[2.0.x] Emergency parser for multiple serial ports (#10524)

This commit is contained in:
Scott Lahteine
2018-04-25 20:58:00 -05:00
committed by GitHub
parent 8cc31d1b2e
commit 2578996631
8 changed files with 121 additions and 106 deletions

View File

@@ -23,6 +23,11 @@
#ifndef HARDWARE_SERIAL_H_
#define HARDWARE_SERIAL_H_
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
#include "../../feature/emergency_parser.h"
#endif
#include <stdarg.h>
#include <stdio.h>
#include <Stream.h>
@@ -32,8 +37,6 @@ extern "C" {
#include "lpc17xx_pinsel.h"
}
#include "../../inc/MarlinConfigPre.h"
class HardwareSerial : public Stream {
private:
LPC_UART_TypeDef *UARTx;
@@ -48,6 +51,9 @@ private:
uint32_t TxQueueWritePos;
uint32_t TxQueueReadPos;
#endif
#if ENABLED(EMERGENCY_PARSER)
EmergencyParser::State emergency_state;
#endif
public:
HardwareSerial(LPC_UART_TypeDef *UARTx)
@@ -59,6 +65,9 @@ public:
, TxQueueWritePos(0)
, TxQueueReadPos(0)
#endif
#if ENABLED(EMERGENCY_PARSER)
, emergency_state(EmergencyParser::State::EP_RESET)
#endif
{
}