Skip to content

Commit

Permalink
No need to manually define the empty response.
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Kirienko <pavel.kirienko@gmail.com>
  • Loading branch information
aentinger and pavel-kirienko committed Jan 16, 2023
1 parent 98ad67b commit aa3a59d
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/register/RegisterList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,5 @@ RegisterList::TAccessResponse RegisterList::onAccess_1_0_Request_Received(TAcces
return _on_access_request_handler_map.at(type_tag)(req, reg_base_ptr);
}

/* Initialise with an empty response in case we
* can't find a matching register.
*/
TAccessResponse const EMPTY_RESPONSE = []()
{
TAccessResponse r;

uavcan_register_Value_1_0_select_empty_(&r.data.value);
r.data.timestamp.microsecond = 0;
r.data._mutable = false;
r.data.persistent = false;

return r;
} ();

return EMPTY_RESPONSE;
return {};
}

0 comments on commit aa3a59d

Please sign in to comment.