Mercurial > public > ostc4
comparison Small_CPU/Src/scheduler.c @ 155:4fd8bbc7d841 FlipDisplay
Do hard sync after communication timeout > 1 second
author | Ideenmodellierer |
---|---|
date | Sun, 03 Mar 2019 17:46:50 +0100 |
parents | ee744c7160ce |
children | c659fda83e44 |
comparison
equal
deleted
inserted
replaced
154:1ac5033f7c7a | 155:4fd8bbc7d841 |
---|---|
430 ****************************************************************************** | 430 ****************************************************************************** |
431 */ | 431 */ |
432 | 432 |
433 void schedule_check_resync(void) | 433 void schedule_check_resync(void) |
434 { | 434 { |
435 //TODO: REMOVE | 435 /* counter is incremented in cyclic 100ms loop and reset to 0 if the transmission complete callback is called */ |
436 if((global.check_sync_not_running >= 3)) | 436 if((global.check_sync_not_running >= 3)) |
437 { | 437 { |
438 // global.dataSendToSlaveIsNotValidCount = 0; | 438 // global.dataSendToSlaveIsNotValidCount = 0; |
439 global.check_sync_not_running = 0; | 439 global.check_sync_not_running = 0; |
440 global.sync_error_count++; | 440 global.sync_error_count++; |
441 | 441 |
442 /* Try to start communication again. If exchange is stuck during execution for some reason the TX will be aborted by the | 442 /* Try to start communication again. If exchange is stuck during execution for some reason the TX will be aborted by the |
443 * function error handler | 443 * function error handler |
444 */ | 444 */ |
445 SPI_Start_single_TxRx_with_Master(); | 445 SPI_Start_single_TxRx_with_Master(); |
446 } | |
447 if((global.check_sync_not_running == 10)) /* connection lost for about a second. Could be debugging or Firmware update */ | |
448 { | |
449 dohardspisync = 1; | |
446 } | 450 } |
447 } | 451 } |
448 | 452 |
449 | 453 |
450 /** | 454 /** |