From 7b7c37364d455acba9e11ff9eecf762fb9274b9e Mon Sep 17 00:00:00 2001
From: Federico Mandelli <federico.mandelli@skywarder.eu>
Date: Wed, 17 Jul 2024 09:15:38 +0200
Subject: [PATCH] [Sensors] Updated adc frequency to 1,6khz and fixed warning

---
 src/boards/MockupMain/Configs/SensorsConfig.h | 7 ++++---
 src/boards/MockupMain/PinHandler/PinHandler.h | 3 +--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/boards/MockupMain/Configs/SensorsConfig.h b/src/boards/MockupMain/Configs/SensorsConfig.h
index 3c06ffb80..e0c97b263 100644
--- a/src/boards/MockupMain/Configs/SensorsConfig.h
+++ b/src/boards/MockupMain/Configs/SensorsConfig.h
@@ -1,5 +1,6 @@
 /* Copyright (c) 2024 Skyward Experimental Rocketry
  * Author: Angelo Prete
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
@@ -92,9 +93,9 @@ constexpr auto UBXGPS_PERIOD = 6_hz;
 // ADS
 constexpr Boardcore::ADS131M08Defs::OversamplingRatio
     ADS131M08_OVERSAMPLING_RATIO =
-        Boardcore::ADS131M08Defs::OversamplingRatio::OSR_1024;
+        Boardcore::ADS131M08Defs::OversamplingRatio::OSR_512;
 constexpr bool ADS131M08_GLOBAL_CHOP_MODE = true;
-constexpr auto ADS131M08_PERIOD           = 1000_hz;
+constexpr auto ADS131M08_PERIOD           = 1600_hz;
 
 // UNUSED - How many bytes go into the fifo each second
 constexpr unsigned int BMX160_FIFO_FILL_RATE =
@@ -131,7 +132,7 @@ constexpr auto INTERNAL_ADC_SAMPLE_PERIOD  = 1_hz;
 constexpr auto INTERNAL_TEMP_SAMPLE_PERIOD = 1_hz;
 
 // LoadCell
-constexpr auto LOAD_CELL_SAMPLE_PERIOD = 1000_hz;
+constexpr auto LOAD_CELL_SAMPLE_PERIOD = ADS131M08_PERIOD;
 constexpr Boardcore::ADS131M08Defs::Channel LOAD_CELL_ADC_CHANNEL =
     Boardcore::ADS131M08Defs::Channel::CHANNEL_0;
 // TODO set calibration
diff --git a/src/boards/MockupMain/PinHandler/PinHandler.h b/src/boards/MockupMain/PinHandler/PinHandler.h
index 6507b200f..f7e828c00 100644
--- a/src/boards/MockupMain/PinHandler/PinHandler.h
+++ b/src/boards/MockupMain/PinHandler/PinHandler.h
@@ -60,9 +60,8 @@ public:
 private:
     Boardcore::PrintLogger logger = Boardcore::Logging::getLogger("pinhandler");
 
-    Boardcore::PinObserver pinObserver;
-
     std::atomic<bool> running;
+    Boardcore::PinObserver pinObserver;
 };
 
 }  // namespace MockupMain
-- 
GitLab