From ff0bfc261d5f8ef6d904f6ae94c80a7dcaeacb3d Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 21 Sep 2010 15:04:40 -0500 Subject: [PATCH] Fix: setting IR to off before handshake completes used to enable it anyway. Fix via Harald --- src/ir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ir.c b/src/ir.c index 7a9bb68..b0bcba8 100644 --- a/src/ir.c +++ b/src/ir.c @@ -74,8 +74,10 @@ void wiiuse_set_ir(struct wiimote_t* wm, int status) { * again to actually enable IR. */ if (!WIIMOTE_IS_SET(wm, WIIMOTE_STATE_HANDSHAKE_COMPLETE)) { - WIIUSE_DEBUG("Tried to enable IR, will wait until handshake finishes."); - WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_IR); + if(status) { + WIIUSE_DEBUG("Tried to enable IR, will wait until handshake finishes."); + WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_IR); + } // else ignoring request to turn off, since it's turned off by default return; }