LinkCable: Preventing repeated packets by clearing send buffer after each serial interrupt

This commit is contained in:
Rodrigo Alfonso 2024-08-27 04:41:19 -03:00
parent d97a104f34
commit 57a818d5d0

View File

@ -331,6 +331,8 @@ class LinkCable {
state.currentPlayerId =
(Link::_REG_SIOCNT & (0b11 << BITS_PLAYER_ID)) >> BITS_PLAYER_ID;
Link::_REG_SIOMLT_SEND = LINK_CABLE_NO_DATA;
if (!isMaster())
sendPendingData();
@ -432,6 +434,7 @@ class LinkCable {
}
void stop() {
Link::_REG_SIOMLT_SEND = LINK_CABLE_NO_DATA;
stopTimer();
setGeneralPurposeMode();
}