Open lockencopp opened 2 years ago
Fixed by appending
target_compile_definitions(
lib-st7735
PUBLIC
PIN_TFT_RST=${SPI_TFT_RST}
PIN_TFT_DC=${SPI_TFT_DC}
PIN_TFT_CS=${SPI_TFT_CS}
)
to parent CMakeLists.txt
Strange, but I will check. According to the CMake documentation everything I add with add_compile_definition
is propagated to all targets. So your code would be redundant. And I use this library in various projects and I never encountered any problems.
can confirm. lost a day to this + forgetting to tie my backlight pin to high
target_compile_definitions(
st7735
PUBLIC
PIN_TFT_RST=${SPI_TFT_RST}
PIN_TFT_DC=${SPI_TFT_DC}
PIN_TFT_CS=${SPI_TFT_CS}
)
stick it in your demo CMakeLists.txt
thanks for the library!
Are you using the newest version and the new version of the demo?
BTW, to cite the c-make documentation: "The preprocessor definitions are added to the COMPILE_DEFINITIONS directory property for the current CMakeLists file. They are also added to the COMPILE_DEFINITIONS target property for each target in the current CMakeLists file."
Oh for christ's sake, lost 30 minutes due to this. I am new to RP2040 so I'm not passing blame, thanks for the fix @cedric-h !
Configuring Cmake defines for pins are not passed to hw.h, making it impossible to configure pins through this mechanism.