Properly implemented registerInternalFailure(); some logging in STM32 test app

This commit is contained in:
Pavel Kirienko
2014-04-11 14:18:36 +04:00
parent 1fbd6c2cdd
commit d2eb0a03ee
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -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_; }
@@ -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)
@@ -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<unsigned long>(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());
}
}
}