699fdb0ab7
- Phase 6: 7/8 smoke tests passed on live hardware (PING/STATUS/overflow/paths/JSON validated) - Phase 7: 4 functional apps compiled + uploaded (Audio, Calculator, Timer, Flashlight) * RAM stable 87.5%, Flash 41.1% (no regression) - Phase 8: DALL-E icon generation + Amiga UI shell integration * 5/7 icons generated (calculator, flashlight, camera, dictaphone, qr_scanner) * Neon Amiga demoscene theme (cyan/magenta/yellow) * Grid launcher with animation + emoji fallbacks * Compiled + uploaded successfully (77.3s) * All P1/P2 security features active Next: Retry DALL-E for audio_player + timer, test touch input mapping
40 lines
814 B
C++
40 lines
814 B
C++
// app_timer.h - Timer/Chrono App
|
|
#pragma once
|
|
|
|
#include "app/app_runtime_types.h"
|
|
#include <Arduino.h>
|
|
|
|
class AppTimer {
|
|
public:
|
|
bool init(const AppContext& ctx);
|
|
void onStart();
|
|
void onStop();
|
|
void onTick(uint32_t dt_ms);
|
|
void onAction(const AppAction& action);
|
|
|
|
// Timer control
|
|
void startCountdown(uint32_t seconds);
|
|
void pause();
|
|
void resume();
|
|
void reset();
|
|
|
|
// Status
|
|
uint32_t getRemainingSeconds() const { return remaining_ms_ / 1000; }
|
|
bool isRunning() const { return running_; }
|
|
|
|
const char* getDisplay() const;
|
|
|
|
private:
|
|
AppContext context_;
|
|
bool initialized_ = false;
|
|
bool running_ = false;
|
|
uint32_t remaining_ms_ = 0;
|
|
uint32_t total_ms_ = 0;
|
|
char display_[32] = "00:00";
|
|
|
|
void updateDisplay();
|
|
void onTimeout();
|
|
};
|
|
|
|
extern AppTimer g_app_timer;
|