Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 91:55971936cee4, committed 2017-10-24
- Comitter:
- Helmut Tschemernjak
- Date:
- Tue Oct 24 20:01:02 2017 +0200
- Parent:
- 90:d98572047c9c
- Child:
- 92:ee3de1d353cd
- Commit message:
- Fixed a dprintf problem of overflowing timestamps
Changed in this revision
| Arduino-mbed-APIs/arduino-util.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Arduino-mbed-APIs/arduino-util.cpp Sun Sep 17 12:46:18 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-util.cpp Tue Oct 24 20:01:02 2017 +0200
@@ -21,9 +21,9 @@
int secs = s_getTicker();
int s = secs % 60;
- int m = secs / 60;
- int h = secs / 3600;
- int us = us_getTicker() % 1000000;
+ int m = (secs / 60) % 60;
+ int h = (secs / 3600) % 24;
+ uint32_t us = us_getTicker() % (uint32_t)1000000;
snprintf(tmpbuf, sizeof(tmpbuf)-1, "%02d:%02d:%02d.%.06d ", h, m, s, us);
ser->write(tmpbuf, (int) sizeof "00:00:34.3436868 " -1);