Display USB waiting message.
This commit is contained in:
2
build.sh
2
build.sh
@@ -17,4 +17,4 @@ binary
|
||||
put MiSTer /media/fat/MiSTer
|
||||
EOF
|
||||
|
||||
plink root@192.168.1.75 -pw 1 'PATH=/media/fat:$PATH;MiSTer >/dev/ttyS0 2>/dev/ttyS0 </dev/null &'
|
||||
plink root@192.168.1.75 -pw 1 'sync;PATH=/media/fat:$PATH;MiSTer >/dev/ttyS0 2>/dev/ttyS0 </dev/null &'
|
||||
|
||||
26
file_io.c
26
file_io.c
@@ -13,6 +13,7 @@
|
||||
#include <linux/magic.h>
|
||||
#include "osd.h"
|
||||
#include "fpga_io.h"
|
||||
#include "menu.h"
|
||||
|
||||
int nDirEntries = 0;
|
||||
struct dirent DirItem[1000];
|
||||
@@ -357,6 +358,7 @@ int isPathMounted(int n)
|
||||
printf("%s is FS: 0x%08X\n", path, fs_stat.f_type);
|
||||
if (fs_stat.f_type != EXT4_SUPER_MAGIC)
|
||||
{
|
||||
printf("%s is not EXT2/3/4.\n", path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -381,20 +383,26 @@ int isUSBMounted()
|
||||
|
||||
void FindStorage(void)
|
||||
{
|
||||
char str[128];
|
||||
printf("Looking for root device...\n");
|
||||
device = 0;
|
||||
FileLoad("device.bin", &device, sizeof(int));
|
||||
orig_device = device;
|
||||
|
||||
if (device)
|
||||
if(device && !isUSBMounted())
|
||||
{
|
||||
printf("Waiting for USB...\n");
|
||||
int btn = 0;
|
||||
int done = 0;
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (int i = 30; i >= 0; i--)
|
||||
{
|
||||
if (isUSBMounted()) done = 1;
|
||||
if (done) break;
|
||||
sprintf(str, "\n\n Waiting for USB...\n\n %d \n", i);
|
||||
InfoMessage(str);
|
||||
if (isUSBMounted())
|
||||
{
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
@@ -402,15 +410,23 @@ void FindStorage(void)
|
||||
if (btn)
|
||||
{
|
||||
printf("Button has been pressed %d\n", btn);
|
||||
InfoMessage("\n\n Canceled!\n");
|
||||
usleep(500000);
|
||||
device = 0;
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
usleep(100000);
|
||||
}
|
||||
if (done) break;
|
||||
}
|
||||
|
||||
if (!done) device = 0;
|
||||
if (!done)
|
||||
{
|
||||
InfoMessage("\n\n No USB storage found\n Falling back to SD card\n");
|
||||
usleep(2000000);
|
||||
device = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (device)
|
||||
|
||||
2
menu.c
2
menu.c
@@ -3586,7 +3586,7 @@ static void set_text(const char *message, unsigned char code)
|
||||
OsdWrite(l++, s, 0, 0);
|
||||
}
|
||||
|
||||
while (l <= 7) OsdWrite(l++, "", 0, 0);
|
||||
while (l <= OsdGetSize()-1) OsdWrite(l++, "", 0, 0);
|
||||
}
|
||||
|
||||
/* Error Message */
|
||||
|
||||
Reference in New Issue
Block a user