Glad to hear it works okay.
Gave me an idea to do an utility component for esp32 with some of these type 'commands' in it.
I did a small trial:
Restart() - restart the MCU
RegisterShutdownHandler(addr of macro) - macro to be called before restart (see demo)
UnRegisterShudownHandler(addr of macro) - unregister a shutdownhandler
GetRestartReason() - 1 is power on, 3 is Restart() called (there are others though I didn't look them up)
GetFreeHeapSize() - get some memory stats
GetMinimumHeapSize()
GetFreeInternalHeapSize()
Need to add the fcpx file to component directory (Global Options->Locations->Search For Components in)
Demo - is very simple and just displays the values from each routine. - then uses a ShutDownHandler to do a 5s countdown to a restart...
Any ideas on 'useful' macros (I just used a handful from the link above)
Martin