Merge pull request #21 from qmk/master

Merge from QMK
This commit is contained in:
Damien 2017-04-29 15:03:52 +02:00 committed by GitHub
commit 584b804ee3
92 changed files with 2832 additions and 235 deletions

View File

@ -21,6 +21,8 @@ override SILENT := false
ON_ERROR := error_occurred=1
BREAK_ON_ERRORS = no
STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
ROOT_DIR := $(dir $(ROOT_MAKEFILE))
@ -462,20 +464,25 @@ endef
include $(ROOT_DIR)/message.mk
ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
HANDLE_ERROR = exit 1
else
HANDLE_ERROR = echo $$error_occurred > $(ERROR_FILE)
endif
# The empty line is important here, as it will force a new shell to be created for each command
# Otherwise the command line will become too long with a lot of keyboards and keymaps
define RUN_COMMAND
+error_occurred=0;\
$(COMMAND_$(SILENT_MODE)_$(COMMAND))\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi;
if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef
define RUN_TEST
+error_occurred=0;\
$($(TEST)_COMMAND)\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi;
if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
@ -527,14 +534,22 @@ test: test-all
.PHONY: test-clean
test-clean: test-all-clean
ifdef SKIP_VERSION
SKIP_GIT := yes
endif
# Generate the version.h file
ifndef SKIP_GIT
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
else
GIT_VERSION := NA
endif
ifndef SKIP_VERSION
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
else
BUILD_DATE := NA
endif
include $(ROOT_DIR)/testlist.mk

View File

@ -176,22 +176,26 @@ endif
ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
endif
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
endif
ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
endif
ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/light_ws2812.c

5
keyboards/M10A/M10A.c Normal file
View File

@ -0,0 +1,5 @@
#include "M10A.h"
void matrix_init_kb(void) {
matrix_init_user();
}

19
keyboards/M10A/M10A.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef M10A_H
#define M10A_H
#include "quantum.h"
#define M10A( \
k00, k01, k02, \
k10, k11, k12, \
k20, k21, k22, \
k30, k31, k32 \
) \
{ \
{ k00, k01, k02 }, \
{ k10, k11, k12 }, \
{ k20, k21, k22 }, \
{ k30, k31, k32 } \
}
#endif

3
keyboards/M10A/Makefile Normal file
View File

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

82
keyboards/M10A/config.h Normal file
View File

@ -0,0 +1,82 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0007
#define DEVICE_VER 0x0001
#define MANUFACTURER Machine Industries
#define PRODUCT M10-A
#define DESCRIPTION RAMA x Machine Industries M10-A
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 3
/* Planck PCB default pin-out */
#define MATRIX_ROW_PINS { B6, F7, F6, D6 }
#define MATRIX_COL_PINS { F5, F1, F0 }
#define UNUSED_PINS
#define BACKLIGHT_PIN B7
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 6
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#endif

View File

@ -0,0 +1,3 @@
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@ -0,0 +1,49 @@
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
// this is the style you want to emulate.
#include "M10A.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layers {
_LAYER0,
_LAYER1,
_LAYER2,
_LAYER3,
_LAYER4,
_LAYER5,
_LAYER6,
_LAYER7,
_LAYER8,
_LAYER9
};
// // Fillers to make layering more clear
// #define _______ KC_TRNS
// #define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER1] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER2] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER3] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER4] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER5] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER6] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER7] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER8] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER9] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}
};
void matrix_init_user(void) {
#ifdef BACKLIGHT_ENABLE
backlight_level(0);
#endif
}

68
keyboards/M10A/rules.mk Normal file
View File

@ -0,0 +1,68 @@
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
MIDI_ENABLE ?= no # MIDI controls
AUDIO_ENABLE ?= no # Audio output on port C6
UNICODE_ENABLE ?= yes # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight.
API_SYSEX_ENABLE = yes
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend

View File

@ -39,7 +39,22 @@
{k40, k41, k42, k43}, \
{k50, XXX, k52, XXX} \
}
#define MAXKEYMAP( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k51, k52, k53\
) \
{ \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k30, k31, k32, k33}, \
{k40, k41, k42, k43}, \
{k50, k51, k52, k53} \
}
void matrix_init_user(void);
void matrix_scan_user(void);

View File

@ -0,0 +1,102 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* |Esc |Setp| - | = |
* |----|----|----|----|
* | F1 | F2 | F3 | F4 |
* |----|----|----|----|
* | 7 | 8 | 9 | - |
* |----|----|----|----|
* | 4 | 5 | 6 | LF |
* |----|----|----|----|
* | 1 | 2 | 3 | \ |
* |----|----|----|----|
* |Left|Down| Up |Rght|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_ESC, KC_TAB, KC_MINS,KC_EQL, \
KC_F1, KC_F2, KC_F3, KC_F4, \
KC_P7, KC_P8, KC_P9, KC_PMNS, \
KC_P4, KC_P5, KC_P6, KC_PENT, \
KC_P1, KC_P2, KC_P3, KC_BSLS, \
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
/* Keymap _FL: Function Layer
* ,-------------------.
* |Esc |TAB |BS | = |
* |----|----|----|----|
* | NL | / | * | - |
* |----|----|----|----|
* | 7 | 8 | 9 | |
* |----|----|----|RST |
* | 4 | 5 | 6 | |
* |----|----|----|----|
* | 1 | 2 | 3 | |
* |----|----|----| En |
* | 0 |./FN| |
* `-------------------'
*/
[_FL] = MAXKEYMAP(
KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
KC_P7, KC_P8, KC_P9, RESET, \
KC_P4, KC_P5, KC_P6, KC_PENT, \
KC_P1, KC_P2, KC_P3, KC_PENT, \
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
};
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

View File

@ -0,0 +1,65 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* | T | G | B |Spac|
* |----|----|----|----|
* | R | F | V | Fn |
* |----|----|----|----|
* | E | D | C | OS |
* |----|----|----|----|
* | W | S | X | Alt|
* |----|----|----|----|
* | Q | A | Z | Ctl|
* |----|----|----|----|
* | Esc| Tab|Shft| Fn2|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_T, KC_G, KC_B, KC_SPACE,\
KC_R, KC_F, KC_V, MO(1), \
KC_E, KC_D, KC_C, KC_LGUI, \
KC_W, KC_S, KC_X, KC_LALT, \
KC_Q, KC_A, KC_Z, KC_LCTL, \
KC_TAB, KC_ESC, KC_LSHIFT, MO(1)),
/* Keymap _FL: Function Layer
* ,-------------------.
* | 5 | F5 | F11|Spac|
* |----|----|----|----|
* | 4 | F4 | F10| |
* |----|----|----|----|
* | 3 | F3 | F9 | OS |
* |----|----|----|----|
* | 2 | F2 | F8 | Alt|
* |----|----|----|----|
* | 1 | F1 | F7 | Ctl|
* |----|----|----|----|
* | ` | Del|Shft| |
* `-------------------'
*/
[_FL] = MAXKEYMAP(
KC_5, KC_F5, KC_F11, _______, \
KC_4, KC_F4, KC_F10, _______, \
KC_3, KC_F3, KC_F9, _______, \
KC_2, KC_F2, KC_F8, _______, \
KC_1, KC_F1, KC_F7, _______, \
KC_GRV,KC_DEL, _______, _______),
};

View File

@ -0,0 +1,65 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* |Spac| N | H | Y |
* |----|----|----|----|
* | Fn | M | J | U |
* |----|----|----|----|
* |Left| , | K | I |
* |----|----|----|----|
* |Down| . | L | O |
* |----|----|----|----|
* | Up | / | ; | P |
* |----|----|----|----|
* |Rght| Ret| " |Bspc|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_SPACE, KC_N, KC_H, KC_Y, \
MO(1), KC_M, KC_J, KC_U, \
KC_LEFT, KC_COMM, KC_K, KC_I, \
KC_DOWN, KC_DOT, KC_L, KC_O, \
KC_UP, KC_SLASH, KC_SCLN, KC_P, \
KC_RIGHT, KC_ENT, KC_QUOT, KC_BSPC),
/* Keymap _FL: Function Layer
* ,-------------------.
* |Esc | F12| F6 | 6 |
* |----|----|----|----|
* | NL | M | - | 7 |
* |----|----|----|----|
* |Left| , | = | 8 |
* |----|----|----|----|
* |Down| . | [ | 9 |
* |----|----|----|----|
* | Up | / | ] | 0 |
* |----|----|----|----|
* |Rght| Ret| \ | Del|
* `-------------------'
*/
[_FL] = MAXKEYMAP(
_______, KC_F12, KC_F6, KC_6, \
_______, _______, KC_MINS, KC_7, \
_______, _______, KC_EQL, KC_8, \
_______, _______, KC_LBRC, KC_9, \
_______, _______, KC_RBRC, KC_0, \
_______, _______, KC_BSLS, KC_DEL),
};

View File

@ -0,0 +1,4 @@
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes

View File

@ -0,0 +1,103 @@
#include "clueboard.h"
// Helpful defines
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
#define _______ KC_TRNS
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _ME 2
#define _CL 3
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: Base Layer (Default Layer)
*/
[_BL] = KEYMAP(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RGUI, MO(_FL), MO(_ME), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
[_FL] = KEYMAP(
KC_ESC, 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_DEL, KC_HOME, \
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_PSCR, KC_END, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_HOME, KC_PGDN, KC_END),
/* Keymap _FL: Function Layer
*/
[_ME] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, KC_VOLD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______ , _______, _______, \
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_MPRV, KC_MPLY, KC_MNXT),
/* Keymap _CL: Control layer
*/
[_CL] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, MO(_FL), _______, RGB_SAI, \
_______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
};
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), // Calls action_function()
[1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
static bool mod_flag;
switch (id) {
case 0:
/* Handle the combined Grave/Esc key
*/
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (record->event.pressed) {
/* The key is being pressed.
*/
if (mods_pressed) {
mod_flag = true;
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
/* The key is being released.
*/
if (mod_flag) {
mod_flag = false;
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
case 1:
if(record->event.pressed) {
del_key(KC_ESC);
}
break;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,23 @@
```
___ _____ _ _ _ __ __ _ __
|__ \ / ____| | | | | | / / / /(_) / /
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
```
# Serubin's Clueboard Layout
This is the layout based on the clueboard default, modified for development on Mac, PC, and Windows. This layout also handles media and volume keys on all the previously listed platforms. Most importantly, Capslock has been replaced by a dual function Esc/Ctrl key. This is particularly handy for use in Vim.
#### Base Layer
![Base Layout Image](layout-base.png)
#### Fn Layer
![Fn Layout Image](layout-fn.png)
#### Media Layer
![Media Layer Image](layout-media.png)

View File

@ -19,8 +19,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
KC_LCTL, KC_LALT, KC_LGUI,MO(_FL), S(KC_SPC),S(KC_SPC), MO(_FL), KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer
*/

View File

@ -16,33 +16,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: Base Layer (Default Layer)
*/
[_BL] = KEYMAP(
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL,KC_LALT,KC_LGUI,MO(_FL), KC_SPC, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
[_FL] = KEYMAP(
KC_GRV, 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_DEL, BL_STEP, \
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______, \
_______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_PGUP, \
_______,_______,_______,MO(_FL), _______,_______, MO(_FL),_______,_______,MO(_FL),KC_HOME,KC_PGDN,KC_END),
S(KC_GRV), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, \
S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer
*/
[_CL] = KEYMAP(
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
_______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
_______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
_______,_______,_______,_______, _______,_______, _______,_______,_______,MO(_FL),_______, _______, _______),
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
_______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD,RGB_SAD,RGB_HUI),
};
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0),
[0] = ACTION_FUNCTION(0), // Calls action_function()
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

View File

@ -75,7 +75,7 @@ static GFXINLINE void init_board(GDisplay *g) {
palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
palSetPadModeRaw(MOSI, ST7565_SPI_MODE);
palSetPadModeRaw(SLCK, ST7565_SPI_MODE);
palSetPadModeRaw(SS, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadModeNamed(SS, PAL_MODE_OUTPUT_PUSHPULL);
spiInit();
spiStart(&SPID1, &spi1config);

View File

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "print.h"
#include "debug.h"
#include "matrix.h"
#include "serial_link/system/serial_link.h"
/*

View File

@ -311,12 +311,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break;
case SWITCH_NDS:
if (record->event.pressed) {
return MACRO( D(LSFT), T(F11), U(LSFT), W(500), D(LALT), T(TAB), U(LALT), END);
return MACRO( D(LSFT), T(F11), U(LSFT), W(255), D(LALT), T(TAB), U(LALT), END);
}
break;
case OPEN_CLOSE_PAREN:
if (record->event.pressed) {
return MACRO( D(LSFT), T(LPRN), T(RPRN), U(LSFT), T(LEFT), END);
return MACRO( D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END);
}
break;
case OPEN_CLOSE_BRACKET:
@ -326,7 +326,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break;
case OPEN_CLOSE_CURLY:
if (record->event.pressed) {
return MACRO( D(LSFT), T(LCBR), T(RCBR), U(LSFT), T(LEFT), END);
return MACRO( D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END);
}
break;
case OPEN_CLOSE_SINGLE_QUOTE:

View File

@ -392,7 +392,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case NotEq:
if (record->event.pressed) {
return MACRO( I(10), D(LSFT), T(EXLM), U(LSFT), T(EQL), END ); // !=
return MACRO( I(10), D(LSFT), T(1), U(LSFT), T(EQL), END ); // !=
}
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -0,0 +1,187 @@
// Netable differences vs. the default firmware for the ErgoDox EZ:
// 1. The Cmd key is now on the right side, making Cmd+Space easier.
// 2. The media keys work on OSX (But not on Windows).
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | LCtl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui |
* |--------+------+------+------+------+------| BkSp | | Meh |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,---------------.
* | BkSp | LGui | | Alt |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Space|LANG1 |------| |------|LANG2 |Enter |
* | /LGui| | End | | PgDn | | |
* `--------------------' `----------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[BASE] = KEYMAP( // layer 0 : default
// left hand
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_BSPC,
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
KC_BSPC, KC_LGUI,
KC_HOME,
MT(MOD_LGUI, KC_SPC),KC_LANG1,KC_END,
// right hand
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI,
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN,KC_LANG2, KC_ENT
),
/* Keymap 1: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | . | 0 | = | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// SYMBOLS
[SYMB] = KEYMAP(
// left hand
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,
KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | Prev | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | |Brwser|
* | | |------| |------| |Back |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
[MDIA] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
default:
// none
break;
}
};

View File

@ -0,0 +1,15 @@
# ErgoDox EZ Default Configuration
## Changelog
* Dec 2016:
* Added LED keys
* Refreshed layout graphic, comes from http://configure.ergodox-ez.com now.
* Sep 22, 2016:
* Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
* Feb 2, 2016 (V1.1):
* Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
This is what we ship with out of the factory. :) The image says it all:
![Default](default_firmware_v1.2-2.png)

View File

@ -17,7 +17,7 @@
#include "yoruian.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP\
[0] = KEYMAP_YORUIAN\
(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8,
ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q,
LC, U, I, A, N, SCLN, M, H, T, S, C, RC,
@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
BSPC, RALT, P2, TAB,
NO, NO,
E, LSFT, NO, NO, ENT, SPC),
[1] = KEYMAP\
[1] = KEYMAP_YORUIAN\
(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9,
TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT,
TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE,

View File

@ -18,36 +18,32 @@
#include "debug.h"
#include "action_layer.h"
#undef KEYMAP
#define KEYMAP\
( \
/* Spacial positions. */ \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \
k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \
k55, k56, k57, k58, \
k54, k59, \
k53, k52, k51, k5C, k5B, k5A) \
\
/* Matrix positions. */ \
{ \
{ KC_##k00, KC_##k10, KC_##k20, KC_##k30, KC_##k40, KC_NO }, \
{ KC_##k01, KC_##k11, KC_##k21, KC_##k31, KC_##k41, KC_##k51 }, \
{ KC_##k02, KC_##k12, KC_##k22, KC_##k32, KC_##k42, KC_##k52 }, \
{ KC_##k03, KC_##k13, KC_##k23, KC_##k33, KC_##k43, KC_##k53 }, \
{ KC_##k04, KC_##k14, KC_##k24, KC_##k34, KC_##k44, KC_##k54 }, \
{ KC_##k05, KC_##k15, KC_##k25, KC_##k35, KC_NO, KC_##k55 }, \
{ KC_##k06, KC_##k16, KC_NO, KC_##k36, KC_NO, KC_##k56 }, \
{ KC_##k07, KC_##k17, KC_NO, KC_##k37, KC_NO, KC_##k57 }, \
{ KC_##k08, KC_##k18, KC_##k28, KC_##k38, KC_NO, KC_##k58 }, \
{ KC_##k09, KC_##k19, KC_##k29, KC_##k39, KC_##k49, KC_##k59 }, \
{ KC_##k0A, KC_##k1A, KC_##k2A, KC_##k3A, KC_##k4A, KC_##k5A }, \
{ KC_##k0B, KC_##k1B, KC_##k2B, KC_##k3B, KC_##k4B, KC_##k5B }, \
{ KC_##k0C, KC_##k1C, KC_##k2C, KC_##k3C, KC_##k4C, KC_##k5C }, \
{ KC_##k0D, KC_##k1D, KC_##k2D, KC_##k3D, KC_##k4D, KC_NO } \
}
#define KEYMAP_YORUIAN( \
/* Spacial positions. */ \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \
k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \
k55, k56, k57, k58, \
k54, k59, \
k53, k52, k51, k5C, k5B, k5A) \
KEYMAP(KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, \
KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, \
KC_##k55, KC_##k56, \
KC_##k54, \
KC_##k53, KC_##k52, KC_##k51, \
KC_##k07, KC_##k08, KC_##k09, KC_##k0A, KC_##k0B, KC_##k0C, KC_##k0D, \
KC_##k17, KC_##k18, KC_##k19, KC_##k1A, KC_##k1B, KC_##k1C, KC_##k1D, \
KC_##k28, KC_##k29, KC_##k2A, KC_##k2B, KC_##k2C, KC_##k2D, \
KC_##k37, KC_##k38, KC_##k39, KC_##k3A, KC_##k3B, KC_##k3C, KC_##k3D, \
KC_##k49, KC_##k4A, KC_##k4B, KC_##k4C, KC_##k4D, \
KC_##k57, KC_##k58, \
KC_##k59, \
KC_##k5C, KC_##k5B, KC_##k5A)
#define KC_ES KC_ESC
#define KC_LC KC_LCTL

View File

@ -115,6 +115,7 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
}
void matrix_print(void) {
#ifndef NO_PRINT
print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_row_t matrix_row = matrix_get_row(row);
@ -125,6 +126,7 @@ void matrix_print(void) {
}
print("\n");
}
#endif
}
uint8_t matrix_key_count(void) {
@ -132,4 +134,4 @@ uint8_t matrix_key_count(void) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
count += bitpop32(matrix[row]);
return count;
}
}

View File

@ -1 +0,0 @@
#include "MS-sculpt-mobile.h"

View File

@ -0,0 +1 @@
#include "MS_sculpt_mobile.h"

View File

@ -7,7 +7,8 @@ Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c
*/
#include "babblePaste.h"
#include "../MS_sculpt_mobile/babblePaste.h"
#include "action_macro.h"
#ifdef USE_BABLPASTE
@ -27,7 +28,7 @@ macro_t* switch_babble_mode( uint8_t id) {
// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15
#define BABLM(ent, macro...) \
if ( ent == shortcut ) \
{ action_macro_play( MACRO(macro)); return MACRO_NONE; }
{ action_macro_play( MACRO(macro)); return MACRO_NONE; }
/* this function runs the appropriate babblepaste macro, given
@ -456,4 +457,4 @@ const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) {
}
#endif
#endif

View File

@ -9,9 +9,9 @@ and jeebak & algernon's keymap
*/
#ifndef _babblePaste_h_included__
#define _babblePaste_h_included__
#include "../MS_sculpt_mobile/config.h"
#include "action_layer.h"
#include "quantum_keycodes.h"
#include "config.h"
#ifdef USE_BABLPASTE

View File

@ -1,7 +1,7 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#include "../../../MS_sculpt_mobile/config.h"
// place overrides here

View File

@ -1,4 +1,4 @@
#include "MS-sculpt-mobile.h"
#include "../../MS_sculpt_mobile.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*

View File

@ -1,7 +1,7 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#include "../../../MS_sculpt_mobile/config.h"
#define USE_BABLPASTE

View File

@ -1,7 +1,7 @@
#include "MS-sculpt-mobile.h"
#include "../../../MS_sculpt_mobile/babblePaste.h"
#include "../../MS_sculpt_mobile.h"
#include "action_layer.h"
#include "action_util.h"
#include "babblePaste.h"
#ifdef AUDIO_ENABLE
#include "audio.h"

View File

@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
X0 , A , O , E , U , I , D , H , R , N , S ,SLSH,
X0 , A , O , E , U , I , D , H , T , N , S ,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 ,
//|----+----+----+----+----+----|----+----|----+----+----+----+----+----|

View File

@ -35,12 +35,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION
/* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 6
#define MATRIX_ROWS 9
/* default pin-out */
#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 }
#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 }
#define MATRIX_COL_PINS { F4, F1, F0, D6, D0, D1 }
#define MATRIX_ROW_PINS { F5, F6, F7 }
#define TRACKPOINT_PINS { B7, B6, D7 }
#define UNUSED_PINS
/*
@ -152,17 +153,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#define PS2_INIT_DELAY 2000
#define PS2_INIT_DELAY 3000
#define BATTERY_PIN 9
#define BATTERY_POLL 30000
#define MAX_VOLTAGE 4.2
#define MIN_VOLTAGE 3.2
#define ___ KC_NO
#define KEYMAP( \
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
tp1, tp2, tp3 \
) \
{ \
{k11, k12, k13, k14, k15, k16}, \
@ -172,18 +176,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{k17, k18, k19, k1a, k1b, k1c}, \
{k27, k28, k29, k2a, k2b, k2c}, \
{k37, k38, k39, k3a, k3b, k3c}, \
{k47, k48, k49, k4a, k4b, k4c} \
{k47, k48, k49, k4a, k4b, k4c}, \
{tp1, tp2, tp3, ___, ___, ___} \
}
#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
enum led_sequence {
LED_IND_LINUX,
LED_IND_APPLE,
LED_IND_WINDOWS,
LED_IND_QWERTY,
LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH,
LED_IND_USB,
LED_IND_BATTERY,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN,
LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI,
LED_IND_GREEK,
LED_BKSP,
LED_ENT,
@ -261,7 +276,7 @@ enum led_sequence {
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1
# define PS2_CLOCK_BIT 3
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD

View File

@ -19,6 +19,8 @@ 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.
PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes
FAUXCLICKY_ENABLE = yes
BLUETOOTH = AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

View File

@ -37,8 +37,8 @@ On Promethium, USB or Bluetooth output is detected on startup. If USB is connect
SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
On Promethium there are 16 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 67 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty.

View File

@ -38,6 +38,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#ifdef FAUXCLICKY_ENABLE
#include "fauxclicky.h"
#ifdef RGBSPS_ENABLE
#undef FAUXCLICKY_OFF
#define FAUXCLICKY_OFF do { \
fauxclicky_enabled = false; \
rgbsps_set(LED_AUDIO, 0, 0, 0); \
fauxclicky_stop(); \
} while (0)
#undef FAUXCLICKY_ON
#define FAUXCLICKY_ON do { \
fauxclicky_enabled = true; \
rgbsps_set(LED_AUDIO, 8, 0, 8); \
} while (0)
#endif
#endif
#include "outputselect.h"
#include "led.h"
@ -128,8 +141,8 @@ enum planck_keycodes {
#ifndef FAUXCLICKY_ENABLE
FC_TOG,
#endif
#ifndef ADAFRUIT_BLE_ENABLE
OUT_BLE,
#ifndef MODULE_ADAFRUIT_BLE
OUT_BT,
#endif
KEYCODE_END
};
@ -428,12 +441,23 @@ const uint8_t PROGMEM LED_FN[] = {
};
const uint8_t PROGMEM LED_INDICATORS[] = {
LED_IND_EMOJI,
LED_IND_NUM,
LED_IND_FUN,
LED_IND_BATTERY,
LED_IND_USB,
LED_IND_LINUX,
LED_IND_APPLE,
LED_IND_WINDOWS,
LED_IND_QWERTY,
LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH,
LED_IND_USB,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN,
LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI,
LED_IND_GREEK,
};
const uint8_t PROGMEM LED_TRACKPOINT[] = {
@ -486,15 +510,31 @@ void led_reset(void) {
}
}
void led_set_default_layer_indicator(void) {
uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) {
rgbsps_set(LED_IND_QWERTY, 15, 10, 0);
rgbsps_set(LED_IND_ALT, 0, 0, 0);
} else {
rgbsps_set(LED_IND_QWERTY, 0, 0, 0);
rgbsps_set(LED_IND_ALT, 15, 10, 0);
}
rgbsps_send();
return;
}
void led_set_layer_indicator(void) {
static uint8_t oldlayer = 255;
rgbsps_set(LED_IND_FUN, 0, 0, 0);
// rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
led_reset();
rgbsps_set(LED_IND_GUI, 0, 0, 0);
rgbsps_set(LED_IND_FUN, 0, 0, 0);
rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_PUNC, 0, 0, 0);
rgbsps_set(LED_IND_GREEK, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
uint8_t layer = biton32(layer_state);
if (oldlayer == layer) {
return;
@ -508,24 +548,57 @@ void led_set_layer_indicator(void) {
}
switch(layer) {
case _GUI:
rgbsps_set(LED_IND_GUI, 15, 0, 15);
break;
case _FUN:
rgbsps_set(LED_IND_FUN, 15, 0, 0);
break;
// case _NUM:
// rgbsps_set(LED_IND_NUM, 0, 0, 15);
// break;
case _NUM:
rgbsps_set(LED_IND_NUM, 0, 0, 15);
break;
case _PUNC:
rgbsps_set(LED_IND_PUNC, 0, 15, 0);
break;
case _GREEKL:
case _GREEKU:
rgbsps_set(LED_IND_GREEK, 0, 15, 15);
break;
case _EMOJI:
rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
break;
default:
rgbsps_set(LED_IND_GUI, 3, 3, 3);
rgbsps_set(LED_IND_FUN, 3, 3, 3);
// rgbsps_set(LED_IND_NUM, 3, 3, 3);
rgbsps_set(LED_IND_NUM, 3, 3, 3);
rgbsps_set(LED_IND_PUNC, 3, 3, 3);
rgbsps_set(LED_IND_GREEK, 3, 3, 3);
rgbsps_set(LED_IND_EMOJI, 3, 3, 3);
}
rgbsps_send();
}
void led_set_unicode_input_mode(void) {
rgbsps_set(LED_IND_LINUX, 0, 0, 0);
rgbsps_set(LED_IND_APPLE, 0, 0, 0);
rgbsps_set(LED_IND_WINDOWS, 0, 0, 0);
switch (get_unicode_input_mode()) {
case UC_LNX:
rgbsps_set(LED_IND_LINUX, 15, 15, 15);
break;
case UC_OSX:
rgbsps_set(LED_IND_APPLE, 15, 15, 15);
break;
case UC_WIN:
case UC_WINC:
rgbsps_set(LED_IND_WINDOWS, 15, 15, 15);
break;
}
rgbsps_send();
}
void led_set_output_ble(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15);
rgbsps_set(LED_IND_USB, 0, 0, 0);
@ -552,7 +625,16 @@ void led_init(void) {
rgbsps_set(LED_TRACKPOINT1, 15, 0, 0);
rgbsps_set(LED_TRACKPOINT2, 0, 0, 15);
rgbsps_set(LED_TRACKPOINT3, 15, 0, 0);
// unicode input mode
led_set_unicode_input_mode();
// layer indicator
led_set_layer_indicator();
led_set_default_layer_indicator();
}
#endif // RGBSPS_ENABLE
// keymaps
@ -574,7 +656,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL
KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL,
_______, _______, _______
),
/* Dvorak
@ -593,7 +676,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______,
_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______,
_______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
#endif
@ -614,7 +698,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______,
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
#endif
@ -635,7 +720,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______,
_______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
#endif
@ -656,7 +742,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______,
_______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______,
_______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
#endif
@ -675,7 +762,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
_______, _______, _______
),
/* Num
@ -690,10 +778,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_NUM] = KEYMAP(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______,
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), _______,
_______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______,
_______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______,
_______, _______, _______
),
/* Func
@ -711,7 +800,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
_______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
/* Uppercase Greek
@ -729,7 +819,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
_______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
/* Lowercase Greek
@ -747,7 +838,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
_______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
/* Empty
@ -765,7 +857,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
),
/* Emoji
@ -783,7 +876,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK)
X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK),
_______, _______, _______
),
/* GUI
@ -801,7 +895,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______
),
/* Sys
@ -816,10 +911,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_SYS] = KEYMAP(
XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______
),
@ -828,6 +924,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
#ifdef RGBSPS_ENABLE
led_set_default_layer_indicator();
#endif
}
#ifdef DOUBLESPACE_LAYER_ENABLE
@ -1072,14 +1171,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// OS switchers
case LINUX:
set_unicode_input_mode(UC_LNX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false;
break;
case WIN:
set_unicode_input_mode(UC_WINC);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false;
break;
case OSX:
set_unicode_input_mode(UC_OSX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false;
break;
@ -1101,6 +1209,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// faux clicky indicator
#ifdef FAUXCLICKY_ENABLE
case FC_TOG:
#ifdef RGBSPS_ENABLE
if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, 0, 0, 0);
} else {
rgbsps_set(LED_IND_AUDIO, 5, 11, 13);
}
rgbsps_send();
#endif
return true;
break;
#endif
@ -1109,12 +1225,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
void set_output_user(uint8_t output) {
#ifdef ADAFRUIT_BLE_ENABLE
#ifdef MODULE_ADAFRUIT_BLE
switch(output) {
case OUTPUT_USB:
led_set_output_usb();
break;
case OUTPUT_ADAFRUIT_BLE:
case OUTPUT_BLUETOOTH:
led_set_output_ble();
break;
default:
@ -1133,12 +1249,12 @@ void matrix_init_user() {
#endif
// auto detect output on init
#ifdef ADAFRUIT_BLE_ENABLE
#ifdef MODULE_ADAFRUIT_BLE
uint8_t output = auto_detect_output();
if (output == OUTPUT_USB) {
set_output(OUTPUT_USB);
} else {
set_output(OUTPUT_ADAFRUIT_BLE);
set_output(OUTPUT_BLUETOOTH);
}
#endif
}
@ -1164,9 +1280,9 @@ void turn_off_capslock() {
bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
if (new_capslock ^ capslock) { // capslock state is different
if ((capslock = new_capslock)) {
rgbsps_set(LED_IND_NUM, 15, 0, 0);
rgbsps_set(LED_IND_CAPSLOCK, 15, 0, 0);
} else {
rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_CAPSLOCK, 0, 0, 0);
}
rgbsps_send();
}

View File

@ -0,0 +1,306 @@
/*
Copyright 2012 Jun Wako
Copyright 2014 Jack Humbert
Copyright 2017 Priyadi Iman Nurcahyo
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/>.
*/
#include <stdint.h>
#include <stdbool.h>
#if defined(__AVR__)
#include <avr/io.h>
#endif
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "timer.h"
/* Set 0 if debouncing isn't needed */
#ifndef DEBOUNCING_DELAY
# define DEBOUNCING_DELAY 5
#endif
#if (DEBOUNCING_DELAY > 0)
static uint16_t debouncing_time;
static bool debouncing = false;
#endif
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif
#ifdef MATRIX_MASKED
extern const matrix_row_t matrix_mask[];
#endif
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
static const uint8_t tp_pins[3] = TRACKPOINT_PINS;
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static void init_cols(void);
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
static void unselect_rows(void);
static void select_row(uint8_t row);
static void unselect_row(uint8_t row);
__attribute__ ((weak))
void matrix_init_quantum(void) {
matrix_init_kb();
}
__attribute__ ((weak))
void matrix_scan_quantum(void) {
matrix_scan_kb();
}
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
void matrix_init(void) {
// To use PORTF disable JTAG with writing JTD bit twice within four cycles.
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
MCUCR |= _BV(JTD);
MCUCR |= _BV(JTD);
#endif
// initialize row and col
unselect_rows();
init_cols();
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
matrix_init_quantum();
}
uint8_t matrix_scan(void
){
// Set row, read cols
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
# if (DEBOUNCING_DELAY > 0)
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
if (matrix_changed) {
debouncing = true;
debouncing_time = timer_read();
}
# else
read_cols_on_row(matrix, current_row);
# endif
}
# if (DEBOUNCING_DELAY > 0)
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
debouncing = false;
}
# endif
matrix_scan_quantum();
return 1;
}
bool matrix_is_modified(void)
{
#if (DEBOUNCING_DELAY > 0)
if (debouncing) return false;
#endif
return true;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
// switch blocker installed and the switch is always pressed.
#ifdef MATRIX_MASKED
return matrix[row] & matrix_mask[row];
#else
return matrix[row];
#endif
}
void matrix_print(void)
{
print_matrix_header();
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row); print(": ");
print_matrix_row(row);
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}
#define ROW_MASK 0b11100000
static const uint8_t row_bit[MATRIX_ROWS] = {
// 76543210
0b00000000,
0b00100000,
0b01000000,
0b01100000,
0b10000000,
0b10100000,
0b11000000,
0b11100000,
};
static void init_cols(void)
{
// columns
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
uint8_t pin = col_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
// rows
DDRF |= ROW_MASK;
PORTF &= ~ROW_MASK;
// trackpoint
for(uint8_t x = 0; x < 3; x++) {
uint8_t pin = tp_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
{
// Store last value of row prior to reading
matrix_row_t last_row_value = current_matrix[current_row];
// Clear data in matrix row
current_matrix[current_row] = 0;
// special case for trackpoint
if (current_row == 8) {
for(uint8_t tp_index = 0; tp_index < 3; tp_index++) {
// Select the TP pin to read (active low)
uint8_t pin = tp_pins[tp_index];
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
// Populate the matrix row with the state of the col pin
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << tp_index);
}
return (last_row_value != current_matrix[current_row]);
}
// Select row and wait for row selecton to stabilize
select_row(current_row);
_delay_us(5); // without this wait it won't read stable value.
// wait_us(50);
// For each col...
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
// Select the col pin to read (active low)
uint8_t pin = col_pins[col_index];
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
// Populate the matrix row with the state of the col pin
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
}
// Unselect row
unselect_row(current_row);
return (last_row_value != current_matrix[current_row]);
}
static void select_row(uint8_t row)
{
PORTF = row_bit[row] | (PORTF & ~ROW_MASK);
}
static void unselect_row(uint8_t row)
{
}
static void unselect_rows(void)
{
}

View File

@ -2,6 +2,11 @@
#include "analog.h"
#include "timer.h"
#include "matrix.h"
#include "musical_notes.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, .03125);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_C3, .03125);
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, .03125);
// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}

View File

@ -65,12 +65,14 @@ 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.
PS2_MOUSE_ENABLE ?= yes
PS2_USE_INT ?= yes
ADAFRUIT_BLE_ENABLE ?= yes
API_SYSEX_ENABLE ?= no
CUSTOM_MATRIX ?= yes
BLUETOOTH ?= AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
SRC += $(QUANTUM_DIR)/light_ws2812.c
SRC += rgbsps.c
SRC += $(QUANTUM_DIR)/analog.c
SRC += $(QUANTUM_DIR)/analog.c
SRC += matrix.c

View File

@ -0,0 +1,176 @@
/* -*- eval: (turn-on-orgtbl); -*-
* default HHKB Layout
*/
#include "hhkb.h"
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _HHKB 3
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
HHKB
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
// Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift)
#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer QWERTY: Qwerty Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_QWERTY] = KEYMAP( // Qwerty layer
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, MEH_GRV, \
HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, SFT_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer COLEMAK: Colemak Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | R | S | T | D | H | N | E | I | O | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | K | M | , | . | / | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_COLEMAK] = KEYMAP( // Colemak layer
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, MEH_GRV, \
HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, \
CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, SFT_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer DVORAK: Dvorak Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | O | E | U | I | D | H | T | N | S | - | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_DVORAK] = KEYMAP( // Dvorak layer
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, MEH_GRV, \
HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, \
CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, SFT_ENT, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer HHKB: HHKB mode (HHKB Fn)
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| | | Qwt | Cmk | Dvk | | + | - | End | PgD | Dow | | | | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|------+------+----------------------+------+------+
| **** | **** | ******************** | **** | **** |
|------+------+----------------------+------+------+
*/
[_HHKB] = KEYMAP(
KC_PWR, 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_INS, KC_DEL, \
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
_______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
_______, _______, _______, _______, _______)};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
}
return true;
}

View File

@ -22,7 +22,7 @@
#undef MOUSEKEY_WHEEL_MAX_SPEED
#define MOUSEKEY_WHEEL_MAX_SPEED 3
#undef MOUSEKEY_WHEEL_TIME_TO_MAX
#define MOUSEKEY_WHEEL_TIME_TO_MAX 1000
#define MOUSEKEY_WHEEL_TIME_TO_MAX 255
#undef ONESHOT_TIMEOUT
#define ONESHOT_TIMEOUT 500
#undef TAPPING_TOGGLE

View File

@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \
_______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______),
/* Layer 3: media layer */
[MEDIA] = KEYMAP(\
[MEDIA] = KEYMAP(\
KC_PWR,KC_SLEP,KC_WAKE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \

View File

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

View File

@ -0,0 +1,87 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER unknown
#define PRODUCT Mitosis
#define DESCRIPTION q.m.k. keyboard firmware for Mitosis
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 10
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
#define ONESHOT_TIMEOUT 500
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
#define PREVENT_STUCK_MODIFIERS
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
//UART settings for communication with the RF microcontroller
#define SERIAL_UART_BAUD 1000000
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
#define SERIAL_UART_INIT() do { \
/* baud rate */ \
UBRR1L = SERIAL_UART_UBRR; \
/* baud rate */ \
UBRR1H = SERIAL_UART_UBRR >> 8; \
/* enable TX and RX */ \
UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
/* 8-bit data */ \
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
} while(0)
#endif

View File

@ -0,0 +1,221 @@
// this is the style you want to emulate.
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
#include "mitosis.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum mitosis_layers
{
_MALT,
_SHIFTED,
_FUNCTION,
_FUNCSHIFT
};
enum mitosis_keycodes
{
FNKEY = SAFE_RANGE,
SHIFT
};
// Macro definitions for readability
enum mitosis_macros
{
VOLU,
VOLD,
ESCM
};
#define LONGPRESS_DELAY 150
#define LAYER_TOGGLE_DELAY 300
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MALT] = { /* Malt Layout, customised for reduced columns (ex: quote and shift locations) */
{KC_Q, KC_P, KC_Y, KC_C, KC_B, KC_V, KC_M, KC_U, KC_Z, KC_L },
{KC_A, KC_N, KC_I, KC_S, KC_F, KC_D, KC_T, KC_H, KC_O, KC_R },
{KC_COMM, KC_DOT, KC_J, KC_G, KC_SLSH, KC_SCLN, KC_W, KC_K, KC_QUOT, KC_X },
{XXXXXXX, M(VOLU), M(ESCM), KC_TAB, KC_LCTL, KC_LALT, KC_ENT, KC_DEL, KC_PGUP, XXXXXXX },
{XXXXXXX, M(VOLD), KC_LGUI, KC_E, FNKEY, SHIFT, KC_SPC, KC_BSPC, KC_PGDN, XXXXXXX }
},
[_SHIFTED] = { /* Shifted Layer, layered so that tri_layer can be used, or selectively
able to modify individual key's shifted behaviour */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
},
[_FUNCTION] = { /* Function Layer, primary alternative layer featuring numpad on right hand,
cursor keys on left hand, and all symbols*/
{KC_AMPR, KC_PERC, KC_UP, KC_CIRC, KC_PIPE, KC_LBRC, KC_7, KC_8, KC_9, KC_MINS },
{KC_AT, KC_LEFT, KC_DOWN, KC_RGHT, KC_HASH, KC_LPRN, KC_4, KC_5, KC_6, KC_PLUS },
{KC_ASTR, KC_UNDS, KC_EXLM, KC_DLR, KC_BSLS, KC_LCBR, KC_1, KC_2, KC_3, KC_ENT },
{XXXXXXX, KC_HOME, KC_GRV, KC_PWR, _______, _______, KC_EQL, KC_TILD, KC_DOT, XXXXXXX },
{XXXXXXX, KC_END, _______, _______, _______, _______, KC_0, _______, KC_PSCR, XXXXXXX }
},
[_FUNCSHIFT] = { /* Function Shifted Layer, secondary alternative layer with closing brackets,
and F-keys under their numpad equivalents*/
{_______, _______, _______, _______, _______, KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10 },
{_______, _______, _______, _______, _______, KC_RPRN, KC_F4, KC_F5, KC_F6, KC_F11 },
{_______, _______, _______, _______, _______, KC_RCBR, KC_F1, KC_F2, KC_F3, KC_F12 },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
}
};
const uint16_t PROGMEM fn_actions[] = {
};
static uint16_t key_timer;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
//switch multiplexing for media, short tap for volume up, long press for play/pause
case VOLU:
if (record->event.pressed) {
key_timer = timer_read(); // if the key is being pressed, we start the timer.
} else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { // LONGPRESS_DELAY being 150ms, the threshhold we pick for counting something as a tap.
return MACRO(T(MPLY), END);
} else {
return MACRO(T(VOLU), END);
}
}
break;
//switch multiplexing for media, short tap for volume down, long press for next track
case VOLD:
if (record->event.pressed) {
key_timer = timer_read();
} else {
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
return MACRO(T(MNXT), END);
} else {
return MACRO(T(VOLD), END);
}
}
break;
//switch multiplexing for escape, short tap for escape, long press for context menu
case ESCM:
if (record->event.pressed) {
key_timer = timer_read();
} else {
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
return MACRO(T(APP), END);
} else {
return MACRO(T(ESC), END);
}
}
break;
break;
}
return MACRO_NONE;
};
static bool singular_key = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
uint8_t layer;
layer = biton32(layer_state); // get the current layer
//custom layer handling for tri_layer,
switch (keycode) {
case FNKEY:
if (record->event.pressed) {
key_timer = timer_read();
singular_key = true;
layer_on(_FUNCTION);
} else {
if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
layer_off(_FUNCTION);
}
}
update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
return false;
break;
//SHIFT is handled as LSHIFT in the general case
case SHIFT:
if (record->event.pressed) {
key_timer = timer_read();
singular_key = true;
layer_on(_SHIFTED);
register_code(KC_LSFT);
} else {
if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
layer_off(_SHIFTED);
unregister_code(KC_LSFT);
}
}
update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
return false;
break;
//If any other key was pressed during the layer mod hold period,
//then the layer mod was used momentarily, and should block latching
default:
singular_key = false;
break;
}
//FUNCSHIFT has been shifted by the SHIFT handling, some keys need to be excluded
if (layer == _FUNCSHIFT) {
//F1-F12 should be sent as unshifted keycodes,
//and ] needs to be unshifted or it is sent as }
if ( (keycode >= KC_F1 && keycode <= KC_F12)
|| keycode == KC_RBRC ) {
if (record->event.pressed) {
unregister_mods(MOD_LSFT);
} else {
register_mods(MOD_LSFT);
}
}
}
return true;
};
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
case _MALT:
set_led_off;
break;
case _FUNCTION:
set_led_blue;
break;
case _SHIFTED:
set_led_red;
break;
case _FUNCSHIFT:
set_led_green;
break;
default:
break;
}
};

164
keyboards/mitosis/matrix.c Normal file
View File

@ -0,0 +1,164 @@
/*
Copyright 2012 Jun Wako
Copyright 2014 Jack Humbert
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/>.
*/
#include <stdint.h>
#include <stdbool.h>
#if defined(__AVR__)
#include <avr/io.h>
#endif
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "timer.h"
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
__attribute__ ((weak))
void matrix_init_quantum(void) {
matrix_init_kb();
}
__attribute__ ((weak))
void matrix_scan_quantum(void) {
matrix_scan_kb();
}
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
void matrix_init(void) {
matrix_init_quantum();
}
uint8_t matrix_scan(void)
{
SERIAL_UART_INIT();
uint32_t timeout = 0;
//the s character requests the RF slave to send the matrix
SERIAL_UART_DATA = 's';
//trust the external keystates entirely, erase the last data
uint8_t uart_data[11] = {0};
//there are 10 bytes corresponding to 10 columns, and an end byte
for (uint8_t i = 0; i < 11; i++) {
//wait for the serial data, timeout if it's been too long
//this only happened in testing with a loose wire, but does no
//harm to leave it in here
while(!SERIAL_UART_RXD_PRESENT){
timeout++;
if (timeout > 10000){
break;
}
}
uart_data[i] = SERIAL_UART_DATA;
}
//check for the end packet, the key state bytes use the LSBs, so 0xE0
//will only show up here if the correct bytes were recieved
if (uart_data[10] == 0xE0)
{
//shifting and transferring the keystates to the QMK matrix variable
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5;
}
}
matrix_scan_quantum();
return 1;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
return matrix[row];
}
void matrix_print(void)
{
print_matrix_header();
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row); print(": ");
print_matrix_row(row);
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}

View File

@ -0,0 +1,31 @@
#include "mitosis.h"
void uart_init(void) {
SERIAL_UART_INIT();
}
void led_init(void) {
DDRD |= (1<<1);
PORTD |= (1<<1);
DDRF |= (1<<4) | (1<<5);
PORTF |= (1<<4) | (1<<5);
}
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
uart_init();
led_init();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
void led_set_kb(uint8_t usb_led) {
}

View File

@ -0,0 +1,67 @@
#ifndef MITOSIS_H
#define MITOSIS_H
#include "quantum.h"
#include "matrix.h"
#include "backlight.h"
#include <stddef.h>
#define red_led_off PORTF |= (1<<5)
#define red_led_on PORTF &= ~(1<<5)
#define blu_led_off PORTF |= (1<<4)
#define blu_led_on PORTF &= ~(1<<4)
#define grn_led_off PORTD |= (1<<1)
#define grn_led_on PORTD &= ~(1<<1)
#define set_led_off red_led_off; grn_led_off; blu_led_off
#define set_led_red red_led_on; grn_led_off; blu_led_off
#define set_led_blue red_led_off; grn_led_off; blu_led_on
#define set_led_green red_led_off; grn_led_on; blu_led_off
#define set_led_yellow red_led_on; grn_led_on; blu_led_off
#define set_led_magenta red_led_on; grn_led_off; blu_led_on
#define set_led_cyan red_led_off; grn_led_on; blu_led_on
#define set_led_white red_led_on; grn_led_on; blu_led_on
/*
#define LED_B 5
#define LED_R 6
#define LED_G 7
#define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define red_led_on PORTF |= (1<<LED_R)
#define red_led_off PORTF &= ~(1<<LED_R)
#define grn_led_on PORTF |= (1<<LED_G)
#define grn_led_off PORTF &= ~(1<<LED_G)
#define blu_led_on PORTF |= (1<<LED_B)
#define blu_led_off PORTF &= ~(1<<LED_B)
#define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R)
#define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B)
#define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G)
#define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G)
#define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B)
#define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G)
#define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G)
*/
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k31, k32, k33, k34, k35, k36, k37, k38, \
k41, k42, k43, k44, k45, k46, k47, k48 \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
{ KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO } \
{ KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO }, \
}
#endif

View File

@ -0,0 +1,33 @@
Mitosis Keyboard Firmware
======================
These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
Build log of the keyboard can be found [here](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/)
Hardware design files can be found [here](https://github.com/reversebias/mitosis-hardware)
Firmware for the nordic MCUs can be found [here](https://github.com/reversebias/mitosis)
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme](/).
## Building
Download or clone the whole firmware and navigate to the keyboards/atreus folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button.
Depending on which keymap you would like to use, you will have to compile slightly differently.
### Default
To build with the default keymap, simply run `make default`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top readme.md) and existent keymap files.
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View File

@ -0,0 +1,81 @@
OPT_DEFS += -DMITOSIS_PROMICRO
OPT_DEFS += -DCATERINA_BOOTLOADER
MITOSIS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
# # project specific files
SRC = matrix.c
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
CUSTOM_MATRIX ?= yes # Remote matrix from the wireless bridge
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
# MIDI_ENABLE ?= YES # MIDI controls
UNICODE_ENABLE ?= YES # Unicode
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
USB ?= /dev/ttyACM0
upload: build
$(MITOSIS_UPLOAD_COMMAND)

View File

@ -0,0 +1,23 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # 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.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@ -0,0 +1,8 @@
#ifndef LAE3_KEYMAP_H
#define LAE3_KEYMAP_H
#include "../../config.h"
#define PREVENT_STUCK_MODIFIERS
#endif

View File

@ -0,0 +1,262 @@
#include "planck.h"
#include "action_layer.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum planck_layers {
_QWERTY,
_ARROW,
_NUMPAD,
_MOVEMENT,
_LOWER,
_RAISE,
_ADJUST
};
#define _MV _MOVEMENT
enum planck_keycodes {
QWERTY = SAFE_RANGE,
ARROW,
NUMPAD,
LOWER,
RAISE,
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define KC_MUP KC_MS_UP
#define KC_MDN KC_MS_DOWN
#define KC_MLFT KC_MS_LEFT
#define KC_MRGT KC_MS_RIGHT
#define KC_MB1 KC_MS_BTN1
#define KC_MB2 KC_MS_BTN2
#define KC_MB3 KC_MS_BTN3
#define KC_MB4 KC_MS_BTN4
#define KC_MB5 KC_MS_BTN5
#define KC_MWUP KC_MS_WH_UP
#define KC_MWDN KC_MS_WH_DOWN
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_ESC, 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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
{KC_LCTL, KC_LGUI, KC_LALT, MO(_MV), LOWER, KC_SPC, KC_SPC, RAISE, MO(_MV), KC_RALT, KC_RGUI, KC_RCTL}
},
/* Arrow
* ,-----------------------------------------------------------------------------------.
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | Up | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | Left | Down | Right|
* `-----------------------------------------------------------------------------------'
*/
[_ARROW] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT}
},
/* Numpad
* ,-----------------------------------------------------------------------------------.
* | | | | | | |NumLck| 7 | 8 | 9 | / | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | |Enter | 4 | 5 | 6 | * | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | 3 | 2 | 1 | - | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | 0 | . | + | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = {
{_______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______},
{_______, _______, _______, _______, _______, _______, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PAST, _______},
{_______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PPLS, _______}
},
/* Movement
* ,-----------------------------------------------------------------------------------.
* | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_MOVEMENT] = {
{_______, KC_MB2, KC_MUP, KC_MB1, KC_MWUP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______},
{_______, KC_MLFT, KC_MDN, KC_MRGT, KC_MWDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_DEL, KC_END, KC_PGDN, _______},
{KC_CAPS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, XXXXXXX, _______},
{_______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Caps | ^ | & | * | ( | ) | { | } | | | " | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F9 | F10 | F11 | F12 | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_INS, KC_HOME, KC_PGUP, _______},
{KC_CAPS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, XXXXXXX, _______},
{_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* |Reset | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, BL_STEP, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, QWERTY, ARROW, NUMPAD, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
} else {
layer_off(_LOWER);
}
update_tri_layer(_LOWER, _RAISE, _ADJUST);
return false;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
} else {
layer_off(_RAISE);
}
update_tri_layer(_LOWER, _RAISE, _ADJUST);
return false;
case QWERTY:
if (record->event.pressed) {
layer_off(_ARROW);
layer_off(_NUMPAD);
}
return false;
case ARROW:
if (record->event.pressed) {
layer_off(_NUMPAD);
layer_on(_ARROW);
}
return false;
case NUMPAD:
if (record->event.pressed) {
layer_off(_ARROW);
layer_on(_NUMPAD);
}
return false;
}
return true;
}
void matrix_init_user(void)
{
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(100); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

View File

@ -0,0 +1,111 @@
# Lae3
_Keymap based around mode-switching for extended functionality_
## Base Layout
┌-----------------------------------------------------------------------------------┐
| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
|------+------+------+------+------+------+------+------+------+------+------+------|
|Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
|------+------+------+------+------+-------------+------+------+------+------+------|
| Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
└-----------------------------------------------------------------------------------┘
This is more similar to a standard keyboard layout than the standard planck
layout, but I have found that this is better for programming, especially for
editor shortcuts.
## Lower Layer
┌-----------------------------------------------------------------------------------┐
| ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
All the numbers are on one hand so that they can all be easily accessed when
playing games. The punctuation was placed in a way that is as similar as
possible the qwerty punctuation layout on a standard keyboard.
## Raise Layer
┌-----------------------------------------------------------------------------------┐
| ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Caps | ^ | & | * | ( | ) | { | } | | | " | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | F9 | F10 | F11 | F12 | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
This layer with the exception of the function and control keys is effectively
the lower layer in combination with the shift key, like on the standard planck
layout.
## Movement Layer
┌-----------------------------------------------------------------------------------┐
| |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
Layer for simplifying movement.
## Meta Layer
┌-----------------------------------------------------------------------------------┐
|Reset | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
This Layer is activated when pressing both the Lower and Raise keys. The Arrow
and Numpad keys each activate a layer between the base layer and the Movement
layer. The Qwerty key disables both of the layers leaving just the base layer
active.
## Arrow Layer
┌-----------------------------------------------------------------------------------┐
| | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | Up | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | Left | Down | Right|
└-----------------------------------------------------------------------------------┘
Replaces the bottom right of the keyboard with arrow keys for games like The
Binding of Isaac.
## Numpad Layer
┌-----------------------------------------------------------------------------------┐
| | | | | | |NumLck| 7 | 8 | 9 | / | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | |Enter | 4 | 5 | 6 | * | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | 3 | 2 | 1 | - | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | 0 | . | + | |
└-----------------------------------------------------------------------------------┘
Replaces the majority of the right side of the keyboard with a numpad because
why not?

View File

@ -153,12 +153,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case 1: // M(1)
if (record->event.pressed) {
unregister_code(KC_LSFT);
register_code(DE_MORE);
register_code(DE_LESS);
} else {
unregister_code(DE_MORE);
unregister_code(DE_LESS);
}
break;
}
return MACRO_NONE;
};
};

View File

@ -27,7 +27,8 @@
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
tp1, tp2, tp3 \
) \
{ \
{k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \

View File

@ -212,10 +212,10 @@ const uint16_t PROGMEM fn_actions[] = {
#ifdef AUDIO_ENABLE
float start_up[][2] = {
{440.0*pow(2.0,(14)/12.0), 20},
{440.0*pow(2.0,(26)/12.0), 8},
{440.0*pow(2.0,(18)/12.0), 20},
{440.0*pow(2.0,(26)/12.0), 8}
MUSICAL_NOTE(_B5, 20),
MUSICAL_NOTE(_B6, 8),
MUSICAL_NOTE(_DS6, 20),
MUSICAL_NOTE(_B6, 8),
};
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
@ -323,7 +323,7 @@ void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
void play_goodbye_tone()
void play_goodbye_tone(void)
{
PLAY_NOTE_ARRAY(goodbye, false, 0);
_delay_ms(150);

View File

@ -4,16 +4,23 @@
extern keymap_config_t keymap_config;
#define _DV 0
#define _QW 1
#define _CM 2
#define _L1 3
#define _L2 4
enum planck_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_ADJUST
};
// Macro name shortcuts
#define DVORAK M(_DV)
#define QWERTY M(_QW)
#define COLEMAK M(_CM)
enum planck_keycodes {
DVORAK = SAFE_RANGE,
QWERTY,
COLEMAK,
LOWER,
RAISE,
ADJUST
};
// Fillers to make layering more clear
#define _______ KC_TRNS
@ -21,45 +28,47 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* 0: Dvorak */
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH },
{MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, LT(_L2, KC_MINS)},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_BSLS, KC_EQL, XXXXXXX, KC_ENT }
[_DVORAK] = { /* 0: Dvorak */
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT},
{KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
},
[_QW] = { /* 1: Qwerty */
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC },
{MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_L2, 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_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT }
[_QWERTY] = { /* 1: Qwerty */
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, 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_RSFT},
{KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
},
[_CM] = { /* 2: Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC },
{MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, LT(_L2, KC_QUOT)},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT }
[_COLEMAK] = { /* 2: Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
{KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
},
[_L1] = {/* 1: FN 1 */
{KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
{_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ },
{_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT },
{KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_EQL, _______, _______ }
[_LOWER] = {/* 1: FN 1 */
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE},
{_______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
{KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
},
[_L2] = { /* 2: FN 2 */
{KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC },
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_HOME, KC_PGUP, KC_VOLU, _______ },
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END, KC_PGDN, KC_VOLD, _______ },
{QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PLUS, _______, _______ }
[_RAISE] = { /* 2: FN 2 */
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS},
{_______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
{KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
},
[_ADJUST] = {
{KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
{_______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{KC_HOME, KC_END, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PGUP, XXXXXXX, KC_PGDN}
}
};
const uint16_t PROGMEM fn_actions[] = {
};
void persistant_default_layer_set(uint16_t default_layer) {
@ -67,26 +76,46 @@ void persistant_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
return MACRO_NONE;
};
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
}
return true;
}

View File

@ -20,13 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h>
#include <musical_notes.h>
__attribute__ ((weak))
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
__attribute__ ((weak))
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
__attribute__ ((weak))
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
bool fauxclicky_enabled = true;
uint16_t note_start = 0;
bool note_playing = false;
@ -48,13 +41,13 @@ void fauxclicky_stop()
note_playing = false;
}
void fauxclicky_play(float note[2]) {
void fauxclicky_play(float note[]) {
if (!fauxclicky_enabled) return;
if (note_playing) fauxclicky_stop();
FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER));
FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2);
FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER));
FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)) / (float)2);
note_playing = true;
note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this
note_period = (note[1] / (float)16) * ((float)60 / (float)FAUXCLICKY_TEMPO) * 1000;
note_start = timer_read();
FAUXCLICKY_ENABLE_OUTPUT;
}

View File

@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdbool.h"
__attribute__ ((weak))
float fauxclicky_pressed_note[2];
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
__attribute__ ((weak))
float fauxclicky_released_note[2];
float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
__attribute__ ((weak))
float fauxclicky_beep_note[2];
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
bool fauxclicky_enabled;
@ -73,11 +73,11 @@ bool fauxclicky_enabled;
#endif
#ifndef FAUXCLICKY_ENABLE_OUTPUT
#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1);
#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1)
#endif
#ifndef FAUXCLICKY_DISABLE_OUTPUT
#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0))
#endif
#ifndef FAUXCLICKY_TIMER_PERIOD

View File

@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
__attribute__ ((weak))
uint16_t keymap_function_id_to_action( uint16_t function_id )
{
// The compiler sees the empty (weak) fn_actions and generates a warning
// This function should not be called in that case, so the warning is too strict
// If this function is called however, the keymap should have overridden fn_actions, and then the compile
// is comparing against the wrong array
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
return pgm_read_word(&fn_actions[function_id]);
#pragma GCC diagnostic pop
}

View File

@ -33,6 +33,10 @@
#define CH_E KC_E
#define CH_F KC_F
#define CH_G KC_G
#ifdef CH_H
// The ChibiOS ch.h file defines this...
#undef CH_H
#endif
#define CH_H KC_H
#define CH_I KC_I
#define CH_J KC_J

View File

@ -20,12 +20,12 @@
bool printing_enabled = false;
uint8_t character_shift = 0;
void enabled_printing() {
void enable_printing(void) {
printing_enabled = true;
serial_init();
}
void disable_printing() {
void disable_printing(void) {
printing_enabled = false;
}
@ -41,9 +41,14 @@ void print_char(char c) {
USB_Init();
}
void print_box_string(uint8_t text[]) {
uint8_t len = strlen(text);
uint8_t out[len * 3 + 8];
void print_string(char c[]) {
for(uint8_t i = 0; i < strlen(c); i++)
print_char(c[i]);
}
void print_box_string(const char text[]) {
size_t len = strlen(text);
char out[len * 3 + 8];
out[0] = 0xDA;
for (uint8_t i = 0; i < len; i++) {
out[i+1] = 0xC4;
@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) {
print_string(out);
}
void print_string(char c[]) {
for(uint8_t i = 0; i < strlen(c); i++)
print_char(c[i]);
}
bool process_printer(uint16_t keycode, keyrecord_t *record) {
if (keycode == PRINT_ON) {
enabled_printing();
enable_printing();
return false;
}
if (keycode == PRINT_OFF) {

View File

@ -21,4 +21,6 @@
#include "protocol/serial.h"
bool process_printer(uint16_t keycode, keyrecord_t *record);
#endif

View File

@ -46,7 +46,7 @@ void serial_output(void) {
}
void enabled_printing() {
void enable_printing() {
printing_enabled = true;
serial_output();
serial_high();
@ -82,7 +82,7 @@ void print_string(char c[]) {
bool process_printer(uint16_t keycode, keyrecord_t *record) {
if (keycode == PRINT_ON) {
enabled_printing();
enable_printing();
return false;
}
if (keycode == PRINT_OFF) {

View File

@ -15,6 +15,7 @@
*/
#include "process_unicode.h"
#include "action_util.h"
#include "eeprom.h"
static uint8_t first_flag = 0;

View File

@ -15,6 +15,7 @@
*/
#include "process_unicode_common.h"
#include "eeprom.h"
static uint8_t input_mode;
uint8_t mods;

View File

@ -125,8 +125,8 @@ static void get_led_state_string(char* output, visualizer_state_t* state) {
pos += 5;
}
if (state->status.leds & (1u << USB_LED_KANA)) {
memcpy(output + pos, "KANA ", 5);
pos += 5;
memcpy(output + pos, "KANA", 4);
pos += 4;
}
output[pos] = 0;
}

View File

@ -140,7 +140,6 @@ void process_record(keyrecord_t *record)
void process_action(keyrecord_t *record, action_t action)
{
bool do_release_oneshot = false;
keyevent_t event = record->event;
#ifndef NO_ACTION_TAPPING
uint8_t tap_count = record->tap.count;
@ -152,6 +151,7 @@ void process_action(keyrecord_t *record, action_t action)
}
#ifndef NO_ACTION_ONESHOT
bool do_release_oneshot = false;
// notice we only clear the one shot layer if the pressed key is not a modifier.
if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) {
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);

View File

@ -9,6 +9,7 @@
#include "suspend.h"
#include "timer.h"
#include "led.h"
#include "host.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"

View File

@ -23,8 +23,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* max value on report descriptor */
#define MOUSEKEY_MOVE_MAX 127
#define MOUSEKEY_WHEEL_MAX 127
#ifndef MOUSEKEY_MOVE_MAX
#define MOUSEKEY_MOVE_MAX 127
#elif MOUSEKEY_MOVE_MAX > 127
#error MOUSEKEY_MOVE_MAX needs to be smaller than 127
#endif
#ifndef MOUSEKEY_WHEEL_MAX
#define MOUSEKEY_WHEEL_MAX 127
#elif MOUSEKEY_WHEEL_MAX > 127
#error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
#endif
#ifndef MOUSEKEY_MOVE_DELTA
#define MOUSEKEY_MOVE_DELTA 5

View File

@ -92,6 +92,9 @@ endif
endif
CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CFLAGS += -Werror
endif
#CFLAGS += -mshort-calls
#CFLAGS += -fno-unit-at-a-time
#CFLAGS += -Wundef
@ -115,6 +118,9 @@ CPPFLAGS += -O$(OPT)
CPPFLAGS += -w
CPPFLAGS += -Wall
CPPFLAGS += -Wundef
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CPPFLAGS += -Werror
endif
#CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes