Skip to content

Commit a08a7d5

Browse files
committed
use tud_cdc_rx_cb to process serial data for xsbug sooner
1 parent c40b5e6 commit a08a7d5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

build/devices/pico/base/debugger.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
4747
}
4848
lastRTS = rts;
4949
}
50+
51+
void tud_cdc_rx_cb(uint8_t itf)
52+
{
53+
modMessagePostToMachineFromISR(NULL, (modMessageDeliver)fxReceiveLoop, NULL);
54+
}
5055
#endif
5156

5257
//---------

xs/platforms/pico/xsHost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ int modMessageService(xsMachine *the, int maxDelayMS)
919919
while (msg && msg->marked) {
920920
modMessage next;
921921

922-
if (msg->callback)
922+
if (msg->callback && (!msg->the || (msg->the == the)))
923923
(msg->callback)(msg->the, msg->refcon, msg->message, msg->length);
924924

925925
modCriticalSectionBegin();

0 commit comments

Comments
 (0)