Skip to content

Commit 3c5f92d

Browse files
committed
better use USE_TINYUSB for stack detection
1 parent 4f9fef7 commit 3c5f92d

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_TinyUSB_Core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* THE SOFTWARE.
2323
*/
2424

25-
#if defined(USE_TINYUSB) && defined(USBCON)
25+
#ifdef USE_TINYUSB
2626

2727
#include "Arduino.h"
2828
#include "Adafruit_TinyUSB_Core.h"
@@ -128,4 +128,4 @@ void Adafruit_TinyUSB_Core_init(void)
128128
tusb_init();
129129
}
130130

131-
#endif
131+
#endif // USE_TINYUSB

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* THE SOFTWARE.
2323
*/
2424

25-
#if defined(USE_TINYUSB) && defined(USBCON)
25+
#ifdef USE_TINYUSB
2626

2727
#include "Arduino.h"
2828
#include <Reset.h> // Needed for auto-reset with 1200bps port touch
@@ -139,4 +139,4 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
139139

140140
}
141141

142-
#endif // NRF52840_XXAA
142+
#endif // USE_TINYUSB

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* THE SOFTWARE.
2323
*/
2424

25-
#if defined(USE_TINYUSB) && defined(USBCON)
25+
#ifdef USE_TINYUSB
2626

2727
#include "Adafruit_USBD_Device.h"
2828

@@ -184,4 +184,4 @@ bool Adafruit_USBD_Device::begin(void)
184184
return true;
185185
}
186186

187-
#endif
187+
#endif // USE_TINYUSB

cores/arduino/main.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ int main( void )
4040

4141
delay(1);
4242

43-
#if defined(USBCON)
44-
#if defined(USE_TINYUSB)
43+
#if defined(USE_TINYUSB)
4544
Adafruit_TinyUSB_Core_init();
46-
#else
45+
#elif defined(USBCON)
4746
USBDevice.init();
4847
USBDevice.attach();
49-
#endif
5048
#endif
5149

5250
setup();
@@ -55,7 +53,7 @@ int main( void )
5553
{
5654
loop();
5755

58-
#if defined(USE_TINYUSB) && defined(USBCON)
56+
#ifdef USE_TINYUSB
5957
tud_task();
6058
#endif
6159

@@ -65,7 +63,7 @@ int main( void )
6563
return 0;
6664
}
6765

68-
#if defined(USE_TINYUSB) && defined(USBCON)
66+
#ifdef USE_TINYUSB
6967
void yield(void)
7068
{
7169
tud_task();

0 commit comments

Comments
 (0)