Skip to content

Commit

Permalink
use tud_cdc_rx_cb to process serial data for xsbug sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
phoddie committed Feb 22, 2021
1 parent c40b5e6 commit a08a7d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build/devices/pico/base/debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
}
lastRTS = rts;
}

void tud_cdc_rx_cb(uint8_t itf)
{
modMessagePostToMachineFromISR(NULL, (modMessageDeliver)fxReceiveLoop, NULL);
}
#endif

//---------
Expand Down
2 changes: 1 addition & 1 deletion xs/platforms/pico/xsHost.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ int modMessageService(xsMachine *the, int maxDelayMS)
while (msg && msg->marked) {
modMessage next;

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

modCriticalSectionBegin();
Expand Down

0 comments on commit a08a7d5

Please sign in to comment.