Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rd91a24c730aeb5cd7e3eba9ef4eca78e442911f8 -r37a8a58b766a496b39241dd7ae46dc10dbda35e4 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision d91a24c730aeb5cd7e3eba9ef4eca78e442911f8) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 37a8a58b766a496b39241dd7ae46dc10dbda35e4) @@ -193,9 +193,8 @@ /*********************************************************************//** * @brief * The initBloodFlow function initializes the BloodFlow module. - * @details - * Inputs : none - * Outputs : BloodFlow module initialized. + * @details Inputs: none + * @details Outputs: BloodFlow module initialized. * @return none *************************************************************************/ void initBloodFlow( void ) @@ -218,9 +217,8 @@ * @brief * The setBloodPumpTargetFlowRate function sets a new target flow rate and * pump direction. - * @details - * Inputs : isBloodPumpOn, bloodPumpDirectionSet - * Outputs : targetBloodFlowRate, bloodPumpdirection, bloodPumpPWMDutyCyclePct + * @details Inputs: isBloodPumpOn, bloodPumpDirectionSet + * @details Outputs: targetBloodFlowRate, bloodPumpdirection, bloodPumpPWMDutyCyclePct * @param flowRate new target blood flow rate * @param dir new blood flow direction * @param mode new control mode @@ -285,9 +283,8 @@ /*********************************************************************//** * @brief * The signalBloodPumpHardStop function stops the blood pump immediately. - * @details - * Inputs : none - * Outputs : Blood pump stopped, set point reset, state changed to off + * @details Inputs: none + * @details Outputs: Blood pump stopped, set point reset, state changed to off * @return none *************************************************************************/ void signalBloodPumpHardStop( void ) @@ -305,9 +302,8 @@ * The signalBloodPumpRotorHallSensor function handles the blood pump rotor * hall sensor detection. Calculates rotor speed (in RPM). Stops pump if * there is a pending request to home the pump. - * @details - * Inputs : bpRotorRevStartTime, bpStopAtHomePosition - * Outputs : bpRotorRevStartTime, bloodPumpRotorSpeedRPM + * @details Inputs: bpRotorRevStartTime, bpStopAtHomePosition + * @details Outputs: bpRotorRevStartTime, bloodPumpRotorSpeedRPM * @return none *************************************************************************/ void signalBloodPumpRotorHallSensor( void ) @@ -330,9 +326,8 @@ /*********************************************************************//** * @brief * The homeBloodPump function initiates a blood pump home operation. - * @details - * Inputs : bloodPumpState - * Outputs : bpStopAtHomePosition, bpHomeStartTime, blood pump started (slow) + * @details Inputs: bloodPumpState + * @details Outputs: bpStopAtHomePosition, bpHomeStartTime, blood pump started (slow) * @return none *************************************************************************/ BOOL homeBloodPump( void ) @@ -352,9 +347,8 @@ /*********************************************************************//** * @brief * The execBloodFlowMonitor function executes the blood flow monitor. - * @details - * Inputs : none - * Outputs : measuredBloodFlowRate, adcBloodPumpMCSpeedRPM, adcBloodPumpMCCurrentmA + * @details Inputs: none + * @details Outputs: measuredBloodFlowRate, adcBloodPumpMCSpeedRPM, adcBloodPumpMCCurrentmA * @return none *************************************************************************/ void execBloodFlowMonitor( void ) @@ -392,9 +386,8 @@ /*********************************************************************//** * @brief * The execBloodFlowController function executes the blood flow controller. - * @details - * Inputs : bloodPumpState - * Outputs : bloodPumpState + * @details Inputs: bloodPumpState + * @details Outputs: bloodPumpState * @return none *************************************************************************/ void execBloodFlowController( void ) @@ -427,9 +420,8 @@ * @brief * The handleBloodPumpOffState function handles the blood pump off state * of the blood pump controller state machine. - * @details - * Inputs : targetBloodFlowRate, bloodPumpDirection - * Outputs : bloodPumpPWMDutyCyclePctSet, bloodPumpDirectionSet, isBloodPumpOn + * @details Inputs: targetBloodFlowRate, bloodPumpDirection + * @details Outputs: bloodPumpPWMDutyCyclePctSet, bloodPumpDirectionSet, isBloodPumpOn * @return next state *************************************************************************/ static BLOOD_PUMP_STATE_T handleBloodPumpOffState( void ) @@ -456,9 +448,8 @@ * @brief * The handleBloodPumpRampingUpState function handles the ramp up state * of the blood pump controller state machine. - * @details - * Inputs : bloodPumpPWMDutyCyclePctSet - * Outputs : bloodPumpPWMDutyCyclePctSet + * @details Inputs: bloodPumpPWMDutyCyclePctSet + * @details Outputs: bloodPumpPWMDutyCyclePctSet * @return next state *************************************************************************/ static BLOOD_PUMP_STATE_T handleBloodPumpRampingUpState( void ) @@ -501,9 +492,8 @@ * @brief * The handleBloodPumpRampingDownState function handles the ramp down state * of the blood pump controller state machine. - * @details - * Inputs : bloodPumpPWMDutyCyclePctSet - * Outputs : bloodPumpPWMDutyCyclePctSet + * @details Inputs: bloodPumpPWMDutyCyclePctSet + * @details Outputs: bloodPumpPWMDutyCyclePctSet * @return next state *************************************************************************/ static BLOOD_PUMP_STATE_T handleBloodPumpRampingDownState( void ) @@ -544,9 +534,8 @@ * @brief * The handleBloodPumpControlToTargetState function handles the "control to * target" state of the blood pump controller state machine. - * @details - * Inputs : none - * Outputs : bloodPumpState + * @details Inputs: none + * @details Outputs: bloodPumpState * @return next state *************************************************************************/ static BLOOD_PUMP_STATE_T handleBloodPumpControlToTargetState( void ) @@ -576,9 +565,8 @@ * @brief * The setBloodPumpControlSignalPWM function sets the PWM duty cycle for * the blood pump to a given %. - * @details - * Inputs : none - * Outputs : blood pump stop signal activated, PWM duty cycle zeroed + * @details Inputs: none + * @details Outputs: blood pump stop signal activated, PWM duty cycle zeroed * @param newPWM new duty cycle % to apply to PWM * @return none *************************************************************************/ @@ -590,9 +578,8 @@ /*********************************************************************//** * @brief * The stopBloodPump function sets the blood pump stop signal. - * @details - * Inputs : none - * Outputs : blood pump stop signal activated, PWM duty cycle zeroed + * @details Inputs: none + * @details Outputs: blood pump stop signal activated, PWM duty cycle zeroed * @return none *************************************************************************/ static void stopBloodPump( void ) @@ -606,9 +593,8 @@ /*********************************************************************//** * @brief * The releaseBloodPumpStop function clears the blood pump stop signal. - * @details - * Inputs : none - * Outputs : blood pump stop signal + * @details Inputs: none + * @details Outputs: blood pump stop signal * @return none *************************************************************************/ static void releaseBloodPumpStop( void ) @@ -620,9 +606,8 @@ * @brief * The setBloodPumpDirection function sets the set blood pump direction to * the given direction. - * @details - * Inputs : bloodPumpState - * Outputs : bloodPumpState + * @details Inputs: bloodPumpState + * @details Outputs: bloodPumpState * @param dir blood pump direction to set * @return none *************************************************************************/ @@ -650,9 +635,8 @@ * @brief * The getPublishBloodFlowDataInterval function gets the blood flow data * publication interval. - * @details - * Inputs : bloodFlowDataPublishInterval - * Outputs : none + * @details Inputs: bloodFlowDataPublishInterval + * @details Outputs: none * @return the current blood flow data publication interval (in task intervals). *************************************************************************/ U32 getPublishBloodFlowDataInterval( void ) @@ -671,9 +655,8 @@ * @brief * The getTargetBloodFlowRate function gets the current target blood flow * rate. - * @details - * Inputs : targetBloodFlowRate - * Outputs : none + * @details Inputs: targetBloodFlowRate + * @details Outputs: none * @return the current target blood flow rate (in mL/min). *************************************************************************/ S32 getTargetBloodFlowRate( void ) @@ -692,9 +675,8 @@ * @brief * The getMeasuredBloodFlowRate function gets the measured blood flow * rate. - * @details - * Inputs : measuredBloodFlowRate - * Outputs : none + * @details Inputs: measuredBloodFlowRate + * @details Outputs: none * @return the current blood flow rate (in mL/min). *************************************************************************/ F32 getMeasuredBloodFlowRate( void ) @@ -713,9 +695,8 @@ * @brief * The getMeasuredBloodPumpRotorSpeed function gets the measured blood flow * rate. - * @details - * Inputs : bloodPumpRotorSpeedRPM - * Outputs : none + * @details Inputs: bloodPumpRotorSpeedRPM + * @details Outputs: none * @return the current blood flow rate (in mL/min). *************************************************************************/ F32 getMeasuredBloodPumpRotorSpeed( void ) @@ -734,9 +715,8 @@ * @brief * The getMeasuredBloodPumpSpeed function gets the measured blood flow * rate. - * @details - * Inputs : bloodPumpSpeedRPM - * Outputs : none + * @details Inputs: bloodPumpSpeedRPM + * @details Outputs: none * @return the current blood flow rate (in mL/min). *************************************************************************/ F32 getMeasuredBloodPumpSpeed( void ) @@ -755,9 +735,8 @@ * @brief * The getMeasuredBloodPumpMCSpeed function gets the measured blood pump * speed. - * @details - * Inputs : adcBloodPumpMCSpeedRPM - * Outputs : none + * @details Inputs: adcBloodPumpMCSpeedRPM + * @details Outputs: none * @return the current blood pump speed (in RPM). *************************************************************************/ F32 getMeasuredBloodPumpMCSpeed( void ) @@ -776,9 +755,8 @@ * @brief * The getMeasuredBloodPumpMCCurrent function gets the measured blood pump * current. - * @details - * Inputs : adcBloodPumpMCCurrentmA - * Outputs : none + * @details Inputs: adcBloodPumpMCCurrentmA + * @details Outputs: none * @return the current blood pump current (in mA). *************************************************************************/ F32 getMeasuredBloodPumpMCCurrent( void ) @@ -797,10 +775,9 @@ * @brief * The publishBloodFlowData function publishes blood flow data at the set * interval. - * @details - * Inputs : target flow rate, measured flow rate, measured MC speed, + * @details Inputs: target flow rate, measured flow rate, measured MC speed, * measured MC current - * Outputs : Blood flow data is published to CAN bus. + * @details Outputs: Blood flow data is published to CAN bus. * @return none *************************************************************************/ static void publishBloodFlowData( void ) @@ -841,9 +818,8 @@ * @brief * The resetBloodFlowMovingAverage function re-initializes the blood flow * moving average sample buffer. - * @details - * Inputs : none - * Outputs : flowReadingsTotal, flowReadingsIdx, flowReadingsCount all set to zero. + * @details Inputs: none + * @details Outputs: flowReadingsTotal, flowReadingsIdx, flowReadingsCount all set to zero. * @return none *************************************************************************/ static void resetBloodFlowMovingAverage( void ) @@ -857,9 +833,8 @@ /*********************************************************************//** * @brief * The filterBloodFlowReadings function adds a new flow sample to the filter. - * @details - * Inputs : none - * Outputs : flowReadings[], flowReadingsIdx, flowReadingsCount, flowReadingsTotal + * @details Inputs: none + * @details Outputs: flowReadings[], flowReadingsIdx, flowReadingsCount, flowReadingsTotal * @param flow newest blood flow sample * @return none *************************************************************************/ @@ -885,9 +860,8 @@ * The updateBloodPumpSpeedAndDirectionFromHallSensors function calculates * the blood pump motor speed and direction from hall sensor counter on * a 1 second interval. - * @details - * Inputs : bpLastMotorHallSensorCount, bpMotorSpeedCalcTimerCtr, current count from FPGA - * Outputs : bpMotorDirectionFromHallSensors, bloodPumpSpeedRPM + * @details Inputs: bpLastMotorHallSensorCount, bpMotorSpeedCalcTimerCtr, current count from FPGA + * @details Outputs: bpMotorDirectionFromHallSensors, bloodPumpSpeedRPM * @return none *************************************************************************/ static void updateBloodPumpSpeedAndDirectionFromHallSensors( void ) @@ -924,9 +898,8 @@ * The checkBloodPumpRotor function checks the rotor for the blood * pump. If homing, this function will stop when hall sensor detected. If pump * is off or running very slowly, rotor speed will be set to zero. - * @details - * Inputs : bpStopAtHomePosition, bpHomeStartTime, bpRotorRevStartTime - * Outputs : pump may be stopped if homing, bloodPumpRotorSpeedRPM may be set to zero. + * @details Inputs: bpStopAtHomePosition, bpHomeStartTime, bpRotorRevStartTime + * @details Outputs: pump may be stopped if homing, bloodPumpRotorSpeedRPM may be set to zero. * @return none *************************************************************************/ static void checkBloodPumpRotor( void ) @@ -958,9 +931,8 @@ * @brief * The checkBloodPumpDirection function checks the set direction vs. * the direction implied by the sign of the measured MC speed. - * @details - * Inputs : - * Outputs : + * @details Inputs: + * @details Outputs: * @return none *************************************************************************/ static void checkBloodPumpDirection( void ) @@ -988,9 +960,8 @@ * 2. while pump is controlling, measured motor speed should be within allowed range of commanded speed. * 3. measured motor speed should be within allowed range of measured rotor speed. * All 3 checks have a persistence time that must be met before an alarm is triggered. - * @details - * Inputs : targetBloodFlowRate, bloodPumpSpeedRPM, bloodPumpRotorSpeedRPM - * Outputs : alarm(s) may be triggered + * @details Inputs: targetBloodFlowRate, bloodPumpSpeedRPM, bloodPumpRotorSpeedRPM + * @details Outputs: alarm(s) may be triggered * @return none *************************************************************************/ static void checkBloodPumpSpeeds( void ) @@ -1072,9 +1043,8 @@ * against the implied flow of the measured pump speed when in treatment mode * and controlling to target flow. If a sufficient difference persists, a * flow vs. motor speed check error is triggered. - * @details - * Inputs : measuredBloodFlowRate, bloodPumpSpeedRPM, errorBloodFlowVsMotorSpeedPersistTimerCtr - * Outputs : alarm may be triggered + * @details Inputs: measuredBloodFlowRate, bloodPumpSpeedRPM, errorBloodFlowVsMotorSpeedPersistTimerCtr + * @details Outputs: alarm may be triggered * @return none *************************************************************************/ static void checkBloodPumpFlowAgainstSpeed( void ) @@ -1111,9 +1081,8 @@ * @brief * The checkBloodPumpMCCurrent function checks the measured MC current vs. * the set state of the blood pump (stopped or running). - * @details - * Inputs : - * Outputs : + * @details Inputs: + * @details Outputs: * @return none *************************************************************************/ static void checkBloodPumpMCCurrent( void ) @@ -1164,9 +1133,8 @@ * @brief * The execBloodFlowTest function executes the state machine for the * BloodFlow self-test. - * @details - * Inputs : none - * Outputs : none + * @details Inputs: none + * @details Outputs: none * @return the current state of the BloodFlow self-test. *************************************************************************/ SELF_TEST_STATUS_T execBloodFlowTest( void ) @@ -1211,9 +1179,8 @@ * @brief * The setBloodFlowCalibration function sets the blood flow calibration * factors and has them stored in non-volatile memory. - * @details - * Inputs : none - * Outputs : bloodFlowCalGain, bloodFlowCalOffset + * @details Inputs: none + * @details Outputs: bloodFlowCalGain, bloodFlowCalOffset * @param gain gain calibration factor for blood flow sensor * @param offset offset calibration factor for blood flow sensor * @return TRUE if calibration factors successfully set/stored, FALSE if not @@ -1246,9 +1213,8 @@ * @brief * The getBloodFlowCalibration function retrieves the current blood flow * calibration factors. - * @details - * Inputs : bloodFlowCalGain, bloodFlowCalOffset - * Outputs : none + * @details Inputs: bloodFlowCalGain, bloodFlowCalOffset + * @details Outputs: none * @param gain value to populate with gain calibration factor for blood flow sensor * @param offset value to populate with offset calibration factor for blood flow sensor * @return none @@ -1263,9 +1229,8 @@ * @brief * The testSetBloodFlowDataPublishIntervalOverride function overrides the * blood flow data publish interval. - * @details - * Inputs : none - * Outputs : bloodFlowDataPublishInterval + * @details Inputs: none + * @details Outputs: bloodFlowDataPublishInterval * @param value override blood flow data publish interval with (in ms) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1289,9 +1254,8 @@ * @brief * The testResetBloodFlowDataPublishIntervalOverride function resets the override * of the blood flow data publish interval. - * @details - * Inputs : none - * Outputs : bloodFlowDataPublishInterval + * @details Inputs: none + * @details Outputs: bloodFlowDataPublishInterval * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetBloodFlowDataPublishIntervalOverride( void ) @@ -1312,9 +1276,8 @@ * @brief * The testSetTargetBloodFlowRateOverride function overrides the target * blood flow rate. - * @details - * Inputs : none - * Outputs : targetBloodFlowRate + * @details Inputs: none + * @details Outputs: targetBloodFlowRate * @param value override target blood flow rate (in mL/min) * @param ctrlMode override pump control mode to this mode (0 = closed loop, 1 = open loop) * @return TRUE if override successful, FALSE if not @@ -1351,9 +1314,8 @@ * @brief * The testResetTargetBloodFlowRateOverride function resets the override of the * target blood flow rate. - * @details - * Inputs : none - * Outputs : targetBloodFlowRate + * @details Inputs: none + * @details Outputs: targetBloodFlowRate * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetTargetBloodFlowRateOverride( void ) @@ -1376,9 +1338,8 @@ * @brief * The testResetMeasuredBloodFlowRateOverride function overrides the measured * blood flow rate. - * @details - * Inputs : none - * Outputs : measuredBloodFlowRate + * @details Inputs: none + * @details Outputs: measuredBloodFlowRate * @param value override measured blood flow rate (in mL/min) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1400,9 +1361,8 @@ * @brief * The testResetOffButtonStateOverride function resets the override of the * measured blood flow rate. - * @details - * Inputs : none - * Outputs : measuredBloodFlowRate + * @details Inputs: none + * @details Outputs: measuredBloodFlowRate * @return TRUE if reset successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredBloodFlowRateOverride( void ) @@ -1423,9 +1383,8 @@ * @brief * The testSetMeasuredBloodPumpRotorSpeedOverride function overrides the measured * blood pump rotor speed. - * @details - * Inputs : none - * Outputs : bloodPumpRotorSpeedRPM + * @details Inputs: none + * @details Outputs: bloodPumpRotorSpeedRPM * @param value override measured blood pump rotor speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1447,9 +1406,8 @@ * @brief * The testResetMeasuredBloodPumpRotorSpeedOverride function resets the override of the * measured blood pump rotor speed. - * @details - * Inputs : none - * Outputs : bloodPumpRotorSpeedRPM + * @details Inputs: none + * @details Outputs: bloodPumpRotorSpeedRPM * @return TRUE if reset successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredBloodPumpRotorSpeedOverride( void ) @@ -1470,9 +1428,8 @@ * @brief * The testSetMeasuredBloodPumpSpeedOverride function overrides the measured * blood pump motor speed. - * @details - * Inputs : none - * Outputs : bloodPumpSpeedRPM + * @details Inputs: none + * @details Outputs: bloodPumpSpeedRPM * @param value override measured blood pump motor speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1494,9 +1451,8 @@ * @brief * The testResetMeasuredBloodPumpSpeedOverride function resets the override of the * measured blood pump motor speed. - * @details - * Inputs : none - * Outputs : bloodPumpSpeedRPM + * @details Inputs: none + * @details Outputs: bloodPumpSpeedRPM * @return TRUE if reset successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredBloodPumpSpeedOverride( void ) @@ -1517,9 +1473,8 @@ * @brief * The testSetMeasuredBloodPumpMCSpeedOverride function overrides the measured * blood pump motor speed. - * @details - * Inputs : none - * Outputs : adcBloodPumpMCSpeedRPM + * @details Inputs: none + * @details Outputs: adcBloodPumpMCSpeedRPM * @param value override measured blood pump speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1541,9 +1496,8 @@ * @brief * The testResetMeasuredBloodPumpMCSpeedOverride function resets the override of the * measured blood pump motor speed. - * @details - * Inputs : none - * Outputs : adcBloodPumpMCSpeedRPM + * @details Inputs: none + * @details Outputs: adcBloodPumpMCSpeedRPM * @return TRUE if reset successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredBloodPumpMCSpeedOverride( void ) @@ -1564,9 +1518,8 @@ * @brief * The testSetMeasuredBloodPumpMCCurrentOverride function overrides the measured * blood pump motor current. - * @details - * Inputs : none - * Outputs : adcBloodPumpMCCurrentmA + * @details Inputs: none + * @details Outputs: adcBloodPumpMCCurrentmA * @param value override measured blood pump current (in mA) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -1588,9 +1541,8 @@ * @brief * The testResetMeasuredBloodPumpMCCurrentOverride function resets the override of the * measured blood pump motor current. - * @details - * Inputs : none - * Outputs : adcBloodPumpMCCurrentmA + * @details Inputs: none + * @details Outputs: adcBloodPumpMCCurrentmA * @return TRUE if reset successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredBloodPumpMCCurrentOverride( void )