From b726e164580b6b63b8d80c910a538940d631fac7 Mon Sep 17 00:00:00 2001 From: whowechina Date: Wed, 27 Sep 2023 20:07:10 +0800 Subject: [PATCH] More command line info and case insensitive --- Production/Firmware/chu_pico.uf2 | Bin 119808 -> 120832 bytes firmware/src/cmd.c | 33 +++++++++++++++++++------------ firmware/src/main.c | 5 +++-- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Production/Firmware/chu_pico.uf2 b/Production/Firmware/chu_pico.uf2 index 9ebaf21286502e62345a2ee00b0a244252ca9430..12ca0bacb28a898fab4597875b1e9d3dbb8fe6be 100644 GIT binary patch delta 16080 zcmbVz3s@6Z7XQ5=KnO$wLFEx~k|2gh5dje`)fjLL1QFkF3kn#mkNBvIRs|om>RL-3 z>)@l-wbr%NT1v%jU2)m2wQ5_NRM)lD+SuC0ZLOWQcI6S0|GAkwX7>B{zu))I_Z?>D zp4ac3d*y+1#vK=AH z&=*k+KOiMSQi_oGTnXod;Ab5hVUlsOE;JS)*^kHpO*W!)Ee%oImm=jIDN?RqhLqE$ zA{2%umcQ{%#U$BPq$KBC)gcn4?|icM$jfRt4~6#I)el1~4L`hdU262g3CoeRUtr3@ zwB)cNELlFg6X}a=pF_*j2X< zxGM4>NWrik#JvMfXSpEsl%zrF)~Bp*Sbwl)LBQ`p7=3M6`&Z^kd3vZ7LVuZgLEgXa z7lW!WLB7bEAW65z^h)g21oDzRD)R%ocFi}nF%nhbyfsOKVx$R$udYc9ODLRYo@7Xn zr&~cIDzVoO)+Q_BtX-R166N!)NY_YH)^MGHcFP7B5LeNOwPi(T3@dAqzQU#|TxrF+ zgEaJ9@W-AzhCd~pTNlQ6ZW!?Vu{w$hX)3+KKEGC5n+Qm-Ho-X0UP4b;Q>T?1is_Q& z`@`p5yId>P>?o9KB8|`3i|IOQdo4DY=#5sHMuwDykw$FaQK&>Ew9WcOSoO6M+MxMt z&5lA!6NhAmNF!~p)2R$4bluhEa_++(q(^qziFB`8zga$s9+{G8IWQ+7++gpmWeS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li?Gy7v$H778~KE_jn(&`QlX@?N$|ByQ8@LKudZeOp@chJQgIEUv1kbERWa-K+D zz=h%CyW1`2T+EyccynT>d$A?6TD>gHFnL*Vsn$Mk5wx)9mY)h5Wt8WH5I-SGF5=<% z2s8a6J{pW-{#_2+T>&<7lHJ-ly_4T1;I=>D#9v?sfuSzps+v`>D=%C`b;EaL;q%;? z;^!w$i=RKD#m~jt#m}Gr2mdj!2YYzFzDs?V04$Sw4d39_L>GmQeuhVn#3&k8A>@1% zY$r+JVp8^l=8dsL3d6xISYc!V6#!X*DuAkhRsz*sX4YQD%j0x&p&T}@$tLR*ph@{8 zuy+{Gr&v3NAB`qVMrcA2LX!&+Dgx5&f>^@ul}4m`7Kq%F@rQ+`^8lzl9Z@P2P3v%f zrtAtnO9rZIoC}wQE?kAzE?{+VtSbW6y8z-Qrh9Rm`W~0Jdtidc!*Q8j7akBgTdTv3 hi6 max_cmd_len) { + max_cmd_len = strlen(cmd); + } } } @@ -43,7 +50,7 @@ static int match_prefix(const char *str[], int num, const char *prefix) bool found = false; for (int i = 0; (i < num) && str[i]; i++) { - if (strncmp(str[i], prefix, strlen(prefix)) == 0) { + if (strncasecmp(str[i], prefix, strlen(prefix)) == 0) { if (found) { return -2; } @@ -59,7 +66,7 @@ static void handle_help(int argc, char *argv[]) { printf("Available commands:\n"); for (int i = 0; i < num_commands; i++) { - printf("%s\n", commands[i]); + printf("%*s: %s\n", max_cmd_len + 2, commands[i], helps[i]); } } @@ -399,16 +406,16 @@ static void handle_factory_reset() void cmd_init() { - register_command("?", handle_help); - register_command("display", handle_display); - register_command("fps", handle_fps); - register_command("hid", handle_hid); - register_command("tof", handle_tof); - register_command("filter", handle_filter); - register_command("sense", handle_sense); - register_command("debounce", handle_debounce); - register_command("save", handle_save); - register_command("factory", config_factory_reset); + register_command("?", handle_help, "Display this help message."); + register_command("display", handle_display, "Display all config."); + register_command("fps", handle_fps, "Display FPS."); + register_command("hid", handle_hid, "Set HID mode."); + register_command("tof", handle_tof, "Set ToF config."); + register_command("filter", handle_filter, "Set pre-filter config."); + register_command("sense", handle_sense, "Set sensitivity config."); + register_command("debounce", handle_debounce, "Set debounce config."); + register_command("save", handle_save, "Save config to flash."); + register_command("factory", config_factory_reset, "Reset everything to default."); } static char cmd_buf[256]; diff --git a/firmware/src/main.c b/firmware/src/main.c index 7b7aa10..7335cbe 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -150,6 +150,8 @@ static void core1_loop() static void core0_loop() { while(1) { + tud_task(); + cmd_run(); save_loop(); fps_count(0); @@ -160,13 +162,12 @@ static void core0_loop() gen_joy_report(); gen_nkro_report(); report_usb_hid(); - tud_task(); } } void init() { - sleep_ms(100); + sleep_ms(50); set_sys_clock_khz(150000, true); board_init(); tusb_init();