Skip to content

Commit

Permalink
fixed handling of negative lock level
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Oct 14, 2023
1 parent 8d62e32 commit 4e6d651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion RemoteIDModule/DroneCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ void DroneCAN::handle_param_getset(CanardInstance* ins, CanardRxTransfer* transf
}
if (vp != nullptr && req.name.len != 0 &&
req.value.union_tag != UAVCAN_PROTOCOL_PARAM_VALUE_EMPTY) {
if (g.lock_level != 0) {
if (g.lock_level > 0) {
can_printf("Parameters locked");
} else {
// param set
Expand Down
2 changes: 1 addition & 1 deletion RemoteIDModule/mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void MAVLinkSerial::process_packet(mavlink_status_t &status, mavlink_message_t &
return;
}
p->get_as_float(value);
if (g.lock_level != 0 &&
if (g.lock_level > 0 &&
(strcmp(p->name, "LOCK_LEVEL") != 0 ||
uint8_t(pkt.param_value) <= uint8_t(value))) {
// only param set allowed is to increase lock level
Expand Down

0 comments on commit 4e6d651

Please sign in to comment.