You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1038,3 +1039,70 @@ int bdmUpdateDeviceData(item_list_t *itemList)
1038
1039
fileXioDclose(dir);
1039
1040
return0;
1040
1041
}
1042
+
1043
+
intbdmWaitForDevice(intdeviceId, u32timeoutMs)
1044
+
{
1045
+
constintRETRY_DELAY=100;
1046
+
charpath[16];
1047
+
1048
+
u32start=GetTimerSystemTime();
1049
+
sprintf(path, "mass%d:/", deviceId);
1050
+
1051
+
while (1) {
1052
+
intdir=fileXioDopen(path);
1053
+
1054
+
if (dir >= 0) {
1055
+
fileXioDclose(dir);
1056
+
return1; // ready
1057
+
}
1058
+
1059
+
u32now=GetTimerSystemTime();
1060
+
u32elapsed_ms= (now-start) / (kBUSCLK / 1000);
1061
+
1062
+
if (elapsed_ms>timeoutMs) {
1063
+
return0; // timeout
1064
+
}
1065
+
1066
+
DelayThread(RETRY_DELAY*1000);
1067
+
}
1068
+
}
1069
+
1070
+
intbdmHDDIsPresent()
1071
+
{
1072
+
// the only thing that currently uses ata_device_identify is ATA_DEVCTL_GET_HIGHEST_UDMA_MODE, so this is the best method to check for presence via xhdd (for now anyways)
0 commit comments