adafruit / Adafruit_LED_Backpack

Adafruit LED Backpack Library for our various LED backpacks.
MIT License
300 stars 192 forks source link

Discrepency between header and cpp files - use of bool vs boolean #66

Closed david-nc closed 2 years ago

david-nc commented 2 years ago

The Adafruit_LEDBackpack.h file has the following function prototypes:

void writeDigitNum(uint8_t x, uint8_t num, bool dot = false); void writeDigitAscii(uint8_t x, uint8_t c, bool dot = false);

while Adafruit_LEDBackpack.cpp has the function definitions:

void Adafruit_7segment::writeDigitNum(uint8_t d, uint8_t num, boolean dot) { void Adafruit_7segment::writeDigitAscii(uint8_t d, uint8_t c, boolean dot) {

The use of bool in the header file and boolean in the cpp file causes compilation errors on some board platforms, specifically the ATTinyCore by Spence Konde, when compiling for an attiny85 using the Arduino IDE version 1.8.16.

/home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.cpp: At global scope: /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.cpp:695:6: error: prototype for 'void Adafruit_7segment::writeDigitNum(uint8_t, uint8_t, boolean)' does not match any in class 'Adafruit_7segment' void Adafruit_7segment::writeDigitNum(uint8_t d, uint8_t num, boolean dot) { ^~~~~ In file included from /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.cpp:38:0: /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.h:376:8: error: candidate is: void Adafruit_7segment::writeDigitNum(uint8_t, uint8_t, bool) void writeDigitNum(uint8_t x, uint8_t num, bool dot = false); ^~~~~ /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.cpp:726:6: error: prototype for 'void Adafruit_7segment::writeDigitAscii(uint8_t, uint8_t, boolean)' does not match any in class 'Adafruit_7segment' void Adafruit_7segment::writeDigitAscii(uint8_t d, uint8_t c, boolean dot) { ^~~~~ In file included from /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.cpp:38:0: /home/test/Arduino/libraries/Adafruit_LED_Backpack_Library/Adafruit_LEDBackpack.h:384:8: error: candidate is: void Adafruit_7segment::writeDigitAscii(uint8_t, uint8_t, bool) void writeDigitAscii(uint8_t x, uint8_t c, bool dot = false); ^~~~~~~

caternuson commented 2 years ago

Please try the 1.3.2 release: https://github.com/adafruit/Adafruit_LED_Backpack/releases/tag/1.3.2

david-nc commented 2 years ago

Thank you for the rapid response. The compiler is no longer flagging an error.