|
@@ -244,12 +244,21 @@ void touch_encoder_update_slave(slave_touch_status_t slave_state) {
|
|
}
|
|
}
|
|
|
|
|
|
void touch_encoder_update(int8_t transaction_id) {
|
|
void touch_encoder_update(int8_t transaction_id) {
|
|
- if (!touch_initialized) return;
|
|
|
|
#if TOUCH_UPDATE_INTERVAL > 0
|
|
#if TOUCH_UPDATE_INTERVAL > 0
|
|
if (!timer_expired(timer_read(), touch_update_timer)) return;
|
|
if (!timer_expired(timer_read(), touch_update_timer)) return;
|
|
touch_update_timer = timer_read() + TOUCH_UPDATE_INTERVAL;
|
|
touch_update_timer = timer_read() + TOUCH_UPDATE_INTERVAL;
|
|
#endif
|
|
#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));
|
|
read_register(QT_DETECTION_STATUS, &touch_raw[0], sizeof(touch_raw));
|
|
touch_processed[1] = touch_raw[1];
|
|
touch_processed[1] = touch_raw[1];
|
|
touch_processed[2] = touch_raw[2];
|
|
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]) {
|
|
if ((touch_raw[0] & SLIDER_BIT) && touch_processed[3] != touch_raw[3]) {
|
|
touch_encoder_update_position();
|
|
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) {
|
|
void touch_encoder_calibrate(void) {
|