changeset 154:1ac5033f7c7a FlipDisplay

Keep NSS low during SPI transfer only
author Ideenmodellierer
date Sun, 03 Mar 2019 17:45:39 +0100
parents 791cdfad0c8e
children 4fd8bbc7d841
files Discovery/Src/data_exchange_main.c
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c	Sun Mar 03 12:19:47 2019 +0100
+++ b/Discovery/Src/data_exchange_main.c	Sun Mar 03 17:45:39 2019 +0100
@@ -299,8 +299,6 @@
 {
 	uint8_t SPI_DMA_answer = 0;
 
-	HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET);
-	delayMicros(10); //~exchange time(+20% reserve)
 	HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_RESET);
 
 	if(data_old__lost_connection_to_slave_counter_temp >= 3)
@@ -355,10 +353,9 @@
 
 void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi)
 {
-
-
 	if(hspi == &cpu2DmaSpi)
 	{
+		HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET);
 		SPI_CALLBACKS+=1;
 	}
 }