Add parser.is_command(letter, code)
This commit is contained in:
@ -416,11 +416,14 @@ inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD
|
||||
* keep sensor readings going and watchdog alive.
|
||||
*/
|
||||
inline bool process_line_done(uint8_t &sis, char (&buff)[MAX_CMD_SIZE], int &ind) {
|
||||
sis = PS_NORMAL;
|
||||
buff[ind] = 0;
|
||||
if (ind) { ind = 0; return false; }
|
||||
thermalManager.manage_heater();
|
||||
return true;
|
||||
sis = PS_NORMAL; // "Normal" Serial Input State
|
||||
buff[ind] = '\0'; // Of course, I'm a Terminator.
|
||||
const bool is_empty = (ind == 0); // An empty line?
|
||||
if (is_empty)
|
||||
thermalManager.manage_heater(); // Keep sensors satisfied
|
||||
else
|
||||
ind = 0; // Start a new line
|
||||
return is_empty; // Inform the caller
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user