Files
Blinds_XIAO/include/mainEventLoop.hpp

35 lines
715 B
C++
Raw Permalink Normal View History

#ifndef BM_EVENTS_H
#define BM_EVENTS_H
2026-03-09 02:29:03 -05:00
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
2026-03-09 02:29:03 -05:00
#include "freertos/task.h"
#ifdef __cplusplus
extern "C" {
#endif
2026-03-09 02:29:03 -05:00
// Shared with max17048.c (C) — only C-compatible types here
typedef enum {
2026-03-09 02:29:03 -05:00
EVENT_CLEAR_CALIB,
EVENT_SAVE_POS,
EVENT_REQUEST_POS,
EVENT_BATTERY_CRITICAL, // stop servo, save pos, alert server, deep sleep
EVENT_BATTERY_WARNING, // alert server (no shutdown)
EVENT_REPORT_SOC, // periodic SOC sync to server
} main_event_type_t;
extern QueueHandle_t main_event_queue;
2026-03-09 02:29:03 -05:00
extern TaskHandle_t wakeTaskHandle;
2026-03-09 02:29:03 -05:00
#ifdef __cplusplus
}
#endif
2026-03-09 02:29:03 -05:00
#ifdef __cplusplus
void mainEventLoop();
void wakeTimer(void* pvParameters);
#endif
2026-03-09 02:29:03 -05:00
#endif