Followup fixes to ExtUI (#15068)

This commit is contained in:
Marcio Teixeira 2019-08-28 03:23:13 -06:00 committed by Scott Lahteine
parent 081e4506ca
commit 0f386d06a1
8 changed files with 30 additions and 3 deletions

View file

@ -50,6 +50,7 @@ void CLCD::turn_on_backlight (void) {
} }
void CLCD::FontMetrics::load(const uint8_t font) { void CLCD::FontMetrics::load(const uint8_t font) {
static_assert(sizeof(FontMetrics) == 148, "Sizeof font metrics is incorrect");
uint32_t rom_fontroot = mem_read_32(MAP::ROM_FONT_ADDR); uint32_t rom_fontroot = mem_read_32(MAP::ROM_FONT_ADDR);
mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148); mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148);
} }
@ -866,6 +867,21 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) {
} }
#endif #endif
#if FTDI_API_LEVEL >= 810
void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) {
struct {
uint32_t type = CMD_ROMFONT;
uint32_t font;
uint32_t romslot;
} cmd_data;
cmd_data.font = font;
cmd_data.romslot = romslot;
cmd( &cmd_data, sizeof(cmd_data) );
}
#endif
/**************************** FT800/810 Co-Processor Command FIFO ****************************/ /**************************** FT800/810 Co-Processor Command FIFO ****************************/
bool CLCD::CommandFifo::is_processing() { bool CLCD::CommandFifo::is_processing() {

View file

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

View file

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

View file

@ -38,7 +38,7 @@ namespace FTDI {
inline uint32_t ALPHA_FUNC(uint8_t func, uint8_t ref) {return DL::ALPHA_FUNC|((func&7UL)<<8)|(ref&255UL);} inline uint32_t ALPHA_FUNC(uint8_t func, uint8_t ref) {return DL::ALPHA_FUNC|((func&7UL)<<8)|(ref&255UL);}
inline uint32_t BEGIN(begin_t prim) {return DL::BEGIN|(prim&15UL);} inline uint32_t BEGIN(begin_t prim) {return DL::BEGIN|(prim&15UL);}
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));} inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr) {return DL::BITMAP_SOURCE|(ram_g_addr);}
inline uint32_t BITMAP_HANDLE(uint8_t handle) {return DL::BITMAP_HANDLE|(handle&31UL);} inline uint32_t BITMAP_HANDLE(uint8_t handle) {return DL::BITMAP_HANDLE|(handle&31UL);}
inline uint32_t BITMAP_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height) inline uint32_t BITMAP_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height)
{return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);} {return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);}

View file

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

View file

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

View file

@ -320,7 +320,7 @@ namespace ExtUI {
#endif #endif
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis])); setFeedrate_mm_s(MMM_TO_MMS(max_manual_feedrate[axis]));
if (!flags.manual_motion) set_destination_from_current(); if (!flags.manual_motion) set_destination_from_current();
destination[axis] = clamp(position, min, max); destination[axis] = clamp(position, min, max);
@ -331,7 +331,7 @@ namespace ExtUI {
setActiveTool(extruder, true); setActiveTool(extruder, true);
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS])); setFeedrate_mm_s(MMM_TO_MMS(max_manual_feedrate[E_AXIS]));
if (!flags.manual_motion) set_destination_from_current(); if (!flags.manual_motion) set_destination_from_current();
destination[E_AXIS] = position; destination[E_AXIS] = position;
flags.manual_motion = true; flags.manual_motion = true;

View file

@ -24,6 +24,10 @@
#include "../inc/MarlinConfig.h" #include "../inc/MarlinConfig.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extensible_ui/ui_api.h"
#endif
Stopwatch::State Stopwatch::state; Stopwatch::State Stopwatch::state;
millis_t Stopwatch::accumulator; millis_t Stopwatch::accumulator;
millis_t Stopwatch::startTimestamp; millis_t Stopwatch::startTimestamp;