aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErez Zukerman <ezuk@madmimi.com>2016-09-23 20:57:41 -0400
committerErez Zukerman <ezuk@madmimi.com>2016-09-23 20:57:41 -0400
commit67252625165ffa0a08e723a52562a853aa4b496b (patch)
tree590591f00a3782b43253a1321220c7652cd9799b
parent1a96b2cdc8895bd9f219e6c793aeee6ff7ce81f6 (diff)
parente1fa9073c263d260fc0ec3c0d2d8a6a6f5aee42e (diff)
downloadqmk_firmware-67252625165ffa0a08e723a52562a853aa4b496b.tar.gz
qmk_firmware-67252625165ffa0a08e723a52562a853aa4b496b.zip
Merge branch 'master' of github.com:jackhumbert/qmk_firmware
-rw-r--r--keyboards/tada68/Makefile3
-rw-r--r--keyboards/tada68/config.h97
-rw-r--r--keyboards/tada68/keymaps/default/Makefile21
-rw-r--r--keyboards/tada68/keymaps/default/keymap.c98
-rw-r--r--keyboards/tada68/keymaps/default/readme.md1
-rw-r--r--keyboards/tada68/readme.md4
-rw-r--r--keyboards/tada68/rules.mk66
-rw-r--r--keyboards/tada68/tada68.c30
-rw-r--r--keyboards/tada68/tada68.h43
-rw-r--r--tmk_core/common/action.c7
10 files changed, 367 insertions, 3 deletions
diff --git a/keyboards/tada68/Makefile b/keyboards/tada68/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/tada68/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h
new file mode 100644
index 000000000..5d8757936
--- /dev/null
+++ b/keyboards/tada68/config.h
@@ -0,0 +1,97 @@
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 0xFEED
25#define PRODUCT_ID 0x6060
26#define DEVICE_VER 0x0003
27#define MANUFACTURER TADA
28#define PRODUCT TADA68
29#define DESCRIPTION QMK keyboard firmware for TADA68 with WS2812 support
30
31/* key matrix size */
32#define MATRIX_ROWS 5
33#define MATRIX_COLS 15
34
35// ROWS: Top to bottom, COLS: Left to right
36
37#define MATRIX_ROW_PINS {D0,D1,F6,F7,D5}
38#define MATRIX_COL_PINS {F0,F1,E6,C7,C6,B7,D4,B1,B0,B5,B4,D7,D6,B3,F4}
39#define UNUSED_PINS
40
41#define BACKLIGHT_PIN B6
42
43/* COL2ROW or ROW2COL */
44#define DIODE_DIRECTION COL2ROW
45
46/* define if matrix has ghost */
47//#define MATRIX_HAS_GHOST
48
49/* Set 0 if debouncing isn't needed */
50#define DEBOUNCING_DELAY 5
51
52/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
53#define LOCKING_SUPPORT_ENABLE
54/* Locking resynchronize hack */
55#define LOCKING_RESYNC_ENABLE
56
57/* key combination for command */
58#define IS_COMMAND() ( \
59 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
60)
61
62/* Backlight configuration
63 */
64#define BACKLIGHT_LEVELS 4
65
66/* Underlight configuration
67 */
68
69/*#define RGB_DI_PIN E2
70#define RGBLIGHT_TIMER
71#define RGBLED_NUM 2 // Number of LEDs
72#define RGBLIGHT_HUE_STEP 10
73#define RGBLIGHT_SAT_STEP 17
74#define RGBLIGHT_VAL_STEP 17*/
75//Disabled while I figure out a suitable pin for RGB support.
76//I've tried F5, D2, D3, and E2 but it's possible the end of my
77//strand is bad. New LEDs on order.
78
79/*
80 * Feature disable options
81 * These options are also useful to firmware size reduction.
82 */
83
84/* disable debug print */
85//#define NO_DEBUG
86
87/* disable print */
88//#define NO_PRINT
89
90/* disable action features */
91//#define NO_ACTION_LAYER
92//#define NO_ACTION_TAPPING
93//#define NO_ACTION_ONESHOT
94//#define NO_ACTION_MACRO
95//#define NO_ACTION_FUNCTION
96
97#endif
diff --git a/keyboards/tada68/keymaps/default/Makefile b/keyboards/tada68/keymaps/default/Makefile
new file mode 100644
index 000000000..2a7ff2779
--- /dev/null
+++ b/keyboards/tada68/keymaps/default/Makefile
@@ -0,0 +1,21 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = yes # Commands for debug and configuration
10NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = no # Audio output on port C6
14UNICODE_ENABLE = no # Unicode
15BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
16RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
17SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
18
19ifndef QUANTUM_DIR
20 include ../../../../Makefile
21endif
diff --git a/keyboards/tada68/keymaps/default/keymap.c b/keyboards/tada68/keymaps/default/keymap.c
new file mode 100644
index 000000000..da57c0343
--- /dev/null
+++ b/keyboards/tada68/keymaps/default/keymap.c
@@ -0,0 +1,98 @@
1#include "tada68.h"
2
3
4// Used for SHIFT_ESC
5#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define _BL 0
12#define _FL 1
13
14#define _______ KC_TRNS
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap _BL: (Base Layer) Default Layer
18 * ,----------------------------------------------------------------.
19 * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` |
20 * |----------------------------------------------------------------|
21 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del |
22 * |----------------------------------------------------------------|
23 * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
24 * |----------------------------------------------------------------|
25 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn|
26 * |----------------------------------------------------------------|
27 * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig |
28 * `----------------------------------------------------------------'
29 */
30[_BL] = KEYMAP_ANSI(
31 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_GRV, \
32 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, \
33 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, \
34 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, \
35 KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT),
36
37 /* Keymap _FL: Function Layer
38 * ,----------------------------------------------------------------.
39 * | | | | | | | | | | | | | | RESET| |
40 * |----------------------------------------------------------------|
41 * | | | | | | | | | | | |BL-|BL+|BL | |
42 * |----------------------------------------------------------------|
43 * | | | | | | | | | | | | | |
44 * |----------------------------------------------------------------|
45 * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | | |
46 * |----------------------------------------------------------------|
47 * | | | | | | | | | | |
48 * `----------------------------------------------------------------'
49 */
50[_FL] = KEYMAP_ANSI(
51 #ifdef RGBLIGHT_ENABLE
52 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \
53 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \
54 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \
55 _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, \
56 _______,_______,_______, _______, _______,_______,_______,_______,_______, _______),
57 #else
58 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \
59 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \
60 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \
61 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
62 _______,_______,_______, _______, _______,_______,_______,_______,_______, _______),
63 #endif
64};
65
66/*enum function_id {
67 //SHIFT_ESC,
68};
69
70const uint16_t PROGMEM fn_actions[] = {
71 //[0] = ACTION_FUNCTION(SHIFT_ESC),
72};
73
74void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
75 static uint8_t shift_esc_shift_mask;
76 switch (id) {
77 case SHIFT_ESC:
78 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
79 if (record->event.pressed) {
80 if (shift_esc_shift_mask) {
81 add_key(KC_GRV);
82 send_keyboard_report();
83 } else {
84 add_key(KC_ESC);
85 send_keyboard_report();
86 }
87 } else {
88 if (shift_esc_shift_mask) {
89 del_key(KC_GRV);
90 send_keyboard_report();
91 } else {
92 del_key(KC_ESC);
93 send_keyboard_report();
94 }
95 }
96 break;
97 }
98}*/
diff --git a/keyboards/tada68/keymaps/default/readme.md b/keyboards/tada68/keymaps/default/readme.md
new file mode 100644
index 000000000..36760d6b9
--- /dev/null
+++ b/keyboards/tada68/keymaps/default/readme.md
@@ -0,0 +1 @@
# default TADA68 layout
diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md
new file mode 100644
index 000000000..552fdea52
--- /dev/null
+++ b/keyboards/tada68/readme.md
@@ -0,0 +1,4 @@
1TADA68 keyboard firmware
2======================
3
4TODO: to be updated.
diff --git a/keyboards/tada68/rules.mk b/keyboards/tada68/rules.mk
new file mode 100644
index 000000000..d8ec42365
--- /dev/null
+++ b/keyboards/tada68/rules.mk
@@ -0,0 +1,66 @@
1
2# MCU name
3#MCU = at90usb1287
4MCU = atmega32u4
5
6# Processor frequency.
7# This will define a symbol, F_CPU, in all source code files equal to the
8# processor frequency in Hz. You can then use this symbol in your source code to
9# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
10# automatically to create a 32-bit value in your source code.
11#
12# This will be an integer division of F_USB below, as it is sourced by
13# F_USB after it has run through any CPU prescalers. Note that this value
14# does not *change* the processor frequency - it should merely be updated to
15# reflect the processor speed set externally so that the code can use accurate
16# software delays.
17F_CPU = 16000000
18
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
52# Build Options
53# comment out to disable the options.
54#
55BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
56MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
57EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
58CONSOLE_ENABLE ?= yes # Console for debug(+400)
59COMMAND_ENABLE ?= yes # Commands for debug and configuration
60NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
61RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870)
62BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
63MIDI_ENABLE ?= no # MIDI controls
64AUDIO_ENABLE ?= no
65UNICODE_ENABLE ?= no # Unicode
66BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
diff --git a/keyboards/tada68/tada68.c b/keyboards/tada68/tada68.c
new file mode 100644
index 000000000..24f89048c
--- /dev/null
+++ b/keyboards/tada68/tada68.c
@@ -0,0 +1,30 @@
1#include "tada68.h"
2#include "led.h"
3
4void matrix_init_kb(void) {
5 // put your keyboard start-up code here
6 // runs once when the firmware starts up
7 matrix_init_user();
8 led_init_ports();
9};
10
11void matrix_scan_kb(void) {
12 // put your looping keyboard code here
13 // runs every cycle (a lot)
14 matrix_scan_user();
15};
16
17void led_init_ports(void) {
18 // * Set our LED pins as output
19 DDRB |= (1<<2);
20}
21
22void led_set_kb(uint8_t usb_led) {
23 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
24 // Turn capslock on
25 PORTB &= ~(1<<2);
26 } else {
27 // Turn capslock off
28 PORTB |= (1<<2);
29 }
30}
diff --git a/keyboards/tada68/tada68.h b/keyboards/tada68/tada68.h
new file mode 100644
index 000000000..d0e027a6f
--- /dev/null
+++ b/keyboards/tada68/tada68.h
@@ -0,0 +1,43 @@
1#ifndef TADA68_H
2#define TADA68_H
3
4#include "quantum.h"
5
6// readability
7#define XXX KC_NO
8
9/* TADA68 ANSI layout
10 * ,----------------------------------------------------------------.
11 * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | 0e |
12 * |----------------------------------------------------------------|
13 * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | 1e |
14 * |----------------------------------------------------------------|
15 * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | 2e |
16 * |----------------------------------------------------------------|
17 * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d| 3e |
18 * |----------------------------------------------------------------|
19 * | 40 | 41 | 42 | 45 | 49| 4a| 4b| 4c| 4d| 4e |
20 * `----------------------------------------------------------------'
21 */
22// The first section contains all of the arguments
23// The second converts the arguments into a two-dimensional array
24
25#define KEYMAP_ANSI( \
26 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \
27 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
28 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \
29 k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
30 k40, k41, k42, k45, k49, k4a, k4b, k4c, k4d, k4e \
31) \
32{ \
33 {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \
34 {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \
35 {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \
36 {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \
37 {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d, k4e} \
38}
39
40void matrix_init_user(void);
41void matrix_scan_user(void);
42
43#endif
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 08ef22eb9..d485b46c7 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -155,9 +155,10 @@ void process_action(keyrecord_t *record, action_t action)
155 action.key.mods<<4; 155 action.key.mods<<4;
156 if (event.pressed) { 156 if (event.pressed) {
157 if (mods) { 157 if (mods) {
158 if (IS_MOD(action.key.code)) { 158 if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
159 // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless. 159 // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
160 // this also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT) 160 // This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
161 // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
161 add_mods(mods); 162 add_mods(mods);
162 } else { 163 } else {
163 add_weak_mods(mods); 164 add_weak_mods(mods);
@@ -168,7 +169,7 @@ void process_action(keyrecord_t *record, action_t action)
168 } else { 169 } else {
169 unregister_code(action.key.code); 170 unregister_code(action.key.code);
170 if (mods) { 171 if (mods) {
171 if (IS_MOD(action.key.code)) { 172 if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
172 del_mods(mods); 173 del_mods(mods);
173 } else { 174 } else {
174 del_weak_mods(mods); 175 del_weak_mods(mods);