From e28de03c88d396d2dc45afbc720c5e555d480526 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 17 Nov 2016 14:38:19 +0100 Subject: ucoo/utils: add trace dump without debuger --- ucoo/hal/i2c/i2c_hard.stm32.cc | 2 +- ucoo/hal/timer/timer.hh | 5 +++++ ucoo/hal/usb/test/Makefile | 2 +- ucoo/hal/usb/usb_driver.cc | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'ucoo/hal') diff --git a/ucoo/hal/i2c/i2c_hard.stm32.cc b/ucoo/hal/i2c/i2c_hard.stm32.cc index 22567c9..fa0266b 100644 --- a/ucoo/hal/i2c/i2c_hard.stm32.cc +++ b/ucoo/hal/i2c/i2c_hard.stm32.cc @@ -30,7 +30,7 @@ namespace ucoo { /// Local trace. -static Trace i2c_trace; +static Trace i2c_trace ("i2c"); /// Information on I2C hardware structure. struct i2c_hardware_t 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 #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 (e.timestamp - eprev.timestamp)); + } }; } // namespace ucoo diff --git a/ucoo/hal/usb/test/Makefile b/ucoo/hal/usb/test/Makefile index d4849df..cac90d8 100644 --- a/ucoo/hal/usb/test/Makefile +++ b/ucoo/hal/usb/test/Makefile @@ -4,6 +4,6 @@ TARGETS = stm32f4 PROGS = test_usb test_usb_SOURCES = test_usb.cc -MODULES = ucoo/hal/usb ucoo/hal/gpio +MODULES = ucoo/hal/usb ucoo/hal/gpio ucoo/utils include $(BASE)/build/top.mk diff --git a/ucoo/hal/usb/usb_driver.cc b/ucoo/hal/usb/usb_driver.cc index efd8e6c..e53fe2f 100644 --- a/ucoo/hal/usb/usb_driver.cc +++ b/ucoo/hal/usb/usb_driver.cc @@ -26,7 +26,7 @@ namespace ucoo { -Trace usb_trace; +Trace usb_trace ("usb"); void UsbDriver::register_application (UsbApplication &app) -- cgit v1.2.3