From 91448c114c3c7df26a07b31e1fa868b96929045f Mon Sep 17 00:00:00 2001 From: LynnL4 Date: Tue, 21 Apr 2020 19:43:01 +0800 Subject: [PATCH] fixed: fixed Serial name for arduino_zero --- variants/arduino_zero/variant.cpp | 4 ++-- variants/arduino_zero/variant.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/variants/arduino_zero/variant.cpp b/variants/arduino_zero/variant.cpp index 6351b5ba1..79066d20d 100644 --- a/variants/arduino_zero/variant.cpp +++ b/variants/arduino_zero/variant.cpp @@ -213,7 +213,7 @@ SERCOM sercom4( SERCOM4 ) ; SERCOM sercom5( SERCOM5 ) ; Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; -Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +Uart Serial2( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; Uart SerialDBG( &sercom1, PIN_SERIALBDG_RX, PIN_SERIALBDG_TX, PAD_SERIALBDG_RX, PAD_SERIALBDG_TX ) ; void SERCOM0_Handler() @@ -223,7 +223,7 @@ void SERCOM0_Handler() void SERCOM5_Handler() { - Serial.IrqHandler(); + Serial2.IrqHandler(); } void SERCOM1_Handler() diff --git a/variants/arduino_zero/variant.h b/variants/arduino_zero/variant.h index a0e227900..a9409443b 100644 --- a/variants/arduino_zero/variant.h +++ b/variants/arduino_zero/variant.h @@ -190,7 +190,7 @@ extern SERCOM sercom3; extern SERCOM sercom4; extern SERCOM sercom5; -extern Uart Serial; +extern Uart Serial2; extern Uart Serial1; extern Uart SerialDBG; @@ -211,8 +211,9 @@ extern Uart SerialDBG; // // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX // pins are NOT connected to anything by default. +#define SerialUSB Serial #define SERIAL_PORT_USBVIRTUAL SerialUSB -#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_MONITOR Serial2 // Serial has no physical pins broken out, so it's not listed as HARDWARE port #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1