Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to FTDI Eve unicode routine and spinner dialog box #22459

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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