move out everything out of main into a separate file

This commit is contained in:
2025-12-28 22:01:37 +01:00
parent 2178d87718
commit 0dc78be629
3 changed files with 209 additions and 181 deletions

28
include/app.hpp Normal file
View File

@@ -0,0 +1,28 @@
#ifndef APP_HPP
#define APP_HPP
#include <cpu.hpp>
#include <gpu.hpp>
#include <mutex>
#include <sys.hpp>
namespace app {
struct sensors {
sys::TimeDate td;
double avg[3] = {0.0f};
sys::Memory ram;
sys::Disk home;
sys::Network net;
sys::sysSensors sys;
cpu::cpuSensors cpu;
gpu::gpuSensors gpu;
float hass_state = 0.0f;
std::mutex mtx; // making sure the struct isnt accessed by multiple threads at once
};
void start(void);
} // namespace app
#endif