From 5ffaee918a8e09b968d8d66a045bd9331169f077 Mon Sep 17 00:00:00 2001 From: fruchti Date: Wed, 15 Jul 2020 13:47:59 +0200 Subject: [PATCH] Wait for measurement to complete light sensor init --- src/light_sensor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/light_sensor.c b/src/light_sensor.c index 2d79442..4c2d42c 100644 --- a/src/light_sensor.c +++ b/src/light_sensor.c @@ -55,6 +55,9 @@ void LightSensor_Init(void) NVIC_EnableIRQ(TIM14_IRQn); LightSensor_Measure(); + + while(!LightSensor_NewMeasurement); + LightSensor_Poll(); } void LightSensor_Poll(void)