mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-15 12:50:04 +00:00
- admin screen: telemetry via upstream LPPDataHelpers (ported; fixed its 1-byte humidity size), every field, per-channel, signed current (helpers/ui/telemetry_text) - battery %: both UIs show ZephyrBoard::getBattPercent() (discharge curve / fuel gauge) instead of a linear 3.0-4.2 V estimate - app/PowerPolicy: low-battery auto-shutdown + v-contact alert + autoshutdown CLI on every companion (headless too); under 2000 mV counts as no battery; default 3200 mV, stored 3300 migrated once - one time_sync.c for both UIs; ui_push_radio_state() for all roles - repeater admin screen in its own file; handleInput split per mode - dead UI code removed; companion help fits one reply frame
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
* Joystick UI: track which source last set the RTC (System > Info > Time).
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <zephyr/sys/util.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum time_sync_source {
|
|
TIME_SYNC_NONE = 0,
|
|
TIME_SYNC_GPS,
|
|
TIME_SYNC_APP,
|
|
TIME_SYNC_WIFI,
|
|
TIME_SYNC_CLI,
|
|
TIME_SYNC_MESH, /* mesh time-sync consensus step */
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DESIGN_JOYSTICK) || \
|
|
IS_ENABLED(CONFIG_ZEPHCORE_UI_DESIGN_BUTTON)
|
|
|
|
void time_sync_report(enum time_sync_source src);
|
|
|
|
/* Current effective time source (prefers live GPS sync). TIME_SYNC_NONE
|
|
* if the RTC has never been set. */
|
|
enum time_sync_source time_sync_get_source(void);
|
|
|
|
#else
|
|
|
|
static inline void time_sync_report(enum time_sync_source src)
|
|
{
|
|
ARG_UNUSED(src);
|
|
}
|
|
|
|
static inline enum time_sync_source time_sync_get_source(void)
|
|
{
|
|
return TIME_SYNC_NONE;
|
|
}
|
|
|
|
#endif /* CONFIG_ZEPHCORE_UI_DESIGN_JOYSTICK || _BUTTON */
|
|
|
|
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DESIGN_JOYSTICK) || \
|
|
IS_ENABLED(CONFIG_ZEPHCORE_UI_DESIGN_BUTTON)
|
|
/* helpers/ui/time_sync.c: the last sync source as text (the joystick UI's
|
|
* System > Info > Time). */
|
|
const char *time_sync_display_label(void);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|