Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98b16b3294 | ||
|
|
85659ae5e1 | ||
|
|
2a89134d8e | ||
|
|
3eabd7946e | ||
|
|
fd0bd29a0a | ||
|
|
feb5e4aaeb | ||
|
|
90d8ed6c44 | ||
|
|
243764b83d | ||
|
|
489a922f34 | ||
|
|
1ac2dd9b63 | ||
|
|
98afb45a27 | ||
|
|
83da38c5e4 | ||
|
|
ccfe60eb57 |
No files matched your search
+53
-28
@@ -1,3 +1,9 @@
|
|||||||
|
# Determine what keyboard we are building and setup the build environment.
|
||||||
|
#
|
||||||
|
# We support folders up to 5 levels deep below `keyboards/`. This file is
|
||||||
|
# responsible for determining which folder is being used and doing the
|
||||||
|
# corresponding environment setup.
|
||||||
|
|
||||||
ifndef VERBOSE
|
ifndef VERBOSE
|
||||||
.SILENT:
|
.SILENT:
|
||||||
endif
|
endif
|
||||||
@@ -6,26 +12,15 @@ endif
|
|||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
|
|
||||||
# 5/4/3/2/1
|
# Set the filename for the final firmware binary
|
||||||
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
|
|
||||||
KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
|
|
||||||
KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2)))
|
|
||||||
KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3)))
|
|
||||||
KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4)))
|
|
||||||
KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1))
|
|
||||||
KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2))
|
|
||||||
KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3))
|
|
||||||
KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
|
|
||||||
KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
|
|
||||||
|
|
||||||
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
|
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
|
||||||
|
|
||||||
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
|
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
|
||||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
|
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
|
||||||
|
|
||||||
# Force expansion
|
# Force expansion
|
||||||
TARGET := $(TARGET)
|
TARGET := $(TARGET)
|
||||||
|
|
||||||
|
# For split boards we need to set a master half.
|
||||||
MASTER ?= left
|
MASTER ?= left
|
||||||
ifdef master
|
ifdef master
|
||||||
MASTER = $(master)
|
MASTER = $(master)
|
||||||
@@ -39,35 +34,58 @@ $(error MASTER does not have a valid value(left/right))
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Determine which subfolders exist.
|
||||||
|
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
|
||||||
|
KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
|
||||||
|
KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2)))
|
||||||
|
KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3)))
|
||||||
|
KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4)))
|
||||||
|
KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1))
|
||||||
|
KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2))
|
||||||
|
KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3))
|
||||||
|
KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
|
||||||
|
KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
|
||||||
KEYBOARD_PATHS :=
|
KEYBOARD_PATHS :=
|
||||||
|
|
||||||
KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1)
|
KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1)
|
||||||
KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2)
|
KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2)
|
||||||
KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3)
|
KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3)
|
||||||
KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4)
|
KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4)
|
||||||
KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5)
|
KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5)
|
||||||
|
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
|
||||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_5)
|
KEYBOARD_PATHS += $(KEYBOARD_PATH_5)
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
|
||||||
|
KEYBOARD_PATHS += $(KEYBOARD_PATH_4)
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
|
||||||
|
KEYBOARD_PATHS += $(KEYBOARD_PATH_3)
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
|
||||||
|
KEYBOARD_PATHS += $(KEYBOARD_PATH_2)
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
|
||||||
|
KEYBOARD_PATHS += $(KEYBOARD_PATH_1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Pull in rules.mk files from all our subfolders
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
|
||||||
include $(KEYBOARD_PATH_5)/rules.mk
|
include $(KEYBOARD_PATH_5)/rules.mk
|
||||||
endif
|
endif
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
|
||||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_4)
|
|
||||||
include $(KEYBOARD_PATH_4)/rules.mk
|
include $(KEYBOARD_PATH_4)/rules.mk
|
||||||
endif
|
endif
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
|
||||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_3)
|
|
||||||
include $(KEYBOARD_PATH_3)/rules.mk
|
include $(KEYBOARD_PATH_3)/rules.mk
|
||||||
endif
|
endif
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
|
||||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_2)
|
|
||||||
include $(KEYBOARD_PATH_2)/rules.mk
|
include $(KEYBOARD_PATH_2)/rules.mk
|
||||||
endif
|
endif
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
|
||||||
KEYBOARD_PATHS += $(KEYBOARD_PATH_1)
|
|
||||||
include $(KEYBOARD_PATH_1)/rules.mk
|
include $(KEYBOARD_PATH_1)/rules.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Find all the C source files to be compiled in subfolders.
|
||||||
KEYBOARD_SRC :=
|
KEYBOARD_SRC :=
|
||||||
|
|
||||||
KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c
|
KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c
|
||||||
@@ -95,6 +113,15 @@ endif
|
|||||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||||
|
|
||||||
|
|
||||||
|
# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
|
||||||
|
# that the same keymap may be used on multiple keyboards.
|
||||||
|
#
|
||||||
|
# We grab the most top-level include file that we can. That file should
|
||||||
|
# use #ifdef statements to include all the neccesary subfolder includes,
|
||||||
|
# as described here:
|
||||||
|
#
|
||||||
|
# https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic
|
||||||
|
#
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
|
||||||
QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
|
QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
|
||||||
endif
|
endif
|
||||||
@@ -111,13 +138,15 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
|
|||||||
QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
|
QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA
|
# Determine and set parameters based on the keyboard's processor family.
|
||||||
|
# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
|
||||||
|
# not used for LUFA
|
||||||
ifdef MCU_FAMILY
|
ifdef MCU_FAMILY
|
||||||
FIRMWARE_FORMAT=bin
|
FIRMWARE_FORMAT?=bin
|
||||||
PLATFORM=CHIBIOS
|
PLATFORM=CHIBIOS
|
||||||
else
|
else
|
||||||
PLATFORM=AVR
|
PLATFORM=AVR
|
||||||
FIRMWARE_FORMAT=hex
|
FIRMWARE_FORMAT?=hex
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),CHIBIOS)
|
ifeq ($(PLATFORM),CHIBIOS)
|
||||||
@@ -148,6 +177,7 @@ ifeq ($(PLATFORM),CHIBIOS)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Find all of the config.h files and add them to our CONFIG_H define.
|
||||||
CONFIG_H :=
|
CONFIG_H :=
|
||||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
|
||||||
CONFIG_H += $(KEYBOARD_PATH_5)/config.h
|
CONFIG_H += $(KEYBOARD_PATH_5)/config.h
|
||||||
@@ -203,7 +233,7 @@ else
|
|||||||
# this state should never be reached
|
# this state should never be reached
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# User space stuff
|
# Userspace setup and definitions
|
||||||
ifeq ("$(USER_NAME)","")
|
ifeq ("$(USER_NAME)","")
|
||||||
USER_NAME := $(KEYMAP)
|
USER_NAME := $(KEYMAP)
|
||||||
endif
|
endif
|
||||||
@@ -283,11 +313,6 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
|||||||
|
|
||||||
# Default target.
|
# Default target.
|
||||||
all: build check-size
|
all: build check-size
|
||||||
|
|
||||||
# Change the build target to build a HEX file or a library.
|
|
||||||
build: elf cpfirmware
|
build: elf cpfirmware
|
||||||
#build: elf hex eep lss sym
|
|
||||||
#build: lib
|
|
||||||
|
|
||||||
|
|
||||||
include $(TMK_PATH)/rules.mk
|
include $(TMK_PATH)/rules.mk
|
||||||
@@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
make bfake:default
|
make bfake:default
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
make bmini:default
|
make bmini:default
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
make canoe:default
|
make canoe:default
|
||||||
|
|
||||||
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_BASE] = LAYOUT( /* Base */
|
[_BASE] = LAYOUT( /* Base */
|
||||||
KC_A, KC_B, KC_C, KC_D, \
|
KC_NLCK, KC_PSLS, KC_PAST, KC_BSPC, \
|
||||||
KC_E, KC_F, KC_G, KC_H, \
|
KC_P7, KC_P8, KC_P9, KC_PEQL, \
|
||||||
MO(_FN), KC_I, KC_J, KC_K, KC_L, \
|
MO(_FN), KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
KC_1, KC_M, KC_N, KC_O, KC_P, \
|
KC_PENT, KC_P1, KC_P2, KC_P3, KC_PMNS, \
|
||||||
KC_Q, KC_R, KC_S, KC_T \
|
KC_SPC, KC_P0, KC_PDOT, KC_TAB \
|
||||||
),
|
),
|
||||||
[_FN] = LAYOUT(
|
[_FN] = LAYOUT(
|
||||||
RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUI, \
|
RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUI, \
|
||||||
|
|||||||
@@ -21,3 +21,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
|
||||||
|
LAYOUTS = 66_ansi
|
||||||
@@ -3,8 +3,12 @@
|
|||||||
"width": 16.5,
|
"width": 16.5,
|
||||||
"height": 5,
|
"height": 5,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"KEYMAP": {
|
"LAYOUT": {
|
||||||
"layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}]
|
"layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}]
|
||||||
|
},
|
||||||
|
|
||||||
|
"LAYOUT_66_ansi": {
|
||||||
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
A fully customizable 66% keyboard with Hot Swap sockets.
|
A fully customizable 66% keyboard with Hot Swap sockets.
|
||||||
|
|
||||||
* Keyboard Maintainer: [Zach White](https://github.com/skullydazed)
|
* Keyboard Maintainer: [Zach White](https://github.com/skullydazed)
|
||||||
* Hardware Supported: Clueboard 66% HotSwap PCB
|
* Hardware Supported: Clueboard 66% HotSwap PCB
|
||||||
* 2.9
|
* 2.9
|
||||||
* Hardware Availability: [clueboard.co](https://clueboard.co/)
|
* Hardware Availability: [clueboard.co](https://clueboard.co/)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
|
||||||
|
LAYOUTS = 66_ansi
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "debug.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#define BASE 0 // default layer
|
||||||
|
#define SYMB 1 // symbols
|
||||||
|
#define MDIA 2 // media keys
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||||
|
EPRM,
|
||||||
|
VRSN,
|
||||||
|
RGB_SLD
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Keymap 0: Basic layer
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | Esc | 1 | 2 | 3 | 4 | 5 | ~ | | ' | 6 | 7 | 8 | 9 | 0 | = |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | Del | Q | W | E | R | T | ~ | | " | Y | U | I | O | P | - |
|
||||||
|
* |--------+------+------+------+------+------| ` | | |------+------+------+------+------+--------|
|
||||||
|
* | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; | \ |
|
||||||
|
* |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
|
||||||
|
* | LAlt | Z | X | C | V | B | [ | | ] | N | M | , | . | / | LShift |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | LT-1 | F4 | F5 | F6 | F11 | | Left | Down | Up | Right| RAlt |
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | L1 | Prev | | Vol+ | L2 |
|
||||||
|
* ,------|------|------| |------+--------+------.
|
||||||
|
* | | | Play | | Vol- | | |
|
||||||
|
* | Space|Backsp|------| |------| Tab |Enter |
|
||||||
|
* | |ace | Next | | Mute | | |
|
||||||
|
* `--------------------' `----------------------'
|
||||||
|
*/
|
||||||
|
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||||
|
// Otherwise, it needs KC_*
|
||||||
|
[BASE] = LAYOUT_ergodox( // layer 0 : default
|
||||||
|
// left hand
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV),
|
||||||
|
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_GRV,
|
||||||
|
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||||
|
KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC,
|
||||||
|
LT(SYMB, KC_F2), KC_F4, KC_F5, KC_F6, KC_F11,
|
||||||
|
TG(SYMB), KC_MPRV,
|
||||||
|
KC_MPLY,
|
||||||
|
KC_SPC,KC_BSPC,KC_MNXT,
|
||||||
|
// right hand
|
||||||
|
KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||||
|
LSFT(KC_QUOT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
|
||||||
|
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS,
|
||||||
|
KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LSFT,
|
||||||
|
KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_RALT,
|
||||||
|
KC_VOLU, TG(MDIA),
|
||||||
|
KC_VOLD,
|
||||||
|
KC_MUTE,KC_TAB, KC_ENT
|
||||||
|
),
|
||||||
|
/* Keymap 1: Symbol Layer
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||||
|
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||||
|
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | EPRM | | | | | | | . | 0 | = | |
|
||||||
|
* `-----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* |Animat| | |Toggle|Solid |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* |Bright|Bright| | | |Hue- |Hue+ |
|
||||||
|
* |ness- |ness+ |------| |------| | |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
// SYMBOLS
|
||||||
|
[SYMB] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
VRSN, 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,
|
||||||
|
EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
|
RGB_MOD,KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
RGB_VAD,RGB_VAI,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,
|
||||||
|
RGB_TOG, RGB_SLD,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_TRNS, RGB_HUD, RGB_HUI
|
||||||
|
),
|
||||||
|
/* Keymap 2: Media and mouse keys
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | | | MsUp | | | | | | | | | | | |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | | | | | | | | | | | Prev | Next | | |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | |Brwser|
|
||||||
|
* | | |------| |------| |Back |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
// MEDIA AND MOUSE
|
||||||
|
[MDIA] = LAYOUT_ergodox(
|
||||||
|
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) {
|
||||||
|
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (record->event.pressed) { // For resetting EEPROM
|
||||||
|
eeconfig_init();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
// dynamically generate these.
|
||||||
|
case EPRM:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
eeconfig_init();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case VRSN:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RGB_SLD:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
rgblight_mode(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# ErgoDox EZ Based Configuration
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
* Aug 2018:
|
||||||
|
* New custom L0 layout.
|
||||||
|
* 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).
|
||||||
@@ -15,10 +15,39 @@ Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_
|
|||||||
- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com)
|
- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com)
|
||||||
- Uses ps2avru instead of ps2avrgb
|
- Uses ps2avru instead of ps2avrgb
|
||||||
- To put in reset mode hold `q` while inserting the USB cable
|
- To put in reset mode hold `q` while inserting the USB cable
|
||||||
- When flashing, type `bootloadHID -r yourfile.hex` and wait awhile
|
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
make facew:default
|
make facew:default
|
||||||
|
|
||||||
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#define SERIAL_PIN_INTERRUPT INT2_vect
|
#define SERIAL_PIN_INTERRUPT INT2_vect
|
||||||
|
|
||||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
#define SERIAL_MASTER_BUFFER_LENGTH 0
|
||||||
|
|
||||||
//// #error rev1/keymaps/OLED_sample serial config
|
//// #error rev1/keymaps/OLED_sample serial config
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
SRC += rev1/matrix.c \
|
SRC += rev1/matrix.c
|
||||||
rev1/split_util.c
|
SRC += rev1/split_util.c
|
||||||
|
|
||||||
BACKLIGHT_ENABLE = no
|
BACKLIGHT_ENABLE = no
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#define SERIAL_PIN_INTERRUPT INT0_vect
|
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||||
|
|
||||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
#define SERIAL_MASTER_BUFFER_LENGTH 0
|
||||||
|
|
||||||
/// #error rev1 serial config
|
/// #error rev1 serial config
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
//#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
|
||||||
#endif /* CONFIG_USER_H */
|
#endif /* CONFIG_USER_H */
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
//#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
#undef TAPPING_FORCE_HOLD
|
#undef TAPPING_FORCE_HOLD
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
#define TAPPING_TERM 120
|
#define TAPPING_TERM 120
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
//#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
|
#undef TAPPING_TERM
|
||||||
|
#define TAPPING_TERM 140
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
|
||||||
#endif /* CONFIG_USER_H */
|
#endif /* CONFIG_USER_H */
|
||||||
@@ -23,6 +23,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
//#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
#ifdef MOUSEKEY_ENABLE
|
#ifdef MOUSEKEY_ENABLE
|
||||||
#undef MOUSEKEY_INTERVAL
|
#undef MOUSEKEY_INTERVAL
|
||||||
#define MOUSEKEY_INTERVAL 0
|
#define MOUSEKEY_INTERVAL 0
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
//#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
#define TAPPING_TERM 200
|
#define TAPPING_TERM 200
|
||||||
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
|
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
// if you need more program area, try uncomment follow line
|
||||||
|
#include "serial_config_simpleapi.h"
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
|
||||||
#endif /* CONFIG_USER_H */
|
#endif /* CONFIG_USER_H */
|
||||||
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <string.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
@@ -34,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
#else // USE_SERIAL
|
#else // USE_SERIAL
|
||||||
# include "serial.h"
|
# include "split_scomm.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DEBOUNCE
|
#ifndef DEBOUNCE
|
||||||
@@ -102,6 +103,8 @@ void matrix_init(void)
|
|||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
TX_RX_LED_INIT;
|
||||||
|
TXLED0;
|
||||||
|
RXLED0;
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -178,17 +181,20 @@ i2c_error: // the cable is disconnceted, or something else went wrong
|
|||||||
|
|
||||||
#else // USE_SERIAL
|
#else // USE_SERIAL
|
||||||
|
|
||||||
int serial_transaction(void) {
|
int serial_transaction(int master_changed) {
|
||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int ret=serial_update_buffers(master_changed);
|
||||||
|
#else
|
||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2)RXLED1;
|
if(ret==2) RXLED1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
RXLED0;
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
memcpy(&matrix[slaveOffset],
|
||||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -199,19 +205,9 @@ uint8_t matrix_scan(void)
|
|||||||
matrix_master_scan();
|
matrix_master_scan();
|
||||||
}else{
|
}else{
|
||||||
matrix_slave_scan();
|
matrix_slave_scan();
|
||||||
|
int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
|
||||||
// if(serial_slave_DATA_CORRUPT()){
|
memcpy(&matrix[offset],
|
||||||
// TXLED0;
|
(void *)serial_master_buffer, sizeof(serial_master_buffer));
|
||||||
int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
matrix[offset+i] = serial_master_buffer[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// }else{
|
|
||||||
// TXLED1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -221,6 +217,7 @@ uint8_t matrix_scan(void)
|
|||||||
uint8_t matrix_master_scan(void) {
|
uint8_t matrix_master_scan(void) {
|
||||||
|
|
||||||
int ret = _matrix_scan();
|
int ret = _matrix_scan();
|
||||||
|
int mchanged = 1;
|
||||||
|
|
||||||
#ifndef KEYBOARD_helix_rev1
|
#ifndef KEYBOARD_helix_rev1
|
||||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||||
@@ -231,16 +228,19 @@ uint8_t matrix_master_scan(void) {
|
|||||||
// i2c_slave_buffer[i] = matrix[offset+i];
|
// i2c_slave_buffer[i] = matrix[offset+i];
|
||||||
// }
|
// }
|
||||||
#else // USE_SERIAL
|
#else // USE_SERIAL
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
serial_master_buffer[i] = matrix[offset+i];
|
mchanged = memcmp((void *)serial_master_buffer,
|
||||||
}
|
&matrix[offset], sizeof(serial_master_buffer));
|
||||||
|
#endif
|
||||||
|
memcpy((void *)serial_master_buffer,
|
||||||
|
&matrix[offset], sizeof(serial_master_buffer));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
if( i2c_transaction() ) {
|
if( i2c_transaction() ) {
|
||||||
#else // USE_SERIAL
|
#else // USE_SERIAL
|
||||||
if( serial_transaction() ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
TXLED1;
|
||||||
@@ -274,9 +274,19 @@ void matrix_slave_scan(void) {
|
|||||||
i2c_slave_buffer[i] = matrix[offset+i];
|
i2c_slave_buffer[i] = matrix[offset+i];
|
||||||
}
|
}
|
||||||
#else // USE_SERIAL
|
#else // USE_SERIAL
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int change = 0;
|
||||||
|
#endif
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
if( serial_slave_buffer[i] != matrix[offset+i] )
|
||||||
|
change = 1;
|
||||||
|
#endif
|
||||||
serial_slave_buffer[i] = matrix[offset+i];
|
serial_slave_buffer[i] = matrix[offset+i];
|
||||||
}
|
}
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
slave_buffer_change_count += change;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
SRC += rev2/matrix.c \
|
SRC += rev2/matrix.c
|
||||||
rev2/split_util.c \
|
SRC += rev2/split_util.c
|
||||||
ws2812.c
|
SRC += rev2/split_scomm.c
|
||||||
|
SRC += ws2812.c
|
||||||
@@ -8,8 +8,7 @@
|
|||||||
#define SERIAL_PIN_MASK _BV(PD2)
|
#define SERIAL_PIN_MASK _BV(PD2)
|
||||||
#define SERIAL_PIN_INTERRUPT INT2_vect
|
#define SERIAL_PIN_INTERRUPT INT2_vect
|
||||||
|
|
||||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
#define SERIAL_USE_MULTI_TRANSACTION
|
||||||
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
|
||||||
|
|
||||||
//// #error rev2 serial config
|
//// #error rev2 serial config
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef SERIAL_CONFIG_SIMPLEAPI_H
|
||||||
|
#define SERIAL_CONFIG_SIMPLEAPI_H
|
||||||
|
|
||||||
|
#undef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
|
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
|
|
||||||
|
#endif // SERIAL_CONFIG_SIMPLEAPI_H
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
#ifdef USE_SERIAL
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
/* --- USE flexible API (using multi-type transaction function) --- */
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <split_scomm.h>
|
||||||
|
#include "serial.h"
|
||||||
|
#ifdef SERIAL_DEBUG_MODE
|
||||||
|
#include <avr/io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||||
|
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||||
|
uint8_t volatile status_com = 0;
|
||||||
|
uint8_t volatile status1 = 0;
|
||||||
|
uint8_t slave_buffer_change_count = 0;
|
||||||
|
uint8_t s_change_old = 0xff;
|
||||||
|
|
||||||
|
SSTD_t transactions[] = {
|
||||||
|
#define GET_SLAVE_STATUS 0
|
||||||
|
/* master buffer not changed, only recive slave_buffer_change_count */
|
||||||
|
{ (uint8_t *)&status_com,
|
||||||
|
0, NULL,
|
||||||
|
sizeof(slave_buffer_change_count), &slave_buffer_change_count,
|
||||||
|
},
|
||||||
|
#define PUT_MASTER_GET_SLAVE_STATUS 1
|
||||||
|
/* master buffer changed need send, and recive slave_buffer_change_count */
|
||||||
|
{ (uint8_t *)&status_com,
|
||||||
|
sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
|
||||||
|
sizeof(slave_buffer_change_count), &slave_buffer_change_count,
|
||||||
|
},
|
||||||
|
#define GET_SLAVE_BUFFER 2
|
||||||
|
/* recive serial_slave_buffer */
|
||||||
|
{ (uint8_t *)&status1,
|
||||||
|
0, NULL,
|
||||||
|
sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void serial_master_init(void)
|
||||||
|
{
|
||||||
|
soft_serial_initiator_init(transactions);
|
||||||
|
}
|
||||||
|
|
||||||
|
void serial_slave_init(void)
|
||||||
|
{
|
||||||
|
soft_serial_target_init(transactions);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0 => no error
|
||||||
|
// 1 => slave did not respond
|
||||||
|
// 2 => checksum error
|
||||||
|
int serial_update_buffers(int master_update)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
static int need_retry = 0;
|
||||||
|
if( s_change_old != slave_buffer_change_count ) {
|
||||||
|
status = soft_serial_transaction(GET_SLAVE_BUFFER);
|
||||||
|
if( status == TRANSACTION_END )
|
||||||
|
s_change_old = slave_buffer_change_count;
|
||||||
|
}
|
||||||
|
if( !master_update && !need_retry)
|
||||||
|
status = soft_serial_transaction(GET_SLAVE_STATUS);
|
||||||
|
else
|
||||||
|
status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS);
|
||||||
|
need_retry = ( status == TRANSACTION_END ) ? 0 : 1;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
#endif /* USE_SERIAL */
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef SPLIT_COMM_H
|
||||||
|
#define SPLIT_COMM_H
|
||||||
|
|
||||||
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */
|
||||||
|
#include "serial.h"
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* --- USE flexible API (using multi-type transaction function) --- */
|
||||||
|
// Buffers for master - slave communication
|
||||||
|
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
|
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
|
|
||||||
|
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||||
|
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||||
|
extern uint8_t slave_buffer_change_count;
|
||||||
|
|
||||||
|
void serial_master_init(void);
|
||||||
|
void serial_slave_init(void);
|
||||||
|
int serial_update_buffers(int master_changed);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* SPLIT_COMM_H */
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
#else
|
#else
|
||||||
# include "serial.h"
|
# include "split_scomm.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile bool isLeftHand = true;
|
volatile bool isLeftHand = true;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
SRC += i2c.c \
|
SRC += i2c.c
|
||||||
serial.c \
|
SRC += serial.c
|
||||||
ssd1306.c
|
SRC += ssd1306.c
|
||||||
|
|
||||||
|
# if firmware size over limit, try this option
|
||||||
|
# CFLAGS += -flto
|
||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1287
|
#MCU = at90usb1287
|
||||||
|
|||||||
+284
-135
@@ -9,40 +9,85 @@
|
|||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
//#include <pro_micro.h>
|
||||||
|
|
||||||
#ifdef USE_SERIAL
|
#ifdef USE_SERIAL
|
||||||
|
|
||||||
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
||||||
|
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||||
|
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||||
|
#endif
|
||||||
|
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||||
|
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||||
|
#endif
|
||||||
|
uint8_t volatile status0 = 0;
|
||||||
|
|
||||||
|
SSTD_t transactions[] = {
|
||||||
|
{ (uint8_t *)&status0,
|
||||||
|
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||||
|
sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
|
||||||
|
#else
|
||||||
|
0, (uint8_t *)NULL,
|
||||||
|
#endif
|
||||||
|
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||||
|
sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
|
||||||
|
#else
|
||||||
|
0, (uint8_t *)NULL,
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void serial_master_init(void)
|
||||||
|
{ soft_serial_initiator_init(transactions); }
|
||||||
|
|
||||||
|
void serial_slave_init(void)
|
||||||
|
{ soft_serial_target_init(transactions); }
|
||||||
|
|
||||||
|
// 0 => no error
|
||||||
|
// 1 => slave did not respond
|
||||||
|
// 2 => checksum error
|
||||||
|
int serial_update_buffers()
|
||||||
|
{ return soft_serial_transaction(); }
|
||||||
|
|
||||||
|
#endif // Simple API (OLD API, compatible with let's split serial.c)
|
||||||
|
|
||||||
|
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||||
|
#define NO_INLINE __attribute__((noinline))
|
||||||
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
||||||
|
|
||||||
// Serial pulse period in microseconds.
|
// Serial pulse period in microseconds.
|
||||||
|
#define TID_SEND_ADJUST 14
|
||||||
|
|
||||||
#define SELECT_SERIAL_SPEED 1
|
#define SELECT_SERIAL_SPEED 1
|
||||||
#if SELECT_SERIAL_SPEED == 0
|
#if SELECT_SERIAL_SPEED == 0
|
||||||
// Very High speed
|
// Very High speed
|
||||||
#define SERIAL_DELAY 4 // micro sec
|
#define SERIAL_DELAY 4 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
#define READ_WRITE_START_ADJUST 33 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 10 // cycles
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 1
|
#elif SELECT_SERIAL_SPEED == 1
|
||||||
// High speed
|
// High speed
|
||||||
#define SERIAL_DELAY 6 // micro sec
|
#define SERIAL_DELAY 6 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 23 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 10 // cycles
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 2
|
#elif SELECT_SERIAL_SPEED == 2
|
||||||
// Middle speed
|
// Middle speed
|
||||||
#define SERIAL_DELAY 12 // micro sec
|
#define SERIAL_DELAY 12 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 25 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 10 // cycles
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 3
|
#elif SELECT_SERIAL_SPEED == 3
|
||||||
// Low speed
|
// Low speed
|
||||||
#define SERIAL_DELAY 24 // micro sec
|
#define SERIAL_DELAY 24 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 25 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 10 // cycles
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 4
|
#elif SELECT_SERIAL_SPEED == 4
|
||||||
// Very Low speed
|
// Very Low speed
|
||||||
#define SERIAL_DELAY 50 // micro sec
|
#define SERIAL_DELAY 50 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 25 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 10 // cycles
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
#else
|
#else
|
||||||
#error Illegal Serial Speed
|
#error Illegal Serial Speed
|
||||||
#endif
|
#endif
|
||||||
@@ -51,14 +96,15 @@
|
|||||||
#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
|
#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
|
||||||
#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
|
#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
|
||||||
|
|
||||||
#define SLAVE_INT_WIDTH 1
|
#define SLAVE_INT_WIDTH_US 1
|
||||||
#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
|
||||||
|
#else
|
||||||
|
#define SLAVE_INT_ACK_WIDTH_UNIT 2
|
||||||
|
#define SLAVE_INT_ACK_WIDTH 4
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
static SSTD_t *Transaction_table = NULL;
|
||||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
|
||||||
|
|
||||||
#define SLAVE_DATA_CORRUPT (1<<0)
|
|
||||||
volatile uint8_t status = 0;
|
|
||||||
|
|
||||||
inline static
|
inline static
|
||||||
void serial_delay(void) {
|
void serial_delay(void) {
|
||||||
@@ -75,12 +121,14 @@ void serial_delay_half2(void) {
|
|||||||
_delay_us(SERIAL_DELAY_HALF2);
|
_delay_us(SERIAL_DELAY_HALF2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_output(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_output(void) {
|
void serial_output(void) {
|
||||||
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the serial pin an input with pull-up resistor
|
// make the serial pin an input with pull-up resistor
|
||||||
|
inline static void serial_input_with_pullup(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_input_with_pullup(void) {
|
void serial_input_with_pullup(void) {
|
||||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||||
@@ -92,50 +140,58 @@ uint8_t serial_read_pin(void) {
|
|||||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_low(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_low(void) {
|
void serial_low(void) {
|
||||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_high(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_high(void) {
|
void serial_high(void) {
|
||||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void serial_master_init(void) {
|
void soft_serial_initiator_init(SSTD_t *sstd_table)
|
||||||
serial_output();
|
{
|
||||||
serial_high();
|
Transaction_table = sstd_table;
|
||||||
|
serial_output();
|
||||||
|
serial_high();
|
||||||
}
|
}
|
||||||
|
|
||||||
void serial_slave_init(void) {
|
void soft_serial_target_init(SSTD_t *sstd_table)
|
||||||
serial_input_with_pullup();
|
{
|
||||||
|
Transaction_table = sstd_table;
|
||||||
|
serial_input_with_pullup();
|
||||||
|
|
||||||
#if SERIAL_PIN_MASK == _BV(PD0)
|
#if SERIAL_PIN_MASK == _BV(PD0)
|
||||||
// Enable INT0
|
// Enable INT0
|
||||||
EIMSK |= _BV(INT0);
|
EIMSK |= _BV(INT0);
|
||||||
// Trigger on falling edge of INT0
|
// Trigger on falling edge of INT0
|
||||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
||||||
#elif SERIAL_PIN_MASK == _BV(PD2)
|
#elif SERIAL_PIN_MASK == _BV(PD2)
|
||||||
// Enable INT2
|
// Enable INT2
|
||||||
EIMSK |= _BV(INT2);
|
EIMSK |= _BV(INT2);
|
||||||
// Trigger on falling edge of INT2
|
// Trigger on falling edge of INT2
|
||||||
EICRA &= ~(_BV(ISC20) | _BV(ISC21));
|
EICRA &= ~(_BV(ISC20) | _BV(ISC21));
|
||||||
#else
|
#else
|
||||||
#error unknown SERIAL_PIN_MASK value
|
#error unknown SERIAL_PIN_MASK value
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by the sender to synchronize timing with the reciver.
|
// Used by the sender to synchronize timing with the reciver.
|
||||||
|
static void sync_recv(void) NO_INLINE;
|
||||||
static
|
static
|
||||||
void sync_recv(void) {
|
void sync_recv(void) {
|
||||||
for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
|
for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
|
||||||
}
|
}
|
||||||
// This shouldn't hang if the slave disconnects because the
|
// This shouldn't hang if the target disconnects because the
|
||||||
// serial line will float to high if the slave does disconnect.
|
// serial line will float to high if the target does disconnect.
|
||||||
while (!serial_read_pin());
|
while (!serial_read_pin());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by the reciver to send a synchronization signal to the sender.
|
// Used by the reciver to send a synchronization signal to the sender.
|
||||||
|
static void sync_send(void)NO_INLINE;
|
||||||
static
|
static
|
||||||
void sync_send(void) {
|
void sync_send(void) {
|
||||||
serial_low();
|
serial_low();
|
||||||
@@ -144,152 +200,245 @@ void sync_send(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reads a byte from the serial line
|
// Reads a byte from the serial line
|
||||||
static
|
static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE;
|
||||||
uint8_t serial_read_byte(void) {
|
static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
|
||||||
uint8_t byte = 0;
|
uint8_t byte, i, p, pb;
|
||||||
|
|
||||||
_delay_sub_us(READ_WRITE_START_ADJUST);
|
_delay_sub_us(READ_WRITE_START_ADJUST);
|
||||||
for ( uint8_t i = 0; i < 8; ++i) {
|
for( i = 0, byte = 0, p = 0; i < bit; i++ ) {
|
||||||
serial_delay_half1(); // read the middle of pulses
|
serial_delay_half1(); // read the middle of pulses
|
||||||
byte = (byte << 1) | serial_read_pin();
|
if( serial_read_pin() ) {
|
||||||
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
byte = (byte << 1) | 1; p ^= 1;
|
||||||
serial_delay_half2();
|
} else {
|
||||||
|
byte = (byte << 1) | 0; p ^= 0;
|
||||||
|
}
|
||||||
|
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
||||||
|
serial_delay_half2();
|
||||||
}
|
}
|
||||||
|
/* recive parity bit */
|
||||||
|
serial_delay_half1(); // read the middle of pulses
|
||||||
|
pb = serial_read_pin();
|
||||||
|
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
||||||
|
serial_delay_half2();
|
||||||
|
|
||||||
|
*pterrcount += (p != pb)? 1 : 0;
|
||||||
|
|
||||||
return byte;
|
return byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sends a byte with MSB ordering
|
// Sends a byte with MSB ordering
|
||||||
static
|
void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
|
||||||
void serial_write_byte(uint8_t data) {
|
void serial_write_chunk(uint8_t data, uint8_t bit) {
|
||||||
uint8_t b = 1<<7;
|
uint8_t b, p;
|
||||||
while( b ) {
|
for( p = 0, b = 1<<(bit-1); b ; b >>= 1) {
|
||||||
if(data & b) {
|
if(data & b) {
|
||||||
serial_high();
|
serial_high(); p ^= 1;
|
||||||
} else {
|
} else {
|
||||||
serial_low();
|
serial_low(); p ^= 0;
|
||||||
|
}
|
||||||
|
serial_delay();
|
||||||
}
|
}
|
||||||
b >>= 1;
|
/* send parity bit */
|
||||||
|
if(p & 1) { serial_high(); }
|
||||||
|
else { serial_low(); }
|
||||||
serial_delay();
|
serial_delay();
|
||||||
}
|
|
||||||
serial_low(); // sync_send() / senc_recv() need raise edge
|
serial_low(); // sync_send() / senc_recv() need raise edge
|
||||||
}
|
}
|
||||||
|
|
||||||
// interrupt handle to be used by the slave device
|
static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
|
||||||
ISR(SERIAL_PIN_INTERRUPT) {
|
static
|
||||||
serial_output();
|
void serial_send_packet(uint8_t *buffer, uint8_t size) {
|
||||||
|
for (uint8_t i = 0; i < size; ++i) {
|
||||||
// slave send phase
|
uint8_t data;
|
||||||
uint8_t checksum = 0;
|
data = buffer[i];
|
||||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
|
||||||
sync_send();
|
sync_send();
|
||||||
serial_write_byte(serial_slave_buffer[i]);
|
serial_write_chunk(data,8);
|
||||||
checksum += serial_slave_buffer[i];
|
|
||||||
}
|
}
|
||||||
sync_send();
|
}
|
||||||
serial_write_byte(checksum);
|
|
||||||
|
|
||||||
// slave switch to input
|
static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
|
||||||
sync_send(); //0
|
static
|
||||||
serial_delay_half1(); //1
|
uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) {
|
||||||
serial_low(); //2
|
uint8_t pecount = 0;
|
||||||
serial_input_with_pullup(); //2
|
for (uint8_t i = 0; i < size; ++i) {
|
||||||
serial_delay_half1(); //3
|
uint8_t data;
|
||||||
|
|
||||||
// slave recive phase
|
|
||||||
uint8_t checksum_computed = 0;
|
|
||||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
|
||||||
sync_recv();
|
sync_recv();
|
||||||
serial_master_buffer[i] = serial_read_byte();
|
data = serial_read_chunk(&pecount, 8);
|
||||||
checksum_computed += serial_master_buffer[i];
|
buffer[i] = data;
|
||||||
}
|
}
|
||||||
|
return pecount == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static
|
||||||
|
void change_sender2reciver(void) {
|
||||||
|
sync_send(); //0
|
||||||
|
serial_delay_half1(); //1
|
||||||
|
serial_low(); //2
|
||||||
|
serial_input_with_pullup(); //2
|
||||||
|
serial_delay_half1(); //3
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static
|
||||||
|
void change_reciver2sender(void) {
|
||||||
|
sync_recv(); //0
|
||||||
|
serial_delay(); //1
|
||||||
|
serial_low(); //3
|
||||||
|
serial_output(); //3
|
||||||
|
serial_delay_half1(); //4
|
||||||
|
}
|
||||||
|
|
||||||
|
// interrupt handle to be used by the target device
|
||||||
|
ISR(SERIAL_PIN_INTERRUPT) {
|
||||||
|
|
||||||
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
serial_low();
|
||||||
|
serial_output();
|
||||||
|
SSTD_t *trans = Transaction_table;
|
||||||
|
#else
|
||||||
|
// recive transaction table index
|
||||||
|
uint8_t tid;
|
||||||
|
uint8_t pecount = 0;
|
||||||
sync_recv();
|
sync_recv();
|
||||||
uint8_t checksum_received = serial_read_byte();
|
tid = serial_read_chunk(&pecount,4);
|
||||||
|
if(pecount> 0)
|
||||||
|
return;
|
||||||
|
serial_delay_half1();
|
||||||
|
|
||||||
if ( checksum_computed != checksum_received ) {
|
serial_high(); // response step1 low->high
|
||||||
status |= SLAVE_DATA_CORRUPT;
|
serial_output();
|
||||||
|
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH);
|
||||||
|
SSTD_t *trans = &Transaction_table[tid];
|
||||||
|
serial_low(); // response step2 ack high->low
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// target send phase
|
||||||
|
if( trans->target2initiator_buffer_size > 0 )
|
||||||
|
serial_send_packet((uint8_t *)trans->target2initiator_buffer,
|
||||||
|
trans->target2initiator_buffer_size);
|
||||||
|
// target switch to input
|
||||||
|
change_sender2reciver();
|
||||||
|
|
||||||
|
// target recive phase
|
||||||
|
if( trans->initiator2target_buffer_size > 0 ) {
|
||||||
|
if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
|
||||||
|
trans->initiator2target_buffer_size) ) {
|
||||||
|
*trans->status = TRANSACTION_ACCEPTED;
|
||||||
|
} else {
|
||||||
|
*trans->status = TRANSACTION_DATA_ERROR;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
status &= ~SLAVE_DATA_CORRUPT;
|
*trans->status = TRANSACTION_ACCEPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_recv(); //weit master output to high
|
sync_recv(); //weit initiator output to high
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
/////////
|
||||||
bool serial_slave_DATA_CORRUPT(void) {
|
// start transaction by initiator
|
||||||
return status & SLAVE_DATA_CORRUPT;
|
//
|
||||||
}
|
// int soft_serial_transaction(int sstd_index)
|
||||||
|
|
||||||
// Copies the serial_slave_buffer to the master and sends the
|
|
||||||
// serial_master_buffer to the slave.
|
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// 0 => no error
|
// TRANSACTION_END
|
||||||
// 1 => slave did not respond
|
// TRANSACTION_NO_RESPONSE
|
||||||
// 2 => checksum error
|
// TRANSACTION_DATA_ERROR
|
||||||
int serial_update_buffers(void) {
|
// this code is very time dependent, so we need to disable interrupts
|
||||||
// this code is very time dependent, so we need to disable interrupts
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int soft_serial_transaction(void) {
|
||||||
|
SSTD_t *trans = Transaction_table;
|
||||||
|
#else
|
||||||
|
int soft_serial_transaction(int sstd_index) {
|
||||||
|
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||||
|
#endif
|
||||||
cli();
|
cli();
|
||||||
|
|
||||||
// signal to the slave that we want to start a transaction
|
// signal to the target that we want to start a transaction
|
||||||
serial_output();
|
serial_output();
|
||||||
serial_low();
|
serial_low();
|
||||||
_delay_us(SLAVE_INT_WIDTH);
|
_delay_us(SLAVE_INT_WIDTH_US);
|
||||||
|
|
||||||
// wait for the slaves response
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
// wait for the target response
|
||||||
serial_input_with_pullup();
|
serial_input_with_pullup();
|
||||||
_delay_us(SLAVE_INT_RESPONSE_TIME);
|
_delay_us(SLAVE_INT_RESPONSE_TIME);
|
||||||
|
|
||||||
// check if the slave is present
|
// check if the target is present
|
||||||
if (serial_read_pin()) {
|
if (serial_read_pin()) {
|
||||||
// slave failed to pull the line low, assume not present
|
// target failed to pull the line low, assume not present
|
||||||
serial_output();
|
serial_output();
|
||||||
serial_high();
|
serial_high();
|
||||||
|
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||||
sei();
|
sei();
|
||||||
return 1;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// master recive phase
|
#else
|
||||||
// if the slave is present syncronize with it
|
// send transaction table index
|
||||||
|
|
||||||
uint8_t checksum_computed = 0;
|
|
||||||
// receive data from the slave
|
|
||||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
|
||||||
sync_recv();
|
|
||||||
serial_slave_buffer[i] = serial_read_byte();
|
|
||||||
checksum_computed += serial_slave_buffer[i];
|
|
||||||
}
|
|
||||||
sync_recv();
|
|
||||||
uint8_t checksum_received = serial_read_byte();
|
|
||||||
|
|
||||||
if (checksum_computed != checksum_received) {
|
|
||||||
serial_output();
|
|
||||||
serial_high();
|
|
||||||
sei();
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// master switch to output
|
|
||||||
sync_recv(); //0
|
|
||||||
serial_delay(); //1
|
|
||||||
serial_low(); //3
|
|
||||||
serial_output(); // 3
|
|
||||||
serial_delay_half1(); //4
|
|
||||||
|
|
||||||
// master send phase
|
|
||||||
uint8_t checksum = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
|
||||||
sync_send();
|
|
||||||
serial_write_byte(serial_master_buffer[i]);
|
|
||||||
checksum += serial_master_buffer[i];
|
|
||||||
}
|
|
||||||
sync_send();
|
sync_send();
|
||||||
serial_write_byte(checksum);
|
_delay_sub_us(TID_SEND_ADJUST);
|
||||||
|
serial_write_chunk(sstd_index, 4);
|
||||||
|
serial_delay_half1();
|
||||||
|
|
||||||
|
// wait for the target response (step1 low->high)
|
||||||
|
serial_input_with_pullup();
|
||||||
|
while( !serial_read_pin() ) {
|
||||||
|
_delay_sub_us(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if the target is present (step2 high->low)
|
||||||
|
for( int i = 0; serial_read_pin(); i++ ) {
|
||||||
|
if (i > SLAVE_INT_ACK_WIDTH + 1) {
|
||||||
|
// slave failed to pull the line low, assume not present
|
||||||
|
serial_output();
|
||||||
|
serial_high();
|
||||||
|
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||||
|
sei();
|
||||||
|
return TRANSACTION_NO_RESPONSE;
|
||||||
|
}
|
||||||
|
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initiator recive phase
|
||||||
|
// if the target is present syncronize with it
|
||||||
|
if( trans->target2initiator_buffer_size > 0 ) {
|
||||||
|
if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
|
||||||
|
trans->target2initiator_buffer_size) ) {
|
||||||
|
serial_output();
|
||||||
|
serial_high();
|
||||||
|
*trans->status = TRANSACTION_DATA_ERROR;
|
||||||
|
sei();
|
||||||
|
return TRANSACTION_DATA_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// initiator switch to output
|
||||||
|
change_reciver2sender();
|
||||||
|
|
||||||
|
// initiator send phase
|
||||||
|
if( trans->initiator2target_buffer_size > 0 ) {
|
||||||
|
serial_send_packet((uint8_t *)trans->initiator2target_buffer,
|
||||||
|
trans->initiator2target_buffer_size);
|
||||||
|
}
|
||||||
|
|
||||||
// always, release the line when not in use
|
// always, release the line when not in use
|
||||||
sync_send();
|
sync_send();
|
||||||
|
|
||||||
|
*trans->status = TRANSACTION_END;
|
||||||
sei();
|
sei();
|
||||||
return 0;
|
return TRANSACTION_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int soft_serial_get_and_clean_status(int sstd_index) {
|
||||||
|
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||||
|
cli();
|
||||||
|
int retval = *trans->status;
|
||||||
|
*trans->status = 0;;
|
||||||
|
sei();
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -3,25 +3,78 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
// ////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////
|
||||||
// Need Soft Serial defines in serial_config.h
|
// Need Soft Serial defines in serial_config.h
|
||||||
// ////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////
|
||||||
// ex.
|
// ex.
|
||||||
// #define SERIAL_PIN_DDR DDRD
|
// #define SERIAL_PIN_DDR DDRD
|
||||||
// #define SERIAL_PIN_PORT PORTD
|
// #define SERIAL_PIN_PORT PORTD
|
||||||
// #define SERIAL_PIN_INPUT PIND
|
// #define SERIAL_PIN_INPUT PIND
|
||||||
// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
|
// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
|
||||||
// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
|
// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
|
||||||
|
//
|
||||||
|
// //// USE Simple API (OLD API, compatible with let's split serial.c)
|
||||||
|
// ex.
|
||||||
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
// #define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||||
|
//
|
||||||
|
// //// USE flexible API (using multi-type transaction function)
|
||||||
|
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
//
|
||||||
|
// /////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Buffers for master - slave communication
|
|
||||||
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
||||||
|
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||||
|
#endif
|
||||||
|
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||||
|
#endif
|
||||||
|
|
||||||
void serial_master_init(void);
|
void serial_master_init(void);
|
||||||
void serial_slave_init(void);
|
void serial_slave_init(void);
|
||||||
int serial_update_buffers(void);
|
int serial_update_buffers(void);
|
||||||
bool serial_slave_data_corrupt(void);
|
|
||||||
|
#endif // USE Simple API
|
||||||
|
|
||||||
|
// Soft Serial Transaction Descriptor
|
||||||
|
typedef struct _SSTD_t {
|
||||||
|
uint8_t *status;
|
||||||
|
uint8_t initiator2target_buffer_size;
|
||||||
|
uint8_t *initiator2target_buffer;
|
||||||
|
uint8_t target2initiator_buffer_size;
|
||||||
|
uint8_t *target2initiator_buffer;
|
||||||
|
} SSTD_t;
|
||||||
|
|
||||||
|
// initiator is transaction start side
|
||||||
|
void soft_serial_initiator_init(SSTD_t *sstd_table);
|
||||||
|
// target is interrupt accept side
|
||||||
|
void soft_serial_target_init(SSTD_t *sstd_table);
|
||||||
|
|
||||||
|
// initiator resullt
|
||||||
|
#define TRANSACTION_END 0
|
||||||
|
#define TRANSACTION_NO_RESPONSE 0x1
|
||||||
|
#define TRANSACTION_DATA_ERROR 0x2
|
||||||
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int soft_serial_transaction(void);
|
||||||
|
#else
|
||||||
|
int soft_serial_transaction(int sstd_index);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// target status
|
||||||
|
// *SSTD_t.status has
|
||||||
|
// initiator:
|
||||||
|
// TRANSACTION_END
|
||||||
|
// or TRANSACTION_NO_RESPONSE
|
||||||
|
// or TRANSACTION_DATA_ERROR
|
||||||
|
// target:
|
||||||
|
// TRANSACTION_DATA_ERROR
|
||||||
|
// or TRANSACTION_ACCEPTED
|
||||||
|
#define TRANSACTION_ACCEPTED 0x4
|
||||||
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
|
int soft_serial_get_and_clean_status(int sstd_index);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* SOFT_SERIAL_H */
|
#endif /* SOFT_SERIAL_H */
|
||||||
@@ -52,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
|||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||||
|
#define _BL 0 // Base Layer
|
||||||
|
#define _FN 1 // Function Layer
|
||||||
|
#define _CL 2 // Control+ Layer
|
||||||
|
|
||||||
|
// Add names for complex momentary keys, to keep the keymap matrix aligned better.
|
||||||
|
#define CTL_ESC MT(MOD_LCTL,KC_ESC)
|
||||||
|
#define GUI_ENT MT(MOD_RGUI, KC_ENT)
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_BL] = LAYOUT(
|
||||||
|
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_F13, MO(_FN), KC_DEL,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME,
|
||||||
|
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_PGUP,
|
||||||
|
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
|
||||||
|
KC_LSFT, MO(_FN), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||||
|
MO(_CL), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FN] = LAYOUT(
|
||||||
|
RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______,
|
||||||
|
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
[_CL] = LAYOUT(
|
||||||
|
LCTL(KC_ESC), LCTL(KC_F1), LCTL(KC_F2), LCTL(KC_F3), LCTL(KC_F4), LCTL(KC_F5), LCTL(KC_F6), LCTL(KC_F7), LCTL(KC_F8), LCTL(KC_F9), LCTL(KC_F10), LCTL(KC_F11), LCTL(KC_F12), LCTL(KC_PSCR), _______, LCTL(KC_DEL),
|
||||||
|
KC_ESC, LCTL(KC_1), LCTL(KC_2), LCTL(KC_3), LCTL(KC_4), LCTL(KC_5), LCTL(KC_6), LCTL(KC_7), LCTL(KC_8), LCTL(KC_9), LCTL(KC_0), LCTL(KC_MINS), LCTL(KC_EQL), LCTL(KC_DEL), KC_DEL, LCTL(KC_HOME),
|
||||||
|
LCTL(KC_TAB), LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, LCTL(KC_LBRC), LCTL(KC_RBRC), LCTL(KC_BSLS), LCTL(KC_PGUP),
|
||||||
|
CTL_ESC, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), LCTL(KC_PGDN),
|
||||||
|
LCTL(KC_LSFT), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), KC_PGDN, LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), LCTL(KC_UP), LCTL(KC_END),
|
||||||
|
_______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), LCTL(KC_RCTL), LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_RGHT)
|
||||||
|
),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||||
|
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
|
||||||
|
} else {
|
||||||
|
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Spaceman Spiff Layout for KBD75
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<!-- http://www.keyboard-layout-editor.com/#/gists/c1e8a15c68e4c52eed84653f21ae2d29 -->
|
||||||
|
|
||||||
|
Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings.
|
||||||
|
|
||||||
|
Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key.
|
||||||
|
|
||||||
|
# Base Layer
|
||||||
|
|
||||||
|
As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`:
|
||||||
|
- `Esc` when pressed alone
|
||||||
|
- `Ctrl` when pressed with another key
|
||||||
|
|
||||||
|
# Control+ Layer
|
||||||
|
|
||||||
|
Left Ctrl key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions:
|
||||||
|
|
||||||
|
- `Ctl+` + `hjkl` are vim-style motion keys
|
||||||
|
- `Ctl+` + `p` and `Ctl+` + `n` are page up and down
|
||||||
|
- `Ctl+` + `Backspace` is forward delete
|
||||||
|
|
||||||
|
# Fn Layer
|
||||||
|
|
||||||
|
Audio Controls:
|
||||||
|
- `Fn` + `a` Volume Down
|
||||||
|
- `Fn` + `s` Volume Up
|
||||||
|
- `Fn` + `d` Mute
|
||||||
|
|
||||||
|
To flash this layout you need to press `Fn+Backspace`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,60 +1,36 @@
|
|||||||
#ifndef CONFIG_USER_H
|
|
||||||
#define CONFIG_USER_H
|
|
||||||
|
|
||||||
#include "../../config.h"
|
#ifndef USERSPACE_CONFIG_H
|
||||||
|
#define USERSPACE_CONFIG_H
|
||||||
|
|
||||||
#define LEADER_TIMEOUT 300
|
|
||||||
//#define BACKLIGHT_BREATHING
|
|
||||||
#define PREVENT_STUCK_MODIFIERS
|
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
|
||||||
|
// #define STARTUP_SONG SONG(E1M1_DOOM)
|
||||||
|
// #define GOODBYE_SONG SONG(SONIC_RING)
|
||||||
|
/* #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||||
|
SONG(COLEMAK_SOUND), \
|
||||||
|
SONG(DVORAK_SOUND), \
|
||||||
|
}
|
||||||
|
*/
|
||||||
//audio clicky
|
//audio clicky
|
||||||
#define AUDIO_CLICKY
|
#define AUDIO_CLICKY
|
||||||
// to enable clicky on startup
|
// to enable clicky on startup
|
||||||
//#define AUDIO_CLICKY_ON
|
//#define AUDIO_CLICKY_ON
|
||||||
#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f
|
#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f
|
||||||
|
|
||||||
/* ws2812 RGB LED
|
|
||||||
#define RGB_DI_PIN B5
|
#endif
|
||||||
#define RGBLIGHT_ANIMATIONS
|
|
||||||
#define RGBLED_NUM 8 // Number of LEDs
|
#define FORCE_NKRO
|
||||||
#define RGBLIGHT_HUE_STEP 10
|
|
||||||
#define RGBLIGHT_SAT_STEP 17
|
#define LEADER_TIMEOUT 300
|
||||||
*/
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
#undef PLANCK_MIT_LAYOUT
|
|
||||||
|
|
||||||
#undef DEBOUNCE
|
#undef DEBOUNCE
|
||||||
#define DEBOUNCE 0
|
#define DEBOUNCE 0
|
||||||
|
|
||||||
//rgb-reactive
|
|
||||||
#define RGB_MATRIX_KEYPRESSES
|
|
||||||
#define EECONFIG_RGB_MATRIX (uint32_t *)16
|
|
||||||
|
|
||||||
//skip usb startup check
|
//skip usb startup check
|
||||||
//#define NO_USB_STARTUP_CHECK
|
//#define NO_USB_STARTUP_CHECK
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MIDI options
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Prevent use of disabled MIDI features in the keymap */
|
|
||||||
//#define MIDI_ENABLE_STRICT 1
|
|
||||||
|
|
||||||
/* enable basic MIDI features:
|
|
||||||
- MIDI notes can be sent when in Music mode is on
|
|
||||||
*/
|
|
||||||
#define MIDI_BASIC
|
|
||||||
|
|
||||||
/* enable advanced MIDI features:
|
|
||||||
- MIDI notes can be added to the keymap
|
|
||||||
- Octave shift and transpose
|
|
||||||
- Virtual sustain, portamento, and modulation wheel
|
|
||||||
- etc.
|
|
||||||
*/
|
|
||||||
//#define MIDI_ADVANCED
|
|
||||||
|
|
||||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
|
||||||
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
// 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.
|
// this is the style you want to emulate.
|
||||||
|
|
||||||
#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example"
|
|
||||||
#include "planck.h"
|
#include "planck.h"
|
||||||
#include "action_layer.h"
|
#include "action_layer.h"
|
||||||
// #include "dynamic_macro.h"
|
// #include "dynamic_macro.h"
|
||||||
@@ -9,65 +8,10 @@
|
|||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#endif
|
#endif
|
||||||
#include "eeconfig.h"
|
#include "eeconfig.h"
|
||||||
|
#include "ishtob.h"
|
||||||
//Macro definition
|
|
||||||
#if (__has_include("macros_private.h") && !defined(SECRETS))
|
|
||||||
#include "macros_private.h"
|
|
||||||
#else
|
|
||||||
#include "macros_public.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
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.
|
|
||||||
#define _QWERTY 0
|
|
||||||
#define _COLEMAK 1
|
|
||||||
#define _DVORAK 2
|
|
||||||
#define _LOWER 3
|
|
||||||
#define _RAISE 4
|
|
||||||
#define _PLOVER 5
|
|
||||||
#define _FNLAYER 6
|
|
||||||
#define _NUMLAY 7
|
|
||||||
#define _MOUSECURSOR 8
|
|
||||||
#define _ADJUST 16
|
|
||||||
|
|
||||||
enum planck_keycodes {
|
|
||||||
QWERTY = SAFE_RANGE,
|
|
||||||
COLEMAK,
|
|
||||||
DVORAK,
|
|
||||||
PLOVER,
|
|
||||||
LOWER,
|
|
||||||
RAISE,
|
|
||||||
BACKLIT,
|
|
||||||
EXT_PLV,
|
|
||||||
DFU,
|
|
||||||
};
|
|
||||||
|
|
||||||
// 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 CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
|
|
||||||
#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
|
|
||||||
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
|
||||||
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
|
||||||
#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer
|
|
||||||
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
|
||||||
#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
|
|
||||||
#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY
|
|
||||||
#define P_CITRIX M(KC_CITRIX) // My login macros
|
|
||||||
#define P_MPASS M(KC_MPASS)
|
|
||||||
#define P_META M(KC_META)
|
|
||||||
#define O_DAYRN M(KC_DAYRN) // My work macros
|
|
||||||
#define O_AUTODC M(KC_AUTODC)
|
|
||||||
#define O_RTQ6H M(KC_RTQ6H)
|
|
||||||
#define M_EMAIL M(KC_EMAIL) // My personal email
|
|
||||||
#define M_EMAIL2 M(KC_EMAIL2) // My work email
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
/* Qwerty
|
/* Qwerty
|
||||||
,-----------------------------------------------------------------------------------.
|
,-----------------------------------------------------------------------------------.
|
||||||
@@ -86,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS),
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS),
|
||||||
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Colemak
|
/* Colemak
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||||
@@ -104,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS),
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS),
|
||||||
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Dvorak
|
/* Dvorak
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
@@ -122,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS),
|
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS),
|
||||||
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Lower
|
/* Lower
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ |
|
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ |
|
||||||
@@ -140,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______,
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Raise
|
/* Raise
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * | \ |
|
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * | \ |
|
||||||
@@ -158,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
_______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______,
|
_______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______,
|
||||||
_______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK
|
_______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Plover layer (http://opensteno.org)
|
/* Plover layer (http://opensteno.org)
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
||||||
@@ -170,14 +114,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | Exit | | | A | O | | E | U | | | |
|
* | Exit | | | A | O | | E | U | | | |
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[_PLOVER] = LAYOUT_planck_grid(
|
[_PLOVER] = LAYOUT_planck_grid(
|
||||||
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
|
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
|
||||||
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||||
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||||
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
|
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
),
|
),
|
||||||
|
|
||||||
/* FN layer on Esc key
|
/* FN layer on Esc key
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + |
|
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + |
|
||||||
@@ -195,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______,
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Num Layer
|
/* Num Layer
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | | Q | Up | 4 | | | 7 | 8 | 9 | - | + | Bksp |
|
* | | Q | Up | 4 | | | 7 | 8 | 9 | - | + | Bksp |
|
||||||
@@ -213,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
_______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______,
|
_______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______,
|
||||||
_______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, KC_NLCK, KC_MPLY
|
_______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, KC_NLCK, KC_MPLY
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Mouse Layer (semi-col)
|
/* Mouse Layer (semi-col)
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | ACCL0| ACCL1| ACCL2|Email |Email2| Home | Wh_Up| WHL_L| M_Up | WHL_R|PASS| Meta |
|
* | ACCL0| ACCL1| ACCL2|Email |Email2| Home | Wh_Up| WHL_L| M_Up | WHL_R|PASS| Meta |
|
||||||
@@ -225,14 +169,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | | | | | | BTN1 | | | | Citx | |
|
* | | | | | | BTN1 | | | | Citx | |
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[_MOUSECURSOR] = LAYOUT_planck_grid(
|
[_MOUSECURSOR] = LAYOUT_planck_grid(
|
||||||
KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META,
|
KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META,
|
||||||
_______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN,
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN,
|
||||||
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______,
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______,
|
||||||
_______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC
|
_______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Adjust (Lower + Raise)
|
/* Adjust (Lower + Raise)
|
||||||
* ,-----------------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------------.
|
||||||
* | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del |
|
* | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del |
|
||||||
@@ -250,7 +194,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG,
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG
|
_______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,7 +225,7 @@ void persistant_default_layer_set(uint16_t default_layer) {
|
|||||||
void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
|
void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
|
||||||
|
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case QWERTY:
|
case QWERTY:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
@@ -369,36 +313,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case DFU:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
clear_keyboard();
|
|
||||||
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
|
|
||||||
process_midi_all_notes_off();
|
|
||||||
#endif
|
|
||||||
#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
|
|
||||||
music_all_notes_off();
|
|
||||||
uint16_t timer_start = timer_read();
|
|
||||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
|
||||||
shutdown_user();
|
|
||||||
while(timer_elapsed(timer_start) < 250)
|
|
||||||
wait_ms(1);
|
|
||||||
stop_all_notes();
|
|
||||||
#else
|
|
||||||
wait_ms(250);
|
|
||||||
#endif
|
|
||||||
// this is also done later in bootloader.c - not sure if it's neccesary here
|
|
||||||
#ifdef BOOTLOADER_CATERINA
|
|
||||||
*(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
|
|
||||||
#endif
|
|
||||||
bootloader_jump();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init_user(void) {
|
void matrix_init_keymap(void) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
startup_user();
|
startup_user();
|
||||||
#endif
|
#endif
|
||||||
@@ -432,4 +351,3 @@ void music_scale_user(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
enum macro_keycodes {
|
|
||||||
KC_CITRIX,
|
|
||||||
KC_MPASS,
|
|
||||||
KC_META,
|
|
||||||
KC_RTQ6H,
|
|
||||||
KC_DAYRN,
|
|
||||||
KC_3DRN,
|
|
||||||
KC_AUTODC,
|
|
||||||
KC_EMAIL,
|
|
||||||
KC_EMAIL2
|
|
||||||
};
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
if (!eeconfig_is_enabled()) {
|
|
||||||
eeconfig_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (id) {
|
|
||||||
//my login macros
|
|
||||||
case KC_CITRIX:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(1), END);
|
|
||||||
}
|
|
||||||
case KC_MPASS:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(1), END);
|
|
||||||
}
|
|
||||||
case KC_META:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(1), END);
|
|
||||||
}
|
|
||||||
//my work macros
|
|
||||||
case KC_RTQ6H:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(TAB), T(0), T (3), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(0), T (9), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(1), T (5), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(2), T (1), T(0), T(0), T(TAB), D(LALT), T(O), U(LALT), END);
|
|
||||||
}
|
|
||||||
case KC_AUTODC:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), D(LALT), T(V), U(LALT), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(T), T(TAB),T(N), D(LALT), T(S), U(LALT), END);
|
|
||||||
}
|
|
||||||
case KC_DAYRN:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(1), D(LALT), T(S), U(LALT), END);
|
|
||||||
}
|
|
||||||
//Ops macros
|
|
||||||
case KC_EMAIL:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(1), END); }
|
|
||||||
case KC_EMAIL2:
|
|
||||||
if (record->event.pressed){
|
|
||||||
return MACRO (I(1), T(1), END);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return MACRO_NONE;
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#Ishtob's personal planck layout
|
#Ishtob's personal planck layout
|
||||||
|
|
||||||
THis is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split.
|
This is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split.
|
||||||
|
|
||||||
|
|
||||||
Main difference with the default layout:
|
Main difference with the default layout:
|
||||||
@@ -14,8 +14,3 @@ Main difference with the default layout:
|
|||||||
* Capslock is on the base layer as it is used quite often with my work's software
|
* Capslock is on the base layer as it is used quite often with my work's software
|
||||||
|
|
||||||
* Numbers layer on lower is positioned to resemble a numpad with 5 taking the location of J for the homing bump and easier entry
|
* Numbers layer on lower is positioned to resemble a numpad with 5 taking the location of J for the homing bump and easier entry
|
||||||
|
|
||||||
|
|
||||||
# Secret Macros
|
|
||||||
|
|
||||||
`macros_public.h` contains a list of macros that can be replaced with passwords or other sensative private macros. `macros_private.h` will be used if it exsists in the folder during compiling and will ignore `macros_public.h` The private macros can be excluded from git commits by adding it to the exclusion list.
|
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
ifeq ($(strip $(SECRETS)),yes)
|
|
||||||
OPT_DEF += -DSECRETS
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Build Options
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||||
|
#define _BL 0
|
||||||
|
#define _FL 1
|
||||||
|
#define _CL 3
|
||||||
|
|
||||||
|
// Add names for complex momentary keys, to keep the keymap matrix aligned better.
|
||||||
|
#define CTL_ESC MT(MOD_LCTL,KC_ESC)
|
||||||
|
#define GUI_ENT MT(MOD_RGUI, KC_ENT)
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Keymap _BL: (Base Layer) Default Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| -| =|Del |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Ctl/Esc| A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Ctrl|Alt |Gui | Space |Gui |Alt |FN |Ctrl |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BL] = LAYOUT_60_ansi(
|
||||||
|
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_BSPC, \
|
||||||
|
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, \
|
||||||
|
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, 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, \
|
||||||
|
MO(_CL), KC_RALT, KC_LGUI, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, MO(_FL)),
|
||||||
|
|
||||||
|
|
||||||
|
/* Keymap _FL: Function Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* | `| | | | | | | | | | | | | RESET|
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | |VDN|VUP|MUTE| | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FL] = LAYOUT_60_ansi(
|
||||||
|
KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______),
|
||||||
|
|
||||||
|
/* Keymap _CL: Control+ Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | |PGU| | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | |LFT| DN| UP|RGT| | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | |PGD| | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_CL] = LAYOUT_60_ansi(
|
||||||
|
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_TAB, LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, KC_ESC, LCTL(KC_RBRC), LCTL(KC_BSLS), \
|
||||||
|
_______, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), \
|
||||||
|
KC_LSFT, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_PGDN, LCTL(KC_N), LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), \
|
||||||
|
_______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), KC_RCTL, MO(_FL)),
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# Spaceman Spiff Layout for GH60 Satan
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<!-- http://www.keyboard-layout-editor.com/#/gists/32feaaa31c29afb8198a8ef591db6ddf -->
|
||||||
|
|
||||||
|
Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings.
|
||||||
|
|
||||||
|
Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key.
|
||||||
|
|
||||||
|
# Base Layer
|
||||||
|
|
||||||
|
As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`:
|
||||||
|
- `Esc` when pressed alone
|
||||||
|
- `Ctrl` when pressed with another key
|
||||||
|
|
||||||
|
# Control+ Layer
|
||||||
|
|
||||||
|
Left Ctrl key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions:
|
||||||
|
|
||||||
|
- `Ctl+` + `hjkl` are vim-style motion keys
|
||||||
|
- `Ctl+` + `p` and `Ctl+` + `n` are page up and down
|
||||||
|
- `Ctl+` + `Backspace` is forward delete
|
||||||
|
|
||||||
|
# Fn Layer
|
||||||
|
|
||||||
|
Audio Controls:
|
||||||
|
- `Fn` + `a` Volume Down
|
||||||
|
- `Fn` + `s` Volume Up
|
||||||
|
- `Fn` + `d` Mute
|
||||||
|
|
||||||
|
To flash this layout you need to press `Fn+Backspace`
|
||||||
|
|
||||||
|
|
||||||
@@ -16,4 +16,34 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
make singa:default
|
make singa:default
|
||||||
|
|
||||||
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
["~\n`","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace",{x:0.5},"Page Up"],
|
||||||
|
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\",{x:0.5},"Page Down"],
|
||||||
|
[{w:1.75},"Caps Lock","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
|
||||||
|
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.25},"Shift","Up"],
|
||||||
|
[{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"Alt","Fn",{w:1.25},"Ctrl","Left","Down","Right"]
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#include QMK_KEYBOARD_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.
|
||||||
|
#define _BL 0
|
||||||
|
#define _FL 1
|
||||||
|
#define _CL 2
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Keymap _BL: Base Layer (Default Layer)
|
||||||
|
*/
|
||||||
|
[_BL] = LAYOUT_66_ansi(
|
||||||
|
KC_GESC,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_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_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_UP, \
|
||||||
|
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, MO(_FL),KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT),
|
||||||
|
|
||||||
|
/* Keymap _FL: Function Layer
|
||||||
|
*/
|
||||||
|
[_FL] = LAYOUT_66_ansi(
|
||||||
|
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, KC_VOLU, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \
|
||||||
|
KC_CAPS,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||||
|
_______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLU,KC_VOLD,_______, _______, KC_PGUP, \
|
||||||
|
_______,_______,_______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END),
|
||||||
|
|
||||||
|
/* Keymap _CL: Control layer
|
||||||
|
*/
|
||||||
|
[_CL] = LAYOUT_66_ansi(
|
||||||
|
BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \
|
||||||
|
RGB_TOG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||||
|
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \
|
||||||
|
_______,_______,_______, RGB_MOD, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI),
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# 66_ansi
|
||||||
|
|
||||||
|
LAYOUT_66_ansi
|
||||||
@@ -340,6 +340,24 @@ void matrix_slave_scan(void) {
|
|||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
serial_slave_buffer[i] = matrix[offset+i];
|
serial_slave_buffer[i] = matrix[offset+i];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef USE_I2C
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
// Read backlight level sent from master and update level on slave
|
||||||
|
backlight_set(i2c_slave_buffer[0]);
|
||||||
|
#endif
|
||||||
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
|
i2c_slave_buffer[i+1] = matrix[offset+i];
|
||||||
|
}
|
||||||
|
#else // USE_SERIAL
|
||||||
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
|
serial_slave_buffer[i] = matrix[offset+i];
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
// Read backlight level sent from master and update level on slave
|
||||||
|
backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
matrix_slave_scan_user();
|
matrix_slave_scan_user();
|
||||||
}
|
}
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,44 @@
|
|||||||
|
# %KEYBOARD%
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A short description of the keyboard/project
|
||||||
|
|
||||||
|
Keyboard Maintainer: [You](https://github.com/yourusername)
|
||||||
|
Hardware Supported: The PCBs, controllers supported
|
||||||
|
Hardware Availability: links to where you can find this hardware
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make %KEYBOARD%:default
|
||||||
|
|
||||||
|
Flashing
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
5. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
1. Install homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install `crosspack-avr`.
|
||||||
|
```
|
||||||
|
brew cask install crosspack-avr
|
||||||
|
```
|
||||||
|
3. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install python
|
||||||
|
brew install pyusb
|
||||||
|
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
|
||||||
|
4. Place your keyboard into reset.
|
||||||
|
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
Executable
+76
@@ -0,0 +1,76 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||||
|
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||||
|
|
||||||
|
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||||
|
SONG(COLEMAK_SOUND), \
|
||||||
|
SONG(DVORAK_SOUND) \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define LEADER_TIMEOUT 300
|
||||||
|
//#define BACKLIGHT_BREATHING
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
//#define PERMISSIVE_HOLD
|
||||||
|
// #define QMK_KEYS_PER_SCAN 4
|
||||||
|
|
||||||
|
//audio clicky
|
||||||
|
//#define AUDIO_CLICKY
|
||||||
|
// to enable clicky on startup
|
||||||
|
//#define AUDIO_CLICKY_ON
|
||||||
|
//#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f
|
||||||
|
|
||||||
|
/* ws2812 RGB LED
|
||||||
|
#define RGB_DI_PIN B5
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 8 // Number of LEDs
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 17
|
||||||
|
*/
|
||||||
|
#undef PLANCK_MIT_LAYOUT
|
||||||
|
|
||||||
|
//#define MUON_LEFT
|
||||||
|
|
||||||
|
#undef DEBOUNCE
|
||||||
|
#define DEBOUNCE 0
|
||||||
|
|
||||||
|
//rgb-reactive
|
||||||
|
//#define RGB_MATRIX_KEYPRESSES
|
||||||
|
//#define EECONFIG_RGB_MATRIX (uint32_t *)16
|
||||||
|
|
||||||
|
//skip usb startup check
|
||||||
|
//#define NO_USB_STARTUP_CHECK
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||||
|
|
||||||
|
// Most tactile encoders have detents every 4 stages
|
||||||
|
#define ENCODER_RESOLUTION 4
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
Based on userspace written by @drashna 2017
|
||||||
|
Copyright 2018 Hsian Chang <[email protected]> @ishtob
|
||||||
|
|
||||||
|
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 "ishtob.h"
|
||||||
|
#include "action.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
// #include "dynamic_macro.h"
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#include "audio.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Add reconfigurable functions here, for keymap customization
|
||||||
|
// This allows for a global, userspace functions, and continued
|
||||||
|
// customization of the keymap. Use _keymap instead of _user
|
||||||
|
// functions in the keymaps
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_keymap(void) {}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_keymap(void) {}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call user matrix init, then call the keymap's init function
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
matrix_init_keymap();
|
||||||
|
}
|
||||||
|
|
||||||
|
// No global matrix scan code, so just run keymap's matix
|
||||||
|
// scan function
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
matrix_scan_keymap();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case DFU:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
clear_keyboard();
|
||||||
|
reset_keyboard();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return process_record_keymap(keycode, record) && process_record_secrets(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
#ifndef USERSPACE
|
||||||
|
#define USERSPACE
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
enum userspace_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE,
|
||||||
|
COLEMAK,
|
||||||
|
DVORAK,
|
||||||
|
PLOVER,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT,
|
||||||
|
EXT_PLV,
|
||||||
|
DFU,
|
||||||
|
P_CITRIX, //these macro exsists in macros_private.c, which is excluded from git
|
||||||
|
P_MPASS,
|
||||||
|
P_META,
|
||||||
|
O_DAYRN,
|
||||||
|
O_RTQ6H,
|
||||||
|
O_3DRN,
|
||||||
|
O_AUTODC,
|
||||||
|
M_EMAIL,
|
||||||
|
M_EMAIL2
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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 _QWERTY 0
|
||||||
|
#define _COLEMAK 1
|
||||||
|
#define _DVORAK 2
|
||||||
|
#define _LOWER 3
|
||||||
|
#define _RAISE 4
|
||||||
|
#define _PLOVER 5
|
||||||
|
#define _FNLAYER 6
|
||||||
|
#define _NUMLAY 7
|
||||||
|
#define _MOUSECURSOR 8
|
||||||
|
#define _ADJUST 16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define LOWER MO(_LOWER)
|
||||||
|
#define RAISE MO(_RAISE)
|
||||||
|
|
||||||
|
// 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 CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
|
||||||
|
#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
|
||||||
|
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||||
|
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
||||||
|
#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer
|
||||||
|
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
||||||
|
#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
|
||||||
|
#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY
|
||||||
|
/*
|
||||||
|
enum userspace_layers {
|
||||||
|
_QWERTY = 0,
|
||||||
|
_COLEMAK,
|
||||||
|
_DVORAK,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_PLOVER,
|
||||||
|
_FNLAYER,
|
||||||
|
_NUMLAY,
|
||||||
|
_MOUSECURSOR,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // !USERSPACE
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
# Ishtob's userspace
|
||||||
|
|
||||||
|
under developement
|
||||||
|
|
||||||
|
# Secret Macros
|
||||||
|
|
||||||
|
This section is a modified version of what @drashna did in his userspace: https://github.com/qmk/qmk_firmware/tree/master/users/drashna#secret-macros
|
||||||
|
|
||||||
|
`macros_private.c` will be used if it exsists in the userspace folder during compiling.
|
||||||
|
|
||||||
|
To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists.
|
||||||
|
```
|
||||||
|
SRC += ishtob.c
|
||||||
|
ifneq ($(wildcard $(USER_PATH)/macros_private.c),"")
|
||||||
|
SRC += macros_private.c
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(NO_SECRETS)), yes)
|
||||||
|
OPT_DEFS += -DNO_SECRETS
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
|
||||||
|
Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile.
|
||||||
|
|
||||||
|
Next, you setup macros_private.c, ensure the keycodes are defined in ishtob.h (or your keymap.h).
|
||||||
|
Here is an example of my macros with the sensitive login information removed:
|
||||||
|
```
|
||||||
|
#include "ishtob.h" //replace this with your userspace or keymap
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#pragma message "secret macros included" //debug line to let me know this file is included in the compile
|
||||||
|
|
||||||
|
//this str is for the monthly password rotation per my workplace's security policy
|
||||||
|
char my_str[5] = "stuff";
|
||||||
|
|
||||||
|
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(keycode) {
|
||||||
|
//my login macros
|
||||||
|
case P_CITRIX:
|
||||||
|
SEND_STRING("username"SS_TAP(X_TAB)"something");
|
||||||
|
send_string(my_str);
|
||||||
|
return false;
|
||||||
|
case P_MPASS:
|
||||||
|
SEND_STRING("something");
|
||||||
|
send_string(my_str);
|
||||||
|
return false;
|
||||||
|
case P_META:
|
||||||
|
SEND_STRING("metausername");
|
||||||
|
return false;
|
||||||
|
//my work macros for the meta application
|
||||||
|
case O_RTQ6H:
|
||||||
|
SEND_STRING(SS_TAP(X_TAB)"0300"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"0900"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"1500"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"2100"SS_TAP(X_TAB)SS_LALT("o"));
|
||||||
|
return false;
|
||||||
|
case O_AUTODC:
|
||||||
|
SEND_STRING(SS_LALT("v")SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"T"SS_TAP(X_TAB)"N"SS_LALT("s"));
|
||||||
|
return false;
|
||||||
|
case O_DAYRN:
|
||||||
|
SEND_STRING(SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"1"SS_LALT("s"));
|
||||||
|
return false;
|
||||||
|
//Ops macros
|
||||||
|
case M_EMAIL:
|
||||||
|
SEND_STRING("[email protected]");
|
||||||
|
return false;
|
||||||
|
case M_EMAIL2:
|
||||||
|
SEND_STRING("[email protected]");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Finally, add the following to .git/info/exclude to prevent private macros from being committed to git.
|
||||||
|
```
|
||||||
|
# git ls-files --others --exclude-from=.git/info/exclude
|
||||||
|
# Lines that start with '#' are comments.
|
||||||
|
# For a project mostly in C, the following would be a good set of
|
||||||
|
# exclude patterns (uncomment them if you want to use them):
|
||||||
|
# *.[oa]
|
||||||
|
# *~
|
||||||
|
/users/ishtob/macros_private.c
|
||||||
|
```
|
||||||
|
|
||||||
|
# Special mentions
|
||||||
|
|
||||||
|
special thanks to @drashna for helping me through quite a bit of these codes.
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
SRC += ishtob.c
|
||||||
|
ifneq ($(wildcard $(USER_PATH)/macros_private.c),"")
|
||||||
|
SRC += macros_private.c
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(NO_SECRETS)), yes)
|
||||||
|
OPT_DEFS += -DNO_SECRETS
|
||||||
|
endif
|
||||||
Reference in new issue
Block a user