Hi all, I found the FHT Library in the particle repository
particle library search fht
Found 1 library matching fht
ArduinoFHT4 4.0.0 39
Everything went smothly to integrate it with my project following the instruction in the example file, but when I try to compile use any fht function (fht_window()) this error came up:
In file included from /Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/ArduinoFHT4.cpp:9:0:
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h: In member function 'void ArduinoFHT4::process()':
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h:1242:4error: unknown register name 'r23' in 'asm'
);
^
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h:1242:4error: unknown register name 'r22' in 'asm'
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h:1242:4error: unknown register name 'r31' in 'asm'
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h:1242:4error: unknown register name 'r30' in 'asm'
/Users/jaimelabra/Documents/Projects/firmware/Intercom_v3/v10/lib/ArduinoFHT4/src/FHT/FHT.h:1242:4error: unknown register name 'r20' in 'asm'
this is refering to this part of the FHT.h file
asm volatile (
"ldi r28, lo8(fht_input) \n" // set to beginning of data space
"ldi r29, hi8(fht_input) \n"
"ldi r30, lo8(_window_func) \n" // set to beginning of lookup table
"ldi r31, hi8(_window_func) \n"
"clr r15 \n" // prep null register
"ldi r20, " STRINGIFY(((FHT_N)&(0xff))) " \n"
"1: \n"
"lpm r22,z+ \n" // fetch window value
"lpm r23,z+ \n"
"ld r16,y \n" // fetch data
"ldd r17,y+1 \n"
// multiply by window
"fmuls r17,r23 \n"
"movw r4,r0 \n"
"fmul r16,r22 \n"
"adc r4,r15 \n"
"movw r2,r0 \n"
"fmulsu r17,r22 \n"
"sbc r5,r15 \n"
"add r3,r0 \n"
"adc r4,r1 \n"
"adc r5,r15 \n"
"fmulsu r23,r16 \n"
"sbc r5,r15 \n"
"add r3,r0 \n"
"adc r4,r1 \n"
"adc r5,r15 \n"
"st y+,r4 \n" // restore data
"st y+,r5 \n"
"dec r20 \n" // check if done
"brne 1b \n"
: :
: "r0", "r20", "r30", "r31", "r22", "r23" // clobber list <= the error refer to this part
);
Can somebody share some lights how to overcome these error, all help are well appreciate it.
thanks!
Jaime.