mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 01:03:33 +08:00
STM32 debug helpers: printing RX queue length
This commit is contained in:
@@ -172,6 +172,12 @@ public:
|
||||
*/
|
||||
virtual uavcan::uint64_t getErrorCount() const;
|
||||
|
||||
/**
|
||||
* Returns number of frames pending in the RX queue.
|
||||
* This is intended for debug use only.
|
||||
*/
|
||||
unsigned getRxQueueLength() const;
|
||||
|
||||
/**
|
||||
* Returns last hardware error code (LEC field in the register ESR)
|
||||
*/
|
||||
|
||||
@@ -518,6 +518,12 @@ uavcan::uint64_t CanIface::getErrorCount() const
|
||||
return error_cnt_ + rx_queue_.getOverflowCount();
|
||||
}
|
||||
|
||||
unsigned CanIface::getRxQueueLength() const
|
||||
{
|
||||
CriticalSectionLocker lock;
|
||||
return rx_queue_.getLength();
|
||||
}
|
||||
|
||||
uavcan::uint8_t CanIface::yieldLastHardwareErrorCode()
|
||||
{
|
||||
CriticalSectionLocker lock;
|
||||
|
||||
@@ -124,7 +124,16 @@ public:
|
||||
{
|
||||
lowsyslog("Spin failure: %i\n", spin_res);
|
||||
}
|
||||
|
||||
lowsyslog("Time sync master: %u\n", unsigned(time_sync_slave.getMasterNodeID().get()));
|
||||
|
||||
lowsyslog("Memory usage: used=%u free=%u\n",
|
||||
node.getAllocator().getNumUsedBlocks(), node.getAllocator().getNumFreeBlocks());
|
||||
|
||||
lowsyslog("RX queues: %u %u\n",
|
||||
can.driver.getIface(0)->getRxQueueLength(),
|
||||
can.driver.getIface(1)->getRxQueueLength());
|
||||
|
||||
node.logInfo("app", "UTC %* sec, %* corr, %* jumps",
|
||||
uavcan_stm32::clock::getUtc().toMSec() / 1000,
|
||||
uavcan_stm32::clock::getUtcSpeedCorrectionPPM(),
|
||||
|
||||
Reference in New Issue
Block a user