changeset 155:4fd8bbc7d841 FlipDisplay

Do hard sync after communication timeout > 1 second
author Ideenmodellierer
date Sun, 03 Mar 2019 17:46:50 +0100
parents 1ac5033f7c7a
children 1fbdb45db701
files Small_CPU/Src/scheduler.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c	Sun Mar 03 17:45:39 2019 +0100
+++ b/Small_CPU/Src/scheduler.c	Sun Mar 03 17:46:50 2019 +0100
@@ -432,7 +432,7 @@
 
 void schedule_check_resync(void)
 {
-	//TODO: REMOVE
+	/* counter is incremented in cyclic 100ms loop and reset to 0 if the transmission complete callback is called */
 	if((global.check_sync_not_running >= 3))
 	{
 //		global.dataSendToSlaveIsNotValidCount = 0;
@@ -444,6 +444,10 @@
 		 */
 		SPI_Start_single_TxRx_with_Master();
 	}
+	if((global.check_sync_not_running == 10)) /* connection lost for about a second. Could be debugging or Firmware update */
+	{
+		dohardspisync = 1;
+	}
 }