From 1a6533bd4ad9dc22023eacc2188182edc2289534 Mon Sep 17 00:00:00 2001 From: nino-porcino Date: Fri, 11 Feb 2022 14:48:53 +0100 Subject: [PATCH] LS command --- demos/sdcard/cmd_dir.h | 4 ++-- demos/sdcard/console.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/demos/sdcard/cmd_dir.h b/demos/sdcard/cmd_dir.h index 033e669..3414a3e 100644 --- a/demos/sdcard/cmd_dir.h +++ b/demos/sdcard/cmd_dir.h @@ -1,5 +1,5 @@ -void comando_dir() { - send_byte_to_MCU(CMD_DIR); +void comando_dir(byte cmd) { + send_byte_to_MCU(cmd); if(TIMEOUT) return; print_string_response(); } diff --git a/demos/sdcard/console.h b/demos/sdcard/console.h index ab3414d..b7e5b50 100644 --- a/demos/sdcard/console.h +++ b/demos/sdcard/console.h @@ -30,7 +30,8 @@ const byte CMD_DUMP = 8; const byte CMD_JMP = 9; const byte CMD_BAS = 10; const byte CMD_DEL = 11; -const byte CMD_EXIT = 12; +const byte CMD_LS = 12; +const byte CMD_EXIT = 13; // the list of recognized commands byte *DOS_COMMANDS[] = { @@ -46,6 +47,7 @@ byte *DOS_COMMANDS[] = { "JMP", "BAS", "DEL", + "LS", "EXIT" }; @@ -193,8 +195,8 @@ void console() { } comando_write(); } - else if(cmd == CMD_DIR) { - comando_dir(); + else if(cmd == CMD_DIR || cmd == CMD_LS) { + comando_dir(cmd); } else if(cmd == CMD_TIME) { get_token(hex1, 4); // parse hex timeout value