changeset 479:4b9427ae0a65 Improve_Button_Sleep

Bugfix unintended else condition: Most likely copy past error in preparation of last commit...
author ideenmodellierer
date Wed, 13 May 2020 21:27:30 +0200
parents 58200d756365
children 3fe9cc747c5c
files Small_CPU/Src/pressure.c
diffstat 1 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Small_CPU/Src/pressure.c	Tue May 12 23:03:50 2020 +0200
+++ b/Small_CPU/Src/pressure.c	Wed May 13 21:27:30 2020 +0200
@@ -220,8 +220,6 @@
 }
 void update_surface_pressure(uint8_t call_rhythm_seconds)
 {
-
-
 	if(is_init_pressure_done())
 	{
 		runningAvg = (runningAvg * avgCount + ambient_pressure_mbar) / (avgCount +1);
@@ -471,20 +469,21 @@
 	{
 		*statusReturn = statusReturnTemp;
 	}
-	else
+
+	switch (cmd & 0x0f) // wait necessary conversion time
 	{
-		switch (cmd & 0x0f) // wait necessary conversion time
-		{
-			case CMD_ADC_256 : HAL_Delay(1); break;
-			case CMD_ADC_512 : HAL_Delay(3); break;
-			case CMD_ADC_1024: HAL_Delay(4); break;
-			case CMD_ADC_2048: HAL_Delay(6); break;
-			case CMD_ADC_4096: HAL_Delay(10); break;
-			default:
-				break;
-		}
-		adcValue = get_adc();
-		if(adcValue == 0xFFFFFFFF)
+		case CMD_ADC_256 : HAL_Delay(1); break;
+		case CMD_ADC_512 : HAL_Delay(3); break;
+		case CMD_ADC_1024: HAL_Delay(4); break;
+		case CMD_ADC_2048: HAL_Delay(6); break;
+		case CMD_ADC_4096: HAL_Delay(10); break;
+		default:
+			break;
+	}
+	adcValue = get_adc();
+	if(adcValue == 0xFFFFFFFF)
+	{
+		if(statusReturn)
 		{
 			*statusReturn = HAL_ERROR;
 		}