# HG changeset patch # User Ideenmodellierer # Date 1551631539 -3600 # Node ID 1ac5033f7c7a9a0da7e05da9b45c2975fe6800ef # Parent 791cdfad0c8eea9831b93cc121c6ab7bd5d8eab0 Keep NSS low during SPI transfer only diff -r 791cdfad0c8e -r 1ac5033f7c7a Discovery/Src/data_exchange_main.c --- 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; } }