AP_CANManager: Console output can be disabled

This commit is contained in:
murata 2022-03-21 18:25:55 +09:00 committed by Andrew Tridgell
parent 5728d2fd7c
commit 1e485c20fc
2 changed files with 5 additions and 5 deletions

View File

@ -328,10 +328,10 @@ bool CANTester::test_loopback(uint32_t loop_rate)
}
for (uint8_t i = 0; i < _num_ifaces; i++) {
hal.console->printf("Loopback Test Results %d->%d:\n", i, (i+1)%2);
hal.console->printf("num_tx: %lu, failed_tx: %lu\n",
DEV_PRINTF("Loopback Test Results %d->%d:\n", i, (i+1)%2);
DEV_PRINTF("num_tx: %lu, failed_tx: %lu\n",
(long unsigned int)_loopback_stats[i].num_tx, (long unsigned int)_loopback_stats[i].failed_tx);
hal.console->printf("num_rx: %lu, flushed_rx: %lu, bad_rx_data: %lu, bad_rx_seq: %lu\n",
DEV_PRINTF("num_rx: %lu, flushed_rx: %lu, bad_rx_data: %lu, bad_rx_seq: %lu\n",
(long unsigned int)_loopback_stats[i].num_rx, (long unsigned int)_loopback_stats[i].num_flushed_rx,
(long unsigned int)_loopback_stats[i].bad_rx_data, (long unsigned int)_loopback_stats[i].bad_rx_seq);
if (_loopback_stats[i].num_rx < 0.9f * _loopback_stats[i].num_tx ||

View File

@ -201,12 +201,12 @@ void AP_CANTester_KDECAN::loop(void)
void AP_CANTester_KDECAN::print_stats(void)
{
hal.console->printf("KDECANTester: TimeStamp: %u\n", (unsigned)AP_HAL::micros());
DEV_PRINTF("KDECANTester: TimeStamp: %u\n", (unsigned)AP_HAL::micros());
for (uint16_t i=0; i<100; i++) {
if (counters[i].frame_id == 0) {
break;
}
hal.console->printf("0x%08x: %u\n", (unsigned)counters[i].frame_id, (unsigned)counters[i].count);
DEV_PRINTF("0x%08x: %u\n", (unsigned)counters[i].frame_id, (unsigned)counters[i].count);
counters[i].count = 0;
}
}