Show badge uptime

This commit is contained in:
Stefan `Sec` Zehl 2011-07-31 00:54:41 +02:00
parent 8bc5424607
commit a20a260117
1 changed files with 33 additions and 0 deletions

View File

@ -44,6 +44,39 @@ void adc_light(void) {
dx=DoString(0,dy,"Done."); dx=DoString(0,dy,"Done.");
}; };
void uptime(void) {
int t;
int h;
char flag;
while ((getInputRaw())==BTN_NONE){
lcdClear();
lcdPrintln("Uptime:");
t=getTimer()/(1000/SYSTICKSPEED);
h=t/60/60;
flag=F_ZEROS;
if(h>0){
lcdPrint(IntToStr(h,2,flag));
lcdPrint("h");
flag|=F_LONG;
};
h=t/60%60;
if(h>0){
lcdPrint(IntToStr(h,2,flag));
lcdPrint("m");
flag|=F_LONG;
};
h=t%60;
if(h>0){
lcdPrint(IntToStr(h,2,flag));
lcdPrint("s");
};
lcdNl();
lcdRefresh();
delayms_queue(200);
};
lcdPrintln("done.");
};
void gotoISP(void) { void gotoISP(void) {
DoString(0,0,"Enter ISP!"); DoString(0,0,"Enter ISP!");
lcdDisplay(); lcdDisplay();