* Introduce shell module for basic serial shell with argument parsing
* Introduce shell_cmd_list module for basic compile-time command
registration
* Harden USB handling to hang less and drop fewer inputs
- Service tud_task() with periodic TC0 timer interrupt
- Service cdc_task() with periodic TC1 timer interrupt
- Handle shell servicing in main app loop
- Add a circular buffering layer for reads/writes
* Change newline prints to also send carriage return
* Refactor filesystem commands for shell subsystem
* Introduce new shell commands:
- 'help' command
- 'flash' command to reset into bootloader
- 'stress' command to stress CDC writes
Testing:
* Shell validated on Sensor Watch Blue w/ Linux host
* Shell validated in emscripten emulator
* Tuned by spamming inputs during `stress` cmd until stack didn't crash
fix undefined behavior found by clang's sanitize
The compiler isn't completely assured of the possible range of this variable. Probably harmless, but it clears up a clang sanitize error.
* Move from .c to .h as needed for consistency.
* When missing from both, copy from pull request or wiki.
* When missing entirely, infer functionality from source code.
These keys are the shortcuts to "press" the alarm, light and mode
buttons. However, they prevent these letters from being input in the
debug console to send filesystem commands. Strangely, there was already
some code to allow typing these letters in the console output, but not
in the input.
When using the simulator, I encountered cases where the light would become stuck on, and the watch
would be unresponsive. In particular, this would occur when pressing the light button on the
sunrise sunset watch face.
I appears that this is caused by a divergence in out the callback mask is interpreted by the
hardware interface, and in the simulator in the following function.
void watch_rtc_disable_matching_periodic_callbacks(uint8_t mask)
In particular, a mask of 0xFE is intended to disable all except the 128hz callback at index 0,
but instead disables all except the 1hz callback at index 7 in the simulator.
This allows the alarm button to be held down in the date settings and
quickly cycle through the dates instead of having to push for each
single increment like in other faces.