mirror of
https://github.com/wiiu-env/AutobootModule.git
synced 2024-09-27 18:48:41 +02:00
Merge 8d6a86377b
into 67dfdd1fc8
This commit is contained in:
commit
ffe4712ec3
@ -90,23 +90,17 @@ void initExternalStorage() {
|
|||||||
// the lib before actually using it.
|
// the lib before actually using it.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int connectedStorage = 0;
|
int connectedStorage = numberUSBStorageDevicesConnected();
|
||||||
if ((connectedStorage = numberUSBStorageDevicesConnected()) <= 0) {
|
|
||||||
nn::spm::Initialize();
|
|
||||||
InitEmptyExternalStorage();
|
|
||||||
nn::spm::Finalize();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Connected StorageDevices = %d", connectedStorage);
|
DEBUG_FUNCTION_LINE("Connected StorageDevices = %d", connectedStorage);
|
||||||
|
|
||||||
nn::spm::Initialize();
|
nn::spm::Initialize();
|
||||||
|
|
||||||
nn::spm::StorageListItem items[0x20];
|
nn::spm::StorageListItem items[0x20];
|
||||||
int tries = 0;
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
while (tries < 1200) { // Wait up to 20 seconds, like the Wii U Menu
|
for(int tries = 1200; tries; tries--) { // Wait up to 20 seconds, like the Wii U Menu
|
||||||
int32_t numItems = nn::spm::GetStorageList(items, 0x20);
|
int32_t numItems = nn::spm::GetStorageList(items, 0x20);
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Number of items: %d", numItems);
|
DEBUG_FUNCTION_LINE("Number of items: %d", numItems);
|
||||||
@ -127,12 +121,11 @@ void initExternalStorage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found || (connectedStorage == numItems)) {
|
if (found || (connectedStorage <= numItems)) {
|
||||||
DEBUG_FUNCTION_LINE("Found all expected items, breaking.");
|
DEBUG_FUNCTION_LINE("Found all expected items, breaking.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
OSSleepTicks(OSMillisecondsToTicks(16));
|
OSSleepTicks(OSMillisecondsToTicks(16));
|
||||||
tries++;
|
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
DEBUG_FUNCTION_LINE("USB Storage is connected but either it doesn't have a WFS partition or we ran into a timeout.");
|
DEBUG_FUNCTION_LINE("USB Storage is connected but either it doesn't have a WFS partition or we ran into a timeout.");
|
||||||
|
Loading…
Reference in New Issue
Block a user