It is not technically a boolean - it is a BOOL which is our implementation of a boolean (TRUE = 1, FALSE = 0). If we don't explicitly compare a BOOL to TRUE, compiler will consider any non-zero value to be TRUE. So if memory is overwritten/corrupted to a random non-zero value, it would satisfy "if ( isSyringePumpPreLoaded() )" and s.w would do the wrong thing. For extra safety, we prefer to compare to TRUE (1) or FALSE (0) depending on what would be safer. For example, in this case we are deciding whether to seek plunger or alarm. We only seek plunger if the syringe pump was pre-loaded. It is safer to check pre-loaded flag is TRUE (1) to seek and ANY OTHER VALUE would alarm. Also, when using the "==" compare operator, we will put the literal first. It looks awkward, but if we accidently use the "=" operator by mistake the compiler will give us a syntax error which saves us from having a tricky bug to fix later.
No harm in adding "F" suffix, but not necessary for assignment to a float variable - assignment statement is inherently typed. We need the "F" suffix where typing is not assured (e.g. #define where we don't know how it will be used).
Not what I meant. I mean when we're determining whether the measured flow is within 50% of estimated flow, we should use the get function (that allows override to be considered) instead of using filteredDialinFlowMeterReading.
Yes and no for the place holder. The profiles expected to change in the future. They may have different load states but for now we have tuned Kp and Ki along with our maximum PWM step limit to get the level of responsiveness we wanted to achieve with this optimization task. We can further fine tune the pump profiles with this data structure if necessary. setROPIFlowProfile will be called in when we transition operation modes when we intend to differentiate between profiles.