fix: Audio/haptic feedback for all hard keys except trim switches (#2201)

* Added audio/haptic feedback for all hard keys excpet trim switches.

Changed logic from application decides if feedback has to be given (was inconsistent and inefficient) to key driver detects button down and triggers immediate feedback if radio settings allowed for acoustic and/or haptic feedback (radio settings, radio setup, sound set to All)

With this change all instances of the application calling for feedback were removed in favor of the centralized approach.

This first commit also introduces a dummy function for providing feedback on key presses in boot.cpp because keys.cpp is also used as the bootloader key driver but with no logic to determine if feedback is allowed. Using a define that indicates keys.cpp is compiled for use in the bootloader would make a much nicer and backwards compatible solution.

* don't want to change libopenui so silence onKeyPress (application requests feedback) in audio.cpp

* made generation of acoustic/haptic feedback conditional on BOOT define, i.e. no feedback if keys.cpp is compiled for the bootloader

* removed onKeyPress()

* fixed crash on acoustic/haptic feedback on hard keys by restoring keys.cpp and moving logic to LvglWrapper.cpp/keyboardDriverRead().

Removed call to getWindowEvent() which would just call getEvent(false) by directly calling getEvent(false). This allowed to remove getWindowEvent() entirely as it was only used by keyboardDriverRead().

* fix: Audio header include no longer needed
This commit is contained in:
Michael
2022-08-19 15:00:50 +10:00
committed by GitHub
parent 8c228bc50f
commit 34dadf7b65
8 changed files with 16 additions and 21 deletions
-5
View File
@@ -1267,11 +1267,6 @@ void pushPrompt(uint16_t prompt, uint8_t id)
#endif
}
void onKeyPress()
{
audioKeyPress();
}
void onKeyError()
{
audioKeyError();