diff --git a/src/io.c b/src/io.c index 25f62d4..16d382a 100644 --- a/src/io.c +++ b/src/io.c @@ -69,7 +69,7 @@ void wiiuse_wait_report(struct wiimote_t *wm, int report, byte *data) { for(;;) { - if(wiiuse_io_read(wm, data, 32) > 0) + if(wiiuse_io_read(wm, data, MAX_PAYLOAD) > 0) if(data[1] == report) break; } @@ -91,7 +91,7 @@ void wiiuse_wait_report(struct wiimote_t *wm, int report, byte *data) void wiiuse_read(struct wiimote_t *wm, byte memory, unsigned addr, unsigned short size, byte *data) { byte pkt[8]; - byte buf[32]; + byte buf[MAX_PAYLOAD]; unsigned n_full_reports; unsigned last_report; byte *output; @@ -154,7 +154,7 @@ void wiiuse_read(struct wiimote_t *wm, byte memory, unsigned addr, unsigned shor void wiiuse_handshake(struct wiimote_t* wm, byte* data, uint16_t len) { /* send request to wiimote for accelerometer calibration */ - byte buf[32]; + byte buf[MAX_PAYLOAD]; byte report_type; /* step 0 - Reset wiimote */ diff --git a/src/motion_plus.c b/src/motion_plus.c index c69f3b2..c0bfe0c 100644 --- a/src/motion_plus.c +++ b/src/motion_plus.c @@ -45,7 +45,7 @@ static void calculate_gyro_rates(struct motion_plus_t* mp); void wiiuse_probe_motion_plus(struct wiimote_t *wm) { - byte buf[32]; + byte buf[MAX_PAYLOAD]; unsigned id; wiiuse_read(wm, 0, WM_EXP_MOTION_PLUS_IDENT, 6, buf); diff --git a/src/wiiuse.c b/src/wiiuse.c index 0711cad..406b1bc 100644 --- a/src/wiiuse.c +++ b/src/wiiuse.c @@ -657,7 +657,7 @@ void wiiuse_send_next_pending_write_request(struct wiimote_t* wm) { * This function should replace any write()s directly to the wiimote device. */ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) { - byte buf[32]; /* no payload is better than this */ + byte buf[MAX_PAYLOAD]; /* no payload is better than this */ int rumble = 0; #ifdef WIIUSE_WIN32