logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

kjer: apps/plugins battery_test.c,1.1,1.2: msg#00085

Subject: kjer: apps/plugins battery_test.c,1.1,1.2
Update of /cvsroot/rockbox/apps/plugins
In directory labb.contactor.se:/var/tmp/cvs-serv13184

Modified Files:
        battery_test.c 
Log Message:
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.


Index: battery_test.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/battery_test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- battery_test.c      15 Jun 2004 23:24:06 -0000      1.1
+++ battery_test.c      22 Jun 2004 05:37:44 -0000      1.2
@@ -69,12 +69,25 @@
             rb->splash(HZ, true, "Failed creating /battery.log");
             break;
         }
+#ifdef HAVE_RTC
         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",
                      t->tm_hour, t->tm_min, t->tm_sec, batt);
         rb->write(f, buf, rb->strlen(buf));
         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);
         
         /* simulate 128kbit/s (16kbyte/s) playback duration */

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox-cvs



<Prev in Thread] Current Thread [Next in Thread>