Cleanup and structirng
Some checks failed
Test compiling project / test (push) Failing after 1m35s

This commit is contained in:
2024-12-08 19:42:24 +01:00
parent ec332c5f76
commit ff97ae18eb
11 changed files with 155 additions and 130 deletions

21
src/tools/tools.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include <Arduino.h>
#include "tools.h"
#include <ArduinoLog.h>
void printSuffix(Print* _logOutput, int logLevel)
{
_logOutput->print(CR);
}
void print_prefix(Print* _logOutput, int logLevel)
{
_logOutput->print("WATERMETER - C");
_logOutput->print(xPortGetCoreID());
_logOutput->print(" - ");
_logOutput->print(pcTaskGetName(xTaskGetCurrentTaskHandle()));
_logOutput->print(" - ");
}
bool is_error(ActiveErrors active_errors) {
return active_errors.current_high || active_errors.current_low || active_errors.level_high || active_errors.level_low || active_errors.voltage_high || active_errors.voltage_low;
}