Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r9e1b9e39a5723fd9f49b5257e8516022a4bc0229 -r8afac005a36a62d8d36e58a4c46d0225b3367204 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 9e1b9e39a5723fd9f49b5257e8516022a4bc0229) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 8afac005a36a62d8d36e58a4c46d0225b3367204) @@ -93,6 +93,7 @@ /// Expected position of empty in relation to home position. #define SYRINGE_PUMP_EMPTY_POS ( SYRINGE_ENCODER_COUNTS_PER_ML * 10.84F ) + /// Margin of error for empty position determination. #define SYRINGE_PUMP_EMPTY_POS_MARGIN ( SYRINGE_ENCODER_COUNTS_PER_ML * 0.5F ) /// Minimum retract position. @@ -156,8 +157,10 @@ #define SYRINGE_PUMP_STALL_SPEED_THRESHOLD 0.05F ///< Minimum syringe pump speed to be considered not stalled. #define SYRINGE_PUMP_ADC_FPGA_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Syringe pump ADC FPGA error timeout in milliseconds. + #define SYRINGE_PUMP_DAC_MAX_RETRIES 5 ///< Syringe pump DAC retries to write. #define SYRINGE_PUMP_DAC_TIMER ( 200 / TASK_PRIORITY_INTERVAL ) ///< Syringe pump DAC timer between retries. + /// Defined states for the syringe pump control state machine. typedef enum SyringePump_States { @@ -296,15 +299,8 @@ syringePumpHomePositionOffset = 0; syringePumpLastPosition = 0; syringePumpVolumeRequired = 0.0; - -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) - { - syringePumpControllerMeasuredDirection = MOTOR_DIR_FORWARD; - syringePumpEncoderMeasuredDirection = MOTOR_DIR_FORWARD; - } -#endif - + syringePumpControllerMeasuredDirection = MOTOR_DIR_FORWARD; + syringePumpEncoderMeasuredDirection = MOTOR_DIR_FORWARD; syringePumpDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; syringePumpSpeedCalcTimerCounter = 0; syringePumpRampTimerCtr = 0;