Skip to content

Commit

Permalink
fixed min/max pwm vals
Browse files Browse the repository at this point in the history
  • Loading branch information
AsiiaPine committed Apr 24, 2024
1 parent 488ba05 commit a107e51
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Src/dronecan_application/modules/PWMModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ void PWMModule::update_params() {
auto min = paramsGetIntegerValue(params_names[i].min);
auto max = paramsGetIntegerValue(params_names[i].max);
auto def = paramsGetIntegerValue(params_names[i].def);
if (min <= max && def >= min && def <= max) {
params[i].def = def;
if (min <= max){
params[i].min = min;
params[i].max = max;
params[i].def = def;
} else {
params_error = true;
params[i].min = max;
params[i].max = min;
}
}

Expand Down

0 comments on commit a107e51

Please sign in to comment.