My tests involved using the following settings in defs.h:
Code:
-DSERIAL1_RX_BUFFER_SIZE=345
-DSERIAL1_TX_BUFFER_SIZE=123
-DF_CPU=144000000
The test code was simply:
Code:
void setup() {
Serial.begin(115200);
elapsedMillis waiting;
while (!Serial && waiting < 1000) {} // Wait for output //
Serial.print("*** init ***");
#ifdef SERIAL1_RX_BUFFER_SIZE
Serial.print("SERIAL1_RX_BUFFER_SIZE: " + String(SERIAL1_RX_BUFFER_SIZE));
#endif
#ifdef SERIAL1_TX_BUFFER_SIZE
Serial.print("SERIAL1_TX_BUFFER_SIZE: " + String(SERIAL1_TX_BUFFER_SIZE));
#endif
#ifdef F_CPU
Serial.print("F_CPU: " + String(F_CPU));
#endif
}
Tested on Mac platform using T3.6 and T4. Both responded with the correct values output.
Next, I tried to verify a different project, not using the defs.h key-value file and got errors. It made me think that the bash script was not working, it's function being to create the file if not present. I checked the platform.txt file above and found the macosx line was commented out! Removing the # comment fixed it, and now projects can be build whether or not they have an associated defs.h file or not. Yay! See attached:platform.txt
I think this solution is amazing and I'm surprised it has so few takers. I can only think that folks don't realise how simple-to-use and powerful it really is.
Many thanks @Frank B for building a project-level override for system settings.