Print, Abort, Exit

davepl
Posts: 29
Joined: Wed Jun 27, 2018 5:29 pm

Print, Abort, Exit

Postby davepl » Tue Jun 15, 2021 1:11 pm

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

rfleming
Posts: 62
Joined: Tue Oct 09, 2018 12:30 am

Re: Print, Abort, Exit

Postby rfleming » Wed Jun 16, 2021 11:01 pm

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();

Who is online

Users browsing this forum: No registered users and 115 guests