diff --git a/libuavcan/include/uavcan/node/node.hpp b/libuavcan/include/uavcan/node/node.hpp index f63b4fdd11..a80ce6d19f 100644 --- a/libuavcan/include/uavcan/node/node.hpp +++ b/libuavcan/include/uavcan/node/node.hpp @@ -55,7 +55,7 @@ protected: virtual void registerInternalFailure(const char* msg) { UAVCAN_TRACE("Node", "Internal failure: %s", msg); - logError("UAVCAN", msg); + (void)getLogger().log(protocol::debug::LogLevel::ERROR, "UAVCAN", msg); } virtual IAllocator& getAllocator() { return pool_allocator_; } diff --git a/libuavcan_drivers/stm32/test_stm32f107/Makefile b/libuavcan_drivers/stm32/test_stm32f107/Makefile index ff390ac45f..ef53576784 100644 --- a/libuavcan_drivers/stm32/test_stm32f107/Makefile +++ b/libuavcan_drivers/stm32/test_stm32f107/Makefile @@ -17,7 +17,8 @@ CPPSRC = src/main.cpp src/dummy.cpp UDEFS = -DUAVCAN_STM32_CHIBIOS=1 \ -DUAVCAN_STM32_TIMER_NUMBER=6 \ -DUAVCAN_MEM_POOL_BLOCK_SIZE=56 \ - -DUAVCAN_TOSTRING=0 + -DUAVCAN_TOSTRING=0 \ + -DUAVCAN_EXCEPTIONS=0 include ../../../libuavcan/include.mk CPPSRC += $(LIBUAVCAN_SRC) diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp b/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp index cd5c935f33..3099ca70d7 100644 --- a/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp +++ b/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp @@ -143,6 +143,8 @@ int main() lowsyslog("Starting the UAVCAN thread\n"); app::uavcan_node_thread.start(LOWPRIO); + app::getNode().getLogger().setLevel(uavcan::protocol::debug::LogLevel::INFO); + while (true) { for (int i = 0; i < 200; i++) @@ -156,5 +158,13 @@ int main() static_cast(utc.toMSec() / 1000), uavcan_stm32::clock::getUtcSpeedCorrectionPPM(), uavcan_stm32::clock::getUtcAjdustmentJumpCount()); + + if (app::getNode().isStarted()) + { + app::getNode().logInfo("app", "UTC %* sec, %* corr, %* jumps", + utc.toMSec() / 1000, + uavcan_stm32::clock::getUtcSpeedCorrectionPPM(), + uavcan_stm32::clock::getUtcAjdustmentJumpCount()); + } } }