This is the existing style of flag implementation in HD code: The flag is set in "set-value" functions (e.g., the function setNewLoadCellReadings() sets the flag dgLoadCellDataFreshFlag = TRUE; ).
These FPGA registers are obsolete - h/w is no longer in our design. Need to continue to maintain register space since registers after these have not moved. You can think of these obsolete registers as "reserved" for future purpose. Dara, I do think we could rename these register fields to something like Reserved1, Reserved2, ...
I think we should just be calling one function to do a single read at a time. If you try to read multiple times back-to-back, the bus reports busy and the read fails. I would keep call to getBatteryManagementData() function with the large switch statement as it was with everything there and remove getBatteryStatusData() function altogether.
Rotor and motor turn in opposite directions. This ensures true check of motor and rotor speed, regardless of direction. Also, measMotorSpeed is absolute value in this function. Direction check is done in a different function.
For DG faults, let's be consistent. DG fault = TRUE Clear Immediate = TRUE (alarm condition moot because DG going to fault mode) Stops = TRUE (HD pauses treatment for alarm) No Clear = FALSE (so HD can clear alarm when user selects option) No Resume = TRUE (cannot resume treatment w/o functioning DG) No Rinseback = FALSE (no reason to prevent patient getting their blood back just because DG failed) No End Treatment = FALSE (should try to end treatment as normally as possible w/o DG - won't be able to drain reservoirs though) No Blood Recirc = FALSE (why not recirc blood?) No Dialysate Recirc = TRUE (may not be possible depending on what's wrong w/ DG) Clear Only = FALSE
Seems like largest calculated t/o = 38.2 seconds vs. 60 second alarm t/o. Let's leave as is for now, but add a TODO comment here to remove alarm t/o and associated alarm.