Fixed bug in error handling causing good commands to be discarded after an error

master 0.0.3
Ondřej Hruška 9 years ago
parent 195132e829
commit 19bdb56748
  1. 2
      scpi.pro
  2. 2
      scpi.pro.user
  3. 5
      source/scpi_parser.c

@ -3,6 +3,8 @@ CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
INCLUDEPATH += source/
SOURCES += \
main.c \
source/scpi_parser.c \

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2015-12-05T21:07:16. -->
<!-- Written by QtCreator 3.5.1, 2015-12-05T23:10:56. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

@ -73,7 +73,7 @@ static struct {
SCPI_argval_t args[SCPI_MAX_PARAM_COUNT];
uint8_t arg_i; // next free argument slot index
} pst = {0}; // initialized by all zeros
} pst = {/*EMPTY*/}; // initialized by all zeros
// buffer for error messages
@ -220,6 +220,7 @@ void scpi_handle_byte(const uint8_t b)
if (c == '\r' || c == '\n') {
pars_reset_cmd();
}
break;
case PARS_TRAILING_WHITE:
@ -510,7 +511,7 @@ static void pars_cmd_newline(void)
} else {
err_no_such_command();
pst.state = PARS_DISCARD_LINE;
pars_reset_cmd();
}
}

Loading…
Cancel
Save