init commit for fix touchscreen bad corner (#1071)

fix a rounding issue and allow more sensible touchscreen
This commit is contained in:
zxkmm 2023-05-26 15:50:32 +08:00 committed by GitHub
parent 5bdf9363e9
commit 53fcdedb88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -71,10 +71,10 @@ Samples get() {
const auto yp_reg = LPC_ADC0->DR[portapack::adc0_touch_yp_input];
const auto yn_reg = LPC_ADC0->DR[portapack::adc0_touch_yn_input];
return {
(xp_reg >> 6) & 0x3ff,
(xn_reg >> 6) & 0x3ff,
(yp_reg >> 6) & 0x3ff,
(yn_reg >> 6) & 0x3ff,
((xp_reg >> 6) & 0x3ff) * 16,
((xn_reg >> 6) & 0x3ff) * 16,
((yp_reg >> 6) & 0x3ff) * 16,
((yn_reg >> 6) & 0x3ff) * 16,
};
}