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