duff2013 / Snooze

Teensy Low Power Library
MIT License
134 stars 37 forks source link

USBSerial print and multiple REDUCED_CPU_BLOCKs #86

Open atestani opened 4 years ago

atestani commented 4 years ago

Before I do major surgery on my code, I wanted to ask about doing USBSerial "printing" (i.e. use Serial.print) and REDUCED_CPU_BLOCKS. This is a custom board that is equivalent to a Teensy 3.2 (MK20DX256VLH7) and I am "printing" to a Windows computer over USBserial. I want to run the majority of code at 8MHz but with a 16MHz crystal (already designed into the board and also needed for a different board configuration), it won't compile at anything less than 24MHz so as to get the proper USB clock.

I have gathered up the places where I am using Serial.print into as few a places as I can but there are still a number of them in different routines. So my question is can I use multiple REDUCED_CPU_BLOCKs including within a separate function where there is "8MHz code" and Serial.print statements?

Maybe I am overthinking this and only need to have the reduced blocks around everything except where I instantiate with Serial.begin()?

Thanks Al Testani

duff2013 commented 4 years ago

REDUCED_CPU_BLOCKS is not implemented in the latest code, I'm planning on adding it back in though. Once it is added back yes you can use multiple ones in the same sketch but USBSerial will not work in the REDUCED_CPU_BLOCKS.