Browse Source

FIx big endian bug

remotes/origin_old/release/v2.9
inmarket 3 years ago
parent
commit
8bd70d953b
  1. 2
      demos/modules/ginput/keyboard/main.c
  2. 2
      demos/modules/gwin/keyboard/main.c
  3. 2
      demos/modules/gwin/textedit/main.c

2
demos/modules/ginput/keyboard/main.c

@ -98,7 +98,7 @@ int main(void) {
if (pk->bytecount) {
gwinPrintf(GW, " Keys:");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(GW, " 0x%02X", (uint8_t)pk->c[i]);
gwinPrintf(GW, " 0x%02X", (int)(uint8_t)pk->c[i]);
gwinPrintf(GW, " [");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(GW, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' ');

2
demos/modules/gwin/keyboard/main.c

@ -121,7 +121,7 @@ int main(void) {
if (pk->bytecount) {
gwinPrintf(ghConsole, " Keys:");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(ghConsole, " 0x%02X", (uint8_t)pk->c[i]);
gwinPrintf(ghConsole, " 0x%02X", (int)(uint8_t)pk->c[i]);
gwinPrintf(ghConsole, " [");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(ghConsole, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' ');

2
demos/modules/gwin/textedit/main.c

@ -145,7 +145,7 @@ int main(void) {
if (pk->bytecount) {
gwinPrintf(ghConsole, " Keys:");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(ghConsole, " 0x%02X", (uint8_t)pk->c[i]);
gwinPrintf(ghConsole, " 0x%02X", (int)(uint8_t)pk->c[i]);
gwinPrintf(ghConsole, " [");
for (i = 0; i < pk->bytecount; i++)
gwinPrintf(ghConsole, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' ');

Loading…
Cancel
Save