aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Dekkers <maartenwut@gmail.com>2018-07-12 21:42:36 +0200
committerDrashna Jaelre <drashna@live.com>2018-07-12 12:42:36 -0700
commited98250e62d9e37218931d09a4216ffe09d3ce3a (patch)
tree3dec04c794c1e4b7494522064a94ae3c6dc51c6e
parent9c35c5979c232749ee05444f9d810536c31c937c (diff)
downloadqmk_firmware-ed98250e62d9e37218931d09a4216ffe09d3ce3a.tar.gz
qmk_firmware-ed98250e62d9e37218931d09a4216ffe09d3ce3a.zip
Add kmini (#3386)
* Add kmini * Change keyboard USB description
-rwxr-xr-xkeyboards/kmini/config.h58
-rwxr-xr-xkeyboards/kmini/info.json6
-rwxr-xr-xkeyboards/kmini/keymaps/default/keymap.c60
-rwxr-xr-xkeyboards/kmini/kmini.c53
-rwxr-xr-xkeyboards/kmini/kmini.h36
-rwxr-xr-xkeyboards/kmini/matrix.c303
-rwxr-xr-xkeyboards/kmini/readme.md13
-rwxr-xr-xkeyboards/kmini/rules.mk71
8 files changed, 600 insertions, 0 deletions
diff --git a/keyboards/kmini/config.h b/keyboards/kmini/config.h
new file mode 100755
index 000000000..567a75442
--- /dev/null
+++ b/keyboards/kmini/config.h
@@ -0,0 +1,58 @@
1/* Copyright 2018 Maarten Dekkers <maartenwut@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#ifndef CONFIG_H
17#define CONFIG_H
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0x6050
24#define DEVICE_VER 0x0104
25#define MANUFACTURER Revo
26#define PRODUCT KMAC Kmini
27#define DESCRIPTION QMK keyboard firmware for Revo KMAC Mini
28
29/* key matrix size */
30#define MATRIX_ROWS 5
31#define MATRIX_COLS 17
32
33/*
34 * Keyboard Matrix Assignments
35 * The KMAC uses a demultiplexer for some of the cols.
36 * See matrix.c for more details.
37*/
38#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
39#define MATRIX_COL_PINS { }
40#define UNUSED_PINS
41
42/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
43#define DIODE_DIRECTION CUSTOM_MATRIX
44
45/* number of backlight levels */
46#define BACKLIGHT_LEVELS 3
47// #define BACKLIGHT_PIN B7
48// #define BACKLIGHT_BREATHING
49
50/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
51#define DEBOUNCING_DELAY 5
52
53/* key combination for magic key command */
54#define IS_COMMAND() ( \
55 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
56)
57
58#endif
diff --git a/keyboards/kmini/info.json b/keyboards/kmini/info.json
new file mode 100755
index 000000000..e5631f933
--- /dev/null
+++ b/keyboards/kmini/info.json
@@ -0,0 +1,6 @@
1{
2 "keyboard_name": "KMAC Mini",
3 "url": "http://kbdmodadmin.cafe24.com/product/detail.html?product_no=12&cate_no=4&display_group=1",
4 "maintainer": "maartenwut"
5 }
6}
diff --git a/keyboards/kmini/keymaps/default/keymap.c b/keyboards/kmini/keymaps/default/keymap.c
new file mode 100755
index 000000000..73d9b611e
--- /dev/null
+++ b/keyboards/kmini/keymaps/default/keymap.c
@@ -0,0 +1,60 @@
1/* Copyright 2018 Maarten Dekkers <maartenwut@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "kmini.h"
17
18// Helpful defines
19#define _____ KC_TRNS
20
21// Each layer gets a name for readability, which is then used in the keymap matrix below.
22// The underscores don't mean anything - you can have a layer called STUFF or any other name.
23// Layer names don't all need to be of the same length, obviously, and you can also skip them
24// entirely and just use numbers.
25#define _MA 0
26#define _FN 1
27
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 [_MA] = LAYOUT(
30 KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \
31 KC_F3, KC_F4, 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_DEL, \
32 KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
33 KC_F7, KC_F8, 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_PGDN, \
34 KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT \
35 ),
36 [_FN] = LAYOUT(
37 _____, _____, _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, _____, \
38 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \
39 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \
40 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \
41 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ \
42 ),
43};
44
45void led_set_user(uint8_t usb_led) {
46 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
47 PORTB &= ~(1<<1); // LO
48 } else {
49 PORTB |= (1<<1); // HI
50 }
51}
52
53
54void matrix_init_user(void) {
55
56}
57
58void matrix_scan_user(void) {
59
60} \ No newline at end of file
diff --git a/keyboards/kmini/kmini.c b/keyboards/kmini/kmini.c
new file mode 100755
index 000000000..08a120b65
--- /dev/null
+++ b/keyboards/kmini/kmini.c
@@ -0,0 +1,53 @@
1/* Copyright 2018 Maarten Dekkers <maartenwut@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "kmini.h"
17
18void matrix_init_kb(void) {
19 // put your keyboard start-up code here
20 // runs once when the firmware starts up
21 led_init_ports();
22 matrix_init_user();
23}
24
25void matrix_scan_kb(void) {
26 // put your looping keyboard code here
27 // runs every cycle (a lot)
28
29 matrix_scan_user();
30}
31
32bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
33 // put your per-action keyboard code here
34 // runs for every action, just before processing by the firmware
35
36 return process_record_user(keycode, record);
37}
38
39void led_init_ports(void) {
40 DDRB |= (1<<1); // OUT
41 DDRB |= (1<<2); // OUT
42 DDRB |= (1<<3); // OUT
43}
44
45/* LED pin configuration
46 * Caps Lock: Low B1
47 * Side1: Low B3
48 * Side2: Low B2
49 */
50void led_set_kb(uint8_t usb_led) {
51 led_set_user(usb_led);
52}
53
diff --git a/keyboards/kmini/kmini.h b/keyboards/kmini/kmini.h
new file mode 100755
index 000000000..0576425ea
--- /dev/null
+++ b/keyboards/kmini/kmini.h
@@ -0,0 +1,36 @@
1/* Copyright 2018 Maarten Dekkers <maartenwut@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#ifndef KMINI_H
17#define KMINI_H
18#define ___ KC_NO
19
20#include "quantum.h"
21
22#define LAYOUT( \
23 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \
24 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \
25 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, K2G, \
26 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3E, K3F, K3G, \
27 K40, K41, K42, K43, K44, K47, K4C, K4E, K4F, K4G \
28) { \
29 {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G}, \
30 {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G}, \
31 {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, ___, K2F, K2G}, \
32 {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___, K3E, K3F, K3G}, \
33 {K40, K41, K42, K43, K44, ___, ___, K47, ___, ___, ___, ___, K4C, ___, K4E, K4F, K4G}, \
34}
35
36#endif
diff --git a/keyboards/kmini/matrix.c b/keyboards/kmini/matrix.c
new file mode 100755
index 000000000..f0733340c
--- /dev/null
+++ b/keyboards/kmini/matrix.c
@@ -0,0 +1,303 @@
1/* Copyright 2018 Maarten Dekkers <maartenwut@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include <stdint.h>
17#include <stdbool.h>
18#if defined(__AVR__)
19#include <avr/io.h>
20#endif
21#include "wait.h"
22#include "print.h"
23#include "debug.h"
24#include "util.h"
25#include "matrix.h"
26#include "timer.h"
27
28
29/* Set 0 if debouncing isn't needed */
30#ifndef DEBOUNCING_DELAY
31# define DEBOUNCING_DELAY 5
32#endif
33
34#define COL_SHIFTER ((uint32_t)1)
35
36static uint16_t debouncing_time;
37static bool debouncing = false;
38
39
40static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
41
42/* matrix state(1:on, 0:off) */
43static matrix_row_t matrix[MATRIX_ROWS];
44static matrix_row_t matrix_debouncing[MATRIX_ROWS];
45
46static void init_rows(void);
47static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
48static void unselect_cols(void);
49static void select_col(uint8_t col);
50
51inline
52uint8_t matrix_rows(void) {
53 return MATRIX_ROWS;
54}
55
56inline
57uint8_t matrix_cols(void) {
58 return MATRIX_COLS;
59}
60
61void matrix_init(void) {
62 unselect_cols();
63 init_rows();
64
65 // initialize matrix state: all keys off
66 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
67 matrix[i] = 0;
68 matrix_debouncing[i] = 0;
69 }
70
71 matrix_init_quantum();
72}
73
74uint8_t matrix_scan(void)
75{
76 // Set col, read rows
77 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
78 bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
79 if (matrix_changed) {
80 debouncing = true;
81 debouncing_time = timer_read();
82 }
83 }
84
85 if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
86 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
87 matrix[i] = matrix_debouncing[i];
88 }
89 debouncing = false;
90 }
91
92 matrix_scan_quantum();
93 return 1;
94}
95
96inline
97bool matrix_is_on(uint8_t row, uint8_t col)
98{
99 return (matrix[row] & ((matrix_row_t)1<col));
100}
101
102inline
103matrix_row_t matrix_get_row(uint8_t row)
104{
105 return matrix[row];
106}
107
108void matrix_print(void)
109{
110 print("\nr/c 0123456789ABCDEFGHIJKLMNOPQRSTUV \n");
111
112 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
113 phex(row); print(": ");
114 print_bin_reverse32(matrix_get_row(row));
115 print("\n");
116 }
117}
118
119uint8_t matrix_key_count(void)
120{
121 uint8_t count = 0;
122 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
123 count += bitpop32(matrix[i]);
124 }
125 return count;
126}
127
128static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
129{
130 bool matrix_changed = false;
131
132 // Select col and wait for col selecton to stabilize
133 select_col(current_col);
134 wait_us(30);
135
136 // For each row...
137 for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
138 {
139 // Store last value of row prior to reading
140 matrix_row_t last_row_value = current_matrix[row_index];
141
142 // Check row pin state
143 // Use the otherwise unused row: 3, col: 0 for caps lock
144 if (row_index == 2 && current_col == 2) {
145 // Pin E2 uses active low
146 if ((_SFR_IO8(E2 >> 4) & _BV(E2 & 0xF)) == 0)
147 {
148 // Pin LO, set col bit
149 current_matrix[row_index] |= (COL_SHIFTER << current_col);
150 }
151 else
152 {
153 // Pin HI, clear col bit
154 current_matrix[row_index] &= ~(COL_SHIFTER << current_col);
155 }
156 }
157 else {
158 if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)))
159 {
160 // Pin HI, set col bit
161 current_matrix[row_index] |= (COL_SHIFTER << current_col);
162 }
163 else
164 {
165 // Pin LO, clear col bit
166 current_matrix[row_index] &= ~(COL_SHIFTER << current_col);
167 }
168 }
169
170 // Determine if the matrix changed state
171 if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
172 {
173 matrix_changed = true;
174 }
175 }
176
177 // Unselect cols
178 unselect_cols();
179
180 return matrix_changed;
181}
182
183/* Row pin configuration
184 * row: 0 1 2 3 4
185 * pin: D0 D1 D2 D3 D5
186 *
187 * Caps lock uses its own pin E2
188 */
189static void init_rows(void) {
190 DDRD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // IN
191 PORTD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // LO
192
193 DDRE &= ~(1<<2); // IN
194 PORTE |= (1<<2); // HI
195}
196
197/* Columns 0 - 16
198 * col 0: B5
199 * col 1: B6
200 * These columns use a 74HC237D 3 to 8 bit demultiplexer.
201 * A B C GL1
202 * col / pin: PF0 PF1 PC7 PC6
203 * 2: 0 0 0 1
204 * 3: 1 0 0 1
205 * 4: 0 1 0 1
206 * 5: 1 1 0 1
207 * 6: 0 0 1 1
208 * 7: 1 0 1 1
209 * 8: 0 1 1 1
210 * 9: 1 1 1 1
211 * col 10: E6
212 * col 11: B0
213 * col 12: B7
214 * col 13: D4
215 * col 14: D6
216 * col 15: D7
217 * col 16: B4
218 */
219static void unselect_cols(void) {
220 DDRB |= (1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4); // OUT
221 PORTB &= ~((1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4)); // LO
222
223 DDRD |= (1<<4) | (1<<6) | (1<<7); // OUT
224 PORTD &= ~((1<<4) | (1<<6) | (1<<7)); // LO
225
226 DDRE |= (1<<6); // OUT
227 PORTE &= ~((1<<6)); // LO
228
229 DDRF |= (1<<0) | (1<<1); // OUT
230 PORTF &= ~((1<<0) | (1<<1)); // LO
231
232 DDRC |= (1<<7) | (1<<6); // OUT
233 PORTC &= ~((1<<7) | (1<<6)); // LO
234}
235
236static void select_col(uint8_t col)
237{
238 switch (col) {
239 case 0:
240 PORTB |= (1<<5); // HI
241 break;
242 case 1:
243 PORTB |= (1<<6); // HI
244 break;
245 case 2:
246 PORTC |= (1<<6); // HI
247 break;
248 case 3:
249 PORTC |= (1<<6); // HI
250 PORTF |= (1<<0); // HI
251 break;
252 case 4:
253 PORTC |= (1<<6); // HI
254 PORTF |= (1<<1); // HI
255 break;
256 case 5:
257 PORTC |= (1<<6); // HI
258 PORTF |= (1<<0); // HI
259 PORTF |= (1<<1); // HI
260 break;
261 case 6:
262 PORTC |= (1<<6); // HI
263 PORTC |= (1<<7); // HI
264 break;
265 case 7:
266 PORTC |= (1<<6); // HI
267 PORTF |= (1<<0); // HI
268 PORTC |= (1<<7); // HI
269 break;
270 case 8:
271 PORTC |= (1<<6); // HI
272 PORTF |= (1<<1); // HI
273 PORTC |= (1<<7); // HI
274 break;
275 case 9:
276 PORTC |= (1<<6); // HI
277 PORTF |= (1<<0); // HI
278 PORTF |= (1<<1); // HI
279 PORTC |= (1<<7); // HI
280 break;
281 case 10:
282 PORTE |= (1<<6); // HI
283 break;
284 case 11:
285 PORTB |= (1<<0); // HI
286 break;
287 case 12:
288 PORTB |= (1<<7); // HI
289 break;
290 case 13:
291 PORTD |= (1<<4); // HI
292 break;
293 case 14:
294 PORTD |= (1<<6); // HI
295 break;
296 case 15:
297 PORTD |= (1<<7); // HI
298 break;
299 case 16:
300 PORTB |= (1<<4); // HI
301 break;
302 }
303}
diff --git a/keyboards/kmini/readme.md b/keyboards/kmini/readme.md
new file mode 100755
index 000000000..2a9e8e790
--- /dev/null
+++ b/keyboards/kmini/readme.md
@@ -0,0 +1,13 @@
1Kmini keyboard firmware
2======================
3
4The Revo Kmini is a 65% keyboard with an additional two columns on the left. It is programmed with the 'KMAC key map', which only works on Windows and according to a [user](https://www.keebtalk.com/t/programming-revo-kmini/2107/7) it cannot map media controls or change the capslock key.
5
6## Hardware
7Columns 0, 1 and 10-16 and rows 0-4 are wired directly to the ATmega32u4, and columns 2-9 are wired to the [74HC237D demultiplexer](https://www.mouser.de/datasheet/2/916/74HC237-1319445.pdf). Capslock is on E2 and also triggers a reset if held when plugging the cable in. There are three possible places for leds, which are the capslock key and the two keys above the right arrow key. All three of them are individually controllable. The ATmega32u4 runs on an external crystal on 8mhz, so you'll have to change the bitclock on the ISP programmer if you're unable to read or write the chip.
8
9## How to build
10Please read the [documentation](https://docs.qmk.fm).
11
12## How to flash
13Hold the capslock key while plugging in the USB and flash the .hex file using QMK Toolbox or Atmel FLIP. \ No newline at end of file
diff --git a/keyboards/kmini/rules.mk b/keyboards/kmini/rules.mk
new file mode 100755
index 000000000..a4183870c
--- /dev/null
+++ b/keyboards/kmini/rules.mk
@@ -0,0 +1,71 @@
1# Project specific files
2SRC = matrix.c
3
4# MCU name
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 = 8000000
19
20
21#
22# LUFA specific
23#
24# Target architecture (see library "Board Types" documentation).
25ARCH = AVR8
26
27# Input clock frequency.
28# This will define a symbol, F_USB, in all source code files equal to the
29# input clock frequency (before any prescaling is performed) in Hz. This value may
30# differ from F_CPU if prescaling is used on the latter, and is required as the
31# raw input clock is fed directly to the PLL sections of the AVR for high speed
32# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
33# at the end, this will be done automatically to create a 32-bit value in your
34# source code.
35#
36# If no clock division is performed on the input clock inside the AVR (via the
37# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
38F_USB = $(F_CPU)
39
40# Interrupt driven control endpoint task(+60)
41OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
42
43
44# Boot Section Size in *bytes*
45# Teensy halfKay 512
46# Teensy++ halfKay 1024
47# Atmel DFU loader 4096
48# LUFA bootloader 4096
49# USBaspLoader 2048
50OPT_DEFS += -DBOOTLOADER_SIZE=4096
51
52
53# Build Options
54# change yes to no to disable
55#
56BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
57MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
58EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
59CONSOLE_ENABLE = no # Console for debug(+400)
60COMMAND_ENABLE = yes # Commands for debug and configuration
61CUSTOM_MATRIX = yes # Custom matrix file
62# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
63SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
64# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
65NKRO_ENABLE = yes # USB Nkey Rollover
66BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
67MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
68UNICODE_ENABLE = no # Unicode
69BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
70AUDIO_ENABLE = no # Audio output on port C6
71FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches