Browse Source

Fix Yield when no Serial on USB

teensy4-core
Andrew J. Kroll 10 years ago
parent
commit
f8938ec150
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      teensy3/usb_serial.h

+ 3
- 7
teensy3/usb_serial.h View File

@@ -31,12 +31,10 @@
#ifndef USBserial_h_
#define USBserial_h_

#if defined(USB_SERIAL) || defined(USB_SERIAL_HID)
#if (F_CPU >= 20000000) && (defined(USB_SERIAL) || defined(USB_SERIAL_HID))

#include <inttypes.h>

#if F_CPU >= 20000000

// C language implementation
#ifdef __cplusplus
extern "C" {
@@ -106,7 +104,7 @@ extern void serialEvent(void);
#endif // __cplusplus


#else // F_CPU < 20 MHz
#else // F_CPU < 20 MHz && !(USB_SERIAL || USB_SERIAL_HID)

// Allow Arduino programs using Serial to compile, but Serial will do nothing.
#ifdef __cplusplus
@@ -142,8 +140,6 @@ extern usb_serial_class Serial;
extern void serialEvent(void);
#endif // __cplusplus

#endif // F_CPU

#endif // USB_SERIAL || USB_SERIAL_HID
#endif // F_CPU && USB_SERIAL || USB_SERIAL_HID

#endif // USBserial_h_

Loading…
Cancel
Save