We can rename priorState to previousInstallState. Also, it should be declared as a static variable to be able to retain previousState value when the control goes out of the function.
You’re right. I should also check the busy status before transitioning to the GET_DATA state. I’ll update the measurement completion logic to first verify the busy bit is cleared, then validate the BP data response code before moving to BP_DRIVER_GET_DATA_STATE.
This is not an atomic assignment, so we have to consider thread safety. If this driver is running from General Task (I believe it is since ModeTreatment's exec will be calling the BPModule's exec which calls this driver's exec) and if the caller to this function will also be running from General Task (I believe it is since BPModule controller is the caller), then there is no thread safety issue and we should mention in the function header brief that this function should only be called from within the General Task. If another task is involved (e.g. Priority Task is calling this function), this function could be interrupting the get data state while it is populating bpResults with new results and the caller would get a mix of old and new results (we would not want that).
The function getSoftwareConfigStatus() is also part of NVM module. Moreover, we are planning to remove this function when NVM will be implemented. So, we will have to perform a cleanup and remove all similar calls that have been currently commented out in other files as well like AirTrap.c, BloodFlow.c, etc.
Did Noe delete the H12 period register? According to this structure, syrPumpDACControl is 2 bytes (U16), so next register should be 42 (40+2). So why do you have 41? Something is out of sync with HDD here. Please align with the HDD.
I think these will eventually be coming from institutional settings, so maybe put a TODO comment to remove these when institutional settings are available.