diff Small_CPU/Src/spi.c @ 278:cc30d1aa03a7

Merged in Ideenmodellierer/ostc4/IPC_Sync_Improvment_3 (pull request #21) IPC Sync Improvment 3
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Sun, 28 Apr 2019 15:54:46 +0000
parents 580822b5d3d1
children 2fc08a0d1ec3
line wrap: on
line diff
--- a/Small_CPU/Src/spi.c	Sun Apr 28 09:41:43 2019 +0200
+++ b/Small_CPU/Src/spi.c	Sun Apr 28 15:54:46 2019 +0000
@@ -358,9 +358,10 @@
 				HAL_SPI_Abort_IT(&hspi1);
 				Scheduler_Request_sync_with_SPI(SPI_SYNC_METHOD_HARD);
 			}
-			 else
-			 {
-			 }
+			else
+			{
+			}
+			SPI_Start_single_TxRx_with_Master();
 		}
 		else
 		{
@@ -386,6 +387,7 @@
 					global.dataSendToMaster.header.checkCode[SPI_HEADER_INDEX_RX_STATE] = SPI_RX_STATE_OFFLINE;
 					resettimeout = 0;
 				}
+				HAL_SPI_TransmitReceive_DMA(&hspi1,(uint8_t*) &(global.dataSendToMaster),(uint8_t*) &(global.dataSendToSlave), EXCHANGE_BUFFERSIZE);
 		}
 
 		global.dataSendToMaster.power_on_reset = 0;
@@ -393,8 +395,6 @@
 
 		scheduleSpecial_Evaluate_DataSendToSlave();
 
-		SPI_Start_single_TxRx_with_Master();
-
 		if(resettimeout)
 		{
 				global.check_sync_not_running = 0;