suppress FPS/MIC singles after FPS+MIC combo
After COMBO_FPS_MIC fires, ignore FPS and MIC edge handling until both keys are fully released, preventing stray feature-mode or mic-mute short presses on staggered key release. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1082,6 +1082,8 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
unsigned combo_triggered = 0;
|
||||
unsigned combo_release_time = 0;
|
||||
unsigned combo_just_released = 0;
|
||||
/* 改动原因:FPS+MIC 组合键触发后,两键往往不同时松开;须吞掉松键边沿,避免误触发 feature/MIC 短按 */
|
||||
unsigned fps_mic_combo_suppress = 0;
|
||||
|
||||
// TX1 factory reset state
|
||||
unsigned factory_reset_counting = 0;
|
||||
@@ -1801,6 +1803,11 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
ex3d_enable = !ex3d_enable;
|
||||
tx1_send_ex3d_onoff_to_tile1(cc_mic_level, ex3d_enable);
|
||||
gpio_leds_dirty = 1;
|
||||
fps_mic_combo_suppress = 1;
|
||||
prev_fps = fps;
|
||||
prev_mic = mic;
|
||||
fps_long_fired = 1;
|
||||
mic_long_fired = 1;
|
||||
debug_printf("TX1: FPS+MIC combo - ex3d_enable=%d\n", ex3d_enable);
|
||||
}
|
||||
}
|
||||
@@ -1853,8 +1860,19 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
// Individual button processing (only when no combo active and outside silence window)
|
||||
if (current_combo == COMBO_NONE && !combo_just_released) {
|
||||
|
||||
/* 改动原因:FPS+MIC 组合松键阶段只同步 prev,不进入 FPS/MIC 单键逻辑 */
|
||||
if (fps_mic_combo_suppress) {
|
||||
if (fps == 1 && mic == 1) {
|
||||
fps_mic_combo_suppress = 0;
|
||||
fps_long_fired = 0;
|
||||
mic_long_fired = 0;
|
||||
}
|
||||
prev_fps = fps;
|
||||
prev_mic = mic;
|
||||
}
|
||||
|
||||
// FPS button - cycle feature modes
|
||||
if (fps != prev_fps) {
|
||||
if (!fps_mic_combo_suppress && fps != prev_fps) {
|
||||
if (fps == 0) { // Pressed
|
||||
fps_press_time = now;
|
||||
fps_long_fired = 0;
|
||||
@@ -1889,7 +1907,7 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
}
|
||||
|
||||
// MIC button - toggle mute
|
||||
if (mic != prev_mic) {
|
||||
if (!fps_mic_combo_suppress && mic != prev_mic) {
|
||||
if (mic == 0) {
|
||||
mic_press_time = now;
|
||||
mic_long_fired = 0;
|
||||
@@ -1908,7 +1926,8 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
}
|
||||
|
||||
// MIC long press - toggle DNR
|
||||
if (mic == 0 && !mic_long_fired && (now - mic_press_time) >= 1000000000ull) {
|
||||
if (!fps_mic_combo_suppress && mic == 0 && !mic_long_fired
|
||||
&& (now - mic_press_time) >= 1000000000ull) {
|
||||
mic_long_fired = 1;
|
||||
dnr_enabled = !dnr_enabled;
|
||||
SET_SHARED_GLOBAL(g_dnr_on, dnr_enabled);
|
||||
|
||||
Reference in New Issue
Block a user