Browse Source

Clean up after changes

Scott Lahteine 3 years ago
parent
commit
bc688f27dc

+ 4
- 9
Marlin/Configuration.h View File

2142
 
2142
 
2143
 //
2143
 //
2144
 // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
2144
 // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
2145
+// Upscaled 128x64 Marlin UI
2145
 //
2146
 //
2146
 //#define FSMC_GRAPHICAL_TFT
2147
 //#define FSMC_GRAPHICAL_TFT
2147
 
2148
 
2149
 // TFT LVGL UI
2150
 // TFT LVGL UI
2150
 //
2151
 //
2151
 // Using default MKS icons and fonts from: https://git.io/JJvzK
2152
 // Using default MKS icons and fonts from: https://git.io/JJvzK
2152
-// Just copy the `assets` folder from the build directory to the
2153
+// Just copy the 'assets' folder from the build directory to the
2153
 // root of your SD card, together with the compiled firmware.
2154
 // root of your SD card, together with the compiled firmware.
2154
 //
2155
 //
2155
-// Robin nano v1.2 uses FSMC
2156
-//
2157
-//#define TFT_LVGL_UI_FSMC
2158
-
2159
-// Robin nano v2.0 uses SPI
2160
-//
2161
-//#define TFT_LVGL_UI_SPI
2162
-
2156
+//#define TFT_LVGL_UI_FSMC  // Robin nano v1.2 uses FSMC
2157
+//#define TFT_LVGL_UI_SPI   // Robin nano v2.0 uses SPI
2163
 
2158
 
2164
 //=============================================================================
2159
 //=============================================================================
2165
 //============================  Other Controllers  ============================
2160
 //============================  Other Controllers  ============================

+ 1
- 1
Marlin/src/HAL/STM32/HAL.cpp View File

63
 void HAL_init() {
63
 void HAL_init() {
64
   FastIO_init();
64
   FastIO_init();
65
 
65
 
66
-  #if ENABLED(SDSUPPORT)
66
+  #if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT)
67
     OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
67
     OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
68
   #endif
68
   #endif
69
 
69
 

+ 1
- 4
Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp View File

41
   }
41
   }
42
 
42
 
43
   bool SDIO_Init() {
43
   bool SDIO_Init() {
44
-    if (hsd.State == HAL_SD_STATE_READY) return 1;  // return passing status
45
-    return 0;                                       // return failing status
44
+    return hsd.State == HAL_SD_STATE_READY;  // return pass/fail status
46
   }
45
   }
47
 
46
 
48
   bool SDIO_ReadBlock(uint32_t block, uint8_t *src) {
47
   bool SDIO_ReadBlock(uint32_t block, uint8_t *src) {
58
 #else // !USBD_USE_CDC_COMPOSITE
57
 #else // !USBD_USE_CDC_COMPOSITE
59
 
58
 
60
   // use local drivers
59
   // use local drivers
61
-
62
   #if defined(STM32F103xE) || defined(STM32F103xG)
60
   #if defined(STM32F103xE) || defined(STM32F103xG)
63
     #include <stm32f1xx_hal_rcc_ex.h>
61
     #include <stm32f1xx_hal_rcc_ex.h>
64
     #include <stm32f1xx_hal_sd.h>
62
     #include <stm32f1xx_hal_sd.h>
274
   bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
272
   bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
275
     hsd.Instance = SDIO;
273
     hsd.Instance = SDIO;
276
     uint8_t retryCnt = SD_RETRY_COUNT;
274
     uint8_t retryCnt = SD_RETRY_COUNT;
277
-
278
     bool status;
275
     bool status;
279
     for (;;) {
276
     for (;;) {
280
       status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500);  // write one 512 byte block with 500mS timeout
277
       status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500);  // write one 512 byte block with 500mS timeout

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

64
 #define _GET_MODE(IO)
64
 #define _GET_MODE(IO)
65
 #define _SET_MODE(IO,M)         pinMode(IO, M)
65
 #define _SET_MODE(IO,M)         pinMode(IO, M)
66
 #define _SET_OUTPUT(IO)         pinMode(IO, OUTPUT)                               /*!< Output Push Pull Mode & GPIO_NOPULL   */
66
 #define _SET_OUTPUT(IO)         pinMode(IO, OUTPUT)                               /*!< Output Push Pull Mode & GPIO_NOPULL   */
67
+#define _SET_OUTPUT_OD(IO)      pinMode(IO, OUTPUT_OPEN_DRAIN)
67
 
68
 
68
 #define WRITE(IO,V)             _WRITE(IO,V)
69
 #define WRITE(IO,V)             _WRITE(IO,V)
69
 #define READ(IO)                _READ(IO)
70
 #define READ(IO)                _READ(IO)
70
 #define TOGGLE(IO)              _TOGGLE(IO)
71
 #define TOGGLE(IO)              _TOGGLE(IO)
71
 
72
 
72
 #define OUT_WRITE(IO,V)         do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
73
 #define OUT_WRITE(IO,V)         do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
74
+#define OUT_WRITE_OD(IO,V)      do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0)
73
 
75
 
74
 #define SET_INPUT(IO)           _SET_MODE(IO, INPUT)                              /*!< Input Floating Mode                   */
76
 #define SET_INPUT(IO)           _SET_MODE(IO, INPUT)                              /*!< Input Floating Mode                   */
75
 #define SET_INPUT_PULLUP(IO)    _SET_MODE(IO, INPUT_PULLUP)                       /*!< Input with Pull-up activation         */
77
 #define SET_INPUT_PULLUP(IO)    _SET_MODE(IO, INPUT_PULLUP)                       /*!< Input with Pull-up activation         */

+ 5
- 0
Marlin/src/HAL/STM32F1/inc/Conditionals_post.h View File

27
 #elif EITHER(I2C_EEPROM, SPI_EEPROM)
27
 #elif EITHER(I2C_EEPROM, SPI_EEPROM)
28
   #define USE_SHARED_EEPROM 1
28
   #define USE_SHARED_EEPROM 1
29
 #endif
29
 #endif
30
+
31
+// Allow SDSUPPORT to be disabled
32
+#if DISABLED(SDSUPPORT)
33
+  #undef SDIO_SUPPORT
34
+#endif

+ 0
- 4
Marlin/src/HAL/STM32F1/inc/SanityCheck.h View File

29
   #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
29
   #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
30
 #endif
30
 #endif
31
 
31
 
32
-#if ENABLED(SDIO_SUPPORT) && DISABLED(SDSUPPORT)
33
-  #error "SDIO_SUPPORT requires SDSUPPORT. Enable SDSUPPORT to continue."
34
-#endif
35
-
36
 #if ENABLED(FAST_PWM_FAN)
32
 #if ENABLED(FAST_PWM_FAN)
37
   #error "FAST_PWM_FAN is not yet implemented for this platform."
33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
38
 #endif
34
 #endif

+ 1
- 1
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp View File

597
     case U8G_DEV_MSG_INIT:
597
     case U8G_DEV_MSG_INIT:
598
       dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id);
598
       dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id);
599
 
599
 
600
-      switch(lcd_id & 0xFFFF) {
600
+      switch (lcd_id & 0xFFFF) {
601
         case 0x8552:   // ST7789V
601
         case 0x8552:   // ST7789V
602
           #ifdef LCD_USE_DMA_FSMC
602
           #ifdef LCD_USE_DMA_FSMC
603
             writeEscSequence(st7789v_init);
603
             writeEscSequence(st7789v_init);

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp View File

95
   buttonPausePos = lv_btn_create(scr, NULL);   /*Add a button the current screen*/
95
   buttonPausePos = lv_btn_create(scr, NULL);   /*Add a button the current screen*/
96
   lv_obj_set_pos(buttonPausePos, PARA_UI_POS_X, PARA_UI_POS_Y);                         /*Set its position*/
96
   lv_obj_set_pos(buttonPausePos, PARA_UI_POS_X, PARA_UI_POS_Y);                         /*Set its position*/
97
   lv_obj_set_size(buttonPausePos, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);                       /*Set its size*/
97
   lv_obj_set_size(buttonPausePos, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);                       /*Set its size*/
98
-  // lv_obj_set_event_cb(buttonMachine, event_handler);
98
+  //lv_obj_set_event_cb(buttonMachine, event_handler);
99
   lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0);
99
   lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0);
100
   lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
100
   lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
101
   lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_PR, &tft_style_label_pre);    /*Set the button's pressed style*/
101
   lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_PR, &tft_style_label_pre);    /*Set the button's pressed style*/

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp View File

137
   buttonMachine = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
137
   buttonMachine = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
138
   lv_obj_set_pos(buttonMachine, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
138
   lv_obj_set_pos(buttonMachine, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
139
   lv_obj_set_size(buttonMachine, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
139
   lv_obj_set_size(buttonMachine, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
140
-  // lv_obj_set_event_cb(buttonMachine, event_handler);
140
+  //lv_obj_set_event_cb(buttonMachine, event_handler);
141
   lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0);
141
   lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0);
142
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
142
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
143
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
143
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
159
   buttonMotor = lv_btn_create(scr, NULL);                                   /*Add a button the current screen*/
159
   buttonMotor = lv_btn_create(scr, NULL);                                   /*Add a button the current screen*/
160
   lv_obj_set_pos(buttonMotor, PARA_UI_POS_X, PARA_UI_POS_Y * 2);            /*Set its position*/
160
   lv_obj_set_pos(buttonMotor, PARA_UI_POS_X, PARA_UI_POS_Y * 2);            /*Set its position*/
161
   lv_obj_set_size(buttonMotor, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);             /*Set its size*/
161
   lv_obj_set_size(buttonMotor, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);             /*Set its size*/
162
-  // lv_obj_set_event_cb(buttonMotor, event_handler);
162
+  //lv_obj_set_event_cb(buttonMotor, event_handler);
163
   lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0);
163
   lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0);
164
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_REL, &tft_style_label_rel);    /*Set the button's released style*/
164
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_REL, &tft_style_label_rel);    /*Set the button's released style*/
165
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_PR, &tft_style_label_pre);     /*Set the button's pressed style*/
165
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_PR, &tft_style_label_pre);     /*Set the button's pressed style*/
181
   buttonAdvance = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
181
   buttonAdvance = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
182
   lv_obj_set_pos(buttonAdvance, PARA_UI_POS_X, PARA_UI_POS_Y * 3);          /*Set its position*/
182
   lv_obj_set_pos(buttonAdvance, PARA_UI_POS_X, PARA_UI_POS_Y * 3);          /*Set its position*/
183
   lv_obj_set_size(buttonAdvance, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
183
   lv_obj_set_size(buttonAdvance, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
184
-  // lv_obj_set_event_cb(buttonMotor, event_handler);
184
+  //lv_obj_set_event_cb(buttonMotor, event_handler);
185
   lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0);
185
   lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0);
186
   lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
186
   lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
187
   lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
187
   lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp View File

144
   buttonAcceleration = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
144
   buttonAcceleration = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
145
   lv_obj_set_pos(buttonAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y);             /*Set its position*/
145
   lv_obj_set_pos(buttonAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y);             /*Set its position*/
146
   lv_obj_set_size(buttonAcceleration, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
146
   lv_obj_set_size(buttonAcceleration, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
147
-  // lv_obj_set_event_cb(buttonMachine, event_handler);
147
+  //lv_obj_set_event_cb(buttonMachine, event_handler);
148
   lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0);
148
   lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0);
149
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
149
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
150
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
150
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
166
   buttonMaxFeedrate = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
166
   buttonMaxFeedrate = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
167
   lv_obj_set_pos(buttonMaxFeedrate, PARA_UI_POS_X, PARA_UI_POS_Y * 2);          /*Set its position*/
167
   lv_obj_set_pos(buttonMaxFeedrate, PARA_UI_POS_X, PARA_UI_POS_Y * 2);          /*Set its position*/
168
   lv_obj_set_size(buttonMaxFeedrate, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
168
   lv_obj_set_size(buttonMaxFeedrate, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
169
-  // lv_obj_set_event_cb(buttonMachine, event_handler);
169
+  //lv_obj_set_event_cb(buttonMachine, event_handler);
170
   lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0);
170
   lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0);
171
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
171
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
172
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
172
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
189
     buttonJerk = lv_btn_create(scr, NULL);                                      /*Add a button the current screen*/
189
     buttonJerk = lv_btn_create(scr, NULL);                                      /*Add a button the current screen*/
190
     lv_obj_set_pos(buttonJerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3);               /*Set its position*/
190
     lv_obj_set_pos(buttonJerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3);               /*Set its position*/
191
     lv_obj_set_size(buttonJerk, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);                /*Set its size*/
191
     lv_obj_set_size(buttonJerk, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);                /*Set its size*/
192
-    // lv_obj_set_event_cb(buttonMotor, event_handler);
192
+    //lv_obj_set_event_cb(buttonMotor, event_handler);
193
     lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0);
193
     lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0);
194
     lv_btn_set_style(buttonJerk, LV_BTN_STYLE_REL, &tft_style_label_rel);       /*Set the button's released style*/
194
     lv_btn_set_style(buttonJerk, LV_BTN_STYLE_REL, &tft_style_label_rel);       /*Set the button's released style*/
195
     lv_btn_set_style(buttonJerk, LV_BTN_STYLE_PR, &tft_style_label_pre);        /*Set the button's pressed style*/
195
     lv_btn_set_style(buttonJerk, LV_BTN_STYLE_PR, &tft_style_label_pre);        /*Set the button's pressed style*/

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp View File

147
   buttonSteps = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
147
   buttonSteps = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
148
   lv_obj_set_pos(buttonSteps, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
148
   lv_obj_set_pos(buttonSteps, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
149
   lv_obj_set_size(buttonSteps, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
149
   lv_obj_set_size(buttonSteps, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);           /*Set its size*/
150
-  // lv_obj_set_event_cb(buttonMachine, event_handler);
150
+  //lv_obj_set_event_cb(buttonMachine, event_handler);
151
   lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0);
151
   lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0);
152
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
152
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
153
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
153
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
169
     buttonTMCcurrent = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
169
     buttonTMCcurrent = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
170
     lv_obj_set_pos(buttonTMCcurrent, PARA_UI_POS_X, PARA_UI_POS_Y * 2);         /*Set its position*/
170
     lv_obj_set_pos(buttonTMCcurrent, PARA_UI_POS_X, PARA_UI_POS_Y * 2);         /*Set its position*/
171
     lv_obj_set_size(buttonTMCcurrent, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
171
     lv_obj_set_size(buttonTMCcurrent, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
172
-    // lv_obj_set_event_cb(buttonMachine, event_handler);
172
+    //lv_obj_set_event_cb(buttonMachine, event_handler);
173
     lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0);
173
     lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0);
174
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
174
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
175
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
175
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
192
       buttonStepMode = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
192
       buttonStepMode = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
193
       lv_obj_set_pos(buttonStepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 3);         /*Set its position*/
193
       lv_obj_set_pos(buttonStepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 3);         /*Set its position*/
194
       lv_obj_set_size(buttonStepMode, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
194
       lv_obj_set_size(buttonStepMode, PARA_UI_SIZE_X, PARA_UI_SIZE_Y);          /*Set its size*/
195
-      // lv_obj_set_event_cb(buttonMachine, event_handler);
195
+      //lv_obj_set_event_cb(buttonMachine, event_handler);
196
       lv_obj_set_event_cb_mks(buttonStepMode, event_handler, ID_MOTOR_STEP_MODE, NULL, 0);
196
       lv_obj_set_event_cb_mks(buttonStepMode, event_handler, ID_MOTOR_STEP_MODE, NULL, 0);
197
       lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
197
       lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
198
       lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
198
       lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp View File

228
     lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre);
228
     lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre);
229
     lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_label_rel);
229
     lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_label_rel);
230
 
230
 
231
-    // lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0);
231
+    //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0);
232
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic);
232
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic);
233
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic);
233
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic);
234
     lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_label_pre);
234
     lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_label_pre);

+ 6
- 4
Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp View File

72
         const uint16_t nr = SD_ORDER(i, fileCnt);
72
         const uint16_t nr = SD_ORDER(i, fileCnt);
73
         card.getfilename_sorted(nr);
73
         card.getfilename_sorted(nr);
74
 
74
 
75
-        if (card.flag.filenameIsDir)
75
+        if (card.flag.filenameIsDir) {
76
           //SERIAL_ECHOLN(card.longest_filename);
76
           //SERIAL_ECHOLN(card.longest_filename);
77
           list_file.IsFolder[valid_name_cnt] = 1;
77
           list_file.IsFolder[valid_name_cnt] = 1;
78
-        else
78
+        }
79
+        else {
79
           //SERIAL_ECHOLN(card.longFilename);
80
           //SERIAL_ECHOLN(card.longFilename);
80
           list_file.IsFolder[valid_name_cnt] = 0;
81
           list_file.IsFolder[valid_name_cnt] = 0;
82
+        }
81
 
83
 
82
         #if 1
84
         #if 1
83
           //
85
           //
523
         //Color = (*p_index >> 8);
525
         //Color = (*p_index >> 8);
524
         //*p_index = Color | ((*p_index & 0xff) << 8);
526
         //*p_index = Color | ((*p_index & 0xff) << 8);
525
         i += 2;
527
         i += 2;
526
-        if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3; //
528
+        if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3;
527
       }
529
       }
528
     #endif // TFT_LVGL_UI_SPI
530
     #endif // TFT_LVGL_UI_SPI
529
     memcpy(data_buf, public_buf, 200);
531
     memcpy(data_buf, public_buf, 200);
556
   #endif
558
   #endif
557
 
559
 
558
   beginIndex = (strIndex1 != 0
560
   beginIndex = (strIndex1 != 0
559
-                // && (strIndex2 != 0) && (strIndex1 < strIndex2)
561
+                //&& (strIndex2 != 0) && (strIndex1 < strIndex2)
560
                 ) ? strIndex1 + 1 : tmpFile;
562
                 ) ? strIndex1 + 1 : tmpFile;
561
 
563
 
562
   if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file
564
   if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file

+ 5
- 5
Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp View File

73
           stepperX.refresh_stepping_mode();
73
           stepperX.refresh_stepping_mode();
74
           lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_disable.bin", 0);
74
           lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_disable.bin", 0);
75
           lv_label_set_text(labelXState, machine_menu.disable);
75
           lv_label_set_text(labelXState, machine_menu.disable);
76
-          // lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
76
+          //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
77
           // gcode.process_subcommands_now_P(PSTR("M500"));
77
           // gcode.process_subcommands_now_P(PSTR("M500"));
78
         }
78
         }
79
         else {
79
         else {
96
           stepperY.refresh_stepping_mode();
96
           stepperY.refresh_stepping_mode();
97
           lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_disable.bin", 0);
97
           lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_disable.bin", 0);
98
           lv_label_set_text(labelYState, machine_menu.disable);
98
           lv_label_set_text(labelYState, machine_menu.disable);
99
-          // lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
99
+          //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
100
         }
100
         }
101
         else {
101
         else {
102
           stepperY.stored.stealthChop_enabled = true;
102
           stepperY.stored.stealthChop_enabled = true;
117
           stepperZ.refresh_stepping_mode();
117
           stepperZ.refresh_stepping_mode();
118
           lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_disable.bin", 0);
118
           lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_disable.bin", 0);
119
           lv_label_set_text(labelZState, machine_menu.disable);
119
           lv_label_set_text(labelZState, machine_menu.disable);
120
-          // lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
120
+          //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
121
         }
121
         }
122
         else {
122
         else {
123
           stepperZ.stored.stealthChop_enabled = true;
123
           stepperZ.stored.stealthChop_enabled = true;
138
           stepperE0.refresh_stepping_mode();
138
           stepperE0.refresh_stepping_mode();
139
           lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_disable.bin", 0);
139
           lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_disable.bin", 0);
140
           lv_label_set_text(labelE0State, machine_menu.disable);
140
           lv_label_set_text(labelE0State, machine_menu.disable);
141
-          // lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
141
+          //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
142
         }
142
         }
143
         else {
143
         else {
144
           stepperE0.stored.stealthChop_enabled = true;
144
           stepperE0.stored.stealthChop_enabled = true;
160
               stepperE1.refresh_stepping_mode();
160
               stepperE1.refresh_stepping_mode();
161
               lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_disable.bin", 0);
161
               lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_disable.bin", 0);
162
               lv_label_set_text(labelE1State, machine_menu.disable);
162
               lv_label_set_text(labelE1State, machine_menu.disable);
163
-              // lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
163
+              //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0);
164
             }
164
             }
165
             else {
165
             else {
166
               stepperE1.stored.stealthChop_enabled = true;
166
               stepperE1.stored.stealthChop_enabled = true;

+ 19
- 19
Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp View File

125
 
125
 
126
   scr = lv_obj_create(NULL, NULL);
126
   scr = lv_obj_create(NULL, NULL);
127
 
127
 
128
-  // static lv_style_t tool_style;
128
+  //static lv_style_t tool_style;
129
 
129
 
130
   lv_obj_set_style(scr, &tft_style_scr);
130
   lv_obj_set_style(scr, &tft_style_scr);
131
   lv_scr_load(scr);
131
   lv_scr_load(scr);
182
     lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_label_pre);
182
     lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_label_pre);
183
     lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_label_rel);
183
     lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_label_rel);
184
 
184
 
185
-    // lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0);
186
-    // lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic);
187
-    // lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic);
188
-    // lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre);
189
-    // lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel);
185
+    //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0);
186
+    //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic);
187
+    //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic);
188
+    //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre);
189
+    //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel);
190
 
190
 
191
-    // lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0);
192
-    // lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic);
193
-    // lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic);
194
-    // lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_label_pre);
195
-    // lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_label_rel);
191
+    //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0);
192
+    //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic);
193
+    //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic);
194
+    //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_label_pre);
195
+    //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_label_rel);
196
 
196
 
197
     lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, "bmp_return.bin", 0);
197
     lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, "bmp_return.bin", 0);
198
     lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic);
198
     lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic);
206
   lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight);
206
   lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight);
207
   lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight);
207
   lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight);
208
   lv_obj_set_pos(buttonLevel, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight);
208
   lv_obj_set_pos(buttonLevel, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight);
209
-  // lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight);
210
-  // lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight);
209
+  //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight);
210
+  //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight);
211
   lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight);
211
   lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight);
212
 
212
 
213
   /*Create a label on the Image button*/
213
   /*Create a label on the Image button*/
216
   lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF);
216
   lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF);
217
   lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF);
217
   lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF);
218
   lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF);
218
   lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF);
219
-  // lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF);
220
-  // lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF);
219
+  //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF);
220
+  //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF);
221
   lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
221
   lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
222
 
222
 
223
   lv_obj_t * labelPreHeat   = lv_label_create(buttonPreHeat, NULL);
223
   lv_obj_t * labelPreHeat   = lv_label_create(buttonPreHeat, NULL);
251
     lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling));
251
     lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling));
252
     lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
252
     lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
253
 
253
 
254
-    // lv_label_set_text(label_Filament, tool_menu.filament);
255
-    // lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
254
+    //lv_label_set_text(label_Filament, tool_menu.filament);
255
+    //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
256
 
256
 
257
-    // lv_label_set_text(label_More, tool_menu.more);
258
-    // lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
257
+    //lv_label_set_text(label_More, tool_menu.more);
258
+    //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
259
 
259
 
260
     lv_label_set_text(label_Back, common_menu.text_back);
260
     lv_label_set_text(label_Back, common_menu.text_back);
261
     lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
261
     lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);

+ 30
- 30
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp View File

361
       strcpy(public_buf_l, tool_menu.title);
361
       strcpy(public_buf_l, tool_menu.title);
362
       break;
362
       break;
363
     case WIFI_LIST_UI:
363
     case WIFI_LIST_UI:
364
-      // strcpy(public_buf_l, list_menu.title);
364
+      //strcpy(public_buf_l, list_menu.title);
365
       break;
365
       break;
366
     case MACHINE_PARA_UI:
366
     case MACHINE_PARA_UI:
367
       strcpy(public_buf_l, MachinePara_menu.title);
367
       strcpy(public_buf_l, MachinePara_menu.title);
386
   ZERO(tmpCurFileStr);
386
   ZERO(tmpCurFileStr);
387
 
387
 
388
   #if _LFN_UNICODE
388
   #if _LFN_UNICODE
389
-    // cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr);
389
+    //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr);
390
   #else
390
   #else
391
     cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr);
391
     cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr);
392
   #endif
392
   #endif
434
 
434
 
435
   void preview_gcode_prehandle(char *path) {
435
   void preview_gcode_prehandle(char *path) {
436
     #if ENABLED(SDSUPPORT)
436
     #if ENABLED(SDSUPPORT)
437
-      // uint8_t re;
438
-      // uint32_t read;
437
+      //uint8_t re;
438
+      //uint32_t read;
439
       uint32_t pre_read_cnt = 0;
439
       uint32_t pre_read_cnt = 0;
440
       uint32_t *p1;
440
       uint32_t *p1;
441
       char *cur_name;
441
       char *cur_name;
468
 
468
 
469
     void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) {
469
     void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) {
470
       #if ENABLED(SDSUPPORT)
470
       #if ENABLED(SDSUPPORT)
471
-        // uint8_t ress;
472
-        // uint32_t write;
471
+        //uint8_t ress;
472
+        //uint32_t write;
473
         volatile uint32_t i, j;
473
         volatile uint32_t i, j;
474
         volatile uint16_t *p_index;
474
         volatile uint16_t *p_index;
475
-        // int res;
475
+        //int res;
476
         char *cur_name;
476
         char *cur_name;
477
 
477
 
478
         cur_name = strrchr(path, '/');
478
         cur_name = strrchr(path, '/');
493
           }
493
           }
494
         }
494
         }
495
 
495
 
496
-        // SERIAL_ECHOLNPAIR("gPicturePreviewStart: ", gPicturePreviewStart, " PREVIEW_LITTLE_PIC_SIZE: ", PREVIEW_LITTLE_PIC_SIZE);
496
+        //SERIAL_ECHOLNPAIR("gPicturePreviewStart: ", gPicturePreviewStart, " PREVIEW_LITTLE_PIC_SIZE: ", PREVIEW_LITTLE_PIC_SIZE);
497
 
497
 
498
         card.setIndex((gPicturePreviewStart + To_pre_view) + size * row + 8);
498
         card.setIndex((gPicturePreviewStart + To_pre_view) + size * row + 8);
499
         #if ENABLED(TFT_LVGL_UI_SPI)
499
         #if ENABLED(TFT_LVGL_UI_SPI)
500
           SPI_TFT.spi_init(SPI_FULL_SPEED);
500
           SPI_TFT.spi_init(SPI_FULL_SPEED);
501
-          // SPI_TFT.SetCursor(0,0);
501
+          //SPI_TFT.SetCursor(0,0);
502
           SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1);
502
           SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1);
503
           SPI_TFT.LCD_WriteRAM_Prepare();
503
           SPI_TFT.LCD_WriteRAM_Prepare();
504
         #else
504
         #else
534
         #else
534
         #else
535
           for (i = 0; i < 400;) {
535
           for (i = 0; i < 400;) {
536
             p_index = (uint16_t *)(&bmp_public_buf[i]);
536
             p_index = (uint16_t *)(&bmp_public_buf[i]);
537
-            if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // gCfgItems.preview_bk_color;
537
+            if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color;
538
             LCD_IO_WriteData(*p_index);
538
             LCD_IO_WriteData(*p_index);
539
             i += 2;
539
             i += 2;
540
           }
540
           }
550
           row  = 0;
550
           row  = 0;
551
 
551
 
552
           gcode_preview_over = 0;
552
           gcode_preview_over = 0;
553
-          // flash_preview_begin = 1;
553
+          //flash_preview_begin = 1;
554
 
554
 
555
           card.closefile();
555
           card.closefile();
556
 
556
 
586
           card.openFileRead(cur_name);
586
           card.openFileRead(cur_name);
587
           if (card.isFileOpen()) {
587
           if (card.isFileOpen()) {
588
             feedrate_percentage = 100;
588
             feedrate_percentage = 100;
589
-            // saved_feedrate_percentage = feedrate_percentage;
589
+            //saved_feedrate_percentage = feedrate_percentage;
590
             planner.flow_percentage[0] = 100;
590
             planner.flow_percentage[0] = 100;
591
             planner.e_factor[0]        = planner.flow_percentage[0] * 0.01;
591
             planner.e_factor[0]        = planner.flow_percentage[0] * 0.01;
592
             if (EXTRUDERS == 2) {
592
             if (EXTRUDERS == 2) {
607
 
607
 
608
     void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) {
608
     void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) {
609
       #if ENABLED(SDSUPPORT)
609
       #if ENABLED(SDSUPPORT)
610
-        // uint8_t ress;
611
-        // uint32_t write;
610
+        //uint8_t ress;
611
+        //uint32_t write;
612
         volatile uint32_t i, j;
612
         volatile uint32_t i, j;
613
         volatile uint16_t *p_index;
613
         volatile uint16_t *p_index;
614
-        // int res;
614
+        //int res;
615
         char *cur_name;
615
         char *cur_name;
616
         uint16_t Color;
616
         uint16_t Color;
617
 
617
 
621
         card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8);
621
         card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8);
622
         #if ENABLED(TFT_LVGL_UI_SPI)
622
         #if ENABLED(TFT_LVGL_UI_SPI)
623
           SPI_TFT.spi_init(SPI_FULL_SPEED);
623
           SPI_TFT.spi_init(SPI_FULL_SPEED);
624
-          // SPI_TFT.SetCursor(0,0);
624
+          //SPI_TFT.SetCursor(0,0);
625
           SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1);
625
           SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1);
626
           SPI_TFT.LCD_WriteRAM_Prepare();
626
           SPI_TFT.LCD_WriteRAM_Prepare();
627
         #else
627
         #else
685
           row  = 0;
685
           row  = 0;
686
 
686
 
687
           gcode_preview_over = 0;
687
           gcode_preview_over = 0;
688
-          // flash_preview_begin = 1;
688
+          //flash_preview_begin = 1;
689
 
689
 
690
           card.closefile();
690
           card.closefile();
691
 
691
 
721
           card.openFileRead(cur_name);
721
           card.openFileRead(cur_name);
722
           if (card.isFileOpen()) {
722
           if (card.isFileOpen()) {
723
             feedrate_percentage = 100;
723
             feedrate_percentage = 100;
724
-            // saved_feedrate_percentage = feedrate_percentage;
724
+            //saved_feedrate_percentage = feedrate_percentage;
725
             planner.flow_percentage[0] = 100;
725
             planner.flow_percentage[0] = 100;
726
             planner.e_factor[0]        = planner.flow_percentage[0] * 0.01;
726
             planner.e_factor[0]        = planner.flow_percentage[0] * 0.01;
727
             if (EXTRUDERS == 2) {
727
             if (EXTRUDERS == 2) {
779
       i = 0;
779
       i = 0;
780
       #if ENABLED(TFT_LVGL_UI_SPI)
780
       #if ENABLED(TFT_LVGL_UI_SPI)
781
 
781
 
782
-        // SPI_TFT.spi_init(SPI_FULL_SPEED);
783
-        // SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20);     //200*200
784
-        // SPI_TFT.LCD_WriteRAM_Prepare();
782
+        //SPI_TFT.spi_init(SPI_FULL_SPEED);
783
+        //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20);     //200*200
784
+        //SPI_TFT.LCD_WriteRAM_Prepare();
785
         int j = 0;
785
         int j = 0;
786
         for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) {
786
         for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) {
787
           SPI_TFT.spi_init(SPI_FULL_SPEED);
787
           SPI_TFT.spi_init(SPI_FULL_SPEED);
789
           SPI_TFT.LCD_WriteRAM_Prepare();
789
           SPI_TFT.LCD_WriteRAM_Prepare();
790
 
790
 
791
           j++;
791
           j++;
792
-          // memcpy(public_buf,&bmp_public_buf[i],400);
792
+          //memcpy(public_buf,&bmp_public_buf[i],400);
793
           SPI_TFT_CS_L;
793
           SPI_TFT_CS_L;
794
           SPI_TFT_DC_H;
794
           SPI_TFT_DC_H;
795
           SPI.dmaSend(&bmp_public_buf[i], 400, true);
795
           SPI.dmaSend(&bmp_public_buf[i], 400, true);
814
             else {
814
             else {
815
               p_index = (uint16_t *)(&bmp_public_buf[i]);
815
               p_index = (uint16_t *)(&bmp_public_buf[i]);
816
             }
816
             }
817
-            if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // gCfgItems.preview_bk_color;
817
+            if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color;
818
             LCD_IO_WriteData(*p_index);
818
             LCD_IO_WriteData(*p_index);
819
             i += 2;
819
             i += 2;
820
           }
820
           }
821
           if (i >= 8000) break;
821
           if (i >= 8000) break;
822
         }
822
         }
823
-      #endif // if ENABLED(TFT_LVGL_UI_SPI)
823
+      #endif // TFT_LVGL_UI_SPI
824
       y_off++;
824
       y_off++;
825
     }
825
     }
826
     W25QXX.init(SPI_QUARTER_SPEED);
826
     W25QXX.init(SPI_QUARTER_SPEED);
841
       }
841
       }
842
     #endif
842
     #endif
843
   }
843
   }
844
-#endif // if HAS_GCODE_PREVIEW
844
+#endif // HAS_GCODE_PREVIEW
845
 
845
 
846
 void print_time_run() {
846
 void print_time_run() {
847
   static uint8_t lastSec = 0;
847
   static uint8_t lastSec = 0;
866
 
866
 
867
   switch (disp_state) {
867
   switch (disp_state) {
868
     case MAIN_UI:
868
     case MAIN_UI:
869
-      // lv_draw_ready_print();
869
+      //lv_draw_ready_print();
870
       break;
870
       break;
871
     case EXTRUSION_UI:
871
     case EXTRUSION_UI:
872
       if (temperature_change_frequency == 1) {
872
       if (temperature_change_frequency == 1) {
1053
 
1053
 
1054
   switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) {
1054
   switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) {
1055
     case PRINT_READY_UI:
1055
     case PRINT_READY_UI:
1056
-      // Get_Temperature_Flg = 0;
1056
+      //Get_Temperature_Flg = 0;
1057
       lv_clear_ready_print();
1057
       lv_clear_ready_print();
1058
       break;
1058
       break;
1059
     case PRINT_FILE_UI:
1059
     case PRINT_FILE_UI:
1251
     default:
1251
     default:
1252
       break;
1252
       break;
1253
   }
1253
   }
1254
-  // GUI_Clear();
1254
+  //GUI_Clear();
1255
 }
1255
 }
1256
 
1256
 
1257
 void draw_return_ui() {
1257
 void draw_return_ui() {
1501
 }
1501
 }
1502
 
1502
 
1503
 void LV_TASK_HANDLER() {
1503
 void LV_TASK_HANDLER() {
1504
-  // lv_tick_inc(1);
1504
+  //lv_tick_inc(1);
1505
   lv_task_handler();
1505
   lv_task_handler();
1506
   if (mks_test_flag == 0x1e) mks_hardware_test();
1506
   if (mks_test_flag == 0x1e) mks_hardware_test();
1507
   #if HAS_GCODE_PREVIEW
1507
   #if HAS_GCODE_PREVIEW
1508
     disp_pre_gcode(2, 36);
1508
     disp_pre_gcode(2, 36);
1509
   #endif
1509
   #endif
1510
   GUI_RefreshPage();
1510
   GUI_RefreshPage();
1511
-  // sd_detection();
1511
+  //sd_detection();
1512
 }
1512
 }
1513
 
1513
 
1514
 #endif // HAS_TFT_LVGL_UI
1514
 #endif // HAS_TFT_LVGL_UI

+ 3
- 6
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h View File

253
   #define BEEPER_PIN                        PC5
253
   #define BEEPER_PIN                        PC5
254
   #define BTN_ENC                           PE13
254
   #define BTN_ENC                           PE13
255
 
255
 
256
-#else
257
-  #if ENABLED(TFT_LITTLE_VGL_UI)
258
-  //FSMC LCD
256
+#elif ENABLED(TFT_LITTLE_VGL_UI)
257
+
259
   #define FSMC_CS_PIN                       PD7   // NE4
258
   #define FSMC_CS_PIN                       PD7   // NE4
260
   #define FSMC_RS_PIN                       PD11  // A0
259
   #define FSMC_RS_PIN                       PD11  // A0
261
 
260
 
266
 
265
 
267
   #define LCD_BACKLIGHT_PIN                 PD13
266
   #define LCD_BACKLIGHT_PIN                 PD13
268
 
267
 
269
-  #endif // TFT_LITTLE_VGL_UI
270
-
271
-#endif // TFT_LVGL_UI_SPI
268
+#endif
272
 
269
 
273
 #if HAS_SPI_LCD
270
 #if HAS_SPI_LCD
274
 
271
 

Loading…
Cancel
Save