Add Pomodoro UI with 1/3/5/10 presets and custom keypad.

Replace Beep/WAV list screen with a timer; pick duration via presets or Set numpad (1-99 min), and keep selectable alarm sounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-18 18:58:21 +08:00
parent b44bd7d3f0
commit 54a70d09e2
8 changed files with 620 additions and 224 deletions

25
include/pomodoro.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
#include <stdint.h>
enum PomoState : uint8_t {
POMO_IDLE = 0,
POMO_RUNNING = 1,
POMO_PAUSED = 2,
POMO_DONE = 3,
};
void pomo_init();
void pomo_tick();
PomoState pomo_state();
uint32_t pomo_remaining_sec();
uint16_t pomo_duration_minutes(); // last configured length
void pomo_set_minutes(uint16_t minutes); // 1..99; idle/paused/done only
void pomo_start_pause();
void pomo_reset();
void pomo_adjust_minutes(int8_t delta);
const char *pomo_state_name();
bool pomo_consume_alarm();

View File

@@ -5,9 +5,6 @@
void ui_create();
void ui_update(const SdCardInfo &info);
void ui_tick(); // refresh timer + fire alarm sound
void ui_refresh_audio_buttons();
void ui_refresh_lists();
void ui_set_touch_debug(int16_t lx, int16_t ly, bool down);
// 0=Beep 1=WAV
uint8_t ui_active_tab();