Skip to content

Commit

Permalink
🐛 Fix FTDI Eve unicode and spinner dialog (#22459)
Browse files Browse the repository at this point in the history
  • Loading branch information
marciot authored Jul 29, 2021
1 parent 363e837 commit cdcb45b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@

utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) {
utf8_char_t val = *(uint8_t*)c++;
while ((*c & 0xC0) == 0x80)
val = (val << 8) | *(uint8_t*)c++;
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++;
while ((*c & 0xC0) == 0x80)
val = (val << 8) | *(uint8_t*)c++;
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 @@ -31,6 +31,7 @@ struct SpinnerDialogBoxData {

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

Expand Down

0 comments on commit cdcb45b

Please sign in to comment.