Skip to content

feat: show power consumption in power menu - #71

Open
4RH1T3CT0R7 wants to merge 2 commits into
flipperdevices:devfrom
4RH1T3CT0R7:feature/23-power-consumption-menu
Open

feat: show power consumption in power menu#71
4RH1T3CT0R7 wants to merge 2 commits into
flipperdevices:devfrom
4RH1T3CT0R7:feature/23-power-consumption-menu

Conversation

@4RH1T3CT0R7

Copy link
Copy Markdown
Contributor
  • Display INA219 voltage, current, and power readings in the power menu header
  • Values update every 1 second via periodic FuriEventLoopTimer
  • Uses existing Power service API (power_ina219_get_voltage_v/current_a/power_w)

Closes #23

@DrZlo13
DrZlo13 self-requested a review March 19, 2026 23:39
Comment thread applications/services/power_menu/power_menu.c Outdated
Comment thread applications/services/power_menu/power_menu.c Outdated
@4RH1T3CT0R7
4RH1T3CT0R7 requested a review from DrZlo13 March 20, 2026 07:04
An optional line between the title and the items, separated from them by
a border. Unlike the title, the status holds a value that changes every
few seconds, so it lives in a fixed buffer in the view model instead of
on the heap: formatting straight into it allocates nothing and keeps the
pointer Clay captures during layout valid.

Also moves the popup_menu_is_visible prototype from gui_i.h to the public
header, now that callers outside the gui service need it.
Show the INA219 voltage, current and power in the power menu status line.
The readings are refreshed on the desktop power update event while the
menu is open, and skipped when the INA219 is not initialized.

Clear the menu visibility on scene exit, otherwise the refresh keeps
running after the menu is closed from an item callback.

Closes flipperdevices#23
@4RH1T3CT0R7

4RH1T3CT0R7 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

The power menu moved into the desktop scenes since I opened this, so rebasing turned into a reimplementation on the new PopupMenu: optional status line under the title, with the border under it.

No allocation now, the model formats into a fixed char[32].

It refreshes on the 5s power event rather than a 1s timer, since scenes can't reach the event loop. Each refresh is three blocking round-trips to the power thread; header_update_battery_state is commented out, maybe for the same reason. Happy to cache in the power service instead.

@4RH1T3CT0R7
4RH1T3CT0R7 force-pushed the feature/23-power-consumption-menu branch from 8eae66a to 1bde37d Compare August 24, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show power consumption in power menu

2 participants