1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Combine __AVR__ and USBCON for 2.0.x parity

This commit is contained in:
Scott Lahteine 2018-03-10 01:26:06 -06:00
parent c05c5d96d9
commit 5ce64f6d16
6 changed files with 12 additions and 12 deletions

View File

@ -31,7 +31,7 @@
#include "Conditionals_LCD.h"
#include "Configuration_adv.h"
#include "pins.h"
#ifndef USBCON
#if defined(__AVR__) && !defined(USBCON)
#define HardwareSerial_h // trick to disable the standard HWserial
#endif
#include "Arduino.h"

View File

@ -34,7 +34,7 @@
#include "MarlinConfig.h"
#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
#if !(defined(__AVR__) && defined(USBCON)) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
#include "MarlinSerial.h"
#include "Marlin.h"
@ -651,9 +651,9 @@
// Preinstantiate
MarlinSerial customizedSerial;
#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)
#endif // !(__AVR__ && USBCON) && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)
// For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH)
#if defined(__AVR__) && defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial;
#endif

View File

@ -85,7 +85,7 @@
#define TX_BUFFER_SIZE 32
#endif
#ifndef USBCON
#if !(defined(__AVR__) && defined(USBCON))
#if RX_BUFFER_SIZE > 256
typedef uint16_t ring_buffer_pos_t;
@ -163,10 +163,10 @@
extern MarlinSerial customizedSerial;
#endif // !USBCON
#endif // !(__AVR__ && USBCON)
// Use the UART for Bluetooth in AT90USB configurations
#if defined(USBCON) && ENABLED(BLUETOOTH)
#if defined(__AVR__) && defined(USBCON) && ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial;
#endif

View File

@ -13848,7 +13848,7 @@ void loop() {
card.closefile();
SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED);
#ifndef USBCON
#if !(defined(__AVR__) && defined(USBCON))
#if ENABLED(SERIAL_STATS_DROPPED_RX)
SERIAL_ECHOLNPAIR("Dropped bytes: ", customizedSerial.dropped());
#endif
@ -13856,7 +13856,7 @@ void loop() {
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
SERIAL_ECHOLNPAIR("Max RX Queue Size: ", customizedSerial.rxMaxEnqueued());
#endif
#endif // !USBCON
#endif // !(__AVR__ && USBCON)
ok_to_send();
}

View File

@ -275,7 +275,7 @@
/**
* Serial
*/
#ifndef USBCON
#if !(defined(__AVR__) && defined(USBCON))
#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
#error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
#elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
@ -1281,7 +1281,7 @@ static_assert(1 >= 0
/**
* emergency-command parser
*/
#if ENABLED(EMERGENCY_PARSER) && defined(USBCON)
#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
#error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
#endif

View File

@ -25,7 +25,7 @@
#include "MarlinConfig.h"
#ifdef USBCON
#if defined(__AVR__) && defined(USBCON)
#include <HardwareSerial.h>
#if ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial;