From 7e151ab87ac59ea3e142e83e45c87c65650823b3 Mon Sep 17 00:00:00 2001 From: linjieqiang <517503838@qq.com> Date: Fri, 4 Jul 2025 15:49:03 +0800 Subject: [PATCH] Fix errors in the readme document --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c8c0afe..d242dbf9 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ static void memFree(void* const user_reference, const size_t size, void* const p Init a library instance: ```c -const struct CanardMemoryResource memory{nullptr, &memAllocate, &memFree}; +const struct CanardMemoryResource memory = {NULL, memFree, memAllocate}; struct CanardInstance canard = canardInit(memory); canard.node_id = 42; // Defaults to anonymous; can be set up later at any point. ``` @@ -95,7 +95,7 @@ canard.node_id = 42; // Defaults to anonymous; can be set In order to be able to send transfers over the network, we will need one transmission queue per redundant CAN interface: ```c -const struct CanardMemoryResource tx_memory{nullptr, memAllocate, memFree}; +const struct CanardMemoryResource tx_memory = {NULL, memFree, memAllocate}; struct CanardTxQueue queue = canardTxInit( 100, // Limit the size of the queue at 100 frames. CANARD_MTU_CAN_FD, // Set MTU = 64 bytes. There is also CANARD_MTU_CAN_CLASSIC.