forked from kofal.net/zmk
fix(drivers): Proper static/const for data/config (#2769)
Save a tiny bit of RAM by properly marking our device config struct instances const consistently, and also add missing static modifiers to properly isolate config/data for drivers.
This commit is contained in:
@@ -445,7 +445,7 @@ static const struct kscan_driver_api kscan_charlieplex_api = {
|
||||
.charlieplex_state = kscan_charlieplex_state_##n, \
|
||||
}; \
|
||||
\
|
||||
static struct kscan_charlieplex_config kscan_charlieplex_config_##n = { \
|
||||
static const struct kscan_charlieplex_config kscan_charlieplex_config_##n = { \
|
||||
.cells = KSCAN_GPIO_LIST(kscan_charlieplex_cells_##n), \
|
||||
.debounce_config = \
|
||||
{ \
|
||||
|
||||
@@ -397,7 +397,7 @@ static const struct kscan_driver_api kscan_direct_api = {
|
||||
.pin_state = kscan_direct_state_##n, \
|
||||
COND_INTERRUPTS((.irqs = kscan_direct_irqs_##n, ))}; \
|
||||
\
|
||||
static struct kscan_direct_config kscan_direct_config_##n = { \
|
||||
static const struct kscan_direct_config kscan_direct_config_##n = { \
|
||||
.debounce_config = \
|
||||
{ \
|
||||
.debounce_press_ms = INST_DEBOUNCE_PRESS_MS(n), \
|
||||
|
||||
@@ -515,7 +515,7 @@ static const struct kscan_driver_api kscan_matrix_api = {
|
||||
.matrix_state = kscan_matrix_state_##n, \
|
||||
COND_INTERRUPTS((.irqs = kscan_matrix_irqs_##n, ))}; \
|
||||
\
|
||||
static struct kscan_matrix_config kscan_matrix_config_##n = { \
|
||||
static const struct kscan_matrix_config kscan_matrix_config_##n = { \
|
||||
.rows = ARRAY_SIZE(kscan_matrix_rows_##n), \
|
||||
.cols = ARRAY_SIZE(kscan_matrix_cols_##n), \
|
||||
.outputs = \
|
||||
|
||||
Reference in New Issue
Block a user