diff options
author | Edward Shin <contact@edwardsh.in> | 2023-10-15 00:36:49 -0400 |
---|---|---|
committer | Edward Shin <contact@edwardsh.in> | 2024-01-07 00:20:20 -0500 |
commit | 5b762d016841acb3cefa60f05e963711f0a3eb2b (patch) | |
tree | 8bea5eb0443df8cbe9cd2e402d2df8dfe7445b0b /movement/filesystem.h | |
parent | 63d6bc6aa0ddf4cc1ce1918ef7650852a25e581b (diff) | |
download | Sensor-Watch-5b762d016841acb3cefa60f05e963711f0a3eb2b.tar.gz Sensor-Watch-5b762d016841acb3cefa60f05e963711f0a3eb2b.tar.bz2 Sensor-Watch-5b762d016841acb3cefa60f05e963711f0a3eb2b.zip |
USB Improvements
* 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
Diffstat (limited to 'movement/filesystem.h')
-rw-r--r-- | movement/filesystem.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/movement/filesystem.h b/movement/filesystem.h index 3cd3d092..fa3d9d1a 100644 --- a/movement/filesystem.h +++ b/movement/filesystem.h @@ -96,9 +96,10 @@ bool filesystem_write_file(char *filename, char *text, int32_t length); */ bool filesystem_append_file(char *filename, char *text, int32_t length); -/** @brief Handles the interactive file browser when Movement is plugged in to USB. - * @param line The command that the user typed into the serial console. - */ -void filesystem_process_command(char *line); +int filesystem_cmd_ls(int argc, char *argv[]); +int filesystem_cmd_cat(int argc, char *argv[]); +int filesystem_cmd_df(int argc, char *argv[]); +int filesystem_cmd_rm(int argc, char *argv[]); +int filesystem_cmd_echo(int argc, char *argv[]); #endif // FILESYSTEM_H_ |