Skip to content

Commit

Permalink
Followup fixes to ExtUI (MarlinFirmware#15068)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcio-ao authored and thinkyhead committed Aug 28, 2019
1 parent 081e450 commit 0f386d0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void CLCD::turn_on_backlight (void) {
}

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);
mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148);
}
Expand Down Expand Up @@ -866,6 +867,21 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) {
}
#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 ****************************/

bool CLCD::CommandFifo::is_processing() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class CLCD::CommandFifo {
void playvideo (uint32_t options);
void videostart();
void videoframe(uint32_t dst, uint32_t ptr);
void romfont (uint8_t font, uint8_t romslot);
#endif

// All the following must be followed by str()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ namespace FTDI_FT810 {
constexpr uint32_t CMD_SETBASE = 0xFFFFFF38;
constexpr uint32_t CMD_MEDIAFIFO = 0xFFFFFF39;
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_VIDEOFRAME = 0xFFFFFF41;
constexpr uint32_t CMD_SETBITMAP = 0xFFFFFF43;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 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_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height)
{return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* *
* 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 *
* *
* 0x300000 0x301FFF 8 kB RAM_DL Display List RAM *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class CommandProcessor : public CLCD::CommandFifo {
{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& 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

inline CommandProcessor& gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extensible_ui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace ExtUI {
#endif

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();
destination[axis] = clamp(position, min, max);
Expand All @@ -331,7 +331,7 @@ namespace ExtUI {
setActiveTool(extruder, true);

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();
destination[E_AXIS] = position;
flags.manual_motion = true;
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/libs/stopwatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#include "../inc/MarlinConfig.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extensible_ui/ui_api.h"
#endif

Stopwatch::State Stopwatch::state;
millis_t Stopwatch::accumulator;
millis_t Stopwatch::startTimestamp;
Expand Down

0 comments on commit 0f386d0

Please sign in to comment.