mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-23 18:27:27 +00:00
Faster rotary encoder events (#9146)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -24,6 +24,9 @@ int BuzzerFeedbackThread::handleInputEvent(const InputEvent *event)
|
|||||||
switch (event->inputEvent) {
|
switch (event->inputEvent) {
|
||||||
case INPUT_BROKER_USER_PRESS:
|
case INPUT_BROKER_USER_PRESS:
|
||||||
case INPUT_BROKER_ALT_PRESS:
|
case INPUT_BROKER_ALT_PRESS:
|
||||||
|
playClick(); // Low delay feedback
|
||||||
|
break;
|
||||||
|
|
||||||
case INPUT_BROKER_SELECT:
|
case INPUT_BROKER_SELECT:
|
||||||
case INPUT_BROKER_SELECT_LONG:
|
case INPUT_BROKER_SELECT_LONG:
|
||||||
playBeep(); // Confirmation feedback
|
playBeep(); // Confirmation feedback
|
||||||
|
|||||||
@@ -113,7 +113,14 @@ void playShutdownMelody()
|
|||||||
void playChirp()
|
void playChirp()
|
||||||
{
|
{
|
||||||
// A short, friendly "chirp" sound for key presses
|
// A short, friendly "chirp" sound for key presses
|
||||||
ToneDuration melody[] = {{NOTE_AS3, 20}}; // Very short AS3 note
|
ToneDuration melody[] = {{NOTE_AS3, 20}}; // Short AS3 note
|
||||||
|
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
||||||
|
}
|
||||||
|
|
||||||
|
void playClick()
|
||||||
|
{
|
||||||
|
// A very short "click" sound with minimum delay; ideal for rotary encoder events
|
||||||
|
ToneDuration melody[] = {{NOTE_AS3, 1}}; // Very Short AS3
|
||||||
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ void playGPSDisableBeep();
|
|||||||
void playComboTune();
|
void playComboTune();
|
||||||
void playBoop();
|
void playBoop();
|
||||||
void playChirp();
|
void playChirp();
|
||||||
|
void playClick();
|
||||||
void playLongPressLeadUp();
|
void playLongPressLeadUp();
|
||||||
bool playNextLeadUpNote(); // Play the next note in the lead-up sequence
|
bool playNextLeadUpNote(); // Play the next note in the lead-up sequence
|
||||||
void resetLeadUpSequence(); // Reset the lead-up sequence to start from beginning
|
void resetLeadUpSequence(); // Reset the lead-up sequence to start from beginning
|
||||||
Reference in New Issue
Block a user