From c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 29 Dec 2021 20:17:34 -0800 Subject: [Keymap] Reorganization, cleanup and readmes for drashna code (#15617) --- users/drashna/keyrecords/process_records.c | 42 +++++++++++++++++++----------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'users/drashna/keyrecords/process_records.c') diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index c7d4a925b0..f49ac6ef64 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -1,18 +1,5 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later #include "drashna.h" #include "version.h" @@ -22,6 +9,9 @@ #ifdef AUTOCORRECTION_ENABLE # include "autocorrection/autocorrection.h" #endif +#ifdef __AVR__ +#include +#endif uint16_t copy_paste_timer; bool host_driver_disabled = false; @@ -212,6 +202,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *re } break; } + case EEP_RST: + if (record->event.pressed) { + eeconfig_disable(); + shutdown_user(); +#ifdef __AVR__ + wdt_enable(WDTO_250MS); +#else + NVIC_SystemReset(); +#endif + } + return false; + case REBOOT: + if (record->event.pressed) { + shutdown_user(); +#ifdef __AVR__ + wdt_enable(WDTO_250MS); +#else + NVIC_SystemReset(); +#endif + } + return false; + } return true; } -- cgit v1.2.3