0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-18 23:49:49 +00:00

🐛 Fix FTDI Eve unicode and spinner dialog (#22459)

This commit is contained in:
Marcio T 2021-07-29 17:19:49 -06:00 committed by GitHub
parent 363e83731f
commit cdcb45b87e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View file

@ -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;
}

View file

@ -31,6 +31,10 @@ using namespace ExtUI;
constexpr static SpinnerDialogBoxData &mydata = screen_data.SpinnerDialogBox;
void SpinnerDialogBox::onEntry() {
mydata.auto_hide = true;
}
void SpinnerDialogBox::onRedraw(draw_mode_t) {
}
@ -38,6 +42,7 @@ void SpinnerDialogBox::show(progmem_str message) {
drawMessage(message);
drawSpinner();
storeBackground();
GOTO_SCREEN(SpinnerDialogBox);
mydata.auto_hide = false;
}
@ -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() {

View file

@ -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();