That’s weird - I could have sworn there was! lemme check!
Hmm… Right you are Moors7 - I had pasted the same file twice.
As you suggested I deleted the project and started again, carefully pasting all the code for IRremote.h, IRremote.cpp,IRremoteInt.h. I left IRremoteInt.cpp blank since there is no code for this file - do I remove it? Tried that before and it didn’t work so this time I left it in.
I included the SparkIntervalTimer library using the IDE… then changed all the includes to #include “SparkIntervalTimer/SparkIntervalTimer.h”
But it still throws errors at me. I was really hoping this would save me some time
Here are the errors:
In file included from iragain.cpp:5:0:
IRremoteInt.h: In function 'int MATCH(int, int)':
IRremoteInt.h:182:41: error: 'USECPERTICK' was not declared in this scope
#define TICKS_LOW(us) (int) (((us)*LTOL/USECPERTICK))
^
IRremoteInt.h:186:58: note: in expansion of macro 'TICKS_LOW'
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
^
IRremoteInt.h: In function 'int MATCH_MARK(int, int)':
IRremoteInt.h:187:96: error: 'MARK_EXCESS' was not declared in this scope
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
^
IRremoteInt.h: In function 'int MATCH_SPACE(int, int)':
IRremoteInt.h:188:97: error: 'MARK_EXCESS' was not declared in this scope
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
^
IRremoteInt.h: At global scope:
IRremoteInt.h:204:23: error: 'RAWBUF' was not declared in this scope
unsigned int rawbuf[RAWBUF]; // raw data
^
IRremoteInt.h: In function 'int MATCH(int, int)':
IRremoteInt.h:186:112: warning: control reaches end of non-void function [-Wreturn-type]
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
^
IRremoteInt.h: In function 'int MATCH_MARK(int, int)':
IRremoteInt.h:187:110: warning: control reaches end of non-void function [-Wreturn-type]
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
^
IRremoteInt.h: In function 'int MATCH_SPACE(int, int)':
IRremoteInt.h:188:111: warning: control reaches end of non-void function [-Wreturn-type]
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
^
make[1]: *** [../build/target/user/platform-6iragain.o] Error 1
make: *** [user] Error 2
If I remove the empty file IRremoteInt.cpp and re-add the #include “IRremoteInt.h” which gets deleted when you remove the file it gives me other errors:
SparkIntervalTimer/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::interrupt_SIT(action)':
SparkIntervalTimer/SparkIntervalTimer.cpp:360:15: warning: variable 'TIMx' set but not used [-Wunused-but-set-variable]
TIM_TypeDef* TIMx;
^
SparkIntervalTimer/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::start_SIT(intPeriod, bool)':
SparkIntervalTimer/SparkIntervalTimer.cpp:276:23: warning: 'TIMx' may be used uninitialized in this function [-Wmaybe-uninitialized]
TIM_Cmd(TIMx, ENABLE);
^
SparkIntervalTimer/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::stop_SIT()':
SparkIntervalTimer/SparkIntervalTimer.cpp:346:18: warning: 'TIMx' may be used uninitialized in this function [-Wmaybe-uninitialized]
TIM_DeInit(TIMx);
^
SparkIntervalTimer/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::resetPeriod_SIT(intPeriod, bool)':
SparkIntervalTimer/SparkIntervalTimer.cpp:476:23: warning: 'TIMx' may be used uninitialized in this function [-Wmaybe-uninitialized]
TIMx->PSC = prescaler;
^
../../../build/target/user/platform-6/libuser.a(iragain.o): In function `MATCH_SPACE(int, int)':
IRremoteInt.h:186: multiple definition of `MATCH(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):IRremoteInt.h:186: first defined here
../../../build/target/user/platform-6/libuser.a(iragain.o): In function `MATCH_MARK(int, int)':
IRremoteInt.h:187: multiple definition of `MATCH_MARK(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):IRremoteInt.h:187: first defined here
../../../build/target/user/platform-6/libuser.a(iragain.o): In function `MATCH_SPACE(int, int)':
IRremoteInt.h:188: multiple definition of `MATCH_SPACE(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):IRremoteInt.h:188: first defined here
collect2: error: ld returned 1 exit status
make: *** [48f160b9402f2346b447fa07ef40c405990088653777ba7deff177956635.elf] Error 1