aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/atreus50/Makefile3
-rw-r--r--keyboards/atreus50/atreus50.c10
-rw-r--r--keyboards/atreus50/atreus50.h36
-rw-r--r--keyboards/atreus50/config.h163
-rw-r--r--keyboards/atreus50/keymaps/default/Makefile6
-rw-r--r--keyboards/atreus50/keymaps/default/keymap.c270
-rw-r--r--keyboards/atreus50/keymaps/default/readme.md1
-rw-r--r--keyboards/atreus50/readme.md25
-rw-r--r--keyboards/atreus50/rules.mk81
9 files changed, 595 insertions, 0 deletions
diff --git a/keyboards/atreus50/Makefile b/keyboards/atreus50/Makefile
new file mode 100644
index 000000000..57b2ef62e
--- /dev/null
+++ b/keyboards/atreus50/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif
diff --git a/keyboards/atreus50/atreus50.c b/keyboards/atreus50/atreus50.c
new file mode 100644
index 000000000..0ec63216f
--- /dev/null
+++ b/keyboards/atreus50/atreus50.c
@@ -0,0 +1,10 @@
1#include "atreus50.h"
2
3void matrix_init_kb(void) {
4
5 // Turn status LED on
6 //DDRE |= (1<<6);
7 PORTE |= (1<<6);
8
9 matrix_init_user();
10}; \ No newline at end of file
diff --git a/keyboards/atreus50/atreus50.h b/keyboards/atreus50/atreus50.h
new file mode 100644
index 000000000..de06f255e
--- /dev/null
+++ b/keyboards/atreus50/atreus50.h
@@ -0,0 +1,36 @@
1#ifndef ATREUS50_H
2#define ATREUS50_H
3
4#include "quantum.h"
5
6// The first section contains all of the arguements
7// The second converts the arguments into a two-dimensional array
8#define KEYMAP( \
9 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
10 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
11 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
12 k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \
13) \
14{ \
15 { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
16 { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
17 { k20, k21, k22, k23, k24, k25, km0, k26, k27, k28, k29, k2a, k2b }, \
18 { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \
19}
20
21#define COMPACT_KEYMAP( \
22 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
23 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
24 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
25 k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \
26) \
27{ \
28 { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \
29 { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \
30 { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##km0, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \
31 { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##km1, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \
32}
33
34#define KC_ KC_TRNS
35
36#endif
diff --git a/keyboards/atreus50/config.h b/keyboards/atreus50/config.h
new file mode 100644
index 000000000..dedcc8cae
--- /dev/null
+++ b/keyboards/atreus50/config.h
@@ -0,0 +1,163 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xBB80
25#define PRODUCT_ID 0x040D
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Hexwire
28#define PRODUCT Atreus 50 Keyboard
29#define DESCRIPTION Atreus layout with extra column
30
31/* key matrix size */
32#define MATRIX_ROWS 4
33#define MATRIX_COLS 13
34
35/* Planck PCB default pin-out */
36#define MATRIX_ROW_PINS { D3, D2, D1, D0 }
37#define MATRIX_COL_PINS { D4, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 }
38#define UNUSED_PINS
39
40/* COL2ROW or ROW2COL */
41#define DIODE_DIRECTION COL2ROW
42
43// #define BACKLIGHT_PIN B7
44// #define BACKLIGHT_BREATHING
45// #define BACKLIGHT_LEVELS 3
46
47
48/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
49#define DEBOUNCING_DELAY 5
50
51/* define if matrix has ghost (lacks anti-ghosting diodes) */
52//#define MATRIX_HAS_GHOST
53
54/* number of backlight levels */
55
56/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
57#define LOCKING_SUPPORT_ENABLE
58/* Locking resynchronize hack */
59#define LOCKING_RESYNC_ENABLE
60
61
62/* ws2812 RGB LED */
63#define RGB_DI_PIN C6
64#define RGBLIGHT_TIMER
65#define RGBLED_NUM 12 // Number of LEDs
66#define RGBLIGHT_HUE_STEP 10
67#define RGBLIGHT_SAT_STEP 17
68#define RGBLIGHT_VAL_STEP 17
69
70
71/*
72 * Force NKRO
73 *
74 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
75 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
76 * makefile for this to work.)
77 *
78 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
79 * until the next keyboard reset.
80 *
81 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
82 * fully operational during normal computer usage.
83 *
84 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
85 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
86 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
87 * power-up.
88 *
89 */
90//#define FORCE_NKRO
91
92/*
93 * Magic Key Options
94 *
95 * Magic keys are hotkey commands that allow control over firmware functions of
96 * the keyboard. They are best used in combination with the HID Listen program,
97 * found here: https://www.pjrc.com/teensy/hid_listen.html
98 *
99 * The options below allow the magic key functionality to be changed. This is
100 * useful if your keyboard/keypad is missing keys and you want magic key support.
101 *
102 */
103
104/* key combination for magic key command */
105#define IS_COMMAND() ( \
106 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
107)
108
109/* control how magic key switches layers */
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
113
114/* override magic key keymap */
115//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
117//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
118//#define MAGIC_KEY_HELP1 H
119//#define MAGIC_KEY_HELP2 SLASH
120//#define MAGIC_KEY_DEBUG D
121//#define MAGIC_KEY_DEBUG_MATRIX X
122//#define MAGIC_KEY_DEBUG_KBD K
123//#define MAGIC_KEY_DEBUG_MOUSE M
124//#define MAGIC_KEY_VERSION V
125//#define MAGIC_KEY_STATUS S
126//#define MAGIC_KEY_CONSOLE C
127//#define MAGIC_KEY_LAYER0_ALT1 ESC
128//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
129//#define MAGIC_KEY_LAYER0 0
130//#define MAGIC_KEY_LAYER1 1
131//#define MAGIC_KEY_LAYER2 2
132//#define MAGIC_KEY_LAYER3 3
133//#define MAGIC_KEY_LAYER4 4
134//#define MAGIC_KEY_LAYER5 5
135//#define MAGIC_KEY_LAYER6 6
136//#define MAGIC_KEY_LAYER7 7
137//#define MAGIC_KEY_LAYER8 8
138//#define MAGIC_KEY_LAYER9 9
139//#define MAGIC_KEY_BOOTLOADER PAUSE
140//#define MAGIC_KEY_LOCK CAPS
141//#define MAGIC_KEY_EEPROM E
142//#define MAGIC_KEY_NKRO N
143//#define MAGIC_KEY_SLEEP_LED Z
144
145/*
146 * Feature disable options
147 * These options are also useful to firmware size reduction.
148 */
149
150/* disable debug print */
151//#define NO_DEBUG
152
153/* disable print */
154//#define NO_PRINT
155
156/* disable action features */
157//#define NO_ACTION_LAYER
158//#define NO_ACTION_TAPPING
159//#define NO_ACTION_ONESHOT
160//#define NO_ACTION_MACRO
161//#define NO_ACTION_FUNCTION
162
163#endif
diff --git a/keyboards/atreus50/keymaps/default/Makefile b/keyboards/atreus50/keymaps/default/Makefile
new file mode 100644
index 000000000..e8556d0d6
--- /dev/null
+++ b/keyboards/atreus50/keymaps/default/Makefile
@@ -0,0 +1,6 @@
1RGBLIGHT_ENABLE = no
2AUDIO_ENABLE = yes
3
4ifndef QUANTUM_DIR
5 include ../../../../Makefile
6endif \ No newline at end of file
diff --git a/keyboards/atreus50/keymaps/default/keymap.c b/keyboards/atreus50/keymaps/default/keymap.c
new file mode 100644
index 000000000..0a77613c5
--- /dev/null
+++ b/keyboards/atreus50/keymaps/default/keymap.c
@@ -0,0 +1,270 @@
1#include "atreus50.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#ifdef AUDIO_ENABLE
5 #include "audio.h"
6#endif
7
8// Each layer gets a name for readability, which is then used in the keymap matrix below.
9// The underscores don't mean anything - you can have a layer called STUFF or any other name.
10// Layer names don't all need to be of the same length, obviously, and you can also skip them
11// entirely and just use numbers.
12#define _QWERTY 0
13#define _COLEMAK 1
14#define _DVORAK 2
15#define _LOWER 3
16#define _RAISE 4
17#define _MOVEMENT 5
18#define _ADJUST 16
19
20enum preonic_keycodes {
21 QWERTY = SAFE_RANGE,
22 COLEMAK,
23 DVORAK,
24 LOWER,
25 RAISE,
26 MOVEMENT,
27 BACKLIT
28};
29
30// Fillers to make layering more clear
31#define _______ KC_TRNS
32#define XXXXXXX KC_NO
33
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35
36/* Qwerty
37 * ,-----------------------------------------------------------------------------------.
38 * | Tab | Q | W | E | R | T | Y | U | I | O | P | - |
39 * |------+------+------+------+------+-------------+------+------+------+------+------|
40 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
41 * |------+------+------+------+------+------|------+------+------+------+------+------|
42 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
43 * |------+------+------+------+------+------+------+------+------+------+------+------|
44 * | ` | Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right |
45 * `-----------------------------------------------------------------------------------'
46 */
47[_QWERTY] = KEYMAP( \
48 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
49 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
50 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
51 KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
52),
53
54/* Colemak
55 * |------+------+------+------+------+------+------+------+------+------+------+------|
56 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - |
57 * |------+------+------+------+------+-------------+------+------+------+------+------|
58 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
59 * |------+------+------+------+------+------|------+------+------+------+------+------|
60 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
61 * |------+------+------+------+------+------+------+------+------+------+------+------|
62 * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
63 * `-----------------------------------------------------------------------------------'
64 */
65[_COLEMAK] = KEYMAP( \
66 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, \
67 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
68 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
69 KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
70),
71
72/* Dvorak
73 * |------+------+------+------+------+------+------+------+------+------+------+------|
74 * | Tab | " | , | . | P | Y | F | G | C | R | L | - |
75 * |------+------+------+------+------+-------------+------+------+------+------+------|
76 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
77 * |------+------+------+------+------+------|------+------+------+------+------+------|
78 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
79 * |------+------+------+------+------+------+------+------+------+------+------+------|
80 * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
81 * `-----------------------------------------------------------------------------------'
82 */
83[_DVORAK] = KEYMAP( \
84 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_MINS, \
85 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
86 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \
87 KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
88),
89
90/* Lower
91 * |------+------+------+------+------+-------------+------+------+------+------+------|
92 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
93 * |------+------+------+------+------+-------------+------+------+------+------+------|
94 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
95 * |------+------+------+------+------+------|------+------+------+------+------+------|
96 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
97 * |------+------+------+------+------+------+------+------+------+------+------+------|
98 * | | | | | | | | Next | Vol- | Vol+ | Play |
99 * `-----------------------------------------------------------------------------------'
100 */
101[_LOWER] = KEYMAP( \
102 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
103 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
104 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
105 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
106),
107
108/* Raise
109 * |------+------+------+------+------+------+------+------+------+------+------+------|
110 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
111 * |------+------+------+------+------+-------------+------+------+------+------+------|
112 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
113 * |------+------+------+------+------+------|------+------+------+------+------+------|
114 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
115 * |------+------+------+------+------+------+------+------+------+------+------+------|
116 * | | | | | | | | Next | Vol- | Vol+ | Play |
117 * `-----------------------------------------------------------------------------------'
118 */
119[_RAISE] = KEYMAP( \
120 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
121 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
122 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
123 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
124),
125
126[_MOVEMENT] = KEYMAP( \
127 KC_TILD, KC_EXLM, KC_MUTE, KC_VOLD, KC_VOLU, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_DEL, \
128 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_RIGHT, KC_RCBR, KC_PIPE, \
129 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
130 _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, KC_PGUP, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
131),
132
133/* Adjust (Lower + Raise)
134 * |------+------+------+------+------+------+------+------+------+------+------+------|
135 * | | Reset| | | | | | | | | | Del |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * | |Voice-|Voice+|Musoff|Mus on| | | | | | | |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | | | | | | | | | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144[_ADJUST] = KEYMAP( \
145 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
146 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
147 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
148 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
149)
150
151};
152
153#ifdef AUDIO_ENABLE
154float tone_startup[][2] = {
155 {NOTE_B5, 20},
156 {NOTE_B6, 8},
157 {NOTE_DS6, 20},
158 {NOTE_B6, 8}
159};
160
161float tone_qwerty[][2] = SONG(QWERTY_SOUND);
162float tone_dvorak[][2] = SONG(DVORAK_SOUND);
163float tone_colemak[][2] = SONG(COLEMAK_SOUND);
164
165float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
166
167float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
168#endif
169
170void persistant_default_layer_set(uint16_t default_layer) {
171 eeconfig_update_default_layer(default_layer);
172 default_layer_set(default_layer);
173}
174
175bool process_record_user(uint16_t keycode, keyrecord_t *record) {
176 switch (keycode) {
177 case QWERTY:
178 if (record->event.pressed) {
179 #ifdef AUDIO_ENABLE
180 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
181 #endif
182 persistant_default_layer_set(1UL<<_QWERTY);
183 }
184 return false;
185 break;
186 case COLEMAK:
187 if (record->event.pressed) {
188 #ifdef AUDIO_ENABLE
189 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
190 #endif
191 persistant_default_layer_set(1UL<<_COLEMAK);
192 }
193 return false;
194 break;
195 case DVORAK:
196 if (record->event.pressed) {
197 #ifdef AUDIO_ENABLE
198 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
199 #endif
200 persistant_default_layer_set(1UL<<_DVORAK);
201 }
202 return false;
203 break;
204 case LOWER:
205 if (record->event.pressed) {
206 layer_on(_LOWER);
207 update_tri_layer(_LOWER, _RAISE, _ADJUST);
208 } else {
209 layer_off(_LOWER);
210 update_tri_layer(_LOWER, _RAISE, _ADJUST);
211 }
212 return false;
213 break;
214 case RAISE:
215 if (record->event.pressed) {
216 layer_on(_RAISE);
217 update_tri_layer(_LOWER, _RAISE, _ADJUST);
218 } else {
219 layer_off(_RAISE);
220 update_tri_layer(_LOWER, _RAISE, _ADJUST);
221 }
222 return false;
223 break;
224 case BACKLIT:
225 if (record->event.pressed) {
226 register_code(KC_RSFT);
227 #ifdef BACKLIGHT_ENABLE
228 backlight_step();
229 #endif
230 } else {
231 unregister_code(KC_RSFT);
232 }
233 return false;
234 break;
235 }
236 return true;
237};
238
239void matrix_init_user(void) {
240 #ifdef AUDIO_ENABLE
241 startup_user();
242 #endif
243}
244
245#ifdef AUDIO_ENABLE
246
247void startup_user()
248{
249 _delay_ms(20); // gets rid of tick
250 PLAY_NOTE_ARRAY(tone_startup, false, 0);
251}
252
253void shutdown_user()
254{
255 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
256 _delay_ms(150);
257 stop_all_notes();
258}
259
260void music_on_user(void)
261{
262 music_scale_user();
263}
264
265void music_scale_user(void)
266{
267 PLAY_NOTE_ARRAY(music_scale, false, 0);
268}
269
270#endif \ No newline at end of file
diff --git a/keyboards/atreus50/keymaps/default/readme.md b/keyboards/atreus50/keymaps/default/readme.md
new file mode 100644
index 000000000..e911968dd
--- /dev/null
+++ b/keyboards/atreus50/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's \ No newline at end of file
diff --git a/keyboards/atreus50/readme.md b/keyboards/atreus50/readme.md
new file mode 100644
index 000000000..f0be255a0
--- /dev/null
+++ b/keyboards/atreus50/readme.md
@@ -0,0 +1,25 @@
1Preonic keyboard firmware
2======================
3DIY/Assembled compact ortholinear 50% keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com).
4
5## Quantum MK Firmware
6
7For the full Quantum feature list, see [the parent readme.md](/readme.md).
8
9## Building
10
11Download or clone the whole firmware and navigate to the keyboards/preonic folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button.
12
13Depending on which keymap you would like to use, you will have to compile slightly differently.
14
15### Default
16To build with the default keymap, simply run `make`.
17
18### Other Keymaps
19Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap, create a file in the keymaps folder named `<name>.c` and see keymap document (you can find in top readme.md) and existent keymap files.
20
21To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
22```
23$ make KEYMAP=[default|jack|<name>]
24```
25Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/atreus50/rules.mk b/keyboards/atreus50/rules.mk
new file mode 100644
index 000000000..7770ea2a2
--- /dev/null
+++ b/keyboards/atreus50/rules.mk
@@ -0,0 +1,81 @@
1
2
3# MCU name
4#MCU = at90usb1287
5MCU = atmega32u4
6
7# Processor frequency.
8# This will define a symbol, F_CPU, in all source code files equal to the
9# processor frequency in Hz. You can then use this symbol in your source code to
10# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
11# automatically to create a 32-bit value in your source code.
12#
13# This will be an integer division of F_USB below, as it is sourced by
14# F_USB after it has run through any CPU prescalers. Note that this value
15# does not *change* the processor frequency - it should merely be updated to
16# reflect the processor speed set externally so that the code can use accurate
17# software delays.
18F_CPU = 16000000
19
20#
21# LUFA specific
22#
23# Target architecture (see library "Board Types" documentation).
24ARCH = AVR8
25
26# Input clock frequency.
27# This will define a symbol, F_USB, in all source code files equal to the
28# input clock frequency (before any prescaling is performed) in Hz. This value may
29# differ from F_CPU if prescaling is used on the latter, and is required as the
30# raw input clock is fed directly to the PLL sections of the AVR for high speed
31# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
32# at the end, this will be done automatically to create a 32-bit value in your
33# source code.
34#
35# If no clock division is performed on the input clock inside the AVR (via the
36# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
37F_USB = $(F_CPU)
38
39# Interrupt driven control endpoint task(+60)
40OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
41
42
43# Boot Section Size in *bytes*
44# Teensy halfKay 512
45# Teensy++ halfKay 1024
46# Atmel DFU loader 4096
47# LUFA bootloader 4096
48# USBaspLoader 2048
49OPT_DEFS += -DBOOTLOADER_SIZE=4096
50
51# Build Options
52# change to "no" to disable the options, or define them in the Makefile in
53# the appropriate keymap folder that will get included automatically
54#
55BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
56MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
57EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
58CONSOLE_ENABLE ?= no # Console for debug(+400)
59COMMAND_ENABLE ?= yes # Commands for debug and configuration
60NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
61BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
62MIDI_ENABLE ?= no # MIDI controls
63AUDIO_ENABLE ?= no # Audio output on port C6
64UNICODE_ENABLE ?= no # Unicode
65BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
66RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
67
68# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
69SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
70
71avrdude: build
72 ls /dev/tty* > /tmp/1; \
73 echo "Reset your Pro Micro now"; \
74 while [[ -z $$USB ]]; do \
75 sleep 1; \
76 ls /dev/tty* > /tmp/2; \
77 USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
78 done; \
79 avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
80
81.PHONY: avrdude