Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r8fc97ad09c8cbdf76dc19929c4751df3feacb40d -r696e732c9742535a58b9c65f243df7cd797d1423 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 8fc97ad09c8cbdf76dc19929c4751df3feacb40d) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 696e732c9742535a58b9c65f243df7cd797d1423) @@ -8,7 +8,7 @@ * @file ModeFault.c * * @author (last) Dara Navaei -* @date (last) 12-Jul-2022 +* @date (last) 12-Aug-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -24,6 +24,7 @@ #include "ROPump.h" #include "RTC.h" #include "SystemCommMessages.h" +#include "Utilities.h" #include "UVReactors.h" #include "Valves.h" #include "CPLD.h" @@ -82,6 +83,11 @@ setCPLDCleanLEDColor( CPLD_CLEAN_LED_OFF ); + // Release RTC in case the RTC semaphore was not released prior to transitioning to fault mode. + // In fault mode, the non-volatile data mgmt POST might be run again so the RTC has to be available. Also, + // the RTC time is read every second which requires the semaphore. + releaseSemaphore( SEMAPHORE_RTC ); + return faultState; } @@ -176,8 +182,8 @@ *************************************************************************/ static DG_FAULT_STATE_T handleFaultStartState( void ) { - DG_FAULT_STATE_T state = DG_FAULT_STATE_START; - NVDATAMGMT_RECORDS_READ_STATUS status = getNVRecordsReadStatus(); + DG_FAULT_STATE_T state = DG_FAULT_STATE_START; + NVDATAMGMT_RECORDS_READ_STATUS_T status = getNVRecordsReadStatus(); switch ( status ) {