Index: firmware/App/Modes/ModeService.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -51,7 +51,6 @@ setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); - } /*********************************************************************//** @@ -63,7 +62,6 @@ *************************************************************************/ U32 execServiceMode( void ) { - return 0; // TODO - return current state } Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -234,6 +234,8 @@ SW_FAULT_ID_AIR_TRAP_INVALID_STATE, SW_FAULT_ID_AIR_TRAP_INVALID_LEVEL_SENSOR, // 90 SW_FAULT_ID_DIALYSIS_INVALID_SALINE_BOLUS_STATE, + SW_FAULT_ID_SYSTEM_COMM_INVALID_FRAME_SIZE, + SW_FAULT_ID_SYSTEM_CMMM_CAN_TRANSMIT_REJECTED, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r42d74314fb54739936fb9d24d6245613cfab26a0 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 42d74314fb54739936fb9d24d6245613cfab26a0) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -392,7 +392,7 @@ fpgaDMAReadRespControlRecord.FRDOFFSET = 0; // Not used fpgaDMAReadRespControlRecord.FRSOFFSET = 0; // Not used - // There shouldn't be any data pending yet + // There should not be any data pending yet consumeUnexpectedData(); } @@ -1069,7 +1069,7 @@ *************************************************************************/ void setAlarmAudioState( ALARM_PRIORITY_T state, U32 volumeLevel ) { - if ( ( ( state < NUM_OF_ALARM_PRIORITIES ) && ( volumeLevel ) ) <= MAX_ALARM_VOLUME_ATTENUATION ) + if ( ( state < NUM_OF_ALARM_PRIORITIES ) && ( volumeLevel <= MAX_ALARM_VOLUME_ATTENUATION ) ) { U08 audioCmd = (U08)state; Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r42d74314fb54739936fb9d24d6245613cfab26a0 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 42d74314fb54739936fb9d24d6245613cfab26a0) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -282,7 +282,7 @@ // Check for sub-system comm timeouts checkForCommTimeouts(); - // Check ACK list for messages that need to be re-sent because they haven't been ACK'd + // Check ACK list for messages that need to be re-sent because they have not been ACK'd checkPendingACKList(); } @@ -296,7 +296,7 @@ *************************************************************************/ void execSystemCommTx( void ) { - // Do not bother with transmitting if no other nodes on CAN bus + // Do not transmit if no other nodes on CAN bus if ( FALSE == hdIsOnlyCANNode ) { // If CAN transmitter is idle, start transmitting any pending packets @@ -306,7 +306,7 @@ } else { - // Generally, transmitter should not be busy at time of this function call - check timeout just in case so we don't get stuck waiting forever + // Generally, transmitter should not be busy at time of this function call - check timeout just in case so we do not get stuck waiting forever if ( TRUE == didTimeout( lastCANPacketSentTimeStamp, CAN_XMIT_PACKET_TIMEOUT_MS ) ) { // Assume last packet was not successfully transmitted. Re-send last packet. @@ -647,13 +647,12 @@ else { signalCANXmitsCompleted(); - // TODO - should not get here, but let's see if we do - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, (U32)mBox ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_SYSTEM_CMMM_CAN_TRANSMIT_REJECTED, (U32)mBox ) } } else - { // TODO - should not get here - just testing - set first data to new s/w fault enum later - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, (U32)buffer, (U32)dataSize ) + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_SYSTEM_COMM_INVALID_FRAME_SIZE, ((U32)buffer << 16) | dataSize ) } } @@ -721,7 +720,7 @@ { U32 numOfBytesInBuffer; - // Assume false so we don't get stuck in loop - only set to true if we find another complete message in buffer + // Assume false so we do not get stuck in loop. Set to true only if we find another complete message in buffer messagesInBuffer = FALSE; // Since messages can have 8-byte alignment padding left unconsumed by last get, get padding out of buffer @@ -733,7 +732,7 @@ U32 bytesPeeked = peekFromCommBuffer( MSG_IN_BUFFERS[ i ], data, MIN( numOfBytesInBuffer, sizeof( MESSAGE_WRAPPER_T ) + 1 ) ); S32 msgSize = parseMessageFromBuffer( data, bytesPeeked ); - hdIsOnlyCANNode = FALSE; // If we are getting a message, we cannot be alone + hdIsOnlyCANNode = FALSE; // Since we are getting a message, this indicates we are not the only node on the CAN bus canXmitRetryCtr = 0; if ( msgSize > 0 ) // Valid, complete message found? @@ -799,7 +798,7 @@ U08 data; U32 numOfBytesInBuffer = numberOfBytesInCommBuffer( buffer ); - // Consume bytes out of buffer 1 at a time until we find the sync byte or it's empty + // Consume bytes out of buffer 1 at a time until we find the sync byte or it is empty while ( numOfBytesInBuffer > 0 ) { peekFromCommBuffer( buffer, &data, 1 ); @@ -848,7 +847,7 @@ msgSize = MESSAGE_OVERHEAD_SIZE + payloadSize; // We now know the size of the message - we can now know if full message is contained in buffer if ( msgSize <= remSize ) - { // Check CRC to make sure it's a valid message + { // Check CRC to make sure it is a valid message if ( data[i+msgSize] == crc8( &data[pos], msgSize - 1 ) ) { result = msgSize; // We found a complete, valid message of this size Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -2049,7 +2049,7 @@ /*********************************************************************//** * @brief - * The handleDGOpMode function handles a DG broadcast of it's current mode. + * The handleDGOpMode function handles a DG broadcast of its current mode. * @details Inputs: none * @details Outputs: message handled, response constructed and queued for transmit. * @param message a pointer to the message to handle. Index: firmware/App/Tasks/TaskBG.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r911f6526ec3ba03ba0131681c7fb371c0abda6bb --- firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 911f6526ec3ba03ba0131681c7fb371c0abda6bb) @@ -50,7 +50,7 @@ { startUICommTimeout = getMSTimerCount(); -#ifndef _VECTORCAST_ // Can't have infinite loop in unit test tool +#ifndef _VECTORCAST_ // Cannot have infinite loop in unit test tool while ( 1 ) #endif {