Umstrukuriert/windows-app hinzugefügt

This commit is contained in:
2025-11-23 23:52:28 +01:00
parent 5cbc5adc4e
commit 8dc70f5499
1650 changed files with 17 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include <stdbool.h>
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Bits im EventGroup */
#define SYS_STATUS_WIFI_OK (1 << 0)
#define SYS_STATUS_INFLUX_OK (1 << 1)
#define SYS_STATUS_MDNS_OK (1 << 2)
void sys_status_init(void);
EventGroupHandle_t sys_status_group(void);
/* Convenience-Setter/Getter */
static inline void sys_status_set_wifi_ok(bool ok) { EventGroupHandle_t g = sys_status_group(); if (ok) xEventGroupSetBits(g, SYS_STATUS_WIFI_OK); else xEventGroupClearBits(g, SYS_STATUS_WIFI_OK); }
static inline void sys_status_set_influx_ok(bool ok) { EventGroupHandle_t g = sys_status_group(); if (ok) xEventGroupSetBits(g, SYS_STATUS_INFLUX_OK); else xEventGroupClearBits(g, SYS_STATUS_INFLUX_OK); }
static inline void sys_status_set_mdns_ok(bool ok) { EventGroupHandle_t g = sys_status_group(); if (ok) xEventGroupSetBits(g, SYS_STATUS_MDNS_OK); else xEventGroupClearBits(g, SYS_STATUS_MDNS_OK); }
static inline bool sys_status_get_wifi_ok(void) { return (xEventGroupGetBits(sys_status_group()) & SYS_STATUS_WIFI_OK) != 0; }
static inline bool sys_status_get_influx_ok(void) { return (xEventGroupGetBits(sys_status_group()) & SYS_STATUS_INFLUX_OK) != 0; }
static inline bool sys_status_get_mdns_ok(void) { return (xEventGroupGetBits(sys_status_group()) & SYS_STATUS_MDNS_OK) != 0; }
#ifdef __cplusplus
}
#endif