Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r80a6638b362f5f613c0665200023d181f614d1bc -r632b2d868efba2aca7c694a9ff648753804a9671 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 80a6638b362f5f613c0665200023d181f614d1bc) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 632b2d868efba2aca7c694a9ff648753804a9671) @@ -335,10 +335,10 @@ static FPGA_SENSORS_ASYNC_T fpgaSensorReadingsAsync; ///< Record of last received async (as needed) FPGA sensor data. #endif -#ifndef DEBUG_ENABLED +//#ifndef DEBUG_ENABLED TODO: uncomment it DN-15SEPT2022 static U16 currentFPGATimerCount_ms; ///< Current FPGA timer count in ms. static U32 currentTimerCount_ms; ///< Current processor timer count in ms. -#endif +//#endif // ********** private function prototypes ********** @@ -972,11 +972,14 @@ U32 const diffFPGATimerCount = (U32)u16DiffWithWrap( currentFPGATimerCount_ms, newFPGATimerCount_ms ); U32 const diffTimerCount = u32DiffWithWrap( currentTimerCount_ms, newTimerCount_ms ); - if ( getCurrentOperationMode() > MODE_INIT ) + if ( getCurrentOperationMode() != MODE_INIT ) { if ( abs( diffFPGATimerCount - diffTimerCount ) > PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR ) ) + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + } } }