Mercurial > public > ostc4
comparison Small_CPU/Src/scheduler.c @ 148:ee744c7160ce FlipDisplay
Use SPI TX callback to synchronize to main CPU
author | Ideenmodellierer |
---|---|
date | Sat, 02 Mar 2019 17:01:06 +0100 |
parents | 69f4b8067daa |
children | 4fd8bbc7d841 |
comparison
equal
deleted
inserted
replaced
147:14e4c83a7559 | 148:ee744c7160ce |
---|---|
56 /* Exported variables --------------------------------------------------------*/ | 56 /* Exported variables --------------------------------------------------------*/ |
57 SGlobal global; | 57 SGlobal global; |
58 SDevice DeviceDataFlash; | 58 SDevice DeviceDataFlash; |
59 uint8_t deviceDataFlashValid = 0; | 59 uint8_t deviceDataFlashValid = 0; |
60 uint8_t deviceDataSubSeconds = 0; | 60 uint8_t deviceDataSubSeconds = 0; |
61 uint8_t dohardspisync = 1; | |
61 | 62 |
62 /* Private variables ---------------------------------------------------------*/ | 63 /* Private variables ---------------------------------------------------------*/ |
63 /* can be lost while in sleep */ | 64 /* can be lost while in sleep */ |
64 uint8_t clearDecoNow = 0; | 65 uint8_t clearDecoNow = 0; |
65 uint8_t setButtonsNow = 0; | 66 uint8_t setButtonsNow = 0; |
179 global.deviceData.diveCycles.value_int32 = 0; | 180 global.deviceData.diveCycles.value_int32 = 0; |
180 global.deviceData.hoursOfOperation.value_int32 = 0; | 181 global.deviceData.hoursOfOperation.value_int32 = 0; |
181 global.deviceData.temperatureMaximum.value_int32 = INT32_MIN; | 182 global.deviceData.temperatureMaximum.value_int32 = INT32_MIN; |
182 global.deviceData.temperatureMinimum.value_int32 = INT32_MAX; | 183 global.deviceData.temperatureMinimum.value_int32 = INT32_MAX; |
183 global.deviceData.voltageMinimum.value_int32 = INT32_MAX; | 184 global.deviceData.voltageMinimum.value_int32 = INT32_MAX; |
185 | |
186 dohardspisync = 1; | |
184 } | 187 } |
185 | 188 |
186 | 189 |
187 void scheduleSpecial_Evaluate_DataSendToSlave(void) | 190 void scheduleSpecial_Evaluate_DataSendToSlave(void) |
188 { | 191 { |
428 */ | 431 */ |
429 | 432 |
430 void schedule_check_resync(void) | 433 void schedule_check_resync(void) |
431 { | 434 { |
432 //TODO: REMOVE | 435 //TODO: REMOVE |
433 if((global.check_sync_not_running >= 2)) | 436 if((global.check_sync_not_running >= 3)) |
434 { | 437 { |
435 // global.dataSendToSlaveIsNotValidCount = 0; | 438 // global.dataSendToSlaveIsNotValidCount = 0; |
436 global.check_sync_not_running = 0; | 439 global.check_sync_not_running = 0; |
437 global.sync_error_count++; | 440 global.sync_error_count++; |
438 | 441 |
902 Scheduler.counterAmbientLight100msec = 0; | 905 Scheduler.counterAmbientLight100msec = 0; |
903 Scheduler.counterWireless1msec = 0; | 906 Scheduler.counterWireless1msec = 0; |
904 } | 907 } |
905 } | 908 } |
906 } | 909 } |
907 static uint8_t dohardspisync = 1; | |
908 | 910 |
909 void HardSyncToSPI() | 911 void HardSyncToSPI() |
910 { | 912 { |
911 if(dohardspisync) | 913 if(dohardspisync) |
912 { | 914 { |