Skip to content

Commit

Permalink
ModbusSunSpec: fixed integer conversion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pipelka committed May 3, 2024
1 parent 38799ab commit 1a7bc13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModbusSunSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void ModbusSunSpecClass::setPowerLimit(uint16_t limit_pct, uint16_t timeout_sec)
uint16_t total_set_power = (total_max_power * limit_pct) / 100;

// round total_set_power
total_set_power = (int)(total_set_power / power_divider) * power_divider;
total_set_power = (total_set_power / power_divider) * power_divider;

// new limit_pct
limit_pct = (total_set_power * 100) / total_max_power;
Expand Down

0 comments on commit 1a7bc13

Please sign in to comment.