mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge pull request #251 from felis/issue234
Keep reading the IR camera as well if an extension disconnects
This commit is contained in:
commit
7b0396c1a0
1 changed files with 14 additions and 3 deletions
13
Wii.cpp
13
Wii.cpp
|
@ -327,11 +327,18 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
||||||
nunchuckConnected = false; // It must be the Nunchuck controller then
|
nunchuckConnected = false; // It must be the Nunchuck controller then
|
||||||
wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
|
wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
|
||||||
onInit();
|
onInit();
|
||||||
|
#ifdef WIICAMERA
|
||||||
|
if(!isIRCameraEnabled()) // We still want to read from the IR camera, so do not change the report mode
|
||||||
|
#endif
|
||||||
setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
|
setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
|
||||||
} else
|
} else {
|
||||||
|
#ifdef WIICAMERA
|
||||||
|
if(!isIRCameraEnabled()) // We still want to read from the IR camera, so do not change the report mode
|
||||||
|
#endif
|
||||||
setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
|
setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef EXTRADEBUG
|
#ifdef EXTRADEBUG
|
||||||
Notify(PSTR("\r\nChecking battery level"), 0x80);
|
Notify(PSTR("\r\nChecking battery level"), 0x80);
|
||||||
|
@ -965,6 +972,10 @@ uint8_t WII::getBatteryLevel() {
|
||||||
};
|
};
|
||||||
|
|
||||||
void WII::setReportMode(bool continuous, uint8_t mode) {
|
void WII::setReportMode(bool continuous, uint8_t mode) {
|
||||||
|
#ifdef EXTRADEBUG
|
||||||
|
Notify(PSTR("\r\nReport mode was changed to: "), 0x80);
|
||||||
|
D_PrintHex<uint8_t > (mode, 0x80);
|
||||||
|
#endif
|
||||||
uint8_t cmd_buf[4];
|
uint8_t cmd_buf[4];
|
||||||
cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
|
cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
|
||||||
cmd_buf[1] = 0x12;
|
cmd_buf[1] = 0x12;
|
||||||
|
|
Loading…
Reference in a new issue