Преглед изворни кода

Allow LCD_PIXEL_WIDTH/HEIGHT override

Scott Lahteine пре 4 година
родитељ
комит
b2328d089a

+ 1
- 1
Marlin/src/gcode/queue.cpp Прегледај датотеку

532
 
532
 
533
         // Reset stream state, terminate the buffer, and commit a non-empty command
533
         // Reset stream state, terminate the buffer, and commit a non-empty command
534
         if (!process_line_done(sd_input_state, command_buffer[index_w], sd_count)) {
534
         if (!process_line_done(sd_input_state, command_buffer[index_w], sd_count)) {
535
-          _commit_command(false);                     // The file was not terminated with a newline
535
+          _commit_command(false);                     // Can handle last line missing a newline terminator
536
           #if ENABLED(POWER_LOSS_RECOVERY)
536
           #if ENABLED(POWER_LOSS_RECOVERY)
537
             recovery.cmd_sdpos = card.getIndex();     // Prime for the next _commit_command
537
             recovery.cmd_sdpos = card.getIndex();     // Prime for the next _commit_command
538
           #endif
538
           #endif

+ 9
- 0
Marlin/src/inc/Conditionals_LCD.h Прегледај датотеку

361
 #define HAS_ADC_BUTTONS      ENABLED(ADC_KEYPAD)
361
 #define HAS_ADC_BUTTONS      ENABLED(ADC_KEYPAD)
362
 #define HAS_DGUS_LCD         ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
362
 #define HAS_DGUS_LCD         ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
363
 
363
 
364
+#if HAS_GRAPHICAL_LCD
365
+  #ifndef LCD_PIXEL_WIDTH
366
+    #define LCD_PIXEL_WIDTH 128
367
+  #endif
368
+  #ifndef LCD_PIXEL_HEIGHT
369
+    #define LCD_PIXEL_HEIGHT 64
370
+  #endif
371
+#endif
372
+
364
 /**
373
 /**
365
  * Extruders have some combination of stepper motors and hotends
374
  * Extruders have some combination of stepper motors and hotends
366
  * so we separate these concepts into the defines:
375
  * so we separate these concepts into the defines:

+ 2
- 1
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h Прегледај датотеку

25
 
25
 
26
 #include <U8glib.h>
26
 #include <U8glib.h>
27
 
27
 
28
-#ifndef U8G_HAL_LINKS
28
+#ifndef U8G_HAL_LINKS   // Defined by LPC1768/9 environments in platform.ini
29
 
29
 
30
   #ifdef __SAM3X8E__
30
   #ifdef __SAM3X8E__
31
 
31
 
75
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
75
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
76
   #endif
76
   #endif
77
 
77
 
78
+  // This can't be invoked from the current platformio.ini
78
   #ifdef TARGET_LPC1768
79
   #ifdef TARGET_LPC1768
79
     uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
80
     uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
80
   #endif
81
   #endif

+ 0
- 2
Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp Прегледај датотеку

59
 
59
 
60
 #include "HAL_LCD_com_defines.h"
60
 #include "HAL_LCD_com_defines.h"
61
 
61
 
62
-#define LCD_PIXEL_WIDTH  128
63
-#define LCD_PIXEL_HEIGHT  64
64
 #define PAGE_HEIGHT        8
62
 #define PAGE_HEIGHT        8
65
 
63
 
66
 /* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */
64
 /* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */

+ 0
- 7
Marlin/src/lcd/dogm/ultralcd_DOGM.h Прегледај датотеку

196
   #endif
196
   #endif
197
 #endif
197
 #endif
198
 
198
 
199
-#ifndef LCD_PIXEL_WIDTH
200
-  #define LCD_PIXEL_WIDTH 128
201
-#endif
202
-#ifndef LCD_PIXEL_HEIGHT
203
-  #define LCD_PIXEL_HEIGHT 64
204
-#endif
205
-
206
 // LCD_FULL_PIXEL_WIDTH =
199
 // LCD_FULL_PIXEL_WIDTH =
207
 // LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X
200
 // LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X
208
 #if ENABLED(FSMC_GRAPHICAL_TFT)
201
 #if ENABLED(FSMC_GRAPHICAL_TFT)

+ 1
- 1
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp Прегледај датотеку

154
 #endif
154
 #endif
155
 
155
 
156
 #endif // U8GLIB_ST7920
156
 #endif // U8GLIB_ST7920
157
-#endif // __AVR__ && !U8G_HAL_LINKS
157
+#endif // !U8G_HAL_LINKS && (__AVR__ || ARDUINO_ARCH_STM32 || ARDUINO_ARCH_ESP32)

+ 3
- 6
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h Прегледај датотеку

31
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
31
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
32
 #define ST7920_CS_PIN   LCD_PINS_RS
32
 #define ST7920_CS_PIN   LCD_PINS_RS
33
 
33
 
34
-//#define PAGE_HEIGHT 8   //128 byte framebuffer
35
-#define PAGE_HEIGHT 16  //256 byte framebuffer
36
-//#define PAGE_HEIGHT 32  //512 byte framebuffer
37
-
38
-#define LCD_PIXEL_WIDTH 128
39
-#define LCD_PIXEL_HEIGHT 64
34
+//#define PAGE_HEIGHT 8   // 128 byte framebuffer
35
+#define PAGE_HEIGHT 16    // 256 byte framebuffer
36
+//#define PAGE_HEIGHT 32  // 512 byte framebuffer
40
 
37
 
41
 #include <U8glib.h>
38
 #include <U8glib.h>
42
 
39
 

Loading…
Откажи
Сачувај