Skip to content

Commit 286949e

Browse files
authored
Merge pull request adafruit#87 from adafruit/warn-menu-selection
warn menu selection for port that has TinyUSB as optional menu
2 parents e36abc6 + 9772ef4 commit 286949e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/Adafruit_TinyUSB.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
#ifndef ADAFRUIT_TINYUSB_H_
2626
#define ADAFRUIT_TINYUSB_H_
2727

28-
#include "tusb_option.h"
28+
// Give warning for Core that must select TinyUSB via menu
29+
#if (defined ARDUINO_ARCH_SAMD || defined ARDUINO_ARCH_RP2040) && !defined USE_TINYUSB
30+
#error TinyUSB is not selected, please select it in Tools->Menu->USB Stack
31+
#endif
2932

30-
//#ifndef USE_TINYUSB
31-
//#error TinyUSB is not selected, please select it in Tools->Menu->USB Stack
32-
//#endif
33+
#include "tusb_option.h"
3334

3435
#if TUSB_OPT_DEVICE_ENABLED
3536

src/arduino/ports/Adafruit_TinyUSB_rp2040.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "tusb_option.h"
2626

27-
#if defined ARDUINO_ARCH_RP2040 & TUSB_OPT_DEVICE_ENABLED
27+
#if defined ARDUINO_ARCH_RP2040 && TUSB_OPT_DEVICE_ENABLED
2828

2929
#include "Arduino.h"
3030
#include "pico/bootrom.h"

src/arduino/ports/Adafruit_TinyUSB_samd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "tusb_option.h"
2626

27-
#if defined ARDUINO_ARCH_SAMD & TUSB_OPT_DEVICE_ENABLED
27+
#if defined ARDUINO_ARCH_SAMD && TUSB_OPT_DEVICE_ENABLED
2828

2929
#include "Arduino.h"
3030
#include <Reset.h> // Needed for auto-reset with 1200bps port touch

0 commit comments

Comments
 (0)