Compiler defines USBCON for USB devices (PR#2433)

This commit is contained in:
Richard Wackerbarth 2015-05-24 11:32:34 -05:00
parent 7268d46508
commit e83575537a
12 changed files with 12 additions and 24 deletions

View File

@ -210,7 +210,7 @@
#include "pins.h" #include "pins.h"
#ifndef AT90USB #ifndef USBCON
#define HardwareSerial_h // trick to disable the standard HWserial #define HardwareSerial_h // trick to disable the standard HWserial
#endif #endif

View File

@ -43,7 +43,7 @@ typedef unsigned long millis_t;
#define analogInputToDigitalPin(p) ((p) + 0xA0) #define analogInputToDigitalPin(p) ((p) + 0xA0)
#endif #endif
#ifdef AT90USB #ifdef USBCON
#include "HardwareSerial.h" #include "HardwareSerial.h"
#endif #endif
@ -58,7 +58,7 @@ typedef unsigned long millis_t;
#include "WString.h" #include "WString.h"
#ifdef AT90USB #ifdef USBCON
#ifdef BTENABLED #ifdef BTENABLED
#define MYSERIAL bt #define MYSERIAL bt
#else #else

View File

@ -23,7 +23,7 @@
#include "Marlin.h" #include "Marlin.h"
#include "MarlinSerial.h" #include "MarlinSerial.h"
#ifndef AT90USB #ifndef USBCON
// this next line disables the entire HardwareSerial.cpp, // this next line disables the entire HardwareSerial.cpp,
// this is so I can support Attiny series and any other chip without a UART // this is so I can support Attiny series and any other chip without a UART
#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H) #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
@ -284,9 +284,9 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
MarlinSerial MSerial; MarlinSerial MSerial;
#endif // whole file #endif // whole file
#endif // !AT90USB #endif // !USBCON
// For AT90USB targets use the UART for BT interfacing // For AT90USB targets use the UART for BT interfacing
#if defined(AT90USB) && defined(BTENABLED) #if defined(USBCON) && defined(BTENABLED)
HardwareSerial bt; HardwareSerial bt;
#endif #endif

View File

@ -64,7 +64,7 @@
#define BYTE 0 #define BYTE 0
#ifndef AT90USB #ifndef USBCON
// Define constants and variables for buffering incoming serial data. We're // Define constants and variables for buffering incoming serial data. We're
// using a ring buffer (I think), in which rx_buffer_head is the index of the // using a ring buffer (I think), in which rx_buffer_head is the index of the
// location to which to write the next incoming character and rx_buffer_tail // location to which to write the next incoming character and rx_buffer_tail
@ -150,10 +150,10 @@ class MarlinSerial { //: public Stream
}; };
extern MarlinSerial MSerial; extern MarlinSerial MSerial;
#endif // !AT90USB #endif // !USBCON
// Use the UART for BT in AT90USB configurations // Use the UART for BT in AT90USB configurations
#if defined(AT90USB) && defined(BTENABLED) #if defined(USBCON) && defined(BTENABLED)
extern HardwareSerial bt; extern HardwareSerial bt;
#endif #endif

View File

@ -8,8 +8,6 @@
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc.
#define LARGE_FLASH true #define LARGE_FLASH true
#define X_STEP_PIN 0 #define X_STEP_PIN 0

View File

@ -9,8 +9,6 @@
#error Oops! Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu.
#endif #endif
#define AT90USB 646 // Disable MarlinSerial etc.
#define X_STEP_PIN 27 #define X_STEP_PIN 27
#define X_DIR_PIN 29 #define X_DIR_PIN 29
#define X_ENABLE_PIN 28 #define X_ENABLE_PIN 28

View File

@ -1,5 +1,5 @@
/** /**
* Brainwave Pro pin assignments (AT90USB186) * Brainwave Pro pin assignments (AT90USB1286)
* *
* Requires hardware bundle for Arduino: * Requires hardware bundle for Arduino:
* https://github.com/unrepentantgeek/brainwave-arduino * https://github.com/unrepentantgeek/brainwave-arduino
@ -15,7 +15,7 @@
#error Uncomment #define AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h for this config #error Uncomment #define AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h for this config
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc. #define LARGE_FLASH true
#define X_STEP_PIN 33 #define X_STEP_PIN 33
#define X_DIR_PIN 32 #define X_DIR_PIN 32

View File

@ -13,8 +13,6 @@
#error These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h #error These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc.
#define LARGE_FLASH true #define LARGE_FLASH true
#define X_STEP_PIN 0 #define X_STEP_PIN 0

View File

@ -9,8 +9,6 @@
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc.
#define LARGE_FLASH true #define LARGE_FLASH true
#define X_STEP_PIN 0 #define X_STEP_PIN 0

View File

@ -52,8 +52,6 @@
// (or build from command line) // (or build from command line)
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc.
#define LARGE_FLASH true #define LARGE_FLASH true
#define X_STEP_PIN 28 // 0 Marlin #define X_STEP_PIN 28 // 0 Marlin

View File

@ -13,8 +13,6 @@
#error These Teensylu assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h #error These Teensylu assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h
#endif #endif
#define AT90USB 1286 // Disable MarlinSerial etc.
#define LARGE_FLASH true #define LARGE_FLASH true
#define X_STEP_PIN 0 #define X_STEP_PIN 0

View File

@ -629,7 +629,7 @@ ISR(TIMER1_COMPA_vect) {
// Take multiple steps per interrupt (For high speed moves) // Take multiple steps per interrupt (For high speed moves)
for (int8_t i = 0; i < step_loops; i++) { for (int8_t i = 0; i < step_loops; i++) {
#ifndef AT90USB #ifndef USBCON
MSerial.checkRx(); // Check for serial chars. MSerial.checkRx(); // Check for serial chars.
#endif #endif