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();