From f5cc84ffd0789dbd322230775597a00cb20bcda3 Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 6 Jan 2018 14:08:37 -0800 Subject: [PATCH] Make the LED do something. --- .../clueboard/1/keymaps/default/keymap.c | 25 ++++++++++++++++++- keyboards/clueboard/1/rules.mk | 5 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/keyboards/clueboard/1/keymaps/default/keymap.c b/keyboards/clueboard/1/keymaps/default/keymap.c index 5a4ab99a..97c89420 100644 --- a/keyboards/clueboard/1/keymaps/default/keymap.c +++ b/keyboards/clueboard/1/keymaps/default/keymap.c @@ -1,6 +1,29 @@ #include "1.h" +#include "print.h" + +#define BUTTON SAFE_RANGE const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //[0] = LAYOUT(BL_STEP) - [0] = LAYOUT(KC_1) + //[0] = LAYOUT(KC_1) + [0] = LAYOUT(BUTTON) }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BUTTON: + if (record->event.pressed) { + print("BUTTON was pressed!\n"); + palClearPad(GPIOB, 5); + palClearPad(GPIOB, 3); + palClearPad(GPIOA, 2); + } else { + print("BUTTON was released!\n"); + palSetPad(GPIOB, 5); + palSetPad(GPIOB, 3); + palSetPad(GPIOA, 2); + } + return false; + } + return true; +} diff --git a/keyboards/clueboard/1/rules.mk b/keyboards/clueboard/1/rules.mk index 7aa7bb25..d4563c61 100644 --- a/keyboards/clueboard/1/rules.mk +++ b/keyboards/clueboard/1/rules.mk @@ -45,5 +45,6 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = no # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover -CUSTOM_MATRIX = yes # Custom matrix file +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +#AUDIO_ENABLE = yes