Charge
Piso WiFi coin-slot controller firmware — hardware-independent timing logic that validates pulses, accumulates paid time, and drives relay state.
Problem
Coin-operated Wi-Fi hotspots need dependable timing logic that survives power glitches and noisy coin acceptors. Charge implements a testable controller module that owns pulse validation, countdown, NVM recovery, and relay decisions while delegating GPIO to a thin hardware layer.
What it covers
- 1 ms tick contract for paid-time countdown accuracy
- Coin pulse debounce and consecutive invalid sequence tracking
- Two-copy NVM configuration recovery
- Display update scheduling decoupled from relay decisions
/*
pc_tick_1ms() must be called once per millisecond.
Owned by this module:
- coin pulse validation
- paid-time accumulation
- countdown timing
- relay state decision
- configuration validation
- two-copy NVM recovery
*/