comparison Small_CPU/Inc/scheduler.h @ 207:b95741467355 ImprovmentSPI

Introduce scheduler function The first implementation was only focussed on doing a hard sync and the new one uses an interface instead of global variables
author ideenmodellierer
date Sun, 24 Mar 2019 22:53:17 +0100
parents 331882a89421
children e524a824d8f2
comparison
equal deleted inserted replaced
206:0bb6a8e7be9d 207:b95741467355
30 30
31 /* Types -------------------------------------------------------------*/ 31 /* Types -------------------------------------------------------------*/
32 #define SENSOR_PRESSURE_ID 0 32 #define SENSOR_PRESSURE_ID 0
33 #define MAX_SENSORS 1 33 #define MAX_SENSORS 1
34 34
35 #define SPI_SYNC_METHOD_NONE (0u)
36 #define SPI_SYNC_METHOD_HARD (1u) /* Scheduler shall reset all counters to 0 */
37 #define SPI_SYNC_METHOD_SOFT (2u) /* Scheduler shall reset adjust counters to 100ms SPI data exchange cycle */
38 #define SPI_SYNC_METHOD_INVALID (4u)
39
35 typedef struct 40 typedef struct
36 { 41 {
37 uint8_t mode; 42 uint8_t mode;
38 short conservatism; 43 short conservatism;
39 short repetitive_dive; 44 short repetitive_dive;
81 } SScheduleCtrl; 86 } SScheduleCtrl;
82 87
83 88
84 /* Variables ---------------------------------------------------------*/ 89 /* Variables ---------------------------------------------------------*/
85 extern SGlobal global; 90 extern SGlobal global;
86 extern uint8_t dohardspisync;
87 91
88 92
89 /* Function prototypes -----------------------------------------------*/ 93 /* Function prototypes -----------------------------------------------*/
90 94
91 void initGlobals(void); 95 void initGlobals(void);
99 void scheduleUpdateLifeData(int32_t asynchron_milliseconds_since_last); 103 void scheduleUpdateLifeData(int32_t asynchron_milliseconds_since_last);
100 void scheduleSpecial_Evaluate_DataSendToSlave(void); 104 void scheduleSpecial_Evaluate_DataSendToSlave(void);
101 void scheduleUpdateDeviceDataChargerFull(void); 105 void scheduleUpdateDeviceDataChargerFull(void);
102 void scheduleUpdateDeviceDataChargerCharging(void); 106 void scheduleUpdateDeviceDataChargerCharging(void);
103 107
108 void Scheduler_Request_sync_with_SPI(uint8_t SyncMethod);
109 void Scheduler_SyncToSPI(void);
110
104 uint8_t scheduleSetButtonResponsiveness(void); 111 uint8_t scheduleSetButtonResponsiveness(void);
105 112
106 void copyBatteryData(void); 113 void copyBatteryData(void);
107 114
108 //void scheduleSurfaceMode_test(void); 115 //void scheduleSurfaceMode_test(void);