Skip to content

Commit

Permalink
Fix circuit_id type from uint8_t to uint16_t (#91)
Browse files Browse the repository at this point in the history
* Fix circuit_id type from uint8_t to uint16_t
* max and min node id fixed
  • Loading branch information
olegogogo authored Dec 4, 2024
1 parent 1b5cf6d commit 1285236
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Src/modules/circuit_status/dronecan/circuit_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void DronecanCircuitStatus::spin_once() {

if (bitmask & static_cast<uint8_t>(Bitmask::ENABLE_5V_PUB)) {
circuit_status.msg = {
.circuit_id = static_cast<uint8_t>(node_id * 10),
.circuit_id = static_cast<uint16_t>(node_id * 10),
.voltage = CircuitPeriphery::voltage_5v(),
.current = CircuitPeriphery::current(),
.error_flags = static_cast<CircuitStatusErrorFlags_t>(error_flags),
Expand All @@ -47,7 +47,7 @@ void DronecanCircuitStatus::spin_once() {

if (bitmask & static_cast<uint8_t>(Bitmask::ENABLE_VIN_PUB)) {
circuit_status.msg = {
.circuit_id = static_cast<uint8_t>(node_id * 10 + 1),
.circuit_id = static_cast<uint16_t>(node_id * 10 + 1),
.voltage = CircuitPeriphery::voltage_vin(),
.current = CircuitPeriphery::current(),
.error_flags = static_cast<CircuitStatusErrorFlags_t>(error_flags),
Expand Down
4 changes: 2 additions & 2 deletions Src/modules/system/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ uavcan.node.id:
enum: PARAM_UAVCAN_NODE_ID
flags: mutable
default: 42
min: 0
max: 255
min: 1
max: 126

uavcan.node.description:
note: User/integrator-defined, human-readable description of this specific node.
Expand Down

0 comments on commit 1285236

Please sign in to comment.