From 2ca4adbeeb753c6831d152dc3c65c3f564b21980 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 11 Sep 2026 13:08:28 +0100 Subject: [PATCH] Export remaining power/battery internal to apps The gas-gauge readings (voltage, current, temperature, capacity, health, charge state) are already exported by stock firmware; add the one remaining safe reader, furi_hal_power_insomnia_level. furi_hal_power_init stays disabled because re-initialising the power HAL from an app is unsafe. --- README.md | 4 ++++ build.sh | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 6c83dfd..811ff68 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,10 @@ symbol costs one API-table entry. without going through the firmware's serial profile. The coprocessor firmware-update calls (`ble_glue_fus_stack_delete/install`) are deliberately left disabled, since they can erase the radio stack. +* **Power / battery internals**: the gas-gauge readings (voltage, current, + temperature, remaining/full/design capacity, health, charge state) are + already exported by stock firmware. This build also enables + `furi_hal_power_insomnia_level`; `furi_hal_power_init` stays disabled. `build.sh` also widens the GAP roles the firmware initialises (`GAP_PERIPHERAL_ROLE | GAP_CENTRAL_ROLE | GAP_OBSERVER_ROLE`) in diff --git a/build.sh b/build.sh index 360e70d..030fcab 100755 --- a/build.sh +++ b/build.sh @@ -112,6 +112,13 @@ EXPORT_ENABLE+=' ^ble_glue_(start|stop|get_c2_status|get_hardfault_info|force_c2_mode)$ ^furi_hal_bt_init$ ' +# Power / battery internals: the gas-gauge readings (voltage, current, +# temperature, capacity, health, charge state) are already exported by stock +# firmware; this adds the remaining safe reader. furi_hal_power_init stays +# disabled (re-initialising the power HAL from an app is unsafe). +EXPORT_ENABLE+=' +^furi_hal_power_insomnia_level$ +' export EXPORT_ENABLE if grep -q "^Function,?," "$API_CSV" || ! grep -qE "^Header,\+,.*ble_hci_le\.h" "$API_CSV"; then # fbt notices the new headers, rewrites the csv with '?' entries and stops.