]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge pull request #1171 from ishtob/master
authorJack Humbert <jack.humb@gmail.com>
Tue, 28 Mar 2017 13:13:41 +0000 (09:13 -0400)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2017 13:13:41 +0000 (09:13 -0400)
SSD1306 I2C OLED display support for let's split

24 files changed:
keyboards/atreus62/atreus62.h
keyboards/frosty_flake/Makefile [new file with mode: 0644]
keyboards/frosty_flake/config.h [new file with mode: 0644]
keyboards/frosty_flake/frosty_flake.c [new file with mode: 0644]
keyboards/frosty_flake/frosty_flake.h [new file with mode: 0644]
keyboards/frosty_flake/keymaps/default/Makefile [new file with mode: 0644]
keyboards/frosty_flake/keymaps/default/config.h [new file with mode: 0644]
keyboards/frosty_flake/keymaps/default/keymap.c [new file with mode: 0644]
keyboards/frosty_flake/keymaps/default/readme.md [new file with mode: 0644]
keyboards/frosty_flake/matrix.c [new file with mode: 0644]
keyboards/frosty_flake/readme.md [new file with mode: 0644]
keyboards/frosty_flake/rules.mk [new file with mode: 0644]
keyboards/xd60/keymaps/cheese/README.md [new file with mode: 0644]
keyboards/xd60/keymaps/cheese/base_layout.png [new file with mode: 0644]
keyboards/xd60/keymaps/cheese/fn_layout.png [new file with mode: 0644]
keyboards/xd60/keymaps/cheese/keymap.c [new file with mode: 0644]
quantum/quantum.c
quantum/quantum_keycodes.h
tmk_core/common.mk
tmk_core/protocol/lufa.mk
tmk_core/protocol/lufa/adafruit_ble.h
tmk_core/protocol/lufa/lufa.c
tmk_core/protocol/lufa/outputselect.c
tmk_core/protocol/lufa/outputselect.h

index eacf5b45138b7738a238a556ee550d4fb0c190a3..ca5cda8a89bc1b865927853f9f60b106e8ee7d61 100644 (file)
@@ -9,18 +9,34 @@ void promicro_bootloader_jmp(bool program);
 // The first section contains all of the arguements
 // The second converts the arguments into a two-dimensional array
 #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,           k36, k37, k38, k39, k3a, k3b, \
-  k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
+    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, \
+    k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
 ) \
 { \
-       { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
-       { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
-       { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \
-       { k30, k31, k32, k33, k34, k35, k46,   k36, k37, k38, k39, k3a, k3b }, \
-       { k40, k41, k42, k43, k44, k45, k47,   k48, k49, k4a, k4b, k4c, k4d } \
+    { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
+    { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
+    { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \
+    { k30, k31, k32, k33, k34, k35, k46,   k36, k37, k38, k39, k3a, k3b }, \
+    { k40, k41, k42, k43, k44, k45, k47,   k48, k49, k4a, k4b, k4c, k4d } \
 }
 
-#endif
\ No newline at end of file
+// Used to create a keymap using only KC_ prefixed keys.
+#define KC_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,           k36, k37, k38, k39, k3a, k3b, \
+    k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
+) \
+{ \
+    { 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 }, \
+    { 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 }, \
+    { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_NO,    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_##k46, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b }, \
+    { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c, KC_##k4d } \
+}
+
+#endif
diff --git a/keyboards/frosty_flake/Makefile b/keyboards/frosty_flake/Makefile
new file mode 100644 (file)
index 0000000..57b2ef6
--- /dev/null
@@ -0,0 +1,3 @@
+ifndef MAKEFILE_INCLUDED
+       include ../../Makefile
+endif
diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h
new file mode 100644 (file)
index 0000000..2c73f10
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6060
+#define DEVICE_VER      0x0001
+#define MANUFACTURER    Bathroom Epiphanies
+#define PRODUCT         frosty_flake
+#define DESCRIPTION     Frosty Flake controller for the CM Storm Quick Fire Rapid
+
+/*
+ * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies
+ * Ported from the Bathroom Epiphanies TMK Firmware:
+ * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers
+ *
+ */
+
+/* key matrix size */
+#define MATRIX_ROWS 8   // Row0 - Row7 in the schematic
+#define MATRIX_COLS 18  // ColA - ColR in the schematic
+
+/*
+ * Keyboard Matrix Assignments
+ */
+#define UNUSED_PINS { B0, C4, D3 }
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/*
+ * Force NKRO
+ *
+ * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
+ * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
+ * makefile for this to work.)
+ *
+ * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
+ * until the next keyboard reset.
+ *
+ * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
+ * fully operational during normal computer usage.
+ *
+ * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
+ * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
+ * bootmagic, NKRO mode will always be enabled until it is toggled again during a
+ * power-up.
+ *
+ */
+//#define FORCE_NKRO
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS  true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS  true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP1          H
+//#define MAGIC_KEY_HELP2          SLASH
+//#define MAGIC_KEY_DEBUG          D
+//#define MAGIC_KEY_DEBUG_MATRIX   X
+//#define MAGIC_KEY_DEBUG_KBD      K
+//#define MAGIC_KEY_DEBUG_MOUSE    M
+//#define MAGIC_KEY_VERSION        V
+//#define MAGIC_KEY_STATUS         S
+//#define MAGIC_KEY_CONSOLE        C
+//#define MAGIC_KEY_LAYER0_ALT1    ESC
+//#define MAGIC_KEY_LAYER0_ALT2    GRAVE
+//#define MAGIC_KEY_LAYER0         0
+//#define MAGIC_KEY_LAYER1         1
+//#define MAGIC_KEY_LAYER2         2
+//#define MAGIC_KEY_LAYER3         3
+//#define MAGIC_KEY_LAYER4         4
+//#define MAGIC_KEY_LAYER5         5
+//#define MAGIC_KEY_LAYER6         6
+//#define MAGIC_KEY_LAYER7         7
+//#define MAGIC_KEY_LAYER8         8
+//#define MAGIC_KEY_LAYER9         9
+//#define MAGIC_KEY_BOOTLOADER     PAUSE
+//#define MAGIC_KEY_LOCK           CAPS
+//#define MAGIC_KEY_EEPROM         E
+//#define MAGIC_KEY_NKRO           N
+//#define MAGIC_KEY_SLEEP_LED      Z
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboards/frosty_flake/frosty_flake.c b/keyboards/frosty_flake/frosty_flake.c
new file mode 100644 (file)
index 0000000..1cd4760
--- /dev/null
@@ -0,0 +1,63 @@
+#include "frosty_flake.h"
+
+void matrix_init_kb(void) {
+    // put your keyboard start-up code here
+    // runs once when the firmware starts up
+
+    matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+    // put your looping keyboard code here
+    // runs every cycle (a lot)
+
+    matrix_scan_user();
+}
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+    // put your per-action keyboard code here
+    // runs for every action, just before processing by the firmware
+
+    return process_record_user(keycode, record);
+}
+
+void led_set_kb(uint8_t usb_led) {
+    DDRB |= (1<<7);
+    DDRC |= (1<<5) | (1<<6);
+
+    print_dec(usb_led);
+
+    if (usb_led & (1<<USB_LED_CAPS_LOCK))
+        PORTC &= ~(1<<5);
+    else
+        PORTC |=  (1<<5);
+
+    if (usb_led & (1<<USB_LED_NUM_LOCK))
+        PORTB &= ~(1<<7);
+    else
+        PORTB |=  (1<<7);
+
+    if (usb_led & (1<<USB_LED_SCROLL_LOCK))
+        PORTC &= ~(1<<6);
+    else
+        PORTC |=  (1<<6);
+
+    led_set_user(usb_led);
+}
+
+__attribute__ ((weak))
+void matrix_init_user(void) {
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+}
+
+__attribute__ ((weak))
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  return true;
+}
+
+__attribute__ ((weak))
+void led_set_user(uint8_t usb_led) {
+}
\ No newline at end of file
diff --git a/keyboards/frosty_flake/frosty_flake.h b/keyboards/frosty_flake/frosty_flake.h
new file mode 100644 (file)
index 0000000..3b52df6
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef FROSTY_FLAKE_H
+#define FROSTY_FLAKE_H
+
+#include "quantum.h"
+
+// This a shortcut to help you visually see your layout.
+// The following is an example using the Planck MIT layout
+// The first section contains all of the arguements
+// The second converts the arguments into a two-dimensional array
+
+/*
+  Matrix col/row mapping
+
+  ,----.    ,-------------------. ,-------------------. ,-------------------. ,--------------.
+  | J6 |    | I4 | H4 | H2 | H6 | | A7 | E6 | D2 | D4 | | B4 | B7 | B6 | B0 | | C7 | C5 | A5 |
+  `----'    `-------------------' `-------------------' `-------------------' `--------------'
+  ,-------------------------------------------------------------------------. ,--------------. ,-------------------.
+  | J4 | J7 | I7 | H7 | G7 | G4 | F4 | F7 | E7 | D7 | R7 | R4 | E4 |     B2 | | L4 | O4 | Q4 | | K1 | L1 | Q1 | Q0 |
+  |-------------------------------------------------------------------------| |--------------| |-------------------|
+  | J2   | J5 | I5 | H5 | G5 | G2 | F2 | F5 | E5 | D5 | R5 | R2 | E2 |   B3 | | K4 | O7 | Q7 | | K5 | L5 | Q5 | O5 |
+  |-------------------------------------------------------------------------| '--------------' |--------------     |
+  | O5    | J3 | I3 | H3 | G3 | G6 | F6 | F3 | E3 | D3 | R3 | R6 |       B1 |                  | K2 | L2 | Q2 |    |
+  |-------------------------------------------------------------------------|      ,----.      |-------------------|
+  | N2      | J1 | I1 | H1 | G1 | G0 | F0 | F1 | E1 | D1 | R0 |          N3 |      | O6 |      | K3 | L3 | Q3 | O3 |
+  |-------------------------------------------------------------------------| ,--------------. |--------------     |
+  | A4 | P2 | C6 |                  K6                  | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6      | Q6 |    |
+  `-------------------------------------------------------------------------' `--------------' `-------------------'
+*/
+#define KEYMAP( \
+  KJ6,      KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0,   KC7, KC5, KA5,                       \
+  KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2,   KL4, KO4, KQ4,   KK1, KL1, KQ1, KQ0, \
+  KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3,   KK4, KO7, KQ7,   KK5, KL5, KQ5, KO5, \
+  KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6,      KB1,                    KK2, KL2, KQ2,      \
+  KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0,      KN3,        KO6,        KK3, KL3, KQ3, KO3, \
+  KA4, KP2, KC6,                KK6,                KC0, KM3, KD0, KA1,   KO0, KK0, KL0,   KL6,      KQ6       \
+) \
+{ \
+/* Columns and rows need to be swapped in the below definition */ \
+/*          A       B       C       D       E       F       G       H       I       J       K       L       M       N       O       P       Q       R       */ \
+/* 0 */ {   KC_NO,  KB0,    KC0,    KD0,    KC_NO,  KF0,    KG0,    KC_NO,  KC_NO,  KC_NO,  KK0,    KL0,    KC_NO,  KC_NO,  KO0,    KC_NO,  KQ0,    KR0     }, \
+/* 1 */ {   KA1,    KB1,    KC_NO,  KD1,    KE1,    KF1,    KG1,    KH1,    KI1,    KJ1,    KK1,    KL1,    KC_NO,  KC_NO,  KC_NO,  KC_NO,  KQ1,    KC_NO   }, \
+/* 2 */ {   KC_NO,  KB2,    KC_NO,  KD2,    KE2,    KF2,    KG2,    KH2,    KI2,    KJ2,    KK2,    KL2,    KC_NO,  KN2,    KC_NO,  KP2,    KQ2,    KR2     }, \
+/* 3 */ {   KC_NO,  KB3,    KC_NO,  KD3,    KE3,    KF3,    KG3,    KH3,    KI3,    KJ3,    KK3,    KL3,    KM3,    KN3,    KO3,    KC_NO,  KQ3,    KR3     }, \
+/* 4 */ {   KA4,    KB4,    KC_NO,  KD4,    KE4,    KF4,    KG4,    KH4,    KI4,    KJ4,    KK4,    KL4,    KC_NO,  KC_NO,  KO4,    KC_NO,  KQ4,    KR4     }, \
+/* 5 */ {   KA5,    KC_NO,  KC5,    KD5,    KE5,    KF5,    KG5,    KH5,    KI5,    KJ5,    KK5,    KL5,    KC_NO,  KC_NO,  KO5,    KC_NO,  KQ5,    KR5     }, \
+/* 6 */ {   KC_NO,  KB6,    KC6,    KC_NO,  KE6,    KF6,    KG6,    KH6,    KI6,    KJ6,    KK6,    KL6,    KC_NO,  KC_NO,  KO6,    KC_NO,  KQ6,    KR6     }, \
+/* 7 */ {   KA7,    KB7,    KC7,    KD7,    KE7,    KF7,    KG7,    KH7,    KI7,    KJ7,    KC_NO,  KC_NO,  KC_NO,  KC_NO,  KO7,    KC_NO,  KQ7,    KR7     }  \
+}
+
+#endif
diff --git a/keyboards/frosty_flake/keymaps/default/Makefile b/keyboards/frosty_flake/keymaps/default/Makefile
new file mode 100644 (file)
index 0000000..9d3df59
--- /dev/null
@@ -0,0 +1,21 @@
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = yes        # Commands for debug and configuration
+NKRO_ENABLE = yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = no           # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
diff --git a/keyboards/frosty_flake/keymaps/default/config.h b/keyboards/frosty_flake/keymaps/default/config.h
new file mode 100644 (file)
index 0000000..8893d12
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CONFIG_USER_H
+#define CONFIG_USER_H
+
+#include "../../config.h"
+
+// place overrides here
+
+#endif
diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c
new file mode 100644 (file)
index 0000000..4dc7ed6
--- /dev/null
@@ -0,0 +1,11 @@
+#include "frosty_flake.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+[0] = KEYMAP(\
+       KC_ESC,  KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9, KC_F10, KC_F11, KC_F12,          KC_PSCR,KC_SLCK,KC_PAUS,                        \
+       KC_GRV,   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,KC_HOME,KC_PGUP,  KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
+       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, KC_END,KC_PGDN,    KC_P7,  KC_P8,  KC_P9,KC_PPLS, \
+      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_P4,  KC_P5,  KC_P6,      \
+      KC_LSFT,KC_NUBS,   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_P1,  KC_P2,  KC_P3,KC_PENT, \
+      KC_LCTL,KC_LGUI,KC_LALT,                 KC_SPC,                                KC_RALT,KC_RGUI, KC_APP,KC_RCTL,  KC_LEFT,KC_DOWN,KC_RGHT,    KC_P0,KC_PDOT)
+};
\ No newline at end of file
diff --git a/keyboards/frosty_flake/keymaps/default/readme.md b/keyboards/frosty_flake/keymaps/default/readme.md
new file mode 100644 (file)
index 0000000..11bf482
--- /dev/null
@@ -0,0 +1 @@
+# The default keymap for frosty_flake
diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c
new file mode 100644 (file)
index 0000000..05dffdb
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+  Copyright 2017 Gabriel Young <gabeplaysdrums@live.com>
+
+  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
+  the Free Software Foundation, either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <avr/io.h>
+#include <util/delay.h>
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+
+#ifndef DEBOUNCING_DELAY
+#   define DEBOUNCING_DELAY 5
+#endif
+static uint8_t debouncing = DEBOUNCING_DELAY;
+
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+static matrix_row_t scan_col(void) {
+    return (
+        (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) |
+        (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) |
+        (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) |
+        (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) |
+        (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) |
+        (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) |
+        (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) |
+        (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7))
+    );
+}
+
+static void select_col(uint8_t col) {
+    switch (col) {
+        case  0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break;
+        case  1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break;
+        case  2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break;
+        case  3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break;
+        case  4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break;
+        case  5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break;
+        case  6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break;
+        case  7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break;
+        case  8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break;
+        case  9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break;
+        case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break;
+        case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break;
+        case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break;
+        case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break;
+        case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break;
+        case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break;
+        case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break;
+        case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break;
+    }
+}
+
+void matrix_init(void) {
+    /* Row output pins */
+    DDRD  |=  0b01111011;
+    /* Column input pins */
+    DDRC  &= ~0b10000000;
+    DDRB  &= ~0b01111111;
+    PORTC |=  0b10000000;
+    PORTB |=  0b01111111;
+
+    for (uint8_t i=0; i < MATRIX_ROWS; i++)
+        matrix[i] = matrix_debouncing[i] = 0;
+
+    matrix_init_quantum();
+}
+
+uint8_t matrix_scan(void) {
+    for (uint8_t col = 0; col < MATRIX_COLS; col++) {
+        select_col(col);
+        _delay_us(3);
+        matrix_row_t col_scan = scan_col();
+        for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+            bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col);
+            bool curr_bit = col_scan & (1<<row);
+            if (prev_bit != curr_bit) {
+                matrix_debouncing[row] ^= ((matrix_row_t)1<<col);
+                debouncing = DEBOUNCING_DELAY;
+            }
+        }
+    }
+
+    if (debouncing) {
+        if (--debouncing)
+            _delay_ms(1);
+        else
+            for (uint8_t i = 0; i < MATRIX_ROWS; i++)
+                matrix[i] = matrix_debouncing[i];
+    }
+
+    matrix_scan_quantum();
+    return 1;
+}
+
+inline matrix_row_t matrix_get_row(uint8_t row) {
+    return matrix[row];
+}
+
+void matrix_print(void) {
+    print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        matrix_row_t matrix_row = matrix_get_row(row);
+        xprintf("%02X: ", row);
+        for (uint8_t col = 0; col < MATRIX_COLS; col++) {
+            bool curr_bit = matrix_row & (1<<col);
+            xprintf("%c", curr_bit ? '*' : '.');
+        }
+        print("\n");
+    }
+}
+
+uint8_t matrix_key_count(void) {
+    uint8_t count = 0;
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++)
+        count += bitpop32(matrix[row]);
+    return count;
+}
\ No newline at end of file
diff --git a/keyboards/frosty_flake/readme.md b/keyboards/frosty_flake/readme.md
new file mode 100644 (file)
index 0000000..ff440e3
--- /dev/null
@@ -0,0 +1,32 @@
+frosty_flake keyboard firmware
+======================
+
+This is the firmware for Rev. 20140521 of the Frosty Flake controller by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), a replacement controller for the [Cooler Master Quick Fire Rapid](http://www.coolermaster.com/peripheral/keyboards/quickfirerapid/).
+
+The code was adapted from the [BathroomEpiphanies TMK Firmware](https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers), but has been cleaned up to match the [schematic](https://deskthority.net/wiki/File:Frosty_Flake_Schematics.pdf) and gone through some minor refactoring for QMK.
+
+## Quantum MK Firmware
+
+For the full Quantum feature list, see [the parent readme](/).
+
+## Building
+
+Download or clone the whole firmware and navigate to the keyboards/frosty_flake folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. 
+
+Depending on which keymap you would like to use, you will have to compile slightly differently.
+
+### Default
+
+To build with the default keymap, simply run `make default`.
+
+### Other Keymaps
+
+Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
+
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
+```
+$ make [default|jack|<name>]
+```
+
+Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/frosty_flake/rules.mk b/keyboards/frosty_flake/rules.mk
new file mode 100644 (file)
index 0000000..dd2f4b6
--- /dev/null
@@ -0,0 +1,71 @@
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u2
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # Virtual DIP switch configuration(+1000)
+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 ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+FAUXCLICKY_ENABLE ?= no      # Use buzzer to emulate clicky switches
+
+CUSTOM_MATRIX = yes
+SRC += matrix.c
\ No newline at end of file
diff --git a/keyboards/xd60/keymaps/cheese/README.md b/keyboards/xd60/keymaps/cheese/README.md
new file mode 100644 (file)
index 0000000..8a5b97c
--- /dev/null
@@ -0,0 +1,13 @@
+# cheese's Layout
+Customized xd60 keymap 
+
+![Base Layout](base_layout.png "Base Layout")
+![Fn Layout](fn_layout.png "Fn Layout")
+
+## Programming Instructions:
+`cd` into keymap directory, `make dfu`
+
+## Features
+- Media keys and movement keys setup like on the pok3r
+- Lower right movement keys setup like on the fc660m (fn+direction for home/end/page up and down)
+- Caps lock can be triggered by pressing both shift keys at the same time (and deactivated the same way)
diff --git a/keyboards/xd60/keymaps/cheese/base_layout.png b/keyboards/xd60/keymaps/cheese/base_layout.png
new file mode 100644 (file)
index 0000000..211c4c7
Binary files /dev/null and b/keyboards/xd60/keymaps/cheese/base_layout.png differ
diff --git a/keyboards/xd60/keymaps/cheese/fn_layout.png b/keyboards/xd60/keymaps/cheese/fn_layout.png
new file mode 100644 (file)
index 0000000..fe5ae99
Binary files /dev/null and b/keyboards/xd60/keymaps/cheese/fn_layout.png differ
diff --git a/keyboards/xd60/keymaps/cheese/keymap.c b/keyboards/xd60/keymaps/cheese/keymap.c
new file mode 100644 (file)
index 0000000..25919a4
--- /dev/null
@@ -0,0 +1,67 @@
+#include "xd60.h"
+#include "action_layer.h"
+
+// Each layer gets a name for readability.
+// The underscores don't mean anything - you can
+// have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same 
+// length, and you can also skip them entirely
+// and just use numbers.
+#define _BL 0
+#define _FL 1
+#define _LS 2
+#define _RS 3
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+  /* (Base Layer) 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|  [|  ]|  \  |
+   * |-----------------------------------------------------------|
+   * |FUNCTION|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return|
+   * |-----------------------------------------------------------|
+   * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift     |
+   * |-----------------------------------------------------------|
+   * |Ctrl|Gui |Alt |      Space           |FN|Left|Up|Down|Right|
+   * `-----------------------------------------------------------'
+   */
+  [_BL] = KEYMAP(
+      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_BSPC,  \
+      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,            \
+      MO(_FL), KC_A,    KC_S,    KC_D,    KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,    KC_SCLN, KC_QUOT,  KC_NO,    KC_ENT,             \
+      F(0), KC_NO,   KC_Z,    KC_X,    KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM, KC_DOT,  KC_SLSH,  F(1),  F(1),  F(1),  \
+      KC_LCTL, KC_LGUI, KC_LALT,                          KC_SPC,                          MO(_FL), KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT),
+
+// Function Layer
+  [_FL] = KEYMAP(
+      KC_GRV,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,    KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_DEL,  KC_DEL,  \
+      KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_CALC, KC_INS,  KC_PGUP,  KC_UP,   KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \
+      KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU,  KC_TRNS,  KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, \
+      KC_TRNS, KC_TRNS, KC_APP,  KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD,  KC_TRNS, KC_TRNS, KC_TRNS, \
+      KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                        KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END),
+
+// Left Shift Layer
+  [_LS] = KEYMAP(
+      KC_GRV, 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, 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, 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_CAPS, KC_CAPS, \
+      KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+
+// Right Shift Layer
+  [_RS] = KEYMAP(
+      KC_GRV, 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, 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
+      KC_CAPS, 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, KC_TRNS,                            KC_TRNS,                        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+
+};
+
+// Custom Actions
+const uint16_t PROGMEM fn_actions[] = {
+    [0] = ACTION_LAYER_MODS(_LS, MOD_LSFT),
+    [1] = ACTION_LAYER_MODS(_RS, MOD_RSFT),
+};
index 582f8920b19638e680d9ef9bf6032ce210362966..807a7084a9717fa4c44d57afecd9b6d917761347 100644 (file)
@@ -294,14 +294,6 @@ bool process_record_quantum(keyrecord_t *record) {
       return false;
       break;
     #endif
-    #ifdef ADAFRUIT_BLE_ENABLE
-    case OUT_BLE:
-      if (record->event.pressed) {
-        set_output(OUTPUT_ADAFRUIT_BLE);
-      }
-      return false;
-      break;
-    #endif
     #endif
     case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
       if (record->event.pressed) {
index 903d57f1ee034fe2433ae89cc53e9033ad347c1e..78b02a0debb4f15217936ef0d0090a8f279e3c9f 100644 (file)
@@ -159,9 +159,6 @@ enum quantum_keycodes {
 #ifdef BLUETOOTH_ENABLE
     OUT_BT,
 #endif
-#ifdef ADAFRUIT_BLE_ENABLE
-    OUT_BLE,
-#endif
 
     // always leave at the end
     SAFE_RANGE
index a86dccc6165fc66d3fce104ae7055ff54a6cac19..47f6fc5719fc85933348c3333ed53cf0c4d633e5 100644 (file)
@@ -93,14 +93,20 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
     TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
 endif
 
-ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
-    TMK_COMMON_DEFS += -DADAFRUIT_BLE_ENABLE
-endif
-
 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
     TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
 endif
 
+ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
+               TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
+               TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_BLE
+endif
+
+ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
+               TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
+               TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_EZKEY
+endif
+
 ifeq ($(strip $(ONEHAND_ENABLE)), yes)
     TMK_COMMON_DEFS += -DONEHAND_ENABLE
 endif
index de0cc795f68a5011cbc9e63263b020f2b79d58d6..5b157797230abd99b2ff33be8b713db48943472a 100644 (file)
@@ -22,11 +22,16 @@ ifeq ($(strip $(MIDI_ENABLE)), yes)
        include $(TMK_PATH)/protocol/midi.mk
 endif
 
-ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
-       LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
+ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
+       LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
+       $(TMK_DIR)/protocol/serial_uart.c
 endif
 
-ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
+ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
+               LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
+endif
+
+ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
        LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
        $(TMK_DIR)/protocol/serial_uart.c
 endif
@@ -54,6 +59,7 @@ LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
 LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 
+LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
 
 # Remote wakeup fix for ATmega32U2        https://github.com/tmk/tmk_keyboard/issues/361
index 351fd55ae92e664c7a3dd7018ed8f9d333a580a2..b3bab3ca0997b6ebc8d8957bb331f6202218c8f5 100644 (file)
@@ -3,7 +3,7 @@
  * Supports the Adafruit BLE board built around the nRF51822 chip.
  */
 #pragma once
-#ifdef ADAFRUIT_BLE_ENABLE
+#ifdef MODULE_ADAFRUIT_BLE
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
@@ -57,4 +57,4 @@ extern bool adafruit_ble_set_power_level(int8_t level);
 }
 #endif
 
-#endif // ADAFRUIT_BLE_ENABLE
+#endif // MODULE_ADAFRUIT_BLE
index ba49284c9ba2b10bf621565263a62eaef7374fb1..4cb23ebc80bae5446e063bceb344f6637f6b5b01 100644 (file)
 #endif
 
 #ifdef BLUETOOTH_ENABLE
-    #include "bluetooth.h"
-#endif
-#ifdef ADAFRUIT_BLE_ENABLE
+  #ifdef MODULE_ADAFRUIT_BLE
     #include "adafruit_ble.h"
+  #else
+    #include "bluetooth.h"
+  #endif
 #endif
 
 #ifdef VIRTSER_ENABLE
@@ -602,18 +603,16 @@ static void send_keyboard(report_keyboard_t *report)
     uint8_t where = where_to_send();
 
 #ifdef BLUETOOTH_ENABLE
-    if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
-        bluefruit_serial_send(0xFD);
-        for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) {
-            bluefruit_serial_send(report->raw[i]);
-        }
-    }
-#endif
-
-#ifdef ADAFRUIT_BLE_ENABLE
-    if (where == OUTPUT_ADAFRUIT_BLE) {
+  if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
+    #ifdef MODULE_ADAFRUIT_BLE
       adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys));
-    }
+    #else
+      bluefruit_serial_send(0xFD);
+      for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) {
+        bluefruit_serial_send(report->raw[i]);
+      }
+    #endif
+  }
 #endif
 
     if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
@@ -660,24 +659,22 @@ static void send_mouse(report_mouse_t *report)
     uint8_t where = where_to_send();
 
 #ifdef BLUETOOTH_ENABLE
-    if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
-        bluefruit_serial_send(0xFD);
-        bluefruit_serial_send(0x00);
-        bluefruit_serial_send(0x03);
-        bluefruit_serial_send(report->buttons);
-        bluefruit_serial_send(report->x);
-        bluefruit_serial_send(report->y);
-        bluefruit_serial_send(report->v); // should try sending the wheel v here
-        bluefruit_serial_send(report->h); // should try sending the wheel h here
-        bluefruit_serial_send(0x00);
-    }
-#endif
-
-#ifdef ADAFRUIT_BLE_ENABLE
-    if (where == OUTPUT_ADAFRUIT_BLE) {
+  if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
+    #ifdef MODULE_ADAFRUIT_BLE
       // FIXME: mouse buttons
       adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h);
-    }
+    #else
+      bluefruit_serial_send(0xFD);
+      bluefruit_serial_send(0x00);
+      bluefruit_serial_send(0x03);
+      bluefruit_serial_send(report->buttons);
+      bluefruit_serial_send(report->x);
+      bluefruit_serial_send(report->y);
+      bluefruit_serial_send(report->v); // should try sending the wheel v here
+      bluefruit_serial_send(report->h); // should try sending the wheel h here
+      bluefruit_serial_send(0x00);
+    #endif
+  }
 #endif
 
     if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
@@ -727,6 +724,9 @@ static void send_consumer(uint16_t data)
 
 #ifdef BLUETOOTH_ENABLE
     if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
+      #ifdef MODULE_ADAFRUIT_BLE
+        adafruit_ble_send_consumer_key(data, 0);
+      #else
         static uint16_t last_data = 0;
         if (data == last_data) return;
         last_data = data;
@@ -740,12 +740,7 @@ static void send_consumer(uint16_t data)
         bluefruit_serial_send(0x00);
         bluefruit_serial_send(0x00);
         bluefruit_serial_send(0x00);
-    }
-#endif
-
-#ifdef ADAFRUIT_BLE_ENABLE
-    if (where == OUTPUT_ADAFRUIT_BLE) {
-      adafruit_ble_send_consumer_key(data, 0);
+      #endif
     }
 #endif
 
@@ -1130,7 +1125,7 @@ int main(void)
     // midi_send_noteoff(&midi_device, 0, 64, 127);
 #endif
 
-#ifdef BLUETOOTH_ENABLE
+#ifdef MODULE_ADAFRUIT_EZKEY
     serial_init();
 #endif
 
@@ -1161,7 +1156,7 @@ int main(void)
 
     print("Keyboard start.\n");
     while (1) {
-        #if !defined(BLUETOOTH_ENABLE) && !defined(ADAFRUIT_BLE_ENABLE)
+        #if !defined(BLUETOOTH_ENABLE)
         while (USB_DeviceState == DEVICE_STATE_Suspended) {
             print("[s]");
             suspend_power_down();
@@ -1182,7 +1177,7 @@ int main(void)
         rgblight_task();
 #endif
 
-#ifdef ADAFRUIT_BLE_ENABLE
+#ifdef MODULE_ADAFRUIT_BLE
         adafruit_ble_task();
 #endif
 
index 5d2457bfff588cbf6672fc72e56e018cae050367..0df5d3b75a01a5adc1fdca85637359c447b1b380 100644 (file)
@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "lufa.h"
 #include "outputselect.h"
-#ifdef ADAFRUIT_BLE_ENABLE
+#ifdef MODULE_ADAFRUIT_BLE
     #include "adafruit_ble.h"
 #endif
 
@@ -34,9 +34,9 @@ uint8_t auto_detect_output(void) {
         return OUTPUT_USB;
     }
 
-#ifdef ADAFRUIT_BLE_ENABLE
+#ifdef MODULE_ADAFRUIT_BLE
     if (adafruit_ble_is_connected()) {
-        return OUTPUT_ADAFRUIT_BLE;
+        return OUTPUT_BLUETOOTH;
     }
 #endif
 
index 79b4dd35dda253912b89f38caf1f340e4a46d524..28cc3298e61f9a3869b79a07a18e256dd83055af 100644 (file)
@@ -18,7 +18,6 @@ enum outputs {
     OUTPUT_NONE,
     OUTPUT_USB,
     OUTPUT_BLUETOOTH,
-    OUTPUT_ADAFRUIT_BLE,
 
     // backward compatibility
     OUTPUT_USB_AND_BT