Fix commands being accepted in monitor mode
This commit is contained in:
parent
dd42aebb16
commit
e29ee8c11f
@ -95,8 +95,6 @@ class Terminal {
|
|||||||
|
|
||||||
if (handleInput) {
|
if (handleInput) {
|
||||||
parseInput();
|
parseInput();
|
||||||
m_inputSize = 0;
|
|
||||||
m_serial << F("$ ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_state == State::MONITOR && --m_monitorDelayCounter == 0) {
|
if (m_state == State::MONITOR && --m_monitorDelayCounter == 0) {
|
||||||
@ -127,7 +125,8 @@ class Terminal {
|
|||||||
if (m_inputSize) {
|
if (m_inputSize) {
|
||||||
if (m_inputBuffer[m_inputSize - 1] == CTRL_C) {
|
if (m_inputBuffer[m_inputSize - 1] == CTRL_C) {
|
||||||
handleCtrlC();
|
handleCtrlC();
|
||||||
} else if (substringEquals(m_inputBuffer, detail::HELP_CMD, m_inputSize)) {
|
} else if (m_state == State::NONE) {
|
||||||
|
if (substringEquals(m_inputBuffer, detail::HELP_CMD, m_inputSize)) {
|
||||||
printHelp();
|
printHelp();
|
||||||
} else if (substringEquals(m_inputBuffer, detail::SHOW_CMD, m_inputSize)) {
|
} else if (substringEquals(m_inputBuffer, detail::SHOW_CMD, m_inputSize)) {
|
||||||
showState();
|
showState();
|
||||||
@ -146,6 +145,11 @@ class Terminal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_inputSize = 0;
|
||||||
|
if (m_state == State::NONE)
|
||||||
|
m_serial << F("$ ");
|
||||||
|
}
|
||||||
|
|
||||||
static void handleCtrlC()
|
static void handleCtrlC()
|
||||||
{
|
{
|
||||||
m_serial << F("Abort!") << detail::ENDL;
|
m_serial << F("Abort!") << detail::ENDL;
|
||||||
|
Loading…
Reference in New Issue
Block a user