Skip to content

Commit

Permalink
AP_Periph: Change division to multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Apr 20, 2024
1 parent bf8c1f5 commit b480a4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/AP_Periph/buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ void AP_Periph_FW::handle_beep_command(CanardInstance* canard_instance, CanardRx
buzzer_start_ms = AP_HAL::millis();
buzzer_len_ms = req.duration*1000;
#ifdef HAL_PERIPH_ENABLE_BUZZER_WITHOUT_NOTIFY
float volume = constrain_float(periph.g.buzz_volume/100.0f, 0, 1);
float volume = constrain_float(periph.g.buzz_volume*0.01f, 0, 1);
#elif defined(HAL_PERIPH_ENABLE_NOTIFY)
float volume = constrain_float(periph.notify.get_buzz_volume()/100.0f, 0, 1);
float volume = constrain_float(periph.notify.get_buzz_volume()*0.01f, 0, 1);
#endif
hal.util->toneAlarm_set_buzzer_tone(req.frequency, volume, uint32_t(req.duration*1000));
}
Expand Down

0 comments on commit b480a4e

Please sign in to comment.