Mercurial > public > ostc4
diff Discovery/Src/data_exchange_main.c @ 82:a6f0881074a4 kittz
+i2c analog noise filtering
spi more stable
author | Dmitry Romanov <kitt@bk.ru> |
---|---|
date | Tue, 20 Nov 2018 12:08:19 +0300 |
parents | 8f8ea3a32e82 |
children | e746bf846638 |
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c Sat Oct 06 15:02:11 2018 +0200 +++ b/Discovery/Src/data_exchange_main.c Tue Nov 20 12:08:19 2018 +0300 @@ -327,6 +327,7 @@ //HAL_GPIO_WritePin(OSCILLOSCOPE2_GPIO_PORT,OSCILLOSCOPE2_PIN,GPIO_PIN_RESET); /* only for testing with Oscilloscope */ SPI_DMA_answer = HAL_SPI_TransmitReceive_DMA(&cpu2DmaSpi, (uint8_t *)&dataOut, (uint8_t *)&dataIn, EXCHANGE_BUFFERSIZE+1); + HAL_Delay(3); if(SPI_DMA_answer != HAL_OK) DataEX_Error_Handler(SPI_DMA_answer); //HAL_Delay(3); @@ -335,6 +336,31 @@ return 1; } + +uint32_t SPI_CALLBACKS; +uint32_t get_num_SPI_CALLBACKS(void){ + return SPI_CALLBACKS; +} + +SDataExchangeSlaveToMaster* get_dataInPointer(void){ + return &dataIn; +} + + +void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) +{ + + + if(hspi == &cpu2DmaSpi) + { + SPI_CALLBACKS+=1; + } +} + + + + + void DateEx_copy_to_dataOut(void) { const SDiveState * pStateReal = stateRealGetPointer();