[LPC176x] Emergency Parser Feature (#10516)

This commit is contained in:
Chris Pepper
2018-04-25 12:44:26 +01:00
committed by Scott Lahteine
parent eef0248a1c
commit 2242b98248
15 changed files with 216 additions and 219 deletions

View File

@ -22,9 +22,14 @@
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h"
#include "HardwareSerial.h"
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
#include "../../feature/emergency_parser.h"
#endif
#if SERIAL_PORT == 0 || SERIAL_PORT_2 == 0
HardwareSerial Serial = HardwareSerial(LPC_UART0);
#elif SERIAL_PORT == 1 || SERIAL_PORT_2 == 1
@ -248,6 +253,9 @@ void HardwareSerial::IRQHandler() {
if (IIRValue == UART_IIR_INTID_RDA) {
// Clear the FIFO
while (UART_Receive(UARTx, &byte, 1, NONE_BLOCKING)) {
#if ENABLED(EMERGENCY_PARSER)
emergency_parser.update(byte);
#endif
if ((RxQueueWritePos + 1) % RX_BUFFER_SIZE != RxQueueReadPos) {
RxBuffer[RxQueueWritePos] = byte;
RxQueueWritePos = (RxQueueWritePos + 1) % RX_BUFFER_SIZE;

View File

@ -32,6 +32,8 @@ extern "C" {
#include "lpc17xx_pinsel.h"
}
#include "../../inc/MarlinConfigPre.h"
class HardwareSerial : public Stream {
private:
LPC_UART_TypeDef *UARTx;
@ -138,8 +140,6 @@ public:
printf("%f" , value );
}
void println(const char value[]) {
printf("%s\n" , value);
}

View File

@ -74,7 +74,3 @@
|| MB(RAMPS_14_RE_ARM_SF))
#error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI"
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for LPC1768. Disable EMERGENCY_PARSER to continue."
#endif

View File

@ -95,6 +95,7 @@ extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
#define vsnprintf_P vsnprintf
#define strcpy_P strcpy
#define snprintf_P snprintf
#define strlen_P strlen
// Time functions
extern "C" {

View File

@ -26,10 +26,6 @@
#include <stdarg.h>
#include <stdio.h>
extern "C" {
#include <debug_frmwrk.h>
}
/**
* Generic RingBuffer
* T type of the buffer array

View File

@ -50,6 +50,9 @@ void watchdog_reset() {
#endif
}
#else
void HAL_clear_reset_source(void) {}
uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
#endif // USE_WATCHDOG
#endif // TARGET_LPC1768