Selaa lähdekoodia

Clean up after changes

Scott Lahteine 3 vuotta sitten
vanhempi
commit
bc688f27dc

+ 4
- 9
Marlin/Configuration.h Näytä tiedosto

@@ -2142,6 +2142,7 @@
2142 2142
 
2143 2143
 //
2144 2144
 // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
2145
+// Upscaled 128x64 Marlin UI
2145 2146
 //
2146 2147
 //#define FSMC_GRAPHICAL_TFT
2147 2148
 
@@ -2149,17 +2150,11 @@
2149 2150
 // TFT LVGL UI
2150 2151
 //
2151 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 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 2160
 //============================  Other Controllers  ============================

+ 1
- 1
Marlin/src/HAL/STM32/HAL.cpp Näytä tiedosto

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

+ 1
- 4
Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp Näytä tiedosto

@@ -41,8 +41,7 @@
41 41
   }
42 42
 
43 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 47
   bool SDIO_ReadBlock(uint32_t block, uint8_t *src) {
@@ -58,7 +57,6 @@
58 57
 #else // !USBD_USE_CDC_COMPOSITE
59 58
 
60 59
   // use local drivers
61
-
62 60
   #if defined(STM32F103xE) || defined(STM32F103xG)
63 61
     #include <stm32f1xx_hal_rcc_ex.h>
64 62
     #include <stm32f1xx_hal_sd.h>
@@ -274,7 +272,6 @@
274 272
   bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
275 273
     hsd.Instance = SDIO;
276 274
     uint8_t retryCnt = SD_RETRY_COUNT;
277
-
278 275
     bool status;
279 276
     for (;;) {
280 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 Näytä tiedosto

@@ -64,12 +64,14 @@ void FastIO_init(); // Must be called before using fast io macros
64 64
 #define _GET_MODE(IO)
65 65
 #define _SET_MODE(IO,M)         pinMode(IO, M)
66 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 69
 #define WRITE(IO,V)             _WRITE(IO,V)
69 70
 #define READ(IO)                _READ(IO)
70 71
 #define TOGGLE(IO)              _TOGGLE(IO)
71 72
 
72 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 76
 #define SET_INPUT(IO)           _SET_MODE(IO, INPUT)                              /*!< Input Floating Mode                   */
75 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 Näytä tiedosto

@@ -27,3 +27,8 @@
27 27
 #elif EITHER(I2C_EEPROM, SPI_EEPROM)
28 28
   #define USE_SHARED_EEPROM 1
29 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 Näytä tiedosto

@@ -29,10 +29,6 @@
29 29
   #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
30 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 32
 #if ENABLED(FAST_PWM_FAN)
37 33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
38 34
 #endif

+ 1
- 1
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp Näytä tiedosto

@@ -597,7 +597,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
597 597
     case U8G_DEV_MSG_INIT:
598 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 601
         case 0x8552:   // ST7789V
602 602
           #ifdef LCD_USE_DMA_FSMC
603 603
             writeEscSequence(st7789v_init);

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp Näytä tiedosto

@@ -95,7 +95,7 @@ void lv_draw_advance_settings(void) {
95 95
   buttonPausePos = lv_btn_create(scr, NULL);   /*Add a button the current screen*/
96 96
   lv_obj_set_pos(buttonPausePos, PARA_UI_POS_X, PARA_UI_POS_Y);                         /*Set its position*/
97 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 99
   lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0);
100 100
   lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
101 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 Näytä tiedosto

@@ -137,7 +137,7 @@ void lv_draw_machine_para(void) {
137 137
   buttonMachine = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
138 138
   lv_obj_set_pos(buttonMachine, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
139 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 141
   lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0);
142 142
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
143 143
   lv_btn_set_style(buttonMachine, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
@@ -159,7 +159,7 @@ void lv_draw_machine_para(void) {
159 159
   buttonMotor = lv_btn_create(scr, NULL);                                   /*Add a button the current screen*/
160 160
   lv_obj_set_pos(buttonMotor, PARA_UI_POS_X, PARA_UI_POS_Y * 2);            /*Set its position*/
161 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 163
   lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0);
164 164
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_REL, &tft_style_label_rel);    /*Set the button's released style*/
165 165
   lv_btn_set_style(buttonMotor, LV_BTN_STYLE_PR, &tft_style_label_pre);     /*Set the button's pressed style*/
@@ -181,7 +181,7 @@ void lv_draw_machine_para(void) {
181 181
   buttonAdvance = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
182 182
   lv_obj_set_pos(buttonAdvance, PARA_UI_POS_X, PARA_UI_POS_Y * 3);          /*Set its position*/
183 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 185
   lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0);
186 186
   lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
187 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 Näytä tiedosto

@@ -144,7 +144,7 @@ void lv_draw_machine_settings(void) {
144 144
   buttonAcceleration = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
145 145
   lv_obj_set_pos(buttonAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y);             /*Set its position*/
146 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 148
   lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0);
149 149
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
150 150
   lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
@@ -166,7 +166,7 @@ void lv_draw_machine_settings(void) {
166 166
   buttonMaxFeedrate = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
167 167
   lv_obj_set_pos(buttonMaxFeedrate, PARA_UI_POS_X, PARA_UI_POS_Y * 2);          /*Set its position*/
168 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 170
   lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0);
171 171
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
172 172
   lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
@@ -189,7 +189,7 @@ void lv_draw_machine_settings(void) {
189 189
     buttonJerk = lv_btn_create(scr, NULL);                                      /*Add a button the current screen*/
190 190
     lv_obj_set_pos(buttonJerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3);               /*Set its position*/
191 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 193
     lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0);
194 194
     lv_btn_set_style(buttonJerk, LV_BTN_STYLE_REL, &tft_style_label_rel);       /*Set the button's released style*/
195 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 Näytä tiedosto

@@ -147,7 +147,7 @@ void lv_draw_motor_settings(void) {
147 147
   buttonSteps = lv_btn_create(scr, NULL);                                 /*Add a button the current screen*/
148 148
   lv_obj_set_pos(buttonSteps, PARA_UI_POS_X, PARA_UI_POS_Y);              /*Set its position*/
149 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 151
   lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0);
152 152
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_REL, &tft_style_label_rel);  /*Set the button's released style*/
153 153
   lv_btn_set_style(buttonSteps, LV_BTN_STYLE_PR, &tft_style_label_pre);   /*Set the button's pressed style*/
@@ -169,7 +169,7 @@ void lv_draw_motor_settings(void) {
169 169
     buttonTMCcurrent = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
170 170
     lv_obj_set_pos(buttonTMCcurrent, PARA_UI_POS_X, PARA_UI_POS_Y * 2);         /*Set its position*/
171 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 173
     lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0);
174 174
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
175 175
     lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_PR, &tft_style_label_pre);  /*Set the button's pressed style*/
@@ -192,7 +192,7 @@ void lv_draw_motor_settings(void) {
192 192
       buttonStepMode = lv_btn_create(scr, NULL);                                /*Add a button the current screen*/
193 193
       lv_obj_set_pos(buttonStepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 3);         /*Set its position*/
194 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 196
       lv_obj_set_event_cb_mks(buttonStepMode, event_handler, ID_MOTOR_STEP_MODE, NULL, 0);
197 197
       lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/
198 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 Näytä tiedosto

@@ -228,7 +228,7 @@ void lv_draw_move_motor(void) {
228 228
     lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre);
229 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 232
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic);
233 233
     lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic);
234 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 Näytä tiedosto

@@ -72,12 +72,14 @@ uint8_t sel_id = 0;
72 72
         const uint16_t nr = SD_ORDER(i, fileCnt);
73 73
         card.getfilename_sorted(nr);
74 74
 
75
-        if (card.flag.filenameIsDir)
75
+        if (card.flag.filenameIsDir) {
76 76
           //SERIAL_ECHOLN(card.longest_filename);
77 77
           list_file.IsFolder[valid_name_cnt] = 1;
78
-        else
78
+        }
79
+        else {
79 80
           //SERIAL_ECHOLN(card.longFilename);
80 81
           list_file.IsFolder[valid_name_cnt] = 0;
82
+        }
81 83
 
82 84
         #if 1
83 85
           //
@@ -523,7 +525,7 @@ void lv_gcode_file_read(uint8_t *data_buf) {
523 525
         //Color = (*p_index >> 8);
524 526
         //*p_index = Color | ((*p_index & 0xff) << 8);
525 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 530
     #endif // TFT_LVGL_UI_SPI
529 531
     memcpy(data_buf, public_buf, 200);
@@ -556,7 +558,7 @@ void cutFileName(char *path, int len, int bytePerLine,  char *outStr) {
556 558
   #endif
557 559
 
558 560
   beginIndex = (strIndex1 != 0
559
-                // && (strIndex2 != 0) && (strIndex1 < strIndex2)
561
+                //&& (strIndex2 != 0) && (strIndex1 < strIndex2)
560 562
                 ) ? strIndex1 + 1 : tmpFile;
561 563
 
562 564
   if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file

+ 5
- 5
Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp Näytä tiedosto

@@ -73,7 +73,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
73 73
           stepperX.refresh_stepping_mode();
74 74
           lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_disable.bin", 0);
75 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 77
           // gcode.process_subcommands_now_P(PSTR("M500"));
78 78
         }
79 79
         else {
@@ -96,7 +96,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
96 96
           stepperY.refresh_stepping_mode();
97 97
           lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_disable.bin", 0);
98 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 101
         else {
102 102
           stepperY.stored.stealthChop_enabled = true;
@@ -117,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
117 117
           stepperZ.refresh_stepping_mode();
118 118
           lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_disable.bin", 0);
119 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 122
         else {
123 123
           stepperZ.stored.stealthChop_enabled = true;
@@ -138,7 +138,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
138 138
           stepperE0.refresh_stepping_mode();
139 139
           lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_disable.bin", 0);
140 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 143
         else {
144 144
           stepperE0.stored.stealthChop_enabled = true;
@@ -160,7 +160,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
160 160
               stepperE1.refresh_stepping_mode();
161 161
               lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_disable.bin", 0);
162 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 165
             else {
166 166
               stepperE1.stored.stealthChop_enabled = true;

+ 19
- 19
Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp Näytä tiedosto

@@ -125,7 +125,7 @@ void lv_draw_tool(void) {
125 125
 
126 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 130
   lv_obj_set_style(scr, &tft_style_scr);
131 131
   lv_scr_load(scr);
@@ -182,17 +182,17 @@ void lv_draw_tool(void) {
182 182
     lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_label_pre);
183 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 197
     lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, "bmp_return.bin", 0);
198 198
     lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic);
@@ -206,8 +206,8 @@ void lv_draw_tool(void) {
206 206
   lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight);
207 207
   lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight);
208 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 211
   lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight);
212 212
 
213 213
   /*Create a label on the Image button*/
@@ -216,8 +216,8 @@ void lv_draw_tool(void) {
216 216
   lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF);
217 217
   lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF);
218 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 221
   lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
222 222
 
223 223
   lv_obj_t * labelPreHeat   = lv_label_create(buttonPreHeat, NULL);
@@ -251,11 +251,11 @@ void lv_draw_tool(void) {
251 251
     lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling));
252 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 260
     lv_label_set_text(label_Back, common_menu.text_back);
261 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 Näytä tiedosto

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

+ 3
- 6
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h Näytä tiedosto

@@ -253,9 +253,8 @@
253 253
   #define BEEPER_PIN                        PC5
254 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 258
   #define FSMC_CS_PIN                       PD7   // NE4
260 259
   #define FSMC_RS_PIN                       PD11  // A0
261 260
 
@@ -266,9 +265,7 @@
266 265
 
267 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 270
 #if HAS_SPI_LCD
274 271
 

Loading…
Peruuta
Tallenna