From 016061d8db32770cfa02747b2ee5af9d72f63f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= Date: Tue, 21 Apr 2026 21:01:43 +0200 Subject: [PATCH 1/2] cmd: Fix 8324edc atoi_short() commit. vlan initialization was removed while trying out an other version. But was not restored back. --- cmd_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd_parser.c b/cmd_parser.c index 4cebc5c..4be700a 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -200,6 +200,7 @@ uint8_t atoi_byte(__xdata uint8_t *out, uint8_t idx) uint8_t atoi_short(__xdata uint16_t *vlan, uint8_t idx) { uint8_t err = 1; + *vlan = 0; while (isnumber(cmd_buffer[idx])) { err = 0; From d2e79d4d8031de95debf82009897740be67c8684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= Date: Tue, 21 Apr 2026 20:57:55 +0200 Subject: [PATCH 2/2] Fix: In commit 8cbafaa cmd_tokenize() has changed. Missed that it also used outside cmd_parser.c. Fix the other location and headerfile. --- cmd_parser.c | 1 + cmd_parser.h | 2 +- rtlplayground.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd_parser.c b/cmd_parser.c index 4be700a..cf66829 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -1191,6 +1191,7 @@ err: // Parse command into words // cmd_words_len contains the number of words found. // cmd_words_b[] contains only start of a word offset. +// Returns the parsing status via `err_status`-variable. void cmd_tokenize(void) __banked { #ifdef DEBUG diff --git a/cmd_parser.h b/cmd_parser.h index dff8cf8..5e65c69 100644 --- a/cmd_parser.h +++ b/cmd_parser.h @@ -8,7 +8,7 @@ extern __xdata uint8_t cmd_buffer[CMD_BUF_SIZE]; extern __xdata uint8_t cmd_available; -uint8_t cmd_tokenize(void) __banked; +void cmd_tokenize(void) __banked; void cmd_parser(void) __banked; void execute_config(void) __banked; void print_sw_version(void) __banked; diff --git a/rtlplayground.c b/rtlplayground.c index 2d90077..9910785 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -26,6 +26,7 @@ extern __code const struct machine machine; extern __xdata uint32_t flash_size; +extern __xdata uint8_t err_status; extern __xdata uint16_t crc_value; __xdata struct machine_runtime machine_detected; @@ -1307,7 +1308,8 @@ void idle(void) // Check whether a command is waiting in the cmd_buffer and execute if (cmd_available) { cmd_available = 0; - if (!cmd_tokenize()) + cmd_tokenize(); + if (err_status == ERR_OK) cmd_parser(); print_string("\n> "); }