You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Devices/barometer_ms5607.c in the barometerMs5607_getData, we delay using HAL_DELAY twice for each reading, each for 2ms. This is necessary because of how the barometer samples data to determine pressure. However, we do this twice (once per each physical device), but we could instead perform the conversions in parallel.
To make them work in parallel, we would want to create new functions to start the D1 and D2 conversions so that we could run them in parallel in hm_readSensorData in system/hardware_manager.c, something like:
barometerMs5607_requestD1Conv(&barometerMs5607[i]); for both barometers
Delay
barometerMs5607_readPressure(&barometerMs5607[i]); for both barometers
barometerMs5607_requestD2Conv(&barometerMs5607[i]); for both barometers
Delay
barometerMs5607_readTemp(&barometerMs5607[i]); for both barometers
barometerMs5607_processData(&barometerMs5607[i]); for both
There is also the possibility of, instead of HAL_Delaying (which just does nothing for the time) spending that time reading other sensors or things to save even more time, although just parallelization like above will be useful.
The text was updated successfully, but these errors were encountered:
In GitLab by @SamHaggans on Feb 8, 2023, 15:01
In
Devices/barometer_ms5607.c
in thebarometerMs5607_getData
, we delay usingHAL_DELAY
twice for each reading, each for 2ms. This is necessary because of how the barometer samples data to determine pressure. However, we do this twice (once per each physical device), but we could instead perform the conversions in parallel.To make them work in parallel, we would want to create new functions to start the D1 and D2 conversions so that we could run them in parallel in
hm_readSensorData
insystem/hardware_manager.c
, something like:barometerMs5607_requestD1Conv(&barometerMs5607[i]);
for both barometersDelay
barometerMs5607_readPressure(&barometerMs5607[i]);
for both barometersbarometerMs5607_requestD2Conv(&barometerMs5607[i]);
for both barometersDelay
barometerMs5607_readTemp(&barometerMs5607[i]);
for both barometersbarometerMs5607_processData(&barometerMs5607[i]);
for bothThere is also the possibility of, instead of
HAL_Delay
ing (which just does nothing for the time) spending that time reading other sensors or things to save even more time, although just parallelization like above will be useful.The text was updated successfully, but these errors were encountered: