From b480a4e126e174df07e8c35aebccae1c316430c7 Mon Sep 17 00:00:00 2001 From: muramura Date: Sat, 20 Apr 2024 19:25:47 +0900 Subject: [PATCH] AP_Periph: Change division to multiplication --- Tools/AP_Periph/buzzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/AP_Periph/buzzer.cpp b/Tools/AP_Periph/buzzer.cpp index c5285e3612d37..a51d6047171c4 100644 --- a/Tools/AP_Periph/buzzer.cpp +++ b/Tools/AP_Periph/buzzer.cpp @@ -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)); }