2020-04-22 06:20:34 +10:00
|
|
|
/*
|
2020-09-10 13:57:44 +10:00
|
|
|
* Copyright (c) 2020 The ZMK Contributors
|
2020-04-22 06:20:34 +10:00
|
|
|
*
|
2020-05-02 09:14:18 +10:00
|
|
|
* SPDX-License-Identifier: MIT
|
2020-04-22 06:20:34 +10:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zephyr.h>
|
|
|
|
#include <device.h>
|
|
|
|
#include <devicetree.h>
|
2020-05-21 13:36:27 +10:00
|
|
|
#include <settings/settings.h>
|
2020-04-26 12:41:20 +10:00
|
|
|
|
2020-05-25 08:22:16 +10:00
|
|
|
#include <logging/log.h>
|
|
|
|
LOG_MODULE_REGISTER(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|
|
|
|
2020-05-18 23:11:46 +10:00
|
|
|
#include <zmk/matrix.h>
|
|
|
|
#include <zmk/kscan.h>
|
2020-07-25 06:39:11 +10:00
|
|
|
#include <zmk/display.h>
|
2020-04-22 06:20:34 +10:00
|
|
|
|
2020-05-07 00:04:19 +10:00
|
|
|
#define ZMK_KSCAN_DEV DT_LABEL(ZMK_MATRIX_NODE_ID)
|
2020-05-15 23:41:06 +10:00
|
|
|
|
2020-09-14 12:53:24 +10:00
|
|
|
void main(void) {
|
|
|
|
LOG_INF("Welcome to ZMK!\n");
|
2020-04-22 06:20:34 +10:00
|
|
|
|
2020-09-14 12:53:24 +10:00
|
|
|
if (zmk_kscan_init(ZMK_KSCAN_DEV) != 0) {
|
|
|
|
return;
|
|
|
|
}
|
2020-07-25 06:39:11 +10:00
|
|
|
|
|
|
|
#ifdef CONFIG_ZMK_DISPLAY
|
2020-09-14 12:53:24 +10:00
|
|
|
zmk_display_init();
|
2020-07-25 06:39:11 +10:00
|
|
|
|
2020-09-14 12:53:24 +10:00
|
|
|
while (1) {
|
|
|
|
zmk_display_task_handler();
|
|
|
|
}
|
2020-07-25 06:39:11 +10:00
|
|
|
#endif /* CONFIG_ZMK_DISPLAY */
|
2020-04-22 06:20:34 +10:00
|
|
|
}
|