Page 1 of 1

Print, Abort, Exit

Posted: Tue Jun 15, 2021 1:11 pm
by davepl
I defined a simple "print error and abort" routine that unfortunately never seems to print anything. Is there anything obviously wrong with this approach?

Thanks!

Code: Select all

inline void DelayedReboot() 
{ 
  Serial.printf("** REBOOT **");
  Serial.flush(); 
  delay(10000); 
  exit(0); 
}  // For catastrophic failure, wait 10 seconds then reboot

Re: Print, Abort, Exit

Posted: Wed Jun 16, 2021 11:01 pm
by rfleming
While I cannot see anything inherently wrong with what you have done, I would recommend posting this on the arduino sub-forum as that would be more appropriate for these functions.

Else if you want to do this with the esp-idf directly you could:

Code: Select all

puts("** REBOOT **");
vTaskDelay(10*1000/portTICK_PERIOD_MS);
esp_restart();