Files
ZephCore/zephcore/src/mesh_events.h
T
liquidraver d5bd805710 peripherals & power: GPS fixes, poweroff/pwrmgt, upstream SensorManager telemetry
- gps: servers honour gps_enabled at boot (was lost on reboot; zc.gps_set
  upgrades older prefs to on once); sleep lock only while acquiring;
  gps off works on boards without a power line (UART sleep); UI toggles
  and fixes handled on the main thread; configure only after a good init;
  observer parks its GPS; one interval clamp (clampGpsInterval); one
  nav-mode knob (room servers on Air530Z now stationary); GNSS UARTE from DT
- gps: split into ZephyrGPSManager / gps_power / gps_module_cfg
  (+gps_internal.h); dead driver branches, gps_get_diag, sats_* removed
- clock: ZephyrRTCClock writes the hardware RTC itself (clkreboot now
  resets it); MESH_EVENT_RTC_SAVE gone
- power: one power-off path (zephcore_power_off, ZephyrBoard::powerOff),
  poweroff/shutdown CLI, get pwrmgt.*, crash record kept across reboot,
  battery reading cached 10 s, fuel gauge on the current API
- telemetry: upstream SensorManager + CayenneLPP (rounded to nearest),
  one builder for all roles; per-sensor channels, MCU temp always,
  guest gating and inverse mask on servers; sensor list/get/set work;
  BME280/BMP280 also probed at 0x77
- CLI: gps in upstream's form, get gps detail, gps sync
2026-09-25 17:56:34 +02:00

31 lines
1.3 KiB
C

/*
* SPDX-License-Identifier: MIT
* Event bits of the mesh thread's k_event, shared by every role.
*
* Each role's main loop blocks in k_event_wait() on these; ISR and work-queue
* callbacks post them. Bits 0-6 mean the same thing in every role that has
* them; bits 2 and 3 are the role's transport input and time tick under
* role-specific names. Role-only bits start at MESH_EVENT_ROLE_BASE.
*/
#pragma once
#include <zephyr/sys/util.h>
#define MESH_EVENT_LORA_RX BIT(0) /* LoRa packet received */
#define MESH_EVENT_LORA_TX_DONE BIT(1) /* LoRa TX complete */
/* Transport input */
#define MESH_EVENT_BLE_RX BIT(2) /* companion: BLE/USB frame received */
#define MESH_EVENT_CLI_RX BIT(2) /* servers, observer: USB CLI line received */
/* Time tick */
#define MESH_EVENT_HOUSEKEEPING BIT(3) /* companion: periodic housekeeping */
#define MESH_EVENT_MAINTENANCE BIT(3) /* servers: a maintenance deadline came due */
#define MESH_EVENT_GPS_ACTION BIT(4) /* GPS state change or fix (must run on the main thread) */
#define MESH_EVENT_TX_DRAIN BIT(5) /* outbound packet delay expired, run checkSend */
/* BIT(6) free: was MESH_EVENT_RTC_SAVE, until ZephyrRTCClock wrote the hardware RTC itself */
#define MESH_EVENT_ROLE_BASE 7 /* first role-only bit */