diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2022-04-28 12:35:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 10:35:27 -0700 |
commit | 0edc0c05e164e6205f353c4039eed579f38bbdb6 (patch) | |
tree | 15a929fa700c2f61a70c7b2dbae9a20d6f3b2eb1 /keyboards/rgbkb | |
parent | e99d6d582cd1ebdda35b2fda1cc170d6d24ad58b (diff) | |
download | qmk_firmware-0edc0c05e164e6205f353c4039eed579f38bbdb6.tar.gz qmk_firmware-0edc0c05e164e6205f353c4039eed579f38bbdb6.zip |
[Keyboard] Small fix for Sol3 with only a slave touch bar (#16952)
Diffstat (limited to 'keyboards/rgbkb')
-rw-r--r-- | keyboards/rgbkb/common/touch_encoder.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/keyboards/rgbkb/common/touch_encoder.c b/keyboards/rgbkb/common/touch_encoder.c index 1e6c54e8eb..5f0e4f0cca 100644 --- a/keyboards/rgbkb/common/touch_encoder.c +++ b/keyboards/rgbkb/common/touch_encoder.c @@ -244,12 +244,21 @@ void touch_encoder_update_slave(slave_touch_status_t slave_state) { } void touch_encoder_update(int8_t transaction_id) { - if (!touch_initialized) return; #if TOUCH_UPDATE_INTERVAL > 0 if (!timer_expired(timer_read(), touch_update_timer)) return; touch_update_timer = timer_read() + TOUCH_UPDATE_INTERVAL; #endif + if (is_keyboard_master()) { + slave_touch_status_t slave_state; + if (transaction_rpc_exec(transaction_id, sizeof(bool), &touch_disabled, sizeof(slave_touch_status_t), &slave_state)) { + if (memcmp(&touch_slave_state, &slave_state, sizeof(slave_touch_status_t))) + touch_encoder_update_slave(slave_state); + } + } + + if (!touch_initialized) return; + read_register(QT_DETECTION_STATUS, &touch_raw[0], sizeof(touch_raw)); touch_processed[1] = touch_raw[1]; touch_processed[2] = touch_raw[2]; @@ -277,14 +286,6 @@ void touch_encoder_update(int8_t transaction_id) { if ((touch_raw[0] & SLIDER_BIT) && touch_processed[3] != touch_raw[3]) { touch_encoder_update_position(); } - - if (is_keyboard_master()) { - slave_touch_status_t slave_state; - if (transaction_rpc_exec(transaction_id, sizeof(bool), &touch_disabled, sizeof(slave_touch_status_t), &slave_state)) { - if (memcmp(&touch_slave_state, &slave_state, sizeof(slave_touch_status_t))) - touch_encoder_update_slave(slave_state); - } - } } void touch_encoder_calibrate(void) { |