IRMP-org / IRMP

Infrared Multi Protocol Decoder
GNU General Public License v3.0
267 stars 43 forks source link

Defining NO_LED_FEEDBACK_CODE breaks compiliation #70

Closed eku closed 2 years ago

eku commented 2 years ago

Bug Report

Board

IDE

Example to reproduce the issue

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:

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 2 years ago

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);
ArminJo commented 2 years ago

Thanks for reporting !!! 🥇

eku commented 2 years ago

Still compile errors, even with 62c8689faf036899462709cc1a017f3fb9943539.

ArminJo commented 2 years ago

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 2 years ago

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);
ArminJo commented 2 years ago

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

eku commented 2 years ago

git pull says Bereits aktuell..

ArminJo commented 2 years ago

Sorry sorry! I checked the wrong example.

ArminJo commented 2 years ago

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

eku commented 2 years ago

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.

ArminJo commented 2 years ago

Thanks 👍 Code size optimisations are always welcome 😀