|
TB2026-YDS Firmware
|
Statistics / diagnostics menu: a top-level list over five live detail pages. More...
#include "stats_screen.h"#include "battery_test.h"#include "fuel_gauge_debug.h"#include "navigator.h"#include "status_bar.h"#include "gfx.h"#include "icons.h"#include "power.h"#include "board_pins.h"#include "gpio_expander.h"#include "fuel_gauge.h"#include "storage.h"#include "sdcard.h"#include "bluetooth.h"#include "input.h"#include "volume.h"#include "audio_dac.h"#include "i2c_bus.h"#include "driver/i2c_master.h"#include "esp_timer.h"#include "esp_system.h"#include "esp_heap_caps.h"#include "esp_app_desc.h"#include "esp_idf_version.h"#include <stdarg.h>#include <stdio.h>#include <stdint.h>Macros | |
| #define | PAD_X 6 |
| #define | BODY_Y (STATUS_BAR_H + 4) /* content starts just under the status bar (no page title) */ |
| #define | LINE_H 12 |
| #define | BATT_HINT_Y 162 /* footer hint on the Battery page */ |
| #define | GROUP_GAP 4 |
| #define | STATUS_X 120 |
| #define | DETAIL_REFRESH_MS 250 /* live re-render cadence for the detail pages */ |
| #define | ADDR_FUEL_GAUGE 0x36 |
| #define | ADDR_EXPANDER 0x38 |
| #define | ADDR_DAC 0x4C |
| #define | DAC_CLK_BAD_MASK 0x23 |
| #define | DETAIL(render_fn) |
| #define | N_ITEMS 5 |
| #define | MENU_ROW_H 32 /* 160px content / 5 items = 32px even slices */ |
| #define | MENU_Y0 (STATUS_BAR_H + 8) /* symmetric top/bottom margins */ |
| #define | MENU_ARROW_X 2 |
| #define | MENU_ICON_X 18 |
| #define | MENU_TEXT_X 40 |
| #define | MENU_SCALE 2 |
Functions | |
| screen_t * | stats_screen (void) |
| Get the singleton Statistics screen, ready to push onto the navigator. | |
Statistics / diagnostics menu: a top-level list over five live detail pages.
The menu reuses no generic widget (it offsets content below the status bar, which the generic menu_screen does not). Each detail page sets screen_t::refresh_ms so the UI task re-renders it every DETAIL_REFRESH_MS for live values; the menu itself stays event-driven.
| #define ADDR_DAC 0x4C |
| #define ADDR_EXPANDER 0x38 |
| #define ADDR_FUEL_GAUGE 0x36 |
| #define BATT_HINT_Y 162 /* footer hint on the Battery page */ |
| #define BODY_Y (STATUS_BAR_H + 4) /* content starts just under the status bar (no page title) */ |
| #define DAC_CLK_BAD_MASK 0x23 |
| #define DETAIL | ( | render_fn | ) |
| #define DETAIL_REFRESH_MS 250 /* live re-render cadence for the detail pages */ |
| #define GROUP_GAP 4 |
| #define LINE_H 12 |
| #define MENU_ARROW_X 2 |
| #define MENU_ICON_X 18 |
| #define MENU_ROW_H 32 /* 160px content / 5 items = 32px even slices */ |
| #define MENU_SCALE 2 |
| #define MENU_TEXT_X 40 |
| #define MENU_Y0 (STATUS_BAR_H + 8) /* symmetric top/bottom margins */ |
| #define N_ITEMS 5 |
| #define PAD_X 6 |
| #define STATUS_X 120 |
| screen_t * stats_screen | ( | void | ) |
Get the singleton Statistics screen, ready to push onto the navigator.