forked from arduino/ArduinoCore-mbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0038-RP2040-usb-fix-USB_DEVICE_ENUMERATION_FIX-linking.patch
52 lines (47 loc) · 1.67 KB
/
0038-RP2040-usb-fix-USB_DEVICE_ENUMERATION_FIX-linking.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From b10230cc4b58ef5f04f89ad273a002a2f8a8e36b Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Mon, 8 Mar 2021 10:06:58 +0100
Subject: [PATCH 038/204] RP2040: usb: fix USB_DEVICE_ENUMERATION_FIX linking
---
.../TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp | 9 +++++++++
targets/targets.json | 1 +
2 files changed, 10 insertions(+)
diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp
index 2ef354035d..c88bdcc573 100644
--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp
+++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/USBPhy_RP2040.cpp
@@ -16,6 +16,11 @@
*/
#include "USBPhyHw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// USB register definitions from pico-sdk
#include "hardware/regs/usb.h"
// USB hardware struct definitions from pico-sdk
@@ -29,6 +34,10 @@
#include "rp2040_usb_device_enumeration.h"
#endif
+#ifdef __cplusplus
+}
+#endif
+
// These accessor functions are used to implement bit clear / bit sets through
// an atomic alias (this handles the state where both cores can access a register
// and cause a bit loss through a read-modify-write access)
diff --git a/targets/targets.json b/targets/targets.json
index ba6bcb6946..46935c0609 100644
--- a/targets/targets.json
+++ b/targets/targets.json
@@ -9437,6 +9437,7 @@
"NANO_RP2040_CONNECT": {
"inherits": ["RP2040"],
"macros_add": [
+ "PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1",
"PICO_NO_BINARY_INFO=1",
"MBED_MPU_CUSTOM",
"PICO_TIME_DEFAULT_ALARM_POOL_DISABLED",
--
2.39.1