olikraus / ucglib

Arduino True Color Library for TFTs and OLEDs
https://github.com/olikraus/ucglib/wiki
Other
261 stars 76 forks source link

__NOP problem when using with stm32duino and platformio #160

Closed developer-ken closed 1 year ago

developer-ken commented 1 year ago

When compiling with platformio with stm32duino, I got the following error:

.pio\libdeps\genericSTM32F103CB\Ucglib\src\Ucglib.cpp:834:3: error: '__NOP' was not declared in this scope  
  834 |   __NOP;  
      |   ^~~~~  
Compiling .pio\build\genericSTM32F103CB\libdb5\Ucglib\clib\ucg_dev_ic_ili9325.c.o  
*** [.pio\build\genericSTM32F103CB\libdb5\Ucglib\Ucglib.cpp.o] Error 1  

One wokaround will be copy the defination from cmsis_gcc.h with a little modification(NOP() -> NOP):
#define __NOP __ASM volatile ("nop")

It would be nice if this problem can be addressed from upstream(here) rather than do that modify manualy whenever I compile the project on a new envirounment. (That makes pio download a fresh ucglib).

developer-ken commented 1 year ago

Oh this is dumplicate, see PR #149