[2.0.x] Enable hardware serial ports on LPC1768 (#8004)

* Enable hardware serial ports on LPC1768

* Fix compilation errors with other HALs

* FIx order of includes in LPC1768 HAL main.cpp

* Add support for RX_BUFFER_SIZE and TX_BUFFER_SIZE options in Configuration_adv.h
This commit is contained in:
Thomas Moore
2017-10-24 17:28:33 -05:00
committed by Roxy-3D
parent 46aae4c6e7
commit 51fafccc16
21 changed files with 498 additions and 667 deletions

View File

@@ -20,10 +20,7 @@
#ifdef TARGET_LPC1768
#include "../../core/macros.h"
#include "../HAL.h"
#include <stdint.h>
#include "../../inc/MarlinConfig.h"
extern "C" {
//#include <lpc17xx_adc.h>
@@ -86,7 +83,7 @@ extern const char errormagic[];
void HAL_adc_enable_channel(int pin) {
if (!WITHIN(pin, 0, NUM_ANALOG_INPUTS - 1)) {
usb_serial.printf("%sINVALID ANALOG PORT:%d\n", errormagic, pin);
MYSERIAL.printf("%sINVALID ANALOG PORT:%d\n", errormagic, pin);
kill(MSG_KILLED);
}
@@ -116,7 +113,7 @@ void HAL_adc_enable_channel(int pin) {
uint8_t active_adc = 0;
void HAL_adc_start_conversion(const uint8_t adc_pin) {
if (adc_pin >= (NUM_ANALOG_INPUTS) || adc_pin_map[adc_pin].port == 0xFF) {
usb_serial.printf("HAL: HAL_adc_start_conversion: no pinmap for %d\n", adc_pin);
MYSERIAL.printf("HAL: HAL_adc_start_conversion: no pinmap for %d\n", adc_pin);
return;
}
LPC_ADC->ADCR &= ~0xFF; // Reset