update code base to Marlin 2.0.9.2

This commit is contained in:
Stefan Kalscheuer
2021-10-03 18:57:12 +02:00
parent b9d7ba838e
commit 7077da3591
2617 changed files with 332093 additions and 103438 deletions

52
buildroot/share/fonts/genpages.c Executable file → Normal file
View File

@@ -71,63 +71,49 @@ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) {
assert(NULL != pstart);
#define NEXT_6_BITS() do{ val <<= 6; p++; val |= (*p & 0x3F); }while(0)
if (0 == (0x80 & *p)) {
val = (size_t)*p;
p++;
}
else if (0xC0 == (0xE0 & *p)) {
val = *p & 0x1F;
val <<= 6;
p++;
val |= (*p & 0x3F);
NEXT_6_BITS();
p++;
assert((wchar_t)val == get_val_utf82uni(pstart));
}
else if (0xE0 == (0xF0 & *p)) {
val = *p & 0x0F;
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
NEXT_6_BITS();
NEXT_6_BITS();
p++;
assert((wchar_t)val == get_val_utf82uni(pstart));
}
else if (0xF0 == (0xF8 & *p)) {
val = *p & 0x07;
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
p++;
assert((wchar_t)val == get_val_utf82uni(pstart));
}
else if (0xF8 == (0xFC & *p)) {
val = *p & 0x03;
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
p++;
assert((wchar_t)val == get_val_utf82uni(pstart));
}
else if (0xFC == (0xFE & *p)) {
val = *p & 0x01;
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
val <<= 6; p++;
val |= (*p & 0x3F);
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
NEXT_6_BITS();
p++;
assert((wchar_t)val == get_val_utf82uni(pstart));
}
@@ -156,12 +142,12 @@ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) {
return p;
}
void usage(char* progname) {
void usage(char *progname) {
fprintf(stderr, "usage: %s\n", progname);
fprintf(stderr, " read data from stdin\n");
}
void utf8_parse(const char* msg, unsigned int len) {
void utf8_parse(const char *msg, unsigned int len) {
uint8_t *pend = NULL;
uint8_t *p;
uint8_t *pre;