Index: firmware/App/DDCommon.h =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -5,13 +5,13 @@ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file TDCommon.h +* @file DDCommon.h * -* @author (last) Sean -* @date (last) 26-Aug-2024 +* @author (last) Vinayakam Mani +* @date (last) 06-Aug-2024 * -* @author (original) Sean -* @date (original) 30-Jul-2024 +* @author (original) Vinayakam Mani +* @date (original) 06-Aug-2024 * ***************************************************************************/ Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r262381341fba476bb71f5cf0d67ac2fe17dee9c6 -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 262381341fba476bb71f5cf0d67ac2fe17dee9c6) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -93,6 +93,8 @@ SW_FAULT_ID_INVALID_FPGA_SENSOR_GROUP_SELECTED = 62, SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_GET_RANK = 63, SW_FAULT_ID_INVALID_ALARM_ID_REFERENCED3 = 64, + SW_FAULT_ID_CAN_IN_INVALID_BUFFER = 65, + SW_FAULT_ID_CAN_OUT_INVALID_BUFFER = 66, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -63,6 +63,7 @@ COMM_BUFFER_NOT_USED, ///< Buffer for outgoing HD to PC messages so no response buffer }; + typedef BOOL (*MsgFuncPtr)( MESSAGE_T* ); /// Message handling function lookup table Index: firmware/App/Services/MsgQueues.c =================================================================== diff -u -rf7c714a1a09b10d85a8b013712532d37b4d7b97a -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision f7c714a1a09b10d85a8b013712532d37b4d7b97a) +++ firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -61,7 +61,7 @@ /*********************************************************************//** * @brief - * The addToMsgQueue function adds a message to a given message queue. * + * The addToMsgQueue function adds a message to a given message queue. * @details \b Inputs: none * @details \b Outputs: message added to queue * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when message queue is full Index: firmware/App/Services/SystemCommDD.c =================================================================== diff -u -rf7c714a1a09b10d85a8b013712532d37b4d7b97a -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision f7c714a1a09b10d85a8b013712532d37b4d7b97a) +++ firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -23,8 +23,6 @@ #include "sys_dma.h" #include "Comm.h" -//#include "DrainPump.h" -//#include "Heaters.h" #include "Interrupts.h" #include "OperationModes.h" #include "Messaging.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. @@ -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; Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -19,20 +19,9 @@ #include "lin.h" #include "Messaging.h" -//#include "ConcentratePumps.h" -//#include "DrainPump.h" -//#include "Heaters.h" -//#include "Integrity.h" -//#include "NVDataMgmt.h" #include "OperationModes.h" -//#include "ROPump.h" -//#include "Switches.h" -#include "SystemComm.h" #include "SystemCommDD.h" -#include "Messaging.h" #include "TaskGeneral.h" -//#include "Thermistors.h" -//#include "Voltages.h" #include "WatchdogMgmt.h" /** Index: firmware/source/sys_main.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -rd741f651b63edc7695b2be2178c9e5c44aaed1f3 --- firmware/source/sys_main.c (.../sys_main.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/source/sys_main.c (.../sys_main.c) (revision d741f651b63edc7695b2be2178c9e5c44aaed1f3) @@ -46,51 +46,33 @@ /* USER CODE END */ /* Include Files */ - -#include #include "sys_common.h" /* USER CODE BEGIN (1) */ -#include "system.h" -#include "sys_dma.h" #include "adc.h" #include "can.h" #include "etpwm.h" #include "gio.h" #include "het.h" #include "mibspi.h" -#include "sci.h" #include "rti.h" +#include "sci.h" +#include "system.h" +#include "sys_dma.h" -#include "DDCommon.h" -#include "AlarmMgmt.h" +#include "AlarmMgmtDD.h" #include "CommBuffers.h" -//#include "ConductivitySensors.h" -//#include "ConcentratePumps.h" -//#include "CPLD.h" -//#include "DrainPump.h" -//#include "Fans.h" -//#include "FluidLeak.h" -//#include "FlowSensors.h" -#include "FPGA.h" +#include "DDCommon.h" +#include "FpgaDD.h" #include "Interrupts.h" #include "MsgQueues.h" -//#include "NVDataMgmt.h" #include "OperationModes.h" -//#include "Pressures.h" -//#include "ROPump.h" -//#include "RTC.h" #include "SafetyShutdown.h" -//#include "Switches.h" -#include "SystemComm.h" +#include "SystemCommDD.h" #include "TaskBG.h" -//#include "TemperatureSensors.h" -//#include "Thermistors.h" #include "Timers.h" #include "Utilities.h" -//#include "UVReactors.h" #include "Valves.h" -//#include "Voltages.h" #include "WatchdogMgmt.h" static void initProcessor( void ); @@ -173,28 +155,11 @@ initWatchdogMgmt(); initInterrupts(); initFPGADD(); - //initCPLD(); - //initInternalADC(); - //initFlowSensors(); - //initPressures(); - //initLoadCell(); - //initNVDataMgmt(); initValves(); - //initHeaters(); - //initTemperatureSensors(); - //initConductivitySensors(); - //initConcentratePump(); - //initFans(); - //initThermistors(); - //initVoltagesMonitor(); - //initROPump(); - //initDrainPump(); - //initSwitches(); initCommBuffers(); initMsgQueues(); initSystemComm(); initOperationModes(); - //initIntegrity(); initTestConfigs(); }