Make the LED do something.

This commit is contained in:
skullY 2018-01-06 14:08:37 -08:00
parent 75977b86ea
commit f5cc84ffd0
2 changed files with 27 additions and 3 deletions

View File

@ -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;
}

View File

@ -47,3 +47,4 @@ 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
#AUDIO_ENABLE = yes