mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 20:03:33 +08:00
Properly implemented registerInternalFailure(); some logging in STM32 test app
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user