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

compile issue on raspberry pi pico #35

Open
goephs opened this issue Nov 30, 2023 · 5 comments
Open

compile issue on raspberry pi pico #35

goephs opened this issue Nov 30, 2023 · 5 comments

Comments

@goephs
Copy link

goephs commented Nov 30, 2023

  • I have been using your library with arduino, STM32 Nucleo 64 F103rb without issues for several years and I love the library!! I was transferring code to raspberry pi Pico and got these compile errors. I'm using visual studio with visual micro extension. Any suggestions to modify the .h file is welcome.

tm1637tinydisplay.cpp:29: In file included from
tm1637tinydisplay.h: 34:6: error: expected unqualified-id before 'const
   34 |   (*(const unsigned char *)(addr)) \\ workaround for non-AVR
   |      ^~~~~
pgmspace.h:116: note  in expansion of macro pgm_read_byte
   116 | static inline unsigned char pgm_read_byte(const void *addr) {
   |                             ^~~~~~~~~~~~~
@jasonacox
Copy link
Owner

This is the header definition:

// Include PROGMEM Support
#include <inttypes.h>
#ifdef __AVR__
#include <avr/pgmspace.h>
#elif defined(ESP8266) || defined(ESP32)
#include <pgmspace.h>
#else
#define pgm_read_byte(addr) \
(*(const unsigned char *)(addr)) // workaround for non-AVR
#endif

Ah, this may be a bug. I don't know that I have a device that would really test that last else case (not AVR and not ESP). Here are some suggestions to try:

  • Try to removing lines 32 to 34. The pgmspace.h you have seems to define pgm_read_byte().
  • Line 33 is doing a \ to push the definition to the next line. That may not be supported. Try moving the contents of line 34 to line 33 (remove the \).

If either of these work, we can update the project to fix that.

@goephs
Copy link
Author

goephs commented Dec 1, 2023 via email

@jasonacox
Copy link
Owner

Thanks @goephs ! I suspect you just needed to remove that #else condition. The formatting in your email didn't come through very well but I think I get the gist.

Let us know if it work on the device.

@goephs
Copy link
Author

goephs commented Dec 3, 2023 via email

@jasonacox
Copy link
Owner

Thanks @goephs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants