Moved the logic to select the type of reboot from behavior_reset.c to a new zmk_reset() function. This allows rebooting to bootloader from other code, and it gives us a starting point for future work to support other bootloaders aside from the Adafruit nrf52 bootloader.
24 lines
521 B
Text
24 lines
521 B
Text
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <dt-bindings/zmk/reset.h>
|
|
|
|
/ {
|
|
behaviors {
|
|
sys_reset: behavior_reset {
|
|
compatible = "zmk,behavior-reset";
|
|
label = "SYSRESET";
|
|
#binding-cells = <0>;
|
|
};
|
|
|
|
bootloader: behavior_reset_dfu {
|
|
compatible = "zmk,behavior-reset";
|
|
label = "BOOTLOAD";
|
|
type = <ZMK_RESET_BOOTLOADER>;
|
|
#binding-cells = <0>;
|
|
};
|
|
};
|
|
};
|