Implement HAL and apply macros across code-base

Implement AVR Platform
This commit is contained in:
Christopher Pepper
2017-06-18 00:36:10 +01:00
committed by Scott Lahteine
parent fb04dfcda8
commit 4b16fa3272
65 changed files with 2264 additions and 761 deletions

View File

@@ -23,20 +23,26 @@
#ifndef __SERIAL_H__
#define __SERIAL_H__
#include "MarlinConfig.h"
#include "src/HAL/HAL.h"
#ifdef USBCON
#include "HardwareSerial.h"
#if ENABLED(BLUETOOTH)
#define MYSERIAL bluetoothSerial
//todo: HAL: breaks encapsulation
// For AVR only, define a serial interface based on configuration
#ifdef ARDUINO_ARCH_AVR
#ifdef USBCON
#include "HardwareSerial.h"
#if ENABLED(BLUETOOTH)
#define MYSERIAL bluetoothSerial
#else
#define MYSERIAL Serial
#endif // BLUETOOTH
#else
#define MYSERIAL Serial
#endif // BLUETOOTH
#else
#include "MarlinSerial.h"
#define MYSERIAL customizedSerial
#include "src/HAL/HAL_AVR/MarlinSerial.h"
#define MYSERIAL customizedSerial
#endif
#endif
#include "MarlinConfig.h"
extern const char echomagic[] PROGMEM;
extern const char errormagic[] PROGMEM;