Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r46b163d19c65e8c21db7b0247bbb1af0dba1ece5 -r38ae50a0d448d90c876fb9a38f24a488d315e119 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 46b163d19c65e8c21db7b0247bbb1af0dba1ece5) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 38ae50a0d448d90c876fb9a38f24a488d315e119) @@ -8,7 +8,7 @@ * @file SystemComm.c * * @author (last) Dara Navaei -* @date (last) 22-Sep-2022 +* @date (last) 18-Oct-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -55,7 +55,10 @@ #define MSG_NOT_ACKED_MAX_RETRIES 20 ///< Maximum number of times a message that requires ACK that was not ACK'd can be re-sent before alarm #define PENDING_ACK_LIST_SIZE 25 ///< Maximum number of Denali messages that can be pending ACK at any given time - + +#define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm +#define MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< FPGA clock speed error window + #pragma pack(push, 1) /// Record for transmitted message that is pending acknowledgment from receiver. @@ -142,6 +145,9 @@ // Initialize bad message CRC time windowed count initTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC, MAX_COMM_CRC_FAILURES, MAX_COMM_CRC_FAILURE_WINDOW_MS ); + + // Initialize FPGA clock speed error time windowed count + initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR, MAX_FPGA_CLOCK_SPEED_ERRORS, MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS); // Initialize pending ACK list for ( i = 0; i < PENDING_ACK_LIST_SIZE; i++ ) @@ -256,7 +262,7 @@ * @return none *************************************************************************/ void execSystemCommRx( void ) -{ +{ // Parse messages from comm buffers and queue them processIncomingData(); @@ -698,7 +704,7 @@ { BOOL isThereMsgRcvd = TRUE; // Assume TRUE at first to get into while loop MESSAGE_WRAPPER_T message; - + while ( TRUE == isThereMsgRcvd ) { // See if any messages received @@ -1141,6 +1147,10 @@ handleUIServiceModeRequest( message ); break; + case MSG_ID_UI_CONFIRMATION_RESULT: + handleUIConfirmationResponse( message ); + break; + // NOTE: this always must be the last case case MSG_ID_TESTER_LOGIN_REQUEST: handleTesterLogInRequest( message ); @@ -1418,7 +1428,7 @@ handleTestSwitchesPublishIntervalOverrideRequest( message ); break; - case MSG_ID_HD_BATTERY_REMAINING_PERCENT_OVERRIDE: + case MSG_ID_HD_BATTERY_REMAINING_CAP_MWH_OVERRIDE: handleBatteryRemainingPercentOverrideRequest( message ); break; @@ -1650,6 +1660,18 @@ handleTestCurrentTreamtmentParametersRequest( message ); break; + case MSG_ID_HD_BLOOD_PUMP_SET_PWM: + handleTestBloodPumpSetPWM( message ); + break; + + case MSG_ID_HD_DIAL_IN_SET_PWM: + handleTestDialInSetPWM( message ); + break; + + case MSG_ID_HD_DIAL_OUT_SET_PWM: + handleTestDialOutSetPWM( message ); + break; + // The default cannot be reached in VectorCAST since the cases are run in a for loop default: // Unrecognized message ID received - ignore