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

Failure to compile for Teensy40 #146

Open
robhamerling opened this issue Nov 9, 2023 · 2 comments
Open

Failure to compile for Teensy40 #146

robhamerling opened this issue Nov 9, 2023 · 2 comments

Comments

@robhamerling
Copy link

When building firmware with st7789_mpy for Teensy 4.0 I get the report:

/home/rob/upy/lib/st7789_mpy/st7789/st7789.c: In function 'write_cmd':
/home/rob/upy/lib/st7789_mpy/st7789/st7789.c:74:18: error: comparison between pointer and integer [-Werror]
   74 |     if (self->cs != GPIO_NUM_NC) {     \
      |                  ^~

and many similar lines.

I see in the comments in st7789.c that I may need to change type or value of GPIO_NUM_NC, and for the Teensy it probably needs to be a pointer type, perhaps &(-1) ?
Maybe an '#ifdef" need to be added for the Teensy?

@russhughes
Copy link
Owner

The GPIO_NUM_NC definition needs to be refactored. A quick workaround is to add CFLAGS_EXTRA="-DGPIO_NUM_NC=NULL" to your make command.

@robhamerling
Copy link
Author

With this suggested workaround compilation succeeded and firmware works, thanks.

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