Skip to content

Commit 7e8e968

Browse files
committed
debug
1 parent 2dc034b commit 7e8e968

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

config/boards/arm/whkb_pro2/whkb_pro2_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ CONFIG_SETTINGS_NVS=y
2222
CONFIG_FLASH=y
2323
CONFIG_FLASH_PAGE_LAYOUT=y
2424
CONFIG_FLASH_MAP=y
25+
26+
CONFIG_ZMK_STUDIO_LOCKING=n

config/zephyr/kscan/kscan_hhkb_pro2.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,29 @@ struct kscan_hhkb_pro2_data
4747
static int kscan_hhkb_pro2_configure(const struct device *dev, kscan_callback_t callback)
4848
{
4949
LOG_DBG("KSCAN API configure");
50-
struct kscan_hhkb_pro2_data *data = dev->data;
51-
if (!callback)
52-
{
53-
return -EINVAL;
54-
}
55-
data->callback = callback;
50+
/* struct kscan_hhkb_pro2_data *data = dev->data; */
51+
/* if (!callback) */
52+
/* { */
53+
/* return -EINVAL; */
54+
/* } */
55+
/* data->callback = callback; */
5656
LOG_DBG("Configured KSCAN");
5757
return 0;
5858
}
5959

6060
static int kscan_hhkb_pro2_enable(const struct device *dev)
6161
{
6262
LOG_DBG("KSCAN API enable");
63-
struct kscan_hhkb_pro2_data *data = dev->data;
64-
k_work_schedule(&data->poll, K_MSEC(data->poll_interval));
63+
/* struct kscan_hhkb_pro2_data *data = dev->data; */
64+
/* k_work_schedule(&data->poll, K_MSEC(data->poll_interval)); */
6565
return 0;
6666
}
6767

6868
static int kscan_hhkb_pro2_disable(const struct device *dev)
6969
{
7070
LOG_DBG("KSCAN API disable");
71-
struct kscan_hhkb_pro2_data *data = dev->data;
72-
k_work_cancel_delayable(&data->poll);
71+
/* struct kscan_hhkb_pro2_data *data = dev->data; */
72+
/* k_work_cancel_delayable(&data->poll); */
7373
return 0;
7474
}
7575

@@ -172,24 +172,24 @@ static int kscan_hhkb_pro2_activity_event_handler(const struct device *dev, cons
172172
static int kscan_hhkb_pro2_init(const struct device *dev)
173173
{
174174
LOG_DBG("KSCAN init");
175-
struct kscan_hhkb_pro2_data *data = dev->data;
176-
const struct kscan_hhkb_pro2_config *cfg = dev->config;
177-
data->dev = dev;
178-
for (int i = 0; i < SEL_PINS; ++i)
179-
{
180-
gpio_pin_configure(cfg->bits[i].port,
181-
cfg->bits[i].pin,
182-
GPIO_OUTPUT_INACTIVE | cfg->bits[i].dt_flags);
183-
}
184-
gpio_pin_configure(cfg->power.port, cfg->power.pin, GPIO_OUTPUT_INACTIVE | cfg->power.dt_flags);
185-
// Disconnect input pin to save power.
186-
gpio_pin_configure(cfg->key.port, cfg->key.pin, GPIO_DISCONNECTED);
187-
gpio_pin_configure(cfg->hys.port, cfg->hys.pin, GPIO_OUTPUT_INACTIVE | cfg->hys.dt_flags);
188-
gpio_pin_configure(cfg->strobe.port, cfg->strobe.pin, GPIO_OUTPUT_INACTIVE | cfg->strobe.dt_flags);
189-
190-
data->poll_interval = cfg->active_polling_interval_ms;
191-
k_work_init_delayable(&data->poll, kscan_hhkb_pro2_work_handler);
192-
k_work_schedule(&data->poll, K_MSEC(data->poll_interval));
175+
/* struct kscan_hhkb_pro2_data *data = dev->data; */
176+
/* const struct kscan_hhkb_pro2_config *cfg = dev->config; */
177+
/* data->dev = dev; */
178+
/* for (int i = 0; i < SEL_PINS; ++i) */
179+
/* { */
180+
/* gpio_pin_configure(cfg->bits[i].port, */
181+
/* cfg->bits[i].pin, */
182+
/* GPIO_OUTPUT_INACTIVE | cfg->bits[i].dt_flags); */
183+
/* } */
184+
/* gpio_pin_configure(cfg->power.port, cfg->power.pin, GPIO_OUTPUT_INACTIVE | cfg->power.dt_flags); */
185+
/* // Disconnect input pin to save power. */
186+
/* gpio_pin_configure(cfg->key.port, cfg->key.pin, GPIO_DISCONNECTED); */
187+
/* gpio_pin_configure(cfg->hys.port, cfg->hys.pin, GPIO_OUTPUT_INACTIVE | cfg->hys.dt_flags); */
188+
/* gpio_pin_configure(cfg->strobe.port, cfg->strobe.pin, GPIO_OUTPUT_INACTIVE | cfg->strobe.dt_flags); */
189+
190+
/* data->poll_interval = cfg->active_polling_interval_ms; */
191+
/* k_work_init_delayable(&data->poll, kscan_hhkb_pro2_work_handler); */
192+
/* k_work_schedule(&data->poll, K_MSEC(data->poll_interval)); */
193193

194194
return 0;
195195
}

0 commit comments

Comments
 (0)