Make initial app clearer for badges who already have a display :)

This commit is contained in:
Stefan `Sec` Zehl 2011-08-04 13:43:49 +02:00
parent 64d22980f2
commit d68b51f230
1 changed files with 18 additions and 10 deletions

View File

@ -70,7 +70,7 @@ void init(void)
void mount(void) void mount(void)
{ {
int res; int res;
lcdPrintln("Mount DF:"); lcdPrint("Mount:");
res=f_mount(0, &FatFs); res=f_mount(0, &FatFs);
lcdPrintln(f_get_rc_string(res)); lcdPrintln(f_get_rc_string(res));
lcdRefresh(); lcdRefresh();
@ -79,7 +79,8 @@ void mount(void)
void format(void) void format(void)
{ {
int res; int res;
lcdPrintln("Formatting DF..."); lcdPrintln("Format DF:");
res=f_mount(0, &FatFs);
res=f_mkfs(0,1,0); res=f_mkfs(0,1,0);
lcdPrintln(f_get_rc_string(res)); lcdPrintln(f_get_rc_string(res));
lcdRefresh(); lcdRefresh();
@ -91,29 +92,34 @@ int check(void)
int res = 1; int res = 1;
res=f_open(&file, "flashed.cfg", FA_OPEN_EXISTING|FA_READ); res=f_open(&file, "flashed.cfg", FA_OPEN_EXISTING|FA_READ);
lcdPrint("open:"); lcdPrint("open:");
lcdPrintln(f_get_rc_string(res)); lcdPrint(f_get_rc_string(res));
lcdPrintln(" ");
lcdRefresh(); lcdRefresh();
return res; return res;
} }
void msc(int timeout) void msc(int timeout)
{ {
lcdPrintln("MSC Enabled."); lcdPrintln("MSC: Wait4data...");
lcdRefresh(); lcdRefresh();
delayms_power(300); delayms_power(300);
usbMSCInit(); usbMSCInit();
while(check()){ while(1){
lcdSetCrsr(0,3*8);
mount(); mount();
if(!check())
break;
if(getInputRaw())
break;
delayms(100); delayms(100);
f_recv(); f_recv();
lcdRefresh();
} }
while(timeout--){ while(timeout--){
//f_recv();
delayms(100); delayms(100);
} }
lcdPrintln("MSC Disabled."); lcdPrintln("MSC:Off.");
usbMSCOff(); usbMSCOff();
lcdRefresh(); lcdRefresh();
} }
@ -127,11 +133,13 @@ void isp(void)
void main_initial(void) { void main_initial(void) {
init(); init();
mount();
//if( check() )
format(); format();
msc(5); msc(5);
delayms(200); delayms(200);
lcdPrintln("ISP:ON");
lcdPrintln("turn off");
lcdPrintln("when done.");
lcdRefresh();
ReinvokeISP(); ReinvokeISP();
} }