Setting default wireless interval to 75

This commit is contained in:
Rodrigo Alfonso 2025-02-05 02:08:54 -03:00
parent 6055e4faac
commit 3ca906cc4f
4 changed files with 6 additions and 6 deletions

View File

@ -95,7 +95,7 @@ The library uses message queues to send/receive data and transmits when it's pos
| ------------- | -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `baudRate` | **BaudRate** | `BaudRate::BAUD_RATE_1` | Sets a specific baud rate. |
| `timeout` | **u32** | `3` | Maximum number of _frames_ without receiving data from other player before marking them as disconnected or resetting the connection. |
| `interval` | **u16** | `50` | Number of _1024-cycle ticks_ (61.04μs) between transfers _(50 = 3.052ms)_. It's the interval of Timer #`sendTimerId`. <br/><br/>Lower values will transfer faster but also consume more CPU. You can use `Link::perFrame(...)` to convert from _packets per frame_ to _interval values_. |
| `interval` | **u16** | `50` | Number of _1024-cycle ticks_ (61.04μs) between transfers _(50 = 3.052ms)_. It's the interval of Timer #`sendTimerId`. <br/><br/>Lower values will transfer faster but also consume more CPU. You can use `Link::perFrame(...)` to convert from _transfers per frame_ to _interval values_. |
| `sendTimerId` | **u8** _(0~3)_ | `3` | GBA Timer to use for sending. |
You can update these values at any time without creating a new instance:
@ -254,7 +254,7 @@ https://github.com/afska/gba-link-connection/assets/1631752/7eeafc49-2dfa-4902-a
| `retransmission` | **bool** | `true` | If `true`, the library handles retransmission for you, so there should be no packet loss. |
| `maxPlayers` | **u8** _(2~5)_ | `5` | Maximum number of allowed players. |
| `timeout` | **u32** | `10` | Maximum number of _frames_ without receiving data from other player before resetting the connection. |
| `interval` | **u16** | `50` | Number of _1024-cycle ticks_ (61.04μs) between transfers _(50 = 3.052ms)_. It's the interval of Timer #`sendTimerId`. Lower values will transfer faster but also consume more CPU. You can use `Link::perFrame(...)` to convert from _packets per frame_ to _interval values_. |
| `interval` | **u16** | `75` | Number of _1024-cycle ticks_ (61.04μs) between transfers _(75 = 4.578ms)_. It's the interval of Timer #`sendTimerId`. Lower values will transfer faster but also consume more CPU. You can use `Link::perFrame(...)` to convert from _transfers per frame_ to _interval values_. |
| `sendTimerId` | **u8** _(0~3)_ | `3` | GBA Timer to use for sending. |
You can update these values at any time without creating a new instance:

View File

@ -138,7 +138,7 @@ LINK_VERSION_TAG LINK_WIRELESS_VERSION = "vLinkWireless/v8.0.0";
#define LINK_WIRELESS_MAX_GAME_NAME_LENGTH 14
#define LINK_WIRELESS_MAX_USER_NAME_LENGTH 8
#define LINK_WIRELESS_DEFAULT_TIMEOUT 10
#define LINK_WIRELESS_DEFAULT_INTERVAL 50
#define LINK_WIRELESS_DEFAULT_INTERVAL 75
#define LINK_WIRELESS_DEFAULT_SEND_TIMER_ID 3
#define LINK_WIRELESS_RESET_IF_NEEDED \
@ -258,7 +258,7 @@ class LinkWireless {
* @param timeout Number of *frames* without receiving *any* data to reset the
* connection.
* @param interval Number of *1024-cycle ticks* (61.04μs) between transfers
* *(50 = 3.052ms)*. It's the interval of Timer #`sendTimerId`. Lower values
* *(75 = 4.578ms)*. It's the interval of Timer #`sendTimerId`. Lower values
* will transfer faster but also consume more CPU.
* @param sendTimerId `(0~3)` GBA Timer to use for sending.
* \warning You can use `Link::perFrame(...)` to convert from *packets per

View File

@ -391,7 +391,7 @@ static inline void reset() {
_REG_SIOCNT = 0;
}
// Packets per frame -> Timer interval
// Transfers per frame -> Timer interval
static inline u16 perFrame(u16 packets) {
return (1667 * 1024) / (packets * 6104);
}

View File

@ -16,7 +16,7 @@ typedef void* C_LinkWirelessHandle;
#define C_LINK_WIRELESS_MAX_GAME_NAME_LENGTH 14
#define C_LINK_WIRELESS_MAX_USER_NAME_LENGTH 8
#define C_LINK_WIRELESS_DEFAULT_TIMEOUT 10
#define C_LINK_WIRELESS_DEFAULT_INTERVAL 50
#define C_LINK_WIRELESS_DEFAULT_INTERVAL 75
#define C_LINK_WIRELESS_DEFAULT_SEND_TIMER_ID 3
typedef enum {