summaryrefslogtreecommitdiff
path: root/users/drashna/keyrecords/process_records.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/keyrecords/process_records.c')
-rw-r--r--users/drashna/keyrecords/process_records.c42
1 files changed, 27 insertions, 15 deletions
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) <drashna@live.com>
- *
- * 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 <http://www.gnu.org/licenses/>.
- */
+// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+// 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 <avr/wdt.h>
+#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;
}