summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-11-04 23:44:27 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-11-04 23:44:27 +0000
commit27f17877be7db35e1455a90a67908b577d3add1d (patch)
treec9f1700252f7ed2b448044b1ce3e57b9deed4847 /apps/screens.c
parent06e0bfddad5fbc3d5944fe7f52952f6726b43651 (diff)
downloadrockbox-27f17877be7db35e1455a90a67908b577d3add1d.tar.gz
rockbox-27f17877be7db35e1455a90a67908b577d3add1d.zip
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
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/screens.c b/apps/screens.c
index 65ad8c657b..9edda1ad43 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -908,6 +908,7 @@ int calibrate(void)
908 908
909 touchscreen_disable_mapping(); /* set raw mode */ 909 touchscreen_disable_mapping(); /* set raw mode */
910 touchscreen_set_mode(TOUCHSCREEN_POINT); 910 touchscreen_set_mode(TOUCHSCREEN_POINT);
911
911 for(i=0; i<3; i++) 912 for(i=0; i<3; i++)
912 { 913 {
913 screen->clear_display(); 914 screen->clear_display();
@@ -923,17 +924,25 @@ int calibrate(void)
923 touchscreen_calibrate(&cal); 924 touchscreen_calibrate(&cal);
924 else 925 else
925 touchscreen_reset_mapping(); 926 touchscreen_reset_mapping();
926 memcpy(&global_settings.ts_calibration_data, &calibration_parameters, sizeof(struct touchscreen_parameter)); 927
928 memcpy(&global_settings.ts_calibration_data, &calibration_parameters,
929 sizeof(struct touchscreen_parameter));
930
927 touchscreen_set_mode(old_mode); 931 touchscreen_set_mode(old_mode);
928 global_settings.statusbar = statusbar; 932 global_settings.statusbar = statusbar;
929 933
934 settings_save();
930 return ret; 935 return ret;
931} 936}
932 937
933int reset_mapping(void) 938int reset_mapping(void)
934{ 939{
935 touchscreen_reset_mapping(); 940 touchscreen_reset_mapping();
936 memcpy(&global_settings.ts_calibration_data, &calibration_parameters, sizeof(struct touchscreen_parameter)); 941
942 memcpy(&global_settings.ts_calibration_data, &calibration_parameters,
943 sizeof(struct touchscreen_parameter));
944
945 settings_save();
937 return 0; 946 return 0;
938} 947}
939#endif 948#endif