diff --git a/cores/nRF5/Arduino.h b/cores/nRF5/Arduino.h index 92721a80..0fe72de5 100644 --- a/cores/nRF5/Arduino.h +++ b/cores/nRF5/Arduino.h @@ -57,8 +57,13 @@ void resumeLoop(void); #include "pulse.h" #include "HardwarePWM.h" #include "utility/SoftwareTimer.h" - #include "Uart.h" + +#ifdef USE_TINYUSB + #include "Adafruit_USBD_Interface.h" + #include "Adafruit_USBD_CDC.h" +#endif + #endif #include "delay.h" @@ -68,10 +73,6 @@ void resumeLoop(void); #include "utility/utilities.h" #include "utility/AdaCallback.h" -#ifdef USE_TINYUSB - #include "Adafruit_USBD_Interface.h" - #include "Adafruit_USBD_CDC.h" -#endif // Include board variant #include "variant.h" diff --git a/cores/nRF5/TinyUSB/Adafruit_USBD_CDC.h b/cores/nRF5/TinyUSB/Adafruit_USBD_CDC.h index 16735eb5..3a2aa8a8 100644 --- a/cores/nRF5/TinyUSB/Adafruit_USBD_CDC.h +++ b/cores/nRF5/TinyUSB/Adafruit_USBD_CDC.h @@ -25,8 +25,6 @@ #ifndef ADAFRUIT_USBD_CDC_H_ #define ADAFRUIT_USBD_CDC_H_ -#ifdef __cplusplus - #include "Adafruit_USBD_Interface.h" #include "Stream.h" @@ -73,5 +71,4 @@ private: extern Adafruit_USBD_CDC Serial; -#endif // __cplusplus #endif diff --git a/cores/nRF5/TinyUSB/Adafruit_USBD_Interface.h b/cores/nRF5/TinyUSB/Adafruit_USBD_Interface.h index 45672f27..ac9d34d7 100644 --- a/cores/nRF5/TinyUSB/Adafruit_USBD_Interface.h +++ b/cores/nRF5/TinyUSB/Adafruit_USBD_Interface.h @@ -25,8 +25,6 @@ #ifndef ADAFRUIT_USBD_INTERFACE_H_ #define ADAFRUIT_USBD_INTERFACE_H_ -#ifdef __cplusplus - class Adafruit_USBD_Interface { protected: @@ -44,5 +42,3 @@ class Adafruit_USBD_Interface }; #endif - -#endif diff --git a/platform.txt b/platform.txt index 3c602a26..bf573a6b 100644 --- a/platform.txt +++ b/platform.txt @@ -64,7 +64,7 @@ nordic.path={build.core.path}/nordic # build.logger_flags and build.sysview_flags are intentionally empty, # to allow modification via a user's own boards.local.txt or platform.local.txt files. -build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} "-I{build.core.path}/cmsis/Core/Include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/TinyUSB" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" +build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} "-I{build.core.path}/cmsis/Core/Include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/TinyUSB" # usb flags build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'