Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tbillion opened this issue Nov 16, 2022 · 3 comments
Open

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

tbillion opened this issue Nov 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@tbillion
Copy link

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)) << (2*i)); // 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
Copy link
Owner

maxint-rd commented Nov 16, 2022

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.

@maxint-rd maxint-rd self-assigned this Nov 16, 2022
@maxint-rd maxint-rd added bug Something isn't working question Further information is requested labels Nov 16, 2022
@tbillion
Copy link
Author

tbillion commented Nov 17, 2022 via email

@maxint-rd
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants