Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r2acaf549519854f7e6de1511d541582267f4d1e8 -r9e85e7ace1390d48587174a5bc6eb11d5185cea4 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 2acaf549519854f7e6de1511d541582267f4d1e8) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 9e85e7ace1390d48587174a5bc6eb11d5185cea4) @@ -109,6 +109,7 @@ #define DOP_PWM_TO_MOTOR_SPEED_RPM(pwm) ( ((pwm) - DOP_PWM_ZERO_OFFSET) * 4000.0 ) #define PUMP_DIR_ERROR_COUNT_MASK 0x3F ///< Bit mask for pump direction error counter. +#define DATA_PUBLISH_COUNTER_START_COUNT 6 ///< Data publish counter start count. /// Enumeration of dialysate outlet pump controller states. typedef enum DialOutPump_States @@ -140,7 +141,7 @@ // ********** private data ********** static DIAL_OUT_PUMP_STATE_T dialOutPumpState = DIAL_OUT_PUMP_OFF_STATE; ///< Current state of the dialysate outlet pump controller state machine. -static U32 dialOutFlowDataPublicationTimerCounter = 6; ///< Timer counter controlling when to publish dialysate outlet data. Set non-zero to phase data publication to CAN bus. +static U32 dialOutFlowDataPublicationTimerCounter; ///< Timer counter controlling when to publish dialysate outlet data. Set non-zero to phase data publication to CAN bus. static BOOL isDialOutPumpOn = FALSE; ///< Flag set to TRUE when dialysate outlet pump is running. static U32 lastGivenRate = 0; ///< Remembers the last given set point rate for the dialysate outlet pump. static F32 dialOutPumpPWMDutyCyclePct = 0.0; ///< Requested PWM duty cycle for dialysate outlet pump (based on given rate). @@ -216,13 +217,15 @@ * @brief * The initDialOutFlow function initializes the DialOutFlow module. * @details Inputs: none - * @details Outputs: DialOutFlow module initialized. + * @details Outputs: dialOutFlowDataPublicationTimerCounter * @return none *************************************************************************/ void initDialOutFlow( void ) { U32 i; + dialOutFlowDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; + signalDialOutPumpHardStop(); setDialOutPumpDirection( MOTOR_DIR_FORWARD );