What is the value of SEMAPHORE_IN_USE_TIMEOUT_MS? The timeout appears to only be check when getSemaphore is called. Seems like you could acquire the semaphore and the process that acquired the semaphore could hold onto it for a time much longer than SEMAPHORE_IN_USE_TIMEOUT.
Those #define below will not be removed until they are added into the calibration records. #define ACID_NORMAL_CONDUCTIVITY 11645.05 #define BICARB_NORMAL_CONDUCTIVITY 13734.88
I think we need the minimum check too. uFRate can be negative if user sets volume to something lower than what has already been collected (negative volume) which would yield a negative rate which is < 0.0.
This math no longer works because we changed the displacement time from 1 minute (which allowed for this simplified approach) to 30 seconds. Generalize the math.
Suggested approach: -integrate volume above properly (don't just sum rates over time). -Should be: fmdIntegratedVolume += ( getMeasuredDialInFlowRate() / (F32)( ( SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ); -Then we don't need to convert here at end of displacement - can just use fmdIntegratedVolume as is in verify state.
We should not be doing a Heparin bolus in treatment mode. It should be completed in pre-treatment mode. transitionToDialysis() function will resume Heparin dispense (not bolus) if necessary when treatment is resumed.