aboutsummaryrefslogtreecommitdiffstats
path: root/src/touchpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/touchpad.c')
-rw-r--r--src/touchpad.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/touchpad.c b/src/touchpad.c
index fe0f047f..676e8e33 100644
--- a/src/touchpad.c
+++ b/src/touchpad.c
@@ -143,6 +143,10 @@ void tpInit(const TOUCHPADDriver *tp) {
//MUTEX_ENTER
tp_lld_init(tp);
//MUTEX_EXIT
+
+ #if TOUCHPAD_STORE_CALIBRATION
+ cal = lld_tpReadCalibration();
+ #endif
}
/**
@@ -222,6 +226,10 @@ void tpCalibrate(void) {
cal.xn = (float)cross[0][0] - cal.xm * (float)points[0][0];
cal.yn = (float)cross[0][1] - cal.ym * (float)points[0][1];
+
+ #if TOUCHPAD_STORE_CALIBRATION
+ lld_tpWriteCalibration(cal);
+ #endif
}
#if TOUCHPAD_HAS_IRQ || defined(__DOXYGEN__)