diff --git a/ADIS_Sumo_Styger/Sumo/Reflectance.c b/ADIS_Sumo_Styger/Sumo/Reflectance.c index bd361e7..b6ba089 100644 --- a/ADIS_Sumo_Styger/Sumo/Reflectance.c +++ b/ADIS_Sumo_Styger/Sumo/Reflectance.c @@ -732,8 +732,12 @@ static void REF_StateMachine(void) { static void ReflTask(void *pvParameters) { (void)pvParameters; /* not used */ for(;;) { - REF_StateMachine(); - vTaskDelay(5/portTICK_PERIOD_MS); + if (REF_Sensor.isEnabled) { + REF_StateMachine(); + vTaskDelay(pdMS_TO_TICKS(5)); + } else { + vTaskDelay(pdMS_TO_TICKS(100)); + } } } @@ -750,7 +754,7 @@ void REF_Init(void) { }; REF_Sensor.isEnabled = true; - REF_Sensor.savePower = true; + REF_Sensor.savePower = false; /* turn off, as this extends the ref sensor task time by around 200 us */ McuGPIO_GetDefaultConfig(&gpioConfig); /* IR on/off: PTD1, high active */ gpioConfig.hw.gpio = GPIOD;