maxint-rd / TM16xx

Arduino TM16xx library for LED & KEY and LED Matrix modules based on TM1638, TM1637, TM1640 and similar chips. Simply use print() on 7-segment and use Adafruit GFX on matrix.
164 stars 34 forks source link

error: '_BV' was not declared in this scope #28

Open tbillion opened 1 year ago

tbillion commented 1 year ago

C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1630.cpp: In member function 'virtual uint32_t TM1630::getButtons()': C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1630.cpp:77:31: error: '_BV' was not declared in this scope 77 | keys_K2 |= ((((received & _BV(1)) >> 1) | ((received & _BV(4)) >> 3)) << (2 i)); // bit 1 for K2/KS3|5|7 and bit 4 for K2/KS2|4|6|8 | ^~~ C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1628.cpp: In member function 'virtual uint32_t TM1628::getButtons()': C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1628.cpp:98:29: error: '_BV' was not declared in this scope 98 | keys_K1 |= (( (received&_BV(0)) | ((received&_BV(3))>>2)) << (2i)); // bit 0 for K1/KS1 and bit 3 for K1/KS2 | ^~~ C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1637.cpp: In member function 'virtual uint32_t TM1637::getButtons()': C:\Users\LocalAdmin\Documents\Arduino\libraries\TM16xx_LEDs_and_Buttons\src\TM1637.cpp:107:9: error: '_BV' was not declared in this scope 107 | return(_BV((0xFF-received)&0x0F)); // return bit set for the button that is pressed (bits 0-15) | ^~~ exit status 1

maxint-rd commented 1 year ago

Hello @tbillion ,

Thank you for reporting this issue. For what processor are you compiling? What core are you using? I ask this so I can try to reproduce your issue, in order to fix it.

Are you using the latest version on Github? In september 2022 I made a fix for the missing _BV on Raspberry Pi Pico (RP2040). Please note that the last release listed under Releases is quite a bit older (October 2021) and doesn't incorporate this fix yet.

tbillion commented 1 year ago

I am using the philhower pico core , on ide 1.8.19. your library is important because I have a customer board that uses the 3x8 keypad feature of the chip and your library is the only one I've found that supports this . If I can help anyway further please let me know .

On Wed, Nov 16, 2022, 3:36 PM Maxint R&D @.***> wrote:

Hello @tbillion https://github.com/tbillion ,

Thank you for reporting this issue. For what processor are you compiling? What core are you using? I ask this so I can try to reproduce your issue, in order to fix it.

— Reply to this email directly, view it on GitHub https://github.com/maxint-rd/TM16xx/issues/28#issuecomment-1317698687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3MNO737NNNRGAE2NXCL63WIVHWDANCNFSM6AAAAAASCS4IW4 . You are receiving this because you were mentioned.Message ID: @.***>

maxint-rd commented 1 year ago

Hi @tbillion, thank you for the further details. For the library to properly compile on the Pi Pico, you should make sure you are using the latest version, to include the fix I made in september. The added definition of _BV is in the TM16xx,h header file, If I can find some time I'll do another test with my own Pi Pico and publish these latest changes into a new release, to make it easier for people using the Arduino environment.