Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r8e366c26b98be701b93f6d224955fae41b96b0aa -r1145e9197855b4f2cb79eb407d3899059b0ca410 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 8e366c26b98be701b93f6d224955fae41b96b0aa) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 1145e9197855b4f2cb79eb407d3899059b0ca410) @@ -320,6 +320,7 @@ static void consumeUnexpectedData( void ); static void monitorFPGAPowerStatus( void ); static BOOL checkFPGACommFailure( void ); +static BOOL checkFPGAFEOEFailure( void ); /*********************************************************************//** * @brief @@ -519,6 +520,9 @@ { fpgaReadByteSize = sizeof( FPGA_SENSORS_T ); + // Check if FE or OE error has occurred + checkFPGAFEOEFailure(); + // FPGA incoming state machine switch ( fpgaState ) { @@ -568,6 +572,9 @@ { fpgaReadByteSize = sizeof( FPGA_SENSORS_T ); + // Check if FE or OE error has occurred + checkFPGAFEOEFailure(); + // FPGA outgoing state machine switch ( fpgaState ) { @@ -2353,4 +2360,35 @@ } +/*********************************************************************//** + * @brief + * The checkFPGACommFailure function increments the FPGA comm failure + * windowed timer if an FE or OE error has occurred and returns whether + * or not the number of failures in + * the window have been reached. + * @details Inputs: none + * @details Outputs: none + * @return TRUE if windowed count exceeded, else false. + *************************************************************************/ +static BOOL checkFPGAFEOEFailure( void ) +{ + BOOL status = false; + BOOL FPGAFEOEError = getSci2FEOEError(); + + if ( TRUE == FPGAFEOEError) + { + if ( getMSTimerCount() > MIN_POWER_ON_TIME_FOR_COMM_FAILS ) + { + if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.errorCountProcessor ) + status = TRUE; + } + } + } + + return status; + +} + /**@}*/