ソースを参照

Fix material_preset reference issue

Scott Lahteine 3年前
コミット
b880712889
2個のファイルの変更30行の追加31行の削除
  1. 27
    28
      Marlin/src/lcd/ultralcd.cpp
  2. 3
    3
      Marlin/src/pins/stm32f1/pins_CREALITY_V4.h

+ 27
- 28
Marlin/src/lcd/ultralcd.cpp ファイルの表示

@@ -20,7 +20,7 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "../inc/MarlinConfigPre.h"
23
+#include "../inc/MarlinConfig.h"
24 24
 
25 25
 #ifdef LED_BACKLIGHT_TIMEOUT
26 26
   #include "../feature/leds/leds.h"
@@ -86,6 +86,32 @@ MarlinUI ui;
86 86
   }
87 87
 #endif
88 88
 
89
+#if PREHEAT_COUNT
90
+  preheat_t MarlinUI::material_preset[PREHEAT_COUNT];  // Initialized by settings.load()
91
+  PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
92
+    #ifdef PREHEAT_1_LABEL
93
+      static PGMSTR(preheat_0_label, PREHEAT_1_LABEL);
94
+    #endif
95
+    #ifdef PREHEAT_2_LABEL
96
+      static PGMSTR(preheat_1_label, PREHEAT_2_LABEL);
97
+    #endif
98
+    #ifdef PREHEAT_3_LABEL
99
+      static PGMSTR(preheat_2_label, PREHEAT_3_LABEL);
100
+    #endif
101
+    #ifdef PREHEAT_4_LABEL
102
+      static PGMSTR(preheat_3_label, PREHEAT_4_LABEL);
103
+    #endif
104
+    #ifdef PREHEAT_5_LABEL
105
+      static PGMSTR(preheat_4_label, PREHEAT_5_LABEL);
106
+    #endif
107
+
108
+    #define _PLBL(N) preheat_##N##_label,
109
+    static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) };
110
+
111
+    return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
112
+  }
113
+#endif
114
+
89 115
 #if HAS_SPI_LCD
90 116
 
91 117
 #if HAS_GRAPHICAL_LCD
@@ -149,33 +175,6 @@ millis_t MarlinUI::next_button_update_ms; // = 0
149 175
   volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update
150 176
 #endif
151 177
 
152
-#if PREHEAT_COUNT
153
-  preheat_t MarlinUI::material_preset[PREHEAT_COUNT];  // Initialized by settings.load()
154
-
155
-  PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
156
-    #ifdef PREHEAT_1_LABEL
157
-      static PGMSTR(preheat_0_label, PREHEAT_1_LABEL);
158
-    #endif
159
-    #ifdef PREHEAT_2_LABEL
160
-      static PGMSTR(preheat_1_label, PREHEAT_2_LABEL);
161
-    #endif
162
-    #ifdef PREHEAT_3_LABEL
163
-      static PGMSTR(preheat_2_label, PREHEAT_3_LABEL);
164
-    #endif
165
-    #ifdef PREHEAT_4_LABEL
166
-      static PGMSTR(preheat_3_label, PREHEAT_4_LABEL);
167
-    #endif
168
-    #ifdef PREHEAT_5_LABEL
169
-      static PGMSTR(preheat_4_label, PREHEAT_5_LABEL);
170
-    #endif
171
-
172
-    #define _PLBL(N) preheat_##N##_label,
173
-    static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) };
174
-
175
-    return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
176
-  }
177
-#endif
178
-
179 178
 #if ENABLED(SDSUPPORT)
180 179
 
181 180
   #include "../sd/cardreader.h"

+ 3
- 3
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h ファイルの表示

@@ -43,15 +43,15 @@
43 43
   //#define FLASH_EEPROM_EMULATION
44 44
 
45 45
   // I2C
46
-  //#define IIC_BL24CXX_EEPROM                    // EEPROM on I2C-0
46
+  #define IIC_BL24CXX_EEPROM                      // EEPROM on I2C-0 used only for display settings
47 47
   #if ENABLED(IIC_BL24CXX_EEPROM)
48 48
     #define IIC_EEPROM_SDA                  PA11
49 49
     #define IIC_EEPROM_SCL                  PA12
50 50
     #define MARLIN_EEPROM_SIZE 0x4000             // 16Kb (24c16)
51
-  #else
52
-    #define SDCARD_EEPROM_EMULATION               // SD EEPROM was in the original build, so...
53 51
   #endif
54 52
 
53
+  #define SDCARD_EEPROM_EMULATION                 // SD EEPROM until all EEPROM is BL24CXX
54
+
55 55
   // SPI
56 56
   //#define SPI_EEPROM                            // EEPROM on SPI-0
57 57
   //#define SPI_CHAN_EEPROM1  ?

読み込み中…
キャンセル
保存