Add some debug messages
This commit is contained in:
@@ -757,6 +757,7 @@ static void handle_expansion(struct wiimote_t* wm, byte* msg) {
|
|||||||
* a handshake with the expansion.
|
* a handshake with the expansion.
|
||||||
*/
|
*/
|
||||||
void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
||||||
|
WIIUSE_DEBUG("handshake_expansion with state %d", wm->expansion_state);
|
||||||
int id;
|
int id;
|
||||||
byte val = 0;
|
byte val = 0;
|
||||||
byte buf = 0x00;
|
byte buf = 0x00;
|
||||||
@@ -796,7 +797,10 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
|||||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_EXP);
|
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_EXP);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if(!data || !len) return;
|
if(!data || !len) {
|
||||||
|
WIIUSE_DEBUG("no handshake data received from expansion");
|
||||||
|
return;
|
||||||
|
}
|
||||||
id = from_big_endian_uint32_t(data + 220);
|
id = from_big_endian_uint32_t(data + 220);
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case EXP_ID_CODE_NUNCHUK:
|
case EXP_ID_CODE_NUNCHUK:
|
||||||
@@ -852,6 +856,7 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
|||||||
* a handshake with the expansion.
|
* a handshake with the expansion.
|
||||||
*/
|
*/
|
||||||
void disable_expansion(struct wiimote_t* wm) {
|
void disable_expansion(struct wiimote_t* wm) {
|
||||||
|
WIIUSE_DEBUG("Disabling expansion");
|
||||||
if (!WIIMOTE_IS_SET(wm, WIIMOTE_STATE_EXP))
|
if (!WIIMOTE_IS_SET(wm, WIIMOTE_STATE_EXP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user