massive Update

This commit is contained in:
2025-06-02 09:02:19 +02:00
parent 125fc17c39
commit dd34bfe645
11 changed files with 491 additions and 419 deletions

View File

@@ -0,0 +1,18 @@
// === button_actions.h ===
#ifndef _BUTTON_ACTIONS_H_
#define _BUTTON_ACTIONS_H_
#include <Arduino.h>
#include "buttoncontrol.h"
// Deklarationen der Button-Callbacks
void ButtonAction_ToggleMode();
void ButtonAction_StartPurge();
void ButtonAction_ToggleWiFi();
void ButtonAction_WashMode();
// Bereitstellung der Aktionsliste
extern const ButtonActionEntry buttonActions[];
extern const uint8_t buttonActionCount;
#endif

View File

@@ -0,0 +1,30 @@
// === buttoncontrol.h ===
#ifndef _BUTTONCONTROL_H_
#define _BUTTONCONTROL_H_
#include <Arduino.h>
// Aktionen, die vom Button ausgelöst werden können
enum ButtonAction
{
BTN_NONE,
BTN_CUSTOM
};
// Callback-Funktionstyp
typedef void (*ButtonCallback)();
struct ButtonActionEntry
{
uint32_t holdTimeMs;
uint32_t ledColor;
ButtonCallback callback;
};
// Initialisierung des Buttonmoduls
void ButtonControl_Init(uint8_t pin, const ButtonActionEntry *actions, uint8_t actionCount);
// Muss regelmäßig in loop() aufgerufen werden
void ButtonControl_Update();
#endif

View File

@@ -41,9 +41,10 @@
#elif PCB_REV == 4
#define GPIO_BUTTON D4
#define GPIO_LED D3
#define GPIO_TRIGGER D6
#define GPIO_TRIGGER D8
#define GPIO_PUMP D0
#define GPIO_CS_CAN D8
#define GPIO_CE_KLINE D8
#endif
#ifndef HOST_NAME

View File

@@ -16,19 +16,6 @@
#include <Arduino.h>
#include "webui.h"
const char PROGMEM helpCmd[] = "sysinfo - System Info\n"
"netinfo - WiFi Info\n"
"formatPDS - Format Persistence EEPROM Data\n"
"formatCFG - Format Configuration EEPROM Data\n"
"checkEE - Check EEPROM with checksum\n"
"dumpEE1k - dump the first 1kb of EEPROM to Serial\n"
"dumpEE - dump the whole EPPROM to Serial\n"
"resetPageEE - Reset the PersistenceData Page\n"
"dumpCFG - print Config struct\n"
"dumpPDS - print PersistanceStruct\n"
"saveEE - save EE-Data\n"
"showdtc - Show all DTCs\n"
"dumpGlobals - print globals\n";
typedef enum DebugStatus_e
{
@@ -49,6 +36,13 @@ const char sDebugPorts[dbg_cntElements][7] = {
extern DebugStatus_t DebuggerStatus[dbg_cntElements];
enum LogLevel
{
LOG_INFO,
LOG_WARN,
LOG_ERROR
};
void initDebugger();
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
void Debug_pushMessage(const char *format, ...);

View File

@@ -0,0 +1,33 @@
// === ledcontrol.h ===
#ifndef _LEDCONTROL_H_
#define _LEDCONTROL_H_
#include <Arduino.h>
// LED-Muster
enum LedPattern
{
LED_PATTERN_ON,
LED_PATTERN_FLASH,
LED_PATTERN_FLASH_FAST,
LED_PATTERN_BLINK,
LED_PATTERN_BLINK_FAST,
LED_PATTERN_BREATH
};
// Initialisiert die LED-Steuerung
void LEDControl_Init(uint8_t pin);
// Setzt den Basiszustand (Farbe + Pattern), wird verwendet wenn kein Override aktiv ist
void LEDControl_SetBasic(uint32_t color, LedPattern pattern);
// Setzt ein Override mit Timeout (0 = bis explizit gecleart)
void LEDControl_SetOverride(uint32_t color, LedPattern pattern, uint32_t durationMs);
// Hebt das Override wieder auf
void LEDControl_ClearOverride();
// Muss regelmäßig aus loop() aufgerufen werden
void LEDControl_Update();
#endif