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 MAX_WIRELESS_BYTES 10
|
|
33 #define SENSOR_PRESSURE_ID 0
|
|
34 #define MAX_SENSORS 1
|
|
35
|
|
36 typedef struct
|
|
37 {
|
|
38 uint8_t mode;
|
|
39 short conservatism;
|
|
40 short repetitive_dive;
|
|
41 long seconds_since_last_dive;
|
|
42 long no_fly_time_minutes;
|
|
43 uint8_t whichGas;
|
|
44 SGas aktualGas[2];
|
|
45 float ceiling_from_main_CPU_mbar;
|
|
46 SLifeData lifeData;
|
|
47 SVpm vpm;
|
|
48 SSettings settings;
|
|
49 SDevice deviceData;
|
|
50 SDataExchangeSlaveToMasterDeviceData deviceDataSendToMaster;
|
|
51 SDataExchangeSlaveToMaster dataSendToMaster;
|
|
52 SDataReceiveFromMaster dataSendToSlave;
|
|
53 _Bool demo_mode;
|
|
54 uint8_t dataSendToSlaveIsValid;
|
|
55 uint8_t dataSendToSlavePending;
|
88
|
56 uint8_t dataSendToSlaveStopEval;
|
38
|
57 uint32_t sync_error_count;
|
|
58 uint32_t check_sync_not_running;
|
|
59 uint8_t ButtonResponsiveness[4];
|
|
60 uint8_t chargerStatus;
|
|
61 uint8_t dataSendToSlaveIsNotValidCount;
|
|
62 uint8_t wirelessdata[MAX_WIRELESS_BYTES];
|
|
63 uint8_t wirelessReceived;
|
|
64 uint8_t wirelessConfidenceStatus;
|
|
65 uint8_t ButtonPICdata[4];
|
|
66 uint8_t accidentFlag;
|
|
67 uint32_t accidentRemainingSeconds;
|
|
68 uint8_t sensorError[MAX_SENSORS];
|
|
69 uint8_t I2C_SystemStatus;
|
|
70 } SGlobal;
|
|
71
|
|
72 typedef struct
|
|
73 {
|
|
74 long seconds_since_last_dive;
|
|
75 long no_fly_time_minutes;
|
|
76 } SBackup;
|
|
77
|
|
78 /* Variables ---------------------------------------------------------*/
|
|
79 extern SGlobal global;
|
|
80
|
|
81
|
|
82 /* Function prototypes -----------------------------------------------*/
|
|
83
|
|
84 void initGlobals(void);
|
|
85
|
|
86 void scheduleSurfaceMode(void);
|
|
87 void scheduleDiveMode(void);
|
|
88 void scheduleSleepMode(void);
|
|
89 void scheduleCompassCalibrationMode(void);
|
|
90 void scheduleTestMode(void);
|
|
91
|
|
92 void scheduleUpdateLifeData(int32_t asynchron_milliseconds_since_last);
|
|
93 void scheduleSpecial_Evaluate_DataSendToSlave(void);
|
|
94 void scheduleUpdateDeviceDataChargerFull(void);
|
|
95 void scheduleUpdateDeviceDataChargerCharging(void);
|
|
96
|
|
97 uint8_t scheduleSetButtonResponsiveness(void);
|
|
98
|
|
99 void copyBatteryData(void);
|
|
100
|
|
101 //void scheduleSurfaceMode_test(void);
|
|
102 //void scheduleSleepMode_test(void);
|
|
103
|
|
104 #ifdef __cplusplus
|
|
105 }
|
|
106 #endif
|
|
107
|
|
108 #endif /* SCHEDULER_H */
|
|
109
|
|
110 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/
|