mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "../cli_main_commands.h"
|
#include "../cli_main_commands.h"
|
||||||
#include <notification/notification_app.h>
|
#include <notification/notification_app.h>
|
||||||
|
#include <math.h>
|
||||||
#include <toolbox/args.h>
|
#include <toolbox/args.h>
|
||||||
#include <toolbox/cli/cli_command.h>
|
#include <toolbox/cli/cli_command.h>
|
||||||
|
|
||||||
@@ -13,6 +14,9 @@ void cli_command_buzzer_print_usage(bool is_freq_subcommand, FuriString* args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider volume effectively zero if below this threshold
|
||||||
|
#define BUZZER_VOLUME_EPSILON (1e-3f)
|
||||||
|
|
||||||
float cli_command_buzzer_read_frequency(bool is_freq_subcommand, FuriString* args) {
|
float cli_command_buzzer_read_frequency(bool is_freq_subcommand, FuriString* args) {
|
||||||
float frequency = 0.0f;
|
float frequency = 0.0f;
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@ void execute(PipeSide* pipe, FuriString* args, void* context) {
|
|||||||
printf("Flipper is in stealth mode. Unmute the device to control buzzer.");
|
printf("Flipper is in stealth mode. Unmute the device to control buzzer.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(notification->settings.speaker_volume == 0.0f) {
|
if(fabsf(notification->settings.speaker_volume) < BUZZER_VOLUME_EPSILON) {
|
||||||
printf("Sound is disabled in settings. Increase volume to control buzzer.");
|
printf("Sound is disabled in settings. Increase volume to control buzzer.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user