Cash Bounty for IRRemote IRrecv Port! :) [SOLVED]

I see, thanks for the clarification.

In order to upload it tho’ you may need to notch up the version number higher than the highest already published version.

@ScruffR @mdoan7 I’d really like to get this working. I have tried copying the .h and .cpp files from github into local libraries on Web IDE. I am getting the following build warnings and errors. I am guessing there is a simple explanation for an expert/someone familiar with this code?

lib/IRremote/src/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::interrupt_SIT(action)':
lib/IRremote/src/SparkIntervalTimer.cpp:360:15: warning: variable 'TIMx' set but not used [-Wunused-but-set-variable]
  TIM_TypeDef* TIMx;
               ^
lib/IRremote/src/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::start_SIT(intPeriod, bool)':
lib/IRremote/src/SparkIntervalTimer.cpp:276:23: warning: 'TIMx' may be used uninitialized in this function [-Wmaybe-uninitialized]
  TIM_Cmd(TIMx, ENABLE);
                       ^
lib/IRremote/src/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::stop_SIT()':
lib/IRremote/src/SparkIntervalTimer.cpp:346:18: warning: 'TIMx' may be used uninitialized in this function [-Wmaybe-uninitialized]
  TIM_DeInit(TIMx);
                  ^
lib/IRremote/src/SparkIntervalTimer.cpp: In member function 'void IntervalTimer::resetPeriod_SIT(intPeriod, bool)':
lib/IRremote/src/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(IRremote.o): In function `MATCH':
lib/IRremote/src/SparkIntervalTimer.h:126: multiple definition of `timer_isr()'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/src/IRremote.cpp:133: first defined here
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH(int, int)':
lib/IRremote/src/IRremoteInt.h:186: multiple definition of `MATCH(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/src/IRremote.cpp:51: first defined here
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH_MARK(int, int)':
lib/IRremote/src/IRremoteInt.h:187: multiple definition of `MATCH_MARK(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/src/IRremote.cpp:71: first defined here
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH_SPACE(int, int)':
lib/IRremote/src/IRremoteInt.h:188: multiple definition of `MATCH_SPACE(int, int)'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/src/IRremote.cpp:97: first defined here
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH_SPACE(int, int)':
lib/IRremote/src/SparkIntervalTimer.h:106: multiple definition of `timer'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/functional:2069: first defined here
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH_SPACE(int, int)':
lib/IRremote/src/SparkIntervalTimer.h:106: multiple definition of `irparams'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/functional:2069: first defined here
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `irparams' changed from 420 in ../../../build/target/user/platform-6/libuser.a(IRremote.o) to 412 in ../../../build/target/user/platform-6/libuser.a(IRremote.o)
../../../build/target/user/platform-6/libuser.a(IRremote.o): In function `MATCH_SPACE(int, int)':
lib/IRremote/src/SparkIntervalTimer.h:106: multiple definition of `irout_khz'
../../../build/target/user/platform-6/libuser.a(IRremote.o):/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/functional:2069: first defined here
collect2: error: ld returned 1 exit status
make: *** [842428a73c4493282cc99192e0fe7007669daefa63f8b4c7163e739469c3.elf] Error 1

It seems you got the library (or parts of it) imported twice.

@scruffR Thanks - good steer. Problem was in SparkIntervalTimer.cpp - something odd with the IDE. However, I still have one error. Looks like the copy from github of IRremote.cpp was incomplete.

Yeah, I’m still waiting for when I can upload the v2.0 flavor of this lib to the community share so these issues can stop coming up. Sorry.

1 Like

Hi @mdoan7 - I can help you with the transfer. I’ll send you a PM.

@armor, The v2.0 compliant lib is published now. Point to v0.0.3.

There’s been additional updates to the root lib which I’ll upload shortly. Enjoy.

3 Likes

Which IRRemote library is this? BeanSQ-IRremote - this is showing as version 0.0.1?

Use IRremote 0.0.3.

BeanSQ-iremote 0.0.1 will be merged and ulimately deleted once the library delete function is enabled (I’ve alr day put in a req to the admin to delete this)

That has built fine - which pin should I connect an IR emitter to - it used to be D5 but nothing seems to be generated on that pin?

Try transmit on A5.

Thanks - that works! :grinning:

Where can I find this pin definition - or is it hard coded? Presumably it needs to be on a PWM enabled pin?

It’s hard coded in this version.
See IRremoteInt.h, line 488

#define TIMER_PWM_PIN A5

1 Like

Thanks - any PWM enabled pin will work, right? I am using A5 as SPI/MOSI.

Library uses hardware timers provided by SparkIntervalTimer so typically yes any PWM will satisfy IRremote… unless your application uses additional hardware timers in which case some PWM pin functions may be disabled.
See https://github.com/pkourany/SparkIntervalTimer for details.