Skip to content

Commit

Permalink
Merge branch 'woodpad'
Browse files Browse the repository at this point in the history
  • Loading branch information
colemarkham committed Aug 2, 2017
2 parents 9eab66c + a59d4cc commit c6aabf8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion keyboards/woodpad/keymaps/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

ifndef QUANTUM_DIR
Expand Down
6 changes: 6 additions & 0 deletions keyboards/woodpad/keymaps/default/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@

// place overrides here

#undef RGB_DI_PIN
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGB_DI_PIN D3
#define RGBLED_NUM 7

#endif
16 changes: 12 additions & 4 deletions keyboards/woodpad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
[_ADJUST] = KEYMAP( /* Base */
_______, KC_A, _______, RESET,\
_______, _______, _______, _______, \
_______, _______, _______, _______, \
_______, _______, _______, _______, \
RGB_TOG, RGB_MOD, _______, _______, \
RGB_HUI, RGB_SAI, RGB_VAI, _______, \
RGB_HUD , RGB_SAD, RGB_VAD, _______, \
_______, _______, _______, _______ \
),
};
Expand All @@ -65,10 +65,14 @@ const uint16_t PROGMEM fn_actions[] = {

void numlock_led_on(void) {
PORTF |= (1<<7);

rgblight_show_solid_color(0, 0, 0xFF);
}

void numlock_led_off(void) {
PORTF &= ~(1<<7);

rgblight_show_solid_color(0, 0xFF, 0);
}

static bool numlock_down = false;
Expand All @@ -80,8 +84,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
numlock_down = true;
if (IS_LAYER_ON(_ALT)) {
layer_on(_ADJUST);
// Don't want to trigger numlock when it's released, so pretend it's no longer down
numlock_down = false;
}
} else{
// If adjust layer was entered, the numlock_down state will not be set which will toggle the numlock state, don't want that
if (!numlock_down) {return false; }
if(!IS_LAYER_ON(_ADJUST)) {
if (!IS_LAYER_ON(_NAV)){
numlock_led_off();
Expand Down Expand Up @@ -122,7 +130,7 @@ void matrix_init_user(void) {
// set Numlock LED to output and low
DDRF |= (1<<7);
PORTF &= ~(1<<7);

numlock_led_on();
}

void matrix_scan_user(void) {
Expand Down
14 changes: 14 additions & 0 deletions keyboards/woodpad/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,17 @@ UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches

avrdude: build
ls /dev/tty.* > /tmp/1; \
echo "Reset your Pro Micro now"; \
while [ -z $$USB ]; do \
sleep 1; \
ls /dev/tty.* > /tmp/2; \
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
done; \
echo Found USB device: $$USB; \
echo executing avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex

.PHONY: avrdude

0 comments on commit c6aabf8

Please sign in to comment.