mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-10-02 05:47:11 -05:00
LinkWirelessMultiboot: Implementing waitForReadySignal correctly
This commit is contained in:
@@ -344,8 +344,8 @@ This version (`LinkWirelessMultiboot::Async`) allows more advanced use cases lik
|
||||
| `getResult([clear])` | **LinkWirelessMultiboot::Async::Result** | Returns the result of the last operation. <br/><br/>After this call, the result is cleared if `clear` is `true` (default behavior). |
|
||||
| `playerCount()` | **u8** _(1~5)_ | Returns the number of connected players. |
|
||||
| `getPercentage()` | **u32** _(0~100)_ | Returns the completion percentage. |
|
||||
| `isReady()` | **bool** | Returns whether the ready mark is active or not. <br/><br/>This is only useful when using the `waitForReadySignal` parameter. |
|
||||
| `markReady()` | **bool** | Marks the transfer as ready. <br/><br/>This is only useful when using the `waitForReadySignal` parameter. |
|
||||
| `isReady()` | **bool** | Returns whether the ready mark is active or not. |
|
||||
| `markReady()` | **bool** | Marks the transfer as ready. |
|
||||
|
||||
⚠️ never call `reset()` inside an interrupt handler!
|
||||
|
||||
|
||||
@@ -848,15 +848,11 @@ class LinkWirelessMultiboot {
|
||||
|
||||
/**
|
||||
* @brief Returns whether the ready mark is active or not.
|
||||
* \warning This is only useful when using the `waitForReadySignal`
|
||||
* parameter.
|
||||
*/
|
||||
[[nodiscard]] bool isReady() { return dynamicData.ready; }
|
||||
|
||||
/**
|
||||
* @brief Marks the transfer as ready.
|
||||
* \warning This is only useful when using the `waitForReadySignal`
|
||||
* parameter.
|
||||
*/
|
||||
void markReady() {
|
||||
if (state == STOPPED)
|
||||
@@ -1241,9 +1237,10 @@ class LinkWirelessMultiboot {
|
||||
};
|
||||
|
||||
void startOrKeepListening() {
|
||||
if ((linkRawWireless.playerCount() < fixedData.players &&
|
||||
!dynamicData.ready) ||
|
||||
linkRawWireless.playerCount() <= 1) {
|
||||
if (linkRawWireless.playerCount() <= 1 ||
|
||||
(fixedData.waitForReadySignal && !dynamicData.ready) ||
|
||||
(linkRawWireless.playerCount() < fixedData.players &&
|
||||
!dynamicData.ready)) {
|
||||
state = LISTENING;
|
||||
return (void)pollConnections();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user