From 7892ef9d248c189be68ce7faf63230ec0a318b67 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 10:11:32 +0100 Subject: refactor: reorganize & add debugging --- src/calibration.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/calibration.hpp') diff --git a/src/calibration.hpp b/src/calibration.hpp index 79b3758..e66b6fc 100644 --- a/src/calibration.hpp +++ b/src/calibration.hpp @@ -1,7 +1,9 @@ #ifndef CALIBRATION_HPP #define CALIBRATION_HPP -#include "sensor.hpp" +#include "sensor/sensor.hpp" +#include "utils/memory.hpp" +#include "utils/serial.hpp" // Calibration precision #define ACCEL_CAL_X_MAX 0.006 @@ -37,8 +39,9 @@ public: * Sensor calibrator. * * @param sensor A sensor to calibrate + * @param sout A Serial output stream */ - SensorCalibrator(Sensor *sensor); + SensorCalibrator(unique_ptr &sensor, SerialStream sout); /** * Calibrates the sensor. @@ -57,7 +60,9 @@ private: void _adjustCalibration(); - Sensor *_sensor; + unique_ptr &_sensor; + + SerialStream _sout; float _accel_x; float _accel_y; -- cgit v1.2.3-18-g5258