From 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 19:12:26 +1000 Subject: WIP merge cyclically dependent components into one big component --- src/battery/include/battery.hpp | 49 ----------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/battery/include/battery.hpp (limited to 'src/battery/include') diff --git a/src/battery/include/battery.hpp b/src/battery/include/battery.hpp deleted file mode 100644 index 314cd373..00000000 --- a/src/battery/include/battery.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 jacqueline - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include - -#include "freertos/FreeRTOS.h" -#include "freertos/timers.h" - -#include "adc.hpp" -#include "samd.hpp" - -namespace battery { - -class Battery { - public: - Battery(drivers::Samd& samd, std::unique_ptr adc); - ~Battery(); - - auto Update() -> void; - - struct BatteryState { - uint_fast8_t percent; - uint32_t millivolts; - bool is_charging; - - bool operator==(const BatteryState& other) const { - return percent == other.percent && is_charging == other.is_charging; - } - }; - - auto State() -> std::optional; - - private: - auto EmitEvent() -> void; - - drivers::Samd& samd_; - std::unique_ptr adc_; - - TimerHandle_t timer_; - std::mutex state_mutex_; - std::optional state_; -}; - -} // namespace battery -- cgit v1.2.3