提交 e0784750 编写于 作者: L Luca Burelli 提交者: Damien George

shared/tinyusb: Avoid symbol clash on targets with external TinyUSB.

On targets that provide a reference TinyUSB implementation, like ESP32,
the SDK already defines and implements standard callback functions such
as tud_cdc_line_state_cb(). This causes a symbol clash when enabling
shared implementations like the MicroPython 1200 touch functionality.

To avoid this symbol clash, add an optional macro to allow ports to
use a different function name in the shared implementation.
Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
上级 3d98f6b8
......@@ -39,7 +39,13 @@ STATIC void usbd_cdc_run_bootloader_task(mp_sched_node_t *node) {
machine_bootloader(0, NULL);
}
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
void
#if MICROPY_HW_USB_EXTERNAL_TINYUSB
mp_usbd_line_state_cb
#else
tud_cdc_line_state_cb
#endif
(uint8_t itf, bool dtr, bool rts) {
if (dtr == false && rts == false) {
// Device is disconnected.
cdc_line_coding_t line_coding;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册