I have three prototype boards that I built, but one is an oddball in that the ESP32S3 I used had some non-functioning GPIOs as a result of soldering/unsoldering/soldering, so I had to move those signals to other pins. I want to use the same code base for these boards.
I thought about using a #ifdef, #elif, #else directives with a couple of #defines in the main .ino file. However, I have to comment/uncomment the correct #define for each board before I compile and upload. Seems fraught with potential for error. Is there a better way?
For example, in main.ino, I have to comment out one of these before each compile/upload depending on the board.
#define Board_Type_A
#define Board_Type_B
rotary_encoder.h
#ifdef Board_Type_A
byte pin[] = {8,3,9,5,6,17,16}; // Seven segment pin is connected to GPIO pins: 8,3,48,5,42,38,39 to a,b,c,d,e,f,g
#elif defined(Board_Type_B)
byte pin[] = {8,3,48,5,42,38,39}; // Seven segment pin is connected to GPIO pins: 8,3,48,5,42,38,39 to a,b,c,d,e,f,g
#endif
Thanks!