Skip to content

Commit 47dcec2

Browse files
author
Chris Gerber
committedFeb 16, 2016
Add support for Atreus running on A-Star
1 parent 0206976 commit 47dcec2

File tree

6 files changed

+106
-19
lines changed

6 files changed

+106
-19
lines changed
 

‎keyboard/atreus/Makefile

+15-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ else
5858
SRC := keymaps/keymap_default.c $(SRC)
5959
endif
6060

61+
ifdef ASTAR
62+
OPT_DEFS += -DATREUS_ASTAR
63+
endif
64+
6165
CONFIG_H = config.h
6266

6367
# MCU name
@@ -114,8 +118,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
114118
# comment out to disable the options.
115119
#
116120
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
117-
#MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
118-
#EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
121+
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
122+
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
119123
CONSOLE_ENABLE = yes # Console for debug(+400)
120124
COMMAND_ENABLE = yes # Commands for debug and configuration
121125
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
@@ -137,3 +141,12 @@ VPATH += $(TMK_DIR)
137141

138142
include $(TOP_DIR)/quantum/quantum.mk
139143

144+
USB ?= /dev/cu.usbmodem1411
145+
146+
upload: build
147+
ifdef ASTAR
148+
while [ ! -r $(USB) ]; do sleep 1; done; \
149+
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
150+
else
151+
teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
152+
endif

‎keyboard/atreus/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
atreus keyboard firmware
22
======================
33

4-
## Note
5-
6-
This is for the Teensy2 hand wired boards only.
7-
84
## Quantum MK Firmware
95

106
You have access to a bunch of goodies! Check out the Makefile to enable/disable some of the features. Uncomment the `#` to enable them. Setting them to `no` does nothing and will only confuse future you.
@@ -14,6 +10,12 @@ You have access to a bunch of goodies! Check out the Makefile to enable/disable
1410
# UNICODE_ENABLE = yes # Unicode support - this is commented out, just as an example. You have to use #, not //
1511
BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
1612

13+
## Atreus specific information
14+
15+
These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2, one powered by an A-Star. This repository currently assumes that you have a Teensy 2 powered Atreus. If you are using an A-Star, specify that by adding `ASTAR=yes` to your `make` commands.
16+
17+
If you are coming from the [atreus-firmware](https://github.com/technomancy/atreus-firmware), we've also brought forward the `make upload` command for you to use.
18+
1719
## Quick aliases to common actions
1820

1921
Your keymap can include shortcuts to common operations (called "function actions" in tmk).

‎keyboard/atreus/atreus.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@
77
#include <stddef.h>
88

99
// This a shortcut to help you visually see your layout.
10-
// The following is an example using the Planck MIT layout
1110
// The first section contains all of the arguements
1211
// The second converts the arguments into a two-dimensional array
1312
#define KEYMAP( \
14-
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
15-
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
16-
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
17-
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
13+
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
14+
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
15+
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, \
16+
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
1817
) \
1918
{ \
20-
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
21-
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
22-
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
23-
{ k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \
24-
}
19+
{ k00, k01, k02, k03, k04, KC_NO, k05, k06, k07, k08, k09 }, \
20+
{ k10, k11, k12, k13, k14, KC_NO, k15, k16, k17, k18, k19 }, \
21+
{ k20, k21, k22, k23, k24, k35, k25, k26, k27, k28, k29 }, \
22+
{ k2a, k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a } \
23+
}
2524

2625
void * matrix_init_user(void);
2726
void * matrix_scan_user(void);

‎keyboard/atreus/config.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3333
#define MATRIX_ROWS 4
3434
#define MATRIX_COLS 11
3535

36-
// Planck PCB default pin-out
3736
// Change this to how you wired your keyboard
3837
// COLS: Left to right, ROWS: Top to bottom
39-
#define COLS (int []){ F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0}
40-
#define ROWS (int []){ D0, D1, D2, D3 }
38+
#ifdef ATREUS_ASTAR
39+
#define COLS (int []){ B7, D6, F7, F6, B6, D4, E6, B4, B5, C6, D7 }
40+
#define ROWS (int []){ D0, D1, D3, D2 }
41+
#else
42+
#define COLS (int []){ F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0}
43+
#define ROWS (int []){ D0, D1, D2, D3 }
44+
#endif
4145

4246
/* COL2ROW or ROW2COL */
4347
#define DIODE_DIRECTION COL2ROW

‎keyboard/atreus/keymaps/keymap_gerb.c

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// This is the personal keymap of Chris Gerber (@gerbercj). I haven't worked out the kinks
2+
// with the Colemak and Dvorak support yet, but everything else works nicely.
3+
4+
#include "atreus.h"
5+
6+
// Each layer gets a name for readability, which is then used in the keymap matrix below.
7+
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8+
// Layer names don't all need to be of the same length, obviously, and you can also skip them
9+
// entirely and just use numbers.
10+
#define _QW 0
11+
#define _CM 1
12+
#define _DV 2
13+
#define _L1 3
14+
#define _L2 4
15+
16+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17+
[_QW] = { /* Qwerty */
18+
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P },
19+
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
20+
{KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
21+
{KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_RCTL, KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT }
22+
},
23+
[_CM] = { /* Colemak */
24+
{KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
25+
{KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O },
26+
{KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH},
27+
{KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_RCTL, KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT }
28+
},
29+
[_DV] = { /* Dvorak */
30+
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L },
31+
{KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S },
32+
{KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LALT, KC_B, KC_M, KC_W, KC_V, KC_Z },
33+
{KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_RCTL, KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_ENT }
34+
},
35+
[_L1] = { /* LAYER 1 */
36+
{KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_VOLU, KC_7, KC_8, KC_9, KC_LBRC},
37+
{KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_VOLD, KC_4, KC_5, KC_6, KC_RBRC},
38+
{KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, KC_MINS, KC_LALT, KC_MUTE, KC_1, KC_2, KC_3, KC_BSLS},
39+
{TG(_L2), KC_APP, KC_LGUI, KC_LSFT, KC_BSPC, KC_RCTL, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL }
40+
},
41+
[_L2] = { /* LAYER 2 */
42+
{KC_TRNS, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, KC_NO, DF(_QW), KC_F7, KC_F8, KC_F9, KC_F10 },
43+
{KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_NO, DF(_CM), KC_F6, KC_F5, KC_F6, KC_F11 },
44+
{KC_BTN4, KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN4, KC_LALT, DF(_DV), KC_F1, KC_F2, KC_F3, KC_F12 },
45+
{KC_TRNS, KC_TRNS, KC_LGUI, KC_LSFT, KC_BSPC, KC_RCTL, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, RESET }
46+
}
47+
};
48+
49+
const uint16_t PROGMEM fn_actions[] = {
50+
51+
};
52+
53+
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
54+
{
55+
// MACRODOWN only works in this function
56+
switch(id) {
57+
case 0:
58+
if (record->event.pressed) {
59+
register_code(KC_RSFT);
60+
} else {
61+
unregister_code(KC_RSFT);
62+
}
63+
break;
64+
}
65+
return MACRO_NONE;
66+
};

‎quantum/keymap_common.c

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ action_t action_for_key(uint8_t layer, keypos_t key)
9191
play_notes(&goodbye, 5, false);
9292
#endif
9393
_delay_ms(250);
94+
#ifdef ATREUS_ASTAR
95+
*(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
96+
#endif
9497
bootloader_jump();
9598
return;
9699
} else if (keycode == DEBUG) { // DEBUG is 0x5001

0 commit comments

Comments
 (0)
Please sign in to comment.