Skip to content

Commit 707dde7

Browse files
committed
RP2040: usb: fix USB_DEVICE_ENUMERATION_FIX linking
1 parent 541f7bf commit 707dde7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

targets/TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717

1818
#include "USBPhyHw.h"
19+
20+
#ifdef __cplusplus
21+
extern "C" {
22+
#endif
23+
1924
// USB register definitions from pico-sdk
2025
#include "hardware/regs/usb.h"
2126
// USB hardware struct definitions from pico-sdk
@@ -29,6 +34,10 @@
2934
#include "rp2040_usb_device_enumeration.h"
3035
#endif
3136

37+
#ifdef __cplusplus
38+
}
39+
#endif
40+
3241
// These accessor functions are used to implement bit clear / bit sets through
3342
// an atomic alias (this handles the state where both cores can access a register
3443
// and cause a bit loss through a read-modify-write access)

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8020,6 +8020,7 @@
80208020
"NANO_RP2040_CONNECT": {
80218021
"inherits": ["RP2040"],
80228022
"macros_add": [
8023+
"PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1",
80238024
"PICO_NO_BINARY_INFO=1",
80248025
"MBED_MPU_CUSTOM",
80258026
"PICO_TIME_DEFAULT_ALARM_POOL_DISABLED",

0 commit comments

Comments
 (0)