Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dsdl_compiler/libcanard_dsdl_compiler/code_type_template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @param msg_buf: pointer to msg storage
* @param offset: bit offset to msg storage
* @param root_item: for detecting if TAO should be used
* @retval returns offset
* @retval returns new offset
*/
uint32_t ${type_name}_encode_internal(${type_name}* source,
void* msg_buf,
Expand Down Expand Up @@ -96,7 +96,7 @@ uint32_t ${type_name}_encode_internal(${type_name}* source,
for (c = 0; c < source->${'%s' % ((f.name + '.len'))}; c++)
{
%if f.cpp_type_category == t.CATEGORY_COMPOUND:
offset += ${f.cpp_type}_encode_internal((void*)&source->${'%s' % ((f.name + '.data'))}[c], msg_buf, offset, 0);
offset = ${f.cpp_type}_encode_internal((void*)&source->${'%s' % ((f.name + '.data'))}[c], msg_buf, offset, 0);
%else
canardEncodeScalar(msg_buf,
offset,
Expand Down Expand Up @@ -180,7 +180,7 @@ uint32_t ${type_name}_encode(${type_name}* source, void* msg_buf)
* ${type_name} dyn memory will point to dyn_arr_buf memory.
* NULL will ignore dynamic arrays decoding.
* @param offset: Call with 0, bit offset to msg storage
* @retval offset or ERROR value if < 0
* @retval new offset or ERROR value if < 0
*/
int32_t ${type_name}_decode_internal(
const CanardRxTransfer* transfer,
Expand Down Expand Up @@ -279,7 +279,7 @@ int32_t ${type_name}_decode_internal(
for (c = 0; c < dest->${'%s' % ((f.name + '.len'))}; c++)
{
%if f.cpp_type_category == t.CATEGORY_COMPOUND:
offset += ${f.cpp_type}_decode_internal(transfer,
offset = ${f.cpp_type}_decode_internal(transfer,
0,
(void*)&dest->${'%s' % ((f.name + '.data'))}[c],
dyn_arr_buf,
Expand Down