Browse Source

Merge latest patches

Scott Lahteine 5 years ago
parent
commit
0f9a14dfda
100 changed files with 1509 additions and 950 deletions
  1. 1
    1
      Marlin/Configuration.h
  2. 4
    0
      Marlin/Configuration_adv.h
  3. 1
    1
      Marlin/src/HAL/AVR/eeprom.cpp
  4. 2
    2
      Marlin/src/HAL/AVR/fastio.h
  5. 1
    1
      Marlin/src/HAL/DUE/EepromEmulation.cpp
  6. 1
    1
      Marlin/src/HAL/DUE/eeprom.cpp
  7. 1
    1
      Marlin/src/HAL/DUE/fastio.h
  8. 108
    47
      Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
  9. 1
    1
      Marlin/src/HAL/DUE/inc/Conditionals_post.h
  10. 1
    1
      Marlin/src/HAL/ESP32/eeprom_impl.cpp
  11. 1
    1
      Marlin/src/HAL/ESP32/fastio.h
  12. 1
    1
      Marlin/src/HAL/ESP32/inc/Conditionals_post.h
  13. 1
    1
      Marlin/src/HAL/LINUX/eeprom_impl.cpp
  14. 1
    1
      Marlin/src/HAL/LPC1768/eeprom_api.h
  15. 1
    1
      Marlin/src/HAL/LPC1768/eeprom_flash.cpp
  16. 1
    1
      Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
  17. 1
    1
      Marlin/src/HAL/LPC1768/fastio.h
  18. 1
    1
      Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
  19. 1
    1
      Marlin/src/HAL/LPC1768/main.cpp
  20. 78
    0
      Marlin/src/HAL/SAMD51/QSPIFlash.cpp
  21. 51
    0
      Marlin/src/HAL/SAMD51/QSPIFlash.h
  22. 66
    0
      Marlin/src/HAL/SAMD51/eeprom.cpp
  23. 96
    0
      Marlin/src/HAL/SAMD51/eeprom_flash.cpp
  24. 71
    0
      Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
  25. 2
    2
      Marlin/src/HAL/SAMD51/fastio.h
  26. 1
    3
      Marlin/src/HAL/SAMD51/inc/Conditionals_post.h
  27. 0
    129
      Marlin/src/HAL/SAMD51/persistent_store_eeprom.cpp
  28. 2
    7
      Marlin/src/HAL/STM32/SoftwareSerial.h
  29. 1
    1
      Marlin/src/HAL/STM32/eeprom_flash.cpp
  30. 6
    6
      Marlin/src/HAL/STM32/eeprom_impl.cpp
  31. 1
    1
      Marlin/src/HAL/STM32/eeprom_sdcard.cpp
  32. 1
    1
      Marlin/src/HAL/STM32/inc/Conditionals_post.h
  33. 3
    3
      Marlin/src/HAL/STM32F1/eeprom.cpp
  34. 3
    4
      Marlin/src/HAL/STM32F1/eeprom_flash.cpp
  35. 1
    2
      Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
  36. 1
    1
      Marlin/src/HAL/STM32_F4_F7/eeprom.cpp
  37. 1
    1
      Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h
  38. 1
    1
      Marlin/src/HAL/TEENSY31_32/eeprom_impl.cpp
  39. 2
    1
      Marlin/src/HAL/TEENSY31_32/fastio.h
  40. 1
    1
      Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h
  41. 1
    1
      Marlin/src/HAL/TEENSY35_36/eeprom.cpp
  42. 2
    1
      Marlin/src/HAL/TEENSY35_36/fastio.h
  43. 1
    1
      Marlin/src/HAL/shared/eeprom_api.cpp
  44. 0
    0
      Marlin/src/HAL/shared/eeprom_api.h
  45. 21
    47
      Marlin/src/MarlinCore.cpp
  46. 2
    0
      Marlin/src/MarlinCore.h
  47. 1
    0
      Marlin/src/core/boards.h
  48. 3
    0
      Marlin/src/core/macros.h
  49. 1
    1
      Marlin/src/feature/backlash.cpp
  50. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  51. 1
    1
      Marlin/src/feature/max7219.cpp
  52. 1
    2
      Marlin/src/feature/mmu2/mmu2.cpp
  53. 14
    25
      Marlin/src/feature/pause.cpp
  54. 0
    2
      Marlin/src/feature/pause.h
  55. 17
    39
      Marlin/src/feature/twibus.cpp
  56. 5
    2
      Marlin/src/feature/twibus.h
  57. 8
    12
      Marlin/src/gcode/calibrate/G28.cpp
  58. 85
    59
      Marlin/src/gcode/calibrate/G425.cpp
  59. 3
    3
      Marlin/src/gcode/calibrate/M425.cpp
  60. 10
    2
      Marlin/src/gcode/config/M43.cpp
  61. 2
    8
      Marlin/src/gcode/feature/camera/M240.cpp
  62. 1
    1
      Marlin/src/gcode/feature/powerloss/M1000.cpp
  63. 5
    1
      Marlin/src/gcode/gcode.cpp
  64. 4
    0
      Marlin/src/gcode/gcode.h
  65. 8
    29
      Marlin/src/gcode/lcd/M0_M1.cpp
  66. 1
    1
      Marlin/src/gcode/motion/G2_G3.cpp
  67. 109
    0
      Marlin/src/gcode/sd/M1001.cpp
  68. 24
    5
      Marlin/src/gcode/temp/M303.cpp
  69. 1
    1
      Marlin/src/inc/Conditionals_adv.h
  70. 20
    4
      Marlin/src/inc/Conditionals_post.h
  71. 2
    1
      Marlin/src/inc/MarlinConfig.h
  72. 1
    1
      Marlin/src/inc/Version.h
  73. 11
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp
  74. 11
    10
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h
  75. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp
  76. 8
    6
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h
  77. 7
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp
  78. 10
    5
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h
  79. 45
    33
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp
  80. 72
    82
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp
  81. 8
    4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp
  82. 4
    4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp
  83. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp
  84. 7
    5
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp
  85. 6
    4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp
  86. 3
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp
  87. 8
    6
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp
  88. 2
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp
  89. 8
    4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp
  90. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp
  91. 91
    74
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp
  92. 83
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp
  93. 0
    3
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp
  94. 1
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp
  95. 8
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h
  96. 107
    119
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp
  97. 128
    100
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h
  98. 2
    2
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h
  99. 2
    2
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h
  100. 0
    0
      Marlin/src/lcd/extui/ui_api.h

+ 1
- 1
Marlin/Configuration.h View File

@@ -473,7 +473,7 @@
473 473
 #if ENABLED(PIDTEMP)
474 474
   //#define PID_EDIT_MENU         // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
475 475
   //#define PID_AUTOTUNE_MENU     // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
476
-  //#define PID_DEBUG             // Sends debug data to the serial port.
476
+  //#define PID_DEBUG             // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
477 477
   //#define PID_OPENLOOP 1        // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
478 478
   //#define SLOW_PWM_HEATERS      // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
479 479
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)

+ 4
- 0
Marlin/Configuration_adv.h View File

@@ -1049,6 +1049,10 @@
1049 1049
 
1050 1050
   #define EVENT_GCODE_SD_STOP "G28XY"       // G-code to run on Stop Print (e.g., "G28XY" or "G27")
1051 1051
 
1052
+  #if ENABLED(PRINTER_EVENT_LEDS)
1053
+    #define PE_LEDS_COMPLETED_TIME  (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
1054
+  #endif
1055
+
1052 1056
   /**
1053 1057
    * Continue after Power-Loss (Creality3D)
1054 1058
    *

Marlin/src/HAL/AVR/persistent_store_eeprom.cpp → Marlin/src/HAL/AVR/eeprom.cpp View File

@@ -25,7 +25,7 @@
25 25
 
26 26
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
27 27
 
28
-#include "../shared/persistent_store_api.h"
28
+#include "../shared/eeprom_api.h"
29 29
 
30 30
 bool PersistentStore::access_start() { return true; }
31 31
 bool PersistentStore::access_finish() { return true; }

+ 2
- 2
Marlin/src/HAL/AVR/fastio.h View File

@@ -98,9 +98,9 @@
98 98
 
99 99
 #define SET_INPUT(IO)         _SET_INPUT(IO)
100 100
 #define SET_INPUT_PULLUP(IO)  do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0)
101
+#define SET_INPUT_PULLDOWN    SET_INPUT
101 102
 #define SET_OUTPUT(IO)        _SET_OUTPUT(IO)
102
-
103
-#define SET_PWM(IO)           SET_OUTPUT(IO)
103
+#define SET_PWM               SET_OUTPUT
104 104
 
105 105
 #define IS_INPUT(IO)          _IS_INPUT(IO)
106 106
 #define IS_OUTPUT(IO)         _IS_OUTPUT(IO)

+ 1
- 1
Marlin/src/HAL/DUE/EepromEmulation.cpp View File

@@ -57,7 +57,7 @@
57 57
 #if ENABLED(FLASH_EEPROM_EMULATION)
58 58
 
59 59
 #include "../shared/Marduino.h"
60
-#include "../shared/persistent_store_api.h"
60
+#include "../shared/eeprom_api.h"
61 61
 
62 62
 #define EEPROMSize     4096
63 63
 #define PagesPerGroup   128

Marlin/src/HAL/DUE/persistent_store_eeprom.cpp → Marlin/src/HAL/DUE/eeprom.cpp View File

@@ -27,7 +27,7 @@
27 27
 #if ENABLED(EEPROM_SETTINGS)
28 28
 
29 29
 #include "../../inc/MarlinConfig.h"
30
-#include "../shared/persistent_store_api.h"
30
+#include "../shared/eeprom_api.h"
31 31
 
32 32
 #if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
33 33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)

+ 1
- 1
Marlin/src/HAL/DUE/fastio.h View File

@@ -166,7 +166,7 @@
166 166
 // Set pin as output (wrapper) -  reads the pin and sets the output to that value
167 167
 #define SET_OUTPUT(IO)       _SET_OUTPUT(IO)
168 168
 // Set pin as PWM
169
-#define SET_PWM(IO)           SET_OUTPUT(IO)
169
+#define SET_PWM               SET_OUTPUT
170 170
 
171 171
 // Check if pin is an input
172 172
 #define IS_INPUT(IO)         ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)

+ 108
- 47
Marlin/src/HAL/DUE/fastio/G2_PWM.cpp View File

@@ -46,6 +46,31 @@
46 46
 
47 47
 #include "G2_PWM.h"
48 48
 
49
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
50
+  #define G2_PWM_X 1
51
+#else
52
+  #define G2_PWM_X 0
53
+#endif
54
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
55
+  #define G2_PWM_Y 1
56
+#else
57
+  #define G2_PWM_Y 0
58
+#endif
59
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
60
+  #define G2_PWM_Z 1
61
+#else
62
+  #define G2_PWM_Z 0
63
+#endif
64
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
65
+  #define G2_PWM_E 1
66
+#else
67
+  #define G2_PWM_E 0
68
+#endif
69
+#define G2_MASK_X(V) (G2_PWM_X * (V))
70
+#define G2_MASK_Y(V) (G2_PWM_Y * (V))
71
+#define G2_MASK_Z(V) (G2_PWM_Z * (V))
72
+#define G2_MASK_E(V) (G2_PWM_E * (V))
73
+
49 74
 volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
50 75
                   *SODR_B = &PIOB->PIO_SODR,
51 76
                   *CODR_A = &PIOA->PIO_CODR,
@@ -55,10 +80,18 @@ PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;
55 80
 
56 81
 void Stepper::digipot_init() {
57 82
 
58
-  OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0);  // init pins
59
-  OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
60
-  OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
61
-  OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
83
+  #if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
84
+    OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0);  // init pins
85
+  #endif
86
+  #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
87
+    OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
88
+  #endif
89
+  #if G2_PWM_Z
90
+    OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
91
+  #endif
92
+  #if G2_PWM_E
93
+    OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
94
+  #endif
62 95
 
63 96
   #define WPKEY          (0x50574D << 8) // “PWM” in ASCII
64 97
   #define WPCMD_DIS_SW   0  // command to disable Write Protect SW
@@ -71,30 +104,51 @@ void Stepper::digipot_init() {
71 104
   PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW;        // enable setting of all PWM registers
72 105
   PWM->PWM_CLK = PWM_CLOCK_F;                             // enable CLK_A and set it to 1MHz, leave CLK_B disabled
73 106
   PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011;                    // set channel 0 to Clock A input & to left aligned
74
-  PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011;                    // set channel 1 to Clock A input & to left aligned
75
-  PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011;                    // set channel 2 to Clock A input & to left aligned
76
-  PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011;                    // set channel 3 to Clock A input & to left aligned
77
-  PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011;                    // set channel 4 to Clock A input & to left aligned
107
+  if (G2_PWM_X) PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011;      // set channel 1 to Clock A input & to left aligned
108
+  if (G2_PWM_Y) PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011;      // set channel 2 to Clock A input & to left aligned
109
+  if (G2_PWM_Z) PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011;      // set channel 3 to Clock A input & to left aligned
110
+  if (G2_PWM_E) PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011;      // set channel 4 to Clock A input & to left aligned
78 111
 
79 112
   PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US;            // set channel 0 Period
80 113
 
81 114
   PWM->PWM_IER2 = PWM_IER1_CHID0;                         // generate interrupt when counter0 overflows
82
-  PWM->PWM_IER2 = PWM_IER2_CMPM0 | PWM_IER2_CMPM1 | PWM_IER2_CMPM2 | PWM_IER2_CMPM3 | PWM_IER2_CMPM4;        // generate interrupt on compare event
83
-
84
-  PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0]));   // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
85
-  PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0]));   // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
86
-  PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1]));   // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
87
-  PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2]));   // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
88
-
89
-  PWM->PWM_CMP[1].PWM_CMPM = 0x0001;  // enable compare event
90
-  PWM->PWM_CMP[2].PWM_CMPM = 0x0001;  // enable compare event
91
-  PWM->PWM_CMP[3].PWM_CMPM = 0x0001;  // enable compare event
92
-  PWM->PWM_CMP[4].PWM_CMPM = 0x0001;  // enable compare event
93
-
94
-  PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0 | PWM_SCM_SYNC1 | PWM_SCM_SYNC2 | PWM_SCM_SYNC3 | PWM_SCM_SYNC4; // sync 1-4 with 0, use mode 0 for updates
95
-
96
-  PWM->PWM_ENA = PWM_ENA_CHID0 | PWM_ENA_CHID1 | PWM_ENA_CHID2 | PWM_ENA_CHID3 | PWM_ENA_CHID4;         // enable the channels used by G2
97
-  PWM->PWM_IER1 = PWM_IER1_CHID0 | PWM_IER1_CHID1 | PWM_IER1_CHID2 | PWM_IER1_CHID3 | PWM_IER1_CHID4;        // enable interrupts for the channels used by G2
115
+  PWM->PWM_IER2 = PWM_IER2_CMPM0
116
+    | G2_MASK_X(PWM_IER2_CMPM1)
117
+    | G2_MASK_Y(PWM_IER2_CMPM2)
118
+    | G2_MASK_Z(PWM_IER2_CMPM3)
119
+    | G2_MASK_E(PWM_IER2_CMPM4)
120
+  ; // generate interrupt on compare event
121
+
122
+  if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
123
+  if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
124
+  if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
125
+  if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
126
+
127
+  if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPM = 0x0001;  // enable compare event
128
+  if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPM = 0x0001;  // enable compare event
129
+  if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPM = 0x0001;  // enable compare event
130
+  if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPM = 0x0001;  // enable compare event
131
+
132
+  PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0
133
+    | G2_MASK_X(PWM_SCM_SYNC1)
134
+    | G2_MASK_Y(PWM_SCM_SYNC2)
135
+    | G2_MASK_Z(PWM_SCM_SYNC3)
136
+    | G2_MASK_E(PWM_SCM_SYNC4)
137
+  ; // sync 1-4 with 0, use mode 0 for updates
138
+
139
+  PWM->PWM_ENA = PWM_ENA_CHID0
140
+    | G2_MASK_X(PWM_ENA_CHID1)
141
+    | G2_MASK_Y(PWM_ENA_CHID2)
142
+    | G2_MASK_Z(PWM_ENA_CHID3)
143
+    | G2_MASK_E(PWM_ENA_CHID4)
144
+  ; // enable channels used by G2
145
+
146
+  PWM->PWM_IER1 = PWM_IER1_CHID0
147
+    | G2_MASK_X(PWM_IER1_CHID1)
148
+    | G2_MASK_Y(PWM_IER1_CHID2)
149
+    | G2_MASK_Z(PWM_IER1_CHID3)
150
+    | G2_MASK_E(PWM_IER1_CHID4)
151
+  ; // enable interrupts for channels used by G2
98 152
 
99 153
   NVIC_EnableIRQ(PWM_IRQn);     // Enable interrupt handler
100 154
   NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0));  // normal priority for PWM module (can stand some jitter on the Vref signals)
@@ -105,20 +159,27 @@ void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
105 159
   if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init();  // Init PWM system if needed
106 160
 
107 161
   switch (driver) {
108
-    case 0: PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update X & Y
109
-            PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
110
-            PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001;  // enable compare event
111
-            PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001;  // enable compare event
112
-            PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
113
-            break;
114
-    case 1: PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update Z
115
-            PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001;  // enable compare event
116
-            PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
117
-            break;
118
-    default:PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update E
119
-            PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001;  // enable compare event
120
-            PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
121
-            break;
162
+    case 0:
163
+      if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update X & Y
164
+      if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
165
+      if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001;  // enable compare event
166
+      if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001;  // enable compare event
167
+      if (G2_PWM_X || G2_PWM_Y) PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
168
+      break;
169
+    case 1:
170
+      if (G2_PWM_Z) {
171
+        PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update Z
172
+        PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001;  // enable compare event
173
+        PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
174
+      }
175
+      break;
176
+    default:
177
+      if (G2_PWM_E) {
178
+        PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));    // update E
179
+        PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001;  // enable compare event
180
+        PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
181
+      }
182
+      break;
122 183
   }
123 184
 }
124 185
 
@@ -127,17 +188,17 @@ volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
127 188
 void PWM_Handler() {
128 189
   PWM_ISR1_STATUS = PWM->PWM_ISR1;
129 190
   PWM_ISR2_STATUS = PWM->PWM_ISR2;
130
-  if (PWM_ISR1_STATUS & PWM_IER1_CHID0) {                           // CHAN_0 interrupt
131
-    *ISR_table[0].set_register = ISR_table[0].write_mask;                                          // set X to active
132
-    *ISR_table[1].set_register = ISR_table[1].write_mask;                                          // set Y to active
133
-    *ISR_table[2].set_register = ISR_table[2].write_mask;                                          // set Z to active
134
-    *ISR_table[3].set_register = ISR_table[3].write_mask;                                          // set E to active
191
+  if (PWM_ISR1_STATUS & PWM_IER1_CHID0) {                                                         // CHAN_0 interrupt
192
+    if (G2_PWM_X) *ISR_table[0].set_register = ISR_table[0].write_mask;                           // set X to active
193
+    if (G2_PWM_Y) *ISR_table[1].set_register = ISR_table[1].write_mask;                           // set Y to active
194
+    if (G2_PWM_Z) *ISR_table[2].set_register = ISR_table[2].write_mask;                           // set Z to active
195
+    if (G2_PWM_E) *ISR_table[3].set_register = ISR_table[3].write_mask;                           // set E to active
135 196
   }
136 197
   else {
137
-    if (PWM_ISR2_STATUS & PWM_IER2_CMPM1)  *ISR_table[0].clr_register = ISR_table[0].write_mask;   // set X to inactive
138
-    if (PWM_ISR2_STATUS & PWM_IER2_CMPM2)  *ISR_table[1].clr_register = ISR_table[1].write_mask;   // set Y to inactive
139
-    if (PWM_ISR2_STATUS & PWM_IER2_CMPM3)  *ISR_table[2].clr_register = ISR_table[2].write_mask;   // set Z to inactive
140
-    if (PWM_ISR2_STATUS & PWM_IER2_CMPM4)  *ISR_table[3].clr_register = ISR_table[3].write_mask;   // set E to inactive
198
+    if (G2_PWM_X && (PWM_ISR2_STATUS & PWM_IER2_CMPM1)) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
199
+    if (G2_PWM_Y && (PWM_ISR2_STATUS & PWM_IER2_CMPM2)) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
200
+    if (G2_PWM_Z && (PWM_ISR2_STATUS & PWM_IER2_CMPM3)) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
201
+    if (G2_PWM_E && (PWM_ISR2_STATUS & PWM_IER2_CMPM4)) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
141 202
   }
142 203
   return;
143 204
 }

+ 1
- 1
Marlin/src/HAL/DUE/inc/Conditionals_post.h View File

@@ -21,7 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if USE_EMULATED_EEPROM
24
+#if USE_FALLBACK_EEPROM
25 25
   #undef SRAM_EEPROM_EMULATION
26 26
   #undef SDCARD_EEPROM_EMULATION
27 27
   #define FLASH_EEPROM_EMULATION

Marlin/src/HAL/ESP32/persistent_store_impl.cpp → Marlin/src/HAL/ESP32/eeprom_impl.cpp View File

@@ -26,7 +26,7 @@
26 26
 
27 27
 #if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
28 28
 
29
-#include "../shared/persistent_store_api.h"
29
+#include "../shared/eeprom_api.h"
30 30
 #include "EEPROM.h"
31 31
 
32 32
 #define EEPROM_SIZE 4096

+ 1
- 1
Marlin/src/HAL/ESP32/fastio.h View File

@@ -56,7 +56,7 @@
56 56
 #define SET_OUTPUT(IO)          do{ _SET_OUTPUT(IO); }while(0)
57 57
 
58 58
 // Set pin as PWM
59
-#define SET_PWM(IO)             SET_OUTPUT(IO)
59
+#define SET_PWM                 SET_OUTPUT
60 60
 
61 61
 // Set pin as output and init
62 62
 #define OUT_WRITE(IO,V)         do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)

+ 1
- 1
Marlin/src/HAL/ESP32/inc/Conditionals_post.h View File

@@ -22,6 +22,6 @@
22 22
 #pragma once
23 23
 
24 24
 // If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
25
-#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
25
+#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
26 26
   #define SDCARD_EEPROM_EMULATION
27 27
 #endif

Marlin/src/HAL/LINUX/persistent_store_impl.cpp → Marlin/src/HAL/LINUX/eeprom_impl.cpp View File

@@ -26,7 +26,7 @@
26 26
 
27 27
 #if ENABLED(EEPROM_SETTINGS)
28 28
 
29
-#include "../shared/persistent_store_api.h"
29
+#include "../shared/eeprom_api.h"
30 30
 #include <stdio.h>
31 31
 
32 32
 #define LINUX_EEPROM_SIZE (E2END + 1)

Marlin/src/HAL/LPC1768/persistent_store_api.h → Marlin/src/HAL/LPC1768/eeprom_api.h View File

@@ -21,6 +21,6 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#include "../shared/persistent_store_api.h"
24
+#include "../shared/eeprom_api.h"
25 25
 
26 26
 #define FLASH_EEPROM_EMULATION

Marlin/src/HAL/LPC1768/persistent_store_flash.cpp → Marlin/src/HAL/LPC1768/eeprom_flash.cpp View File

@@ -40,7 +40,7 @@
40 40
 
41 41
 #if ENABLED(FLASH_EEPROM_EMULATION)
42 42
 
43
-#include "persistent_store_api.h"
43
+#include "eeprom_api.h"
44 44
 
45 45
 extern "C" {
46 46
   #include <lpc17xx_iap.h>

Marlin/src/HAL/LPC1768/persistent_store_sdcard.cpp → Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp View File

@@ -26,7 +26,7 @@
26 26
 
27 27
 #if ENABLED(SDCARD_EEPROM_EMULATION)
28 28
 
29
-#include "persistent_store_api.h"
29
+#include "eeprom_api.h"
30 30
 
31 31
 #include <chanfs/diskio.h>
32 32
 #include <chanfs/ff.h>

+ 1
- 1
Marlin/src/HAL/LPC1768/fastio.h View File

@@ -104,7 +104,7 @@
104 104
 /// set pin as output wrapper  -  reads the pin and sets the output to that value
105 105
 #define SET_OUTPUT(IO)        do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0)
106 106
 // set pin as PWM
107
-#define SET_PWM(IO)           SET_OUTPUT(IO)
107
+#define SET_PWM               SET_OUTPUT
108 108
 
109 109
 /// check if pin is an input wrapper
110 110
 #define IS_INPUT(IO)          _IS_INPUT(IO)

+ 1
- 1
Marlin/src/HAL/LPC1768/inc/Conditionals_post.h View File

@@ -21,6 +21,6 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if USE_EMULATED_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
24
+#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
25 25
   #define FLASH_EEPROM_EMULATION
26 26
 #endif

+ 1
- 1
Marlin/src/HAL/LPC1768/main.cpp View File

@@ -90,7 +90,7 @@ void HAL_init() {
90 90
 
91 91
   //debug_frmwrk_init();
92 92
   //_DBG("\n\nDebug running\n");
93
-  // Initialise the SD card chip select pins as soon as possible
93
+  // Initialize the SD card chip select pins as soon as possible
94 94
   #if PIN_EXISTS(SS)
95 95
     OUT_WRITE(SS_PIN, HIGH);
96 96
   #endif

+ 78
- 0
Marlin/src/HAL/SAMD51/QSPIFlash.cpp View File

@@ -0,0 +1,78 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(QSPI_EEPROM)
26
+
27
+#include "QSPIFlash.h"
28
+
29
+#define INVALID_ADDR    0xffffffff
30
+#define SECTOR_OF(a)    (a & ~(SFLASH_SECTOR_SIZE - 1))
31
+#define OFFSET_OF(a)    (a & (SFLASH_SECTOR_SIZE - 1))
32
+
33
+Adafruit_SPIFlashBase * QSPIFlash::_flashBase = nullptr;
34
+uint8_t QSPIFlash::_buf[SFLASH_SECTOR_SIZE];
35
+uint32_t QSPIFlash::_addr = INVALID_ADDR;
36
+
37
+void QSPIFlash::begin() {
38
+  if (_flashBase != nullptr) return;
39
+
40
+  _flashBase = new Adafruit_SPIFlashBase(new Adafruit_FlashTransport_QSPI());
41
+  _flashBase->begin(NULL);
42
+}
43
+
44
+size_t QSPIFlash::size() {
45
+  return _flashBase->size();
46
+}
47
+
48
+uint8_t QSPIFlash::readByte(const uint32_t address) {
49
+  if (SECTOR_OF(address) == _addr) return _buf[OFFSET_OF(address)];
50
+
51
+  return _flashBase->read8(address);
52
+}
53
+
54
+void QSPIFlash::writeByte(const uint32_t address, const uint8_t value) {
55
+  uint32_t const sector_addr = SECTOR_OF(address);
56
+
57
+  // Page changes, flush old and update new cache
58
+  if (sector_addr != _addr) {
59
+    flush();
60
+    _addr = sector_addr;
61
+
62
+    // read a whole page from flash
63
+    _flashBase->readBuffer(sector_addr, _buf, SFLASH_SECTOR_SIZE);
64
+  }
65
+
66
+  _buf[OFFSET_OF(address)] = value;
67
+}
68
+
69
+void QSPIFlash::flush() {
70
+  if (_addr == INVALID_ADDR) return;
71
+
72
+  _flashBase->eraseSector(_addr / SFLASH_SECTOR_SIZE);
73
+  _flashBase->writeBuffer(_addr, _buf, SFLASH_SECTOR_SIZE);
74
+
75
+  _addr = INVALID_ADDR;
76
+}
77
+
78
+#endif // QSPI_EEPROM

+ 51
- 0
Marlin/src/HAL/SAMD51/QSPIFlash.h View File

@@ -0,0 +1,51 @@
1
+/**
2
+ * @file QSPIFlash.h
3
+ *
4
+ * The MIT License (MIT)
5
+ *
6
+ * Copyright (c) 2019 Ha Thach and Dean Miller for Adafruit Industries LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ *
26
+ * Derived from Adafruit_SPIFlash class with no SdFat references
27
+ *
28
+ */
29
+
30
+#pragma once
31
+
32
+#include "Adafruit_SPIFlashBase.h"
33
+
34
+// This class extends Adafruit_SPIFlashBase by adding caching support.
35
+//
36
+// This class will use 4096 Bytes of RAM as a block cache.
37
+class QSPIFlash {
38
+  public:
39
+    static void begin();
40
+    static size_t size();
41
+    static uint8_t readByte(const uint32_t address);
42
+    static void writeByte(const uint32_t address, const uint8_t v);
43
+    static void flush();
44
+
45
+  private:
46
+    static Adafruit_SPIFlashBase * _flashBase;
47
+    static uint8_t _buf[SFLASH_SECTOR_SIZE];
48
+    static uint32_t _addr;
49
+};
50
+
51
+extern QSPIFlash qspi;

+ 66
- 0
Marlin/src/HAL/SAMD51/eeprom.cpp View File

@@ -0,0 +1,66 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ *
4
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+
22
+#ifdef __SAMD51__
23
+
24
+#include "../../inc/MarlinConfig.h"
25
+
26
+#if ENABLED(EEPROM_SETTINGS) && NONE(QSPI_EEPROM, FLASH_EEPROM_EMULATION)
27
+
28
+#include "../shared/eeprom_api.h"
29
+
30
+size_t PersistentStore::capacity() { return E2END + 1; }
31
+
32
+bool PersistentStore::access_start() { return true; }
33
+bool PersistentStore::access_finish() { return true; }
34
+
35
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
36
+  while (size--) {
37
+    const uint8_t v = *value;
38
+    uint8_t * const p = (uint8_t * const)pos;
39
+    if (v != eeprom_read_byte(p)) {
40
+      eeprom_write_byte(p, v);
41
+      delay(2);
42
+      if (eeprom_read_byte(p) != v) {
43
+        SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
44
+        return true;
45
+      }
46
+    }
47
+    crc16(crc, &v, 1);
48
+    pos++;
49
+    value++;
50
+  }
51
+  return false;
52
+}
53
+
54
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
55
+  while (size--) {
56
+    uint8_t c = eeprom_read_byte((uint8_t*)pos);
57
+    if (writing) *value = c;
58
+    crc16(crc, &c, 1);
59
+    pos++;
60
+    value++;
61
+  }
62
+  return false;
63
+}
64
+
65
+#endif // EEPROM_SETTINGS && !(QSPI_EEPROM || FLASH_EEPROM_EMULATION)
66
+#endif // __SAMD51__

+ 96
- 0
Marlin/src/HAL/SAMD51/eeprom_flash.cpp View File

@@ -0,0 +1,96 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ *
4
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+
22
+#ifdef __SAMD51__
23
+
24
+#include "../../inc/MarlinConfig.h"
25
+
26
+#if ENABLED(FLASH_EEPROM_EMULATION)
27
+
28
+#include "../shared/eeprom_api.h"
29
+
30
+#define NVMCTRL_CMD(c)    do{                                                 \
31
+                            SYNC(!NVMCTRL->STATUS.bit.READY);                 \
32
+                            NVMCTRL->INTFLAG.bit.DONE = true;                 \
33
+                            NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
34
+                            SYNC(NVMCTRL->INTFLAG.bit.DONE);                  \
35
+                          }while(0)
36
+#define NVMCTRL_FLUSH()   do{                                           \
37
+                            if (NVMCTRL->SEESTAT.bit.LOAD)              \
38
+                              NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH);  \
39
+                          }while(0)
40
+
41
+size_t PersistentStore::capacity() {
42
+  const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
43
+                sblk = NVMCTRL->SEESTAT.bit.SBLK;
44
+
45
+  return   (!psz && !sblk)         ? 0
46
+         : (psz <= 2)              ? (0x200 << psz)
47
+         : (sblk == 1 || psz == 3) ?  4096
48
+         : (sblk == 2 || psz == 4) ?  8192
49
+         : (sblk <= 4 || psz == 5) ? 16384
50
+         : (sblk >= 9 && psz == 7) ? 65536
51
+                                   : 32768;
52
+}
53
+
54
+bool PersistentStore::access_start() {
55
+  NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED;  // Buffered mode and segment reallocation active
56
+  if (NVMCTRL->SEESTAT.bit.RLOCK)
57
+    NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE);    // Unlock E2P data write access
58
+  return true;
59
+}
60
+
61
+bool PersistentStore::access_finish() {
62
+  NVMCTRL_FLUSH();
63
+  if (!NVMCTRL->SEESTAT.bit.LOCK)
64
+    NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE);    // Lock E2P data write access
65
+  return true;
66
+}
67
+
68
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
69
+  while (size--) {
70
+    const uint8_t v = *value;
71
+    SYNC(NVMCTRL->SEESTAT.bit.BUSY);
72
+    if (NVMCTRL->INTFLAG.bit.SEESFULL)
73
+      NVMCTRL_FLUSH();      // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
74
+    ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
75
+    SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
76
+    crc16(crc, &v, 1);
77
+    pos++;
78
+    value++;
79
+  }
80
+  return false;
81
+}
82
+
83
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
84
+  while (size--) {
85
+    SYNC(NVMCTRL->SEESTAT.bit.BUSY);
86
+    uint8_t c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
87
+    if (writing) *value = c;
88
+    crc16(crc, &c, 1);
89
+    pos++;
90
+    value++;
91
+  }
92
+  return false;
93
+}
94
+
95
+#endif // FLASH_EEPROM_EMULATION
96
+#endif // __SAMD51__

+ 71
- 0
Marlin/src/HAL/SAMD51/eeprom_qspi.cpp View File

@@ -0,0 +1,71 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ *
4
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+#ifdef __SAMD51__
22
+
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(QSPI_EEPROM)
26
+
27
+#include "../shared/eeprom_api.h"
28
+
29
+#include "QSPIFlash.h"
30
+
31
+static bool initialized;
32
+
33
+size_t PersistentStore::capacity() { return qspi.size(); }
34
+
35
+bool PersistentStore::access_start() {
36
+  if (!initialized) {
37
+    qspi.begin();
38
+    initialized = true;
39
+  }
40
+  return true;
41
+}
42
+
43
+bool PersistentStore::access_finish() {
44
+  qspi.flush();
45
+  return true;
46
+}
47
+
48
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
49
+  while (size--) {
50
+    const uint8_t v = *value;
51
+    qspi.writeByte(pos, v);
52
+    crc16(crc, &v, 1);
53
+    pos++;
54
+    value++;
55
+  }
56
+  return false;
57
+}
58
+
59
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
60
+  while (size--) {
61
+    uint8_t c = qspi.readByte(pos);
62
+    if (writing) *value = c;
63
+    crc16(crc, &c, 1);
64
+    pos++;
65
+    value++;
66
+  }
67
+  return false;
68
+}
69
+
70
+#endif // QSPI_EEPROM
71
+#endif // __SAMD51__

+ 2
- 2
Marlin/src/HAL/SAMD51/fastio.h View File

@@ -100,9 +100,9 @@
100 100
                                   PORT->Group[port].DIRCLR.reg = MASK(pin);                           \
101 101
                                 }while(0)
102 102
 // Set pin as PWM (push pull)
103
-#define SET_PWM(IO)             SET_OUTPUT(IO)
103
+#define SET_PWM                 SET_OUTPUT
104 104
 // Set pin as PWM (open drain)
105
-#define SET_PWM_OD(IO)          SET_OUTPUT_OD(IO)
105
+#define SET_PWM_OD              SET_OUTPUT_OD
106 106
 
107 107
 // check if pin is an output
108 108
 #define IS_OUTPUT(IO)            ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].DIR.reg & MASK(GET_SAMD_PIN(IO))) \

+ 1
- 3
Marlin/src/HAL/SAMD51/inc/Conditionals_post.h View File

@@ -21,8 +21,6 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if USE_EMULATED_EEPROM
25
-  #undef SRAM_EEPROM_EMULATION
26
-  #undef SDCARD_EEPROM_EMULATION
24
+#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
27 25
   #define FLASH_EEPROM_EMULATION
28 26
 #endif

+ 0
- 129
Marlin/src/HAL/SAMD51/persistent_store_eeprom.cpp View File

@@ -1,129 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- *
4
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5
- * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
- *
20
- */
21
-
22
-#ifdef __SAMD51__
23
-
24
-#include "../../inc/MarlinConfig.h"
25
-
26
-#if ENABLED(EEPROM_SETTINGS)
27
-
28
-#include "../shared/persistent_store_api.h"
29
-
30
-#if ENABLED(FLASH_EEPROM_EMULATION)
31
-  #define NVMCTRL_CMD(c)    do{                                                 \
32
-                              SYNC(!NVMCTRL->STATUS.bit.READY);                 \
33
-                              NVMCTRL->INTFLAG.bit.DONE = true;                 \
34
-                              NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
35
-                              SYNC(NVMCTRL->INTFLAG.bit.DONE);                  \
36
-                            }while(0)
37
-  #define NVMCTRL_FLUSH()   do{                                           \
38
-                              if (NVMCTRL->SEESTAT.bit.LOAD)              \
39
-                                NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH);  \
40
-                            }while(0)
41
-#endif
42
-
43
-bool PersistentStore::access_start() {
44
-  #if ENABLED(FLASH_EEPROM_EMULATION)
45
-    NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED;  // Buffered mode and segment reallocation active
46
-  #endif
47
-
48
-  return true;
49
-}
50
-
51
-bool PersistentStore::access_finish() {
52
-  #if ENABLED(FLASH_EEPROM_EMULATION)
53
-    NVMCTRL_FLUSH();
54
-    if (!NVMCTRL->SEESTAT.bit.LOCK)
55
-      NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE);    // Lock E2P data write access
56
-  #endif
57
-
58
-  return true;
59
-}
60
-
61
-bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
62
-  #if ENABLED(FLASH_EEPROM_EMULATION)
63
-    if (NVMCTRL->SEESTAT.bit.RLOCK)
64
-      NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE);    // Unlock E2P data write access
65
-  #endif
66
-
67
-  while (size--) {
68
-    const uint8_t v = *value;
69
-    #if ENABLED(FLASH_EEPROM_EMULATION)
70
-      SYNC(NVMCTRL->SEESTAT.bit.BUSY);
71
-      if (NVMCTRL->INTFLAG.bit.SEESFULL)
72
-        NVMCTRL_FLUSH();      // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
73
-      ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
74
-      SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
75
-    #else
76
-      uint8_t * const p = (uint8_t * const)pos;
77
-      if (v != eeprom_read_byte(p)) {
78
-        eeprom_write_byte(p, v);
79
-        delay(2);
80
-        if (eeprom_read_byte(p) != v) {
81
-          SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
82
-          return true;
83
-        }
84
-      }
85
-    #endif
86
-    crc16(crc, &v, 1);
87
-    pos++;
88
-    value++;
89
-  }
90
-  return false;
91
-}
92
-
93
-bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
94
-  while (size--) {
95
-    uint8_t c;
96
-    #if ENABLED(FLASH_EEPROM_EMULATION)
97
-      SYNC(NVMCTRL->SEESTAT.bit.BUSY);
98
-      c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
99
-    #else
100
-      c = eeprom_read_byte((uint8_t*)pos);
101
-    #endif
102
-    if (writing) *value = c;
103
-    crc16(crc, &c, 1);
104
-    pos++;
105
-    value++;
106
-  }
107
-  return false;
108
-}
109
-
110
-size_t PersistentStore::capacity() {
111
-  #if ENABLED(FLASH_EEPROM_EMULATION)
112
-    const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
113
-                  sblk = NVMCTRL->SEESTAT.bit.SBLK;
114
-
115
-         if (!psz && !sblk)         return     0;
116
-    else if (psz <= 2)              return (0x200 << psz);
117
-    else if (sblk == 1 || psz == 3) return  4096;
118
-    else if (sblk == 2 || psz == 4) return  8192;
119
-    else if (sblk <= 4 || psz == 5) return 16384;
120
-    else if (sblk >= 9 && psz == 7) return 65536;
121
-    else                            return 32768;
122
-  #else
123
-    return E2END + 1;
124
-  #endif
125
-}
126
-
127
-#endif // EEPROM_SETTINGS
128
-
129
-#endif // __SAMD51__

+ 2
- 7
Marlin/src/HAL/STM32/SoftwareSerial.h View File

@@ -29,9 +29,7 @@
29 29
  * The latest version of this library can always be found at
30 30
  * http://arduiniana.org.
31 31
  */
32
-
33
-#ifndef SOFTWARESERIAL_H
34
-#define SOFTWARESERIAL_H
32
+#pragma once
35 33
 
36 34
 #include <Arduino.h>
37 35
 
@@ -64,7 +62,6 @@ class SoftwareSerial : public Stream {
64 62
     uint32_t delta_start = 0;
65 63
 
66 64
     // static data
67
-    static bool initialised;
68 65
     static HardwareTimer timer;
69 66
     static const IRQn_Type timer_interrupt_number;
70 67
     static uint32_t timer_interrupt_priority;
@@ -91,7 +88,7 @@ class SoftwareSerial : public Stream {
91 88
   public:
92 89
     // public methods
93 90
 
94
-    SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false);
91
+    SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic=false);
95 92
     virtual ~SoftwareSerial();
96 93
     void begin(long speed);
97 94
     bool listen();
@@ -115,5 +112,3 @@ class SoftwareSerial : public Stream {
115 112
 
116 113
     using Print::write;
117 114
 };
118
-
119
-#endif // SOFTWARESERIAL_H

Marlin/src/HAL/STM32/persistent_store_flash.cpp → Marlin/src/HAL/STM32/eeprom_flash.cpp View File

@@ -27,7 +27,7 @@
27 27
 
28 28
 #if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
29 29
 
30
-#include "../shared/persistent_store_api.h"
30
+#include "../shared/eeprom_api.h"
31 31
 
32 32
 
33 33
 // Only STM32F4 can support wear leveling at this time

Marlin/src/HAL/STM32/persistent_store_impl.cpp → Marlin/src/HAL/STM32/eeprom_impl.cpp View File

@@ -24,9 +24,9 @@
24 24
 
25 25
 #include "../../inc/MarlinConfig.h"
26 26
 
27
-#if EITHER(USE_REAL_EEPROM, SRAM_EEPROM_EMULATION)
27
+#if EITHER(USE_WIRED_EEPROM, SRAM_EEPROM_EMULATION)
28 28
 
29
-#include "../shared/persistent_store_api.h"
29
+#include "../shared/eeprom_api.h"
30 30
 
31 31
 bool PersistentStore::access_start() {
32 32
   return true;
@@ -41,7 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
41 41
     uint8_t v = *value;
42 42
 
43 43
     // Save to either external EEPROM, program flash or Backup SRAM
44
-    #if USE_REAL_EEPROM
44
+    #if USE_WIRED_EEPROM
45 45
       // EEPROM has only ~100,000 write cycles,
46 46
       // so only write bytes that have changed!
47 47
       uint8_t * const p = (uint8_t * const)pos;
@@ -68,7 +68,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
68 68
   do {
69 69
     // Read from either external EEPROM, program flash or Backup SRAM
70 70
     const uint8_t c = (
71
-      #if USE_REAL_EEPROM
71
+      #if USE_WIRED_EEPROM
72 72
         eeprom_read_byte((uint8_t*)pos)
73 73
       #else
74 74
         (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
@@ -85,7 +85,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
85 85
 
86 86
 size_t PersistentStore::capacity() {
87 87
   return (
88
-    #if USE_REAL_EEPROM
88
+    #if USE_WIRED_EEPROM
89 89
       E2END + 1
90 90
     #else
91 91
       4096 // 4kB
@@ -93,5 +93,5 @@ size_t PersistentStore::capacity() {
93 93
   );
94 94
 }
95 95
 
96
-#endif // USE_REAL_EEPROM || SRAM_EEPROM_EMULATION
96
+#endif // USE_WIRED_EEPROM || SRAM_EEPROM_EMULATION
97 97
 #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

Marlin/src/HAL/STM32/persistent_store_sdcard.cpp → Marlin/src/HAL/STM32/eeprom_sdcard.cpp View File

@@ -30,7 +30,7 @@
30 30
 
31 31
 #if ENABLED(SDCARD_EEPROM_EMULATION)
32 32
 
33
-#include "../shared/persistent_store_api.h"
33
+#include "../shared/eeprom_api.h"
34 34
 
35 35
 #ifndef E2END
36 36
   #define E2END 0xFFF // 4KB

+ 1
- 1
Marlin/src/HAL/STM32/inc/Conditionals_post.h View File

@@ -22,6 +22,6 @@
22 22
 #pragma once
23 23
 
24 24
 // If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
25
-#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
25
+#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
26 26
   #define SDCARD_EEPROM_EMULATION
27 27
 #endif

Marlin/src/HAL/STM32F1/persistent_store_eeprom.cpp → Marlin/src/HAL/STM32F1/eeprom.cpp View File

@@ -22,9 +22,9 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if USE_REAL_EEPROM
25
+#if USE_WIRED_EEPROM
26 26
 
27
-#include "../shared/persistent_store_api.h"
27
+#include "../shared/eeprom_api.h"
28 28
 
29 29
 bool PersistentStore::access_start() {
30 30
   #if ENABLED(SPI_EEPROM)
@@ -73,5 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
73 73
 
74 74
 size_t PersistentStore::capacity() { return E2END + 1; }
75 75
 
76
-#endif // USE_REAL_EEPROM
76
+#endif // USE_WIRED_EEPROM
77 77
 #endif // __STM32F1__

Marlin/src/HAL/STM32F1/persistent_store_flash.cpp → Marlin/src/HAL/STM32F1/eeprom_flash.cpp View File

@@ -31,10 +31,9 @@
31 31
 
32 32
 #include "../../inc/MarlinConfig.h"
33 33
 
34
-// This is for EEPROM emulation in flash
35
-#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
34
+#if ENABLED(FLASH_EEPROM_EMULATION)
36 35
 
37
-#include "../shared/persistent_store_api.h"
36
+#include "../shared/eeprom_api.h"
38 37
 
39 38
 #include <flash_stm32.h>
40 39
 #include <EEPROM.h>
@@ -108,5 +107,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
108 107
 
109 108
 size_t PersistentStore::capacity() { return EEPROM_SIZE; }
110 109
 
111
-#endif // EEPROM_SETTINGS && EEPROM FLASH
110
+#endif // FLASH_EEPROM_EMULATION
112 111
 #endif // __STM32F1__

Marlin/src/HAL/STM32F1/persistent_store_sdcard.cpp → Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp View File

@@ -31,7 +31,7 @@
31 31
 
32 32
 #if ENABLED(SDCARD_EEPROM_EMULATION)
33 33
 
34
-#include "../shared/persistent_store_api.h"
34
+#include "../shared/eeprom_api.h"
35 35
 
36 36
 #ifndef E2END
37 37
   #define E2END 0xFFF // 4KB
@@ -101,5 +101,4 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
101 101
 size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
102 102
 
103 103
 #endif // SDCARD_EEPROM_EMULATION
104
-
105 104
 #endif // __STM32F1__

Marlin/src/HAL/STM32_F4_F7/persistent_store_eeprom.cpp → Marlin/src/HAL/STM32_F4_F7/eeprom.cpp View File

@@ -27,7 +27,7 @@
27 27
 
28 28
 #if ENABLED(EEPROM_SETTINGS)
29 29
 
30
-#include "../shared/persistent_store_api.h"
30
+#include "../shared/eeprom_api.h"
31 31
 
32 32
 bool PersistentStore::access_start() { return true; }
33 33
 bool PersistentStore::access_finish() { return true; }

+ 1
- 1
Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h View File

@@ -22,7 +22,7 @@
22 22
 #pragma once
23 23
 
24 24
 #if ENABLED(EEPROM_SETTINGS) && defined(STM32F7)
25
-  #undef USE_REAL_EEPROM
25
+  #undef USE_WIRED_EEPROM
26 26
   #undef SRAM_EEPROM_EMULATION
27 27
   #undef SDCARD_EEPROM_EMULATION
28 28
   #define FLASH_EEPROM_EMULATION

Marlin/src/HAL/TEENSY31_32/persistent_store_impl.cpp → Marlin/src/HAL/TEENSY31_32/eeprom_impl.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #if ENABLED(EEPROM_SETTINGS)
24 24
 
25
-#include "../shared/persistent_store_api.h"
25
+#include "../shared/eeprom_api.h"
26 26
 
27 27
 bool PersistentStore::access_start() { return true; }
28 28
 bool PersistentStore::access_finish() { return true; }

+ 2
- 1
Marlin/src/HAL/TEENSY31_32/fastio.h View File

@@ -76,8 +76,9 @@
76 76
 
77 77
 #define SET_INPUT(IO)         _SET_INPUT(IO)
78 78
 #define SET_INPUT_PULLUP(IO)  _SET_INPUT_PULLUP(IO)
79
+#define SET_INPUT_PULLDOWN    SET_INPUT
79 80
 #define SET_OUTPUT(IO)        _SET_OUTPUT(IO)
80
-#define SET_PWM(IO)            SET_OUTPUT(IO)
81
+#define SET_PWM               SET_OUTPUT
81 82
 
82 83
 #define IS_INPUT(IO)          _IS_INPUT(IO)
83 84
 #define IS_OUTPUT(IO)         _IS_OUTPUT(IO)

+ 1
- 1
Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h View File

@@ -22,6 +22,6 @@
22 22
 #pragma once
23 23
 
24 24
 // If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
25
-#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
25
+#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
26 26
   #define SDCARD_EEPROM_EMULATION
27 27
 #endif

Marlin/src/HAL/TEENSY35_36/persistent_store_eeprom.cpp → Marlin/src/HAL/TEENSY35_36/eeprom.cpp View File

@@ -27,7 +27,7 @@
27 27
 
28 28
 #if ENABLED(EEPROM_SETTINGS)
29 29
 
30
-#include "../shared/persistent_store_api.h"
30
+#include "../shared/eeprom_api.h"
31 31
 #include <avr/eeprom.h>
32 32
 
33 33
 bool PersistentStore::access_start() { return true; }

+ 2
- 1
Marlin/src/HAL/TEENSY35_36/fastio.h View File

@@ -76,8 +76,9 @@
76 76
 
77 77
 #define SET_INPUT(IO)         _SET_INPUT(IO)
78 78
 #define SET_INPUT_PULLUP(IO)  _SET_INPUT_PULLUP(IO)
79
+#define SET_INPUT_PULLDOWN    SET_INPUT
79 80
 #define SET_OUTPUT(IO)        _SET_OUTPUT(IO)
80
-#define SET_PWM(IO)            SET_OUTPUT(IO)
81
+#define SET_PWM               SET_OUTPUT
81 82
 
82 83
 #define IS_INPUT(IO)          _IS_INPUT(IO)
83 84
 #define IS_OUTPUT(IO)         _IS_OUTPUT(IO)

Marlin/src/HAL/shared/persistent_store_api.cpp → Marlin/src/HAL/shared/eeprom_api.cpp View File

@@ -24,7 +24,7 @@
24 24
 
25 25
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
26 26
 
27
-  #include "persistent_store_api.h"
27
+  #include "eeprom_api.h"
28 28
   PersistentStore persistentStore;
29 29
 
30 30
 #endif

Marlin/src/HAL/shared/persistent_store_api.h → Marlin/src/HAL/shared/eeprom_api.h View File


+ 21
- 47
Marlin/src/MarlinCore.cpp View File

@@ -210,6 +210,24 @@ bool wait_for_heatup = true;
210 210
 // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
211 211
 #if HAS_RESUME_CONTINUE
212 212
   bool wait_for_user; // = false;
213
+
214
+  void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
215
+    #if DISABLED(ADVANCED_PAUSE_FEATURE)
216
+      UNUSED(no_sleep);
217
+    #endif
218
+    KEEPALIVE_STATE(PAUSED_FOR_USER);
219
+    wait_for_user = true;
220
+    if (ms) ms += millis(); // expire time
221
+    while (wait_for_user && !(ms && ELAPSED(millis(), ms))) {
222
+      idle(
223
+        #if ENABLED(ADVANCED_PAUSE_FEATURE)
224
+          no_sleep
225
+        #endif
226
+      );
227
+    }
228
+    wait_for_user = false;
229
+  }
230
+
213 231
 #endif
214 232
 
215 233
 // Inactivity shutdown
@@ -418,52 +436,8 @@ void startOrResumeJob() {
418 436
   }
419 437
 
420 438
   inline void finishSDPrinting() {
421
-
422
-    bool did_state = true;
423
-    switch (card.sdprinting_done_state) {
424
-
425
-      case 1:
426
-        did_state = print_job_timer.duration() < 60 || queue.enqueue_one_P(PSTR("M31"));
427
-        break;
428
-
429
-      case 2:
430
-        did_state = queue.enqueue_one_P(PSTR("M77"));
431
-        break;
432
-
433
-      case 3:
434
-        #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
435
-          ui.set_progress_done();
436
-        #endif
437
-        break;
438
-
439
-      case 4:                                   // Display "Click to Continue..."
440
-        #if HAS_RESUME_CONTINUE                 // 30 min timeout with LCD, 1 min without
441
-          did_state = queue.enqueue_one_P(
442
-            print_job_timer.duration() < 60 ? PSTR("M0Q1P1") : PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60"))
443
-          );
444
-        #endif
445
-        break;
446
-
447
-      case 5:
448
-        #if ENABLED(POWER_LOSS_RECOVERY)
449
-          recovery.purge();
450
-        #endif
451
-
452
-        #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
453
-          planner.finish_and_disable();
454
-        #endif
455
-
456
-        #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
457
-          ui.reselect_last_file();
458
-        #endif
459
-
460
-        SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
461
-
462
-      default:
463
-        did_state = false;
464
-        card.sdprinting_done_state = 0;
465
-    }
466
-    if (did_state) ++card.sdprinting_done_state;
439
+    if (queue.enqueue_one_P(PSTR("M1001")))
440
+      marlin_state = MF_RUNNING;
467 441
   }
468 442
 
469 443
 #endif // SDSUPPORT
@@ -1208,7 +1182,7 @@ void loop() {
1208 1182
     #if ENABLED(SDSUPPORT)
1209 1183
       card.checkautostart();
1210 1184
       if (card.flag.abort_sd_printing) abortSDPrinting();
1211
-      if (card.sdprinting_done_state) finishSDPrinting();
1185
+      if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
1212 1186
     #endif
1213 1187
 
1214 1188
     queue.advance();

+ 2
- 0
Marlin/src/MarlinCore.h View File

@@ -83,6 +83,7 @@ enum MarlinState : uint8_t {
83 83
   MF_PAUSED       = _BV(1),
84 84
   MF_WAITING      = _BV(2),
85 85
   MF_STOPPED      = _BV(3),
86
+  MF_SD_COMPLETE  = _BV(4),
86 87
   MF_KILLED       = _BV(7)
87 88
 };
88 89
 
@@ -98,6 +99,7 @@ extern bool wait_for_heatup;
98 99
 
99 100
 #if HAS_RESUME_CONTINUE
100 101
   extern bool wait_for_user;
102
+  void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
101 103
 #endif
102 104
 
103 105
 // Inactivity shutdown timer

+ 1
- 0
Marlin/src/core/boards.h View File

@@ -144,6 +144,7 @@
144 144
 #define BOARD_LEAPFROG_XEED2015       1321  // Leapfrog Xeed 2015
145 145
 #define BOARD_PICA_REVB               1322  // PICA Shield (original version)
146 146
 #define BOARD_PICA                    1323  // PICA Shield (rev C or later)
147
+#define BOARD_INTAMSYS40              1324  // Intamsys 4.0 (Funmat HT)
147 148
 
148 149
 //
149 150
 // ATmega1281, ATmega2561

+ 3
- 0
Marlin/src/core/macros.h View File

@@ -194,6 +194,9 @@
194 194
 #define DISABLED(V...)      DO(DIS,&&,V)
195 195
 
196 196
 #define TERN(O,A,B)         _TERN(_ENA_1(O),B,A)    // OPTION converted to '0' or '1'
197
+#define TERN0(O,A)          _TERN(_ENA_1(O),0,A)    // OPTION converted to A or '0'
198
+#define TERN1(O,A)          _TERN(_ENA_1(O),1,A)    // OPTION converted to A or '1'
199
+#define TERN_(O,A)          _TERN(_ENA_1(O),,A)     // OPTION converted to A or '<nul>'
197 200
 #define _TERN(E,V...)       __TERN(_CAT(T_,E),V)    // Prepend 'T_' to get 'T_0' or 'T_1'
198 201
 #define __TERN(T,V...)      ___TERN(_CAT(_NO,T),V)  // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
199 202
 #define ___TERN(P,V...)     THIRD(P,V)              // If first argument has a comma, A. Else B.

+ 1
- 1
Marlin/src/feature/backlash.cpp View File

@@ -113,7 +113,7 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const
113 113
             error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps
114 114
         }
115 115
       #endif
116
-      // Making a correction reduces the residual error and modifies delta_mm
116
+      // Making a correction reduces the residual error and adds block steps
117 117
       if (error_correction) {
118 118
         block->steps[axis] += ABS(error_correction);
119 119
         residual_error[axis] -= error_correction;

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -27,7 +27,7 @@
27 27
   #include "../bedlevel.h"
28 28
 
29 29
   #include "../../../MarlinCore.h"
30
-  #include "../../../HAL/shared/persistent_store_api.h"
30
+  #include "../../../HAL/shared/eeprom_api.h"
31 31
   #include "../../../libs/hex_print_routines.h"
32 32
   #include "../../../module/configuration_store.h"
33 33
   #include "../../../lcd/ultralcd.h"

+ 1
- 1
Marlin/src/feature/max7219.cpp View File

@@ -121,7 +121,7 @@ uint8_t Max7219::suspended; // = 0;
121 121
   #define CRITICAL_SECTION_START() NOOP
122 122
   #define CRITICAL_SECTION_END()   NOOP
123 123
 #else
124
-  #define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR)
124
+  #define SIG_DELAY() DELAY_NS(250)
125 125
 #endif
126 126
 
127 127
 void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) {

+ 1
- 2
Marlin/src/feature/mmu2/mmu2.cpp View File

@@ -707,14 +707,13 @@ void MMU2::filament_runout() {
707 707
     if (recover)  {
708 708
       LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
709 709
       BUZZ(200, 404);
710
-      wait_for_user = true;
711 710
       #if ENABLED(HOST_PROMPT_SUPPORT)
712 711
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR);
713 712
       #endif
714 713
       #if ENABLED(EXTENSIBLE_UI)
715 714
         ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"));
716 715
       #endif
717
-      while (wait_for_user) idle();
716
+      wait_for_user_response();
718 717
       BUZZ(200, 404);
719 718
       BUZZ(200, 404);
720 719
 

+ 14
- 25
Marlin/src/feature/pause.cpp View File

@@ -134,15 +134,6 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) {
134 134
   return thermalManager.wait_for_hotend(active_extruder);
135 135
 }
136 136
 
137
-void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) {
138
-  #if HAS_FILAMENT_SENSOR
139
-    runout.reset();
140
-  #endif
141
-  current_position.e += length / planner.e_factor[active_extruder];
142
-  line_to_current_position(fr_mm_s);
143
-  planner.synchronize();
144
-}
145
-
146 137
 /**
147 138
  * Load filament into the hotend
148 139
  *
@@ -184,7 +175,6 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
184 175
     #endif
185 176
 
186 177
     KEEPALIVE_STATE(PAUSED_FOR_USER);
187
-    wait_for_user = true;    // LCD click or M108 will clear this
188 178
     #if ENABLED(HOST_PROMPT_SUPPORT)
189 179
       const char tool = '0'
190 180
         #if NUM_RUNOUT_SENSORS > 1
@@ -218,7 +208,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
218 208
   #endif
219 209
 
220 210
   // Slow Load filament
221
-  if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
211
+  if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
222 212
 
223 213
   // Fast Load Filament
224 214
   if (fast_load_length) {
@@ -227,7 +217,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
227 217
       planner.settings.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL;
228 218
     #endif
229 219
 
230
-    do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
220
+    unscaled_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
231 221
 
232 222
     #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
233 223
       planner.settings.retract_acceleration = saved_acceleration;
@@ -246,15 +236,15 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
246 236
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE);
247 237
     #endif
248 238
 
249
-    wait_for_user = true;
250 239
     #if ENABLED(HOST_PROMPT_SUPPORT)
251 240
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR);
252 241
     #endif
253 242
     #if ENABLED(EXTENSIBLE_UI)
254 243
       ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."));
255 244
     #endif
245
+    wait_for_user = true; // A click or M108 breaks the purge_length loop
256 246
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
257
-      do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
247
+      unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
258 248
     wait_for_user = false;
259 249
 
260 250
   #else
@@ -267,7 +257,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
267 257
         #endif
268 258
 
269 259
         // Extrude filament to get into hotend
270
-        do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
260
+        unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
271 261
       }
272 262
 
273 263
       #if ENABLED(HOST_PROMPT_SUPPORT)
@@ -332,13 +322,13 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
332 322
   #endif
333 323
 
334 324
   // Retract filament
335
-  do_pause_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
325
+  unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
336 326
 
337 327
   // Wait for filament to cool
338 328
   safe_delay(FILAMENT_UNLOAD_PURGE_DELAY);
339 329
 
340 330
   // Quickly purge
341
-  do_pause_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
331
+  unscaled_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
342 332
                   (FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);
343 333
 
344 334
   // Unload filament
@@ -347,7 +337,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
347 337
     planner.settings.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL;
348 338
   #endif
349 339
 
350
-  do_pause_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);
340
+  unscaled_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);
351 341
 
352 342
   #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
353 343
     planner.settings.retract_acceleration = saved_acceleration;
@@ -437,7 +427,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float
437 427
 
438 428
   // Initial retract before move to filament change position
439 429
   if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
440
-    do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
430
+    unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
441 431
 
442 432
   // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
443 433
   if (!axes_need_homing())
@@ -508,13 +498,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
508 498
 
509 499
   // Wait for filament insert by user and press button
510 500
   KEEPALIVE_STATE(PAUSED_FOR_USER);
511
-  wait_for_user = true;    // LCD click or M108 will clear this
512 501
   #if ENABLED(HOST_PROMPT_SUPPORT)
513 502
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), CONTINUE_STR);
514 503
   #endif
515 504
   #if ENABLED(EXTENSIBLE_UI)
516 505
     ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked"));
517 506
   #endif
507
+  wait_for_user = true;    // LCD click or M108 will clear this
518 508
   while (wait_for_user) {
519 509
     #if HAS_BUZZER
520 510
       filament_change_beep(max_beep_count);
@@ -540,8 +530,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
540 530
         ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout"));
541 531
       #endif
542 532
 
543
-      // Wait for LCD click or M108
544
-      while (wait_for_user) idle_no_sleep();
533
+      wait_for_user_response(0, true); // Wait for LCD click or M108
545 534
 
546 535
       #if ENABLED(HOST_PROMPT_SUPPORT)
547 536
         host_prompt_do(PROMPT_INFO, PSTR("Reheating"));
@@ -633,11 +622,11 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
633 622
   #if ENABLED(FWRETRACT)
634 623
     // If retracted before goto pause
635 624
     if (fwretract.retracted[active_extruder])
636
-      do_pause_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
625
+      unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
637 626
   #endif
638 627
 
639 628
   // If resume_position is negative
640
-  if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
629
+  if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
641 630
 
642 631
   // Move XY to starting position, then Z
643 632
   do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
@@ -646,7 +635,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
646 635
   do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
647 636
 
648 637
   #if ADVANCED_PAUSE_RESUME_PRIME != 0
649
-    do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
638
+    unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
650 639
   #endif
651 640
 
652 641
   // Now all extrusion positions are resumed and ready to be confirmed

+ 0
- 2
Marlin/src/feature/pause.h View File

@@ -83,8 +83,6 @@ extern uint8_t did_pause_print;
83 83
   #define DXC_PASS
84 84
 #endif
85 85
 
86
-void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s);
87
-
88 86
 bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS);
89 87
 
90 88
 void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);

+ 17
- 39
Marlin/src/feature/twibus.cpp View File

@@ -49,37 +49,27 @@ void TWIBus::address(const uint8_t adr) {
49 49
 
50 50
   addr = adr;
51 51
 
52
-  #if ENABLED(DEBUG_TWIBUS)
53
-    debug(PSTR("address"), adr);
54
-  #endif
52
+  debug(PSTR("address"), adr);
55 53
 }
56 54
 
57 55
 void TWIBus::addbyte(const char c) {
58 56
   if (buffer_s >= COUNT(buffer)) return;
59 57
   buffer[buffer_s++] = c;
60
-  #if ENABLED(DEBUG_TWIBUS)
61
-    debug(PSTR("addbyte"), c);
62
-  #endif
58
+  debug(PSTR("addbyte"), c);
63 59
 }
64 60
 
65 61
 void TWIBus::addbytes(char src[], uint8_t bytes) {
66
-  #if ENABLED(DEBUG_TWIBUS)
67
-    debug(PSTR("addbytes"), bytes);
68
-  #endif
62
+  debug(PSTR("addbytes"), bytes);
69 63
   while (bytes--) addbyte(*src++);
70 64
 }
71 65
 
72 66
 void TWIBus::addstring(char str[]) {
73
-  #if ENABLED(DEBUG_TWIBUS)
74
-    debug(PSTR("addstring"), str);
75
-  #endif
67
+  debug(PSTR("addstring"), str);
76 68
   while (char c = *str++) addbyte(c);
77 69
 }
78 70
 
79 71
 void TWIBus::send() {
80
-  #if ENABLED(DEBUG_TWIBUS)
81
-    debug(PSTR("send"), addr);
82
-  #endif
72
+  debug(PSTR("send"), addr);
83 73
 
84 74
   Wire.beginTransmission(I2C_ADDRESS(addr));
85 75
   Wire.write(buffer, buffer_s);
@@ -89,21 +79,21 @@ void TWIBus::send() {
89 79
 }
90 80
 
91 81
 // static
92
-void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) {
82
+void TWIBus::echoprefix(uint8_t bytes, const char pref[], uint8_t adr) {
93 83
   SERIAL_ECHO_START();
94
-  serialprintPGM(prefix);
84
+  serialprintPGM(pref);
95 85
   SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:");
96 86
 }
97 87
 
98 88
 // static
99
-void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) {
100
-  echoprefix(bytes, prefix, adr);
89
+void TWIBus::echodata(uint8_t bytes, const char pref[], uint8_t adr) {
90
+  echoprefix(bytes, pref, adr);
101 91
   while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read());
102 92
   SERIAL_EOL();
103 93
 }
104 94
 
105
-void TWIBus::echobuffer(const char prefix[], uint8_t adr) {
106
-  echoprefix(buffer_s, prefix, adr);
95
+void TWIBus::echobuffer(const char pref[], uint8_t adr) {
96
+  echoprefix(buffer_s, pref, adr);
107 97
   LOOP_L_N(i, buffer_s) SERIAL_CHAR(buffer[i]);
108 98
   SERIAL_EOL();
109 99
 }
@@ -111,15 +101,11 @@ void TWIBus::echobuffer(const char prefix[], uint8_t adr) {
111 101
 bool TWIBus::request(const uint8_t bytes) {
112 102
   if (!addr) return false;
113 103
 
114
-  #if ENABLED(DEBUG_TWIBUS)
115
-    debug(PSTR("request"), bytes);
116
-  #endif
104
+  debug(PSTR("request"), bytes);
117 105
 
118 106
   // requestFrom() is a blocking function
119 107
   if (Wire.requestFrom(addr, bytes) == 0) {
120
-    #if ENABLED(DEBUG_TWIBUS)
121
-      debug("request fail", addr);
122
-    #endif
108
+    debug("request fail", addr);
123 109
     return false;
124 110
   }
125 111
 
@@ -127,9 +113,7 @@ bool TWIBus::request(const uint8_t bytes) {
127 113
 }
128 114
 
129 115
 void TWIBus::relay(const uint8_t bytes) {
130
-  #if ENABLED(DEBUG_TWIBUS)
131
-    debug(PSTR("relay"), bytes);
132
-  #endif
116
+  debug(PSTR("relay"), bytes);
133 117
 
134 118
   if (request(bytes))
135 119
     echodata(bytes, PSTR("i2c-reply"), addr);
@@ -141,9 +125,7 @@ uint8_t TWIBus::capture(char *dst, const uint8_t bytes) {
141 125
   while (count < bytes && Wire.available())
142 126
     dst[count++] = Wire.read();
143 127
 
144
-  #if ENABLED(DEBUG_TWIBUS)
145
-    debug(PSTR("capture"), count);
146
-  #endif
128
+  debug(PSTR("capture"), count);
147 129
 
148 130
   return count;
149 131
 }
@@ -156,16 +138,12 @@ void TWIBus::flush() {
156 138
 #if I2C_SLAVE_ADDRESS > 0
157 139
 
158 140
   void TWIBus::receive(uint8_t bytes) {
159
-    #if ENABLED(DEBUG_TWIBUS)
160
-      debug(PSTR("receive"), bytes);
161
-    #endif
141
+    debug(PSTR("receive"), bytes);
162 142
     echodata(bytes, PSTR("i2c-receive"), 0);
163 143
   }
164 144
 
165 145
   void TWIBus::reply(char str[]/*=nullptr*/) {
166
-    #if ENABLED(DEBUG_TWIBUS)
167
-      debug(PSTR("reply"), str);
168
-    #endif
146
+    debug(PSTR("reply"), str);
169 147
 
170 148
     if (str) {
171 149
       reset();

+ 5
- 2
Marlin/src/feature/twibus.h View File

@@ -223,7 +223,6 @@ class TWIBus {
223 223
     #endif
224 224
 
225 225
     #if ENABLED(DEBUG_TWIBUS)
226
-
227 226
       /**
228 227
        * @brief Prints a debug message
229 228
        * @details Prints a simple debug message "TWIBus::function: value"
@@ -233,6 +232,10 @@ class TWIBus {
233 232
       static void debug(const char func[], char c);
234 233
       static void debug(const char func[], char adr[]);
235 234
       static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); }
236
-
235
+    #else
236
+      static inline void debug(const char[], uint32_t) {}
237
+      static inline void debug(const char[], char) {}
238
+      static inline void debug(const char[], char[]) {}
239
+      static inline void debug(const char[], uint8_t) {}
237 240
     #endif
238 241
 };

+ 8
- 12
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -255,28 +255,28 @@ void GcodeSuite::G28() {
255 255
   #define HAS_HOMING_CURRENT (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2))
256 256
 
257 257
   #if HAS_HOMING_CURRENT
258
-    auto debug_current = [](const char * const s, const int16_t a, const int16_t b){
259
-      DEBUG_ECHO(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
258
+    auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){
259
+      serialprintPGM(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
260 260
     };
261 261
     #if HAS_CURRENT_HOME(X)
262 262
       const int16_t tmc_save_current_X = stepperX.getMilliamps();
263 263
       stepperX.rms_current(X_CURRENT_HOME);
264
-      if (DEBUGGING(LEVELING)) debug_current("X", tmc_save_current_X, X_CURRENT_HOME);
264
+      if (DEBUGGING(LEVELING)) debug_current(PSTR("X"), tmc_save_current_X, X_CURRENT_HOME);
265 265
     #endif
266 266
     #if HAS_CURRENT_HOME(X2)
267 267
       const int16_t tmc_save_current_X2 = stepperX2.getMilliamps();
268 268
       stepperX2.rms_current(X2_CURRENT_HOME);
269
-      if (DEBUGGING(LEVELING)) debug_current("X2", tmc_save_current_X2, X2_CURRENT_HOME);
269
+      if (DEBUGGING(LEVELING)) debug_current(PSTR("X2"), tmc_save_current_X2, X2_CURRENT_HOME);
270 270
     #endif
271 271
     #if HAS_CURRENT_HOME(Y)
272 272
       const int16_t tmc_save_current_Y = stepperY.getMilliamps();
273 273
       stepperY.rms_current(Y_CURRENT_HOME);
274
-      if (DEBUGGING(LEVELING)) debug_current("Y", tmc_save_current_Y, Y_CURRENT_HOME);
274
+      if (DEBUGGING(LEVELING)) debug_current(PSTR("Y"), tmc_save_current_Y, Y_CURRENT_HOME);
275 275
     #endif
276 276
     #if HAS_CURRENT_HOME(Y2)
277 277
       const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps();
278 278
       stepperY2.rms_current(Y2_CURRENT_HOME);
279
-      if (DEBUGGING(LEVELING)) debug_current("Y2", tmc_save_current_Y2, Y2_CURRENT_HOME);
279
+      if (DEBUGGING(LEVELING)) debug_current(PSTR("Y2"), tmc_save_current_Y2, Y2_CURRENT_HOME);
280 280
     #endif
281 281
   #endif
282 282
 
@@ -345,12 +345,8 @@ void GcodeSuite::G28() {
345 345
     #endif
346 346
 
347 347
     // Home Y (before X)
348
-    #if ENABLED(HOME_Y_BEFORE_X)
349
-
350
-      if (doY || (doX && ENABLED(CODEPENDENT_XY_HOMING)))
351
-        homeaxis(Y_AXIS);
352
-
353
-    #endif
348
+    if (ENABLED(HOME_Y_BEFORE_X) && (doY || (ENABLED(CODEPENDENT_XY_HOMING) && doX)))
349
+      homeaxis(Y_AXIS);
354 350
 
355 351
     // Home X
356 352
     if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) {

+ 85
- 59
Marlin/src/gcode/calibrate/G425.cpp View File

@@ -37,6 +37,21 @@
37 37
 #include "../../module/endstops.h"
38 38
 #include "../../feature/bedlevel/bedlevel.h"
39 39
 
40
+#if !AXIS_CAN_CALIBRATE(X)
41
+  #undef CALIBRATION_MEASURE_LEFT
42
+  #undef CALIBRATION_MEASURE_RIGHT
43
+#endif
44
+
45
+#if !AXIS_CAN_CALIBRATE(Y)
46
+  #undef CALIBRATION_MEASURE_FRONT
47
+  #undef CALIBRATION_MEASURE_BACK
48
+#endif
49
+
50
+#if !AXIS_CAN_CALIBRATE(Z)
51
+  #undef CALIBRATION_MEASURE_AT_TOP_EDGES
52
+#endif
53
+
54
+
40 55
 /**
41 56
  * G425 backs away from the calibration object by various distances
42 57
  * depending on the confidence level:
@@ -207,42 +222,52 @@ inline float measure(const AxisEnum axis, const int dir, const bool stop_state,
207 222
 inline void probe_side(measurements_t &m, const float uncertainty, const side_t side, const bool probe_top_at_edge=false) {
208 223
   const xyz_float_t dimensions = CALIBRATION_OBJECT_DIMENSIONS;
209 224
   AxisEnum axis;
210
-  float dir;
225
+  float dir = 1;
211 226
 
212 227
   park_above_object(m, uncertainty);
213 228
 
214 229
   switch (side) {
215
-    case TOP: {
216
-      const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
217
-      m.obj_center.z = measurement - dimensions.z / 2;
218
-      m.obj_side[TOP] = measurement;
219
-      return;
220
-    }
221
-    case RIGHT: axis = X_AXIS; dir = -1; break;
222
-    case FRONT: axis = Y_AXIS; dir =  1; break;
223
-    case LEFT:  axis = X_AXIS; dir =  1; break;
224
-    case BACK:  axis = Y_AXIS; dir = -1; break;
230
+    #if AXIS_CAN_CALIBRATE(Z)
231
+      case TOP: {
232
+        const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
233
+        m.obj_center.z = measurement - dimensions.z / 2;
234
+        m.obj_side[TOP] = measurement;
235
+        return;
236
+      }
237
+    #endif
238
+    #if AXIS_CAN_CALIBRATE(X)
239
+      case LEFT:  axis = X_AXIS; break;
240
+      case RIGHT: axis = X_AXIS; dir = -1; break;
241
+    #endif
242
+    #if AXIS_CAN_CALIBRATE(Y)
243
+      case FRONT: axis = Y_AXIS; break;
244
+      case BACK:  axis = Y_AXIS; dir = -1; break;
245
+    #endif
225 246
     default: return;
226 247
   }
227 248
 
228 249
   if (probe_top_at_edge) {
229
-    // Probe top nearest the side we are probing
230
-    current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]);
231
-    calibration_move();
232
-    m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
233
-    m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2;
250
+    #if AXIS_CAN_CALIBRATE(Z)
251
+      // Probe top nearest the side we are probing
252
+      current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]);
253
+      calibration_move();
254
+      m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
255
+      m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2;
256
+    #endif
234 257
   }
235 258
 
236
-  // Move to safe distance to the side of the calibration object
237
-  current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty);
238
-  calibration_move();
259
+  if (AXIS_CAN_CALIBRATE(X) && axis == X_AXIS || AXIS_CAN_CALIBRATE(Y) && axis == Y_AXIS) {
260
+    // Move to safe distance to the side of the calibration object
261
+    current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty);
262
+    calibration_move();
239 263
 
240
-  // Plunge below the side of the calibration object and measure
241
-  current_position.z = m.obj_side[TOP] - CALIBRATION_NOZZLE_TIP_HEIGHT * 0.7;
242
-  calibration_move();
243
-  const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty);
244
-  m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2);
245
-  m.obj_side[side] = measurement;
264
+    // Plunge below the side of the calibration object and measure
265
+    current_position.z = m.obj_side[TOP] - (CALIBRATION_NOZZLE_TIP_HEIGHT) * 0.7f;
266
+    calibration_move();
267
+    const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty);
268
+    m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2);
269
+    m.obj_side[side] = measurement;
270
+  }
246 271
 }
247 272
 
248 273
 /**
@@ -252,7 +277,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
252 277
  *   uncertainty        in     - How far away from the calibration object to begin probing
253 278
  */
254 279
 inline void probe_sides(measurements_t &m, const float uncertainty) {
255
-  #ifdef CALIBRATION_MEASURE_AT_TOP_EDGES
280
+  #if ENABLED(CALIBRATION_MEASURE_AT_TOP_EDGES)
256 281
     constexpr bool probe_top_at_edge = true;
257 282
   #else
258 283
     // Probing at the exact center only works if the center is flat. Probing on a washer
@@ -261,18 +286,18 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
261 286
     probe_side(m, uncertainty, TOP);
262 287
   #endif
263 288
 
264
-  #ifdef CALIBRATION_MEASURE_RIGHT
289
+  #if ENABLED(CALIBRATION_MEASURE_RIGHT)
265 290
     probe_side(m, uncertainty, RIGHT, probe_top_at_edge);
266 291
   #endif
267 292
 
268
-  #ifdef CALIBRATION_MEASURE_FRONT
293
+  #if ENABLED(CALIBRATION_MEASURE_FRONT)
269 294
     probe_side(m, uncertainty, FRONT, probe_top_at_edge);
270 295
   #endif
271 296
 
272
-  #ifdef CALIBRATION_MEASURE_LEFT
297
+  #if ENABLED(CALIBRATION_MEASURE_LEFT)
273 298
     probe_side(m, uncertainty, LEFT,  probe_top_at_edge);
274 299
   #endif
275
-  #ifdef CALIBRATION_MEASURE_BACK
300
+  #if ENABLED(CALIBRATION_MEASURE_BACK)
276 301
     probe_side(m, uncertainty, BACK,  probe_top_at_edge);
277 302
   #endif
278 303
 
@@ -313,7 +338,9 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
313 338
 #if ENABLED(CALIBRATION_REPORTING)
314 339
   inline void report_measured_faces(const measurements_t &m) {
315 340
     SERIAL_ECHOLNPGM("Sides:");
316
-    SERIAL_ECHOLNPAIR("  Top: ", m.obj_side[TOP]);
341
+    #if AXIS_CAN_CALIBRATE(Z)
342
+      SERIAL_ECHOLNPAIR("  Top: ", m.obj_side[TOP]);
343
+    #endif
317 344
     #if ENABLED(CALIBRATION_MEASURE_LEFT)
318 345
       SERIAL_ECHOLNPAIR("  Left: ", m.obj_side[LEFT]);
319 346
     #endif
@@ -343,19 +370,25 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
343 370
 
344 371
   inline void report_measured_backlash(const measurements_t &m) {
345 372
     SERIAL_ECHOLNPGM("Backlash:");
346
-    #if ENABLED(CALIBRATION_MEASURE_LEFT)
347
-      SERIAL_ECHOLNPAIR("  Left: ", m.backlash[LEFT]);
348
-    #endif
349
-    #if ENABLED(CALIBRATION_MEASURE_RIGHT)
350
-      SERIAL_ECHOLNPAIR("  Right: ", m.backlash[RIGHT]);
373
+    #if AXIS_CAN_CALIBRATE(X)
374
+      #if ENABLED(CALIBRATION_MEASURE_LEFT)
375
+        SERIAL_ECHOLNPAIR("  Left: ", m.backlash[LEFT]);
376
+      #endif
377
+      #if ENABLED(CALIBRATION_MEASURE_RIGHT)
378
+        SERIAL_ECHOLNPAIR("  Right: ", m.backlash[RIGHT]);
379
+      #endif
351 380
     #endif
352
-    #if ENABLED(CALIBRATION_MEASURE_FRONT)
353
-      SERIAL_ECHOLNPAIR("  Front: ", m.backlash[FRONT]);
381
+    #if AXIS_CAN_CALIBRATE(Y)
382
+      #if ENABLED(CALIBRATION_MEASURE_FRONT)
383
+        SERIAL_ECHOLNPAIR("  Front: ", m.backlash[FRONT]);
384
+      #endif
385
+      #if ENABLED(CALIBRATION_MEASURE_BACK)
386
+        SERIAL_ECHOLNPAIR("  Back: ", m.backlash[BACK]);
387
+      #endif
354 388
     #endif
355
-    #if ENABLED(CALIBRATION_MEASURE_BACK)
356
-      SERIAL_ECHOLNPAIR("  Back: ", m.backlash[BACK]);
389
+    #if AXIS_CAN_CALIBRATE(Z)
390
+      SERIAL_ECHOLNPAIR("  Top: ", m.backlash[TOP]);
357 391
     #endif
358
-    SERIAL_ECHOLNPAIR("  Top: ", m.backlash[TOP]);
359 392
     SERIAL_EOL();
360 393
   }
361 394
 
@@ -369,7 +402,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
369 402
     #if HAS_Y_CENTER
370 403
       SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y);
371 404
     #endif
372
-    SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
405
+    if (AXIS_CAN_CALIBRATE(Z)) SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
373 406
     SERIAL_EOL();
374 407
   }
375 408
 
@@ -417,6 +450,7 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
417 450
     probe_sides(m, uncertainty);
418 451
 
419 452
     #if ENABLED(BACKLASH_GCODE)
453
+
420 454
       #if HAS_X_CENTER
421 455
         backlash.distance_mm.x = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2;
422 456
       #elif ENABLED(CALIBRATION_MEASURE_LEFT)
@@ -433,18 +467,18 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
433 467
         backlash.distance_mm.y = m.backlash[BACK];
434 468
       #endif
435 469
 
436
-      backlash.distance_mm.z = m.backlash[TOP];
470
+      if (AXIS_CAN_CALIBRATE(Z)) backlash.distance_mm.z = m.backlash[TOP];
437 471
     #endif
438 472
   }
439 473
 
440 474
   #if ENABLED(BACKLASH_GCODE)
441 475
     // Turn on backlash compensation and move in all
442
-    // directions to take up any backlash
476
+    // allowed directions to take up any backlash
443 477
     {
444 478
       // New scope for TEMPORARY_BACKLASH_CORRECTION
445 479
       TEMPORARY_BACKLASH_CORRECTION(all_on);
446 480
       TEMPORARY_BACKLASH_SMOOTHING(0.0f);
447
-      const xyz_float_t move = { 3, 3, 3 };
481
+      const xyz_float_t move = { AXIS_CAN_CALIBRATE(X) * 3, AXIS_CAN_CALIBRATE(Y) * 3, AXIS_CAN_CALIBRATE(Z) * 3 };
448 482
       current_position += move; calibration_move();
449 483
       current_position -= move; calibration_move();
450 484
     }
@@ -482,26 +516,18 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const
482 516
 
483 517
   // Adjust the hotend offset
484 518
   #if HAS_HOTEND_OFFSET
485
-    #if HAS_X_CENTER
486
-      hotend_offset[extruder].x += m.pos_error.x;
487
-    #endif
488
-    #if HAS_Y_CENTER
489
-      hotend_offset[extruder].y += m.pos_error.y;
490
-    #endif
491
-    hotend_offset[extruder].z += m.pos_error.z;
519
+    if (ENABLED(HAS_X_CENTER) && AXIS_CAN_CALIBRATE(X)) hotend_offset[extruder].x += m.pos_error.x;
520
+    if (ENABLED(HAS_Y_CENTER) && AXIS_CAN_CALIBRATE(Y)) hotend_offset[extruder].y += m.pos_error.y;
521
+                             if (AXIS_CAN_CALIBRATE(Z)) hotend_offset[extruder].z += m.pos_error.z;
492 522
     normalize_hotend_offsets();
493 523
   #endif
494 524
 
495 525
   // Correct for positional error, so the object
496 526
   // is at the known actual spot
497 527
   planner.synchronize();
498
-  #if HAS_X_CENTER
499
-    update_measurements(m, X_AXIS);
500
-  #endif
501
-  #if HAS_Y_CENTER
502
-    update_measurements(m, Y_AXIS);
503
-  #endif
504
-  update_measurements(m, Z_AXIS);
528
+  if (ENABLED(HAS_X_CENTER) && AXIS_CAN_CALIBRATE(X)) update_measurements(m, X_AXIS);
529
+  if (ENABLED(HAS_Y_CENTER) && AXIS_CAN_CALIBRATE(Y)) update_measurements(m, Y_AXIS);
530
+                           if (AXIS_CAN_CALIBRATE(Z)) update_measurements(m, Z_AXIS);
505 531
 
506 532
   sync_plan_position();
507 533
 }

+ 3
- 3
Marlin/src/gcode/calibrate/M425.cpp View File

@@ -47,7 +47,7 @@ void GcodeSuite::M425() {
47 47
   bool noArgs = true;
48 48
 
49 49
   LOOP_XYZ(a) {
50
-    if (parser.seen(XYZ_CHAR(a))) {
50
+    if (CAN_CALIBRATE(a) && parser.seen(XYZ_CHAR(a))) {
51 51
       planner.synchronize();
52 52
       backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a));
53 53
       noArgs = false;
@@ -74,7 +74,7 @@ void GcodeSuite::M425() {
74 74
     SERIAL_ECHOLNPGM("active:");
75 75
     SERIAL_ECHOLNPAIR("  Correction Amount/Fade-out:     F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
76 76
     SERIAL_ECHOPGM("  Backlash Distance (mm):        ");
77
-    LOOP_XYZ(a) {
77
+    LOOP_XYZ(a) if (CAN_CALIBRATE(a)) {
78 78
       SERIAL_CHAR(' ', XYZ_CHAR(a));
79 79
       SERIAL_ECHO(backlash.distance_mm[a]);
80 80
       SERIAL_EOL();
@@ -87,7 +87,7 @@ void GcodeSuite::M425() {
87 87
     #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
88 88
       SERIAL_ECHOPGM("  Average measured backlash (mm):");
89 89
       if (backlash.has_any_measurement()) {
90
-        LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) {
90
+        LOOP_XYZ(a) if (CAN_CALIBRATE(a) && backlash.has_measurement(AxisEnum(a))) {
91 91
           SERIAL_CHAR(' ', XYZ_CHAR(a));
92 92
           SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
93 93
         }

+ 10
- 2
Marlin/src/gcode/config/M43.cpp View File

@@ -67,7 +67,11 @@ inline void toggle_pins() {
67 67
     else {
68 68
       watchdog_refresh();
69 69
       report_pin_state_extended(pin, ignore_protection, true, PSTR("Pulsing   "));
70
-      const bool prior_mode = GET_PINMODE(pin);
70
+      #ifdef __STM32F1__
71
+        const auto prior_mode = _GET_MODE(i);
72
+      #else
73
+        const bool prior_mode = GET_PINMODE(pin);
74
+      #endif
71 75
       #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
72 76
         if (pin == TEENSY_E2) {
73 77
           SET_OUTPUT(TEENSY_E2);
@@ -96,7 +100,11 @@ inline void toggle_pins() {
96 100
           watchdog_refresh();
97 101
         }
98 102
       }
99
-      pinMode(pin, prior_mode);
103
+      #ifdef __STM32F1__
104
+        _SET_MODE(i, prior_mode);
105
+      #else
106
+        pinMode(pin, prior_mode);
107
+      #endif
100 108
     }
101 109
     SERIAL_EOL();
102 110
   }

+ 2
- 8
Marlin/src/gcode/feature/camera/M240.cpp View File

@@ -48,14 +48,8 @@
48 48
 
49 49
   #ifdef PHOTO_RETRACT_MM
50 50
     inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) {
51
-      if (length && thermalManager.hotEnoughToExtrude(active_extruder)) {
52
-        #if ENABLED(ADVANCED_PAUSE_FEATURE)
53
-          do_pause_e_move(length, fr_mm_s);
54
-        #else
55
-          current_position.e += length / planner.e_factor[active_extruder];
56
-          line_to_current_position(fr_mm_s);
57
-        #endif
58
-      }
51
+      if (length && thermalManager.hotEnoughToExtrude(active_extruder))
52
+        unscaled_e_move(length, fr_mm_s);
59 53
     }
60 54
   #endif
61 55
 

+ 1
- 1
Marlin/src/gcode/feature/powerloss/M1000.cpp View File

@@ -63,7 +63,7 @@ void GcodeSuite::M1000() {
63 63
       #if HAS_LCD_MENU
64 64
         ui.goto_screen(menu_job_recovery);
65 65
       #elif ENABLED(EXTENSIBLE_UI)
66
-        ExtUI::OnPowerLossResume();
66
+        ExtUI::onPowerLossResume();
67 67
       #else
68 68
         SERIAL_ECHO_MSG("Resume requires LCD.");
69 69
       #endif

+ 5
- 1
Marlin/src/gcode/gcode.cpp View File

@@ -857,7 +857,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
857 857
 
858 858
       #if ENABLED(POWER_LOSS_RECOVERY)
859 859
         case 413: M413(); break;                                  // M413: Enable/disable/query Power-Loss Recovery
860
-        case 1000: M1000(); break;                                // M1000: Resume from power-loss
860
+        case 1000: M1000(); break;                                // M1000: [INTERNAL] Resume from power-loss
861
+      #endif
862
+
863
+      #if ENABLED(SDSUPPORT)
864
+        case 1001: M1001(); break;                                // M1001: [INTERNAL] Handle SD completion
861 865
       #endif
862 866
 
863 867
       #if ENABLED(MAX7219_GCODE)

+ 4
- 0
Marlin/src/gcode/gcode.h View File

@@ -968,6 +968,10 @@ private:
968 968
     static void M1000();
969 969
   #endif
970 970
 
971
+  #if ENABLED(SDSUPPORT)
972
+    static void M1001();
973
+  #endif
974
+
971 975
   #if ENABLED(MAX7219_GCODE)
972 976
     static void M7219();
973 977
   #endif

+ 8
- 29
Marlin/src/gcode/lcd/M0_M1.cpp View File

@@ -24,23 +24,19 @@
24 24
 
25 25
 #if HAS_RESUME_CONTINUE
26 26
 
27
+#include "../../inc/MarlinConfig.h"
28
+
27 29
 #include "../gcode.h"
28
-#include "../../module/planner.h"
29 30
 
30
-#include "../../inc/MarlinConfig.h"
31
+#include "../../module/planner.h" // for synchronize()
32
+#include "../../MarlinCore.h"     // for wait_for_user_response()
31 33
 
32 34
 #if HAS_LCD_MENU
33 35
   #include "../../lcd/ultralcd.h"
34
-#endif
35
-
36
-#if ENABLED(EXTENSIBLE_UI)
36
+#elif ENABLED(EXTENSIBLE_UI)
37 37
   #include "../../lcd/extui/ui_api.h"
38 38
 #endif
39 39
 
40
-#if HAS_LEDS_OFF_FLAG
41
-  #include "../../feature/leds/printer_event_leds.h"
42
-#endif
43
-
44 40
 #if ENABLED(HOST_PROMPT_SUPPORT)
45 41
   #include "../../feature/host_actions.h"
46 42
 #endif
@@ -56,16 +52,11 @@ void GcodeSuite::M0_M1() {
56 52
 
57 53
   planner.synchronize();
58 54
 
59
-  const bool seenQ = parser.seen('Q');
60
-  #if HAS_LEDS_OFF_FLAG
61
-    if (seenQ) printerEventLEDs.onPrintCompleted();      // Change LED color for Print Completed
62
-  #endif
63
-
64 55
   #if HAS_LCD_MENU
65 56
 
66 57
     if (parser.string_arg)
67 58
       ui.set_status(parser.string_arg, true);
68
-    else if (!seenQ) {
59
+    else {
69 60
       LCD_MESSAGEPGM(MSG_USERWAIT);
70 61
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
71 62
         ui.reset_progress_bar_timeout();
@@ -73,12 +64,10 @@ void GcodeSuite::M0_M1() {
73 64
     }
74 65
 
75 66
   #elif ENABLED(EXTENSIBLE_UI)
76
-
77 67
     if (parser.string_arg)
78 68
       ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
79 69
     else
80 70
       ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
81
-
82 71
   #else
83 72
 
84 73
     if (parser.string_arg) {
@@ -88,25 +77,15 @@ void GcodeSuite::M0_M1() {
88 77
 
89 78
   #endif
90 79
 
91
-  KEEPALIVE_STATE(PAUSED_FOR_USER);
92
-  wait_for_user = true;
93
-
94 80
   #if ENABLED(HOST_PROMPT_SUPPORT)
95 81
     host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
96 82
   #endif
97 83
 
98
-  if (ms > 0) ms += millis();  // wait until this time for a click
99
-  while (wait_for_user && (ms == 0 || PENDING(millis(), ms))) idle();
100
-
101
-  #if HAS_LEDS_OFF_FLAG
102
-    printerEventLEDs.onResumeAfterWait();
103
-  #endif
84
+  wait_for_user_response(ms);
104 85
 
105 86
   #if HAS_LCD_MENU
106
-    if (!seenQ) ui.reset_status();
87
+    ui.reset_status();
107 88
   #endif
108
-
109
-  wait_for_user = false;
110 89
 }
111 90
 
112 91
 #endif // HAS_RESUME_CONTINUE

+ 1
- 1
Marlin/src/gcode/motion/G2_G3.cpp View File

@@ -236,7 +236,7 @@ void plan_arc(
236 236
     planner.apply_leveling(raw);
237 237
   #endif
238 238
 
239
-  planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, seg_length
239
+  planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0
240 240
     #if ENABLED(SCARA_FEEDRATE_SCALING)
241 241
       , inv_duration
242 242
     #endif

+ 109
- 0
Marlin/src/gcode/sd/M1001.cpp View File

@@ -0,0 +1,109 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(SDSUPPORT)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/printcounter.h"
29
+
30
+#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
31
+  #include "../../lcd/ultralcd.h"
32
+#endif
33
+
34
+#if ENABLED(POWER_LOSS_RECOVERY)
35
+  #include "../../feature/powerloss.h"
36
+#endif
37
+
38
+#if HAS_LEDS_OFF_FLAG
39
+  #include "../../feature/leds/printer_event_leds.h"
40
+#endif
41
+
42
+#if ENABLED(EXTENSIBLE_UI)
43
+  #include "../../lcd/extui/ui_api.h"
44
+#endif
45
+
46
+#if ENABLED(HOST_ACTION_COMMANDS)
47
+  #include "../../feature/host_actions.h"
48
+#endif
49
+
50
+#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
51
+  #include "../../module/planner.h"
52
+#endif
53
+
54
+#ifndef PE_LEDS_COMPLETED_TIME
55
+  #define PE_LEDS_COMPLETED_TIME (30*60)
56
+#endif
57
+
58
+/**
59
+ * M1001: Execute actions for SD print completion
60
+ */
61
+void GcodeSuite::M1001() {
62
+
63
+  // Report total print time
64
+  const bool long_print = print_job_timer.duration() > 60;
65
+  if (long_print) gcode.process_subcommands_now_P(PSTR("M31"));
66
+
67
+  // Stop the print job timer
68
+  gcode.process_subcommands_now_P(PSTR("M77"));
69
+
70
+  // Set the progress bar "done" state
71
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
72
+    ui.set_progress_done();
73
+  #endif
74
+
75
+  // Purge the recovery file
76
+  #if ENABLED(POWER_LOSS_RECOVERY)
77
+    recovery.purge();
78
+  #endif
79
+
80
+  // Announce SD file completion
81
+  SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
82
+
83
+  // Update the status LED color
84
+  #if HAS_LEDS_OFF_FLAG
85
+    if (long_print) {
86
+      printerEventLEDs.onPrintCompleted();
87
+      #if ENABLED(EXTENSIBLE_UI)
88
+        ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE));
89
+      #endif
90
+      #if ENABLED(HOST_PROMPT_SUPPORT)
91
+        host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR);
92
+      #endif
93
+      wait_for_user_response(1000UL * TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30));
94
+      printerEventLEDs.onResumeAfterWait();
95
+    }
96
+  #endif
97
+
98
+  // Wait for the queue to empty (and "clean"), inject SD_FINISHED_RELEASECOMMAND
99
+  #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
100
+    planner.finish_and_disable();
101
+  #endif
102
+
103
+  // Re-select the last printed file in the UI
104
+  #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
105
+    ui.reselect_last_file();
106
+  #endif
107
+}
108
+
109
+#endif // SDSUPPORT

+ 24
- 5
Marlin/src/gcode/temp/M303.cpp View File

@@ -34,12 +34,31 @@
34 34
 /**
35 35
  * M303: PID relay autotune
36 36
  *
37
- *       S<temperature> sets the target temperature. (default 150C / 70C)
38
- *       E<extruder> (-1 for the bed) (default 0)
39
- *       C<cycles> Minimum 3. Default 5.
40
- *       U<bool> with a non-zero value will apply the result to current settings
37
+ *  S<temperature>  Set the target temperature. (Default: 150C / 70C)
38
+ *  E<extruder>     Extruder number to tune, or -1 for the bed. (Default: E0)
39
+ *  C<cycles>       Number of times to repeat the procedure. (Minimum: 3, Default: 5)
40
+ *  U<bool>         Flag to apply the result to the current PID values
41
+ *
42
+ * With PID_DEBUG:
43
+ *  D               Toggle PID debugging and EXIT without further action.
41 44
  */
45
+
46
+#if ENABLED(PID_DEBUG)
47
+  bool pid_debug_flag = 0;
48
+#endif
49
+
42 50
 void GcodeSuite::M303() {
51
+
52
+  #if ENABLED(PID_DEBUG)
53
+    if (parser.seen('D')) {
54
+      pid_debug_flag = !pid_debug_flag;
55
+      SERIAL_ECHO_START();
56
+      SERIAL_ECHOPGM("PID Debug ");
57
+      serialprintln_onoff(pid_debug_flag);
58
+      return;
59
+    }
60
+  #endif
61
+
43 62
   #if ENABLED(PIDTEMPBED)
44 63
     #define SI H_BED
45 64
   #else
@@ -54,7 +73,7 @@ void GcodeSuite::M303() {
54 73
   if (!WITHIN(e, SI, EI)) {
55 74
     SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM);
56 75
     #if ENABLED(EXTENSIBLE_UI)
57
-      ExtUI::OnPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM);
76
+      ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM);
58 77
     #endif
59 78
     return;
60 79
   }

+ 1
- 1
Marlin/src/inc/Conditionals_adv.h View File

@@ -93,7 +93,7 @@
93 93
 #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
94 94
   #define HAS_SOFTWARE_ENDSTOPS 1
95 95
 #endif
96
-#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER)
96
+#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS)
97 97
   #define HAS_RESUME_CONTINUE 1
98 98
 #endif
99 99
 

+ 20
- 4
Marlin/src/inc/Conditionals_post.h View File

@@ -35,16 +35,19 @@
35 35
   #define HAS_LINEAR_E_JERK 1
36 36
 #endif
37 37
 
38
-// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
38
+// Determine which type of 'EEPROM' is in use
39 39
 #if ENABLED(EEPROM_SETTINGS)
40
-  #if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && EITHER(I2C_EEPROM, SPI_EEPROM)
41
-    #define USE_REAL_EEPROM 1
40
+  // EEPROM type may be defined by compile flags, configs, HALs, or pins
41
+  // Set additional flags to let HALs choose in their Conditionals_post.h
42
+  #if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && ANY(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM)
43
+    #define USE_WIRED_EEPROM    1
42 44
   #else
43
-    #define USE_EMULATED_EEPROM 1
45
+    #define USE_FALLBACK_EEPROM 1
44 46
   #endif
45 47
 #else
46 48
   #undef I2C_EEPROM
47 49
   #undef SPI_EEPROM
50
+  #undef QSPI_EEPROM
48 51
   #undef SDCARD_EEPROM_EMULATION
49 52
   #undef SRAM_EEPROM_EMULATION
50 53
   #undef FLASH_EEPROM_EMULATION
@@ -136,6 +139,19 @@
136 139
   #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n))
137 140
 #endif
138 141
 
142
+// Calibration codes only for non-core axes
143
+#if EITHER(BACKLASH_GCODE, CALIBRATION_GCODE)
144
+  #if IS_CORE
145
+    #define X_AXIS_INDEX 0
146
+    #define Y_AXIS_INDEX 1
147
+    #define Z_AXIS_INDEX 2
148
+    #define CAN_CALIBRATE(A,B) (A##_AXIS_INDEX == B##_INDEX)
149
+  #else
150
+    #define CAN_CALIBRATE(...) 1
151
+  #endif
152
+#endif
153
+#define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS)
154
+
139 155
 /**
140 156
  * No adjustable bed on non-cartesians
141 157
  */

+ 2
- 1
Marlin/src/inc/MarlinConfig.h View File

@@ -35,11 +35,12 @@
35 35
 #include "Conditionals_post.h"
36 36
 #include HAL_PATH(../HAL, inc/Conditionals_post.h)
37 37
 
38
+#include "../core/types.h"  // Ahead of sanity-checks
39
+
38 40
 #include "SanityCheck.h"
39 41
 #include HAL_PATH(../HAL, inc/SanityCheck.h)
40 42
 
41 43
 // Include all core headers
42
-#include "../core/types.h"
43 44
 #include "../core/language.h"
44 45
 #include "../core/utility.h"
45 46
 #include "../core/serial.h"

+ 1
- 1
Marlin/src/inc/Version.h View File

@@ -42,7 +42,7 @@
42 42
  * version was tagged.
43 43
  */
44 44
 #ifndef STRING_DISTRIBUTION_DATE
45
-  #define STRING_DISTRIBUTION_DATE "2020-03-24"
45
+  #define STRING_DISTRIBUTION_DATE "2020-03-31"
46 46
 #endif
47 47
 
48 48
 /**

+ 11
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp View File

@@ -38,6 +38,11 @@ namespace FTDI {
38 38
     SET_OUTPUT(CLCD_SPI_CS);
39 39
     WRITE(CLCD_SPI_CS, 1);
40 40
 
41
+    #ifdef CLCD_SPI_EXTRA_CS
42
+      SET_OUTPUT(CLCD_SPI_EXTRA_CS);
43
+      WRITE(CLCD_SPI_EXTRA_CS, 1);
44
+    #endif
45
+
41 46
     #ifdef SPI_FLASH_SS
42 47
       SET_OUTPUT(SPI_FLASH_SS);
43 48
       WRITE(SPI_FLASH_SS, 1);
@@ -111,12 +116,18 @@ namespace FTDI {
111 116
       ::SPI.beginTransaction(spi_settings);
112 117
     #endif
113 118
     WRITE(CLCD_SPI_CS, 0);
119
+    #ifdef CLCD_SPI_EXTRA_CS
120
+      WRITE(CLCD_SPI_EXTRA_CS, 0);
121
+    #endif
114 122
     delayMicroseconds(1);
115 123
   }
116 124
 
117 125
   // CLCD SPI - Chip Deselect
118 126
   void SPI::spi_ftdi_deselect() {
119 127
     WRITE(CLCD_SPI_CS, 1);
128
+    #ifdef CLCD_SPI_EXTRA_CS
129
+      WRITE(CLCD_SPI_EXTRA_CS, 1);
130
+    #endif
120 131
     #ifndef CLCD_USE_SOFT_SPI
121 132
       ::SPI.endTransaction();
122 133
     #endif

+ 11
- 10
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h View File

@@ -176,11 +176,12 @@
176 176
     #undef MAKE_ARDUINO_PINS
177 177
   } // namespace fast_io
178 178
 
179
-  #define SET_INPUT(pin)               fast_io::pin::set_input()
180
-  #define SET_INPUT_PULLUP(pin)        fast_io::pin::set_input(); fast_io::pin::set_high()
181
-  #define SET_OUTPUT(pin)              fast_io::pin::set_output()
182
-  #define READ(pin)                    fast_io::pin::read()
183
-  #define WRITE(pin, value)            fast_io::pin::write(value)
179
+  #define SET_INPUT(pin)              fast_io::pin::set_input()
180
+  #define SET_INPUT_PULLUP(pin)       do{ fast_io::pin::set_input(); fast_io::pin::set_high(); }while(0)
181
+  #define SET_INPUT_PULLDOWN          SET_INPUT
182
+  #define SET_OUTPUT(pin)             fast_io::pin::set_output()
183
+  #define READ(pin)                   fast_io::pin::read()
184
+  #define WRITE(pin, value)           fast_io::pin::write(value)
184 185
 
185 186
   #ifndef pgm_read_word_far
186 187
   #define pgm_read_word_far pgm_read_word
@@ -195,11 +196,11 @@
195 196
   #endif
196 197
 
197 198
   #define SERIAL_ECHO_START()
198
-  #define SERIAL_ECHOLNPGM(str)        Serial.println(F(str))
199
-  #define SERIAL_ECHOPGM(str)          Serial.print(F(str))
200
-  #define SERIAL_ECHO_MSG(str)         Serial.println(str)
201
-  #define SERIAL_ECHOLNPAIR(str, val) {Serial.print(F(str)); Serial.println(val);}
202
-  #define SERIAL_ECHOPAIR(str, val)   {Serial.print(F(str)); Serial.print(val);}
199
+  #define SERIAL_ECHOLNPGM(str)       Serial.println(F(str))
200
+  #define SERIAL_ECHOPGM(str)         Serial.print(F(str))
201
+  #define SERIAL_ECHO_MSG(str)        Serial.println(str)
202
+  #define SERIAL_ECHOLNPAIR(str, val) do{ Serial.print(F(str)); Serial.println(val); }while(0)
203
+  #define SERIAL_ECHOPAIR(str, val)   do{ Serial.print(F(str)); Serial.print(val); }while(0)
203 204
 
204 205
   #define safe_delay delay
205 206
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp View File

@@ -191,7 +191,7 @@ namespace FTDI {
191 191
 
192 192
             #if ENABLED(TOUCH_UI_DEBUG)
193 193
               SERIAL_ECHO_START();
194
-              SERIAL_ECHOLNPAIR("Touch end: ", tag);
194
+              SERIAL_ECHOLNPAIR("Touch end: ", pressed_tag);
195 195
             #endif
196 196
 
197 197
             const uint8_t saved_pressed_tag = pressed_tag;

+ 8
- 6
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h View File

@@ -70,13 +70,15 @@ namespace Language_en {
70 70
   PROGMEM Language_Str MSG_PRINT_FINISHED           = u8"Print finished";
71 71
   PROGMEM Language_Str MSG_PRINT_ERROR              = u8"Print error";
72 72
   PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1      = u8"Color Touch Panel";
73
-  PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2      = u8"Portions " COPYRIGHT_SIGN " 2019 Aleph Objects, Inc.\n"
74
-                                                        "Portions " COPYRIGHT_SIGN " 2019 Cocoa Press";
75
-  PROGMEM Language_Str MSG_FIRMWARE_FOR_TOOLHEAD    = u8"Firmware for toolhead:\n%s\n\n";
73
+  PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2      = WEBSITE_URL;
74
+  PROGMEM Language_Str MSG_LICENSE                  = u8"This program is free software: you can redistribute it and/or modify it under the terms of "
75
+                                                        "the GNU General Public License as published by the Free Software Foundation, either version 3 "
76
+                                                        "of the License, or (at your option) any later version.\n\nTo view a copy of the GNU General "
77
+                                                        "Public License, go to the following location: http://www.gnu.org/licenses.";
76 78
   PROGMEM Language_Str MSG_RUNOUT_1                 = u8"Runout 1";
77 79
   PROGMEM Language_Str MSG_RUNOUT_2                 = u8"Runout 2";
78 80
   PROGMEM Language_Str MSG_DISPLAY_MENU             = u8"Display";
79
-  PROGMEM Language_Str MSG_INTERFACE_SETTINGS       = u8"Interface Settings";
81
+  PROGMEM Language_Str MSG_INTERFACE                = u8"Interface";
80 82
   PROGMEM Language_Str MSG_MEASURE_AUTOMATICALLY    = u8"Measure automatically";
81 83
   PROGMEM Language_Str MSG_H_OFFSET                 = u8"H Offset";
82 84
   PROGMEM Language_Str MSG_V_OFFSET                 = u8"V Offset";
@@ -129,7 +131,7 @@ namespace Language_en {
129 131
   PROGMEM Language_Str MSG_SOUND_VOLUME             = u8"Sound volume";
130 132
   PROGMEM Language_Str MSG_SCREEN_LOCK              = u8"Screen lock";
131 133
   PROGMEM Language_Str MSG_BOOT_SCREEN              = u8"Boot screen";
132
-  PROGMEM Language_Str MSG_INTERFACE_SOUNDS         = u8"Interface Sounds";
134
+  PROGMEM Language_Str MSG_SOUNDS                   = u8"Sounds";
133 135
   PROGMEM Language_Str MSG_CLICK_SOUNDS             = u8"Click sounds";
134 136
   PROGMEM Language_Str MSG_EEPROM_RESTORED          = u8"Settings restored from backup";
135 137
   PROGMEM Language_Str MSG_EEPROM_RESET             = u8"Settings restored to default";
@@ -144,12 +146,12 @@ namespace Language_en {
144 146
 
145 147
   PROGMEM Language_Str MSG_TOUCH_CALIBRATION_START  = u8"Release to begin screen calibration";
146 148
   PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate";
149
+  PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS         = u8"Level X Axis";
147 150
 
148 151
   #ifdef TOUCH_UI_LULZBOT_BIO
149 152
     PROGMEM Language_Str MSG_MOVE_TO_HOME           = u8"Move to Home";
150 153
     PROGMEM Language_Str MSG_RAISE_PLUNGER          = u8"Raise Plunger";
151 154
     PROGMEM Language_Str MSG_RELEASE_XY_AXIS        = u8"Release X and Y Axis";
152
-    PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS       = u8"Auto-level X Axis";
153 155
     PROGMEM Language_Str MSG_BED_TEMPERATURE        = u8"Bed Temperature";
154 156
     PROGMEM Language_Str MSG_HOME_XYZ_WARNING       = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?";
155 157
     PROGMEM Language_Str MSG_HOME_E_WARNING         = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?";

+ 7
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp View File

@@ -131,8 +131,14 @@ namespace ExtUI {
131 131
     }
132 132
   #endif
133 133
 
134
+  #if ENABLED(POWER_LOSS_RECOVERY)
135
+    void onPowerLossResume() {
136
+      // Called on resume from power-loss
137
+    }
138
+  #endif
139
+
134 140
   #if HAS_PID_HEATING
135
-    void OnPidTuning(const result_t rst) {
141
+    void onPidTuning(const result_t rst) {
136 142
       // Called for temperature PID tuning result
137 143
       SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
138 144
       switch (rst) {

+ 10
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h View File

@@ -129,12 +129,13 @@
129 129
  *      9         GND     GND     GND     -->  GND
130 130
  *     10         5V      5V      5V      -->  KILL [3]
131 131
  *
132
- * [1] This configuration is not compatible with the
133
- *     EinsyRetro 1.1a because there is a level shifter
134
- *     on MISO enabled by SD/USB chip select.
132
+ * [1] This configuration allows daisy-chaining of the
133
+ *     display and SD/USB on EXP2, except for [2]
135 134
  *
136
- * [2] This configuration allows daisy-chaining of the
137
- *     display and SD/USB on EXP2.
135
+ * [2] The Ultimachine Einsy boards have a level shifter
136
+ *     on MISO enabled by SD_CSEL chip select, hence it
137
+ *     is not possible to run both the display and the
138
+ *     SD/USB on EXP2.
138 139
  *
139 140
  * [3] Archim Rambo provides 5V on this pin. On any other
140 141
  *     board, divert this wire from the ribbon cable and
@@ -148,4 +149,8 @@
148 149
 
149 150
   #define CLCD_SPI_CS                    BTN_EN1
150 151
   #define CLCD_MOD_RESET                 BTN_EN2
152
+  
153
+  #if MB(EINSY_RAMBO, EINSY_RETRO) && DISABLED(SDSUPPORT)
154
+    #define CLCD_SPI_EXTRA_CS            SDSS
155
+  #endif
151 156
 #endif

+ 45
- 33
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp View File

@@ -27,7 +27,7 @@
27 27
 #include "screens.h"
28 28
 
29 29
 #define GRID_COLS 4
30
-#define GRID_ROWS 9
30
+#define GRID_ROWS 7
31 31
 
32 32
 using namespace FTDI;
33 33
 using namespace Theme;
@@ -45,50 +45,62 @@ void AboutScreen::onRedraw(draw_mode_t) {
45 45
      .cmd(COLOR_RGB(bg_text_enabled))
46 46
      .tag(0);
47 47
 
48
-  draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(4,1),
49
-    #ifdef CUSTOM_MACHINE_NAME
50
-      F(CUSTOM_MACHINE_NAME)
51
-    #else
52
-      GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1)
53
-    #endif
54
-    , OPT_CENTER, font_xlarge
55
-  );
48
+  #define HEADING_POS BTN_POS(1,2), BTN_SIZE(4,1)
49
+  #define FW_VERS_POS BTN_POS(1,3), BTN_SIZE(4,1)
50
+  #define FW_INFO_POS BTN_POS(1,4), BTN_SIZE(4,1)
51
+  #define LICENSE_POS BTN_POS(1,5), BTN_SIZE(4,2)
52
+  #define STATS_POS   BTN_POS(1,7), BTN_SIZE(2,1)
53
+  #define BACK_POS    BTN_POS(3,7), BTN_SIZE(2,1)
56 54
 
57
-  #ifdef TOOLHEAD_NAME
58
-    char about_str[
59
-      strlen_P(GET_TEXT(FIRMWARE_FOR_TOOLHEAD)) +
60
-      strlen_P(TOOLHEAD_NAME) +
61
-      strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + 1
62
-    ];
55
+  #define _INSET_POS(x,y,w,h) x + w/10, y, w - w/5, h
56
+  #define INSET_POS(pos) _INSET_POS(pos)
63 57
 
64
-    sprintf_P(about_str, GET_TEXT(MSG_FIRMWARE_FOR_TOOLHEAD), TOOLHEAD_NAME);
65
-    strcat_P (about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2));
58
+  char about_str[
59
+    strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) +
60
+    strlen_P(TOOLHEAD_NAME) + 1
61
+  ];
62
+  #ifdef TOOLHEAD_NAME
63
+    // If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name.
64
+    // But this is optional, so squelch the compiler warning here.
65
+    #pragma GCC diagnostic push
66
+    #pragma GCC diagnostic ignored "-Wformat-extra-args"
67
+    sprintf_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2), TOOLHEAD_NAME);
68
+    #pragma GCC diagnostic pop
69
+  #else
70
+    strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2));
66 71
   #endif
67 72
 
68
-  cmd.tag(2);
69
-  draw_text_box(cmd, BTN_POS(1,3), BTN_SIZE(4,3),
70
-    #ifdef TOOLHEAD_NAME
71
-      about_str
73
+  draw_text_box(cmd, HEADING_POS,
74
+    #ifdef CUSTOM_MACHINE_NAME
75
+      F(CUSTOM_MACHINE_NAME)
72 76
     #else
73
-      GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_2)
77
+      GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1)
74 78
     #endif
75
-    , OPT_CENTER, font_medium
79
+    , OPT_CENTER, font_xlarge
76 80
   );
77
-
78
-  cmd.tag(0);
79
-  draw_text_box(cmd, BTN_POS(1,6), BTN_SIZE(4,2), progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium);
80
-
81
-  cmd.font(font_medium).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY));
81
+  draw_text_box(cmd, FW_VERS_POS, progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium);
82
+  draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium);
83
+  draw_text_box(cmd, INSET_POS(LICENSE_POS), GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny);
84
+
85
+  cmd.font(font_medium)
86
+     .colors(normal_btn)
87
+     .tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU))
88
+     .colors(action_btn)
89
+     .tag(1).button(BACK_POS,  GET_TEXT_F(MSG_BACK));
82 90
 }
83 91
 
84 92
 bool AboutScreen::onTouchEnd(uint8_t tag) {
85 93
   switch (tag) {
86
-    case 1: GOTO_PREVIOUS();            return true;
87
-#if ENABLED(TOUCH_UI_DEVELOPER_MENU)
88
-    case 2: GOTO_SCREEN(DeveloperMenu); return true;
89
-#endif
90
-    default:                            return false;
94
+    case 1: GOTO_PREVIOUS(); break;
95
+    #if ENABLED(PRINTCOUNTER)
96
+      case 2: GOTO_SCREEN(StatisticsScreen); break;
97
+    #endif
98
+    #if ENABLED(TOUCH_UI_DEVELOPER_MENU)
99
+      case 3: GOTO_SCREEN(DeveloperMenu); break;
100
+    #endif
101
+    default: return false;
91 102
   }
103
+  return true;
92 104
 }
93 105
 
94 106
 #endif // TOUCH_UI_FTDI_EVE

+ 72
- 82
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp View File

@@ -37,127 +37,116 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
37 37
        .cmd(CLEAR(true,true,true));
38 38
   }
39 39
 
40
+    #ifdef TOUCH_UI_PORTRAIT
41
+      #if HAS_CASE_LIGHT || ENABLED(SENSORLESS_HOMING)
42
+        #define GRID_ROWS 9
43
+      #else
44
+        #define GRID_ROWS 8
45
+      #endif
46
+      #define GRID_COLS 2
47
+      #define RESTORE_DEFAULTS_POS    BTN_POS(1,1), BTN_SIZE(2,1)
48
+      #define DISPLAY_POS             BTN_POS(1,2), BTN_SIZE(1,1)
49
+      #define INTERFACE_POS           BTN_POS(2,2), BTN_SIZE(1,1)
50
+      #define ZPROBE_ZOFFSET_POS      BTN_POS(1,3), BTN_SIZE(1,1)
51
+      #define STEPS_PER_MM_POS        BTN_POS(2,3), BTN_SIZE(1,1)
52
+      #define FILAMENT_POS            BTN_POS(1,4), BTN_SIZE(1,1)
53
+      #define VELOCITY_POS            BTN_POS(2,4), BTN_SIZE(1,1)
54
+      #define TMC_CURRENT_POS         BTN_POS(1,5), BTN_SIZE(1,1)
55
+      #define ACCELERATION_POS        BTN_POS(2,5), BTN_SIZE(1,1)
56
+      #define ENDSTOPS_POS            BTN_POS(1,6), BTN_SIZE(1,1)
57
+      #define JERK_POS                BTN_POS(2,6), BTN_SIZE(1,1)
58
+      #define OFFSETS_POS             BTN_POS(1,7), BTN_SIZE(1,1)
59
+      #define BACKLASH_POS            BTN_POS(2,7), BTN_SIZE(1,1)
60
+      #define CASE_LIGHT_POS          BTN_POS(1,8), BTN_SIZE(1,1)
61
+      #define TMC_HOMING_THRS_POS     BTN_POS(2,8), BTN_SIZE(1,1)
62
+      #if HAS_CASE_LIGHT || ENABLED(SENSORLESS_HOMING)
63
+        #define BACK_POS              BTN_POS(1,9), BTN_SIZE(2,1)
64
+      #else
65
+        #define BACK_POS              BTN_POS(1,8), BTN_SIZE(2,1)
66
+      #endif
67
+    #else
68
+      #define GRID_ROWS 6
69
+      #define GRID_COLS 3
70
+      #define ZPROBE_ZOFFSET_POS      BTN_POS(1,1), BTN_SIZE(1,1)
71
+      #define CASE_LIGHT_POS          BTN_POS(1,4), BTN_SIZE(1,1)
72
+      #define STEPS_PER_MM_POS        BTN_POS(2,1), BTN_SIZE(1,1)
73
+      #define TMC_CURRENT_POS         BTN_POS(3,1), BTN_SIZE(1,1)
74
+      #define TMC_HOMING_THRS_POS     BTN_POS(3,2), BTN_SIZE(1,1)
75
+      #define BACKLASH_POS            BTN_POS(3,3), BTN_SIZE(1,1)
76
+      #define FILAMENT_POS            BTN_POS(1,3), BTN_SIZE(1,1)
77
+      #define ENDSTOPS_POS            BTN_POS(3,4), BTN_SIZE(1,1)
78
+      #define DISPLAY_POS             BTN_POS(3,5), BTN_SIZE(1,1)
79
+      #define INTERFACE_POS           BTN_POS(1,5), BTN_SIZE(2,1)
80
+      #define RESTORE_DEFAULTS_POS    BTN_POS(1,6), BTN_SIZE(2,1)
81
+      #define VELOCITY_POS            BTN_POS(2,2), BTN_SIZE(1,1)
82
+      #define ACCELERATION_POS        BTN_POS(2,3), BTN_SIZE(1,1)
83
+      #define JERK_POS                BTN_POS(2,4), BTN_SIZE(1,1)
84
+      #define OFFSETS_POS             BTN_POS(1,2), BTN_SIZE(1,1)
85
+      #define BACK_POS                BTN_POS(3,6), BTN_SIZE(1,1)
86
+    #endif
87
+
40 88
   if (what & FOREGROUND) {
41 89
     CommandProcessor cmd;
42 90
     cmd.colors(normal_btn)
43 91
        .font(Theme::font_medium)
44
-    #ifdef TOUCH_UI_PORTRAIT
45
-      #define GRID_ROWS 10
46
-      #define GRID_COLS 2
47 92
       .enabled(
48 93
         #if HAS_BED_PROBE
49 94
           1
50 95
         #endif
51 96
       )
52
-      .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
97
+      .tag(2) .button( ZPROBE_ZOFFSET_POS,     GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
53 98
       .enabled(
54 99
         #if HAS_CASE_LIGHT
55 100
           1
56 101
         #endif
57 102
       )
58
-      .tag(16).button( BTN_POS(1,6),  BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
59
-      .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
103
+      .tag(16).button( CASE_LIGHT_POS,         GET_TEXT_F(MSG_CASE_LIGHT))
104
+      .tag(3) .button( STEPS_PER_MM_POS,       GET_TEXT_F(MSG_STEPS_PER_MM))
60 105
       .enabled(
61 106
         #if HAS_TRINAMIC_CONFIG
62 107
           1
63 108
         #endif
64 109
       )
65
-      .tag(13).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
110
+      .tag(13).button( TMC_CURRENT_POS,        GET_TEXT_F(MSG_TMC_CURRENT))
66 111
       .enabled(
67
-        #if HAS_TRINAMIC_CONFIG
112
+        #if ENABLED(SENSORLESS_HOMING)
68 113
           1
69 114
         #endif
70 115
       )
71
-      .tag(14).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
116
+      .tag(14).button( TMC_HOMING_THRS_POS,    GET_TEXT_F(MSG_TMC_HOMING_THRS))
72 117
       .enabled(
73 118
         #if HOTENDS > 1
74 119
           1
75 120
         #endif
76 121
       )
77
-      .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
122
+      .tag(4) .button( OFFSETS_POS,            GET_TEXT_F(MSG_OFFSETS_MENU))
78 123
       .enabled(
79 124
         #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
80 125
           1
81 126
         #endif
82 127
       )
83
-      .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
84
-      .tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
85
-      .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
86
-      .tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
87
-      .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
88
-      .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
89
-      .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
90
-      #if DISABLED(CLASSIC_JERK)
91
-      .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
92
-      #else
93
-      .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
94
-      #endif
95
-      .enabled(
96
-        #if ENABLED(BACKLASH_GCODE)
97
-          1
98
-        #endif
99
-      )
100
-      .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
101
-      .colors(action_btn)
102
-      .tag(1) .button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
103
-      #undef GRID_COLS
104
-      #undef GRID_ROWS
105
-    #else
106
-      #define GRID_ROWS 6
107
-      #define GRID_COLS 3
108
-      .enabled(
109
-        #if HAS_BED_PROBE
110
-          1
111
-        #endif
112
-      )
113
-      .tag(2) .button( BTN_POS(1,1),  BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
114
-      .enabled(
115
-        #if HAS_CASE_LIGHT
116
-          1
117
-        #endif
118
-      )
119
-      .tag(16).button( BTN_POS(1,4),  BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
120
-      .enabled(1)
121
-      .tag(3) .button( BTN_POS(2,1),  BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
122
-      .enabled(
123
-        #if HAS_TRINAMIC_CONFIG
124
-          1
125
-        #endif
126
-      )
127
-      .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
128
-      .enabled(
129
-        #if HAS_TRINAMIC_CONFIG
130
-          1
128
+      .tag(11).button( FILAMENT_POS,           GET_TEXT_F(MSG_FILAMENT))
129
+      .tag(12).button( ENDSTOPS_POS,           GET_TEXT_F(MSG_LCD_ENDSTOPS))
130
+      .tag(15).button( DISPLAY_POS,            GET_TEXT_F(MSG_DISPLAY_MENU))
131
+      .tag(9) .button( INTERFACE_POS,          GET_TEXT_F(MSG_INTERFACE))
132
+      .tag(10).button( RESTORE_DEFAULTS_POS,   GET_TEXT_F(MSG_RESTORE_DEFAULTS))
133
+      .tag(5) .button( VELOCITY_POS,           GET_TEXT_F(MSG_VELOCITY))
134
+      .tag(6) .button( ACCELERATION_POS,       GET_TEXT_F(MSG_ACCELERATION))
135
+      .tag(7) .button( JERK_POS,               GET_TEXT_F(
136
+        #if DISABLED(CLASSIC_JERK)
137
+          MSG_JUNCTION_DEVIATION
138
+        #else
139
+          JERK_POS
131 140
         #endif
132
-      )
133
-      .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
141
+       ))
134 142
       .enabled(
135 143
         #if ENABLED(BACKLASH_GCODE)
136 144
           1
137 145
         #endif
138 146
       )
139
-      .tag(8).button( BTN_POS(3,3),  BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
140
-      .enabled(
141
-        #if HOTENDS > 1
142
-          1
143
-        #endif
144
-      )
145
-      .tag(4) .button( BTN_POS(1,2),  BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
146
-      .tag(12).button( BTN_POS(3,4),  BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
147
-      .tag(5) .button( BTN_POS(2,2),  BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
148
-      .tag(6) .button( BTN_POS(2,3),  BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
149
-      #if DISABLED(CLASSIC_JERK)
150
-      .tag(7) .button( BTN_POS(2,4),  BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
151
-      #else
152
-      .tag(7) .button( BTN_POS(2,4),  BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
153
-      #endif
154
-      .tag(11).button( BTN_POS(1,3),  BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
155
-      .tag(15).button( BTN_POS(3,5),  BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
156
-      .tag(9) .button( BTN_POS(1,5),  BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
157
-      .tag(10).button( BTN_POS(1,6),  BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
147
+      .tag(8).button( BACKLASH_POS,            GET_TEXT_F(MSG_BACKLASH))
158 148
       .colors(action_btn)
159
-      .tag(1) .button( BTN_POS(3,6),  BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
160
-    #endif
149
+      .tag(1).button( BACK_POS,                GET_TEXT_F(MSG_BACK));
161 150
   }
162 151
 }
163 152
 
@@ -191,6 +180,8 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
191 180
     case 12: GOTO_SCREEN(EndstopStatesScreen); break;
192 181
     #if HAS_TRINAMIC_CONFIG
193 182
     case 13: GOTO_SCREEN(StepperCurrentScreen); break;
183
+    #endif
184
+    #if ENABLED(SENSORLESS_HOMING)
194 185
     case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
195 186
     #endif
196 187
     case 15: GOTO_SCREEN(DisplayTuningScreen); break;
@@ -201,5 +192,4 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
201 192
   }
202 193
   return true;
203 194
 }
204
-
205 195
 #endif // TOUCH_UI_FTDI_EVE

+ 8
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp View File

@@ -345,10 +345,14 @@ void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) {
345 345
   }
346 346
 
347 347
   cmd.font(LAYOUT_FONT);
348
- _button(cmd, tag+0, BTN_POS(5,_line),  BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_X));
349
- _button(cmd, tag+1, BTN_POS(7,_line),  BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Y));
350
- _button(cmd, tag+2, BTN_POS(9,_line),  BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Z));
351
- _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXT_F(MSG_AXIS_ALL));
348
+ _button(cmd, tag+0, BTN_POS(5,_line),    BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_X));
349
+ _button(cmd, tag+1, BTN_POS(7,_line),    BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Y));
350
+ #if DISABLED(Z_SAFE_HOMING)
351
+   _button(cmd, tag+2, BTN_POS(9,_line),  BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Z));
352
+   _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXT_F(MSG_AXIS_ALL));
353
+ #else
354
+   _button(cmd, tag+3, BTN_POS(9,_line),  BTN_SIZE(3,1), GET_TEXT_F(MSG_AXIS_ALL));
355
+ #endif
352 356
 
353 357
   _line++;
354 358
 }

+ 4
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp View File

@@ -46,7 +46,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
46 46
     return false;
47 47
   }
48 48
 
49
-  #ifdef LCD_TIMEOUT_TO_STATUS
49
+  #if LCD_TIMEOUT_TO_STATUS
50 50
     if (EventLoop::get_pressed_tag() != 0) {
51 51
       reset_menu_timeout();
52 52
     }
@@ -66,7 +66,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
66 66
 }
67 67
 
68 68
 void BaseScreen::onIdle() {
69
-  #ifdef LCD_TIMEOUT_TO_STATUS
69
+  #if LCD_TIMEOUT_TO_STATUS
70 70
     if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) {
71 71
       reset_menu_timeout();
72 72
       #if ENABLED(TOUCH_UI_DEBUG)
@@ -78,12 +78,12 @@ void BaseScreen::onIdle() {
78 78
 }
79 79
 
80 80
 void BaseScreen::reset_menu_timeout() {
81
-  #ifdef LCD_TIMEOUT_TO_STATUS
81
+  #if LCD_TIMEOUT_TO_STATUS
82 82
     last_interaction = millis();
83 83
   #endif
84 84
 }
85 85
 
86
-#ifdef LCD_TIMEOUT_TO_STATUS
86
+#if LCD_TIMEOUT_TO_STATUS
87 87
   uint32_t BaseScreen::last_interaction;
88 88
 #endif
89 89
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp View File

@@ -85,7 +85,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
85 85
         #endif
86 86
       )
87 87
       .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
88
-      .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
88
+      .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE))
89 89
       .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
90 90
       .colors(action_btn)
91 91
       .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));

+ 7
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp View File

@@ -36,11 +36,13 @@ void BioConfirmHomeE::onRedraw(draw_mode_t) {
36 36
 bool BioConfirmHomeE::onTouchEnd(uint8_t tag) {
37 37
   switch (tag) {
38 38
     case 1:
39
-      SpinnerDialogBox::enqueueAndWait_P(F(
40
-        "G28 E\n"
41
-        AXIS_LEVELING_COMMANDS "\n"
42
-        PARK_AND_RELEASE_COMMANDS
43
-      ));
39
+      #if defined(AXIS_LEVELING_COMMANDS) && defined(PARK_AND_RELEASE_COMMANDS)
40
+        SpinnerDialogBox::enqueueAndWait_P(F(
41
+          "G28 E\n"
42
+          AXIS_LEVELING_COMMANDS "\n"
43
+          PARK_AND_RELEASE_COMMANDS
44
+        ));
45
+      #endif
44 46
       current_screen.forget();
45 47
       break;
46 48
     case 2:

+ 6
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp View File

@@ -36,10 +36,12 @@ void BioConfirmHomeXYZ::onRedraw(draw_mode_t) {
36 36
 bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) {
37 37
   switch (tag) {
38 38
     case 1:
39
-      SpinnerDialogBox::enqueueAndWait_P(F(
40
-       "G28\n"
41
-       PARK_AND_RELEASE_COMMANDS
42
-      ));
39
+      #ifdef PARK_AND_RELEASE_COMMANDS
40
+        SpinnerDialogBox::enqueueAndWait_P(F(
41
+         "G28\n"
42
+         PARK_AND_RELEASE_COMMANDS
43
+        ));
44
+      #endif
43 45
       current_screen.forget();
44 46
       break;
45 47
     case 2:

+ 3
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp View File

@@ -51,7 +51,7 @@ void MainMenu::onRedraw(draw_mode_t what) {
51 51
        .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS))
52 52
        .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
53 53
        .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE))
54
-       .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
54
+       .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE))
55 55
        .tag(8).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
56 56
        .tag(9).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU))
57 57
        .colors(action_btn)
@@ -72,7 +72,9 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
72 72
     case 2: GOTO_SCREEN(BioConfirmHomeXYZ);                                              break;
73 73
     case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? F("G0 E0 F120") : F("G112"));   break;
74 74
     case 4: StatusScreen::unlockMotors();                                                break;
75
+    #ifdef AXIS_LEVELING_COMMANDS
75 76
     case 5: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS));               break;
77
+    #endif
76 78
     case 6: GOTO_SCREEN(TemperatureScreen);                                              break;
77 79
     case 7: GOTO_SCREEN(InterfaceSettingsScreen);                                        break;
78 80
     case 8: GOTO_SCREEN(AdvancedSettingsMenu);                                           break;

+ 8
- 6
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp View File

@@ -80,12 +80,14 @@ void BootScreen::onIdle() {
80 80
       SpinnerDialogBox::hide();
81 81
     }
82 82
 
83
-    if (UIData::animations_enabled()) {
84
-      // If there is a startup video in the flash SPI, play
85
-      // that, otherwise show a static splash screen.
86
-      if (!MediaPlayerScreen::playBootMedia())
87
-        showSplashScreen();
88
-    }
83
+    #if DISABLED(TOUCH_UI_NO_BOOTSCREEN)
84
+      if (UIData::animations_enabled()) {
85
+        // If there is a startup video in the flash SPI, play
86
+        // that, otherwise show a static splash screen.
87
+        if (!MediaPlayerScreen::playBootMedia())
88
+          showSplashScreen();
89
+      }
90
+    #endif
89 91
 
90 92
     StatusScreen::loadBitmaps();
91 93
 

+ 2
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp View File

@@ -111,6 +111,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
111 111
   if (what & BACKGROUND) {
112 112
     cmd.cmd(CLEAR_COLOR_RGB(bg_color))
113 113
        .cmd(CLEAR(true,true,true))
114
+       .cmd(COLOR_RGB(bg_text_enabled))
114 115
        .tag(0)
115 116
     #ifdef TOUCH_UI_PORTRAIT
116 117
        .font(font_large)
@@ -119,7 +120,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
119 120
     #endif
120 121
        .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION))
121 122
     #ifdef TOUCH_UI_PORTRAIT
122
-       .text(BTN_POS(1,7), BTN_SIZE(1,1), F(""))
123
+       .text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE))
123 124
     #else
124 125
        .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE))
125 126
        .font(font_small)

+ 8
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp View File

@@ -69,7 +69,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
69 69
        .cmd(COLOR_RGB(bg_text_enabled))
70 70
        .tag(0)
71 71
        .font(font_medium)
72
-       .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
72
+       .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE))
73 73
     #undef EDGE_R
74 74
     #define EDGE_R 30
75 75
        .font(font_small)
@@ -77,7 +77,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
77 77
        .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY)
78 78
        .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME),   OPT_RIGHTX | OPT_CENTERY)
79 79
        .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_SCREEN_LOCK),    OPT_RIGHTX | OPT_CENTERY);
80
+    #if DISABLED(TOUCH_UI_NO_BOOTSCREEN)
80 81
     cmd.text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BOOT_SCREEN),    OPT_RIGHTX | OPT_CENTERY);
82
+    #endif
81 83
     #undef EDGE_R
82 84
   }
83 85
 
@@ -95,16 +97,18 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
95 97
        .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume,     0xFF)
96 98
        .colors(ui_toggle)
97 99
        .tag(4).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), LockScreen::is_enabled())
100
+    #if DISABLED(TOUCH_UI_NO_BOOTSCREEN)
98 101
        .tag(5).toggle2(BTN_POS(3,5), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), UIData::animations_enabled())
102
+    #endif
99 103
     #undef EDGE_R
100 104
     #define EDGE_R 0
101 105
     #ifdef TOUCH_UI_PORTRAIT
102 106
        .colors(normal_btn)
103
-       .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS))
107
+       .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS))
104 108
        .colors(action_btn)
105 109
        .tag(1).button (BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK));
106 110
     #else
107
-       .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS))
111
+       .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUNDS))
108 112
        .colors(action_btn)
109 113
        .tag(1).button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
110 114
     #endif
@@ -252,7 +256,7 @@ void InterfaceSettingsScreen::loadSettings(const char *buff) {
252 256
 }
253 257
 
254 258
 #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
255
-  #include "../../../../../HAL/shared/persistent_store_api.h"
259
+  #include "../../../../../HAL/shared/eeprom_api.h"
256 260
 
257 261
   bool restoreEEPROM() {
258 262
     uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE];

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp View File

@@ -71,7 +71,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) {
71 71
     #define GRID_ROWS 9
72 72
 
73 73
        .font(font_medium)
74
-       .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS))
74
+       .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS))
75 75
     #undef EDGE_R
76 76
     #define EDGE_R 30
77 77
        .font(font_small)

+ 91
- 74
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp View File

@@ -37,81 +37,89 @@ void MainMenu::onRedraw(draw_mode_t what) {
37 37
        .cmd(CLEAR(true,true,true));
38 38
   }
39 39
 
40
+  #ifdef TOUCH_UI_PORTRAIT
41
+    #define GRID_ROWS 8
42
+    #define GRID_COLS 2
43
+    #define ABOUT_PRINTER_POS     BTN_POS(1,1), BTN_SIZE(2,1)
44
+    #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1)
45
+    #define FILAMENTCHANGE_POS    BTN_POS(1,3), BTN_SIZE(2,1)
46
+    #define TEMPERATURE_POS       BTN_POS(1,4), BTN_SIZE(2,1)
47
+    #define MOVE_AXIS_POS         BTN_POS(1,5), BTN_SIZE(1,1)
48
+    #define DISABLE_STEPPERS_POS  BTN_POS(2,5), BTN_SIZE(1,1)
49
+    #define AUTO_HOME_POS         BTN_POS(1,6), BTN_SIZE(1,1)
50
+    #define CLEAN_NOZZLE_POS      BTN_POS(2,6), BTN_SIZE(1,1)
51
+    #define LEVEL_BED_POS         BTN_POS(1,7), BTN_SIZE(1,1)
52
+    #define LEVEL_AXIS_POS        BTN_POS(2,7), BTN_SIZE(1,1)
53
+    #define BACK_POS              BTN_POS(1,8), BTN_SIZE(2,1)
54
+  #else
55
+    #define GRID_ROWS 6
56
+    #define GRID_COLS 2
57
+    #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(1,1)
58
+    #define ABOUT_PRINTER_POS     BTN_POS(2,1), BTN_SIZE(1,1)
59
+    #define AUTO_HOME_POS         BTN_POS(1,2), BTN_SIZE(1,1)
60
+    #define CLEAN_NOZZLE_POS      BTN_POS(2,2), BTN_SIZE(1,1)
61
+    #define MOVE_AXIS_POS         BTN_POS(1,3), BTN_SIZE(1,1)
62
+    #define DISABLE_STEPPERS_POS  BTN_POS(2,3), BTN_SIZE(1,1)
63
+    #define TEMPERATURE_POS       BTN_POS(1,4), BTN_SIZE(1,1)
64
+    #define FILAMENTCHANGE_POS    BTN_POS(2,4), BTN_SIZE(1,1)
65
+    #define LEVEL_BED_POS         BTN_POS(1,5), BTN_SIZE(1,1)
66
+    #define LEVEL_AXIS_POS        BTN_POS(2,5), BTN_SIZE(1,1)
67
+    #define BACK_POS              BTN_POS(1,6), BTN_SIZE(2,1)
68
+  #endif
69
+
40 70
   if (what & FOREGROUND) {
41 71
     CommandProcessor cmd;
42 72
     cmd.colors(normal_btn)
43 73
        .font(Theme::font_medium)
44
-    #ifdef TOUCH_UI_PORTRAIT
45
-      #define GRID_ROWS 8
46
-      #define GRID_COLS 2
47
-        .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
48
-        .enabled(
49
-          #if ENABLED(NOZZLE_CLEAN_FEATURE)
50
-            1
51
-          #endif
52
-        )
53
-        .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
54
-        .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
55
-        .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
56
-        .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE))
57
-        .enabled(
58
-          #if NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
59
-            1
60
-          #endif
74
+       .tag(2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME))
75
+       .enabled(
76
+           #if ANY(NOZZLE_CLEAN_FEATURE, TOUCH_UI_COCOA_PRESS)
77
+             1
78
+           #endif
79
+         )
80
+       .tag(3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(
81
+         #if ENABLED(TOUCH_UI_COCOA_PRESS)
82
+            MSG_PREHEAT_1
83
+         #else
84
+            MSG_CLEAN_NOZZLE
85
+         #endif
86
+       ))
87
+       .tag(4).button( MOVE_AXIS_POS,        GET_TEXT_F(MSG_MOVE_AXIS))
88
+       .tag(5).button( DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
89
+       .tag(6).button( TEMPERATURE_POS,      GET_TEXT_F(MSG_TEMPERATURE))
90
+       .enabled(
91
+           #if DISABLED(TOUCH_UI_LULZBOT_BIO)
92
+             1
93
+           #endif
94
+         )
95
+       .tag(7).button( FILAMENTCHANGE_POS, GET_TEXT_F(
96
+         #if ENABLED(TOUCH_UI_COCOA_PRESS)
97
+             MSG_CASE_LIGHT
98
+         #else
99
+             MSG_FILAMENTCHANGE
100
+         #endif
101
+        ))
102
+       .tag(8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
103
+       .enabled(
104
+         #ifdef PRINTCOUNTER
105
+           1
106
+         #endif
61 107
         )
62
-        .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
63
-        .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
64
-        .enabled(
65
-          #ifdef PRINTCOUNTER
66
-            1
67
-          #endif
108
+       .enabled(
109
+         #ifdef AXIS_LEVELING_COMMANDS
110
+           1
111
+         #endif
68 112
         )
69
-        .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
70
-        .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU))
71
-        .colors(action_btn)
72
-        .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
73
-      #undef GRID_COLS
74
-      #undef GRID_ROWS
75
-    #else
76
-      #define GRID_ROWS 5
77
-      #define GRID_COLS 2
78
-        .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
79
-        #if ENABLED(TOUCH_UI_COCOA_PRESS)
80
-          .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_PREHEAT_1))
81
-        #else
82
-          .enabled(
83
-            #if ENABLED(NOZZLE_CLEAN_FEATURE)
84
-              1
85
-            #endif
86
-          )
87
-          .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
88
-        #endif
89
-        .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
90
-        .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
91
-        .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE))
92
-        #if ENABLED(TOUCH_UI_COCOA_PRESS)
93
-          .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
94
-        #else
95
-          .enabled(
96
-            #if DISABLED(TOUCH_UI_LULZBOT_BIO)
97
-              1
98
-            #endif
99
-          )
100
-          .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
101
-        #endif
102
-        .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
103
-        .enabled(
104
-          #ifdef PRINTCOUNTER
105
-            1
106
-          #endif
113
+       .tag(9).button( LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
114
+       .enabled(
115
+         #ifdef HAS_LEVELING
116
+           1
117
+         #endif
107 118
         )
108
-        .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
109
-        .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_MENU))
110
-        .colors(action_btn)
111
-        .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
112
-      #undef GRID_COLS
113
-      #undef GRID_ROWS
114
-    #endif
119
+       .tag(10).button( LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED))
120
+       .tag(11).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU))
121
+       .colors(action_btn)
122
+       .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK));
115 123
   }
116 124
 }
117 125
 
@@ -122,23 +130,32 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
122 130
     case 1:  SaveSettingsDialogBox::promptToSaveSettings();           break;
123 131
     case 2:  SpinnerDialogBox::enqueueAndWait_P(F("G28"));            break;
124 132
     #if ENABLED(TOUCH_UI_COCOA_PRESS)
125
-    case 3:  GOTO_SCREEN(PreheatTimerScreen);                         break;
133
+    case 3:  GOTO_SCREEN(PreheatMenu);                                break;
126 134
     #elif ENABLED(NOZZLE_CLEAN_FEATURE)
127 135
     case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
128 136
     #endif
129 137
     case 4:  GOTO_SCREEN(MoveAxisScreen);                             break;
130 138
     case 5:  injectCommands_P(PSTR("M84"));                           break;
131 139
     case 6:  GOTO_SCREEN(TemperatureScreen);                          break;
132
-    #if ENABLED(TOUCH_UI_COCOA_PRESS)
140
+    #if ENABLED(TOUCH_UI_COCOA_PRESS) && HAS_CASE_LIGHT
133 141
     case 7:  GOTO_SCREEN(CaseLightScreen);                            break;
134 142
     #else
135 143
     case 7:  GOTO_SCREEN(ChangeFilamentScreen);                       break;
136 144
     #endif
137 145
     case 8:  GOTO_SCREEN(AdvancedSettingsMenu);                       break;
138
-#if ENABLED(PRINTCOUNTER)
139
-    case 9:  GOTO_SCREEN(StatisticsScreen);                           break;
140
-#endif
141
-    case 10: GOTO_SCREEN(AboutScreen);                                break;
146
+    #ifdef AXIS_LEVELING_COMMANDS
147
+    case 9: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
148
+    #endif
149
+    #ifdef HAS_LEVELING
150
+    case 10:  SpinnerDialogBox::enqueueAndWait_P(F(
151
+      #ifdef BED_LEVELING_COMMANDS
152
+        BED_LEVELING_COMMANDS
153
+      #else
154
+        "G29"
155
+      #endif
156
+    ));            break;
157
+    #endif
158
+    case 11: GOTO_SCREEN(AboutScreen);                                break;
142 159
     default:
143 160
       return false;
144 161
   }

+ 83
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp View File

@@ -0,0 +1,83 @@
1
+/********************
2
+ * preheat_menu.cpp *
3
+ ********************/
4
+
5
+/****************************************************************************
6
+ *   Written By Marcio Teixeira 2020 - Cocoa Press                          *
7
+ *                                                                          *
8
+ *   This program is free software: you can redistribute it and/or modify   *
9
+ *   it under the terms of the GNU General Public License as published by   *
10
+ *   the Free Software Foundation, either version 3 of the License, or      *
11
+ *   (at your option) any later version.                                    *
12
+ *                                                                          *
13
+ *   This program is distributed in the hope that it will be useful,        *
14
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU General Public License for more details.                           *
17
+ *                                                                          *
18
+ *   To view a copy of the GNU General Public License, go to the following  *
19
+ *   location: <http://www.gnu.org/licenses/>.                              *
20
+ ****************************************************************************/
21
+
22
+#include "../config.h"
23
+
24
+#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS)
25
+
26
+#include "screens.h"
27
+
28
+using namespace FTDI;
29
+using namespace ExtUI;
30
+using namespace Theme;
31
+
32
+void PreheatMenu::onRedraw(draw_mode_t what) {
33
+  if (what & BACKGROUND) {
34
+    CommandProcessor cmd;
35
+    cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
36
+       .cmd(CLEAR(true,true,true))
37
+       .tag(0);
38
+  }
39
+
40
+  #define GRID_ROWS 3
41
+  #define GRID_COLS 2
42
+    
43
+  if (what & FOREGROUND) {
44
+    CommandProcessor cmd;
45
+    cmd.cmd(COLOR_RGB(bg_text_enabled))
46
+       .font(Theme::font_medium)
47
+       .text  ( BTN_POS(1,1),  BTN_SIZE(2,1), GET_TEXT_F(MSG_PREHEAT_1))
48
+       .colors(normal_btn)
49
+       .tag(2).button( BTN_POS(1,2),  BTN_SIZE(1,1), F("Dark Chocolate"))
50
+       .tag(3).button( BTN_POS(2,2),  BTN_SIZE(1,1), F("Milk Chocolate"))
51
+       .tag(4).button( BTN_POS(1,3),  BTN_SIZE(1,1), F("White Chocolate"))
52
+       .colors(action_btn)
53
+       .tag(1) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
54
+  }
55
+}
56
+
57
+bool PreheatMenu::onTouchEnd(uint8_t tag) {
58
+  switch (tag) {
59
+    case 1: GOTO_PREVIOUS();                   break;
60
+    case 2:
61
+      #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT
62
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT));
63
+      #endif
64
+      GOTO_SCREEN(PreheatTimerScreen);
65
+      break;
66
+    case 3:
67
+      #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT
68
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT));
69
+      #endif
70
+      GOTO_SCREEN(PreheatTimerScreen);
71
+      break;
72
+    case 4:
73
+      #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT
74
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT));
75
+      #endif
76
+      GOTO_SCREEN(PreheatTimerScreen);
77
+      break;
78
+    default: return false;
79
+  }
80
+  return true;
81
+}
82
+
83
+#endif // TOUCH_UI_FTDI_EVE

+ 0
- 3
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp View File

@@ -77,9 +77,6 @@ void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) {
77 77
 
78 78
 void PreheatTimerScreen::onEntry() {
79 79
   screen_data.PreheatTimerScreen.start_ms = millis();
80
-  #ifdef COCOA_PRESS_PREHEAT_SCRIPT
81
-    injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_SCRIPT));
82
-  #endif
83 80
 }
84 81
 
85 82
 void PreheatTimerScreen::onRedraw(draw_mode_t what) {

+ 1
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp View File

@@ -105,6 +105,7 @@ SCREEN_TABLE {
105 105
   DECL_SCREEN(BioConfirmHomeE),
106 106
 #endif
107 107
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
108
+  DECL_SCREEN(PreheatMenu),
108 109
   DECL_SCREEN(PreheatTimerScreen),
109 110
 #endif
110 111
 #if ENABLED(TOUCH_UI_DEVELOPER_MENU)

+ 8
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h View File

@@ -76,6 +76,7 @@ enum {
76 76
   PRINTING_SCREEN_CACHE,
77 77
 #endif
78 78
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
79
+  PREHEAT_MENU_CACHE,
79 80
   PREHEAT_TIMER_SCREEN_CACHE,
80 81
 #endif
81 82
   CHANGE_FILAMENT_SCREEN_CACHE,
@@ -99,7 +100,7 @@ enum {
99 100
 
100 101
 class BaseScreen : public UIScreen {
101 102
   protected:
102
-    #ifdef LCD_TIMEOUT_TO_STATUS
103
+    #if LCD_TIMEOUT_TO_STATUS
103 104
       static uint32_t last_interaction;
104 105
     #endif
105 106
 
@@ -314,6 +315,12 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
314 315
 #endif
315 316
 
316 317
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
318
+  class PreheatMenu : public BaseScreen, public CachedScreen<PREHEAT_MENU_CACHE> {
319
+    public:
320
+      static void onRedraw(draw_mode_t);
321
+      static bool onTouchEnd(uint8_t tag);
322
+  };
323
+
317 324
   class PreheatTimerScreen : public BaseScreen, public CachedScreen<PREHEAT_TIMER_SCREEN_CACHE> {
318 325
     private:
319 326
       static uint16_t secondsRemaining();

+ 107
- 119
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp View File

@@ -33,9 +33,9 @@ using namespace FTDI;
33 33
 using namespace Theme;
34 34
 
35 35
 #ifdef TOUCH_UI_PORTRAIT
36
-  #define GRID_ROWS 8
36
+    #define GRID_ROWS 8
37 37
 #else
38
-  #define GRID_ROWS 8
38
+    #define GRID_ROWS 8
39 39
 #endif
40 40
 
41 41
 void StatusScreen::draw_axis_position(draw_mode_t what) {
@@ -43,41 +43,41 @@ void StatusScreen::draw_axis_position(draw_mode_t what) {
43 43
 
44 44
   #define GRID_COLS 3
45 45
 
46
+  #ifdef TOUCH_UI_PORTRAIT
47
+    #define X_LBL_POS  BTN_POS(1,5), BTN_SIZE(1,1)
48
+    #define Y_LBL_POS  BTN_POS(1,6), BTN_SIZE(1,1)
49
+    #define Z_LBL_POS  BTN_POS(1,7), BTN_SIZE(1,1)
50
+    #define X_VAL_POS  BTN_POS(2,5), BTN_SIZE(2,1)
51
+    #define Y_VAL_POS  BTN_POS(2,6), BTN_SIZE(2,1)
52
+    #define Z_VAL_POS  BTN_POS(2,7), BTN_SIZE(2,1)
53
+  #else
54
+    #define X_LBL_POS  BTN_POS(1,5), BTN_SIZE(1,1)
55
+    #define Y_LBL_POS  BTN_POS(2,5), BTN_SIZE(1,1)
56
+    #define Z_LBL_POS  BTN_POS(3,5), BTN_SIZE(1,1)
57
+    #define X_VAL_POS  BTN_POS(1,6), BTN_SIZE(1,1)
58
+    #define Y_VAL_POS  BTN_POS(2,6), BTN_SIZE(1,1)
59
+    #define Z_VAL_POS  BTN_POS(3,6), BTN_SIZE(1,1)
60
+  #endif
61
+
62
+  #define _UNION_POS(x1,y1,w1,h1,x2,y2,w2,h2) x1,y1,max(x1+w1,x2+w2)-x1,max(y1+h1,y2+h2)-y1
63
+  #define UNION_POS(p1, p2) _UNION_POS(p1, p2)
64
+
46 65
   if (what & BACKGROUND) {
47 66
     cmd.tag(6)
48
-    #ifdef TOUCH_UI_PORTRAIT
49
-      .fgcolor(Theme::axis_label)
50
-        .font(Theme::font_large)
51
-                         .button( BTN_POS(1,5), BTN_SIZE(2,1), F(""), OPT_FLAT)
52
-                         .button( BTN_POS(1,6), BTN_SIZE(2,1), F(""), OPT_FLAT)
53
-                         .button( BTN_POS(1,7), BTN_SIZE(2,1), F(""), OPT_FLAT)
54
-
55
-        .font(Theme::font_small)
56
-                         .text  ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X))
57
-                         .text  ( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y))
58
-                         .text  ( BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z))
59
-
60
-        .font(Theme::font_medium)
61
-        .fgcolor(Theme::x_axis) .button( BTN_POS(2,5), BTN_SIZE(2,1), F(""), OPT_FLAT)
62
-        .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(2,1), F(""), OPT_FLAT)
63
-        .fgcolor(Theme::z_axis) .button( BTN_POS(2,7), BTN_SIZE(2,1), F(""), OPT_FLAT);
64
-    #else
65
-      .fgcolor(Theme::axis_label)
66
-        .font(Theme::font_large)
67
-                         .button( BTN_POS(1,5), BTN_SIZE(1,2), F(""),  OPT_FLAT)
68
-                         .button( BTN_POS(2,5), BTN_SIZE(1,2), F(""),  OPT_FLAT)
69
-                         .button( BTN_POS(3,5), BTN_SIZE(1,2), F(""),  OPT_FLAT)
70
-
71
-        .font(Theme::font_small)
72
-                         .text  ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X))
73
-                         .text  ( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y))
74
-                         .text  ( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z))
75
-                         .font(Theme::font_medium)
76
-
77
-        .fgcolor(Theme::x_axis) .button( BTN_POS(1,6), BTN_SIZE(1,1), F(""), OPT_FLAT)
78
-        .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT)
79
-        .fgcolor(Theme::z_axis) .button( BTN_POS(3,6), BTN_SIZE(1,1), F(""), OPT_FLAT);
80
-    #endif
67
+       .fgcolor(Theme::axis_label)
68
+       .font(Theme::font_large)
69
+                               .button( UNION_POS(X_LBL_POS, X_VAL_POS), F(""), OPT_FLAT)
70
+                               .button( UNION_POS(Y_LBL_POS, Y_VAL_POS), F(""), OPT_FLAT)
71
+                               .button( UNION_POS(Z_LBL_POS, Z_VAL_POS), F(""), OPT_FLAT)
72
+       .font(Theme::font_medium)
73
+       .fgcolor(Theme::x_axis) .button( X_VAL_POS, F(""), OPT_FLAT)
74
+       .fgcolor(Theme::y_axis) .button( Y_VAL_POS, F(""), OPT_FLAT)
75
+       .fgcolor(Theme::z_axis) .button( Z_VAL_POS, F(""), OPT_FLAT)
76
+       .font(Theme::font_small)
77
+                               .text  ( X_LBL_POS, GET_TEXT_F(MSG_AXIS_X))
78
+                               .text  ( Y_LBL_POS, GET_TEXT_F(MSG_AXIS_Y))
79
+                               .text  ( Z_LBL_POS, GET_TEXT_F(MSG_AXIS_Z))
80
+       .colors(normal_btn);
81 81
   }
82 82
 
83 83
   if (what & FOREGROUND) {
@@ -101,16 +101,11 @@ void StatusScreen::draw_axis_position(draw_mode_t what) {
101 101
     else
102 102
       strcpy_P(z_str, PSTR("?"));
103 103
 
104
-    cmd.tag(6).font(Theme::font_medium)
105
-    #ifdef TOUCH_UI_PORTRAIT
106
-         .text  ( BTN_POS(2,5), BTN_SIZE(2,1), x_str)
107
-         .text  ( BTN_POS(2,6), BTN_SIZE(2,1), y_str)
108
-         .text  ( BTN_POS(2,7), BTN_SIZE(2,1), z_str);
109
-    #else
110
-         .text  ( BTN_POS(1,6), BTN_SIZE(1,1), x_str)
111
-         .text  ( BTN_POS(2,6), BTN_SIZE(1,1), y_str)
112
-         .text  ( BTN_POS(3,6), BTN_SIZE(1,1), z_str);
113
-    #endif
104
+    cmd.tag(6)
105
+       .font(Theme::font_medium)
106
+       .text  ( X_VAL_POS, x_str)
107
+       .text  ( Y_VAL_POS, y_str)
108
+       .text  ( Z_VAL_POS, z_str);
114 109
   }
115 110
 
116 111
   #undef GRID_COLS
@@ -125,49 +120,49 @@ void StatusScreen::draw_axis_position(draw_mode_t what) {
125 120
 void StatusScreen::draw_temperature(draw_mode_t what) {
126 121
   using namespace Theme;
127 122
 
123
+  #define TEMP_RECT_1 BTN_POS(1,1), BTN_SIZE(4,2)
124
+  #define TEMP_RECT_2 BTN_POS(1,1), BTN_SIZE(8,1)
125
+  #define NOZ_1_POS   BTN_POS(1,1), BTN_SIZE(4,1)
126
+  #define NOZ_2_POS   BTN_POS(5,1), BTN_SIZE(4,1)
127
+  #define BED_POS     BTN_POS(1,2), BTN_SIZE(4,1)
128
+  #define FAN_POS     BTN_POS(5,2), BTN_SIZE(4,1)
129
+
130
+  #define _ICON_POS(x,y,w,h) x, y, w/4, h
131
+  #define _TEXT_POS(x,y,w,h) x + w/4, y, w - w/4, h
132
+  #define ICON_POS(pos) _ICON_POS(pos)
133
+  #define TEXT_POS(pos) _TEXT_POS(pos)
134
+
128 135
   CommandProcessor cmd;
129 136
 
130 137
   if (what & BACKGROUND) {
131 138
     cmd.font(Theme::font_small)
132
-    #ifdef TOUCH_UI_PORTRAIT
133
-       .tag(5)
134
-       .fgcolor(temp)      .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT)
135
-                                  .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT)
136
-       .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT)
137
-       .tag(0)
138
-       .fgcolor(progress)  .button( BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT)
139
-                                  .button( BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT);
140
-    #else
141 139
        .tag(5)
142
-       .fgcolor(temp)      .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT)
143
-                                  .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT)
144
-       .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT)
145
-       .tag(0)
146
-       .fgcolor(progress)  .button( BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT)
147
-                                  .button( BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT);
148
-    #endif
140
+       .fgcolor(temp)     .button( TEMP_RECT_1, F(""), OPT_FLAT)
141
+                          .button( TEMP_RECT_2, F(""), OPT_FLAT)
142
+       .fgcolor(fan_speed).button( FAN_POS,     F(""), OPT_FLAT)
143
+       .tag(0);
149 144
 
150 145
     // Draw Extruder Bitmap on Extruder Temperature Button
151 146
 
152 147
     cmd.tag(5)
153
-       .cmd(BITMAP_SOURCE(Extruder_Icon_Info))
154
-       .cmd(BITMAP_LAYOUT(Extruder_Icon_Info))
155
-       .cmd(BITMAP_SIZE  (Extruder_Icon_Info))
156
-       .icon (BTN_POS(1,1), BTN_SIZE(1,1),  Extruder_Icon_Info, icon_scale)
157
-       .icon (BTN_POS(5,1), BTN_SIZE(1,1),  Extruder_Icon_Info, icon_scale);
148
+       .cmd (BITMAP_SOURCE(Extruder_Icon_Info))
149
+       .cmd (BITMAP_LAYOUT(Extruder_Icon_Info))
150
+       .cmd (BITMAP_SIZE  (Extruder_Icon_Info))
151
+       .icon(ICON_POS(NOZ_1_POS), Extruder_Icon_Info, icon_scale)
152
+       .icon(ICON_POS(NOZ_2_POS), Extruder_Icon_Info, icon_scale);
158 153
 
159 154
     // Draw Bed Heat Bitmap on Bed Heat Button
160
-    cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info))
161
-       .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info))
162
-       .cmd(BITMAP_SIZE  (Bed_Heat_Icon_Info))
163
-       .icon (BTN_POS(1,2), BTN_SIZE(1,1), Bed_Heat_Icon_Info, icon_scale);
155
+    cmd.cmd (BITMAP_SOURCE(Bed_Heat_Icon_Info))
156
+       .cmd (BITMAP_LAYOUT(Bed_Heat_Icon_Info))
157
+       .cmd (BITMAP_SIZE  (Bed_Heat_Icon_Info))
158
+       .icon(ICON_POS(BED_POS), Bed_Heat_Icon_Info, icon_scale);
164 159
 
165 160
     // Draw Fan Percent Bitmap on Bed Heat Button
166 161
 
167
-    cmd.cmd(BITMAP_SOURCE(Fan_Icon_Info))
168
-       .cmd(BITMAP_LAYOUT(Fan_Icon_Info))
169
-       .cmd(BITMAP_SIZE  (Fan_Icon_Info))
170
-       .icon  (BTN_POS(5,2), BTN_SIZE(1,1), Fan_Icon_Info, icon_scale);
162
+    cmd.cmd (BITMAP_SOURCE(Fan_Icon_Info))
163
+       .cmd (BITMAP_LAYOUT(Fan_Icon_Info))
164
+       .cmd (BITMAP_SIZE  (Fan_Icon_Info))
165
+       .icon(ICON_POS(FAN_POS), Fan_Icon_Info, icon_scale);
171 166
 
172 167
     #ifdef TOUCH_UI_USE_UTF8
173 168
       load_utf8_bitmaps(cmd); // Restore font bitmap handles
@@ -212,10 +207,10 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
212 207
 
213 208
     cmd.tag(5)
214 209
        .font(font_medium)
215
-       .text(BTN_POS(2,1), BTN_SIZE(3,1), e0_str)
216
-       .text(BTN_POS(6,1), BTN_SIZE(3,1), e1_str)
217
-       .text(BTN_POS(2,2), BTN_SIZE(3,1), bed_str)
218
-       .text(BTN_POS(6,2), BTN_SIZE(3,1), fan_str);
210
+       .text(TEXT_POS(NOZ_1_POS), e0_str)
211
+       .text(TEXT_POS(NOZ_2_POS), e1_str)
212
+       .text(TEXT_POS(BED_POS), bed_str)
213
+       .text(TEXT_POS(FAN_POS), fan_str);
219 214
   }
220 215
 }
221 216
 
@@ -225,15 +220,18 @@ void StatusScreen::draw_progress(draw_mode_t what) {
225 220
 
226 221
   CommandProcessor cmd;
227 222
 
223
+  #if ENABLED(TOUCH_UI_PORTRAIT)
224
+    #define TIME_POS     BTN_POS(1,3), BTN_SIZE(4,1)
225
+    #define PROGRESS_POS BTN_POS(5,3), BTN_SIZE(4,1)
226
+  #else
227
+    #define TIME_POS     BTN_POS(9,1), BTN_SIZE(4,1)
228
+    #define PROGRESS_POS BTN_POS(9,2), BTN_SIZE(4,1)
229
+  #endif
230
+
228 231
   if (what & BACKGROUND) {
229 232
     cmd.tag(0).font(font_medium)
230
-    #ifdef TOUCH_UI_PORTRAIT
231
-       .fgcolor(progress) .button(BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT)
232
-                                 .button(BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT);
233
-    #else
234
-       .fgcolor(progress) .button(BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT)
235
-                                 .button(BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT);
236
-    #endif
233
+       .fgcolor(progress).button(TIME_POS,     F(""), OPT_FLAT)
234
+                         .button(PROGRESS_POS, F(""), OPT_FLAT);
237 235
   }
238 236
 
239 237
   if (what & FOREGROUND) {
@@ -248,13 +246,8 @@ void StatusScreen::draw_progress(draw_mode_t what) {
248 246
     sprintf_P(progress_str, PSTR("%-3d %%"),      getProgress_percent() );
249 247
 
250 248
     cmd.font(font_medium)
251
-    #ifdef TOUCH_UI_PORTRAIT
252
-       .tag(0).text(BTN_POS(1,3), BTN_SIZE(4,1), time_str)
253
-              .text(BTN_POS(5,3), BTN_SIZE(4,1), progress_str);
254
-    #else
255
-       .tag(0).text(BTN_POS(9,1), BTN_SIZE(4,1), time_str)
256
-              .text(BTN_POS(9,2), BTN_SIZE(4,1), progress_str);
257
-    #endif
249
+       .tag(0).text(TIME_POS, time_str)
250
+              .text(PROGRESS_POS, progress_str);
258 251
   }
259 252
 }
260 253
 
@@ -266,6 +259,14 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
266 259
   if (what & FOREGROUND) {
267 260
     using namespace ExtUI;
268 261
 
262
+  #if ENABLED(TOUCH_UI_PORTRAIT)
263
+    #define MEDIA_BTN_POS  BTN_POS(1,8), BTN_SIZE(2,1)
264
+    #define MENU_BTN_POS   BTN_POS(3,8), BTN_SIZE(2,1)
265
+  #else
266
+    #define MEDIA_BTN_POS  BTN_POS(1,7), BTN_SIZE(2,2)
267
+    #define MENU_BTN_POS   BTN_POS(3,7), BTN_SIZE(2,2)
268
+  #endif
269
+
269 270
     const bool has_media = isMediaInserted() && !isPrintingFromMedia();
270 271
 
271 272
     CommandProcessor cmd;
@@ -273,42 +274,29 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
273 274
        .font(Theme::font_medium)
274 275
        .enabled(has_media)
275 276
        .colors(has_media ? action_btn : normal_btn)
276
-       .tag(3).button(
277
-          #ifdef TOUCH_UI_PORTRAIT
278
-            BTN_POS(1,8), BTN_SIZE(2,1),
279
-          #else
280
-            BTN_POS(1,7), BTN_SIZE(2,2),
281
-          #endif
282
-          isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA)
283
-        ).colors(!has_media ? action_btn : normal_btn)
284
-      #ifdef TOUCH_UI_PORTRAIT
285
-       .tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_MENU));
286
-      #else
287
-       .tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), GET_TEXT_F(MSG_BUTTON_MENU));
288
-    #endif
277
+       .tag(3).button(MEDIA_BTN_POS, isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA))
278
+       .colors(!has_media ? action_btn : normal_btn)
279
+       .tag(4).button( MENU_BTN_POS, GET_TEXT_F(MSG_BUTTON_MENU));
289 280
   }
290 281
   #undef  GRID_COLS
291 282
 }
292 283
 
293 284
 void StatusScreen::draw_status_message(draw_mode_t what, const char* message) {
294 285
   #define GRID_COLS 1
286
+
287
+  #if ENABLED(TOUCH_UI_PORTRAIT)
288
+    #define STATUS_POS  BTN_POS(1,4), BTN_SIZE(1,1)
289
+  #else
290
+    #define STATUS_POS  BTN_POS(1,3), BTN_SIZE(1,2)
291
+  #endif
292
+
295 293
   if (what & BACKGROUND) {
296 294
     CommandProcessor cmd;
297 295
     cmd.fgcolor(Theme::status_msg)
298 296
        .tag(0)
299
-    #ifdef TOUCH_UI_PORTRAIT
300
-       .button( BTN_POS(1,4), BTN_SIZE(1,1), F(""), OPT_FLAT);
301
-    #else
302
-       .button( BTN_POS(1,3), BTN_SIZE(1,2), F(""), OPT_FLAT);
303
-    #endif
297
+       .button( STATUS_POS, F(""), OPT_FLAT);
304 298
 
305
-    draw_text_box(cmd,
306
-    #ifdef TOUCH_UI_PORTRAIT
307
-      BTN_POS(1,4), BTN_SIZE(1,1),
308
-    #else
309
-      BTN_POS(1,3), BTN_SIZE(1,2),
310
-    #endif
311
-      message, OPT_CENTER, font_large);
299
+    draw_text_box(cmd, STATUS_POS, message, OPT_CENTER, font_large);
312 300
   }
313 301
   #undef  GRID_COLS
314 302
 }
@@ -326,10 +314,10 @@ void StatusScreen::setStatusMessage(const char* message) {
326 314
      .cmd(CLEAR(true,true,true));
327 315
 
328 316
   draw_temperature(BACKGROUND);
329
-  draw_progress(BACKGROUND);
330
-  draw_axis_position(BACKGROUND);
331 317
   draw_status_message(BACKGROUND, message);
332 318
   draw_interaction_buttons(BACKGROUND);
319
+  draw_progress(BACKGROUND);
320
+  draw_axis_position(BACKGROUND);
333 321
 
334 322
   storeBackground();
335 323
 

+ 128
- 100
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h View File

@@ -24,121 +24,149 @@
24 24
 #pragma once
25 25
 
26 26
 namespace Theme {
27
-  #ifdef TOUCH_UI_LULZBOT_BIO
28
-    // The Lulzbot Bio uses the color PANTONE 2175C on the case silkscreen.
29
-    // This translates to HSL(208°, 100%, 39%) as an accent color on the GUI.
30
-
31
-    constexpr int   accent_hue          = 208;
32
-    constexpr float accent_sat          = 0.5;
33
-
34
-    constexpr uint32_t logo_bg_rgb      = 0xffffff;
35
-    constexpr uint32_t logo_fill_rgb    = 0xffffff;
36
-    constexpr uint32_t logo_stroke_rgb  = hsl_to_rgb(accent_hue, 1.0, 0.39);
27
+  #if ENABLED(TOUCH_UI_COCOA_THEME)
28
+    constexpr int      accent_hue           = 23;
29
+
30
+    // Browns and Oranges
31
+    constexpr uint32_t accent_color_1       = hsl_to_rgb(12.8,0.597,0.263); // Darkest
32
+    constexpr uint32_t accent_color_2       = hsl_to_rgb(12.8,0.597,0.263);
33
+    constexpr uint32_t accent_color_3       = hsl_to_rgb( 9.6,0.664,0.443);
34
+    constexpr uint32_t accent_color_4       = hsl_to_rgb(16.3,0.873,0.537);
35
+    constexpr uint32_t accent_color_5       = hsl_to_rgb(23.0,0.889,0.539);
36
+    constexpr uint32_t accent_color_6       = hsl_to_rgb(23.0,0.889,0.539); // Lightest
37 37
   #else
38
-    // The Lulzbot logo uses the color PANTONE 382c.
39
-    // This translates to HSL(68°, 68%, 52%) as an accent color on the GUI.
40
-
41
-    constexpr int   accent_hue          = 68;
42
-    constexpr float accent_sat          = 0.68;
43
-
44
-    constexpr uint32_t logo_bg_rgb      = hsl_to_rgb(accent_hue, 0.77, 0.64);
45
-    constexpr uint32_t logo_fill_rgb    = hsl_to_rgb(accent_hue, 0.68, 0.52); // Lulzbot Green
46
-    constexpr uint32_t logo_stroke_rgb  = 0x000000;
38
+    // Use linear accent colors
39
+
40
+    #if ANY(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME)
41
+        // Dark blue accent colors
42
+        constexpr int      accent_hue       = 216;
43
+        constexpr float    accent_sat       = 0.7;
44
+    #else
45
+        // Green accent colors
46
+        constexpr int      accent_hue       = 68;
47
+        constexpr float    accent_sat       = 0.68;
48
+    #endif
49
+
50
+    // Shades of accent color
51
+    constexpr uint32_t accent_color_0       = hsl_to_rgb(accent_hue, accent_sat, 0.15); // Darkest
52
+    constexpr uint32_t accent_color_1       = hsl_to_rgb(accent_hue, accent_sat, 0.26);
53
+    constexpr uint32_t accent_color_2       = hsl_to_rgb(accent_hue, accent_sat, 0.39);
54
+    constexpr uint32_t accent_color_3       = hsl_to_rgb(accent_hue, accent_sat, 0.52);
55
+    constexpr uint32_t accent_color_4       = hsl_to_rgb(accent_hue, accent_sat, 0.65);
56
+    constexpr uint32_t accent_color_5       = hsl_to_rgb(accent_hue, accent_sat, 0.78);
57
+    constexpr uint32_t accent_color_6       = hsl_to_rgb(accent_hue, accent_sat, 0.91); // Lightest
47 58
   #endif
48 59
 
49
-  // Shades of accent color
60
+  // Shades of gray
50 61
 
51
-  #ifdef TOUCH_UI_COCOA_PRESS
52
-    constexpr uint32_t accent_color_1   = hsl_to_rgb(12.8,0.597,0.263); // Darkest
53
-    constexpr uint32_t accent_color_2   = hsl_to_rgb(12.8,0.597,0.263);
54
-    constexpr uint32_t accent_color_3   = hsl_to_rgb( 9.6,0.664,0.443);
55
-    constexpr uint32_t accent_color_4   = hsl_to_rgb(16.3,0.873,0.537);
56
-    constexpr uint32_t accent_color_5   = hsl_to_rgb(23.0,0.889,0.539);
57
-    constexpr uint32_t accent_color_6   = hsl_to_rgb(23.0,0.889,0.539); // Lightest
62
+  constexpr float    gray_sat               = 0.14;
63
+  constexpr uint32_t gray_color_0           = hsl_to_rgb(accent_hue, gray_sat, 0.15); // Darkest
64
+  constexpr uint32_t gray_color_1           = hsl_to_rgb(accent_hue, gray_sat, 0.26);
65
+  constexpr uint32_t gray_color_2           = hsl_to_rgb(accent_hue, gray_sat, 0.39);
66
+  constexpr uint32_t gray_color_3           = hsl_to_rgb(accent_hue, gray_sat, 0.52);
67
+  constexpr uint32_t gray_color_4           = hsl_to_rgb(accent_hue, gray_sat, 0.65);
68
+  constexpr uint32_t gray_color_5           = hsl_to_rgb(accent_hue, gray_sat, 0.78);
69
+  constexpr uint32_t gray_color_6           = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest
70
+
71
+  #if ENABLED(TOUCH_UI_ROYAL_THEME)
72
+    constexpr uint32_t theme_darkest        = accent_color_1;
73
+    constexpr uint32_t theme_dark           = accent_color_4;
74
+
75
+    constexpr uint32_t bg_color             = gray_color_0;
76
+    constexpr uint32_t axis_label           = gray_color_1;
77
+
78
+    constexpr uint32_t bg_text_enabled      = accent_color_6;
79
+    constexpr uint32_t bg_text_disabled     = gray_color_0;
80
+    constexpr uint32_t bg_normal            = accent_color_4;
81
+    constexpr uint32_t fg_disabled          = gray_color_0;
82
+    constexpr uint32_t fg_normal            = accent_color_0;
83
+    constexpr uint32_t fg_action            = accent_color_1;
84
+
85
+    constexpr uint32_t logo_bg_rgb          = accent_color_1;
86
+    constexpr uint32_t logo_fill_rgb        = accent_color_0;
87
+    constexpr uint32_t logo_stroke_rgb      = accent_color_4;
88
+  #elif ANY(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME)
89
+    constexpr uint32_t theme_darkest        = accent_color_1;
90
+    constexpr uint32_t theme_dark           = accent_color_4;
91
+
92
+    constexpr uint32_t bg_color             = 0xFFFFFF;
93
+    constexpr uint32_t axis_label           = gray_color_5;
94
+
95
+    constexpr uint32_t bg_text_enabled      = accent_color_1;
96
+    constexpr uint32_t bg_text_disabled     = gray_color_1;
97
+    constexpr uint32_t bg_normal            = accent_color_4;
98
+    constexpr uint32_t fg_disabled          = gray_color_6;
99
+    constexpr uint32_t fg_normal            = accent_color_1;
100
+    constexpr uint32_t fg_action            = accent_color_4;
101
+
102
+    constexpr uint32_t logo_bg_rgb          = accent_color_5;
103
+    constexpr uint32_t logo_fill_rgb        = accent_color_6;
104
+    constexpr uint32_t logo_stroke_rgb      = accent_color_2;
58 105
   #else
59
-    constexpr uint32_t accent_color_1   = hsl_to_rgb(accent_hue, accent_sat, 0.26); // Darkest
60
-    constexpr uint32_t accent_color_2   = hsl_to_rgb(accent_hue, accent_sat, 0.39);
61
-    constexpr uint32_t accent_color_3   = hsl_to_rgb(accent_hue, accent_sat, 0.52);
62
-    constexpr uint32_t accent_color_4   = hsl_to_rgb(accent_hue, accent_sat, 0.65);
63
-    constexpr uint32_t accent_color_5   = hsl_to_rgb(accent_hue, accent_sat, 0.78);
64
-    constexpr uint32_t accent_color_6   = hsl_to_rgb(accent_hue, accent_sat, 0.91); // Lightest
106
+    constexpr uint32_t theme_darkest        = gray_color_1;
107
+    constexpr uint32_t theme_dark           = gray_color_2;
108
+
109
+    constexpr uint32_t bg_color             = gray_color_1;
110
+    constexpr uint32_t axis_label           = gray_color_2;
111
+
112
+    constexpr uint32_t bg_text_enabled      = 0xFFFFFF;
113
+    constexpr uint32_t bg_text_disabled     = gray_color_2;
114
+    constexpr uint32_t bg_normal            = gray_color_1;
115
+    constexpr uint32_t fg_disabled          = gray_color_1;
116
+    constexpr uint32_t fg_normal            = gray_color_2;
117
+    constexpr uint32_t fg_action            = accent_color_2;
118
+
119
+    constexpr uint32_t logo_bg_rgb          = accent_color_4;
120
+    constexpr uint32_t logo_fill_rgb        = accent_color_3;
121
+    constexpr uint32_t logo_stroke_rgb      = 0x000000;
65 122
   #endif
66 123
 
67
-  // Shades of gray
68
-
69
-  constexpr float gray_sat = 0.14;
124
+  constexpr uint32_t shadow_rgb             = gray_color_6;
125
+  constexpr uint32_t stroke_rgb             = accent_color_1;
126
+  constexpr uint32_t fill_rgb               = accent_color_3;
127
+  constexpr uint32_t syringe_rgb            = accent_color_5;
70 128
 
71
-  constexpr uint32_t gray_color_1       = hsl_to_rgb(accent_hue, gray_sat, 0.26); // Darkest
72
-  constexpr uint32_t gray_color_2       = hsl_to_rgb(accent_hue, gray_sat, 0.39);
73
-  constexpr uint32_t gray_color_3       = hsl_to_rgb(accent_hue, gray_sat, 0.52);
74
-  constexpr uint32_t gray_color_4       = hsl_to_rgb(accent_hue, gray_sat, 0.65);
75
-  constexpr uint32_t gray_color_5       = hsl_to_rgb(accent_hue, gray_sat, 0.78);
76
-  constexpr uint32_t gray_color_6       = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest
77
-
78
-  #if NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
79
-    // Lulzbot TAZ Pro
80
-    constexpr uint32_t theme_darkest    = gray_color_1;
81
-    constexpr uint32_t theme_dark       = gray_color_2;
82
-
83
-    constexpr uint32_t bg_color         = theme_darkest;
84
-    constexpr uint32_t bg_text_disabled = theme_dark;
85
-    constexpr uint32_t bg_text_enabled  = 0xFFFFFF;
86
-    constexpr uint32_t bg_normal        = theme_darkest;
87
-
88
-    constexpr uint32_t fg_normal        = theme_dark;
89
-    constexpr uint32_t fg_action        = accent_color_2;
90
-    constexpr uint32_t fg_disabled      = theme_darkest;
129
+  #if ENABLED(TOUCH_UI_ROYAL_THEME)
130
+    constexpr uint32_t x_axis               = hsl_to_rgb(0,   1.00, 0.26);
131
+    constexpr uint32_t y_axis               = hsl_to_rgb(120, 1.00, 0.13);
132
+    constexpr uint32_t z_axis               = hsl_to_rgb(240, 1.00, 0.10); 
91 133
   #else
92
-    // Lulzbot Bio
93
-    constexpr uint32_t theme_darkest    = accent_color_1;
94
-    constexpr uint32_t theme_dark       = accent_color_4;
95
-
96
-    constexpr uint32_t bg_color         = 0xFFFFFF;
97
-    constexpr uint32_t bg_text_disabled = gray_color_1;
98
-    constexpr uint32_t bg_text_enabled  = accent_color_1;
99
-    constexpr uint32_t bg_normal        = accent_color_4;
100
-
101
-    constexpr uint32_t fg_normal        = accent_color_1;
102
-    constexpr uint32_t fg_action        = accent_color_4;
103
-    constexpr uint32_t fg_disabled      = gray_color_6;
104
-
105
-    constexpr uint32_t shadow_rgb       = gray_color_6;
106
-    constexpr uint32_t stroke_rgb       = accent_color_1;
107
-    constexpr uint32_t fill_rgb         = accent_color_3;
108
-    constexpr uint32_t syringe_rgb      = accent_color_5;
134
+    constexpr uint32_t x_axis               = hsl_to_rgb(0,   1.00, 0.5);
135
+    constexpr uint32_t y_axis               = hsl_to_rgb(120, 1.00, 0.37);
136
+    constexpr uint32_t z_axis               = hsl_to_rgb(240, 1.00, 0.37);
109 137
   #endif
110
-
111
-  constexpr uint32_t x_axis             = 0xFF0000;
112
-  constexpr uint32_t y_axis             = 0x00BB00;
113
-  constexpr uint32_t z_axis             = 0x0000BF;
114
-  constexpr uint32_t e_axis             = gray_color_2;
115
-  constexpr uint32_t feedrate           = gray_color_2;
116
-  constexpr uint32_t other              = gray_color_2;
138
+  constexpr uint32_t e_axis                 = axis_label;
139
+  constexpr uint32_t feedrate               = axis_label;
140
+  constexpr uint32_t other                  = axis_label;
117 141
 
118 142
   // Status screen
119
-  constexpr uint32_t progress           = gray_color_2;
120
-  constexpr uint32_t status_msg         = gray_color_2;
121
-  constexpr uint32_t fan_speed          = 0x377198;
122
-  constexpr uint32_t temp               = 0x892c78;
123
-  constexpr uint32_t axis_label         = gray_color_2;
143
+  constexpr uint32_t progress               = axis_label;
144
+  constexpr uint32_t status_msg             = axis_label;
145
+  #if ENABLED(TOUCH_UI_ROYAL_THEME)
146
+    constexpr uint32_t fan_speed            = hsl_to_rgb(240, 0.5, 0.13);
147
+    constexpr uint32_t temp                 = hsl_to_rgb(343, 1.0, 0.23);
148
+  #else
149
+    constexpr uint32_t fan_speed            = hsl_to_rgb(204, 0.47, 0.41);
150
+    constexpr uint32_t temp                 = hsl_to_rgb(311, 0.51, 0.35);
151
+  #endif
124 152
 
125
-  constexpr uint32_t disabled_icon      = gray_color_1;
153
+  constexpr uint32_t disabled_icon          = gray_color_1;
126 154
 
127 155
   // Calibration Registers Screen
128
-  constexpr uint32_t transformA         = 0x3010D0;
129
-  constexpr uint32_t transformB         = 0x4010D0;
130
-  constexpr uint32_t transformC         = 0x5010D0;
131
-  constexpr uint32_t transformD         = 0x6010D0;
132
-  constexpr uint32_t transformE         = 0x7010D0;
133
-  constexpr uint32_t transformF         = 0x8010D0;
134
-  constexpr uint32_t transformVal       = 0x104010;
135
-
136
-  constexpr btn_colors disabled_btn     = {.bg = bg_color,      .grad = fg_disabled, .fg = fg_disabled,  .rgb = fg_disabled };
137
-  constexpr btn_colors normal_btn       = {.bg = fg_action,     .grad = 0xFFFFFF,    .fg = fg_normal,    .rgb = 0xFFFFFF };
138
-  constexpr btn_colors action_btn       = {.bg = bg_color,      .grad = 0xFFFFFF,    .fg = fg_action,    .rgb = 0xFFFFFF };
139
-  constexpr btn_colors red_btn          = {.bg = 0xFF5555,      .grad = 0xFFFFFF,    .fg = 0xFF0000,     .rgb = 0xFFFFFF };
140
-  constexpr btn_colors ui_slider        = {.bg = theme_darkest, .grad = 0xFFFFFF,    .fg = theme_dark,   .rgb = accent_color_3 };
141
-  constexpr btn_colors ui_toggle        = {.bg = theme_darkest, .grad = 0xFFFFFF,    .fg = theme_dark,   .rgb = 0xFFFFFF };
156
+  constexpr uint32_t transformA             = 0x3010D0;
157
+  constexpr uint32_t transformB             = 0x4010D0;
158
+  constexpr uint32_t transformC             = 0x5010D0;
159
+  constexpr uint32_t transformD             = 0x6010D0;
160
+  constexpr uint32_t transformE             = 0x7010D0;
161
+  constexpr uint32_t transformF             = 0x8010D0;
162
+  constexpr uint32_t transformVal           = 0x104010;
163
+
164
+  constexpr btn_colors disabled_btn         = {.bg = bg_color,      .grad = fg_disabled, .fg = fg_disabled,  .rgb = fg_disabled };
165
+  constexpr btn_colors normal_btn           = {.bg = fg_action,     .grad = 0xFFFFFF,    .fg = fg_normal,    .rgb = 0xFFFFFF };
166
+  constexpr btn_colors action_btn           = {.bg = bg_color,      .grad = 0xFFFFFF,    .fg = fg_action,    .rgb = 0xFFFFFF };
167
+  constexpr btn_colors red_btn              = {.bg = 0xFF5555,      .grad = 0xFFFFFF,    .fg = 0xFF0000,     .rgb = 0xFFFFFF };
168
+  constexpr btn_colors ui_slider            = {.bg = theme_darkest, .grad = 0xFFFFFF,    .fg = theme_dark,   .rgb = accent_color_3 };
169
+  constexpr btn_colors ui_toggle            = {.bg = theme_darkest, .grad = 0xFFFFFF,    .fg = theme_dark,   .rgb = 0xFFFFFF };
142 170
 
143 171
   // Temperature color scale
144 172
 

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h View File

@@ -35,5 +35,5 @@ const PROGMEM uint16_t logo_stroke[] = {0xADF3, 0x546C, 0x419D, 0x546F, 0x3D05,
35 35
 
36 36
 #define LOGO_BACKGROUND logo_bg_rgb
37 37
 #define LOGO_PAINT_PATHS \
38
-  LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \
39
-  LOGO_PAINT_PATH(logo_fill_rgb,   logo_fill)
38
+  LOGO_PAINT_PATH(logo_fill_rgb,   logo_fill) \
39
+  LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke)

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h View File

@@ -35,5 +35,5 @@ const PROGMEM uint16_t logo_stroke[] = {0x3C19, 0x70C5, 0x371A, 0x7159, 0x3302,
35 35
 
36 36
 #define LOGO_BACKGROUND logo_bg_rgb
37 37
 #define LOGO_PAINT_PATHS \
38
-  LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \
39
-  LOGO_PAINT_PATH(logo_fill_rgb,   logo_fill)
38
+  LOGO_PAINT_PATH(logo_fill_rgb,   logo_fill) \
39
+  LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke)

+ 0
- 0
Marlin/src/lcd/extui/ui_api.h View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save