diff --git a/firmware/platformio.ini b/firmware/platformio.ini index 06b5e30..e87cd30 100644 --- a/firmware/platformio.ini +++ b/firmware/platformio.ini @@ -21,12 +21,6 @@ build_flags = -DLV_CONF_SKIP -DLV_COLOR_DEPTH=16 -DLV_USE_LOG=0 - -DLV_FONT_MONTSERRAT_12=1 - -DLV_FONT_MONTSERRAT_14=1 - -DLV_FONT_MONTSERRAT_16=1 - -DLV_FONT_MONTSERRAT_20=1 - -DLV_FONT_MONTSERRAT_24=1 - -DLV_FONT_MONTSERRAT_28=1 -DLV_USE_BAR=1 -DLV_USE_LABEL=1 -DLV_USE_ARC=1 diff --git a/firmware/src/ble.cpp b/firmware/src/ble.cpp index 91ca182..458d6c6 100644 --- a/firmware/src/ble.cpp +++ b/firmware/src/ble.cpp @@ -232,8 +232,3 @@ void ble_keyboard_release(void) { input_kbd->setValue(report, sizeof(report)); input_kbd->notify(); } - -bool ble_is_connected(void) { - return state == BLE_STATE_CONNECTED; -} - diff --git a/firmware/src/ble.h b/firmware/src/ble.h index ac4f91b..675fc88 100644 --- a/firmware/src/ble.h +++ b/firmware/src/ble.h @@ -23,5 +23,3 @@ void ble_request_refresh(void); // BLE HID keyboard void ble_keyboard_press(uint8_t key, uint8_t modifier); void ble_keyboard_release(void); -bool ble_is_connected(void); - diff --git a/firmware/src/imu.cpp b/firmware/src/imu.cpp index 0468254..fd59341 100644 --- a/firmware/src/imu.cpp +++ b/firmware/src/imu.cpp @@ -74,8 +74,3 @@ void imu_tick(void) { uint8_t imu_get_rotation(void) { return current_rotation; } - -void imu_set_rotation(uint8_t r) { - current_rotation = r % 4; - Serial.printf("Rotation: %d (manual)\n", current_rotation); -} diff --git a/firmware/src/power.cpp b/firmware/src/power.cpp index 72adb6e..23d711d 100644 --- a/firmware/src/power.cpp +++ b/firmware/src/power.cpp @@ -4,15 +4,13 @@ // Poll intervals #define BATTERY_POLL_MS 2000 -#define VBUS_POLL_MS 500 +#define CHARGING_POLL_MS 500 static int cached_pct = -1; static bool cached_charging = false; -static bool cached_usb = false; -static bool usb_changed_flag = false; static bool pwr_pressed_flag = false; static uint32_t last_battery_ms = 0; -static uint32_t last_vbus_ms = 0; +static uint32_t last_charging_ms = 0; static uint32_t last_pwr_ms = 0; #define PWR_POLL_MS 50 @@ -23,9 +21,7 @@ void power_init(void) { } Serial.println("AXP2101 init OK"); - // Enable battery and VBUS ADC measurements pmu.enableBattDetection(); - pmu.enableVbusVoltageMeasure(); pmu.enableBattVoltageMeasure(); // Enable PWR button short-press IRQ (mid button for cycling screens) @@ -33,8 +29,6 @@ void power_init(void) { pmu.clearIrqStatus(); pmu.enableIRQ(XPOWERS_AXP2101_PKEY_SHORT_IRQ); - // Read initial state - cached_usb = pmu.isVbusIn(); cached_charging = pmu.isCharging(); cached_pct = pmu.getBatteryPercent(); } @@ -42,18 +36,11 @@ void power_init(void) { void power_tick(void) { uint32_t now = millis(); - // Poll VBUS status - if (now - last_vbus_ms >= VBUS_POLL_MS) { - last_vbus_ms = now; - bool usb_now = pmu.isVbusIn(); - if (usb_now != cached_usb) { - cached_usb = usb_now; - usb_changed_flag = true; - } + if (now - last_charging_ms >= CHARGING_POLL_MS) { + last_charging_ms = now; cached_charging = pmu.isCharging(); } - // Poll battery level if (now - last_battery_ms >= BATTERY_POLL_MS) { last_battery_ms = now; cached_pct = pmu.getBatteryPercent(); @@ -78,18 +65,6 @@ bool power_is_charging(void) { return cached_charging; } -bool power_is_usb_connected(void) { - return cached_usb; -} - -bool power_usb_changed(void) { - if (usb_changed_flag) { - usb_changed_flag = false; - return true; - } - return false; -} - bool power_pwr_pressed(void) { if (pwr_pressed_flag) { pwr_pressed_flag = false; diff --git a/firmware/src/power.h b/firmware/src/power.h index 7b68d34..81736b4 100644 --- a/firmware/src/power.h +++ b/firmware/src/power.h @@ -4,6 +4,4 @@ void power_init(void); void power_tick(void); int power_battery_pct(void); // 0-100, or -1 if no battery bool power_is_charging(void); -bool power_is_usb_connected(void); -bool power_usb_changed(void); // true once per VBUS state transition bool power_pwr_pressed(void); // true once per AXP2101 PWR button short-press diff --git a/firmware/src/splash.cpp b/firmware/src/splash.cpp index 55ebb95..3b8d4b2 100644 --- a/firmware/src/splash.cpp +++ b/firmware/src/splash.cpp @@ -166,19 +166,6 @@ void splash_next(void) { Serial.printf("splash: -> %s\n", a->name); } -void splash_prev(void) { - if (SPLASH_ANIM_COUNT == 0) return; - cur_anim = (cur_anim + SPLASH_ANIM_COUNT - 1) % SPLASH_ANIM_COUNT; - cur_frame = 0; - frame_started_ms = millis(); - last_pick_ms = frame_started_ms; - const splash_anim_def_t *a = &splash_anims[cur_anim]; - render_frame(a->frames[0], a->palette); - Serial.printf("splash: <- %s\n", a->name); -} - -void splash_set_active(bool a) { active = a; } - void splash_pick_for_current_rate(void) { if (SPLASH_ANIM_COUNT == 0) return; int g = usage_rate_group(); @@ -214,10 +201,3 @@ void splash_hide(void) { lv_obj_t* splash_get_root(void) { return splash_container; } - -const char *splash_current_name(void) { - if (SPLASH_ANIM_COUNT == 0) return "(none)"; - return splash_anims[cur_anim].name; -} - -uint16_t splash_count(void) { return SPLASH_ANIM_COUNT; } diff --git a/firmware/src/splash.h b/firmware/src/splash.h index 9918290..ccfd9ec 100644 --- a/firmware/src/splash.h +++ b/firmware/src/splash.h @@ -12,12 +12,6 @@ void splash_tick(void); // Cycle to the next animation in the catalog. void splash_next(void); -// Cycle to the previous animation in the catalog. -void splash_prev(void); - -// Pause/resume rendering (e.g. when a different screen is active). -void splash_set_active(bool active); - // Show/hide the splash container. void splash_show(void); void splash_hide(void); @@ -32,8 +26,3 @@ bool splash_is_active(void); // Root container (so ui.cpp can attach a click event). lv_obj_t* splash_get_root(void); - -// Current animation name (for debug/UI). -const char *splash_current_name(void); - -uint16_t splash_count(void); diff --git a/firmware/src/usage_rate.cpp b/firmware/src/usage_rate.cpp index 787b423..7cf1361 100644 --- a/firmware/src/usage_rate.cpp +++ b/firmware/src/usage_rate.cpp @@ -33,7 +33,7 @@ static inline uint8_t oldest_idx(void) { return (head + RING_SIZE - count) % RING_SIZE; } -void usage_rate_reset(void) { +static void usage_rate_reset(void) { count = 0; head = 0; } diff --git a/firmware/src/usage_rate.h b/firmware/src/usage_rate.h index d1fcad4..4a7c82a 100644 --- a/firmware/src/usage_rate.h +++ b/firmware/src/usage_rate.h @@ -10,6 +10,3 @@ void usage_rate_sample(float session_pct); // 0 = idle, 1 = normal, 2 = active, 3 = heavy. // Defaults to 0 when the buffer doesn't have enough samples yet. int usage_rate_group(void); - -// Clear the buffer (e.g. when the 5-hour session window resets). -void usage_rate_reset(void);