Skip to content

Commit

Permalink
fix circuit status sonarcloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Dec 18, 2024
1 parent 1d2092f commit 401abd8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Src/modules/circuit_status/dronecan/circuit_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ void DronecanCircuitStatus::spin_once() {
}

uint16_t error_flags = 0;
error_flags |= CircuitPeriphery::overvoltage() * (uint16_t)ERROR_FLAG_OVERVOLTAGE;
error_flags |= CircuitPeriphery::undervoltage() * (uint16_t)ERROR_FLAG_UNDERVOLTAGE;
error_flags |= CircuitPeriphery::overcurrent() * (uint16_t)ERROR_FLAG_OVERCURRENT;
if (CircuitPeriphery::overvoltage()) {
error_flags |= (uint16_t)ERROR_FLAG_OVERVOLTAGE;
}
if (CircuitPeriphery::undervoltage()) {
error_flags |= (uint16_t)ERROR_FLAG_UNDERVOLTAGE;
}
if (CircuitPeriphery::overcurrent()) {
error_flags |= (uint16_t)ERROR_FLAG_OVERCURRENT;
}

if (bitmask & static_cast<uint8_t>(Bitmask::ENABLE_5V_PUB)) {
circuit_status.msg = {
Expand Down

0 comments on commit 401abd8

Please # to comment.