conditionally compile handshake_state field
This commit is contained in:
3
src/io.c
3
src/io.c
@@ -205,8 +205,7 @@ void wiiuse_read(struct wiimote_t *wm, byte memory, unsigned addr, unsigned shor
|
|||||||
* with this data.
|
* with this data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYNC_HANDSHAKE 1
|
#ifndef WIIUSE_SYNC_HANDSHAKE
|
||||||
#ifdef SYNC_HANDSHAKE
|
|
||||||
|
|
||||||
void wiiuse_handshake(struct wiimote_t* wm, byte* data, uint16_t len)
|
void wiiuse_handshake(struct wiimote_t* wm, byte* data, uint16_t len)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ void wiiuse_disconnected(struct wiimote_t* wm) {
|
|||||||
wm->leds = 0;
|
wm->leds = 0;
|
||||||
wm->state = WIIMOTE_INIT_STATES;
|
wm->state = WIIMOTE_INIT_STATES;
|
||||||
wm->read_req = NULL;
|
wm->read_req = NULL;
|
||||||
|
#ifdef WIIUSE_SYNC_HANDSHAKE
|
||||||
wm->handshake_state = 0;
|
wm->handshake_state = 0;
|
||||||
|
#endif
|
||||||
wm->btns = 0;
|
wm->btns = 0;
|
||||||
wm->btns_held = 0;
|
wm->btns_held = 0;
|
||||||
wm->btns_released = 0;
|
wm->btns_released = 0;
|
||||||
@@ -795,7 +797,9 @@ void wiiuse_set_accel_threshold(struct wiimote_t* wm, int threshold) {
|
|||||||
void wiiuse_resync(struct wiimote_t* wm) {
|
void wiiuse_resync(struct wiimote_t* wm) {
|
||||||
if (!wm) return;
|
if (!wm) return;
|
||||||
|
|
||||||
|
#ifdef WIIUSE_SYNC_HANDSHAKE
|
||||||
wm->handshake_state = 0;
|
wm->handshake_state = 0;
|
||||||
|
#endif
|
||||||
wiiuse_handshake(wm, NULL, 0);
|
wiiuse_handshake(wm, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -322,6 +322,9 @@ typedef enum ir_position_t {
|
|||||||
#define WIIMOTE_EXP_TIMEOUT 10
|
#define WIIMOTE_EXP_TIMEOUT 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define WIIUSE_SYNC_HANDSHAKE
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned char byte;
|
typedef unsigned char byte;
|
||||||
typedef char sbyte;
|
typedef char sbyte;
|
||||||
|
|
||||||
@@ -756,7 +759,9 @@ typedef struct wiimote_t {
|
|||||||
|
|
||||||
WCONST int flags; /**< options flag */
|
WCONST int flags; /**< options flag */
|
||||||
|
|
||||||
|
#ifdef WIIUSE_SYNC_HANDSHAKE
|
||||||
WCONST byte handshake_state; /**< the state of the connection handshake */
|
WCONST byte handshake_state; /**< the state of the connection handshake */
|
||||||
|
#endif
|
||||||
WCONST byte expansion_state; /**< the state of the expansion handshake */
|
WCONST byte expansion_state; /**< the state of the expansion handshake */
|
||||||
WCONST struct data_req_t* data_req; /**< list of data read requests */
|
WCONST struct data_req_t* data_req; /**< list of data read requests */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user