AP_Periph: Change division to multiplication

This commit is contained in:
muramura 2024-04-20 19:25:47 +09:00 committed by Peter Barker
parent 8dc7fdb771
commit bdacfdc76d

View File

@ -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));
}