From d5d85c20ec76a5d2273e623f759d6b884410cce7 Mon Sep 17 00:00:00 2001 From: Candas1 Date: Wed, 27 Jan 2021 22:45:57 +0100 Subject: [PATCH] At startup, wait until on/off button is released, to prevent entering auto-calibration after flashing --- Src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/main.c b/Src/main.c index 80d0f66..9c86c2b 100644 --- a/Src/main.c +++ b/Src/main.c @@ -199,6 +199,8 @@ int main(void) { int16_t board_temp_adcFilt = adc_buffer.temp; int16_t board_temp_deg_c; + // Loop until button is released + while(HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) HAL_Delay(10); while(1) { HAL_Delay(DELAY_IN_MAIN_LOOP); // delay in ms