Scott Lahteine 4 vuotta sitten
vanhempi
commit
b5ef699523

+ 9
- 11
Marlin/src/HAL/STM32/tft/tft_fsmc.h Näytä tiedosto

@@ -21,30 +21,28 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "../../../inc/MarlinConfig.h"
25
+
24 26
 #ifdef STM32F1xx
25 27
   #include "stm32f1xx_hal.h"
28
+  #define __IS_DMA_ENABLED(__HANDLE__)  ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
26 29
 #elif defined(STM32F4xx)
27 30
   #include "stm32f4xx_hal.h"
31
+  #define __IS_DMA_ENABLED(__HANDLE__)  ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
28 32
 #else
29
-  #error FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware.
33
+  #error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
30 34
 #endif
31 35
 
32 36
 #ifndef LCD_READ_ID
33
-  #define LCD_READ_ID 0x04   // Read display identification information (0xD3 on ILI9341)
37
+  #define LCD_READ_ID  0x04   // Read display identification information (0xD3 on ILI9341)
34 38
 #endif
35 39
 #ifndef LCD_READ_ID4
36 40
   #define LCD_READ_ID4 0xD3   // Read display identification information (0xD3 on ILI9341)
37 41
 #endif
38 42
 
39
-#define DATASIZE_8BIT    SPI_DATASIZE_8BIT
40
-#define DATASIZE_16BIT   SPI_DATASIZE_16BIT
41
-#define TFT_IO_DRIVER TFT_FSMC
42
-
43
-#ifdef STM32F1xx
44
-  #define __IS_DMA_ENABLED(__HANDLE__)      ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
45
-#elif defined(STM32F4xx)
46
-  #define __IS_DMA_ENABLED(__HANDLE__)      ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
47
-#endif
43
+#define DATASIZE_8BIT  SPI_DATASIZE_8BIT
44
+#define DATASIZE_16BIT SPI_DATASIZE_16BIT
45
+#define TFT_IO_DRIVER  TFT_FSMC
48 46
 
49 47
 typedef struct {
50 48
   __IO uint16_t REG;

+ 4
- 4
Marlin/src/HAL/STM32F1/tft/tft_fsmc.h Näytä tiedosto

@@ -22,7 +22,7 @@
22 22
 #pragma once
23 23
 
24 24
 #ifndef LCD_READ_ID
25
-  #define LCD_READ_ID 0x04   // Read display identification information (0xD3 on ILI9341)
25
+  #define LCD_READ_ID  0x04   // Read display identification information (0xD3 on ILI9341)
26 26
 #endif
27 27
 #ifndef LCD_READ_ID4
28 28
   #define LCD_READ_ID4 0xD3   // Read display identification information (0xD3 on ILI9341)
@@ -30,9 +30,9 @@
30 30
 
31 31
 #include <libmaple/dma.h>
32 32
 
33
-#define DATASIZE_8BIT    DMA_SIZE_8BITS
34
-#define DATASIZE_16BIT   DMA_SIZE_16BITS
35
-#define TFT_IO_DRIVER TFT_FSMC
33
+#define DATASIZE_8BIT  DMA_SIZE_8BITS
34
+#define DATASIZE_16BIT DMA_SIZE_16BITS
35
+#define TFT_IO_DRIVER  TFT_FSMC
36 36
 
37 37
 typedef struct {
38 38
   __IO uint16_t REG;

+ 7
- 7
Marlin/src/lcd/tft/ui_480x320.cpp Näytä tiedosto

@@ -428,21 +428,21 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu
428 428
   extern screenFunc_t _manual_move_func_ptr;
429 429
   if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) {
430 430
 
431
-    #define SLIDER_LENGHT 336
431
+    #define SLIDER_LENGTH 336
432 432
     #define SLIDER_Y_POSITION 186
433 433
 
434
-    tft.canvas((TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION, SLIDER_LENGHT, 16);
434
+    tft.canvas((TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION, SLIDER_LENGTH, 16);
435 435
     tft.set_background(COLOR_BACKGROUND);
436 436
 
437
-    int16_t position = (SLIDER_LENGHT - 2) * ui.encoderPosition / maxEditValue;
437
+    int16_t position = (SLIDER_LENGTH - 2) * ui.encoderPosition / maxEditValue;
438 438
     tft.add_bar(0, 7, 1, 2, ui.encoderPosition == 0 ? COLOR_SLIDER_INACTIVE : COLOR_SLIDER);
439 439
     tft.add_bar(1, 6, position, 4, COLOR_SLIDER);
440
-    tft.add_bar(position + 1, 6, SLIDER_LENGHT - 2 - position, 4, COLOR_SLIDER_INACTIVE);
441
-    tft.add_bar(SLIDER_LENGHT - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE);
440
+    tft.add_bar(position + 1, 6, SLIDER_LENGTH - 2 - position, 4, COLOR_SLIDER_INACTIVE);
441
+    tft.add_bar(SLIDER_LENGTH - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE);
442 442
 
443 443
     #if ENABLED(TOUCH_SCREEN)
444
-      tft.add_image((SLIDER_LENGHT - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER);
445
-      touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGHT, 32, maxEditValue);
444
+      tft.add_image((SLIDER_LENGTH - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER);
445
+      touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGTH, 32, maxEditValue);
446 446
     #endif
447 447
   }
448 448
 

+ 1
- 1
Marlin/src/lcd/tft_io/ssd1963.h Näytä tiedosto

@@ -125,7 +125,7 @@ static const uint16_t ssd1963_init[] = {
125 125
   ESC_REG(SSD1963_NORON),
126 126
   ESC_REG(SSD1963_DISPON),
127 127
 
128
-  ESC_REG(SSD1963_SPWMCFG), 0x0006, 0x00f0, 0x0001, 0x00f0, 0x0000, 0x0000,
128
+  ESC_REG(SSD1963_SPWMCFG), 0x0006, 0x00F0, 0x0001, 0x00F0, 0x0000, 0x0000,
129 129
   ESC_REG(SSD1963_SDBCCFG), 0x000D,
130 130
   ESC_END
131 131
 };

Loading…
Peruuta
Tallenna