Mercurial > public > ostc4
annotate Common/Inc/data_central.h @ 773:2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
author | heinrichsweikamp |
---|---|
date | Wed, 10 May 2023 16:24:57 +0200 |
parents | 29d9b5bc7946 |
children | 6169309d6eb9 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Common/Inc/data_central.h | |
5 /// \brief Common Dadatypes Declarations | |
6 /// \author Heinrichs Weikamp | |
7 /// \date 2018 | |
8 /// | |
9 /// $Id$ | |
10 /////////////////////////////////////////////////////////////////////////////// | |
11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
12 /// | |
13 /// This program is free software: you can redistribute it and/or modify | |
14 /// it under the terms of the GNU General Public License as published by | |
15 /// the Free Software Foundation, either version 3 of the License, or | |
16 /// (at your option) any later version. | |
17 /// | |
18 /// This program is distributed in the hope that it will be useful, | |
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 /// GNU General Public License for more details. | |
22 /// | |
23 /// You should have received a copy of the GNU General Public License | |
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 ////////////////////////////////////////////////////////////////////////////// | |
26 | |
27 #ifndef DATA_CENTRAL_H | |
28 #define DATA_CENTRAL_H | |
29 | |
30 #include <stdint.h> | |
31 | |
32 #include "settings.h" | |
33 #include "stm32f4xx_hal.h" | |
672 | 34 #include "configuration.h" |
38 | 35 |
36 #define BUEHLMANN_STRUCT_MAX_GASES 11 | |
37 #define BUEHLMANN_STRUCT_MAX_ASCENDRATES 3 | |
38 #define DECOINFO_STRUCT_MAX_STOPS 50 | |
39 | |
40 #define false 0 | |
41 #define true 1 | |
42 | |
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
43 #define EXT_INTERFACE_SENSOR_CNT (5u) /* 5 sensors may be connected to the external interface */ |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
44 |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
45 |
38 | 46 /* Helper structs ------------------------------------------------------------*/ |
47 | |
48 //struct SGas | |
49 //contains gasinfos of single gas for deco calculation | |
50 typedef struct | |
51 { | |
52 uint8_t nitrogen_percentage; | |
53 uint8_t helium_percentage; | |
54 uint8_t setPoint_cbar; | |
55 uint8_t change_during_ascent_depth_meter_otherwise_zero; | |
56 uint8_t GasIdInSettings; | |
662 | 57 uint8_t AppliedDiveMode; |
58 float pscr_factor; | |
38 | 59 } SGas; |
60 | |
61 typedef struct | |
62 { | |
63 float use_from_depth_bar; | |
64 float rate_bar_per_minute; | |
65 } SAscentrate; | |
66 | |
67 | |
68 typedef struct{ | |
69 uint32_t date_rtc_dr; | |
70 uint32_t time_rtc_tr; | |
71 int32_t value_int32; | |
72 } SDeviceLine; | |
73 | |
74 | |
75 typedef struct | |
76 { | |
77 uint16_t ageInMilliSeconds; | |
78 uint8_t numberOfBytes; | |
79 uint8_t status; | |
80 uint8_t data[12]; | |
81 } SDataWireless; | |
82 | |
662 | 83 |
84 typedef struct | |
85 { | |
748 | 86 uint32_t CO2_ppm; |
662 | 87 uint16_t signalStrength; |
88 } SCO2Sensor; | |
89 | |
38 | 90 /* Main structs -------------------------------------------------------------*/ |
91 | |
92 | |
93 //struct SDecoinfo | |
94 //contains result of deco calculation | |
95 typedef struct | |
96 { | |
97 unsigned short output_stop_length_seconds[DECOINFO_STRUCT_MAX_STOPS]; | |
98 int output_time_to_surface_seconds; | |
99 int output_ndl_seconds; | |
100 float output_ceiling_meter; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
101 float super_saturation; |
38 | 102 uint32_t tickstamp; |
103 } SDecoinfo; | |
104 | |
105 | |
106 typedef struct | |
107 { | |
108 //crushing pressure | |
109 //in/out | |
110 float max_crushing_pressure_he[16]; | |
111 float max_crushing_pressure_n2[16]; | |
112 // | |
113 float run_time_start_of_deco_zone_save; | |
114 float depth_start_of_deco_zone_save; | |
115 float max_first_stop_depth_save; | |
116 short decomode_vpm_plus_conservatism_last_dive; | |
117 _Bool deco_zone_reached; | |
118 //State variables for repetetive dives | |
119 _Bool repetitive_variables_not_valid; | |
120 float adjusted_crushing_pressure_he[16]; | |
121 float adjusted_crushing_pressure_n2[16]; | |
122 float adjusted_critical_radius_he[16]; | |
123 float adjusted_critical_radius_n2[16]; | |
124 float initial_allowable_gradient_he[16]; | |
125 float initial_allowable_gradient_n2[16]; | |
126 float max_actual_gradient[16]; | |
127 } SVpm; | |
128 | |
129 typedef struct | |
130 { | |
131 _Bool repetitive_variables_not_valid; | |
132 _Bool is_data_from_RTE_CPU; | |
133 _Bool spare2; | |
134 _Bool spare3; | |
135 float adjusted_crushing_pressure_he[16]; | |
136 float adjusted_crushing_pressure_n2[16]; | |
137 float adjusted_critical_radius_he[16]; | |
138 float adjusted_critical_radius_n2[16]; | |
139 float initial_allowable_gradient_he[16]; | |
140 float initial_allowable_gradient_n2[16]; | |
141 float max_actual_gradient[16]; | |
142 } SVpmRepetitiveData; | |
143 | |
144 //struct SDevice | |
145 //contains information about usage | |
146 typedef struct | |
147 { | |
148 SDeviceLine batteryChargeCycles; | |
149 SDeviceLine batteryChargeCompleteCycles; | |
150 SDeviceLine temperatureMinimum; | |
151 SDeviceLine temperatureMaximum; | |
152 SDeviceLine depthMaximum; | |
153 SDeviceLine diveCycles; | |
154 SDeviceLine voltageMinimum; | |
155 SDeviceLine hoursOfOperation; | |
156 SDeviceLine diveAccident; | |
157 } SDevice; | |
158 | |
159 /* | |
160 typedef struct | |
161 { | |
162 SDevice device; | |
163 SVpmRepetitiveData vpm; | |
164 } SDeviceState; | |
165 */ | |
166 | |
167 /* struct SLifeData | |
168 * contains data all actual data (pressure, stuturation, etc. as received from second ship | |
169 * and has actualGas to be send to Small CPU (second chip) | |
170 * contains data calculated from actual data after receiption from Small CPU | |
171 */ | |
172 typedef struct | |
173 { | |
174 /* from Small CPU */ | |
752
4f19336a3f21
Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents:
748
diff
changeset
|
175 uint8_t extIf_sensor_data[32]; /* The external sensor may contain a 64 bit ID. It has been placed at the beginning of the structure to avoid problems in alignment */ |
4f19336a3f21
Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents:
748
diff
changeset
|
176 uint8_t extIf_sensor_map[EXT_INTERFACE_SENSOR_CNT]; |
4f19336a3f21
Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents:
748
diff
changeset
|
177 |
38 | 178 int32_t dive_time_seconds; |
179 int32_t dive_time_seconds_without_surface_time; | |
180 uint32_t surface_time_seconds; | |
181 float pressure_ambient_bar; | |
182 float pressure_surface_bar; | |
183 float tissue_nitrogen_bar[16]; | |
184 float tissue_helium_bar[16]; | |
185 float cns; | |
186 float otu; | |
187 uint16_t desaturation_time_minutes; | |
188 uint16_t no_fly_time_minutes; | |
189 float temperature_celsius; | |
190 float compass_heading; | |
191 float compass_roll; | |
192 float compass_pitch; | |
193 int16_t compass_DX_f; | |
194 int16_t compass_DY_f; | |
195 int16_t compass_DZ_f; | |
196 uint16_t counterSecondsShallowDepth; | |
197 float ascent_rate_meter_per_min; | |
198 uint32_t timeBinaryFormat; | |
199 uint32_t dateBinaryFormat; | |
200 float battery_voltage; | |
201 float battery_charge; | |
202 uint16_t ambient_light_level; | |
203 SDataWireless wireless_data[4]; | |
204 uint8_t buttonPICdata[4]; | |
662 | 205 SCO2Sensor CO2_data; |
714
045ff7800501
Added customizable data area for specific sensor data:
Ideenmodellierer
parents:
672
diff
changeset
|
206 uint8_t extIf_sensor_Id; |
38 | 207 |
208 /* by create DiveSettings() and by setActualGas() | |
209 * is send to Small CPU2 for nitrogen calculation | |
210 * includes setpoint information | |
211 */ | |
212 SGas actualGas; | |
771
29d9b5bc7946
Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
heinrichsweikamp
parents:
752
diff
changeset
|
213 |
38 | 214 uint8_t lastDiluent_GasIdInSettings; |
771
29d9b5bc7946
Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
heinrichsweikamp
parents:
752
diff
changeset
|
215 float lastSetpointChangeDepthM; |
38 | 216 |
217 /* calculated by DataEX_copy_to_LifeData() | |
218 bottle_bar array size is made like this to have multiples of 32bit | |
219 */ | |
220 float ppO2; | |
221 float depth_meter; | |
222 float max_depth_meter; | |
223 float average_depth_meter; | |
224 float apnea_total_max_depth_meter; | |
225 float apnea_last_max_depth_meter; | |
226 int32_t apnea_last_dive_time_seconds; | |
227 uint16_t bottle_bar[2 * NUM_GASES +1]; | |
228 uint16_t bottle_bar_age_MilliSeconds[2 * NUM_GASES + 1]; | |
229 uint16_t apnea_total_counter; | |
230 | |
231 /* control of DataEX_copy_to_LifeData() | |
232 */ | |
233 uint8_t boolResetAverageDepth; | |
234 uint8_t bool_temp1; | |
235 uint8_t bool_temp2; | |
236 | |
237 /* from local sensor or direct HUD communication */ | |
238 //pp O2 Sensor | |
239 float ppO2Sensor_bar[3]; | |
240 float sensorVoltage_mV[3]; | |
241 float HUD_battery_voltage_V; | |
662 | 242 |
243 /* for PSCR Mode */ | |
244 float ppo2Simulated_bar; | |
38 | 245 } SLifeData; |
246 | |
247 | |
248 typedef struct | |
249 { | |
250 uint16_t tissue_nitrogen_desaturation_time_minutes[16]; | |
251 uint16_t tissue_helium_desaturation_time_minutes[16]; | |
252 } SLifeData2; | |
253 | |
254 | |
255 typedef struct | |
256 { | |
257 //warnings | |
258 int8_t decoMissed; | |
259 int8_t aGf; | |
260 int8_t ascentRateHigh; | |
261 int8_t ppO2Low; | |
262 int8_t ppO2High; | |
263 int8_t cnsHigh; | |
264 int8_t slowWarning; | |
265 int8_t lowBattery; | |
266 int8_t numWarnings; | |
267 int8_t sensorLinkLost; | |
268 int8_t sensorOutOfBounds[3]; | |
269 int8_t betterGas; | |
270 int8_t fallback; | |
271 int8_t betterSetpoint; | |
752
4f19336a3f21
Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents:
748
diff
changeset
|
272 int8_t co2High; |
478
58200d756365
Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents:
309
diff
changeset
|
273 #ifdef ENABLE_BOTTLE_SENSOR |
58200d756365
Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents:
309
diff
changeset
|
274 int8_t newPressure; |
58200d756365
Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents:
309
diff
changeset
|
275 #endif |
38 | 276 } SWarnings; |
277 | |
278 | |
279 typedef struct | |
280 { | |
281 //Events logbook only | |
282 int16_t manualMarker; | |
283 int16_t gasChange; | |
284 int16_t info_GasChange; | |
285 int16_t setpointChange; | |
286 int16_t info_SetpointChange; | |
281 | 287 int16_t manualGasSet; |
288 int16_t info_manualGasSetHe; | |
289 int16_t info_manualGasSetO2; | |
38 | 290 int16_t bailout; |
291 int16_t info_bailoutHe; | |
292 int16_t info_bailoutO2; | |
293 } SEvents; | |
294 | |
295 | |
296 | |
297 //struct SDiveSettings | |
298 //contains settings necessary for deco calculation | |
299 typedef struct | |
300 { | |
301 float last_stop_depth_bar; | |
302 float input_next_stop_increment_depth_bar; | |
303 float input_second_to_last_stop_depth_bar; | |
304 float ascentRate_meterperminute; | |
305 uint8_t diveMode; /* OC, CC, .. */ | |
306 uint8_t CCR_Mode; | |
307 uint8_t future_TTS_minutes; | |
308 | |
309 /* If beginning of dive is CCR than ccrOption is set true | |
310 * true allows returning from bailout (OC) back to CCR | |
311 * true activates CC gas and setpoint pages in dive menu | |
312 */ | |
313 uint8_t ccrOption; | |
314 uint8_t fallbackOption; | |
315 uint8_t ppo2sensors_deactivated; | |
316 | |
317 split2x4_Type deco_type; /* GF or VPM for standard and alternative seperate */ | |
318 | |
319 /* VPM conservatism, do not change during dive!!! | |
320 * do not change in between dives otherwise repetitve dive is not possible | |
321 */ | |
322 uint8_t vpm_conservatism; | |
323 | |
324 /* B�hlmann GF | |
325 * and a variable that is used by Buehlmann during the dive | |
326 * to remember the position of GF low during ascend | |
327 */ | |
328 uint8_t gf_high; | |
329 uint8_t gf_low; | |
330 | |
331 /* copy of the Settings GasList and SetpintList | |
332 * that can be modified during the dive | |
333 * especially gases can be actived and deactivated | |
334 * gas[0] and setpoint[0] are the special ones configurable during the dive | |
335 */ | |
336 SGasLine gas[1 + (2*NUM_GASES)]; | |
337 SSetpointLine setpoint[1 + NUM_GASES]; | |
338 | |
339 /* List of GasChanges in the actual order | |
340 * this is necessary for VPM and Buehlmann and will be created on start of each calculation | |
341 */ | |
342 SGas decogaslist[BUEHLMANN_STRUCT_MAX_GASES]; // unused filled with 0xFF | |
343 | |
344 /* | |
345 */ | |
346 float internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero; | |
347 uint16_t compassHeading; | |
662 | 348 |
349 uint8_t pscr_o2_drop; | |
350 uint8_t pscr_lung_ratio; | |
38 | 351 } SDiveSettings; |
352 | |
353 enum CHARGE_STATUS{ | |
354 CHARGER_off = 0, | |
355 CHARGER_running, | |
356 CHARGER_complete, | |
357 CHARGER_lostConnection | |
358 }; | |
359 | |
360 typedef struct | |
361 { | |
362 SDiveSettings diveSettings; | |
363 SLifeData lifeData; | |
364 SVpm vpm; | |
365 SEvents events; | |
366 SWarnings warnings; | |
367 SDecoinfo decolistVPM; | |
368 SDecoinfo decolistFutureVPM; | |
369 SDecoinfo decolistBuehlmann; // | |
370 SDecoinfo decolistFutureBuehlmann; | |
371 uint8_t mode; /* hw for sleep, surface, dive, .. */ | |
372 uint8_t chargeStatus; | |
373 uint8_t data_old__lost_connection_to_slave; | |
374 | |
375 uint32_t pressure_uTick_new; | |
376 uint32_t compass_uTick_new; | |
377 | |
378 uint32_t pressure_uTick_old; | |
379 uint32_t compass_uTick_old; | |
380 | |
381 uint32_t pressure_uTick_local_new; | |
382 uint32_t compass_uTick_local_new; | |
383 | |
384 uint8_t cnsHigh_at_the_end_of_dive; | |
385 uint8_t decoMissed_at_the_end_of_dive; | |
386 | |
387 uint8_t sensorErrorsRTE; | |
388 | |
389 uint8_t lastKnownBatteryPercentage; | |
390 } SDiveState; | |
391 | |
392 | |
393 typedef struct{ | |
394 uint8_t bit0:1; | |
395 uint8_t bit1:1; | |
396 uint8_t bit2:1; | |
397 uint8_t bit3:1; | |
398 uint8_t bit4:1; | |
399 uint8_t bit5:1; | |
400 uint8_t bit6:1; | |
401 uint8_t bit7:1; | |
402 } ubit8_t; | |
403 | |
404 typedef union{ | |
405 ubit8_t ub; | |
406 uint8_t uw; | |
407 } bit8_Type; | |
408 | |
409 extern SDiveState stateSim; | |
410 extern SDiveState stateDeco; | |
411 extern uint8_t decoLock; | |
271
1303747b5ba2
cleanup: also write gas and setpoint changes in simulator mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
270
diff
changeset
|
412 extern const SDiveState *stateUsed; |
1303747b5ba2
cleanup: also write gas and setpoint changes in simulator mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
270
diff
changeset
|
413 extern SDiveState *stateUsedWrite; |
38 | 414 |
415 enum DECO_LOCK{ | |
416 DECO_CALC_running, | |
417 DECO_CALC_ready, | |
418 DECO_CALC_FINSHED_Buehlmann, | |
419 DECO_CALC_FINSHED_vpm, | |
420 DECO_CALC_FINSHED_FutureBuehlmann, | |
421 DECO_CALC_FINSHED_Futurevpm, | |
422 DECO_CALC_init_as_is_start_of_dive, | |
423 DECO_CALC_undefined | |
424 }; | |
425 | |
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
426 typedef enum |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
427 { |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
428 SENSOR_NONE, |
745 | 429 SENSOR_SEARCH, |
733 | 430 SENSOR_OPTIC, |
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
431 SENSOR_ANALOG, |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
432 SENSOR_DIGO2, |
745 | 433 SENSOR_SENTINEL, |
434 SENSOR_TYPE_O2_END, | |
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
435 SENSOR_CO2, |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
436 SENSOR_END |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
437 } externalInterfaceSensorType; |
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
438 |
745 | 439 #define DVO2_FATAL_INTENSITY_LOW (0x00000001) |
440 #define DVO2_FATAL_AMBIENT_HIGH (0x00000002) | |
441 #define DVO2_FATAL_REFINT_LOW (0x00000004) | |
442 #define DVO2_FATAL_REFAMB_HIGH (0x00000008) | |
443 #define DVO2_FATAL_TEMPERATURE (0x00000010) | |
444 | |
445 #define DVO2_FATAL_ERROR (DVO2_FATAL_INTENSITY_LOW | DVO2_FATAL_AMBIENT_HIGH | DVO2_FATAL_REFINT_LOW | DVO2_FATAL_REFAMB_HIGH | DVO2_FATAL_TEMPERATURE) | |
728
5143e927219f
Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents:
714
diff
changeset
|
446 |
38 | 447 uint32_t time_elapsed_ms(uint32_t ticksstart,uint32_t ticksnow); |
448 | |
449 void set_stateUsedToSim(void); | |
450 void set_stateUsedToReal(void); | |
451 | |
452 _Bool is_stateUsedSetToSim(void); | |
453 | |
454 const SDiveState * stateRealGetPointer(void); | |
455 const SDiveState * stateSimGetPointer(void); | |
456 SDiveState * stateRealGetPointerWrite(void); | |
457 SDiveState * stateSimGetPointerWrite(void); | |
458 const SDevice * stateDeviceGetPointer(void); | |
459 SDevice * stateDeviceGetPointerWrite(void); | |
460 const SVpmRepetitiveData * stateVpmRepetitiveDataGetPointer(void); | |
461 SVpmRepetitiveData * stateVpmRepetitiveDataGetPointerWrite(void); | |
462 | |
463 void UpdateLifeDataTest(SDiveState * diveState); | |
464 | |
465 void setSimulationValues(int _ascent_rate_meter_per_min, int _descent_rate_meter_per_min, int _max_depth, int _bottom_time ); | |
466 | |
467 void createDiveSettings(void); | |
468 void copyDiveSettingsToSim(void); | |
469 void copyVpmRepetetiveDataToSim(void); | |
470 //void fallbackToFixedSetpoints(SLifeData *lifeData); | |
471 void setActualGasFirst(SLifeData *lifeData); | |
472 void setActualGasAir(SLifeData *lifeData); | |
473 void setActualGas(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar); | |
474 void setActualGas_ExtraGas(SLifeData *lifeData, uint8_t oxygen, uint8_t helium, uint8_t setpoint_cbar); | |
475 void setActualGas_DM(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar); | |
476 void setWeekday(RTC_DateTypeDef *sDate); | |
477 void setDate(RTC_DateTypeDef Sdate); | |
478 void setTime(RTC_TimeTypeDef Stime); | |
479 void setBatteryPercentage(uint8_t newChargePercentage); | |
480 void setButtonResponsiveness(uint8_t *ButtonSensitivyList); | |
481 void calibrateCompass(void); | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
478
diff
changeset
|
482 void compass_Inertia(float newHeading); |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
478
diff
changeset
|
483 float compass_getCompensated(); |
38 | 484 void clearDeco(void); |
485 void translateDate(uint32_t datetmpreg, RTC_DateTypeDef *sDate); | |
486 void translateTime(uint32_t tmpreg, RTC_TimeTypeDef *sTime); | |
487 void updateSetpointStateUsed(void); | |
488 | |
489 uint8_t calc_MOD(uint8_t gasId); | |
490 uint8_t calc_MinOD(uint8_t gasId); | |
491 //float calc_ppO2(float input_ambient_pressure_bar, SGas* pGas); | |
492 int current_second(void); | |
493 _Bool vpm_crush(SDiveState* pDiveState); | |
494 _Bool deco_zone_reached(void); | |
270
2e58a4094770
feature, debug: make simulator write a logbook entry
Jan Mulder <jlmulder@xs4all.nl>
parents:
247
diff
changeset
|
495 void resetEvents(const SDiveState *pStateUsed); |
38 | 496 |
497 uint32_t crc32c_checksum(uint8_t* message, uint16_t length, uint8_t* message2, uint16_t length2); | |
498 uint32_t CRC_CalcBlockCRC(uint32_t *buffer, uint32_t words); | |
499 uint32_t CRC_CalcBlockCRC_moreThan768000(uint32_t *buffer1, uint32_t *buffer2, uint32_t words); | |
500 | |
501 _Bool is_ambient_pressure_close_to_surface(SLifeData *lifeData); | |
502 | |
662 | 503 uint8_t isLoopMode(uint8_t Mode); |
504 | |
38 | 505 #endif // DATA_CENTRAL_H |