uavcan_v1:Uavcan: Use inttypes

This commit is contained in:
David Sidrane
2021-04-30 04:04:32 -07:00
committed by Julian Oes
parent 026d36dee8
commit 37d93320eb
+4 -4
View File
@@ -64,7 +64,7 @@ UavcanNode::UavcanNode(CanardInterface *interface, uint32_t node_id) :
uavcan_allocator = o1heapInit(_uavcan_heap, HeapSize, nullptr, nullptr); uavcan_allocator = o1heapInit(_uavcan_heap, HeapSize, nullptr, nullptr);
if (uavcan_allocator == nullptr) { if (uavcan_allocator == nullptr) {
PX4_ERR("o1heapInit failed with size %d", HeapSize); PX4_ERR("o1heapInit failed with size %u", HeapSize);
} }
_canard_instance = canardInit(&memAllocate, &memFree); _canard_instance = canardInit(&memAllocate, &memFree);
@@ -228,7 +228,7 @@ void UavcanNode::Run()
// It is possible to statically prove that an out-of-memory will never occur for a given application if // It is possible to statically prove that an out-of-memory will never occur for a given application if
// the heap is sized correctly; for background, refer to the Robson's Proof and the documentation for O1Heap. // the heap is sized correctly; for background, refer to the Robson's Proof and the documentation for O1Heap.
// Reception of an invalid frame is NOT an error. // Reception of an invalid frame is NOT an error.
PX4_ERR("Receive error %d\n", result); PX4_ERR("Receive error %" PRId32" \n", result);
} else if (result == 1) { } else if (result == 1) {
// A transfer has been received, process it. // A transfer has been received, process it.
@@ -389,7 +389,7 @@ extern "C" __EXPORT int uavcan_v1_main(int argc, char *argv[])
param_get(param_find("UAVCAN_V1_ID"), &node_id); param_get(param_find("UAVCAN_V1_ID"), &node_id);
// Start // Start
PX4_INFO("Node ID %u, bitrate %u", node_id, bitrate); PX4_INFO("Node ID %" PRIu32 ", bitrate %" PRIu32, node_id, bitrate);
return UavcanNode::start(node_id, bitrate); return UavcanNode::start(node_id, bitrate);
} }
@@ -444,7 +444,7 @@ void UavcanNode::sendHeartbeat()
// An error has occurred: either an argument is invalid or we've ran out of memory. // An error has occurred: either an argument is invalid or we've ran out of memory.
// It is possible to statically prove that an out-of-memory will never occur for a given application if the // It is possible to statically prove that an out-of-memory will never occur for a given application if the
// heap is sized correctly; for background, refer to the Robson's Proof and the documentation for O1Heap. // heap is sized correctly; for background, refer to the Robson's Proof and the documentation for O1Heap.
PX4_ERR("Heartbeat transmit error %d", result); PX4_ERR("Heartbeat transmit error %" PRId32 "", result);
} }
_uavcan_node_heartbeat_last = now; _uavcan_node_heartbeat_last = now;