Does Serial.flush() actually block until all the bytes are transfered when configured for RAWHID or Serial for that matter? I'm having a problem where if I'm send a string, call Serial.flush() then go to sleep the serial transmission gets cut off before it's done sending or doesn't send at all indicating that the flush is not waiting for all the bytes to send before moving on. I have to put in delay before sleeping. I thought this was fixed some time ago?
Code:
#include <LowPower_Teensy3.h>
TEENSY3_LP LP = TEENSY3_LP();
void callbackhandler() {
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
}
void setup() {
delay(2000);
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(0, INPUT_PULLUP);
attachInterrupt(0, callbackhandler, RISING);
}
void loop() {
Serial.println("abcdefghijklmnopqrstuvwxyz1234567890");
Serial.flush();
//delay(100);[COLOR=#ff0000] //Need this to print to serial monitor before sleeping![/COLOR]
LP.Sleep();
}