Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
PicoUSBInit.hpp
Go to the documentation of this file.
1#pragma once
2
13#include <AH/Arduino-Wrapper.h>
14
15#if defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED) && \
16 defined(USE_TINYUSB)
17#include <Adafruit_TinyUSB.h>
18namespace {
19bool ensure_usb_init(Print &stream) {
20 if (&stream == static_cast<Print *>(&Serial))
21 return TinyUSBDevice.mounted();
22 return true;
23}
24} // namespace
25#else
26namespace {
27constexpr bool ensure_usb_init(Print &) { return true; }
28} // namespace
29#endif