mirror of
https://github.com/esphome/esphome.git
synced 2024-11-15 03:28:12 +01:00
clean up code
This commit is contained in:
parent
9e3a4333f4
commit
f28f60bedd
1 changed files with 2 additions and 4 deletions
|
@ -98,8 +98,8 @@ void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_r
|
||||||
tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000);
|
tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000);
|
||||||
tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000);
|
tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000);
|
||||||
} else {
|
} else {
|
||||||
tp.x = (uint16_t) (int) x;
|
tp.x = x;
|
||||||
tp.y = (uint16_t) (int) y;
|
tp.y = y;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tp.state |= STATE_CALIBRATE;
|
tp.state |= STATE_CALIBRATE;
|
||||||
|
@ -109,8 +109,6 @@ void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_r
|
||||||
tp.y_org = tp.y;
|
tp.y_org = tp.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGD(TAG, "Touch info, x_raw: %d, y_raw: %d, p: %d, x: %d, y: %d, x_prev: %d, y_prev: %d", x_raw, y_raw, z_raw, tp.x, tp.y,tp.x_prev, tp.y_prev );
|
|
||||||
|
|
||||||
this->touches_[id] = tp;
|
this->touches_[id] = tp;
|
||||||
|
|
||||||
this->is_touched_ = true;
|
this->is_touched_ = true;
|
||||||
|
|
Loading…
Reference in a new issue