diff Discovery/Src/data_exchange_main.c @ 149:e1d66bc78f9a FlipDisplay

Eliminate warnings
author Ideenmodellierer
date Sat, 02 Mar 2019 17:42:06 +0100
parents 30d855ea60d8
children 1ac5033f7c7a
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c	Sat Mar 02 17:01:06 2019 +0100
+++ b/Discovery/Src/data_exchange_main.c	Sat Mar 02 17:42:06 2019 +0100
@@ -302,8 +302,6 @@
 	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);
-	/* one cycle with NotChipSelect true to clear slave spi buffer */
-
 
 	if(data_old__lost_connection_to_slave_counter_temp >= 3)
 	{
@@ -312,14 +310,20 @@
 		{
 			HAL_SPI_Abort_IT(&cpu2DmaSpi);
 		}
-
 		/* reset of own DMA does not work ==> request reset of slave dma */
-		if((DataEX_check_header_and_footer_shifted()) && (data_old__lost_connection_to_slave_counter_retry >= 2))
+		if((DataEX_check_header_and_footer_shifted()) && (data_old__lost_connection_to_slave_counter_retry == 2))
 		{
 			dataOut.header.checkCode[SPI_HEADER_INDEX_SLAVE] = 0xA5;
 		}
 		data_old__lost_connection_to_slave_counter_retry++;
 	}
+#if USE_OLD_SYNC_METHOD
+	/* one cycle with NotChipSelect true to clear slave spi buffer */
+	else
+	{
+		HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_RESET);
+	}
+#endif
 
 	DataEx_call_helper_requests();
 
@@ -327,10 +331,10 @@
 
 
 	SPI_DMA_answer = HAL_SPI_TransmitReceive_DMA(&cpu2DmaSpi, (uint8_t *)&dataOut, (uint8_t *)&dataIn, EXCHANGE_BUFFERSIZE);
-//	HAL_Delay(3);
 	if(SPI_DMA_answer != HAL_OK)
+	{
 		DataEX_Error_Handler(SPI_DMA_answer);
-
+	}		
 //	HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET);
 //HAL_Delay(3);
 //HAL_GPIO_WritePin(OSCILLOSCOPE2_GPIO_PORT,OSCILLOSCOPE2_PIN,GPIO_PIN_SET); /* only for testing with Oscilloscope */
@@ -851,6 +855,10 @@
 	float ambient, surface, density, meter;
 	SSettings *pSettings;
 	
+	ambient = 0;
+	surface = 0;
+	meter = 0;
+
 	/*	uint8_t IAmStolenPleaseKillMe;
 	 */
 	pSettings = settingsGetPointer();