Browse Source

STM32F1xx support for TFTGLCD (#20515)

Serhiy-K 3 years ago
parent
commit
0b3b4da7d0
No account linked to committer's email address

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

@@ -972,6 +972,12 @@
972 972
 
973 973
       MeshFlags done_flags{0};
974 974
       const xy_int8_t &lpos = location.pos;
975
+
976
+      #if IS_TFTGLCD_PANEL
977
+        lcd_mesh_edit_setup(0);                             // Change current screen before calling ui.ubl_plot
978
+        safe_delay(50);
979
+      #endif
980
+
975 981
       do {
976 982
         location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags);
977 983
 

+ 6
- 6
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp View File

@@ -32,7 +32,7 @@
32 32
  * and supports color output.
33 33
  */
34 34
 
35
-#if NONE(__AVR__, TARGET_LPC1768, __STM32F1__, STM32F4xx)
35
+#if NONE(__AVR__, TARGET_LPC1768, STM32F1, STM32F4xx)
36 36
   #warning "Selected platform not yet tested. Please contribute your good pin mappings."
37 37
 #endif
38 38
 
@@ -129,7 +129,7 @@ static uint8_t PanelDetected = 0;
129 129
 #if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
130 130
   #define SPI_SEND_ONE(V) SPI.transfer(V);
131 131
   #define SPI_SEND_TWO(V) SPI.transfer16(V);
132
-#elif defined(STM32F4xx)
132
+#elif EITHER(STM32F4xx, STM32F1xx)
133 133
   #define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE);
134 134
   #define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE);
135 135
 #elif defined(ARDUINO_ARCH_ESP32)
@@ -139,7 +139,7 @@ static uint8_t PanelDetected = 0;
139 139
 
140 140
 #if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
141 141
   #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L);
142
-#elif defined(STM32F4xx)
142
+#elif EITHER(STM32F4xx, STM32F1xx)
143 143
   #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L, SPI_CONTINUE);
144 144
 #elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32)
145 145
   #define SPI_SEND_SOME(V,L,Z)  do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0)
@@ -276,7 +276,7 @@ uint8_t MarlinUI::read_slow_buttons(void) {
276 276
     Wire.endTransmission();
277 277
     #ifdef __AVR__
278 278
       Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1);
279
-    #elif defined(__STM32F1__)
279
+    #elif defined(STM32F1)
280 280
       Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2);
281 281
     #elif EITHER(STM32F4xx, TARGET_LPC1768)
282 282
       Wire.requestFrom(LCD_I2C_ADDRESS, 2);
@@ -330,7 +330,7 @@ void MarlinUI::init_lcd() {
330 330
     Wire.endTransmission(); // send buffer
331 331
     #ifdef __AVR__
332 332
       Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1);
333
-    #elif ANY(__STM32F1__, STM32F4xx, TARGET_LPC1768)
333
+    #elif ANY(STM32F1, STM32F4xx, TARGET_LPC1768)
334 334
       Wire.requestFrom(LCD_I2C_ADDRESS, 1);
335 335
     #endif
336 336
     t = (uint8_t)Wire.read();
@@ -626,7 +626,7 @@ Equal to 20x10 text LCD
626 626
 | ttc  ttc   %       | ttc - current temperature
627 627
 | tts  tts  %%%      | tts - setted temperature, %%% - percent for FAN
628 628
 | ICO  ICO  ICO  ICO | ICO - icon 48x48, placed in 2 text lines
629
-| ICO  ICO  ICO  ICO | ICO /
629
+| ICO  ICO  ICO  ICO | ICO
630 630
 
631 631
 or
632 632
 

+ 2
- 1
Marlin/src/pins/stm32f1/pins_MORPHEUS.h View File

@@ -30,7 +30,7 @@
30 30
  * MORPHEUS Board pin assignments
31 31
  */
32 32
 
33
-#if NOT_TARGET(__STM32F1__)
33
+#if NOT_TARGET(__STM32F1__, STM32F1xx)
34 34
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
35 35
 #endif
36 36
 
@@ -90,3 +90,4 @@
90 90
 #define LED_PIN                             PC13
91 91
 #define SDSS                                PA3
92 92
 #define TFTGLCD_CS                          PA4
93
+#define SD_DETECT_PIN                       PC14

Loading…
Cancel
Save