You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <devicetree.h>
|
|
|
|
|
|
|
|
#define ZMK_MATRIX_NODE_ID DT_CHOSEN(zmk_kscan)
|
|
|
|
|
|
|
|
#if DT_NODE_HAS_PROP(ZMK_MATRIX_NODE_ID,row_gpios)
|
|
|
|
#define ZMK_MATRIX_ROWS DT_PROP_LEN(ZMK_MATRIX_NODE_ID,row_gpios)
|
|
|
|
#define ZMK_MATRIX_COLS DT_PROP_LEN(ZMK_MATRIX_NODE_ID,col_gpios)
|
|
|
|
#elif DT_NODE_HAS_PROP(ZMK_MATRIX_NODE_ID,input_gpios)
|
|
|
|
#define ZMK_MATRIX_ROWS 1
|
|
|
|
#define ZMK_MATRIX_COLS DT_PROP_LEN(ZMK_MATRIX_NODE_ID,input_gpios)
|
|
|
|
#else
|
|
|
|
#define ZMK_MATRIX_ROWS DT_PROP(ZMK_MATRIX_NODE_ID,rows)
|
|
|
|
#define ZMK_MATRIX_COLS DT_PROP(ZMK_MATRIX_NODE_ID,columns)
|
|
|
|
#endif
|
|
|
|
|