1
0
Fork 0
forked from len0rd/rockbox

Ensure touchscreen calibration setting is saved after change or reset.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23529 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rob Purchase 2009-11-04 23:44:27 +00:00
parent 06e0bfddad
commit 27f17877be

View file

@ -908,6 +908,7 @@ int calibrate(void)
touchscreen_disable_mapping(); /* set raw mode */ touchscreen_disable_mapping(); /* set raw mode */
touchscreen_set_mode(TOUCHSCREEN_POINT); touchscreen_set_mode(TOUCHSCREEN_POINT);
for(i=0; i<3; i++) for(i=0; i<3; i++)
{ {
screen->clear_display(); screen->clear_display();
@ -923,17 +924,25 @@ int calibrate(void)
touchscreen_calibrate(&cal); touchscreen_calibrate(&cal);
else else
touchscreen_reset_mapping(); touchscreen_reset_mapping();
memcpy(&global_settings.ts_calibration_data, &calibration_parameters, sizeof(struct touchscreen_parameter));
memcpy(&global_settings.ts_calibration_data, &calibration_parameters,
sizeof(struct touchscreen_parameter));
touchscreen_set_mode(old_mode); touchscreen_set_mode(old_mode);
global_settings.statusbar = statusbar; global_settings.statusbar = statusbar;
settings_save();
return ret; return ret;
} }
int reset_mapping(void) int reset_mapping(void)
{ {
touchscreen_reset_mapping(); touchscreen_reset_mapping();
memcpy(&global_settings.ts_calibration_data, &calibration_parameters, sizeof(struct touchscreen_parameter));
memcpy(&global_settings.ts_calibration_data, &calibration_parameters,
sizeof(struct touchscreen_parameter));
settings_save();
return 0; return 0;
} }
#endif #endif