input: kbd_matrix: add print helper define

Add a print helper define for the keyboard matrix row paired with the
row typedef.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-11-22 17:04:28 +00:00 committed by Fabio Baltieri
parent 85b398be65
commit bc849c7078
2 changed files with 3 additions and 1 deletions

View file

@ -212,7 +212,7 @@ static bool input_kbd_matrix_check_key_events(const struct device *dev)
key_pressed = input_kbd_matrix_scan(dev);
for (int c = 0; c < cfg->col_size; c++) {
LOG_DBG("c=%2d u=%02x p=%02x n=%02x",
LOG_DBG("c=%2d u=" PRIkbdrow " p=" PRIkbdrow " n=" PRIkbdrow,
c,
cfg->matrix_unstable_state[c],
cfg->matrix_previous_state[c],

View file

@ -32,8 +32,10 @@
/** Row entry data type */
#if CONFIG_INPUT_KBD_MATRIX_16_BIT_ROW
typedef uint16_t kbd_row_t;
#define PRIkbdrow "%04x"
#else
typedef uint8_t kbd_row_t;
#define PRIkbdrow "%02x"
#endif
/** Maximum number of rows */