Is there a way to set a compiler flag to disable serial ports ?
Suppose i want to KEEP Serial0, but i want to make my own serial interrupt for S1, S2, and S3
Or have my own serial interrupt for S0, but use S1 as a debug port, with serial libray active
At different times it will be Mega2560, uno, w 168, or 328, or maybe even my own board with a 644 processor.
So, it will be 'random' combinations of serial libray active at different projects.
You will have to check, but I think ISR's using 'ISR()' should have the 'weak' attribute set by default.
If its not set, you could add 'attribute((weak))' to the core versions, and implement your own versions in the sketch.
This might not work, but is how the AVR core defines its interrupts so they all point to the bad_vector ISR, unless you provide your own version.
So far i have resolved it by editing hardwareserial.cpp
it has the drawback, that i MUST remember to use the proper hardwareserial and copy the correct one into the libfolder
majenko:
what about board variants - can i set it in boards.txt ?
what will happen if i need s2, and s3 by hardwareserial - but s0 and s1 must be controlled by my own interrupt ?
pYro_65
I would rather have some kind of
/#define disable_serial0 ... kind of thing