* Add bindings to allow creating multiple physical layouts that specify their key's physical attributes, and the matching matrix transform and dependant kscan to use. * Synthesize a basic physical layout if none specified, for backwards compatibility. * Update matrix transform API to explicitly pass in the selected transform to the API instead of using a fixed chosen transform. * Move kscan subscription and handling into the physical layout code, so that selecting a different physical layout at runtime can also use the correct kscan instance. * Add `physical_layouts.dtsi` file to include so you can use the pre-configured `&key_physical_attrs` for adding you layout keys.
30 lines
557 B
C
30 lines
557 B
C
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/device.h>
|
|
#include <zephyr/devicetree.h>
|
|
#include <zephyr/settings/settings.h>
|
|
|
|
#include <zephyr/logging/log.h>
|
|
LOG_MODULE_REGISTER(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|
|
|
#include <zmk/display.h>
|
|
|
|
int main(void) {
|
|
LOG_INF("Welcome to ZMK!\n");
|
|
|
|
#if IS_ENABLED(CONFIG_SETTINGS)
|
|
settings_subsys_init();
|
|
settings_load();
|
|
#endif
|
|
|
|
#ifdef CONFIG_ZMK_DISPLAY
|
|
zmk_display_init();
|
|
#endif /* CONFIG_ZMK_DISPLAY */
|
|
|
|
return 0;
|
|
}
|