When my application detects a power fail I’d like to ‘kill’ the RTOS ( stop all tasks ) so that 100% micro processing resource is available for PF Code. Probably there is no graceful way for code execution to reach PF Code ? I need to execute PF Code directly following execution of code at a certain point within the low priority task that is fully responsible for non volatile storage access ( I’d like to ‘kill’ the RTOS from this task ).
/* Finally start the scheduler. */
/* PF Code: ( all tasks and RTOS are now 'dead' )
/* Save all my data to non volatile storage */
/* Force a micro reset */
/* Will only reach here if there is insufficient heap available to start
the scheduler. */