Mercurial > public > ostc4
annotate Small_CPU/Inc/scheduler.h @ 199:ac58a9fb92ac div-fixes-cleaup-2
Bugfix: fix initial CNS data in the logbook header
Apparently, there has been confusion in the past about the data format of the
CNS data in the logbook. This seems to be partially fixed back in 2015, but
this fix forgot that the initial CNS data is also in the logbook header.
So, now, the logbook header also stores the initial CNS data in a correct way,
which fixes the problem of strange CNS values at the very start of repetitive
dives, that get reset in the dive profile after the first CNS sample data comes
along.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Fri, 22 Mar 2019 08:36:39 +0100 |
parents | 331882a89421 |
children | b95741467355 |
rev | line source |
---|---|
38 | 1 /** |
2 ****************************************************************************** | |
3 * @file scheduler.h | |
4 * @author heinrichs weikamp gmbh | |
5 * @version V0.0.5 | |
6 * @date 27-March-2014 | |
7 * @brief | |
8 * | |
9 ****************************************************************************** | |
10 * @attention | |
11 * | |
12 * <h2><center>© COPYRIGHT(c) 2015 heinrichs weikamp</center></h2> | |
13 * | |
14 ****************************************************************************** | |
15 */ | |
16 | |
17 | |
18 #ifndef SCHEDULER_H | |
19 #define SCHEDULER_H | |
20 | |
21 #ifdef __cplusplus | |
22 extern "C" { | |
23 #endif | |
24 | |
25 | |
26 /* Includes ------------------------------------------------------------------*/ | |
27 #include "data_central.h" | |
28 #include "data_exchange.h" | |
29 #include "settings.h" | |
30 | |
31 /* Types -------------------------------------------------------------*/ | |
32 #define SENSOR_PRESSURE_ID 0 | |
33 #define MAX_SENSORS 1 | |
181 | 34 |
38 | 35 typedef struct |
36 { | |
37 uint8_t mode; | |
38 short conservatism; | |
39 short repetitive_dive; | |
40 long seconds_since_last_dive; | |
41 long no_fly_time_minutes; | |
42 uint8_t whichGas; | |
43 SGas aktualGas[2]; | |
44 float ceiling_from_main_CPU_mbar; | |
45 SLifeData lifeData; | |
46 SVpm vpm; | |
47 SSettings settings; | |
48 SDevice deviceData; | |
49 SDataExchangeSlaveToMasterDeviceData deviceDataSendToMaster; | |
50 SDataExchangeSlaveToMaster dataSendToMaster; | |
51 SDataReceiveFromMaster dataSendToSlave; | |
52 _Bool demo_mode; | |
53 uint8_t dataSendToSlaveIsValid; | |
54 uint8_t dataSendToSlavePending; | |
88 | 55 uint8_t dataSendToSlaveStopEval; |
38 | 56 uint32_t sync_error_count; |
57 uint32_t check_sync_not_running; | |
58 uint8_t ButtonResponsiveness[4]; | |
59 uint8_t chargerStatus; | |
60 uint8_t dataSendToSlaveIsNotValidCount; | |
61 uint8_t ButtonPICdata[4]; | |
62 uint8_t accidentFlag; | |
63 uint32_t accidentRemainingSeconds; | |
64 uint8_t sensorError[MAX_SENSORS]; | |
65 uint8_t I2C_SystemStatus; | |
66 } SGlobal; | |
67 | |
68 typedef struct | |
69 { | |
70 long seconds_since_last_dive; | |
71 long no_fly_time_minutes; | |
72 } SBackup; | |
73 | |
144 | 74 typedef struct |
75 { | |
76 uint8_t counterSPIdata100msec; | |
77 uint8_t counterPressure100msec; | |
78 uint8_t counterCompass100msec; | |
79 uint8_t counterAmbientLight100msec; | |
80 uint32_t tickstart; | |
81 } SScheduleCtrl; | |
82 | |
83 | |
38 | 84 /* Variables ---------------------------------------------------------*/ |
85 extern SGlobal global; | |
148
ee744c7160ce
Use SPI TX callback to synchronize to main CPU
Ideenmodellierer
parents:
144
diff
changeset
|
86 extern uint8_t dohardspisync; |
38 | 87 |
88 | |
89 /* Function prototypes -----------------------------------------------*/ | |
90 | |
91 void initGlobals(void); | |
92 | |
93 void scheduleSurfaceMode(void); | |
94 void scheduleDiveMode(void); | |
95 void scheduleSleepMode(void); | |
96 void scheduleCompassCalibrationMode(void); | |
97 void scheduleTestMode(void); | |
98 | |
99 void scheduleUpdateLifeData(int32_t asynchron_milliseconds_since_last); | |
100 void scheduleSpecial_Evaluate_DataSendToSlave(void); | |
101 void scheduleUpdateDeviceDataChargerFull(void); | |
102 void scheduleUpdateDeviceDataChargerCharging(void); | |
103 | |
104 uint8_t scheduleSetButtonResponsiveness(void); | |
105 | |
106 void copyBatteryData(void); | |
107 | |
108 //void scheduleSurfaceMode_test(void); | |
109 //void scheduleSleepMode_test(void); | |
110 | |
111 #ifdef __cplusplus | |
112 } | |
113 #endif | |
114 | |
115 #endif /* SCHEDULER_H */ | |
116 | |
117 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ |