Browse Source

Touch Calibration Screen auto-save option (#20971)

Victor Oliveira 3 years ago
parent
commit
617f5dfe5e
No account linked to committer's email address
2 changed files with 9 additions and 0 deletions
  1. 4
    0
      Marlin/Configuration.h
  2. 5
    0
      Marlin/src/lcd/tft_io/touch_calibration.cpp

+ 4
- 0
Marlin/Configuration.h View File

2457
   //#define TOUCH_OFFSET_Y        257
2457
   //#define TOUCH_OFFSET_Y        257
2458
   //#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
2458
   //#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
2459
 
2459
 
2460
+  #if BOTH(TOUCH_SCREEN_CALIBRATION, EEPROM_SETTINGS)
2461
+    #define TOUCH_CALIBRATION_AUTO_SAVE // Auto save successful calibration values to EEPROM
2462
+  #endif
2463
+
2460
   #if ENABLED(TFT_COLOR_UI)
2464
   #if ENABLED(TFT_COLOR_UI)
2461
     //#define SINGLE_TOUCH_NAVIGATION
2465
     //#define SINGLE_TOUCH_NAVIGATION
2462
   #endif
2466
   #endif

+ 5
- 0
Marlin/src/lcd/tft_io/touch_calibration.cpp View File

28
 #define DEBUG_OUT ENABLED(DEBUG_TOUCH_CALIBRATION)
28
 #define DEBUG_OUT ENABLED(DEBUG_TOUCH_CALIBRATION)
29
 #include "../../core/debug_out.h"
29
 #include "../../core/debug_out.h"
30
 
30
 
31
+#if ENABLED(TOUCH_CALIBRATION_AUTO_SAVE)
32
+  #include "../../module/settings.h"
33
+#endif
34
+
31
 TouchCalibration touch_calibration;
35
 TouchCalibration touch_calibration;
32
 
36
 
33
 touch_calibration_t TouchCalibration::calibration;
37
 touch_calibration_t TouchCalibration::calibration;
78
     SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
82
     SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
79
     SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
83
     SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
80
     SERIAL_ECHO_TERNARY(calibration.orientation == TOUCH_LANDSCAPE, "TOUCH_ORIENTATION ", "TOUCH_LANDSCAPE", "TOUCH_PORTRAIT", "\n");
84
     SERIAL_ECHO_TERNARY(calibration.orientation == TOUCH_LANDSCAPE, "TOUCH_ORIENTATION ", "TOUCH_LANDSCAPE", "TOUCH_PORTRAIT", "\n");
85
+    TERN_(TOUCH_CALIBRATION_AUTO_SAVE, settings.save());
81
   }
86
   }
82
 }
87
 }
83
 
88
 

Loading…
Cancel
Save