mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Wiimote: Added timeout for Eeprom data reading, it should fail very rarely, but if it would we now stop waiting for it after two seconds. If it fails it will break the functionality of the real wiimote because g_WiiMotes[i]->ReadData() will not be called by ReadWiimote_ThreadFunc() while we are waiting for it.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2115 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -248,6 +248,21 @@ void ReadWiimote()
|
||||
handle_event(g_WiiMotesFromWiiUse[0]);
|
||||
std::string Temp;
|
||||
|
||||
/* Timeout for data reading. This is used in Initialize() to read the Eeprom, if we have not gotten
|
||||
what we wanted in the WIIUSE_READ_DATA case we stop this loop to avoid interference with the regular
|
||||
wiiuse_io_read() and wiiuse_io_write() communication. */
|
||||
if (g_RunTemporary)
|
||||
{
|
||||
// This holds if the update rate of wiiuse_poll() is kept at the default value of 10 ms
|
||||
static const int SecondsToWait = 2;
|
||||
g_RunTemporaryCountdown++;
|
||||
if(g_RunTemporaryCountdown > (SecondsToWait * 100))
|
||||
{
|
||||
g_RunTemporaryCountdown = 0;
|
||||
g_RunTemporary = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Read formatted Wiimote data
|
||||
if (wiiuse_poll(g_WiiMotesFromWiiUse, MAX_WIIMOTES))
|
||||
{
|
||||
|
Reference in New Issue
Block a user