IRMP-org/IRMP

Defining NO_LED_FEEDBACK_CODE breaks compiliation

eku opened this issue · 11 comments

eku commented

Bug Report

Board

  • ESP8266 board

IDE

  • PlatformIO IDE

Example to reproduce the issue

  • Other

Version

Current behavior

#define IRMP_IRSND_ALLOW_DYNAMIC_PINS 1
#define USE_ONE_TIMER_FOR_IRMP_AND_IRSND 1
#define NO_LED_FEEDBACK_CODE
#include <irmp.hpp>
#include <irsnd.hpp>

Compile error

lib/lib_div/IRMP/src/irmpArduinoExt.hpp: In function 'void irmp_init(uint_fast8_t, uint_fast8_t, bool)':
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:35:5: error: 'irmp_irsnd_LedFeedbackPin' was not declared in this scope
     irmp_irsnd_LedFeedbackPin = aFeedbackLedPin;
     ^
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:36:5: error: 'irmp_irsnd_LedFeedbackPinIsActiveLow' was not declared in this scope
     irmp_irsnd_LedFeedbackPinIsActiveLow = aIrmpLedFeedbackPinIsActiveLow;
     ^
lib/lib_div/IRMP/src/irmpArduinoExt.hpp: In function 'void irmp_init(uint_fast8_t, uint_fast8_t)':
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:59:47: error: 'irmp_irsnd_LedFeedbackPinIsActiveLow' was not declared in this scope
     irmp_init(aIrmpInputPin, aFeedbackLedPin, irmp_irsnd_LedFeedbackPinIsActiveLow);

checklist:

  • I have read the README.md file thoroughly.
  • I have searched existing issues to see if there is anything I have missed.
  • [] I have browsed the examples for one, that matches my use case.
  • Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • The title of the issue is helpful and relevant.
  • [] I checked, if at least one of the examples was working.

** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**

eku commented

Thanks for quick response.

If NO_LED_FEEDBACK_CODE is defined, irmp_irsnd_LEDFeedback should not be available, as used in OneProtocol.ino.

Still compile errors

lib/lib_div/IRMP/src/irsndArduinoExt.hpp:70:33: error: 'irmp_irsnd_LedFeedbackPin' was not declared in this scope
     irsnd_init(aIrsndOutputPin, irmp_irsnd_LedFeedbackPin, irmp_irsnd_LedFeedbackPinIsActiveLow);
                                 ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:70:60: error: 'irmp_irsnd_LedFeedbackPinIsActiveLow' was not declared in this scope
     irsnd_init(aIrsndOutputPin, irmp_irsnd_LedFeedbackPin, irmp_irsnd_LedFeedbackPinIsActiveLow);
                                                            ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp: In function 'void irsnd_on()':
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:109:13: error: 'irmp_irsnd_LedFeedbackEnabled' was not declared in this scope
         if (irmp_irsnd_LedFeedbackEnabled)
             ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:112:43: error: 'irmp_irsnd_SetFeedbackLED' was not declared in this scope
             irmp_irsnd_SetFeedbackLED(true);
                                           ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp: In function 'void irsnd_off()':
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:140:13: error: 'irmp_irsnd_LedFeedbackEnabled' was not declared in this scope
         if (irmp_irsnd_LedFeedbackEnabled)
             ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:143:44: error: 'irmp_irsnd_SetFeedbackLED' was not declared in this scope
             irmp_irsnd_SetFeedbackLED(false);

Thanks for reporting !!! 🥇

eku commented

Still compile errors, even with 62c8689.

You mean this Must not be enabled ?

USE_ONE_TIMER_FOR_IRMP_AND_IRSND disabled Must be defined if you use receiving and sending simultaneously, since both use the same timer resource. Must not be enabled if you only use receiving.
eku commented

I use the receiver and sender simultaneously, so I defined USE_ONE_TIMER_FOR_IRMP_AND_IRSND. I hope I got that one right.

Compile errors still come from defining NO_LED_FEEDBACK_CODE.

lib/lib_div/IRMP/src/irsndArduinoExt.hpp: In function 'void irsnd_on()':
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:121:13: error: 'irmp_irsnd_LedFeedbackEnabled' was not declared in this scope
         if (irmp_irsnd_LedFeedbackEnabled)
             ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:124:43: error: 'irmp_irsnd_SetFeedbackLED' was not declared in this scope
             irmp_irsnd_SetFeedbackLED(true);
                                           ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp: In function 'void irsnd_off()':
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:150:13: error: 'irmp_irsnd_LedFeedbackEnabled' was not declared in this scope
         if (irmp_irsnd_LedFeedbackEnabled)
             ^
lib/lib_div/IRMP/src/irsndArduinoExt.hpp:153:44: error: 'irmp_irsnd_SetFeedbackLED' was not declared in this scope
             irmp_irsnd_SetFeedbackLED(false);

I amended the last commit, so you must get the sources again.

eku commented

git pull says Bereits aktuell..

Sorry sorry! I checked the wrong example.

Hi Erik,
can you test it again, before I release the hotfix.
Thanks!

eku commented

Both IRMP and IRSND compile with NO_LED_FEEDBACK_CODE.

I think I have seen potential for optimisation. Possibly make the including of headers dependent on this. But it's up to you.

Thanks 👍
Code size optimisations are always welcome 😀