Index: firmware/.cproject
===================================================================
diff -u -r789c1a1b2bfc0e4f8b416bd08c0822babf85d32f -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/.cproject (.../.cproject) (revision 789c1a1b2bfc0e4f8b416bd08c0822babf85d32f)
+++ firmware/.cproject (.../.cproject) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -56,6 +56,7 @@
Index: firmware/App/DGCommon.h
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/DGCommon.h (.../DGCommon.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/DGCommon.h (.../DGCommon.h) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -24,8 +24,6 @@
#ifndef _VECTORCAST_
// #define RM46_EVAL_BOARD_TARGET 1
// #define SIMULATE_UI 1
- #define DEBUG_ENABLED 1
- #define DISABLE_CRC_ERROR 1
#ifdef DEBUG_ENABLED
#include
Index: firmware/App/Modes/ModeFill.c
===================================================================
diff -u -r4fa5628781e2b420cad6afc42a4b754dd484b997 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 4fa5628781e2b420cad6afc42a4b754dd484b997)
+++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -22,24 +22,30 @@
#include "CPLD.h"
#endif
+/**
+ * @addtogroup FillMode
+ * @{
+ */
+
// ********** private definitions **********
#define QUARTER_SECOND 250
#define HALF_SECOND 500
+/// Enumberation of fill mode states.
typedef enum Fill_Mode_States
{
- FILL_MODE_STATE_START = 0,
- FILL_MODE_STATE_CHECK_INLET_WATER,
- FILL_MODE_STATE_CREATE_PRODUCT_WATER,
- FILL_MODE_STATE_DIALYSATE_PRODUCTION,
- FILL_MODE_STATE_DELIVER_DIALYSATE,
- NUM_OF_FILL_MODE_STATES
+ FILL_MODE_STATE_START = 0, ///< Start fill mode state.
+ FILL_MODE_STATE_CHECK_INLET_WATER, ///< Check inlet water state.
+ FILL_MODE_STATE_CREATE_PRODUCT_WATER, ///< Create product water state.
+ FILL_MODE_STATE_DIALYSATE_PRODUCTION, ///< Dialysate production state.
+ FILL_MODE_STATE_DELIVER_DIALYSATE, ///< Deliver dialysate state.
+ NUM_OF_FILL_MODE_STATES ///< Number of fill mode states.
} FILL_MODE_STATE_T;
// ********** private data **********
-static FILL_MODE_STATE_T fillState;
+static FILL_MODE_STATE_T fillState; ///< Currently active fill state.
// ********** private function prototypes **********
@@ -109,7 +115,8 @@
break;
default:
- // TODO - s/w fault
+ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, fillState ) // TODO - add s/w fault enum to 1st data param
+ fillState = FILL_MODE_STATE_START;
break;
}
}
@@ -181,3 +188,5 @@
return result;
}
+
+/**@}*/
Index: firmware/App/Modes/ModeFill.h
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/ModeFill.h (.../ModeFill.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Modes/ModeFill.h (.../ModeFill.h) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
*
@@ -19,6 +19,15 @@
#include "DGCommon.h"
+/**
+ * @defgroup FillMode FillMode
+ * @brief Fill mode module.
+ * Manages fill mode functions via a state machine.
+ *
+ * @addtogroup FillMode
+ * @{
+ */
+
// ********** public definitions **********
// ********** private function prototypes **********
@@ -27,4 +36,6 @@
void transitionToFillMode( void ); // prepares for transition to fill mode
void execFillMode( void ); // execute the fill mode state machine (call from OperationModes)
+/**@}*/
+
#endif
Index: firmware/App/Modes/ModeSolo.h
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/ModeSolo.h (.../ModeSolo.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Modes/ModeSolo.h (.../ModeSolo.h) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2020 Diality Inc. - All Rights Reserved.
*
Index: firmware/App/Modes/ModeStandby.c
===================================================================
diff -u -r4fa5628781e2b420cad6afc42a4b754dd484b997 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 4fa5628781e2b420cad6afc42a4b754dd484b997)
+++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
*
@@ -18,24 +18,30 @@
#include "ModeStandby.h"
#include "CPLD.h"
+/**
+ * @addtogroup StandbyMode
+ * @{
+ */
+
// ********** private definitions **********
+/// Enumeration of standby mode states.
typedef enum Standby_Mode_States
{
- STANDBY_MODE_STATE_START = 0,
- STANDBY_MODE_STATE_IDLE,
- NUM_OF_STANDBY_MODE_STATES
+ STANDBY_MODE_STATE_START = 0, ///< Start standby mode state.
+ STANDBY_MODE_STATE_IDLE, ///< Idle standby mode state.
+ NUM_OF_STANDBY_MODE_STATES ///< Number of standby mode states.
} STANDBY_MODE_STATE_T;
// ********** private data **********
-static STANDBY_MODE_STATE_T standbyState = STANDBY_MODE_STATE_START;
+static STANDBY_MODE_STATE_T standbyState = STANDBY_MODE_STATE_START; ///< Currently active standby state.
// ********** private function prototypes **********
STANDBY_MODE_STATE_T handleStandbyIdleState( void );
-/*************************************************************************
+/*********************************************************************//**
* @brief initStandbyMode
* The initStandbyMode function initializes the Standby Mode module.
* @details
@@ -48,7 +54,7 @@
{
}
-/*************************************************************************
+/*********************************************************************//**
* @brief transitionToStandbyMode
* The transitionToStandbyMode function prepares for transition to standby mode.
* @details
@@ -63,7 +69,7 @@
standbyState = STANDBY_MODE_STATE_START;
}
-/*************************************************************************
+/*********************************************************************//**
* @brief execStandbyMode
* The execStandbyMode function executes the Standby Mode state machine.
* @details
@@ -86,13 +92,13 @@
break;
default:
- SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, standbyState )
+ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, standbyState ) // TODO - add s/w fault enum to 1st data param
standbyState = STANDBY_MODE_STATE_START;
break;
}
}
-/*************************************************************************
+/*********************************************************************//**
* @brief
* The handleStandbyIdleState function executes the Idle state of the \n
* Standby Mode state machine.
@@ -116,3 +122,5 @@
return result;
}
+
+/**@}*/
Index: firmware/App/Modes/ModeStandby.h
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
*
@@ -19,10 +19,21 @@
#include "DGCommon.h"
+/**
+ * @defgroup StandbyMode StandbyMode
+ * @brief Standby mode module.
+ * Manages standby mode functions via a state machine.
+ *
+ * @addtogroup StandbyMode
+ * @{
+ */
+
// ********** private function prototypes **********
void initStandbyMode( void ); // initialize this module
void transitionToStandbyMode( void ); // prepares for transition to standby mode
void execStandbyMode( void ); // execute the standby mode state machine (call from OperationModes)
+/**@}*/
+
#endif
Index: firmware/App/Modes/OperationModes.c
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
*
@@ -29,12 +29,17 @@
#include "ModeSolo.h"
#include "ModeStandby.h"
+/**
+ * @addtogroup OperationModes
+ * @{
+ */
+
// ********** private data **********
-static volatile BOOL modeRequest[NUM_OF_MODES - 1];
-static OP_MODE currentMode = MODE_INIT;
+static volatile BOOL modeRequest[NUM_OF_MODES - 1]; ///< Array of mode request flags.
+static OP_MODE currentMode = MODE_INIT; ///< The currently active mode.
-// this matrix determines legal transitions from one mode to another
+/// This matrix determines legal transitions from one mode to another.
static const OP_MODE MODE_TRANSITION_TABLE[NUM_OF_MODES - 1][NUM_OF_MODES - 1] =
{
// from to-> FAULT SERVICE INIT STANBY STBY-SOLO FILL DRAIN FLUSH DISINFECT
@@ -54,7 +59,7 @@
static OP_MODE arbitrateModeRequest( void );
static void transitionToNewOperationMode( OP_MODE newMode );
-/*************************************************************************
+/*********************************************************************//**
* @brief execOperationModes
* The execOperationModes function initializes the Operation Modes module.
* @details
@@ -89,7 +94,7 @@
initDisinfectMode();
}
-/*************************************************************************
+/*********************************************************************//**
* @brief execOperationModes
* The execOperationModes function executes the Operation Modes state machine.
* @details
@@ -167,7 +172,7 @@
} // end switch
}
-/*************************************************************************
+/*********************************************************************//****
* @brief requestNewOperationMode
* The requestNewOperationMode function initializes the Operation Modes module.
* @details
@@ -190,7 +195,7 @@
}
}
-/*************************************************************************
+/*********************************************************************//**
* @brief getCurrentOperationMode
* The getCurrentOperationMode function initializes the Operation Modes module.
* @details
@@ -204,7 +209,7 @@
return currentMode;
}
-/*************************************************************************
+/*********************************************************************//**
* @brief arbitrateModeRequest
* The arbitrateModeRequest function initializes the Operation Modes module.
* @details
@@ -243,7 +248,7 @@
return reqMode;
}
-/*************************************************************************
+/*********************************************************************//**
* @brief transitionToNewOperationMode
* The transitionToNewOperationMode function initializes the Operation Modes module.
* @details
@@ -285,8 +290,9 @@
transitionToDisinfectMode();
break;
default:
- // TODO - s/w fault
+ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, (U32)newMode ) // TODO - add s/w fault enum to 1st data param
break;
}
}
+/**@}*/
Index: firmware/App/Modes/OperationModes.h
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -1,4 +1,4 @@
-/**************************************************************************
+/**********************************************************************//**
*
* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
*
@@ -19,28 +19,40 @@
#include "DGCommon.h"
+/**
+ * @defgroup OperationModes OperationModes
+ * @brief Operation Modes module.
+ * Manages the top level operation modes of the DG via a state machine.
+ *
+ * @addtogroup OperationModes
+ * @{
+ */
+
// ********** public definitions **********
-typedef enum Op_Modes // These are in order of priority (highest to lowest)
+/// Enumeration of operation modes. These are in order of priority (highest to lowest).
+typedef enum Op_Modes
{
- MODE_FAUL = 0, // Fault
- MODE_SERV, // Service
- MODE_INIT, // Initialization & POST
- MODE_STAN, // Standby - mated to HD
- MODE_SOLO, // Standby - no HD connected
- MODE_FILL, // Fill mode
- MODE_DRAI, // Drain
- MODE_FLUS, // Flush
- MODE_DISI, // Disinfect
- MODE_NLEG, // Not legal
+ MODE_FAUL = 0, ///< Fault mode.
+ MODE_SERV, ///< Service mode.
+ MODE_INIT, ///< Initialization & POST mode.
+ MODE_STAN, ///< Standby mode - connected to HD.
+ MODE_SOLO, ///< Standby Solo mode - no HD connected.
+ MODE_FILL, ///< Fill mode.
+ MODE_DRAI, ///< Drain mode.
+ MODE_FLUS, ///< Flush mode.
+ MODE_DISI, ///< Disinfect mode.
+ MODE_NLEG, ///< Not legal - an illegal mode transition occurred.
NUM_OF_MODES
} OP_MODE;
// ********** public function prototypes **********
void initOperationModes( void ); // initialize this module
-void execOperationModes( void ); // execute the operation modes state machine (scheduled periodic call)
+void execOperationModes( void ); // execute the operation modes state machine (scheduled periodic call)
void requestNewOperationMode( OP_MODE newMode ); // request a transition to a new operation mode
OP_MODE getCurrentOperationMode( void ); // get the current operation mode
+/**@}*/
+
#endif
Index: firmware/App/Services/Reservoirs.c
===================================================================
diff -u -rf6413fefb94be1273323d4193bba3c522cf8ecb4 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision f6413fefb94be1273323d4193bba3c522cf8ecb4)
+++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -232,9 +232,6 @@
}
-/**@}*/
-
-
/*************************************************************************
* TEST SUPPORT FUNCTIONS
*************************************************************************/
@@ -380,3 +377,5 @@
return result;
}
+
+/**@}*/
Index: firmware/App/Services/SystemComm.c
===================================================================
diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision f267c42c91fd6e22db80e19039b8993582de51e9)
+++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -847,9 +847,7 @@
listTimeInMS = calcTimeSince( badCRCTimeStamps[ badCRCListIdx ] );
if ( ( badCRCListCount >= MAX_COMM_CRC_FAILURES ) && ( listTimeInMS <= MAX_COMM_CRC_FAILURE_WINDOW_MS ) )
{
-#ifndef DISABLE_CRC_ERROR
activateAlarmNoData( ALARM_ID_COMM_TOO_MANY_BAD_CRCS );
-#endif
}
}
Index: firmware/App/Services/WatchdogMgmt.c
===================================================================
diff -u -rb64c49fdcf2b6d95e61e63f8e258c4e600935bbd -rf43eb1e9e0803776ec7420b16e1db8760b020bd9
--- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision b64c49fdcf2b6d95e61e63f8e258c4e600935bbd)
+++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9)
@@ -15,7 +15,6 @@
**************************************************************************/
#include "CPLD.h"
-#include "SafetyShutdown.h"
#include "SystemCommMessages.h"
#include "Timers.h"
#include "WatchdogMgmt.h"
@@ -112,7 +111,6 @@
if ( WATCHDOG_SELF_TEST_STATE_COMPLETE == watchdogSelfTestState )
{
#ifndef DEBUG_ENABLED
- activateSafetyShutdown(); // TODO - restore these - commented out now so that we don't get WD error with breakpoints while debugging
activateAlarmNoData( ALARM_ID_WATCHDOG_EXPIRED );
#endif
}