Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- 'nrf52840'
# RP2040
- 'feather_rp2040_tinyusb'
- 'pico_rp2040_tinyusb_host'
# SAMD
- 'metro_m0_tinyusb'
- 'metro_m4_tinyusb'
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
21 changes: 12 additions & 9 deletions src/arduino/Adafruit_TinyUSB_API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@

#include "tusb_option.h"

#if CFG_TUD_ENABLED
#if CFG_TUD_ENABLED || CFG_TUH_ENABLED

#include "Adafruit_TinyUSB.h"
#include "Arduino.h"

//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
extern "C" {

//--------------------------------------------------------------------+
// Device
//--------------------------------------------------------------------+
#if CFG_TUD_ENABLED
void TinyUSB_Device_Init(uint8_t rhport) {
// Init USB Device controller and stack
TinyUSBDevice.begin(rhport);
Expand All @@ -54,9 +55,12 @@ void TinyUSB_Device_FlushCDC(void) {
tud_cdc_n_write_flush(instance);
}
}
#endif
#endif // CFG_TUD_ENABLED

// Debug log with Serial1
#if CFG_TUSB_DEBUG && defined(CFG_TUSB_DEBUG_PRINTF)
//------------- Debug log with Serial1 -------------//
#if CFG_TUSB_DEBUG && defined(CFG_TUSB_DEBUG_PRINTF) && \
!defined(ARDUINO_ARCH_ESP32)

// #define USE_SEGGER_RTT
#define SERIAL_TUSB_DEBUG Serial1
Expand Down Expand Up @@ -90,7 +94,6 @@ __attribute__((used)) int CFG_TUSB_DEBUG_PRINTF(const char *__restrict format,
}
#endif // CFG_TUSB_DEBUG

#endif // ARDUINO_ARCH_ESP32

} // extern C
#endif

#endif // CFG_TUD_ENABLED || CFG_TUH_ENABLED