ok
This commit is contained in:
parent
07d090db8b
commit
b3f638f491
20 changed files with 309 additions and 366 deletions
|
@ -39,7 +39,7 @@
|
|||
#----------------------------------------------------------------------------
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = atomic_lufa
|
||||
TARGET = planck_lufa
|
||||
|
||||
# Directory common source filess exist
|
||||
TOP_DIR = ../..
|
||||
|
@ -47,20 +47,50 @@ TOP_DIR = ../..
|
|||
# Directory keyboard dependent files exist
|
||||
TARGET_DIR = .
|
||||
|
||||
# project specific files
|
||||
|
||||
|
||||
# # project specific files
|
||||
ifdef COMMON
|
||||
|
||||
SRC = keymap_common.c \
|
||||
matrix.c \
|
||||
led.c
|
||||
led.c \
|
||||
backlight.c
|
||||
|
||||
ifdef KEYMAP
|
||||
SRC := keymap_$(KEYMAP).c $(SRC)
|
||||
SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC)
|
||||
else
|
||||
SRC := keymap_vlad.c $(SRC)
|
||||
SRC := common_keymaps/keymap_jack.c $(SRC)
|
||||
endif
|
||||
|
||||
ifdef MATRIX
|
||||
SRC := matrix_$(MATRIX).c $(SRC)
|
||||
else
|
||||
SRC := matrix_pcb.c $(SRC)
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
SRC = extended_keymap_common.c \
|
||||
analog.c \
|
||||
led.c \
|
||||
backlight.c
|
||||
|
||||
ifdef KEYMAP
|
||||
SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC)
|
||||
else
|
||||
SRC := extended_keymaps/extended_keymap_default.c $(SRC)
|
||||
endif
|
||||
|
||||
ifdef MATRIX
|
||||
SRC := matrix_$(MATRIX).c $(SRC)
|
||||
else
|
||||
SRC := matrix_pcb.c $(SRC)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
CONFIG_H = config.h
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
@ -119,9 +149,10 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
|||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
|
|
@ -55,7 +55,7 @@ SRC = keymap_common.c \
|
|||
ifdef KEYMAP
|
||||
SRC := keymap_$(KEYMAP).c $(SRC)
|
||||
else
|
||||
SRC := keymap_poker.c $(SRC)
|
||||
SRC := keymap_jack.c $(SRC)
|
||||
endif
|
||||
|
||||
CONFIG_H = config.h
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
GH60 keyboard firmware
|
||||
======================
|
||||
DIY compact keyboard designed and run by komar007 and Geekhack community.
|
||||
|
||||
- Both Rev.A and Rev.B PCB are supported by one firmware binary(issue #64)
|
||||
|
||||
## GH60 Resources
|
||||
- [KOMAR's project page](http://blog.komar.be/projects/gh60-programmable-keyboard/)
|
||||
- [Prototyping](http://geekhack.org/index.php?topic=34959.0)
|
||||
- [Rev.A PCB test](http://geekhack.org/index.php?topic=37570.0)
|
||||
- [Rev.B PCB test](http://geekhack.org/index.php?topic=50685.0)
|
||||
- [Group buy](http://geekhack.org/index.php?topic=41464.0)
|
||||
|
||||
|
||||
## Build
|
||||
Move to this directory then just run `make` like:
|
||||
|
||||
$ make
|
||||
|
||||
Use `make -f Makefile.pjrc` if you want to use PJRC stack but I find no reason to do so now.
|
||||
|
||||
|
||||
## Keymap
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in top README.md) and existent keymap files.
|
||||
|
||||
To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like:
|
||||
|
||||
$ make KEYMAP=[poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>]
|
||||
|
||||
|
||||
### 1 Poker
|
||||
[keymap_poker.c](keymap_poker.c) emulates original Poker layers
|
||||
while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys.
|
||||
|
||||
Fn + Esc = `
|
||||
Fn + {left, down, up, right} = {home, pgdown, pgup, end}
|
||||
|
||||
#### 1.0 Default layer
|
||||
,-----------------------------------------------------------.
|
||||
| `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
|
||||
|-----------------------------------------------------------|
|
||||
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
|
||||
|-----------------------------------------------------------|
|
||||
|Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||
|-----------------------------------------------------------|
|
||||
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||
|-----------------------------------------------------------|
|
||||
|Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl|
|
||||
`-----------------------------------------------------------'
|
||||
#### 1.1 Poker Fn layer
|
||||
,-----------------------------------------------------------.
|
||||
|Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |
|
||||
|-----------------------------------------------------------|
|
||||
| |FnQ| Up| | | | | | |Cal| |Hom|Ins| |
|
||||
|-----------------------------------------------------------|
|
||||
| |Lef|Dow|Rig| | |Psc|Slk|Pau| |Tsk|End| |
|
||||
|-----------------------------------------------------------|
|
||||
| |Del| |Web|Mut|VoU|VoD| |PgU|PgD|Del| Up |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | FnS |Fn |Left|Down|Righ|
|
||||
`-----------------------------------------------------------'
|
||||
|
||||
|
||||
### 2. Plain
|
||||
Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host.
|
||||
See [keymap_plain.c](keymap_plain.c) for detail.
|
||||
|
||||
#### 1.0 Plain Default layer
|
||||
,-----------------------------------------------------------.
|
||||
|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
|
||||
|-----------------------------------------------------------|
|
||||
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
|
||||
|-----------------------------------------------------------|
|
||||
|Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||
|-----------------------------------------------------------|
|
||||
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||
|-----------------------------------------------------------|
|
||||
|Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl|
|
||||
`-----------------------------------------------------------'
|
||||
|
||||
|
||||
### 3. Hasu
|
||||
This is my favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail.
|
||||
|
||||
|
||||
### 4. SpaceFN
|
||||
This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0).
|
||||
|
||||
#### 4.0 Default layer
|
||||
,-----------------------------------------------------------.
|
||||
|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
|
||||
|-----------------------------------------------------------|
|
||||
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
|
||||
|-----------------------------------------------------------|
|
||||
|Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||
|-----------------------------------------------------------|
|
||||
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||
|-----------------------------------------------------------|
|
||||
|Ctrl|Gui |Alt | Space/Fn |Alt |Gui |App |Ctrl|
|
||||
`-----------------------------------------------------------'
|
||||
#### 4.1 SpaceFN layer
|
||||
,-----------------------------------------------------------.
|
||||
|` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | | | | |Hom|Up |End|Psc|Slk|Pau|Ins |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | | | |PgU|Lef|Dow|Rig| | | |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | | |Spc|PgD|` |~ | | | |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | Fn | | | | |
|
||||
`-----------------------------------------------------------'
|
||||
|
||||
|
||||
### 5. HHKB
|
||||
[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers.
|
||||
#### 5.0: Default layer
|
||||
,-----------------------------------------------------------.
|
||||
|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
|
||||
|-----------------------------------------------------------|
|
||||
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc |
|
||||
|-----------------------------------------------------------|
|
||||
|Ctrl | A| S| D| F| G| H| J| K| L|Fn3| '|Return |
|
||||
|-----------------------------------------------------------|
|
||||
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn |
|
||||
|-----------------------------------------------------------|
|
||||
| |Gui |Alt | Space | |Alt |Gui | |
|
||||
`-----------------------------------------------------------'
|
||||
#### 5.1: HHKB Fn layer
|
||||
,-----------------------------------------------------------.
|
||||
|Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
|
||||
|-----------------------------------------------------------|
|
||||
|Caps | | | | | | | |Psc|Slk|Pus|Up | | |
|
||||
|-----------------------------------------------------------|
|
||||
| |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | | | | +| -|End|PgD|Dow| | |
|
||||
|-----------------------------------------------------------|
|
||||
| | | | | | | | |
|
||||
`-----------------------------------------------------------'
|
||||
|
|
@ -24,8 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Ortholinear Keyboards
|
||||
#define PRODUCT Atomic Keyboard
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for Atomic
|
||||
#define PRODUCT Atomic
|
||||
#define DESCRIPTION A compact ortholinear keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
|
@ -34,6 +34,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
/* NOTE: this is the max value of 0..BACKLIGHT_LEVELS so really 16 levels. */
|
||||
#define BACKLIGHT_LEVELS 15
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
|
|
|
@ -33,55 +33,97 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
||||
extern const uint16_t fn_actions[];
|
||||
|
||||
// JCK: Semi-Standard layout
|
||||
#define KEYMAP_JCK( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, K3E, \
|
||||
K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E \
|
||||
|
||||
// MIT Layout
|
||||
/*
|
||||
* ,-----------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------'
|
||||
*/
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \
|
||||
{ KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \
|
||||
}
|
||||
|
||||
// ASK: Short Space layout
|
||||
#define KEYMAP_ASK_MESSY( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, K3E, \
|
||||
K40, K41, K43, K44, K46, K48, K49, K4A, K4B, K4C, K4D, K4E \
|
||||
// Grid Layout
|
||||
/*
|
||||
* ,-----------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------'
|
||||
*/
|
||||
#define KEYMAP_GRID( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \
|
||||
{ KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_##K44, KC_NO, KC_##K46, KC_NO, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \
|
||||
}
|
||||
|
||||
#define KEYMAP_ASK( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \
|
||||
K40, K41, K43, K44, K46, K47, K48, K4A, K4B, K4C, K4D, K4E \
|
||||
#define KEYMAP_REVERSE( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_NO, KC_##K2E }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_##K3D, KC_##K3E }, \
|
||||
{ KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_##K44, KC_NO, KC_##K46, KC_##K47, KC_##K48, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \
|
||||
{ KC_##K0B, KC_##K0A, KC_##K09, KC_##K08, KC_##K07, KC_##K06, KC_##K05, KC_##K04, KC_##K03, KC_##K02, KC_##K01, KC_##K00 }, \
|
||||
{ KC_##K1B, KC_##K1A, KC_##K19, KC_##K18, KC_##K17, KC_##K16, KC_##K15, KC_##K14, KC_##K13, KC_##K12, KC_##K11, KC_##K10 }, \
|
||||
{ KC_##K2B, KC_##K2A, KC_##K29, KC_##K28, KC_##K27, KC_##K26, KC_##K25, KC_##K24, KC_##K23, KC_##K22, KC_##K21, KC_##K20 }, \
|
||||
{ KC_##K3B, KC_##K3A, KC_##K39, KC_##K38, KC_##K37, KC_##K35, KC_##K35, KC_##K34, KC_##K33, KC_##K32, KC_##K31, KC_##K30 }, \
|
||||
}
|
||||
|
||||
#define KEYMAP_AND_REVERSE(args...) KEYMAP(args), KEYMAP_REVERSE(args)
|
||||
|
||||
// MLO: Semi-Grid layout
|
||||
#define KEYMAP_SWAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \
|
||||
) { \
|
||||
{ KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05 }, \
|
||||
{ KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15 }, \
|
||||
{ KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25 }, \
|
||||
{ KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K35, KC_##K35, KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34 }, \
|
||||
}
|
||||
|
||||
// KLN: Grid layout
|
||||
#define KEYMAP_AND_SWAP(args...) KEYMAP(args), KEYMAP_SWAP(args)
|
||||
|
||||
/*
|
||||
Keymap for the Planck 48 key variant.
|
||||
*/
|
||||
#define KEYMAP_48( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B }, \
|
||||
}
|
||||
|
||||
// PKR: Standard layout
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#include "keymap_common.h"
|
||||
|
||||
// JCK: Semi-Standard layout
|
||||
|
||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* 0: qwerty */
|
||||
[0] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, \
|
||||
ESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, MPLY, \
|
||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \
|
||||
LCTL, LALT, LGUI, SPC, FN1, LEFT, DOWN, UP, RGHT),
|
||||
[1] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
|
||||
TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, DEL, \
|
||||
ESC, A, R, S, T, D, H, N, E, I, O, QUOT, ENT, MPLY, \
|
||||
LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \
|
||||
LCTL, LALT, LGUI, SPC, FN1, LEFT, DOWN, UP, RGHT),
|
||||
[2] = KEYMAP_JCK(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \
|
||||
TAB, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, BSLS, DEL, \
|
||||
ESC, FN3, FN4, TRNS, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, ENT, MPLY, \
|
||||
LSFT, FN9, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \
|
||||
LCTL, LALT, LGUI, SPC, TRNS, MNXT, VOLD, VOLU, MPLY),
|
||||
};
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay
|
||||
[3] = ACTION_DEFAULT_LAYER_SET(0),
|
||||
[4] = ACTION_DEFAULT_LAYER_SET(1),
|
||||
|
||||
[9] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE),
|
||||
|
||||
[10] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
|
||||
[11] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
|
||||
[12] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
|
||||
[13] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
|
||||
[14] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
|
||||
[15] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
|
||||
[16] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
|
||||
[17] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
|
||||
[18] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
|
||||
[19] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
|
||||
[20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS),
|
||||
[21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL),
|
||||
[22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV),
|
||||
[23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC),
|
||||
[24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC),
|
||||
[28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
#include "keymap_common.h"
|
||||
|
||||
// JCK: Semi-Standard layout
|
||||
|
||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* 0: qwerty */
|
||||
[0] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, PSCR, \
|
||||
CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, INS, \
|
||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, DEL, \
|
||||
LCTL, LGUI, LALT, SPC, RALT, RCTL, LEFT, DOWN, RGHT)
|
||||
};
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#include "keymap_common.h"
|
||||
|
||||
// JCK: Semi-Standard layout
|
||||
|
||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* 0: qwerty */
|
||||
[0] = KEYMAP_ASK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, \
|
||||
CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, VOLU, \
|
||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, VOLD, \
|
||||
LCTL, LGUI, LALT, LGUI, SPC, RGUI, RALT, RGUI, RCTL, LEFT, DOWN, RGHT)
|
||||
};
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
|
@ -22,4 +22,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
// // Using PE6 Caps Lock LED
|
||||
// if (usb_led & (1<<USB_LED_CAPS_LOCK))
|
||||
// {
|
||||
// // Output high.
|
||||
// DDRE |= (1<<6);
|
||||
// PORTE |= (1<<6);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Output low.
|
||||
// DDRE &= ~(1<<6);
|
||||
// PORTE &= ~(1<<6);
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2012 Jun Wako
|
||||
Generated by planckkeyboard.com (2014 Jack Humbert)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -22,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "action_layer.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
|
@ -43,7 +43,6 @@ static void init_cols(void);
|
|||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
{
|
||||
|
@ -56,7 +55,6 @@ uint8_t matrix_cols(void)
|
|||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
// initialize row and col
|
||||
|
@ -96,7 +94,6 @@ uint8_t matrix_scan(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -109,7 +106,7 @@ bool matrix_is_modified(void)
|
|||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
return (matrix[row] & ((matrix_row_t)1<col));
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -137,51 +134,39 @@ uint8_t matrix_key_count(void)
|
|||
return count;
|
||||
}
|
||||
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
* pin: F0 F1 F4 F5 F6 F7 B6 B5 B4 D7 D5 D4
|
||||
*/
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
DDRC &= ~(1<<6 | 1<<7);
|
||||
PORTC |= (1<<6 | 1<<7);
|
||||
DDRD &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7);
|
||||
PORTD |= (1<<4 | 1<<5 | 1<<6 | 1<<7);
|
||||
DDRB &= ~(1<<4 | 1<<5 | 1<<6);
|
||||
PORTB |= (1<<4 | 1<<5 | 1<<6);
|
||||
DDRB &= ~(1<<6 | 1<<5 | 1<<4);
|
||||
PORTB |= (1<<6 | 1<<5 | 1<<4);
|
||||
DDRD &= ~(1<<7 | 1<<6 | 1<<4);
|
||||
PORTD |= (1<<7 | 1<<6 | 1<<4);
|
||||
DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
|
||||
PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
|
||||
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(void)
|
||||
{
|
||||
return (PINC&(1<<6) ? 0 : (1<< 0)) |
|
||||
(PINC&(1<<7) ? 0 : (1<< 1)) |
|
||||
(PIND&(1<<5) ? 0 : (1<< 2)) |
|
||||
(PIND&(1<<4) ? 0 : (1<< 3)) |
|
||||
(PIND&(1<<6) ? 0 : (1<< 4)) |
|
||||
(PIND&(1<<7) ? 0 : (1<< 5)) |
|
||||
(PINB&(1<<4) ? 0 : (1<< 6)) |
|
||||
(PINB&(1<<5) ? 0 : (1<< 7)) |
|
||||
(PINB&(1<<6) ? 0 : (1<< 8)) |
|
||||
(PINF&(1<<7) ? 0 : (1<< 9)) |
|
||||
(PINF&(1<<6) ? 0 : (1<<10)) |
|
||||
(PINF&(1<<5) ? 0 : (1<<11)) |
|
||||
(PINF&(1<<4) ? 0 : (1<<12)) |
|
||||
(PINF&(1<<1) ? 0 : (1<<13)) |
|
||||
(PINF&(1<<0) ? 0 : (1<<14));
|
||||
return (PIND&(1<<4) ? 0 : (1<<0)) |
|
||||
(PIND&(1<<6) ? 0 : (1<<1)) |
|
||||
(PIND&(1<<7) ? 0 : (1<<2)) |
|
||||
(PINB&(1<<4) ? 0 : (1<<3)) |
|
||||
(PINB&(1<<5) ? 0 : (1<<4)) |
|
||||
(PINB&(1<<6) ? 0 : (1<<5)) |
|
||||
(PINF&(1<<7) ? 0 : (1<<6)) |
|
||||
(PINF&(1<<6) ? 0 : (1<<7)) |
|
||||
(PINF&(1<<5) ? 0 : (1<<8)) |
|
||||
(PINF&(1<<4) ? 0 : (1<<9)) |
|
||||
(PINF&(1<<1) ? 0 : (1<<10)) |
|
||||
(PINF&(1<<0) ? 0 : (1<<11));
|
||||
|
||||
}
|
||||
|
||||
/* Row pin configuration
|
||||
* row: 0 1 2 3
|
||||
* pin: B0 B1 B2 B3
|
||||
*/
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
// Hi-Z(DDR:0, PORT:0) to unselect
|
||||
DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
|
||||
PORTB |= (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
|
||||
DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3);
|
||||
PORTB |= (1<<0 | 1<<1 | 1<<2 | 1<<3);
|
||||
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
|
@ -203,9 +188,6 @@ static void select_row(uint8_t row)
|
|||
DDRB |= (1<<3);
|
||||
PORTB &= ~(1<<3);
|
||||
break;
|
||||
case 4:
|
||||
DDRB |= (1<<7);
|
||||
PORTB &= ~(1<<7);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ TARGET_DIR = .
|
|||
ifdef COMMON
|
||||
|
||||
SRC = keymap_common.c \
|
||||
matrix_pcb.c \
|
||||
led.c \
|
||||
backlight.c
|
||||
backlight.c \
|
||||
beeps.c
|
||||
|
||||
ifdef KEYMAP
|
||||
SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC)
|
||||
|
@ -63,12 +63,19 @@ else
|
|||
SRC := common_keymaps/keymap_jack.c $(SRC)
|
||||
endif
|
||||
|
||||
ifdef MATRIX
|
||||
SRC := matrix_$(MATRIX).c $(SRC)
|
||||
else
|
||||
SRC := matrix_pcb.c $(SRC)
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
SRC = extended_keymap_common.c \
|
||||
matrix_pcb.c \
|
||||
analog.c \
|
||||
led.c \
|
||||
backlight.c
|
||||
backlight.c \
|
||||
beeps.c
|
||||
|
||||
ifdef KEYMAP
|
||||
SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC)
|
||||
|
@ -76,6 +83,12 @@ else
|
|||
SRC := extended_keymaps/extended_keymap_default.c $(SRC)
|
||||
endif
|
||||
|
||||
ifdef MATRIX
|
||||
SRC := matrix_$(MATRIX).c $(SRC)
|
||||
else
|
||||
SRC := matrix_pcb.c $(SRC)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
CONFIG_H = config.h
|
||||
|
|
|
@ -8,42 +8,42 @@ void backlight_init_ports()
|
|||
{
|
||||
|
||||
// Setup PB7 as output and output low.
|
||||
DDRB |= (1<<7);
|
||||
PORTB &= ~(1<<7);
|
||||
// DDRB |= (1<<7);
|
||||
// PORTB &= ~(1<<7);
|
||||
|
||||
// Use full 16-bit resolution.
|
||||
ICR1 = 0xFFFF;
|
||||
// // Use full 16-bit resolution.
|
||||
// ICR1 = 0xFFFF;
|
||||
|
||||
// I could write a wall of text here to explain... but TL;DW
|
||||
// Go read the ATmega32u4 datasheet.
|
||||
// And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
|
||||
// // I could write a wall of text here to explain... but TL;DW
|
||||
// // Go read the ATmega32u4 datasheet.
|
||||
// // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
|
||||
|
||||
// Pin PB7 = OCR1C (Timer 1, Channel C)
|
||||
// Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
|
||||
// (i.e. start high, go low when counter matches.)
|
||||
// WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
|
||||
// Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
|
||||
// // Pin PB7 = OCR1C (Timer 1, Channel C)
|
||||
// // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
|
||||
// // (i.e. start high, go low when counter matches.)
|
||||
// // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
|
||||
// // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
|
||||
|
||||
TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010;
|
||||
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
|
||||
// TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010;
|
||||
// TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
|
||||
|
||||
backlight_init();
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level)
|
||||
{
|
||||
if ( level == 0 )
|
||||
{
|
||||
// Turn off PWM control on PB7, revert to output low.
|
||||
TCCR1A &= ~(_BV(COM1C1));
|
||||
// CHANNEL = level << OFFSET | 0x0FFF;
|
||||
CHANNEL = ((1 << level) - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Turn on PWM control of PB7
|
||||
TCCR1A |= _BV(COM1C1);
|
||||
// CHANNEL = level << OFFSET | 0x0FFF;
|
||||
CHANNEL = ((1 << level) - 1);
|
||||
}
|
||||
// if ( level == 0 )
|
||||
// {
|
||||
// // Turn off PWM control on PB7, revert to output low.
|
||||
// TCCR1A &= ~(_BV(COM1C1));
|
||||
// // CHANNEL = level << OFFSET | 0x0FFF;
|
||||
// CHANNEL = ((1 << level) - 1);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Turn on PWM control of PB7
|
||||
// TCCR1A |= _BV(COM1C1);
|
||||
// // CHANNEL = level << OFFSET | 0x0FFF;
|
||||
// CHANNEL = ((1 << level) - 1);
|
||||
// }
|
||||
}
|
|
@ -59,10 +59,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "debug.h"
|
||||
#include "backlight.h"
|
||||
|
||||
|
||||
static action_t keycode_to_action(uint16_t keycode);
|
||||
|
||||
|
||||
|
@ -70,6 +69,9 @@ action_t action_for_key(uint8_t layer, keypos_t key)
|
|||
} else if (keycode == RESET) {
|
||||
bootloader_jump();
|
||||
return;
|
||||
} else if (keycode > RESET) {
|
||||
// MIDI
|
||||
return;
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
|
|
|
@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "action_macro.h"
|
||||
#include "report.h"
|
||||
#include "host.h"
|
||||
#include "print.h"
|
||||
// #include "print.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifdef BOOTMAGIC_ENABLE
|
||||
|
@ -174,4 +174,6 @@ extern const uint16_t fn_actions[];
|
|||
|
||||
#define RESET 0x5000
|
||||
|
||||
#define MIDI(n) n | 0x6000
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
||||
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT},
|
||||
{BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
// Space is repeated to accommadate for both spacebar wiring positions
|
||||
},
|
||||
[1] = { /* Colemak */
|
||||
|
@ -16,19 +16,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
},
|
||||
[2] = { /* RAISE */
|
||||
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
|
||||
{KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||
{KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS},
|
||||
{KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||
{KC_TRNS, KC_F11, KC_F12, 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, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
},
|
||||
[3] = { /* LOWER */
|
||||
{S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC},
|
||||
{KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)},
|
||||
{KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)},
|
||||
{KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS},
|
||||
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_MOMENTARY(2), // to RAISE
|
||||
[2] = ACTION_LAYER_MOMENTARY(3), // to LOWER
|
||||
|
@ -43,7 +42,12 @@ 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:
|
||||
return MACRODOWN(T(CM_T), END);
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
ACTION_BACKLIGHT_STEP();
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
|
|
|
@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "action_macro.h"
|
||||
#include "report.h"
|
||||
#include "host.h"
|
||||
#include "print.h"
|
||||
// #include "print.h"
|
||||
#include "debug.h"
|
||||
#include "keymap.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "print.h"
|
||||
// #include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
|
|
|
@ -23,10 +23,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "action_layer.h"
|
||||
#include "print.h"
|
||||
// #include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "analog.h"
|
||||
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
|
@ -40,9 +41,14 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
|||
|
||||
static matrix_row_t read_cols(void);
|
||||
static void init_cols(void);
|
||||
static void init_encoder(void);
|
||||
static void init_pot(void);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
int16_t analogRead(uint8_t pin);
|
||||
uint8_t state;
|
||||
int32_t position;
|
||||
int16_t value;
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
|
@ -61,6 +67,8 @@ void matrix_init(void)
|
|||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
init_encoder();
|
||||
init_pot();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
|
@ -69,6 +77,50 @@ void matrix_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void init_encoder(void)
|
||||
{
|
||||
DDRC &= ~(1<<6 | 1<<7);
|
||||
PORTC |= (1<<6 | 1<<7);
|
||||
|
||||
uint8_t s = 0;
|
||||
_delay_ms(1);
|
||||
if (PINC&(1<<6)) s |= 1;
|
||||
if (PINC&(1<<7)) s |= 2;
|
||||
state = s;
|
||||
position = 0;
|
||||
}
|
||||
|
||||
void read_encoder(void)
|
||||
{
|
||||
uint8_t s = state & 3;
|
||||
if (PINC&(1<<6)) s |= 4;
|
||||
if (PINC&(1<<7)) s |= 8;
|
||||
state = (s >> 2);
|
||||
switch (s) {
|
||||
case 1: case 7: case 8: case 14:
|
||||
position++;
|
||||
break;
|
||||
case 2: case 4: case 11: case 13:
|
||||
position--;
|
||||
break;
|
||||
case 3: case 12:
|
||||
position += 2;
|
||||
break;
|
||||
case 6: case 9:
|
||||
position -= 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define HEX(n) (((n) < 10) ? ((n) + '0') : ((n) + 'A' - 10))
|
||||
|
||||
static void init_pot(void)
|
||||
{
|
||||
// DDRD &= ~(1<<4);
|
||||
// PORTD |= (1<<4);
|
||||
// DIDR2 = (1<<0);
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
|
@ -95,6 +147,21 @@ uint8_t matrix_scan(void)
|
|||
}
|
||||
}
|
||||
|
||||
read_encoder();
|
||||
if (position >= 2) {
|
||||
register_code(KC_AUDIO_VOL_UP);
|
||||
unregister_code(KC_AUDIO_VOL_UP);
|
||||
position = 0;
|
||||
} else if (position <= -2) {
|
||||
register_code(KC_AUDIO_VOL_DOWN);
|
||||
unregister_code(KC_AUDIO_VOL_DOWN);
|
||||
position = 0;
|
||||
}
|
||||
|
||||
// uint16_t val = analogRead(11);
|
||||
|
||||
// debug("analogRead: "); debug_hex(val); debug("\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "print.h"
|
||||
// #include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "backlight.h" // TODO fix this dependency
|
||||
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 10
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue