Skip to content

Commit

Permalink
🐛 Fix FTDI Eve unicode and spinner dialog (MarlinFirmware#22459)
Browse files Browse the repository at this point in the history
  • Loading branch information
marciot authored and Night69 committed Aug 31, 2021
1 parent 08b0ba4 commit e66d97b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@

utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) {
utf8_char_t val = *(uint8_t*)c++;
if ((val & 0xC0) == 0xC0)
if ((val & 0xC0) == 0x80)
while ((*c & 0xC0) == 0x80)
val = (val << 8) | *(uint8_t*)c++;
return val;
}

utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) {
utf8_char_t val = *(uint8_t*)c++;
if ((val & 0xC0) == 0xC0)
if ((val & 0xC0) == 0x80)
while ((*c & 0xC0) == 0x80)
val = (val << 8) | *(uint8_t*)c++;
return val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ using namespace ExtUI;

constexpr static SpinnerDialogBoxData &mydata = screen_data.SpinnerDialogBox;

void SpinnerDialogBox::onEntry() {
mydata.auto_hide = true;
}

void SpinnerDialogBox::onRedraw(draw_mode_t) {
}

void SpinnerDialogBox::show(progmem_str message) {
drawMessage(message);
drawSpinner();
storeBackground();
GOTO_SCREEN(SpinnerDialogBox);
mydata.auto_hide = false;
}

Expand All @@ -48,16 +53,12 @@ void SpinnerDialogBox::hide() {

void SpinnerDialogBox::enqueueAndWait(progmem_str message, progmem_str commands) {
show(message);
GOTO_SCREEN(SpinnerDialogBox);
ExtUI::injectCommands_P((const char*)commands);
mydata.auto_hide = true;
}

void SpinnerDialogBox::enqueueAndWait(progmem_str message, char *commands) {
show(message);
GOTO_SCREEN(SpinnerDialogBox);
ExtUI::injectCommands(commands);
mydata.auto_hide = true;
}

void SpinnerDialogBox::onIdle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ struct SpinnerDialogBoxData {
bool auto_hide;
};

class SpinnerDialogBox : public UIScreen {
class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen<SPINNER_CACHE,SPINNER_DL_SIZE> {
public:
static void onEntry();
static void onExit();
static void onRedraw(draw_mode_t);
static void onRefresh();
static void onIdle();

static void show(progmem_str);
Expand Down

0 comments on commit e66d97b

Please sign in to comment.