mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
1) Presents a time for us without RTC.
2) Escaping the percent-sign correct for the splash screen. 3) Removed the newline for the splash screen. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4785 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
051e017ab8
commit
57e43cfb21
1 changed files with 13 additions and 0 deletions
|
|
@ -69,12 +69,25 @@ void loop(void)
|
||||||
rb->splash(HZ, true, "Failed creating /battery.log");
|
rb->splash(HZ, true, "Failed creating /battery.log");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_RTC
|
||||||
t = rb->get_time();
|
t = rb->get_time();
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
static struct tm temp;
|
||||||
|
long t2 = *rb->current_tick/HZ;
|
||||||
|
temp.tm_hour=t2/3600;
|
||||||
|
temp.tm_min=(t2/60)%60;
|
||||||
|
temp.tm_sec=t2%60;
|
||||||
|
t=&temp;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
rb->snprintf(buf, sizeof buf, "%02d:%02d:%02d Battery %d%%\n",
|
rb->snprintf(buf, sizeof buf, "%02d:%02d:%02d Battery %d%%\n",
|
||||||
t->tm_hour, t->tm_min, t->tm_sec, batt);
|
t->tm_hour, t->tm_min, t->tm_sec, batt);
|
||||||
rb->write(f, buf, rb->strlen(buf));
|
rb->write(f, buf, rb->strlen(buf));
|
||||||
rb->close(f);
|
rb->close(f);
|
||||||
|
|
||||||
|
rb->snprintf(buf, sizeof buf, "%02d:%02d:%02d Battery %d%%%%",
|
||||||
|
t->tm_hour, t->tm_min, t->tm_sec, batt);
|
||||||
rb->splash(0, true, buf);
|
rb->splash(0, true, buf);
|
||||||
|
|
||||||
/* simulate 128kbit/s (16kbyte/s) playback duration */
|
/* simulate 128kbit/s (16kbyte/s) playback duration */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue