2020-04-22 06:20:34 +10:00
|
|
|
/*
|
2020-05-02 09:14:18 +10:00
|
|
|
* Copyright (c) 2020 Peter Johanson
|
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-04-26 12:41:20 +10:00
|
|
|
|
2020-05-07 00:04:19 +10:00
|
|
|
#include "zmk.h"
|
2020-05-02 09:14:18 +10:00
|
|
|
#include "kscan.h"
|
2020-05-06 06:09:05 +10:00
|
|
|
#include "usb_hid.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-04-22 06:20:34 +10:00
|
|
|
void main(void)
|
|
|
|
{
|
2020-05-02 04:58:00 +10:00
|
|
|
printk("Welcome to ZMK!\n");
|
2020-04-22 06:20:34 +10:00
|
|
|
|
2020-05-07 00:04:19 +10:00
|
|
|
if (zmk_kscan_init(ZMK_KSCAN_DEV) != 0) {
|
2020-05-04 05:49:33 +10:00
|
|
|
printk("Keyboard Scan Init Failed\n");
|
|
|
|
return;
|
|
|
|
}
|
2020-05-06 06:09:05 +10:00
|
|
|
|
|
|
|
if (zmk_usb_hid_init() < 0) {
|
|
|
|
printk("USB HID Init Failed\n");
|
|
|
|
return;
|
|
|
|
}
|
2020-04-22 06:20:34 +10:00
|
|
|
}
|