summaryrefslogtreecommitdiff
path: root/ucoo/hal/timer
diff options
context:
space:
mode:
authorNicolas Schodet2016-11-17 14:38:19 +0100
committerNicolas Schodet2019-10-09 23:05:51 +0200
commite28de03c88d396d2dc45afbc720c5e555d480526 (patch)
treefb596dfebbbcce3844366b0f397eb40f75feef0e /ucoo/hal/timer
parent54971d4b01b927a8b29a16a13c2708730bc209f9 (diff)
ucoo/utils: add trace dump without debuger
Diffstat (limited to 'ucoo/hal/timer')
-rw-r--r--ucoo/hal/timer/timer.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/ucoo/hal/timer/timer.hh b/ucoo/hal/timer/timer.hh
index ab0fa18..31f785f 100644
--- a/ucoo/hal/timer/timer.hh
+++ b/ucoo/hal/timer/timer.hh
@@ -23,6 +23,7 @@
// DEALINGS IN THE SOFTWARE.
//
// }}}
+#include <cstdio>
#if defined TARGET_stm32
# include "timer.stm32.hh"
@@ -44,6 +45,10 @@ struct TimerTraceTimestamp
{
e.timestamp = Timer::get_value ();
}
+ int dump (const Entry &e, const Entry &eprev, char *buf) const
+ {
+ return sprintf (buf, "[%+8d] ", static_cast<int> (e.timestamp - eprev.timestamp));
+ }
};
} // namespace ucoo