]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/debug.c
Enable expression evaluation for numeric command line args
[z180-stamp.git] / avr / debug.c
index e29a0858b91dd41004fe9f7aabd8aae123c5773e..e38ccb2f27d86d063d2efdfa5e6de7bf30d299b5 100644 (file)
@@ -1,9 +1,10 @@
 /*
  * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
  *
- * SPDX-License-Identifier:    GPL-2.0+
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
+#include "debug.h"
 #include "common.h"
 #include <stdlib.h>
 #include <string.h>
@@ -13,7 +14,6 @@
 #include "command.h"
 #include "cli_readline.h"
 #include "print-utils.h"
-#include "debug.h"
 
 /*
  * Debugging
@@ -170,7 +170,7 @@ mod_mem_avr(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
                data = *addr;
                printf_P(PSTR("%04x: %02x"), addr, data);
 
-               nbytes = cli_readline(PSTR(" ? "));
+               nbytes = cli_readline(PSTR(" ? "), 0);
                if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
                        /* <CR> pressed as only input, don't modify current
                         * location and move to next. "-" pressed will go back.
@@ -189,7 +189,7 @@ mod_mem_avr(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
                                        addr++;
                        }
                }
-       } while (nbytes);
+       } while (nbytes > 0);
 
        mm_last_addr = addr;
        return CMD_RET_SUCCESS;