Browse Source

Followup fixes to ExtUI (#15068)

Marcio Teixeira 4 years ago
parent
commit
0f386d06a1

+ 16
- 0
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp View File

@@ -50,6 +50,7 @@ void CLCD::turn_on_backlight (void) {
50 50
 }
51 51
 
52 52
 void CLCD::FontMetrics::load(const uint8_t font) {
53
+  static_assert(sizeof(FontMetrics) == 148, "Sizeof font metrics is incorrect");
53 54
   uint32_t rom_fontroot = mem_read_32(MAP::ROM_FONT_ADDR);
54 55
   mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148);
55 56
 }
@@ -866,6 +867,21 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) {
866 867
 }
867 868
 #endif
868 869
 
870
+#if FTDI_API_LEVEL >= 810
871
+void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) {
872
+  struct {
873
+    uint32_t  type = CMD_ROMFONT;
874
+    uint32_t  font;
875
+    uint32_t  romslot;
876
+  } cmd_data;
877
+
878
+  cmd_data.font    = font;
879
+  cmd_data.romslot = romslot;
880
+
881
+  cmd( &cmd_data, sizeof(cmd_data) );
882
+}
883
+#endif
884
+
869 885
 /**************************** FT800/810 Co-Processor Command FIFO ****************************/
870 886
 
871 887
 bool CLCD::CommandFifo::is_processing() {

+ 1
- 0
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.h View File

@@ -235,6 +235,7 @@ class CLCD::CommandFifo {
235 235
       void playvideo (uint32_t options);
236 236
       void videostart();
237 237
       void videoframe(uint32_t dst, uint32_t ptr);
238
+      void romfont   (uint8_t font, uint8_t romslot);
238 239
     #endif
239 240
 
240 241
     // All the following must be followed by str()

+ 3
- 0
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h View File

@@ -272,6 +272,9 @@ namespace FTDI_FT810 {
272 272
   constexpr uint32_t CMD_SETBASE                      = 0xFFFFFF38;
273 273
   constexpr uint32_t CMD_MEDIAFIFO                    = 0xFFFFFF39;
274 274
   constexpr uint32_t CMD_PLAYVIDEO                    = 0xFFFFFF3A;
275
+  constexpr uint32_t CMD_SETFONT2                     = 0xFFFFFF3B;
276
+  constexpr uint32_t CMD_SETSCRATCH                   = 0xFFFFFF3C;
277
+  constexpr uint32_t CMD_ROMFONT                      = 0xFFFFFF3F;
275 278
   constexpr uint32_t CMD_VIDEOSTART                   = 0xFFFFFF40;
276 279
   constexpr uint32_t CMD_VIDEOFRAME                   = 0xFFFFFF41;
277 280
   constexpr uint32_t CMD_SETBITMAP                    = 0xFFFFFF43;

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/display_list.h View File

@@ -38,7 +38,7 @@ namespace FTDI {
38 38
   inline uint32_t ALPHA_FUNC(uint8_t func, uint8_t ref)        {return DL::ALPHA_FUNC|((func&7UL)<<8)|(ref&255UL);}
39 39
   inline uint32_t BEGIN(begin_t prim)                          {return DL::BEGIN|(prim&15UL);}
40 40
 
41
-  inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr)           {return DL::BITMAP_SOURCE|(ram_g_addr & (FTDI::ftdi_memory_map::RAM_G_SIZE-1));}
41
+  inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr)           {return DL::BITMAP_SOURCE|(ram_g_addr);}
42 42
   inline uint32_t BITMAP_HANDLE(uint8_t handle)                {return DL::BITMAP_HANDLE|(handle&31UL);}
43 43
   inline uint32_t BITMAP_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height)
44 44
                                                                {return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);}

+ 2
- 0
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/registers_ft810.h View File

@@ -36,6 +36,8 @@
36 36
  *                                                                             *
37 37
  * 0x1E0000 0x2FFFFB  1152 kB  ROM_FONT       Font table and bitmap            *
38 38
  *                                                                             *
39
+ * 0x201EE0 0x2029DC  2812  B  ROM_FONT_ROOT  ROM font table                   *
40
+ *                                                                             *
39 41
  * 0x2FFFFC 0x2FFFFF     4  B  ROM_FONT_ADDR  Font table pointer address       *
40 42
  *                                                                             *
41 43
  * 0x300000 0x301FFF     8 kB  RAM_DL         Display List RAM                 *

+ 1
- 0
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/command_processor.h View File

@@ -191,6 +191,7 @@ class CommandProcessor : public CLCD::CommandFifo {
191 191
                                                                   {CLCD::CommandFifo::snapshot2(fmt,ptr,x,y,w,h); return *this;}
192 192
     inline CommandProcessor& mediafifo (uint32_t p, uint32_t s)   {CLCD::CommandFifo::mediafifo(p, s); return *this;}
193 193
     inline CommandProcessor& playvideo(uint32_t options)          {CLCD::CommandFifo::playvideo(options); return *this;}
194
+    inline CommandProcessor& romfont(uint8_t font, uint8_t slot)  {CLCD::CommandFifo::romfont(font, slot); return *this;}
194 195
     #endif
195 196
 
196 197
     inline CommandProcessor& gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1)

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

@@ -320,7 +320,7 @@ namespace ExtUI {
320 320
     #endif
321 321
 
322 322
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
323
-    setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis]));
323
+    setFeedrate_mm_s(MMM_TO_MMS(max_manual_feedrate[axis]));
324 324
 
325 325
     if (!flags.manual_motion) set_destination_from_current();
326 326
     destination[axis] = clamp(position, min, max);
@@ -331,7 +331,7 @@ namespace ExtUI {
331 331
     setActiveTool(extruder, true);
332 332
 
333 333
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
334
-    setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS]));
334
+    setFeedrate_mm_s(MMM_TO_MMS(max_manual_feedrate[E_AXIS]));
335 335
     if (!flags.manual_motion) set_destination_from_current();
336 336
     destination[E_AXIS] = position;
337 337
     flags.manual_motion = true;

+ 4
- 0
Marlin/src/libs/stopwatch.cpp View File

@@ -24,6 +24,10 @@
24 24
 
25 25
 #include "../inc/MarlinConfig.h"
26 26
 
27
+#if ENABLED(EXTENSIBLE_UI)
28
+  #include "../lcd/extensible_ui/ui_api.h"
29
+#endif
30
+
27 31
 Stopwatch::State Stopwatch::state;
28 32
 millis_t Stopwatch::accumulator;
29 33
 millis_t Stopwatch::startTimestamp;

Loading…
Cancel
Save