Improve the serial port parsing.

This commit is contained in:
Jonathan Naylor 2016-11-04 06:46:27 +00:00
parent 496078928c
commit 9238d74082
1 changed files with 24 additions and 24 deletions

View File

@ -73,7 +73,7 @@ bool m_started = false;
uint32_t m_count = 0U;
bool m_led = false;
uint8_t m_buffer[255U];
uint8_t m_buffer[256U];
uint8_t m_offset = 0U;
uint8_t m_length = 0U;
@ -95,7 +95,6 @@ void loop()
} else {
m_buffer[m_offset] = c;
m_offset++;
}
if (m_length == m_offset) {
switch (m_buffer[2U]) {
@ -124,6 +123,7 @@ void loop()
m_offset = 0U;
}
}
}
bool lockout = digitalRead(PIN_LOCKOUT) == HIGH;
if (lockout != m_lockout) {