Index: firmware/App/Services/SystemCommDD.c =================================================================== diff -u -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 -r121912c6c7b1d21d5e4f2f8d9386a9f51ee68f1f --- firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) +++ firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision 121912c6c7b1d21d5e4f2f8d9386a9f51ee68f1f) @@ -16,18 +16,16 @@ ***************************************************************************/ #include // for memcpy() -#include #include "can.h" #include "sci.h" #include "sys_dma.h" #include "Comm.h" -//#include "DrainPump.h" -//#include "Heaters.h" #include "Interrupts.h" #include "OperationModes.h" #include "Messaging.h" +#include "SystemCommDD.h" #include "Timers.h" #include "Utilities.h" @@ -46,7 +44,6 @@ #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 - // ********** private data ********** /// Array of out-going CAN buffers. @@ -81,9 +78,9 @@ /*********************************************************************//** * @brief - * The initSystemCommDD function initializes the DD SystemComm module. + * The initSystemCommDD function initializes the DD SystemComm unit. * @details \b Inputs: none - * @details \b Outputs: SystemComm module initialized. + * @details \b Outputs: SystemComm unit initialized. * @return none *************************************************************************/ void initSystemCommDD( void ) @@ -96,7 +93,6 @@ // 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); - } /*********************************************************************//** @@ -178,6 +174,8 @@ * The getInBufferID function gets the buffer ID for a given buffer index. * @details \b Inputs: CAN_IN_BUFFERS[] * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid CAN Input + * buffer is seen. * @param idx incoming buffer index (e.g. 0 indicates first incoming buffer) * @return buffer id associated with given incoming buffer index *************************************************************************/ @@ -192,7 +190,7 @@ } else { - // TODO - s/w fault + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_CAN_IN_INVALID_BUFFER ) } return result; @@ -223,6 +221,8 @@ * The getOutBufferID function gets the buffer ID for a given buffer index. * @details \b Inputs: CAN_OUT_BUFFERS[] * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid CAN Output + * buffer is seen. * @param idx outgoing buffer index (e.g. 0 indicates first outgoing buffer) * @return buffer id associated with given outgoing buffer index *************************************************************************/ @@ -237,7 +237,7 @@ } else { - // TODO - s/w fault + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_CAN_OUT_INVALID_BUFFER ) } return result; @@ -258,7 +258,6 @@ handleIncomingMessage( message ); } - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/