Fix wrong format specifier for axis label
_monitor_display() used %C (wide character, expects wint_t) instead of %c (plain char/int) to print the X/Y/Z axis label. Every other single-character display in the codebase uses %c; on the embedded build, without wide-char support in the C library, %C is not a valid conversion for the char actually being passed.
This commit is contained in:
@@ -384,7 +384,7 @@ static void _monitor_display(lis2dw_monitor_state_t *state)
|
|||||||
{
|
{
|
||||||
char buf[10];
|
char buf[10];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), " %C ", "XYZ"[state->axis]);
|
snprintf(buf, sizeof(buf), " %c ", "XYZ"[state->axis]);
|
||||||
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, buf, buf);
|
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, buf, buf);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%2d", state->axis + 1);
|
snprintf(buf, sizeof(buf), "%2d", state->axis + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user