From 696bce8bda1e4a988b8c6ce93884dda61408cc6c Mon Sep 17 00:00:00 2001 From: Erki Date: Tue, 14 Sep 2021 23:38:05 +0300 Subject: [PATCH] Peripherals: Fix IR sensors not initializing offsets to 0 --- Peripherals/Inc/peripherals_ir_sensors.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Peripherals/Inc/peripherals_ir_sensors.hpp b/Peripherals/Inc/peripherals_ir_sensors.hpp index e6c135d..a399abb 100644 --- a/Peripherals/Inc/peripherals_ir_sensors.hpp +++ b/Peripherals/Inc/peripherals_ir_sensors.hpp @@ -43,6 +43,9 @@ public: : adc(hadc), channels_(channels), gpios_{std::forward(gpios)...} { static_assert(sizeof...(Args) == N, "Not enough GPIOs passed."); + + for (auto& o : offsets_) + o = 0; } void startReading()