mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-10-03 06:17:07 -05:00
Copying outgoingState on serial IRQ
This commit is contained in:
@@ -480,6 +480,7 @@ class LinkWireless {
|
||||
return;
|
||||
|
||||
linkSPI->_onSerial(true);
|
||||
copyOutgoingState();
|
||||
|
||||
bool hasNewData = linkSPI->getAsyncState() == LinkSPI::AsyncState::READY;
|
||||
if (hasNewData)
|
||||
@@ -1107,6 +1108,11 @@ class LinkWireless {
|
||||
}
|
||||
|
||||
void copyState() { // (irq only)
|
||||
copyOutgoingState();
|
||||
copyIncomingState();
|
||||
}
|
||||
|
||||
void copyOutgoingState() { // (irq only)
|
||||
if (!isAddingMessage) {
|
||||
while (!sessionState.tmpMessagesToSend.isEmpty()) {
|
||||
if (isSessionActive() && !canSend())
|
||||
@@ -1125,7 +1131,9 @@ class LinkWireless {
|
||||
isPendingClearActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void copyIncomingState() { // (irq only)
|
||||
if (!isReadingMessages) {
|
||||
while (!sessionState.tmpMessagesToReceive.isEmpty()) {
|
||||
auto message = sessionState.tmpMessagesToReceive.pop();
|
||||
|
||||
Reference in New Issue
Block a user