mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 00:48:30 -04:00
AP_Periph: Change division to multiplication
This commit is contained in:
parent
8dc7fdb771
commit
bdacfdc76d
@ -32,9 +32,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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user