-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Debug char, fix compile errors for lcd pins #4335
Debug char, fix compile errors for lcd pins #4335
Conversation
thinkyhead
commented
Jul 17, 2016
•
edited
Loading
edited
- Add a character debug option, so single letters can be output
- Fix compile errors with redefined lcd pins. Reference: Support for VIKI2 with MKS 1.3 / 1.4 #4277 (comment)
- Small reduction in lcd status code
77a7463
to
5e3d391
Compare
I've confirmed just now that warnings are gone. |
But unfortunately, flickering problem on ASCII LCD with |
I don't know how to fix it. The code I posted on that issue is somehow incorrect. But how, I don't know. Someone needs to log the bytes being processed in the function setting the lcd message. |
Hum... how to log it? |
void set_utf_strlen(char* s, uint8_t n) {
uint8_t i = 0, j = 0;
while (s[i] && (j < n)) {
if ((s[i] & 0xC0u) != 0x80u) j++;
SERIAL_ECHOPAIR("Message byte ", i);
SERIAL_ECHOPAIR(" at len ", j);
SERIAL_ECHOPAIR(" is char ", int(s[i]) & 0x00FF);
SERIAL_EOL;
i++;
}
while (j++ < n) s[i++] = ' ';
s[i] = '\0';
} |
I'm thankful for the exhibiting.
|
Those big numbers are actually small negative numbers. I altered the logging code above to try to get better output. So please try again with the new code. |
And, these are
|
Sure. please wait a moment. |
Well, it's not super important. I can begin to see what is happening. But why? That is what we need to know...
The longer string is supposed to register as 14 characters (
Do you see the same behavior with both |
retaked
|
This need the same correction for MAPPER_NON as lcd_strlen(). |
Actually, there are 16 bytes that become 14 characters, so I believe the Should either |
Probably fixes the issue. Probably not the best or real solution: void set_utf_strlen(char* s, uint8_t n) {
uint8_t i = 0, j = 0;
while (s[i] && (j < n)) {
#if ENABLED(MAPPER_NON)
#if ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
if (s[i] != 0xDEu) j++;
#else
j++;
#endif
#else
if ((s[i] & 0xC0u) != 0x80u) j++;
#endif
i++;
}
while (j++ < n) s[i++] = ' ';
s[i] = '\0';
} |
It's unerring suggestion. I've confirmed flickering is gone.
|
Oh, I test it from now. Please wait a moment again... |
Test has been done. Flickering is gone.
|
No, it isn't. |
Um? It looks like that solution for fix by @thinkyhead was changed... |
Done... Tested code: void set_utf_strlen(char* s, uint8_t n) {
uint8_t i = 0, j = 0;
while (s[i] && (j < n)) {
#if ENABLED(MAPPER_NON)
#if ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
if (s[i] != 0xDEu) j++;
#else
j++;
#endif
#else
if ((s[i] & 0xC0u) != 0x80u) j++;
#endif
SERIAL_ECHOPAIR("Message byte ", i);
SERIAL_ECHOPAIR(" at len ", j);
SERIAL_ECHOPAIR(" is char ", int(s[i]) & 0x00FF);
SERIAL_EOL;
i++;
}
while (j++ < n) s[i++] = ' ';
s[i] = '\0';
} Logs:
|
Follow-up the PR #4335 (Debug char, fix compile errors for lcd pins)
…for lcd pins) ・Solve a flickering when SD card is inserted or removed at using a ASCII LCD + language_kana.h