Move some things around

This commit is contained in:
Daniel Flanagan 2019-12-23 11:50:09 -06:00
parent 55994b6e60
commit c69d225d0a
3 changed files with 39 additions and 46 deletions

View file

@ -1,4 +1,6 @@
#include <stdbool.h>
#include <stdlib.h>
#include <math.h>
#include "action.h"
#include "twi_master.h"
@ -74,20 +76,16 @@ void expander_read_cols(void) {
}
uint8_t expander_get_col(uint8_t col) {
if (col > (MATRIX_COLS / 2) + 1) {
col++;
}
return expander_input & (1<<col) ? 1 : 0;
}
matrix_row_t expander_read_row(void) {
expander_read_cols();
/* make cols */
matrix_row_t cols = 0;
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
for (uint8_t col = 0; col < 8; col++) {
if (expander_get_col(col)) {
cols |= (1UL << (MATRIX_COLS + 1 - col));
cols |= (1 << (col + 4));
}
}

View file

@ -22,50 +22,50 @@
enum layers { L_QWERTY, L_LEFT, L_RIGHT, L_CONFIG, L_BOTH };
#define TAB_ALT LALT_T(KC_TAB)
#define K_L_L MO(L_LEFT)
#define K_L_R MO(L_RIGHT)
#define K_L_C MO(L_CONFIG)
#define K_L_B MO(L_BOTH)
#define KC_L_L MO(L_LEFT)
#define KC_L_R MO(L_RIGHT)
#define KC_L_C MO(L_CONFIG)
#define KC_L_B MO(L_BOTH)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[L_QWERTY] = LAYOUT(
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC,
TAB_ALT, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC,
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC,
ESC_CTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT ,
KC_LGUI, KC_SPC , K_L_L , K_L_C , K_L_C , KC_LALT, K_L_R , KC_RALT
KC_LGUI, KC_SPC , KC_L_L , KC_L_C , KC_L_C , KC_L_R , KC_SPC , KC_RALT
),
[L_LEFT] = LAYOUT(
KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 ,
KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC , KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL ,
KC_DEL , _______, _______, _______, _______, _______ , _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC , KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
_______, _______, _______, _______, _______, _______ , _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______ , _______, K_L_B , K_L_B, _______
_______, _______, _______, _______ , _______, KC_L_B , KC_L_B , _______
),
// the insert key at M's position is for easily inputting Shift+Insert
[L_RIGHT] = LAYOUT(
KC_ESC , KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC , KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL ,
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL ,
KC_GRV , _______, _______, _______, _______, _______ , _______, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS,
_______, _______, _______, _______, _______, _______ , _______, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS,
_______, _______, _______, _______, _______, _______ , _______, KC_INS , _______, _______, _______, _______,
_______, KC_LALT, K_L_B , _______ , _______, _______, _______, _______
_______, KC_LALT, KC_L_B , _______ , _______, _______, _______, _______
),
[L_CONFIG] = LAYOUT(
RESET , _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
RESET , _______, _______, _______, _______, OUT_AUTO , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, OUT_USB , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, OUT_BT , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______ , _______, _______, _______, _______
),
[L_BOTH] = LAYOUT(
_______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ , KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______,
_______, _______, _______, _______, _______, _______ , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______,
_______, _______, _______, _______, _______, _______ , KC_HOME, KC_PGDN, KC_PGUP, KC_END , _______, _______,
DF(0) , DF(1) , DF(2) , DF(3) , DF(4) , _______ , _______, _______, _______, _______, _______, _______,
_______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______ , KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______,
_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______ , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______,
_______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______ , KC_HOME, KC_PGDN, KC_PGUP, KC_END , _______, _______,
_______, _______, _______, _______ , _______, _______, _______, _______
)
};

View file

@ -3,9 +3,6 @@ SRC = \
matrix.c \
expander.c \
# MCU: Feather 32u4 Bluefruit LE
# IO Expander: MCP23017
MCU ?= atmega32u4
ARCH ?= AVR8
@ -18,26 +15,24 @@ BOOTLOADER ?= caterina
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDone
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= no # Commands for debug and configuration
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE ?= no # Enable keyboard RGB underglow
MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # TODO: Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches
HD44780_ENABLE ?= no # Enable support for HD44780 based LCDs (+400)
CUSTOM_MATRIX ?= yes
BOOTMAGIC_ENABLE ?= no
MOUSEKEY_ENABLE ?= yes
EXTRAKEY_ENABLE ?= yes
CONSOLE_ENABLE ?= no
COMMAND_ENABLE ?= no
SLEEP_LED_ENABLE ?= no
NKRO_ENABLE ?= yes
BACKLIGHT_ENABLE ?= no
RGBLIGHT_ENABLE ?= no
MIDI_ENABLE ?= no
UNICODE_ENABLE ?= no
BLUETOOTH_ENABLE ?= yes
AUDIO_ENABLE ?= no
FAUXCLICKY_ENABLE ?= no
HD44780_ENABLE ?= no
ADAFRUIT_BLE_ENABLE ?= yes
BLUETOOTH ?= AdafruitBLE
# SPLIT_KEYBOARD ?= yes
LAYOUTS = splyte
DEBUG_MATRIX ?= no