comparison Common/Inc/data_central.h @ 309:b0045281cb2d cleanup-4

cleanup: factor out SHelper typedef (and more) It is totally useless to carry some data around in the SLifeData global data, that is never used in a significant way. All data in the SHelper typedef can trivially be changed to static data in the new setAvgDepth code. Further, cleanup the setAvgDepth code. Reset to 0 instead of 1, adapt the references to the new local and static data instead of pointers to the external data. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Fri, 24 May 2019 09:29:29 +0200
parents b6436edfb2c0
children 58200d756365
comparison
equal deleted inserted replaced
308:1203255481e4 309:b0045281cb2d
149 { 149 {
150 SDevice device; 150 SDevice device;
151 SVpmRepetitiveData vpm; 151 SVpmRepetitiveData vpm;
152 } SDeviceState; 152 } SDeviceState;
153 */ 153 */
154
155 typedef struct
156 {
157 uint32_t average_depth_meter_Count;
158 uint32_t average_depth_last_update_dive_time_seconds_without_surface_time;
159 } SHelper;
160 154
161 /* struct SLifeData 155 /* struct SLifeData
162 * contains data all actual data (pressure, stuturation, etc. as received from second ship 156 * contains data all actual data (pressure, stuturation, etc. as received from second ship
163 * and has actualGas to be send to Small CPU (second chip) 157 * and has actualGas to be send to Small CPU (second chip)
164 * contains data calculated from actual data after receiption from Small CPU 158 * contains data calculated from actual data after receiption from Small CPU
225 /* from local sensor or direct HUD communication */ 219 /* from local sensor or direct HUD communication */
226 //pp O2 Sensor 220 //pp O2 Sensor
227 float ppO2Sensor_bar[3]; 221 float ppO2Sensor_bar[3];
228 float sensorVoltage_mV[3]; 222 float sensorVoltage_mV[3];
229 float HUD_battery_voltage_V; 223 float HUD_battery_voltage_V;
230
231 /* used by DataEX_copy_to_LifeData()
232 */
233 SHelper internal;
234 } SLifeData; 224 } SLifeData;
235 225
236 226
237 typedef struct 227 typedef struct
238 { 228 {