I am trying to add support for a 4.2" BW EPaper display to an existing application that has already support for a 2.13" BW display. I am using the GxEPD2 library. I have separately built and tested applications targeted for each size of display and I am now trying to combine the files for each in the same application with conditional compilation to include the relevant files. However, when I add support for the 4.2" display (GxEPD2_420.h/.cpp) to the files and test the compile I am getting an error telling me these files were included and compiled which they should not have been. I have tried Clearing the cache. This is the raw error.
../build/target/user/platform-14-msrc/GxEPD2_420.o src/GxEPD2_420.cpp In file included from src/GxEPD2_420.cpp:1:0: src/GxEPD2_420.h:14:40: error: 'GDEW042T2' is not a member of 'GxEPD2' static const GxEPD2::Panel panel = GxEPD2::GDEW042T2; ^ ../build/module.mk:277: recipe for target '../build/target/user/platform-14-msrc/GxEPD2_420.o' failed
This suggests that whatever I put in as conditional includes is being ignored and it gets included and compiled anyway? As soon as I remove the files it compiles fine. I noticed the same with another library - is there a way around this?