Browse Source

Merge branch 'master' into flicker-fix

Peter Eichinger 10 years ago
parent
commit
78192791bc
62 changed files with 7863 additions and 566 deletions
  1. 323 0
      HAND-WIRE.md
  2. 41 11
      README.md
  3. 2 0
      keyboard/ergodox_ez/config.h
  4. 1471 0
      keyboard/ergodox_ez/keymaps/colemak/colemak.hex
  5. 184 0
      keyboard/ergodox_ez/keymaps/colemak/keymap.c
  6. 4 0
      keyboard/ergodox_ez/keymaps/colemak/readme.md
  7. 1 68
      keyboard/ergodox_ez/keymaps/jack/keymap.c
  8. 299 0
      keyboard/ergodox_ez/keymaps/osx_de/keymap.c
  9. 22 22
      keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex
  10. 64 62
      keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c
  11. 136 0
      keyboard/ergodox_ez/keymaps/tm2030/README.md
  12. 258 0
      keyboard/ergodox_ez/keymaps/tm2030/keymap.c
  13. 1544 0
      keyboard/ergodox_ez/keymaps/tm2030/keymap.hex
  14. 184 0
      keyboard/ergodox_ez/keymaps/tonyabra_osx/keymap.c
  15. 5 0
      keyboard/ergodox_ez/keymaps/tonyabra_osx/readme.md
  16. 1471 0
      keyboard/ergodox_ez/keymaps/tonyabra_osx/tonyabra_osx.hex
  17. 27 6
      keyboard/planck/Makefile
  18. 87 39
      keyboard/planck/README.md
  19. 9 0
      keyboard/planck/config.h
  20. 0 0
      keyboard/planck/keymaps/alexey.c
  21. 0 0
      keyboard/planck/keymaps/angerthosenear.c
  22. 0 0
      keyboard/planck/keymaps/austin.c
  23. 0 0
      keyboard/planck/keymaps/charlie.c
  24. 0 0
      keyboard/planck/keymaps/daniel.c
  25. 0 0
      keyboard/planck/keymaps/david.c
  26. 34 0
      keyboard/planck/keymaps/default/README.md
  27. 6 2
      keyboard/planck/keymaps/keymap_default.c
  28. 0 0
      keyboard/planck/keymaps/dzobert.c
  29. 0 0
      keyboard/planck/keymaps/gabriel.c
  30. 0 0
      keyboard/planck/keymaps/joe.c
  31. 0 50
      keyboard/planck/keymaps/keymap_jack.c
  32. 0 0
      keyboard/planck/keymaps/kyle.c
  33. 0 0
      keyboard/planck/keymaps/leo.c
  34. 3 0
      keyboard/planck/keymaps/lock/README.md
  35. 45 10
      keyboard/planck/keymaps/keymap_lock.c
  36. 0 0
      keyboard/planck/keymaps/max.c
  37. 0 0
      keyboard/planck/keymaps/monkey.c
  38. 0 0
      keyboard/planck/keymaps/numpad.c
  39. BIN
      keyboard/planck/keymaps/yang/WS2812-wiring.jpg
  40. 85 5
      quantum/template/keymaps/keymap_default.c
  41. BIN
      keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg
  42. 6 1
      keyboard/planck/planck.c
  43. 12 4
      keyboard/planck/planck.h
  44. 1 1
      new_project.sh
  45. 362 0
      quantum/audio.c
  46. 3 4
      quantum/beeps.h
  47. 0 246
      quantum/beeps.c
  48. 10 11
      quantum/keymap_midi.c
  49. 2 0
      quantum/keymap_midi.h
  50. 2 0
      quantum/keymap_unicode.c
  51. 181 0
      quantum/light_ws2812.c
  52. 73 0
      quantum/light_ws2812.h
  53. 27 4
      quantum/quantum.mk
  54. 505 0
      quantum/rgblight.c
  55. 87 0
      quantum/rgblight.h
  56. 3 3
      quantum/template/Makefile
  57. 3 3
      quantum/template/README.md
  58. 4 4
      quantum/template/config.h
  59. 4 8
      quantum/template/template.h
  60. 265 0
      quantum/wave.h
  61. 3 0
      tmk_core/common.mk
  62. 5 2
      tmk_core/protocol/lufa/lufa.c

File diff suppressed because it is too large
+ 323 - 0
HAND-WIRE.md


+ 41 - 11
README.md

@@ -73,7 +73,7 @@ The following shortcuts automatically add `LSFT()` to keycodes to get commonly u
     KC_PIPE  |
     KC_COLN  :
 
-`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. 
+`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down.
 
 These are the values you can use for the `mod` in `MT()` (right-hand modifiers are not available):
 
@@ -86,15 +86,15 @@ These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LS
 
 We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact:
 
-  * `CTL_T(kc)` - is LCTL when held and *kc* when tapped 
-  * `SFT_T(kc)` - is LSFT when held and *kc* when tapped 
-  * `ALT_T(kc)` - is LALT when held and *kc* when tapped 
-  * `GUI_T(kc)` - is LGUI when held and *kc* when tapped 
+  * `CTL_T(kc)` - is LCTL when held and *kc* when tapped
+  * `SFT_T(kc)` - is LSFT when held and *kc* when tapped
+  * `ALT_T(kc)` - is LALT when held and *kc* when tapped
+  * `GUI_T(kc)` - is LGUI when held and *kc* when tapped
   * `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)
   * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped
   * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift.
 
-### Temporarily setting the default layer 
+### Temporarily setting the default layer
 
 `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does.
 
@@ -115,7 +115,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) //
     case 0: // this would trigger when you hit a key mapped as M(0)
       if (record->event.pressed) {
         return MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END  ); // this sends the string 'hello' when the macro executes
-      } 
+      }
       break;
   }
   return MACRO_NONE;
@@ -141,11 +141,11 @@ Everything is assuming you're in Qwerty (in software) by default, but there is b
    #include "keymap_<layout>.h"
 
 Where <layout> is "colemak" or "dvorak". After including this line, you will get access to:
- 
+
  * `CM_*` for all of the Colemak-equivalent characters
  * `DV_*` for all of the Dvorak-equivalent characters
- 
-These implementations assume you're using Colemak or Dvorak on your OS, not on your keyboard - this is referred to as a software-implemented layout. If your computer is in Qwerty and your keymap is in Colemak or Dvorak, this is referred to as a firmware-implemented layout, and you won't need these features. 
+
+These implementations assume you're using Colemak or Dvorak on your OS, not on your keyboard - this is referred to as a software-implemented layout. If your computer is in Qwerty and your keymap is in Colemak or Dvorak, this is referred to as a firmware-implemented layout, and you won't need these features.
 
 To give an example, if you're using software-implemented Colemak, and want to get an `F`, you would use `CM_F` - `KC_F` under these same circumstances would result in `T`.
 
@@ -188,7 +188,7 @@ The method does not require Unicode support in the keyboard itself but depends i
 First you need to select a modifier combination that is not in use by any of your programs.
 CtrlAltWin is not used very widely and should therefore be perfect for this.
 There is a macro defined for a mod-tab combo `LCAG_T`.
-Add this mod-tab combo to a key on your keyboard, e.g.: `LCAG_T(KC_TAB)`. 
+Add this mod-tab combo to a key on your keyboard, e.g.: `LCAG_T(KC_TAB)`.
 This makes the key behave like a tab key if pressed and released immediately but changes it to the modifier if used with another key.
 
 In the default script of AutoHotkey you can define custom hotkeys.
@@ -198,3 +198,33 @@ In the default script of AutoHotkey you can define custom hotkeys.
 
 The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a.
 AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
+
+## RGB Under Glow Mod
+
+![Planck with RGB Underglow](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
+
+Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
+
+For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring the VCC, GND, and DI, you can enable the underglow in your Makefile.
+
+    RGBLIGHT_ENABLE = yes
+
+Please note that the underglow is not compatible with MIDI functions. So you cannot enable both of them at the same time.
+
+Please add the following options into your config.h, and set them up according your hardware configuration.
+
+    #define ws2812_PORTREG  PORTF
+    #define ws2812_DDRREG   DDRF
+    #define ws2812_pin PF4
+    #define RGBLED_NUM 14     // Number of LEDs
+    #define RGBLIGHT_HUE_STEP 10
+    #define RGBLIGHT_SAT_STEP 17
+    #define RGBLIGHT_VAL_STEP 17
+
+The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboard/planck/keymaps/yang/keymap.c`
+
+### WS2812 Wiring
+
+![WS2812 Wiring](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboard/planck/keymaps/yang/WS2812-wiring.jpg)
+
+Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.

+ 2 - 0
keyboard/ergodox_ez/config.h

@@ -38,6 +38,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define MOUSEKEY_MAX_SPEED      3
 #define MOUSEKEY_TIME_TO_MAX    10
 
+#define TAPPING_TOGGLE  1
+
 #define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
 #define ROWS (int []){ D0, D5, B5, B6 }
 

File diff suppressed because it is too large
+ 1471 - 0
keyboard/ergodox_ez/keymaps/colemak/colemak.hex


+ 184 - 0
keyboard/ergodox_ez/keymaps/colemak/keymap.c

@@ -0,0 +1,184 @@
+#include "ergodox_ez.h"
+#include "debug.h"
+#include "action_layer.h"
+
+#define BASE 0 // default layer
+#define SYMB 1 // symbols
+#define MDIA 2 // media keys
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Basic layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   -    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * | Del    |   Q  |   W  |   F  |   P  |   G  |  L1  |           |  L1  |   J  |   L  |   U  |   Y  |   ;  |   \    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * | BkSp   |   A  |   R  |   S  |   T  |   D  |------|           |------|   H  |   N  |   E  |   I  |O / L2|   '    |
+ * |--------+------+------+------+------+------| Hyper|           | Meh  |------+------+------+------+------+--------|
+ * | LShift |Z/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   K  |   M  |   ,  |   .  |//Ctrl| RShift |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |Grv/L1|  '"  |AltShf| Left | Right|                                       |  Up  | Down |   [  |   ]  | ~L1  |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
+ *                                 ,------|------|------|       |------+--------+------.
+ *                                 |      |      | Home |       | PgUp |        |      |
+ *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
+ *                                 |      |ace   | End  |       | PgDn |        |      |
+ *                                 `--------------------'       `----------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[BASE] = KEYMAP(  // layer 0 : default
+        // left hand
+        KC_EQL,         KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   KC_LEFT,
+        KC_DELT,        KC_Q,         KC_W,   KC_F,   KC_P,   KC_G,   TG(SYMB),
+        KC_BSPC,        KC_A,         KC_R,   KC_S,   KC_T,   KC_D,
+        KC_LSFT,        CTL_T(KC_Z),  KC_X,   KC_C,   KC_V,   KC_B,   ALL_T(KC_NO),
+        LT(SYMB,KC_GRV),KC_QUOT,      LALT(KC_LSFT),  KC_LEFT,KC_RGHT,
+                                              ALT_T(KC_APP),  KC_LGUI,
+                                                              KC_HOME,
+                                               KC_SPC,KC_BSPC,KC_END,
+        // right hand
+             KC_RGHT,     KC_6,   KC_7,   KC_8,   KC_9,   KC_0,             KC_MINS,
+             TG(SYMB),    KC_J,   KC_L,   KC_U,   KC_Y,   KC_SCLN,          KC_BSLS,
+                          KC_H,   KC_N,   KC_E,   KC_I,   LT(MDIA, KC_O),   KC_QUOT,
+             MEH_T(KC_NO),KC_K,   KC_M,   KC_COMM,KC_DOT, CTL_T(KC_SLSH),   KC_RSFT,
+                                  KC_UP,  KC_DOWN,KC_LBRC,KC_RBRC,          KC_FN1,
+             KC_LALT,        CTL_T(KC_ESC),
+             KC_PGUP,
+             KC_PGDN,KC_TAB, KC_ENT
+    ),
+/* Keymap 1: Symbol Layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |   F12  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |   \  |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |    . |   0  |   =  |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |      |      |------|       |------|      |      |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// SYMBOLS
+[SYMB] = KEYMAP(
+       // left hand
+       KC_TRNS,KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_TRNS,
+       KC_TRNS,KC_EXLM,KC_AT,  KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
+       KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
+       KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
+                                       KC_TRNS,KC_TRNS,
+                                               KC_TRNS,
+                               KC_TRNS,KC_TRNS,KC_TRNS,
+       // right hand
+       KC_TRNS, KC_F6,   KC_F7,  KC_F8,   KC_F9,   KC_F10,  KC_F11,
+       KC_TRNS, KC_UP,   KC_7,   KC_8,    KC_9,    KC_ASTR, KC_F12,
+                KC_DOWN, KC_4,   KC_5,    KC_6,    KC_PLUS, KC_TRNS,
+       KC_TRNS, KC_AMPR, KC_1,   KC_2,    KC_3,    KC_BSLS, KC_TRNS,
+                         KC_TRNS,KC_DOT,  KC_0,    KC_EQL,  KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+/* Keymap 2: Media and mouse keys
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |      |      | MsUp |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |      |      |      |      |  Play  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |      |           |      |      |      | Prev | Next |      |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      | Lclk | Rclk |                                       |VolUp |VolDn | Mute |      |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |Brwser|
+ *                                 |      |      |------|       |------|      |Back  |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// MEDIA AND MOUSE
+[MDIA] = KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_TRNS, KC_TRNS, KC_TRNS,
+    // right hand
+       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_MPLY,
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
+                          KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_WBAK
+),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    [1] = ACTION_LAYER_TAP_TOGGLE(SYMB)                // FN1 - Momentary Layer 1 (Symbols)
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+  // MACRODOWN only works in this function
+      switch(id) {
+        case 0:
+        if (record->event.pressed) {
+          register_code(KC_RSFT);
+        } else {
+          unregister_code(KC_RSFT);
+        }
+        break;
+      }
+    return MACRO_NONE;
+};
+
+// Runs just one time when the keyboard initializes.
+void * matrix_init_user(void) {
+
+};
+
+// Runs constantly in the background, in a loop.
+void * matrix_scan_user(void) {
+
+    uint8_t layer = biton32(layer_state);
+
+    ergodox_board_led_off();
+    ergodox_right_led_1_off();
+    ergodox_right_led_2_off();
+    ergodox_right_led_3_off();
+    switch (layer) {
+      // TODO: Make this relevant to the ErgoDox EZ.
+        case 1:
+            ergodox_right_led_1_on();
+            break;
+        case 2:
+            ergodox_right_led_2_on();
+            break;
+        default:
+            // none
+            break;
+    }
+
+};

+ 4 - 0
keyboard/ergodox_ez/keymaps/colemak/readme.md

@@ -0,0 +1,4 @@
+# ErgoDox EZ Colemak Configuration
+
+Colemak layout with same layers as default ergodox ez keymap.
+

+ 1 - 68
keyboard/ergodox_ez/keymaps/jack/keymap.c

@@ -8,29 +8,6 @@
 #define MDIA 2 // media keys
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-/* Keymap 0: Basic layer
- *
- * ,--------------------------------------------------.           ,--------------------------------------------------.
- * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   -    |
- * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- * | Del    |   Q  |   W  |   E  |   R  |   T  |  L1  |           |  L1  |   Y  |   U  |   I  |   O  |   P  |   \    |
- * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * | BkSp   |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |; / L2|   '    |
- * |--------+------+------+------+------+------| Hyper|           | Meh  |------+------+------+------+------+--------|
- * | LShift |Z/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |//Ctrl| RShift |
- * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |Grv/L1|  '"  |AltShf| Left | Right|                                       |  Up  | Down |   [  |   ]  | ~L1  |
- *   `----------------------------------'                                       `----------------------------------'
- *                                        ,-------------.       ,-------------.
- *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
- *                                 ,------|------|------|       |------+--------+------.
- *                                 |      |      | Home |       | PgUp |        |      |
- *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
- *                                 |      |ace   | End  |       | PgDn |        |      |
- *                                 `--------------------'       `----------------------'
- */
-// If it accepts an argument (i.e, is a function), it doesn't need KC_.
-// Otherwise, it needs KC_*
 [BASE] = KEYMAP(  // layer 0 : default
         // left hand
         KC_NO,          KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   KC_NO,
@@ -51,28 +28,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
              KC_PGUP,
              KC_PGDN, KC_SPC,KC_SPC
     ),
-/* Keymap 1: Symbol Layer
- *
- * ,--------------------------------------------------.           ,--------------------------------------------------.
- * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
- * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |   F12  |
- * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |
- * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |   \  |        |
- * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |      |      |      |      |      |                                       |      |    . |   0  |   =  |      |
- *   `----------------------------------'                                       `----------------------------------'
- *                                        ,-------------.       ,-------------.
- *                                        |      |      |       |      |      |
- *                                 ,------|------|------|       |------+------+------.
- *                                 |      |      |      |       |      |      |      |
- *                                 |      |      |------|       |------|      |      |
- *                                 |      |      |      |       |      |      |      |
- *                                 `--------------------'       `--------------------'
- */
-// SYMBOLS
 [SYMB] = KEYMAP(
        // left hand
        KC_TRNS,KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_TRNS,
@@ -93,29 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS
 ),
-/* Keymap 2: Media and mouse keys
- *
- * ,--------------------------------------------------.           ,--------------------------------------------------.
- * |        |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
- * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- * |        |      |      | MsUp |      |      |      |           |      |      |      |      |      |      |        |
- * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |      |      |      |      |  Play  |
- * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |        |      |      |      |      |      |      |           |      |      |      | Prev | Next |      |        |
- * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |      |      |      | Lclk | Rclk |                                       |VolUp |VolDn | Mute |      |      |
- *   `----------------------------------'                                       `----------------------------------'
- *                                        ,-------------.       ,-------------.
- *                                        |      |      |       |      |      |
- *                                 ,------|------|------|       |------+------+------.
- *                                 |      |      |      |       |      |      |Brwser|
- *                                 |      |      |------|       |------|      |Back  |
- *                                 |      |      |      |       |      |      |      |
- *                                 `--------------------'       `--------------------'
- */
-// MEDIA AND MOUSE
-KEYMAP(
+[MDIA] = KEYMAP(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_TRNS,
        KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,  

+ 299 - 0
keyboard/ergodox_ez/keymaps/osx_de/keymap.c

@@ -0,0 +1,299 @@
+#include "ergodox_ez.h"
+#include "debug.h"
+#include "action_layer.h"
+#include "keymap_extras/keymap_german_osx.h"
+
+#define BASE 0 // default layer
+#define SYMB 1 // symbols
+#define MDIA 2 // media keys
+#define CRSR 3 // media keys
+#define NUMB 4 // number keys
+
+#define M_CTRL_CMDV 1
+#define M_CTRL_CMDC 2
+#define M_MEH_SH_ACUT 3
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Basic layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |  ESC   |   1  |   2  |   3  |   4  |   5  |CMD-V |           |CMD-C |   6  |   7  |   8  |   9  |   0  |   ß    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |  TAB   |   Q  |   W  |   E  |   R  |   T  | CMD  |           | CMD  |   Z  |   U  |   I  |   O  |   P  |   ü    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |  LALT  |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ö  |  ä/RALT|
+ * |--------+------+------+------+------+------| LALT |           | RALT |------+------+------+------+------+--------|
+ * | LShift |Y/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |-/Ctrl| RShift |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |</L1|  ^°  |AltShf| Left | Right|                                       |  Up  | Down | CMD-SHIFT |  +  | #/L1 |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,---------------.
+ *                                        | MDIA | Meh  |       | Hyper|  NUM   |
+ *                                 ,------|------|------|       |------+--------+------.
+ *                                 |      |      | Home |       | PgUp |        |      |
+ *                                 | Back-|  Del |------|       |------|  Enter | Space|
+ *                                 | Space|      | End  |       | PgDn |        |      |
+ *                                 `--------------------'       `----------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[BASE] = KEYMAP(  // layer 0 : default
+        // left hand
+        KC_ESC,                  DE_1,         DE_2,   DE_3,   DE_4,   DE_5,   M(M_CTRL_CMDV),
+        KC_TAB,                  DE_Q,         DE_W,   DE_E,   DE_R,   DE_T,   KC_LGUI,
+        KC_LALT,                   DE_A,         DE_S,   DE_D,   DE_F,   DE_G,
+        KC_LSFT,                 CTL_T(DE_Y),  DE_X,   DE_C,   DE_V,   DE_B,   KC_LALT,
+        LT(SYMB,KC_GRV),         DE_LESS,      LALT(KC_LSFT),  KC_LEFT,KC_RGHT,
+                                               			  	M(M_MEH_SH_ACUT), 	TG(2),
+                                                              					KC_HOME,
+                                               				KC_BSPC,KC_DEL,		KC_END,
+        // right hand
+             M(M_CTRL_CMDC),  DE_6,   DE_7,   DE_8,   DE_9,   DE_0,     	DE_SS,
+             KC_RGUI,     DE_Z,   DE_U,   DE_I,   DE_O,   DE_P,         	DE_UE,
+                          DE_H,   DE_J,   DE_K,   DE_L,   DE_OE,		ALT_T(DE_AE),
+             KC_RALT,	  DE_N,   DE_M,   DE_COMM,DE_DOT, CTL_T(DE_MINS),   	KC_RSFT,
+                                  KC_UP,  KC_DOWN,LGUI(KC_LSFT),DE_PLUS,        LT(SYMB,DE_HASH),
+             TG(4),	  ALL_T(DE_ACUT),
+             KC_PGUP,
+             KC_PGDN,KC_ENT, KC_SPC
+    ),
+/* Keymap 1: Symbol Layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |  <   |  >   |   !  |  ?   |      |      |           |      |   \  |   [  |   ]  |   |  |   #  |   F12  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   #  |   $  |   \  |   /  |   .  |------|           |------|   /  |   (  |   )  |   {  |   }  |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |   ^  |   %  |   |  |   ~  |      |           |      |   &  |   <  |   >  |   "  |   '  |    ?   |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |      |   .  |   !  |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |      |      |------|       |------|      |      |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// SYMBOLS
+[SYMB] = KEYMAP(
+       // left hand
+       KC_TRNS,KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_TRNS,
+       KC_TRNS,DE_LESS,DE_MORE,DE_EXLM,DE_QST, KC_TRNS,KC_TRNS,
+       KC_TRNS,DE_HASH,DE_DLR, DE_BSLS,DE_SLSH,KC_DOT,
+       KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,DE_PIPE,DE_TILD,KC_TRNS,
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
+                                       KC_TRNS,KC_TRNS,
+                                               KC_TRNS,
+                               KC_TRNS,KC_DEL,KC_TRNS,
+       // right hand
+       KC_TRNS, KC_F6,   KC_F7,  KC_F8,   KC_F9,   KC_F10,  KC_F11,
+       KC_TRNS, LALT(LSFT(KC_7)),   LALT(KC_5),   LALT(KC_6),    LALT(KC_7),    DE_HASH, KC_F12,
+                DE_SLSH,   DE_LPRN,   DE_RPRN,    LALT(KC_8),    LALT(KC_9), KC_TRNS,
+       KC_TRNS, DE_AMPR, KC_GRV,   LSFT(KC_GRV),    DE_DQOT,    DE_QUOT, DE_QST,
+                         KC_TRNS,KC_DOT,  KC_EXLM,    KC_TRNS,  KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+/* Keymap 2: Media and mouse keys
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |      |      |      |      |      |      |           | Mute |      |      |      |      |      |  Play  |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |      | Lclk | MsUp | Rclk | WlUp |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |MsLeft|MsDown|MsRght| WlDw |------|           |------|VolUp |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      | MClk |      |           |      |VolDn |      | Prev | Next | Up   |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |      | Left | Down | Right |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |Brwser|
+ *                                 |      |      |------|       |------|      |Back  |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// MEDIA AND MOUSE
+KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D,
+       KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_TRNS, KC_TRNS, KC_TRNS,
+    // right hand
+       KC_MUTE,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+                 KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS,  KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP,   KC_TRNS,
+                          KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_WBAK
+),
+// ADNW-KOY layer
+/* Keymap 3: ADNW-Koy layer
+ * ADNW-Koy is a special layout designed to be ergonomic. Was created using software to determine the most ergonomic way to type German and English texts.
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |      |      |      |      |      |      |           |      |      |      |      |      |      |   -    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |   K  |   .  |   O  |   ,  |   Y  |      |           |      |   V  |   G  |   C  |   L  |   ß  |   Z    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   H  |   A  |   E  |   I  |   U  |------|           |------|   D  |   T  |   R  |   N |   S  |  F/L2  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |X/Ctrl|   Q  |   Ä  |   Ü  |   Ö  |      |           |      |   B  |   P  |   W  |   M  |J/Ctrl| RShift |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |</L1|  ^  |AltShf| Left | Right|                                       |  Up | Down | CMD-SHIFT |  ´  | //L1 |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+--------+------.
+ *                                 |      |      |      |       |      |        |      |
+ *                                 |      |      |------|       |------|        |      |
+ *                                 |      |      |      |       |      |        |      |
+ *                                 `--------------------'       `----------------------'
+ */
+KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_K,    KC_DOT,  KC_O,    KC_COMM, KC_Z,    KC_TRNS,
+       KC_TRNS, KC_H,    KC_A,    KC_E,    KC_I,    KC_U,
+       KC_TRNS, CTL_T(KC_X),KC_Q,    DE_AE,   DE_UE,   DE_OE,   KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_TRNS, KC_TRNS, KC_TRNS,
+    // right hand
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH,
+       KC_TRNS,  KC_V,    KC_G,    KC_C,    KC_L,    KC_MINS, KC_Y,
+                 KC_D,    KC_T,    KC_R,    KC_N,    KC_S, LT(MDIA,KC_F),
+       KC_TRNS,  KC_B,    KC_P,    KC_W,    KC_M,    CTL_T(KC_J), KC_TRNS,
+                          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+//number pad
+KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, 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,
+       // right hand
+       KC_TRNS, KC_F6,   KC_F7,  KC_F8,   KC_F9,   KC_F10,  KC_F11,
+       KC_TRNS, KC_UP,   KC_7,   KC_8,    KC_9,    LSFT(KC_RBRC), KC_F12,
+                KC_DOWN, KC_4,   KC_5,    KC_6,    KC_RBRC, KC_TRNS,
+       KC_TRNS, LSFT(KC_6), KC_1,   KC_2,    KC_3,    LSFT(KC_7), KC_TRNS,
+                         KC_0,KC_DOT,  KC_0,    KC_EQL,  KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    [1] = ACTION_LAYER_TAP_TOGGLE(SYMB),                // FN1 - Momentary Layer 1 (Symbols)
+    [2] = ACTION_LAYER_TAP_TOGGLE(CRSR)                // FN2 - Momentary Layer 2 (Cursors)
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+		static uint16_t start;
+  // MACRODOWN only works in this function
+      switch(id) {
+        case 0:
+		if (record->event.pressed) {
+		  register_code(KC_RSFT);
+		} else {
+		  unregister_code(KC_RSFT);
+		}
+		break;
+	case 1:
+		if (record->event.pressed) {
+			start = timer_read();
+			return MACRO(D(LCTRL), END);
+		} else {
+			if (timer_elapsed(start) > 150) {
+			    return MACRO(U(LCTRL), END);
+			} else {
+			    return MACRO(U(LCTRL), D(LGUI), T(V), U(LGUI), END);
+			}
+		}
+		break;
+	case 2:
+		if (record->event.pressed) {
+			start = timer_read();
+			return MACRO(D(LCTRL),END);
+		} else {
+			if (timer_elapsed(start) > 150){
+				return MACRO(U(LCTRL),END);
+			} else {
+				return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END);
+			}
+		}
+		break;
+	case 3:
+		if (record->event.pressed) {
+			start = timer_read();
+			return MACRO(D(LCTRL),D(LSFT),D(LALT),END);
+		} else {
+			if (timer_elapsed(start) > 150){
+				return MACRO(U(LCTRL),U(LSFT),U(LALT),END);
+			} else {
+				return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); //cannot use DE_ACUT here, as macro needs KC_ prefix
+			}
+		}
+		break;
+      }
+    return MACRO_NONE;
+};
+
+// Runs just one time when the keyboard initializes.
+void * matrix_init_user(void) {
+
+};
+
+// Runs constantly in the background, in a loop.
+void * matrix_scan_user(void) {
+
+    uint8_t layer = biton32(layer_state);
+
+    ergodox_board_led_off();
+    ergodox_right_led_1_off();
+    ergodox_right_led_2_off();
+    ergodox_right_led_3_off();
+    switch (layer) {
+      // TODO: Make this relevant to the ErgoDox EZ.
+        case 1:
+            ergodox_right_led_1_on();
+            break;
+        case 2:
+            ergodox_right_led_2_on();
+	    break;
+        case 3:
+            ergodox_right_led_3_on();
+            break;
+        case 4:
+	    ergodox_right_led_1_on();
+            ergodox_right_led_3_on();
+	    //ergodox_board_led_on();
+            break;
+        default:
+            // none
+            break;
+    }
+
+};

+ 22 - 22
keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex

@@ -16,17 +16,17 @@
 :1000F000E20001E001E101E20002E001E3010602A9
 :100100000602E30002E00001E00002E001E3011961
 :10011000021902E30002E00001E0000000F0A1F09B
-:10012000A329002B000354E100358100001E0014B8
+:10012000A329002B00E200E100358100001E00142D
 :100130000004001D7135004D001F001A0016001B41
 :1001400000E1044C00200008000700060050002ACF
 :100150000021001500090019004F004A0022001775
-:10016000000A000500000002540130E3000000E234
-:1001700000000003300230E7000000E60000002E1F
-:100180007F23001C000B0011000000045424001801
+:10016000000A000500000003300130E3000000E257
+:1001700000000002540230E7000000E60000000426
+:100180005423001C000B00110000002E7F240018D7
 :10019000000D00100052004B0025000C000E003630
 :1001A0000051002C00260012000F003700E1082843
 :1001B00000270013003300387130004E002D002F4F
-:1001C000003482E5003181000001000100010001DE
+:1001C000003474E5003181000001000100010001EC
 :1001D00000010000003A003500310001000100017B
 :1001E000003B0035022102350001004C003C001E9E
 :1001F0000224062202010001003D002D02240224F7
@@ -38,26 +38,26 @@
 :100250000425041F021E0201004300310026043160
 :1002600002010001004400450001002D02010000D0
 :100270000001000100010001000100000001000177
-:10028000000100FB000100010001000100F200F983
-:1002900000010001000100F000F100FA00F400018B
-:1002A0000001000100F300FC00F500010001000165
-:1002B000000100F600000001000100010000000143
-:1002C0000000000100010001000000010000000129
-:1002D0000001000100010001000000010001000117
-:1002E000000100A800A9000100010001000100AC0C
-:1002F00000AA00B600010001000100AB005000019F
+:100280000001000100010001000100F400F200FB88
+:1002900000010001000100F000F100FA000100017E
+:1002A000000100F500F300FC00010001000100F96D
+:1002B00000FA00F60000000100010001000000014A
+:1002C0000000000100A80001000000010000000182
+:1002D0000001000100A900AA0000000100010001C6
+:1002E000000100010001000100010001000100AC5B
+:1002F000000100B600010001000100AB0050000148
 :1003000000010001000100520051000100AE000197
 :1003100000010001004F0000000100010001000188
-:1003200000010000000100010001000100010001C6
-:1003300000010001000100010001000100010001B5
-:1003400000010001000100010001000100010001A5
-:100350000001000100010001000100010000000196
+:10032000000100000001000E000B001B7101000124
+:100330000001003700040014000100010001001258
+:10034000000800340001000100010036000C002FFD
+:10035000000100010001001D001800330000000131
 :100360000001000100000001000000010001000187
-:100370000000000100000001000100010001000177
-:100380000000000100010001000100010001000166
-:100390000001000100010001000100010001000155
-:1003A00000010001005000010001000100010052A5
-:1003B000005100010001000100010001004F000098
+:100370000000000100000001000100190007000555
+:10038000000000010001000A001700130001000135
+:10039000000100060015001A000100010001000F15
+:1003A00000110010000100010001002D0016000DD9
+:1003B000710100010038001C0009820100010000E9
 :1003C0000001000100010001000100000001000126
 :1003D00000010001000100010001000100500001C6
 :1003E0000001000100010052005100010001000164

+ 64 - 62
keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c

@@ -15,49 +15,50 @@
 
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-/* Keymap 0: Basic layer
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+
+/* Keymap 0: ADNW-Koy layer
+ * ADNW-Koy is a special layout designed to be ergonomic. Was created using software to determine the most ergonomic way to type German and English texts.
  *
  * ,--------------------------------------------------.           ,--------------------------------------------------.
- * |  ESC   |   1  |   2  |   3  |   4  |   5  |CMD-V |           |CMD-C |   6  |   7  |   8  |   9  |   0  |   ß    |
+ * |  ESC   |   1  |   2  |   3  |   4  |   5  |Lctrl |           |Rctrl |   6  |   7  |   8  |   9  |   0  |   -    |
  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- * |  TAB   |   Q  |   W  |   E  |   R  |   T  | CMD  |           | CMD  |   Z  |   U  |   I  |   O  |   P  |   ü    |
+ * |  TAB   |   K  |   .  |   O  |   ,  |   Y  | CMD  |           | CMD  |   V  |   G  |   C  |   L  |   ß  |   Z    |
  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |  ADNW  |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ö  |  ä/L2  |
+ * |  ADNW  |   H  |   A  |   E  |   I  |   U  |------|           |------|   D  |   T  |   R  |   N |   S  |  F/L2  |
  * |--------+------+------+------+------+------| LALT |           | RALT |------+------+------+------+------+--------|
- * | LShift |Y/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |-/Ctrl| RShift |
+ * | LShift |X/Ctrl|   Q  |   Ä  |   Ü  |   Ö  |      |           |      |   B  |   P  |   W  |   M  |J/Ctrl| RShift |
  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |</L1|  ^°  |AltShf| Left | Right|                                       |  Up  | Down | CMD-SHIFT |  +  | #/L1 |
+ *   |</L1|  ^  |AltShf| Left | Right|                                       |  Up | Down | CMD-SHIFT |  ´  | //L1 |
  *   `----------------------------------'                                       `----------------------------------'
- *                                        ,-------------.       ,---------------.
- *                                        | MDIA | Meh  |       | Hyper|  NUM   |
+ *                                        ,-------------.       ,-------------.
+ *                                        | L1 | LGui |       | Alt  |Ctrl/Esc|
  *                                 ,------|------|------|       |------+--------+------.
  *                                 |      |      | Home |       | PgUp |        |      |
- *                                 | Back-|  Del |------|       |------|  Enter | Space|
- *                                 | Space|      | End  |       | PgDn |        |      |
+ *                                 | Space|Backsp|------|       |------|  Enter | Space|
+ *                                 |      |ace   | End  |       | PgDn |        |      |
  *                                 `--------------------'       `----------------------'
  */
-// If it accepts an argument (i.e, is a function), it doesn't need KC_.
-// Otherwise, it needs KC_*
-[BASE] = KEYMAP(  // layer 0 : default
-        // left hand
-        KC_ESC,                  KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   LGUI(KC_V),
-        KC_TAB,                  KC_Q,         KC_W,   KC_E,   KC_R,   KC_T,   KC_LGUI,
-        TG(3),                   KC_A,         KC_S,   KC_D,   KC_F,   KC_G,
-        KC_LSFT,                 CTL_T(KC_Z),  KC_X,   KC_C,   KC_V,   KC_B,   KC_LALT,
-        LT(SYMB,KC_GRV),         DE_LESS,      LALT(KC_LSFT),  KC_LEFT,KC_RGHT,
-                                               TG(2),  MEH_T(LSFT(DE_ACUT)),
-                                                              KC_HOME,
-                                               KC_BSPC,KC_DEL,KC_END,
-        // right hand
-             LGUI(KC_C),     KC_6,   KC_7,   KC_8,   KC_9,   KC_0,             KC_MINS,
-             KC_RGUI,     KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,             DE_UE,
-                          KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,LT(MDIA,DE_AE),
-             KC_RALT,KC_N,   KC_M,   KC_COMM,KC_DOT, CTL_T(KC_SLSH),   KC_RSFT,
-                                  KC_UP,  KC_DOWN,LGUI(KC_LSFT),KC_RBRC,          LT(SYMB,KC_BSLS),
-             ALL_T(DE_ACUT),        TG(4),
-             KC_PGUP,
-             KC_PGDN,KC_ENT, KC_SPC
-    ),
+KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_K,    KC_DOT,  KC_O,    KC_COMM, KC_Z,    KC_TRNS,
+       KC_TRNS, KC_H,    KC_A,    KC_E,    KC_I,    KC_U,
+       KC_TRNS, CTL_T(KC_X),KC_Q,    DE_AE,   DE_UE,   DE_OE,   KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_TRNS, KC_TRNS, KC_TRNS,
+    // right hand
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH,
+       KC_TRNS,  KC_V,    KC_G,    KC_C,    KC_L,    KC_MINS, KC_Y,
+                 KC_D,    KC_T,    KC_R,    KC_N,    KC_S, LT(MDIA,KC_F),
+       KC_TRNS,  KC_B,    KC_P,    KC_W,    KC_M,    CTL_T(KC_J), KC_TRNS,
+                          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
 /* Keymap 1: Symbol Layer
  *
  * ,--------------------------------------------------.           ,--------------------------------------------------.
@@ -141,48 +142,49 @@ KEYMAP(
        KC_TRNS,
        KC_TRNS, KC_TRNS, KC_WBAK
 ),
-/* Keymap 3: ADNW-Koy layer
- * ADNW-Koy is a special layout designed to be ergonomic. Was created using software to determine the most ergonomic way to type German and English texts.
+/* Keymap 3: qwertz layer
  *
  * ,--------------------------------------------------.           ,--------------------------------------------------.
- * |  ESC   |   1  |   2  |   3  |   4  |   5  |Lctrl |           |Rctrl |   6  |   7  |   8  |   9  |   0  |   -    |
+ * |  ESC   |   1  |   2  |   3  |   4  |   5  |CMD-V |           |CMD-C |   6  |   7  |   8  |   9  |   0  |   ß    |
  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
- * |  TAB   |   K  |   .  |   O  |   ,  |   Y  | CMD  |           | CMD  |   V  |   G  |   C  |   L  |   ß  |   Z    |
+ * |  TAB   |   Q  |   W  |   E  |   R  |   T  | CMD  |           | CMD  |   Z  |   U  |   I  |   O  |   P  |   ü    |
  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
- * |  ADNW  |   H  |   A  |   E  |   I  |   U  |------|           |------|   D  |   T  |   R  |   N |   S  |  F/L2  |
+ * |  ADNW  |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ö  |  ä/L2  |
  * |--------+------+------+------+------+------| LALT |           | RALT |------+------+------+------+------+--------|
- * | LShift |X/Ctrl|   Q  |   Ä  |   Ü  |   Ö  |      |           |      |   B  |   P  |   W  |   M  |J/Ctrl| RShift |
+ * | LShift |Y/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |-/Ctrl| RShift |
  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |</L1|  ^  |AltShf| Left | Right|                                       |  Up | Down | CMD-SHIFT |  ´  | //L1 |
+ *   |</L1|  ^°  |AltShf| Left | Right|                                       |  Up  | Down | CMD-SHIFT |  +  | #/L1 |
  *   `----------------------------------'                                       `----------------------------------'
- *                                        ,-------------.       ,-------------.
- *                                        | L1 | LGui |       | Alt  |Ctrl/Esc|
+ *                                        ,-------------.       ,---------------.
+ *                                        | MDIA | Meh  |       | Hyper|  NUM   |
  *                                 ,------|------|------|       |------+--------+------.
  *                                 |      |      | Home |       | PgUp |        |      |
- *                                 | Space|Backsp|------|       |------|  Enter | Space|
- *                                 |      |ace   | End  |       | PgDn |        |      |
+ *                                 | Back-|  Del |------|       |------|  Enter | Space|
+ *                                 | Space|      | End  |       | PgDn |        |      |
  *                                 `--------------------'       `----------------------'
  */
-KEYMAP(
-       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
-       KC_TRNS, KC_K,    KC_DOT,  KC_O,    KC_COMM, KC_Z,    KC_TRNS,
-       KC_TRNS, KC_H,    KC_A,    KC_E,    KC_I,    KC_U,
-       KC_TRNS, CTL_T(KC_X),KC_Q,    DE_AE,   DE_UE,   DE_OE,   KC_TRNS,
-       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
-                                           KC_TRNS, KC_TRNS,
-                                                    KC_TRNS,
-                                  KC_TRNS, KC_TRNS, KC_TRNS,
-    // right hand
-       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH,
-       KC_TRNS,  KC_V,    KC_G,    KC_C,    KC_L,    KC_MINS, KC_Y,
-                 KC_D,    KC_T,    KC_R,    KC_N,    KC_S, LT(MDIA,KC_F),
-       KC_TRNS,  KC_B,    KC_P,    KC_W,    KC_M,    CTL_T(KC_J), KC_TRNS,
-                          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
-       KC_TRNS, KC_TRNS,
-       KC_TRNS,
-       KC_TRNS, KC_TRNS, KC_TRNS
-),
 
+[BASE] = KEYMAP(  // layer 3 : default qwertz layout
+        // left hand
+        KC_ESC,                  KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   LGUI(KC_V),
+        KC_TAB,                  KC_Q,         KC_W,   KC_E,   KC_R,   KC_T,   KC_LGUI,
+        TG(3),                   KC_A,         KC_S,   KC_D,   KC_F,   KC_G,
+        KC_LSFT,                 CTL_T(KC_Z),  KC_X,   KC_C,   KC_V,   KC_B,   KC_LALT,
+        LT(SYMB,KC_GRV),         DE_LESS,      LALT(KC_LSFT),  KC_LEFT,KC_RGHT,
+                                               TG(2),  MEH_T(LSFT(DE_ACUT)),
+                                                              KC_HOME,
+                                               KC_BSPC,KC_DEL,KC_END,
+        // right hand
+             LGUI(KC_C),     KC_6,   KC_7,   KC_8,   KC_9,   KC_0,             KC_MINS,
+             KC_RGUI,     KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,             DE_UE,
+                          KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,LT(MDIA,DE_AE),
+             KC_RALT,KC_N,   KC_M,   KC_COMM,KC_DOT, CTL_T(KC_SLSH),   KC_RSFT,
+                                  KC_UP,  KC_DOWN,LGUI(KC_LSFT),KC_RBRC,          LT(SYMB,KC_BSLS),
+             ALL_T(DE_ACUT),        TG(4),
+             KC_PGUP,
+             KC_PGDN,KC_ENT, KC_SPC
+    ),
+//numblock
 KEYMAP(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,

+ 136 - 0
keyboard/ergodox_ez/keymaps/tm2030/README.md

@@ -0,0 +1,136 @@
+# TypeMatrix™ 2030 inspired layout
+
+This is a [TypeMatrix™ 2030](http://typematrix.com/2030/features.php) inspired layout for the ErgoDox EZ. The _TypeMatrix_ is a nice small ergonomic keyboard with a matrix layout, and it provides several nice features like `enter`, `backspace` and `delete` at the center, bigger `shift` keys and international `cut`, `copy` and `paste` keys.
+
+The idea in this ErgoDox layout is to make it is as close as possible to the TM2030, such that it would be easy to switch between the TM and the ErgoDox. No _fancy_ features have been implemented, as this is intended to be a base for further customization if desired. Some keys have been duplicated in order to accomodate for most people.
+
+Most of the TM2030 features are supported except
+* automatic window switching (alt-tab key, at the left of the space key)
+* show desktop key (at the right of the space key)
+* 102/106 modes
+
+Dvorak mode is even supported by pressing [`Magic`](/TMK_README.md#magic-commands)+`1` (`Magic` is by default `LShift`+`RShift`)
+
+Some keys had to be moved around to fit into the ErgoDox, especially the `F1`-`F12` keys and the arrow keys.
+
+## Base Layer
+This is the default layer, close to the TM with the following differences:
+
+ - Top row (with the `F`-keys) and rightmost column (with application shortcuts) are removed, the corresponding keys are displaced elsewhere.
+ - Bottom-left keys are reorganized on a single row as: `Ctrl`, `fn`, `Gui`, `Play`, `App`/`Alt`.
+ - `shuffle` and `desktop` are not supported.
+ - `right-shift` is moved on `'`, `\` and on the right thumb (the latter is actually the only _true_ `right-shift`, and must be used in the `Magic` key combination).
+ - `right-ctrl` is moved on `End`.
+ - `]` is moved in place of the dash (`-`).
+ - Dash (`-`) and `=` are moved on bottom right row.
+ - Arrows and `PgUp`/`PgDn` are moved on the thumbs.
+
+```
+,--------------------------------------------------.           ,--------------------------------------------------.
+|   `    |   1  |   2  |   3  |   4  |   5  | Del  |           | Del  |   6  |   7  |   8  |   9  |   0  |   ]    |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+| Tab    |   Q  |   W  |   E  |   R  |   T  |Backsp|           |Backsp|   Y  |   U  |   I  |   O  |   P  |   [    |
+|--------+------+------+------+------+------|ace   |           |ace   |------+------+------+------+------+--------|
+| LShift |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  | '/Shift|
+|--------+------+------+------+------+------|Enter |           |Enter |------+------+------+------+------+--------|
+| LShift |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   /  | \/Shift|
+`--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+  |LCtrl |  fn  | LGui | Play |App/Alt|                                      | RAlt |   -  | Home |   =  |End/Ctl|
+  `-----------------------------------'                                      `-----------------------------------'
+                                      ,--------------.       ,-------------.
+                                      |Esc/Alt| num  |       | Left |Right |
+                               ,------+-------+------|       |------+------+------.
+                               |      |       | PgUp |       |  Up  |      |      |
+                               |Space |LShift |------|       |------|RShift|Space |
+                               |      |       | PgDn |       | Down |      |      |
+                               `---------------------'       `--------------------'
+```
+
+### Layer Switching
+- Use `num` to toggle the Numeric Layer.
+- Hold `fn` to temporarily activate the Numeric & Fn Layers.
+
+As on the original TM 2030, when `num` layer is activated, holding `fn` disables it but enables the other `fn` keys.
+
+## Dvorak Layer
+Same as Layer 0 but with _Dvorak_ layout, to use with QWERTY OS layout.
+
+Enable Dvorak layout with [`Magic`](/TMK_README.md#magic-commands+`1` (`LShift`+`RShift`+`1`), disable with `Magic`-`0`.
+
+The middle (green) led indicates when the Dvorak layer is activated.
+
+    ,--------------------------------------------------.           ,--------------------------------------------------.
+    |   `    |   1  |   2  |   3  |   4  |   5  | Del  |           | Del  |   6  |   7  |   8  |   9  |   0  |   =    |
+    |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+    | Tab    |   '  |   ,  |   .  |   P  |   Y  |Backsp|           |Backsp|   F  |   G  |   C  |   R  |   L  |   /    |
+    |--------+------+------+------+------+------|ace   |           |ace   |------+------+------+------+------+--------|
+    | LShift |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  |   S  | -/Shift|
+    |--------+------+------+------+------+------|Enter |           |Enter |------+------+------+------+------+--------|
+    | LShift |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | \/Shift|
+    `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+      |LCtrl |  fn  | LGui | Play |App/Alt|                                      | RAlt |   [  | Home |   ]  |End/Ctl|
+      `-----------------------------------'                                      `-----------------------------------'
+                                          ,--------------.       ,-------------.
+                                          |Esc/Alt| num  |       | Left |Right |
+                                   ,------+-------+------|       |------+------+------.
+                                   |      |       | PgUp |       |  Up  |      |      |
+                                   |Space |LShift |------|       |------|RShift|Space |
+                                   |      |       | PgDn |       | Down |      |      |
+                                   `---------------------'       `--------------------'
+
+## Numeric Layer
+Numeric layer close to the TM when toggling `num`, with the following differences:
+
+- Numpad is displaced by 1 to the top left.
+- Arrows are displaced by 1 to the left.
+- Provides access to `F1`-`F12`, `caps-lock` and `num-lock`.
+
+The numeric layer is indicated with the left (red) led. Caps-lock is indicated with the right (blue) led.
+
+    ,--------------------------------------------------.           ,--------------------------------------------------.
+    |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |      |      |  Tab |   /  |   *  |   -    |
+    |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+    |        |  F6  |  F7  |  F8  |  F9  |  F10 |      |           |      |      | Home |   7  |   8  |   9  |   +    |
+    |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+    |        |  F11 |  F12 |      |      |      |------|           |------|  Up  | End  |   4  |   5  |   6  |   +    |
+    |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+    |        |      |      |      |      |      |      |           | Left | Down | Right|   1  |   2  |   3  |KpEnter |
+    `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+      |      |      |      |      |      |                                       |      |   0  |  00  |   .  |Etr/Ctl|
+      `----------------------------------'                                       `-----------------------------------'
+                                           ,-------------.       ,-------------.
+                                           |      |      |       |n.lock|c.lock|
+                                    ,------|------|------|       |------+------+------.
+                                    |      |      |      |       |      |      |      |
+                                    |      |      |------|       |------|      |      |
+                                    |      |      |      |       |      |      |      |
+                                    `--------------------'       `--------------------'
+
+## Fn Layer
+Activated simultaneously with the Numeric layer when holding the `fn` key. As on the TM, it provides access to the following features:
+- `cut`, `copy` and `paste`
+- `volume up`, `volume down` and `mute` — as opposed to the TM, these are only on left hand
+- `previous track` and `next track`
+- `calculator`, `mail` and `browser home`
+- `insert`, `power`, `sleep`, `wake`, `print screen`, `scroll-lock` and `pause`
+
+Note: the `eject` key does not work due to jackhumbert/qmk_firmware#82
+
+    ,--------------------------------------------------.           ,--------------------------------------------------.
+    |        |      |      |      |      |      |Insert|           |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk|
+    |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+    |        |      |      |      |      |      |VolUp |           |      |      |      |      |      |      | Pause  |
+    |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+    |        |      |      | Calc | Mail |Browsr|------|           |------|      |      |      |      |      |        |
+    |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+    |        |      | cut  | copy |paste | Mute |VolDn |           |      |      |      |      |      |      |        |
+    `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+      |      |      |      |      |      |                                       |      |      |      |      |      |
+      `----------------------------------'                                       `----------------------------------'
+                                           ,-------------.       ,-------------.
+                                           |      |      |       |      |      |
+                                    ,------|------|------|       |------+------+------.
+                                    |      |      |      |       | Next |      |      |
+                                    | Mute |      |------|       |------|      |      |
+                                    |      |      |      |       | Prev |      |      |
+                                    `--------------------'       `--------------------'

+ 258 - 0
keyboard/ergodox_ez/keymaps/tm2030/keymap.c

@@ -0,0 +1,258 @@
+/* TypeMatrix-2030-like keymap  */
+#include "ergodox_ez.h"
+#include "debug.h"
+#include "action_layer.h"
+#include "led.h"
+
+#define BASE 0 // default layer
+#define DVRK 1 // Dvorak layer
+#define NUMR 8 // numeric layer
+#define FNLR 9 // fn layer
+
+#define MDBL0 1
+#define MFNLR 2
+#define MCUT  3
+#define MCOPY 4
+#define MPSTE 5
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Basic layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |   `    |   1  |   2  |   3  |   4  |   5  | Del  |           | Del  |   6  |   7  |   8  |   9  |   0  |   ]    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * | Tab    |   Q  |   W  |   E  |   R  |   T  |Backsp|           |Backsp|   Y  |   U  |   I  |   O  |   P  |   [    |
+ * |--------+------+------+------+------+------|ace   |           |ace   |------+------+------+------+------+--------|
+ * | LShift |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  | '/Shift|
+ * |--------+------+------+------+------+------|Enter |           |Enter |------+------+------+------+------+--------|
+ * | LShift |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   /  | \/Shift|
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |LCtrl |  fn  | LGui | Play |App/Alt|                                      | RAlt |   -  | Home |   =  |End/Ctl|
+ *   `-----------------------------------'                                      `-----------------------------------'
+ *                                       ,--------------.       ,-------------.
+ *                                       |Esc/Alt| num  |       | Left |Right |
+ *                                ,------+-------+------|       |------+------+------.
+ *                                |      |       | PgUp |       |  Up  |      |      |
+ *                                |Space |LShift |------|       |------|RShift|Space |
+ *                                |      |       | PgDn |       | Down |      |      |
+ *                                `---------------------'       `--------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[BASE] = KEYMAP(  // layer 0 : default
+        // left hand
+        KC_GRV,         KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   KC_DELT,
+        KC_TAB,         KC_Q,         KC_W,   KC_E,   KC_R,   KC_T,   KC_BSPC,
+        KC_LSFT,        KC_A,         KC_S,   KC_D,   KC_F,   KC_G,
+        KC_LSFT,        KC_Z,         KC_X,   KC_C,   KC_V,   KC_B,   KC_ENT,
+        KC_LCTL,        M(MFNLR),     KC_LGUI,KC_MPLY,ALT_T(KC_APP),
+
+                                              ALT_T(KC_ESC),  TG(NUMR),
+                                                              KC_PGUP,
+                                            KC_SPC, KC_LSFT,  KC_PGDN,
+
+        // right hand
+             KC_DELT,     KC_6,   KC_7,    KC_8,    KC_9,    KC_0,     KC_RBRC,
+             KC_BSPC,     KC_Y,   KC_U,    KC_I,    KC_O,    KC_P,     KC_LBRC,
+                          KC_H,   KC_J,    KC_K,    KC_L,    KC_SCLN,  SFT_T(KC_QUOT),
+             KC_ENT,      KC_N,   KC_M,    KC_COMM, KC_DOT,  KC_SLSH,  SFT_T(KC_BSLS),
+                                  KC_RALT, KC_MINS, KC_HOME, KC_EQL,   CTL_T(KC_END),
+
+             KC_LEFT, KC_RGHT,
+             KC_UP,
+             KC_DOWN, KC_RSFT,  KC_SPC
+    ),
+/* Dvorak layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |   `    |   1  |   2  |   3  |   4  |   5  | Del  |           | Del  |   6  |   7  |   8  |   9  |   0  |   =    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * | Tab    |   '  |   ,  |   .  |   P  |   Y  |Backsp|           |Backsp|   F  |   G  |   C  |   R  |   L  |   /    |
+ * |--------+------+------+------+------+------|ace   |           |ace   |------+------+------+------+------+--------|
+ * | LShift |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  |   S  | -/Shift|
+ * |--------+------+------+------+------+------|Enter |           |Enter |------+------+------+------+------+--------|
+ * | LShift |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | \/Shift|
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |LCtrl |  fn  | LGui | Play |App/Alt|                                      | RAlt |   [  | Home |   ]  |End/Ctl|
+ *   `-----------------------------------'                                      `-----------------------------------'
+ *                                       ,--------------.       ,-------------.
+ *                                       |Esc/Alt| num  |       | Left |Right |
+ *                                ,------+-------+------|       |------+------+------.
+ *                                |      |       | PgUp |       |  Up  |      |      |
+ *                                |Space |LShift |------|       |------|RShift|Space |
+ *                                |      |       | PgDn |       | Down |      |      |
+ *                                `---------------------'       `--------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[DVRK] = KEYMAP(  // layer 0 : default
+        // left hand
+        KC_GRV,   KC_1,      KC_2,    KC_3,    KC_4,   KC_5,   KC_DELT,
+        KC_TAB,   KC_QUOT,   KC_COMM, KC_DOT,  KC_P,   KC_Y,   KC_BSPC,
+        KC_LSFT,  KC_A,      KC_O,    KC_E,    KC_U,   KC_I,
+        KC_LSFT,  KC_SCLN,   KC_Q,    KC_J,    KC_K,   KC_X,   KC_ENT,
+        KC_LCTL,  M(MFNLR),  KC_LGUI, KC_MPLY, ALT_T(KC_APP),
+
+                                              ALT_T(KC_ESC),  TG(NUMR),
+                                                              KC_PGUP,
+                                            KC_SPC, KC_LSFT,  KC_PGDN,
+
+        // right hand
+             KC_DELT,     KC_6,   KC_7,    KC_8,    KC_9,    KC_0,     KC_EQL,
+             KC_BSPC,     KC_F,   KC_G,    KC_C,    KC_R,    KC_L,     KC_SLSH,
+                          KC_D,   KC_H,    KC_T,    KC_N,    KC_S,     SFT_T(KC_MINS),
+             KC_ENT,      KC_B,   KC_M,    KC_W,    KC_V,    KC_Z,     SFT_T(KC_BSLS),
+                                  KC_RALT, KC_LBRC, KC_HOME, KC_RBRC,  CTL_T(KC_END),
+
+             KC_LEFT, KC_RGHT,
+             KC_UP,
+             KC_DOWN, KC_RSFT,  KC_SPC
+    ),
+/* Numeric Layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |      |      |  Tab |   /  |   *  |   -    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |  F6  |  F7  |  F8  |  F9  |  F10 |      |           |      |      | Home |   7  |   8  |   9  |   +    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |  F11 |  F12 |      |      |      |------|           |------|  Up  | End  |   4  |   5  |   6  |   +    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |      |           | Left | Down | Right|   1  |   2  |   3  |KpEnter |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |   0  |  00  |   .  |Etr/Ctl|
+ *   `----------------------------------'                                       `-----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |n.lock|c.lock|
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |      |      |------|       |------|      |      |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// SYMBOLS
+[NUMR] = KEYMAP(
+       // left hand
+       KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_TRNS,
+       KC_TRNS, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_TRNS,
+       KC_TRNS, KC_F11,  KC_F12,  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,
+       // right hand
+       KC_INS,  KC_F6,   KC_F7,   KC_TAB,  KC_PSLS, KC_PAST, KC_PMNS,
+       KC_TRNS, KC_TRNS, KC_HOME, KC_P7,   KC_P8,   KC_P9,   KC_PPLS,
+                KC_UP,   KC_END,  KC_P4,   KC_P5,   KC_P6,   KC_PPLS,
+       KC_LEFT, KC_DOWN, KC_RGHT, KC_P1,   KC_P2,   KC_P3,   KC_PENT,
+                         KC_TRNS, KC_P0,   M(MDBL0),KC_PDOT, CTL_T(KC_PENT),
+
+       KC_NLCK, KC_CAPS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+/* fn layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |      |      |      |      |      |Insert|           |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk|
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |VolUp |           |      |      |      |      |      |      | Pause  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      | Calc | Mail |Browsr|------|           |------|      |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      | cut  | copy |paste | Mute |VolDn |           |      |      |      |      |      |      |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |      |      |      |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       | Next |      |      |
+ *                                 | Mute |      |------|       |------|      |      |
+ *                                 |      |      |      |       | Prev |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// MEDIA AND MOUSE
+[FNLR] = KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,      KC_TRNS, KC_INS,
+       KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,      KC_TRNS, KC_VOLU,
+       KC_TRNS, KC_TRNS, KC_TRNS,      KC_CALC,     KC_MAIL,      KC_WHOM,
+       KC_TRNS, KC_TRNS, M(MCUT),      M(MCOPY),    M(MPSTE),     KC_MUTE, KC_VOLD,
+       KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
+
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_MUTE, KC_TRNS, KC_TRNS,
+    // right hand
+       KC_INS,   KC_EJCT, KC_PWR,  KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK,
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS,
+                 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_MPRV,
+       KC_MNXT, KC_TRNS, KC_TRNS
+),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+  // MACRODOWN only works in this function
+    switch(id) {
+        case MDBL0:
+            if (record->event.pressed) {
+              return MACRO( I(25), T(P0), T(P0), END );
+            }
+        break;
+        case MFNLR:
+            layer_state ^= (1 << NUMR) | (1 << FNLR);
+            break;
+        case MCUT:
+            if (record->event.pressed) {
+                return MACRO(D(LSFT), T(DELT), U(LSFT), END);
+            }
+            break;
+        case MCOPY:
+            if (record->event.pressed) {
+                return MACRO(D(LCTL), T(INS), U(LCTL), END);
+            }
+            break;
+        case MPSTE:
+            if (record->event.pressed) {
+                return MACRO(D(LSFT), T(INS), U(LSFT), END);
+            }
+            break;
+    }
+    return MACRO_NONE;
+};
+
+// Runs just one time when the keyboard initializes.
+void * matrix_init_user(void) {
+
+};
+
+// Runs constantly in the background, in a loop.
+void * matrix_scan_user(void) {
+
+    ergodox_board_led_off();
+    ergodox_right_led_1_off();
+    ergodox_right_led_2_off();
+    ergodox_right_led_3_off();
+    // led 1: numeric layer
+    if (layer_state & (1 << NUMR)) {
+        ergodox_right_led_1_on();
+    }
+    // led 2: Dvorak layer
+    if (default_layer_state == 1 << DVRK) {
+        ergodox_right_led_2_on();
+    }
+    // led 3: caps lock
+    if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
+      ergodox_right_led_3_on();
+    }
+};

File diff suppressed because it is too large
+ 1544 - 0
keyboard/ergodox_ez/keymaps/tm2030/keymap.hex


+ 184 - 0
keyboard/ergodox_ez/keymaps/tonyabra_osx/keymap.c

@@ -0,0 +1,184 @@
+#include "ergodox_ez.h"
+#include "debug.h"
+#include "action_layer.h"
+
+#define BASE 0 // default layer
+#define SYMB 1 // symbols
+#define MDIA 2 // media keys
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Basic layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * | Esc    |   1  |   2  |   3  |   4  |   5  |   =  |           |   -  |   6  |   7  |   8  |   9  |   0  |  Enter |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * | Tab    |   Q  |   W  |   E  |   R  |   T  |  L1  |           |  L1  |   Y  |   U  |   I  |   O  |   P  |   \    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * | BkSp   |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  |   '"   |
+ * |--------+------+------+------+------+------| LGui |           | LGui |------+------+------+------+------+--------|
+ * | LShift |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   /  | RShift |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |  L1  |   `  |  {   |   }  |  '"  |                                       | Left |  Up  | Down | Right|  L2  |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |  Del | Alt  |       | Alt  | Ctrl |
+ *                                 ,------|------|------|       |------+--------+------.
+ *                                 |      |      | Home |       | PgUp |        |      |
+ *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
+ *                                 |      |ace   | End  |       | PgDn |        |      |
+ *                                 `--------------------'       `----------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[BASE] = KEYMAP(  // layer 0 : default
+        // left hand
+        KC_ESC,         KC_1,         KC_2,   KC_3,   KC_4,   KC_5,   KC_EQL,
+        KC_TAB,         KC_Q,         KC_W,   KC_E,   KC_R,   KC_T,   TG(SYMB),
+        KC_BSPC,        KC_A,         KC_S,   KC_D,   KC_F,   KC_G,
+        KC_LSFT,        KC_Z,         KC_X,   KC_C,   KC_V,   KC_B,   KC_LGUI,
+        TG(SYMB),       KC_GRV,       KC_LBRC,        KC_RBRC,KC_QUOT,
+                                                      KC_DELT,KC_LALT,
+                                                              KC_HOME,
+                                               KC_SPC,KC_BSPC,KC_END,
+        // right hand
+             KC_MINS,     KC_6,   KC_7,   KC_8,   KC_9,   KC_0,             KC_ENT,
+             TG(SYMB),    KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,             KC_BSLS,
+                          KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,          KC_QUOT,
+             KC_LGUI,     KC_N,   KC_M,   KC_COMM,KC_DOT, KC_SLSH,          KC_RSFT,
+                                  KC_LEFT,KC_UP,  KC_DOWN,KC_RIGHT,          TG(MDIA),
+             KC_RALT,     KC_RCTL,
+             KC_PGUP,
+             KC_PGDN,KC_TAB, KC_ENT
+    ),
+/* Keymap 1: Symbol Layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |   F12  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |   \  |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |    . |   0  |   =  |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |      |      |------|       |------|      |      |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// SYMBOLS
+[SYMB] = KEYMAP(
+       // left hand
+       KC_TRNS,KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_TRNS,
+       KC_TRNS,KC_EXLM,KC_AT,  KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
+       KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
+       KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
+       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
+                                       KC_TRNS,KC_TRNS,
+                                               KC_TRNS,
+                               KC_TRNS,KC_TRNS,KC_TRNS,
+       // right hand
+       KC_TRNS, KC_F6,   KC_F7,  KC_F8,   KC_F9,   KC_F10,  KC_F11,
+       KC_TRNS, KC_UP,   KC_7,   KC_8,    KC_9,    KC_ASTR, KC_F12,
+                KC_DOWN, KC_4,   KC_5,    KC_6,    KC_PLUS, KC_TRNS,
+       KC_TRNS, KC_AMPR, KC_1,   KC_2,    KC_3,    KC_BSLS, KC_TRNS,
+                         KC_TRNS,KC_DOT,  KC_0,    KC_EQL,  KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS
+),
+/* Keymap 2: Media and mouse keys
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |        |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |      |      | MsUp |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |      |      |      |      |  Play  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |      |           |      |      |      | Prev | Next |      |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      | Lclk | Rclk |                                       |VolUp |VolDn | Mute |      |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |Brwser|
+ *                                 |      |      |------|       |------|      |Back  |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+// MEDIA AND MOUSE
+[MDIA] = KEYMAP(
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
+                                           KC_TRNS, KC_TRNS,
+                                                    KC_TRNS,
+                                  KC_TRNS, KC_TRNS, KC_TRNS,
+    // right hand
+       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_MPLY,
+       KC_TRNS,  KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
+                          KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
+       KC_TRNS, KC_TRNS,
+       KC_TRNS,
+       KC_TRNS, KC_TRNS, KC_WBAK
+),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    [1] = ACTION_LAYER_TAP_TOGGLE(SYMB)                // FN1 - Momentary Layer 1 (Symbols)
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+  // MACRODOWN only works in this function
+      switch(id) {
+        case 0:
+        if (record->event.pressed) {
+          register_code(KC_RSFT);
+        } else {
+          unregister_code(KC_RSFT);
+        }
+        break;
+      }
+    return MACRO_NONE;
+};
+
+// Runs just one time when the keyboard initializes.
+void * matrix_init_user(void) {
+
+};
+
+// Runs constantly in the background, in a loop.
+void * matrix_scan_user(void) {
+
+    uint8_t layer = biton32(layer_state);
+
+    ergodox_board_led_off();
+    ergodox_right_led_1_off();
+    ergodox_right_led_2_off();
+    ergodox_right_led_3_off();
+    switch (layer) {
+      // TODO: Make this relevant to the ErgoDox EZ.
+        case 1:
+            ergodox_right_led_1_on();
+            break;
+        case 2:
+            ergodox_right_led_2_on();
+            break;
+        default:
+            // none
+            break;
+    }
+
+};

+ 5 - 0
keyboard/ergodox_ez/keymaps/tonyabra_osx/readme.md

@@ -0,0 +1,5 @@
+# ErgoDox EZ OS X Simplified Configuration
+
+This keyboard configuration replaces the hyper and meh keys with the command key. It also removes all of the meta keys that require a "hold" because I found that I hesitate when I type, which can accidentally fire those combinations. On the upper left of the left hand, I mimicked the Mac placement of tab and escape, and on the upper right of the right hand, I placed an additional enter key for convenience when breezing through prompts.
+
+This is my standard working configuration for now, but I can see myself tweaking it as I use it more. I highly recommend you do the same.

File diff suppressed because it is too large
+ 1471 - 0
keyboard/ergodox_ez/keymaps/tonyabra_osx/tonyabra_osx.hex


+ 27 - 6
keyboard/planck/Makefile

@@ -27,7 +27,7 @@
 # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
 #                (must have Atmel FLIP installed).
 #
-# make debug = Start either simulavr or avarice as specified for debugging, 
+# make debug = Start either simulavr or avarice as specified for debugging,
 #              with avr-gdb or avr-insight as the front end for debugging.
 #
 # make filename.s = Just compile filename.c into the assembler code only.
@@ -50,14 +50,30 @@ TMK_DIR = ../../tmk_core
 TARGET_DIR = .
 
 # # project specific files
-SRC = planck.c \
-	backlight.c 
+SRC = planck.c
+
+ifdef keymap
+	KEYMAP = $(keymap)
+endif
 
 ifdef KEYMAP
-    SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
+ifneq ("$(wildcard keymaps/$(KEYMAP).c)","")
+	KEYMAP_FILE = keymaps/$(KEYMAP).c
+else
+ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","")
+	KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c
 else
-    SRC := keymaps/keymap_default.c $(SRC)
+$(error Keymap file does not exist)
 endif
+endif
+else
+ifneq ("$(wildcard keymaps/default.c)","")
+	KEYMAP_FILE = keymaps/default.c
+else
+	KEYMAP_FILE = keymaps/default/keymap.c
+endif
+endif
+SRC := $(KEYMAP_FILE) $(SRC)
 
 CONFIG_H = config.h
 
@@ -124,8 +140,14 @@ COMMAND_ENABLE = yes    # Commands for debug and configuration
 # NKRO_ENABLE = yes		# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
 BACKLIGHT_ENABLE = yes  # Enable keyboard backlight functionality
 # MIDI_ENABLE = YES 		# MIDI controls
+# AUDIO_ENABLE = YES 		# Audio output on port C6
 # UNICODE_ENABLE = YES 		# Unicode
 # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
+# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.  Do not enable this with MIDI at the same time.
+
+ifdef BACKLIGHT_ENABLE
+	SRC += backlight.c
+endif
 
 
 # Optimize size but this may cause error "relocation truncated to fit"
@@ -137,4 +159,3 @@ VPATH += $(TOP_DIR)
 VPATH += $(TMK_DIR)
 
 include $(TOP_DIR)/quantum/quantum.mk
-

File diff suppressed because it is too large
+ 87 - 39
keyboard/planck/README.md


+ 9 - 0
keyboard/planck/config.h

@@ -58,6 +58,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
     keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
 )
 
+/* ws2812 RGB LED */
+#define ws2812_PORTREG  PORTD
+#define ws2812_DDRREG   DDRD
+#define ws2812_pin PD1
+#define RGBLED_NUM 28     // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
+
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

keyboard/planck/keymaps/keymap_alexey.c → keyboard/planck/keymaps/alexey.c


keyboard/planck/keymaps/keymap_angerthosenear.c → keyboard/planck/keymaps/angerthosenear.c


keyboard/planck/keymaps/keymap_austin.c → keyboard/planck/keymaps/austin.c


keyboard/planck/keymaps/keymap_charlie.c → keyboard/planck/keymaps/charlie.c


keyboard/planck/keymaps/keymap_daniel.c → keyboard/planck/keymaps/daniel.c


keyboard/planck/keymaps/keymap_david.c → keyboard/planck/keymaps/david.c


+ 34 - 0
keyboard/planck/keymaps/default/README.md

@@ -0,0 +1,34 @@
+# The Default Planck Layout
+
+    const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    [_QW] = { /* Qwerty */
+      {KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC},
+      {KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT},
+      {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT },
+      {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+    },
+    [_CM] = { /* Colemak */
+      {KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSPC},
+      {KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT},
+      {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT },
+      {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+    },
+    [_DV] = { /* Dvorak */
+      {KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,    KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_BSPC},
+      {KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,    KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_SLSH},
+      {KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,    KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_ENT },
+      {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+    },
+    [_RS] = { /* RAISE */
+      {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC},
+      {KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_MINS, KC_EQL,  KC_LBRC, KC_RBRC, KC_BSLS},
+      {KC_TRNS, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  DF(_QW), DF(_CM), DF(_DV), RESET,   KC_TRNS},
+      {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
+    },
+    [_LW] = { /* LOWER */
+      {KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
+      {KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
+      {KC_TRNS, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  DF(_QW), DF(_CM), DF(_DV), RESET,   KC_TRNS},
+      {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
+    }
+    };

+ 6 - 2
keyboard/planck/keymaps/keymap_default.c

@@ -2,7 +2,9 @@
 // this is the style you want to emulate.
 
 #include "planck.h"
-#include "backlight.h"
+#ifdef BACKLIGHT_ENABLE
+  #include "backlight.h"
+#endif
 
 // Each layer gets a name for readability, which is then used in the keymap matrix below.
 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -58,7 +60,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case 0:
           if (record->event.pressed) {
             register_code(KC_RSFT);
-            backlight_step();
+            #ifdef BACKLIGHT_ENABLE
+              backlight_step();
+            #endif
           } else {
             unregister_code(KC_RSFT);
           }

keyboard/planck/keymaps/keymap_dzobert.c → keyboard/planck/keymaps/dzobert.c


keyboard/planck/keymaps/keymap_gabriel.c → keyboard/planck/keymaps/gabriel.c


keyboard/planck/keymaps/keymap_joe.c → keyboard/planck/keymaps/joe.c


+ 0 - 50
keyboard/planck/keymaps/keymap_jack.c

@@ -1,50 +0,0 @@
-#include "keymap_common.h"
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = { /* Jack soft-coded colemak */
-  {KC_TAB,  CM_Q,    CM_W,    CM_F,    CM_P,    CM_G,    CM_J,    CM_L,    CM_U,    CM_Y,    CM_SCLN, KC_BSPC},
-  {KC_ESC,  CM_A,    CM_R,    CM_S,    CM_T,    CM_D,    CM_H,    CM_N,    CM_E,    CM_I,    CM_O,     KC_QUOT},
-  {KC_LSFT, CM_Z,    CM_X,    CM_C,    CM_V,    CM_B,    CM_K,    CM_M,    CM_COMM, CM_DOT,  CM_SLSH, KC_ENT},
-  {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2),    KC_SPC,   KC_SPC,    FUNC(1),   KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT}
-                                                // Space is repeated to accommadate for both spacebar wiring positions
-},
-[1] = { /* Jack hard-coded colemak */
-  {KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSPC},
-  {KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,     KC_QUOT},
-  {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT},
-  {KC_FN3, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2),    KC_SPC,   KC_SPC,    FUNC(1),   KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT}
-},
-[2] = { /* Jack RAISE */
-  {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC},
-  {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL,  KC_LBRC, KC_RBRC, KC_BSLS},
-  {KC_TRNS, KC_F11,  KC_F12,  KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20, KC_TRNS},
-  {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS,   KC_TRNS,  FUNC(1),   KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
-},
-[3] = { /* Jack LOWER */
-  {S(KC_GRV),  S(KC_1),    S(KC_2),    S(KC_3),    S(KC_4),    S(KC_5),    S(KC_6),    S(KC_7),    S(KC_8),    S(KC_9),    S(KC_0), KC_BSPC},
-  {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL),  S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)},
-  {KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_TRNS},
-  {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2),   KC_TRNS,   KC_TRNS,   KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
-}
-};
-
-
-const uint16_t PROGMEM fn_actions[] = {
-    [1] = ACTION_LAYER_MOMENTARY(2),  // to Fn overlay
-    [2] = ACTION_LAYER_MOMENTARY(3),  // to Fn overlay
-
-    [3] = ACTION_DEFAULT_LAYER_SET(0),
-    [4] = ACTION_DEFAULT_LAYER_SET(1),
-
-};
-
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 
-{
-  // MACRODOWN only works in this function
-    switch(id) {
-      case 0:
-        return MACRODOWN(T(CM_T), END);
-      break;
-    } 
-    return MACRO_NONE;
-};

keyboard/planck/keymaps/keymap_kyle.c → keyboard/planck/keymaps/kyle.c


keyboard/planck/keymaps/keymap_leo.c → keyboard/planck/keymaps/leo.c


+ 3 - 0
keyboard/planck/keymaps/lock/README.md

@@ -0,0 +1,3 @@
+# Lock layout
+
+This layout is designed for having a lock switch in the lower-left-hand corner, and for experimenting with MIDI/audio features. It's constantly in development, so don't expect anything to work/be documented correctly!

+ 45 - 10
keyboard/planck/keymaps/keymap_lock.c

@@ -1,7 +1,12 @@
+// USING_MIDI
+// USING_BACKLIGHT
 #include "keymap_common.h"
-#include "backlight.h"
+#ifdef BACKLIGHT_ENABLE
+  #include "backlight.h"
+#endif
 #include "action_layer.h"
 #include "keymap_midi.h"
+#include "audio.h"
 #include <avr/boot.h>
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -63,15 +68,31 @@ uint16_t hextokeycode(int hex) {
     }
 }
 
+float walk_up[][2] = {
+  {440.0*pow(2.0,(60)/12.0), 400},
+  {0, 50},
+  {440.0*pow(2.0,(67)/12.0), 600},
+};
+
+float walk_dn[][2] = {
+  {440.0*pow(2.0,(67)/12.0), 400},
+  {0, 50},
+  {440.0*pow(2.0,(60)/12.0), 600},
+};
+
 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 
 {
   // MACRODOWN only works in this function
       switch(id) {
         case 0:   
         if (record->event.pressed) {
+
+          play_notes(&walk_up, 3, false);
           // play_note(440, 20);
           // register_code(KC_RSFT);
-          backlight_set(BACKLIGHT_LEVELS);
+          #ifdef BACKLIGHT_ENABLE
+            backlight_set(BACKLIGHT_LEVELS);
+          #endif
           default_layer_and(0); 
           default_layer_or((1<<5));
 
@@ -103,19 +124,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
           // register_code(hextokeycode((lock & 0x0F)));
           // unregister_code(hextokeycode((lock & 0x0F)));
 
-          // note(0+12, 20);
-          // note(0+24, 20);
         } else {
-          // unregister_code(KC_RSFT);
-          // stop_note();
-          backlight_set(0);
+          unregister_code(KC_RSFT);
+          play_notes(&walk_dn, 3, false);
+          #ifdef BACKLIGHT_ENABLE
+            backlight_set(0);
+          #endif
           default_layer_and(0); 
           default_layer_or(0);
-          // note(0+24, 20);
-          // note(0, 20);
-          // play_note(4, 20);
         }
         break;
       } 
     return MACRO_NONE;
 };
+
+float start_up[][2] = {
+  {440.0*pow(2.0,(67)/12.0), 600},
+  {0, 50},
+  {440.0*pow(2.0,(64)/12.0), 400},
+  {0, 50},
+  {440.0*pow(2.0,(55)/12.0), 400},
+  {0, 50},
+  {440.0*pow(2.0,(60)/12.0), 400},
+  {0, 50},
+  {440.0*pow(2.0,(64)/12.0), 1000},
+};
+
+void * matrix_init_user(void) {
+    init_notes();
+    play_notes(&start_up, 9, false);
+}

keyboard/planck/keymaps/keymap_max.c → keyboard/planck/keymaps/max.c


keyboard/planck/keymaps/keymap_monkey.c → keyboard/planck/keymaps/monkey.c


keyboard/planck/keymaps/keymap_numpad.c → keyboard/planck/keymaps/numpad.c


BIN
keyboard/planck/keymaps/yang/WS2812-wiring.jpg


+ 85 - 5
quantum/template/keymaps/keymap_default.c

@@ -1,7 +1,10 @@
 // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
 // this is the style you want to emulate.
 
-#include "%KEYBOARD%.h"
+#include "planck.h"
+#ifdef BACKLIGHT_ENABLE
+  #include "backlight.h"
+#endif
 
 // Each layer gets a name for readability, which is then used in the keymap matrix below.
 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -12,25 +15,26 @@
 #define _DV 2
 #define _LW 3
 #define _RS 4
+#define _RGB 5
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 [_QW] = { /* Qwerty */
   {KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC},
   {KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT},
   {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT },
-  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), F(0),    F(0),    MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
 },
 [_CM] = { /* Colemak */
   {KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSPC},
   {KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT},
   {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT },
-  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), F(0),    F(0),    MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
 },
 [_DV] = { /* Dvorak */
   {KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,    KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_BSPC},
   {KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,    KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_SLSH},
   {KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,    KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_ENT },
-  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC,  KC_SPC,  MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
+  {M(0),    KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), F(0),    F(0),    MO(_RS), KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT}
 },
 [_RS] = { /* RAISE */
   {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC},
@@ -43,11 +47,37 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   {KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
   {KC_TRNS, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  DF(_QW), DF(_CM), DF(_DV), RESET,   KC_TRNS},
   {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
+},
+[_RGB] = { /* RGBLIGHT */
+  {KC_TRNS,  KC_PGUP,  KC_UP,    KC_PGDN,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_DEL},
+  {KC_TRNS,  KC_LEFT,  KC_DOWN,  KC_RGHT,  KC_TRNS,  KC_HOME,  KC_LEFT,  KC_DOWN,  KC_UP,    KC_RGHT,  KC_END,   KC_TRNS},
+  {KC_TRNS,  F(1),     F(2),     F(3),     F(4),     F(5),     F(6),     F(7),     F(8),     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}
+
 }
 };
 
-const uint16_t PROGMEM fn_actions[] = {
+enum function_id {
+    RGBLED_TOGGLE,
+    RGBLED_STEP_MODE,
+    RGBLED_INCREASE_HUE,
+    RGBLED_DECREASE_HUE,
+    RGBLED_INCREASE_SAT,
+    RGBLED_DECREASE_SAT,
+    RGBLED_INCREASE_VAL,
+    RGBLED_DECREASE_VAL,
+};
 
+const uint16_t PROGMEM fn_actions[] = {
+  [0]  = ACTION_LAYER_TAP_KEY(_RGB, KC_SPC),
+  [1]  = ACTION_FUNCTION(RGBLED_TOGGLE),
+  [2]  = ACTION_FUNCTION(RGBLED_STEP_MODE),
+  [3]  = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
+  [4]  = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
+  [5]  = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
+  [6]  = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
+  [7]  = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
+  [8]  = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
 };
 
 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
@@ -57,6 +87,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case 0:
           if (record->event.pressed) {
             register_code(KC_RSFT);
+            #ifdef BACKLIGHT_ENABLE
+              backlight_step();
+            #endif
           } else {
             unregister_code(KC_RSFT);
           }
@@ -64,3 +97,50 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
       }
     return MACRO_NONE;
 };
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  switch (id) {
+    case RGBLED_TOGGLE:
+      //led operations
+      if (record->event.pressed) {
+        rgblight_toggle();
+      }
+
+      break;
+    case RGBLED_INCREASE_HUE:
+      if (record->event.pressed) {
+        rgblight_increase_hue();
+      }
+      break;
+    case RGBLED_DECREASE_HUE:
+      if (record->event.pressed) {
+        rgblight_decrease_hue();
+      }
+      break;
+    case RGBLED_INCREASE_SAT:
+      if (record->event.pressed) {
+        rgblight_increase_sat();
+      }
+      break;
+    case RGBLED_DECREASE_SAT:
+      if (record->event.pressed) {
+        rgblight_decrease_sat();
+      }
+      break;
+      case RGBLED_INCREASE_VAL:
+        if (record->event.pressed) {
+          rgblight_increase_val();
+        }
+        break;
+      case RGBLED_DECREASE_VAL:
+        if (record->event.pressed) {
+          rgblight_decrease_val();
+        }
+        break;
+      case RGBLED_STEP_MODE:
+        if (record->event.pressed) {
+          rgblight_step();
+        }
+        break;
+  }
+}

BIN
keyboard/planck/keymaps/yang/planck-with-rgb-underglow.jpg


+ 6 - 1
keyboard/planck/planck.c

@@ -15,6 +15,11 @@ void * matrix_init_kb(void) {
     	backlight_init_ports();
 	#endif
 
+	#ifdef RGBLIGHT_ENABLE
+		rgblight_init();
+	#endif
+
+
     // Turn status LED on
     DDRE |= (1<<6);
     PORTE |= (1<<6);
@@ -28,4 +33,4 @@ void * matrix_scan_kb(void) {
 	if (matrix_scan_user) {
 		(*matrix_scan_user)();
 	}
-};
+};

+ 12 - 4
keyboard/planck/planck.h

@@ -3,8 +3,16 @@
 
 #include "matrix.h"
 #include "keymap_common.h"
-#include "backlight.h"
+#ifdef BACKLIGHT_ENABLE
+	#include "backlight.h"
+#endif
+#ifdef RGBLIGHT_ENABLE
+  #include "rgblight.h"
+#endif
 #include <stddef.h>
+#ifdef MIDI_ENABLE
+	#include <keymap_midi.h>
+#endif
 
 #define PLANCK_MIT( \
 	k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
@@ -17,7 +25,7 @@
 	{ 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, k35, k37, k38, k39, k3a, k3b } \
-} 
+}
 
 #define PLANCK_GRID( \
 	k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
@@ -30,9 +38,9 @@
 	{ 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 } \
-} 
+}
 
 void * matrix_init_user(void);
 void * matrix_scan_user(void);
 
-#endif
+#endif

+ 1 - 1
new_project.sh

@@ -12,7 +12,7 @@ sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboard/$KEYBOA
 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD/config.h
 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md
 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile
-sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/keymap_default.c > keyboard/$KEYBOARD/keymaps/keymap_default.c
+sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default.c > keyboard/$KEYBOARD/keymaps/default.c
 cp quantum/template/bootloader.hex keyboard/$KEYBOARD/bootloader.hex
 
 echo "######################################################"

+ 362 - 0
quantum/audio.c

@@ -0,0 +1,362 @@
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <avr/pgmspace.h>
+#include <avr/interrupt.h>
+#include <avr/io.h>
+
+#include "audio.h"
+#include "keymap_common.h"
+
+#define PI 3.14159265
+
+// #define PWM_AUDIO
+
+#ifdef PWM_AUDIO
+    #include "wave.h"
+    #define SAMPLE_DIVIDER 39
+    #define SAMPLE_RATE (2000000.0/SAMPLE_DIVIDER/2048)
+    // Resistor value of 1/ (2 * PI * 10nF * (2000000 hertz / SAMPLE_DIVIDER / 10)) for 10nF cap
+#endif
+
+void delay_us(int count) {
+  while(count--) {
+    _delay_us(1);
+  }
+}
+
+int voices = 0;
+int voice_place = 0;
+double frequency = 0;
+int volume = 0;
+long position = 0;
+
+double frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+bool sliding = false;
+
+int max = 0xFF;
+float sum = 0;
+int value = 128;
+float place = 0;
+float places[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+uint16_t place_int = 0;
+bool repeat = true;
+uint8_t * sample;
+uint16_t sample_length = 0;
+
+
+bool notes = false;
+bool note = false;
+float note_frequency = 0;
+float note_length = 0;
+uint16_t note_position = 0;
+float (* notes_pointer)[][2];
+uint8_t notes_length;
+bool notes_repeat;
+uint8_t current_note = 0;
+
+void stop_all_notes() {
+    voices = 0;
+    #ifdef PWM_AUDIO
+        TIMSK3 &= ~_BV(OCIE3A);
+    #else
+        TIMSK3 &= ~_BV(OCIE3A);
+        TCCR3A &= ~_BV(COM3A1);
+    #endif
+    notes = false;
+    note = false;
+    frequency = 0;
+    volume = 0;
+
+    for (int i = 0; i < 8; i++) {
+        frequencies[i] = 0;
+        volumes[i] = 0;
+    }
+}
+
+void stop_note(double freq) {
+    #ifdef PWM_AUDIO
+        freq = freq / SAMPLE_RATE;
+    #endif
+    for (int i = 7; i >= 0; i--) {
+        if (frequencies[i] == freq) {
+            frequencies[i] = 0;
+            volumes[i] = 0;
+            for (int j = i; (j < 7); j++) {
+                frequencies[j] = frequencies[j+1];
+                frequencies[j+1] = 0;
+                volumes[j] = volumes[j+1];
+                volumes[j+1] = 0;
+            }
+        }
+    }
+    voices--;
+    if (voices < 0)
+        voices = 0;
+    if (voices == 0) {
+        #ifdef PWM_AUDIO
+            TIMSK3 &= ~_BV(OCIE3A);
+        #else
+            TIMSK3 &= ~_BV(OCIE3A);
+            TCCR3A &= ~_BV(COM3A1);
+        #endif
+        frequency = 0;
+        volume = 0;
+        note = false;
+    } else {
+        double freq = frequencies[voices - 1];
+        int vol = volumes[voices - 1];
+        double starting_f = frequency;
+        if (frequency < freq) {
+            sliding = true;
+            for (double f = starting_f; f <= freq; f += ((freq - starting_f) / 2000.0)) {
+                frequency = f;
+            }
+            sliding = false;
+        } else if (frequency > freq) {
+            sliding = true;
+            for (double f = starting_f; f >= freq; f -= ((starting_f - freq) / 2000.0)) {
+                frequency = f;
+            }
+            sliding = false;
+        }
+        frequency = freq;
+        volume = vol;
+    }
+}
+
+void init_notes() {
+
+    #ifdef PWM_AUDIO
+        PLLFRQ = _BV(PDIV2);
+        PLLCSR = _BV(PLLE);
+        while(!(PLLCSR & _BV(PLOCK)));
+        PLLFRQ |= _BV(PLLTM0); /* PCK 48MHz */
+
+        /* Init a fast PWM on Timer4 */
+        TCCR4A = _BV(COM4A0) | _BV(PWM4A); /* Clear OC4A on Compare Match */
+        TCCR4B = _BV(CS40); /* No prescaling => f = PCK/256 = 187500Hz */
+        OCR4A = 0;
+
+        /* Enable the OC4A output */
+        DDRC |= _BV(PORTC6);
+
+        TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs
+        
+        TCCR3A = 0x0; // Options not needed
+        TCCR3B = _BV(CS31) | _BV(CS30) | _BV(WGM32); // 64th prescaling and CTC
+        OCR3A = SAMPLE_DIVIDER - 1; // Correct count/compare, related to sample playback
+    #else
+        DDRC |= _BV(PORTC6);
+
+        TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs
+
+        TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
+        TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
+    #endif
+}
+
+
+ISR(TIMER3_COMPA_vect) {
+
+    if (note) {
+        #ifdef PWM_AUDIO
+            if (voices == 1) {
+                // SINE
+                OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 2;
+            
+                // SQUARE
+                // if (((int)place) >= 1024){
+                //     OCR4A = 0xFF >> 2;
+                // } else {
+                //     OCR4A = 0x00;
+                // }
+                
+                // SAWTOOTH
+                // OCR4A = (int)place / 4;
+
+                // TRIANGLE
+                // if (((int)place) >= 1024) {
+                //     OCR4A = (int)place / 2;
+                // } else {
+                //     OCR4A = 2048 - (int)place / 2;
+                // }
+
+                place += frequency;
+
+                if (place >= SINE_LENGTH)
+                    place -= SINE_LENGTH;
+
+            } else {
+                int sum = 0;
+                for (int i = 0; i < voices; i++) {
+                    // SINE
+                    sum += pgm_read_byte(&sinewave[(uint16_t)places[i]]) >> 2;
+
+                    // SQUARE
+                    // if (((int)places[i]) >= 1024){
+                    //     sum += 0xFF >> 2;
+                    // } else {
+                    //     sum += 0x00;
+                    // }
+
+                    places[i] += frequencies[i];
+
+                    if (places[i] >= SINE_LENGTH)
+                        places[i] -= SINE_LENGTH;
+                }
+                OCR4A = sum;
+            }
+        #else
+            if (frequency > 0) {
+                // ICR3 = (int)(((double)F_CPU) / frequency); // Set max to the period
+                // OCR3A = (int)(((double)F_CPU) / frequency) >> 1; // Set compare to half the period
+                if (place > 10) {
+                    voice_place = (voice_place + 1) % voices;
+                    place = 0.0;
+                }
+                ICR3 = (int)(((double)F_CPU) / frequencies[voice_place]); // Set max to the period
+                OCR3A = (int)(((double)F_CPU) / frequencies[voice_place]) >> 1; // Set compare to half the period
+                place++;
+            }
+        #endif
+    }
+
+    // SAMPLE
+    // OCR4A = pgm_read_byte(&sample[(uint16_t)place_int]);
+
+    // place_int++;
+
+    // if (place_int >= sample_length)
+    //     if (repeat)
+    //         place_int -= sample_length;
+    //     else
+    //         TIMSK3 &= ~_BV(OCIE3A);
+
+
+    if (notes) {
+        #ifdef PWM_AUDIO
+            OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 0;
+
+            place += note_frequency;
+            if (place >= SINE_LENGTH)
+                place -= SINE_LENGTH;
+        #else
+            if (note_frequency > 0) {
+                ICR3 = (int)(((double)F_CPU) / note_frequency); // Set max to the period
+                OCR3A = (int)(((double)F_CPU) / note_frequency) >> 1; // Set compare to half the period
+            }
+        #endif
+
+
+        note_position++;
+        if (note_position >= note_length) {
+            current_note++;
+            if (current_note >= notes_length) {
+                if (notes_repeat) {
+                    current_note = 0;
+                } else {
+                    #ifdef PWM_AUDIO
+                        TIMSK3 &= ~_BV(OCIE3A);
+                    #else
+                        TIMSK3 &= ~_BV(OCIE3A);
+                        TCCR3A &= ~_BV(COM3A1);
+                    #endif
+                    notes = false;
+                    return;
+                }
+            }
+            #ifdef PWM_AUDIO
+                note_frequency = (*notes_pointer)[current_note][0] / SAMPLE_RATE;
+                note_length = (*notes_pointer)[current_note][1];
+            #else
+                note_frequency = (*notes_pointer)[current_note][0];
+                note_length = (*notes_pointer)[current_note][1] / 4;
+            #endif
+            note_position = 0;
+        }
+
+    }
+
+}
+
+void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat) {
+    if (note)
+        stop_all_notes();
+    notes = true;
+
+    notes_pointer = np;
+    notes_length = n_length;
+    notes_repeat = n_repeat;
+
+    place = 0;
+    current_note = 0;
+    #ifdef PWM_AUDIO
+        note_frequency = (*notes_pointer)[current_note][0] / SAMPLE_RATE;
+        note_length = (*notes_pointer)[current_note][1];
+    #else
+        note_frequency = (*notes_pointer)[current_note][0];
+        note_length = (*notes_pointer)[current_note][1] / 4;
+    #endif
+    note_position = 0;
+
+
+    #ifdef PWM_AUDIO
+        TIMSK3 |= _BV(OCIE3A);
+    #else
+        TIMSK3 |= _BV(OCIE3A);
+        TCCR3A |= _BV(COM3A1);
+    #endif
+}
+
+void play_sample(uint8_t * s, uint16_t l, bool r) {
+    stop_all_notes();
+    place_int = 0;
+    sample = s;
+    sample_length = l;
+    repeat = r;
+
+    #ifdef PWM_AUDIO
+        TIMSK3 |= _BV(OCIE3A);
+    #else
+    #endif
+}
+
+void play_note(double freq, int vol) {
+    if (notes)
+        stop_all_notes();
+    note = true;
+    #ifdef PWM_AUDIO
+        freq = freq / SAMPLE_RATE;
+    #endif
+    if (freq > 0) {
+        if (frequency != 0) {
+            double starting_f = frequency;
+            if (frequency < freq) {
+                for (double f = starting_f; f <= freq; f += ((freq - starting_f) / 2000.0)) {   
+                    frequency = f;
+                }
+            } else if (frequency > freq) {
+                for (double f = starting_f; f >= freq; f -= ((starting_f - freq) / 2000.0)) {
+                    frequency = f;
+                }
+            }
+        }
+        frequency = freq;
+        volume = vol;
+
+        frequencies[voices] = frequency;
+        volumes[voices] = volume;
+        voices++;
+    }
+
+    #ifdef PWM_AUDIO
+        TIMSK3 |= _BV(OCIE3A);
+    #else
+        TIMSK3 |= _BV(OCIE3A);
+        TCCR3A |= _BV(COM3A1);
+    #endif
+
+}

+ 3 - 4
quantum/beeps.h

@@ -3,10 +3,9 @@
 #include <avr/io.h>
 #include <util/delay.h>
 
-void note(int x, float length);
-void beeps();
-void true_note(float x, float y, float length);
+void play_sample(uint8_t * s, uint16_t l, bool r);
 void play_note(double freq, int vol);
 void stop_note(double freq);
 void stop_all_notes();
-void init_notes();
+void init_notes();
+void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat);

+ 0 - 246
quantum/beeps.c

@@ -1,246 +0,0 @@
-#include "beeps.h"
-#include <math.h>
-#include <avr/pgmspace.h>
-#include <avr/interrupt.h>
-#include <avr/io.h>
-
-#define PI 3.14159265
-
-void delay_us(int count) {
-  while(count--) {
-    _delay_us(1);
-  }
-}
-
-int voices = 0;
-double frequency = 0;
-int volume = 0;
-int position = 0;
-
-double frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-bool sliding = false;
-#define RANGE 1000
-volatile int i=0; //elements of the wave
-
-
-void beeps() {
-    play_notes();
-}
-
-void send_freq(double freq, int vol) {
-    int duty = (((double)F_CPU) / freq);
-    ICR3 = duty; // Set max to the period
-    OCR3A = duty >> (0x10 - vol); // Set compare to half the period
-}
-
-void stop_all_notes() {
-    voices = 0;
-    TCCR3A = 0;
-    TCCR3B = 0;
-    frequency = 0;
-    volume = 0;
-
-    for (int i = 0; i < 8; i++) {
-        frequencies[i] = 0;
-        volumes[i] = 0;
-    }
-}
-
-void stop_note(double freq) {
-    for (int i = 7; i >= 0; i--) {
-        if (frequencies[i] == freq) {
-            frequencies[i] = 0;
-            volumes[i] = 0;
-            for (int j = i; (j < 7); j++) {
-                frequencies[j] = frequencies[j+1];
-                frequencies[j+1] = 0;
-                volumes[j] = volumes[j+1];
-                volumes[j+1] = 0;
-            }
-        }
-    }
-    voices--;
-    if (voices < 0)
-        voices = 0;
-    if (voices == 0) {
-        TCCR3A = 0;
-        TCCR3B = 0;
-        frequency = 0;
-        volume = 0;
-    } else {
-        double freq = frequencies[voices - 1];
-        int vol = volumes[voices - 1];
-        if (frequency < freq) {
-            sliding = true;
-            for (double f = frequency; f <= freq; f += ((freq - frequency) / 500.0)) {
-                send_freq(f, vol);
-            }
-            sliding = false;
-        } else if (frequency > freq) {
-            sliding = true;
-            for (double f = frequency; f >= freq; f -= ((frequency - freq) / 500.0)) {
-                send_freq(f, vol);
-            }
-            sliding = false;
-        }
-        send_freq(freq, vol);
-        frequency = freq;
-        volume = vol;
-    }
-}
-
-void init_notes() {
-    // TCCR1A = (1 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (1 << WGM10);
-    // TCCR1B = (1 << COM1B1) | (0 << COM1A0) | (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (0 << CS11) | (1 << CS10);
-
-    // DDRC |= (1<<6); 
-
-    // TCCR3A = (1 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
-    // TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (0 << CS31) | (1 << CS30);
-
-    // ICR3 = 0xFFFF; 
-    // OCR3A = (int)((float)wave[i]*ICR3/RANGE); //go to next array element
-
-
-    // cli();
-
-    // /* Enable interrupt on timer2 == 127, with clk/8 prescaler. At 16MHz,
-    //    this gives a timer interrupt at 15625Hz. */
-    // TIMSK3 = (1 << OCIE3A);
-
-    // /* clear/reset timer on match */
-    // // TCCR3A = 1<<WGM31 | 0<<WGM30;  CTC mode, reset on match 
-    // // TCCR3B = 0<<CS32 | 1<<CS31 | 0<<CS30; /* clk, /8 prescaler */
-
-    // TCCR3A = (1 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
-    // TCCR3B = (0 << WGM33) | (0 << WGM32) | (0 << CS32) | (0 << CS31) | (1 << CS30);
-
-
-    // TCCR1A = (1 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (0 << WGM10);
-    // TCCR1B = (1 << WGM12) | (0 << CS12) | (0 << CS11) | (1 << CS10);
-    // // SPCR = 0x50;
-    // // SPSR = 0x01;
-    // DDRC |= (1<<6);
-    // // ICR3 = 0xFFFF; 
-    // // OCR3A=80;
-    // PORTC |= (1<<6);
-
-    // sei();
-}
-
-// #define highByte(c) ((c >> 8) & 0x00FF)
-// #define lowByte(c) (c & 0x00FF)
-
-ISR(TIMER3_COMPA_vect) {
-
-    if (ICR3 > 0 && !sliding) {
-        switch (position) {
-            case 0: {
-                int duty = (((double)F_CPU) / (frequency));
-                ICR3 = duty; // Set max to the period
-                OCR3A = duty >> 1; // Set compare to half the period
-                break;
-            }
-            case 1: {
-                int duty = (((double)F_CPU) / (frequency*2));
-                ICR3 = duty; // Set max to the period
-                OCR3A = duty >> 1; // Set compare to half the period
-                break;
-            }
-            case 2: {
-                int duty = (((double)F_CPU) / (frequency*3));
-                ICR3 = duty; // Set max to the period
-                OCR3A = duty >> 1; // Set compare to half the period
-                break;
-            }
-        }
-        position = (position + 1) % 3;
-    }
-//     /* OCR2A has been cleared, per TCCR2A above */
-//     // OCR3A = 127;
-
-//     // pos1 += incr1;
-//     // pos2 += incr2;
-//     // pos3 += incr3;
-
-//     // sample = sinewave[highByte(pos1)] + sinewave[highByte(pos2)] + sinewave[highByte(pos3)];
-
-//     // OCR3A = sample;
-
-
-//     OCR3A=pgm_read_byte(&sinewave[pos1]);
-//     pos1++;
-//     // PORTC &= ~(1<<6);
-
-//     /* buffered, 1x gain, active mode */
-//     // SPDR = highByte(sample) | 0x70;
-//     // while (!(SPSR & (1<<SPIF)));
-
-//     // SPDR = lowByte(sample);
-//     // while (!(SPSR & (1<<SPIF)));
-
-//     // PORTC |= (1<<6);
-}
-
-void play_note(double freq, int vol) {
-
-    if (freq > 0) {
-        DDRC |= (1<<6); 
-
-        TCCR3A = (1 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
-        TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
-
-        if (frequency != 0) {
-            if (frequency < freq) {
-                for (double f = frequency; f <= freq; f += ((freq - frequency) / 500.0)) {
-                    send_freq(f, vol);
-                }
-            } else if (frequency > freq) {
-                for (double f = frequency; f >= freq; f -= ((frequency - freq) / 500.0)) {
-                    send_freq(f, vol);
-                }
-            }
-        }
-        send_freq(freq, vol);
-        frequency = freq;
-        volume = vol;
-
-        frequencies[voices] = frequency;
-        volumes[voices] = volume;
-        voices++;
-    }
-    // ICR3 = 0xFFFF;
-    // for (int i = 0; i < 10000; i++) {
-    //     OCR3A = round((sin(i*freq)*.5)+.5)*0xFFFF;
-    //     // _delay_us(50);
-    // }
-
-    // TCCR3A = 0;
-    // TCCR3B = 0;
-}
-
-// void note(int x, float length) {
-//     DDRC |= (1<<6);
-// 	int t = (int)(440*pow(2,-x/12.0)); // starting note
-//     for (int y = 0; y < length*1000/t; y++) { // note length
-//         PORTC |= (1<<6);
-//         delay_us(t);
-//         PORTC &= ~(1<<6);
-//         delay_us(t);
-//     }
-// 	PORTC &= ~(1<<6);
-// }
-
-// void true_note(float x, float y, float length) {
-// 	for (uint32_t i = 0; i < length * 50; i++) {
-// 		uint32_t v = (uint32_t) (round(sin(PI*2*i*640000*pow(2, x/12.0))*.5+1 + sin(PI*2*i*640000*pow(2, y/12.0))*.5+1) / 2 * pow(2, 8)); 
-// 		for (int u = 0; u < 8; u++) {
-// 			if (v & (1 << u) && !(PORTC&(1<<6)))
-// 		        PORTC |= (1<<6);
-// 		    else if (PORTC&(1<<6))
-// 	        	PORTC &= ~(1<<6);
-// 		}
-// 	}
-// 	PORTC &= ~(1<<6);
-// }

+ 10 - 11
quantum/keymap_midi.c

@@ -17,7 +17,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "keymap_common.h"
 #include "keymap_midi.h"
-#include <lufa.h>
 
 uint8_t starting_note = 0x0C;
 int offset = 7;
@@ -35,7 +34,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
     if (record->event.key.col == (MATRIX_COLS - 1) && record->event.key.row == (MATRIX_ROWS - 1)) {
         if (record->event.pressed) {
             starting_note++;
-            play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
+            play_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
             midi_send_cc(&midi_device, 0, 0x7B, 0);
             midi_send_cc(&midi_device, 1, 0x7B, 0);
             midi_send_cc(&midi_device, 2, 0x7B, 0);
@@ -43,7 +42,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
             midi_send_cc(&midi_device, 4, 0x7B, 0);
             return;
         } else {
-            stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)));
+            stop_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)));
             stop_all_notes();
             return;
         }
@@ -51,7 +50,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
     if (record->event.key.col == (MATRIX_COLS - 2) && record->event.key.row == (MATRIX_ROWS - 1)) {
         if (record->event.pressed) {
             starting_note--;
-            play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
+            play_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
             midi_send_cc(&midi_device, 0, 0x7B, 0);
             midi_send_cc(&midi_device, 1, 0x7B, 0);
             midi_send_cc(&midi_device, 2, 0x7B, 0);
@@ -59,7 +58,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
             midi_send_cc(&midi_device, 4, 0x7B, 0);
             return;
         } else {
-            stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)));
+            stop_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[0 + offset])/12.0+(MATRIX_ROWS - 1)));
             stop_all_notes();
             return;
         }
@@ -74,9 +73,9 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
         midi_send_cc(&midi_device, 4, 0x7B, 0);
         stop_all_notes();
         for (int i = 0; i <= 7; i++) {
-            play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
+            play_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
             _delay_us(80000);
-            stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)));
+            stop_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)));
             _delay_us(8000);
         }
         return;
@@ -90,9 +89,9 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
         midi_send_cc(&midi_device, 4, 0x7B, 0);
         stop_all_notes();
         for (int i = 0; i <= 7; i++) {
-            play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
+            play_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)), 0xC);
             _delay_us(80000);
-            stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)));
+            stop_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[i + offset])/12.0+(MATRIX_ROWS - 1)));
             _delay_us(8000);
         }
         return;
@@ -101,10 +100,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
     if (record->event.pressed) {
     	// midi_send_noteon(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127);
         midi_send_noteon(&midi_device, 0, (starting_note + SCALE[record->event.key.col + offset])+12*(MATRIX_ROWS - record->event.key.row), 127);
-        play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
+        play_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
     } else {
         // midi_send_noteoff(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127);
         midi_send_noteoff(&midi_device, 0, (starting_note + SCALE[record->event.key.col + offset])+12*(MATRIX_ROWS - record->event.key.row), 127);
-        stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
+        stop_note(((double)261.626)*pow(2.0, -1.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
     }
 }

+ 2 - 0
quantum/keymap_midi.h

@@ -18,6 +18,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef KEYMAP_MIDI_H
 #define KEYMAP_MIDI_H
 
+#include <lufa.h>
+
 #define MIDI 0x6000
 #define MIDI12 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000
 

+ 2 - 0
quantum/keymap_unicode.c

@@ -30,6 +30,8 @@ uint16_t hextokeycode(int hex) {
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
 
+    // For more info on how this works per OS, see here: https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input
+
     if (record->event.pressed) {
         uint16_t unicode = (opt << 8) | id;
         register_code(KC_LALT);

+ 181 - 0
quantum/light_ws2812.c

@@ -0,0 +1,181 @@
+/*
+* light weight WS2812 lib V2.0b
+*
+* Controls WS2811/WS2812/WS2812B RGB-LEDs
+* Author: Tim (cpldcpu@gmail.com)
+*
+* Jan 18th, 2014  v2.0b Initial Version
+* Nov 29th, 2015  v2.3  Added SK6812RGBW support
+*
+* License: GNU GPL v2 (see License.txt)
+*/
+
+#include "light_ws2812.h"
+#include <avr/interrupt.h>
+#include <avr/io.h>
+#include <util/delay.h>
+#include "debug.h"
+
+// Setleds for standard RGB
+void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds)
+{
+   ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
+}
+
+void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask)
+{
+  ws2812_DDRREG |= pinmask; // Enable DDR
+  ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask);
+  _delay_us(50);
+}
+
+// Setleds for SK6812RGBW
+void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds)
+{
+  ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR
+  ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(ws2812_pin));
+  _delay_us(80);
+}
+
+void ws2812_sendarray(uint8_t *data,uint16_t datlen)
+{
+  ws2812_sendarray_mask(data,datlen,_BV(ws2812_pin));
+}
+
+/*
+  This routine writes an array of bytes with RGB values to the Dataout pin
+  using the fast 800kHz clockless WS2811/2812 protocol.
+*/
+
+// Timing in ns
+#define w_zeropulse   350
+#define w_onepulse    900
+#define w_totalperiod 1250
+
+// Fixed cycles used by the inner loop
+#define w_fixedlow    2
+#define w_fixedhigh   4
+#define w_fixedtotal  8
+
+// Insert NOPs to match the timing, if possible
+#define w_zerocycles    (((F_CPU/1000)*w_zeropulse          )/1000000)
+#define w_onecycles     (((F_CPU/1000)*w_onepulse    +500000)/1000000)
+#define w_totalcycles   (((F_CPU/1000)*w_totalperiod +500000)/1000000)
+
+// w1 - nops between rising edge and falling edge - low
+#define w1 (w_zerocycles-w_fixedlow)
+// w2   nops between fe low and fe high
+#define w2 (w_onecycles-w_fixedhigh-w1)
+// w3   nops to complete loop
+#define w3 (w_totalcycles-w_fixedtotal-w1-w2)
+
+#if w1>0
+  #define w1_nops w1
+#else
+  #define w1_nops  0
+#endif
+
+// The only critical timing parameter is the minimum pulse length of the "0"
+// Warn or throw error if this timing can not be met with current F_CPU settings.
+#define w_lowtime ((w1_nops+w_fixedlow)*1000000)/(F_CPU/1000)
+#if w_lowtime>550
+   #error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?"
+#elif w_lowtime>450
+   #warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)."
+   #warning "Please consider a higher clockspeed, if possible"
+#endif
+
+#if w2>0
+#define w2_nops w2
+#else
+#define w2_nops  0
+#endif
+
+#if w3>0
+#define w3_nops w3
+#else
+#define w3_nops  0
+#endif
+
+#define w_nop1  "nop      \n\t"
+#define w_nop2  "rjmp .+0 \n\t"
+#define w_nop4  w_nop2 w_nop2
+#define w_nop8  w_nop4 w_nop4
+#define w_nop16 w_nop8 w_nop8
+
+void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)
+{
+  uint8_t curbyte,ctr,masklo;
+  uint8_t sreg_prev;
+
+  masklo	=~maskhi&ws2812_PORTREG;
+  maskhi |=        ws2812_PORTREG;
+  sreg_prev=SREG;
+  cli();
+
+  while (datlen--) {
+    curbyte=*data++;
+
+    asm volatile(
+    "       ldi   %0,8  \n\t"
+    "loop%=:            \n\t"
+    "       out   %2,%3 \n\t"    //  '1' [01] '0' [01] - re
+#if (w1_nops&1)
+w_nop1
+#endif
+#if (w1_nops&2)
+w_nop2
+#endif
+#if (w1_nops&4)
+w_nop4
+#endif
+#if (w1_nops&8)
+w_nop8
+#endif
+#if (w1_nops&16)
+w_nop16
+#endif
+    "       sbrs  %1,7  \n\t"    //  '1' [03] '0' [02]
+    "       out   %2,%4 \n\t"    //  '1' [--] '0' [03] - fe-low
+    "       lsl   %1    \n\t"    //  '1' [04] '0' [04]
+#if (w2_nops&1)
+  w_nop1
+#endif
+#if (w2_nops&2)
+  w_nop2
+#endif
+#if (w2_nops&4)
+  w_nop4
+#endif
+#if (w2_nops&8)
+  w_nop8
+#endif
+#if (w2_nops&16)
+  w_nop16
+#endif
+    "       out   %2,%4 \n\t"    //  '1' [+1] '0' [+1] - fe-high
+#if (w3_nops&1)
+w_nop1
+#endif
+#if (w3_nops&2)
+w_nop2
+#endif
+#if (w3_nops&4)
+w_nop4
+#endif
+#if (w3_nops&8)
+w_nop8
+#endif
+#if (w3_nops&16)
+w_nop16
+#endif
+
+    "       dec   %0    \n\t"    //  '1' [+2] '0' [+2]
+    "       brne  loop%=\n\t"    //  '1' [+3] '0' [+4]
+    :	"=&d" (ctr)
+    :	"r" (curbyte), "I" (_SFR_IO_ADDR(ws2812_PORTREG)), "r" (maskhi), "r" (masklo)
+    );
+  }
+
+  SREG=sreg_prev;
+}

+ 73 - 0
quantum/light_ws2812.h

@@ -0,0 +1,73 @@
+/*
+ * light weight WS2812 lib include
+ *
+ * Version 2.3  - Nev 29th 2015
+ * Author: Tim (cpldcpu@gmail.com)
+ *
+ * Please do not change this file! All configuration is handled in "ws2812_config.h"
+ *
+ * License: GNU GPL v2 (see License.txt)
+ +
+ */
+
+#ifndef LIGHT_WS2812_H_
+#define LIGHT_WS2812_H_
+
+#include <avr/io.h>
+#include <avr/interrupt.h>
+//#include "ws2812_config.h"
+
+/*
+ *  Structure of the LED array
+ *
+ * cRGB:     RGB  for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106
+ * cRGBW:    RGBW for SK6812RGBW
+ */
+
+struct cRGB  { uint8_t g; uint8_t r; uint8_t b; };
+struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;};
+
+
+
+/* User Interface
+ *
+ * Input:
+ *         ledarray:           An array of GRB data describing the LED colors
+ *         number_of_leds:     The number of LEDs to write
+ *         pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0)
+ *
+ * The functions will perform the following actions:
+ *         - Set the data-out pin as output
+ *         - Send out the LED data
+ *         - Wait 50�s to reset the LEDs
+ */
+
+void ws2812_setleds     (struct cRGB  *ledarray, uint16_t number_of_leds);
+void ws2812_setleds_pin (struct cRGB  *ledarray, uint16_t number_of_leds,uint8_t pinmask);
+void ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t number_of_leds);
+
+/*
+ * Old interface / Internal functions
+ *
+ * The functions take a byte-array and send to the data output as WS2812 bitstream.
+ * The length is the number of bytes to send - three per LED.
+ */
+
+void ws2812_sendarray     (uint8_t *array,uint16_t length);
+void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask);
+
+
+/*
+ * Internal defines
+ */
+#ifndef CONCAT
+#define CONCAT(a, b)            a ## b
+#endif
+#ifndef CONCAT_EXP
+#define CONCAT_EXP(a, b)   CONCAT(a, b)
+#endif
+
+// #define ws2812_PORTREG  CONCAT_EXP(PORT,ws2812_port)
+// #define ws2812_DDRREG   CONCAT_EXP(DDR,ws2812_port)
+
+#endif /* LIGHT_WS2812_H_ */

+ 27 - 4
quantum/quantum.mk

@@ -2,21 +2,45 @@ QUANTUM_DIR = quantum
 
 # # project specific files
 SRC += $(QUANTUM_DIR)/keymap_common.c \
-	$(QUANTUM_DIR)/led.c 
+	$(QUANTUM_DIR)/led.c
+
+# ifdef KEYMAP_FILE
+# ifneq (,$(shell grep USING_MIDI '$(KEYMAP_FILE)'))
+# MIDI_ENABLE=yes
+# $(info  * Overriding MIDI_ENABLE setting - $(KEYMAP_FILE) requires it)
+# endif
+# ifneq (,$(shell grep USING_UNICODE '$(KEYMAP_FILE)'))
+# UNICODE_ENABLE=yes
+# $(info  * Overriding UNICODE_ENABLE setting - $(KEYMAP_FILE) requires it)
+# endif
+# ifneq (,$(shell grep USING_BACKLIGHT '$(KEYMAP_FILE)'))
+# BACKLIGHT_ENABLE=yes
+# $(info  * Overriding BACKLIGHT_ENABLE setting - $(KEYMAP_FILE) requires it)
+# endif
+# endif
 
 ifndef CUSTOM_MATRIX
 	SRC += $(QUANTUM_DIR)/matrix.c
 endif
 
 ifdef MIDI_ENABLE
-	SRC += $(QUANTUM_DIR)/keymap_midi.c \
-		   $(QUANTUM_DIR)/beeps.c
+	SRC += $(QUANTUM_DIR)/keymap_midi.c
+endif
+
+ifdef AUDIO_ENABLE
+	SRC += $(QUANTUM_DIR)/audio.c
 endif
 
 ifdef UNICODE_ENABLE
 	SRC += $(QUANTUM_DIR)/keymap_unicode.c
 endif
 
+ifdef RGBLIGHT_ENABLE
+	SRC += $(QUANTUM_DIR)/light_ws2812.c
+	SRC += $(QUANTUM_DIR)/rgblight.c
+	OPT_DEFS += -DRGBLIGHT_ENABLE
+endif
+
 # Optimize size but this may cause error "relocation truncated to fit"
 #EXTRALDFLAGS = -Wl,--relax
 
@@ -27,4 +51,3 @@ include $(TMK_DIR)/protocol/lufa.mk
 
 include $(TMK_DIR)/common.mk
 include $(TMK_DIR)/rules.mk
-

File diff suppressed because it is too large
+ 505 - 0
quantum/rgblight.c


+ 87 - 0
quantum/rgblight.h

@@ -0,0 +1,87 @@
+#ifndef RGBLIGHT_H
+#define RGBLIGHT_H
+
+#ifndef RGBLIGHT_MODES
+#define RGBLIGHT_MODES 23
+#endif
+
+#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
+#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
+#endif
+
+#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
+#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
+#endif
+#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
+#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 9
+#endif
+
+#ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH
+#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
+#endif
+
+#ifndef RGBLIGHT_HUE_STEP
+#define RGBLIGHT_HUE_STEP 10
+#endif
+#ifndef RGBLIGHT_SAT_STEP
+#define RGBLIGHT_SAT_STEP 17
+#endif
+#ifndef RGBLIGHT_VAL_STEP
+#define RGBLIGHT_VAL_STEP 17
+#endif
+
+#define RGBLED_TIMER_TOP F_CPU/(256*64)
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "eeconfig.h"
+#include "light_ws2812.h"
+
+typedef union {
+  uint32_t raw;
+  struct {
+    bool     enable  :1;
+    uint8_t  mode    :6;
+    uint16_t hue     :9;
+    uint8_t  sat     :8;
+    uint8_t  val     :8;
+  };
+} rgblight_config_t;
+
+void rgblight_init(void);
+void rgblight_increase(void);
+void rgblight_decrease(void);
+void rgblight_toggle(void);
+void rgblight_step(void);
+void rgblight_mode(uint8_t mode);
+void rgblight_set(void);
+void rgblight_increase_hue(void);
+void rgblight_decrease_hue(void);
+void rgblight_increase_sat(void);
+void rgblight_decrease_sat(void);
+void rgblight_increase_val(void);
+void rgblight_decrease_val(void);
+void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
+void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
+
+#define EECONFIG_RGBLIGHT (uint8_t *)7
+uint32_t eeconfig_read_rgblight(void);
+void eeconfig_write_rgblight(uint32_t val);
+void eeconfig_write_rgblight_default(void);
+void eeconfig_debug_rgblight(void);
+
+void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1);
+void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1);
+void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
+
+void rgblight_timer_init(void);
+void rgblight_timer_enable(void);
+void rgblight_timer_disable(void);
+void rgblight_timer_toggle(void);
+void rgblight_effect_breathing(uint8_t interval);
+void rgblight_effect_rainbow_mood(uint8_t interval);
+void rgblight_effect_rainbow_swirl(uint8_t interval);
+void rgblight_effect_snake(uint8_t interval);
+void rgblight_effect_knight(uint8_t interval);
+
+#endif

+ 3 - 3
quantum/template/Makefile

@@ -53,9 +53,9 @@ TARGET_DIR = .
 SRC = %KEYBOARD%.c
 
 ifdef KEYMAP
-    SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
+    SRC := keymaps/$(KEYMAP).c $(SRC)
 else
-    SRC := keymaps/keymap_default.c $(SRC)
+    SRC := keymaps/default.c $(SRC)
 endif
 
 CONFIG_H = config.h
@@ -107,7 +107,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
 #   Atmel DFU loader 4096
 #   LUFA bootloader  4096
 #   USBaspLoader     2048
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
+OPT_DEFS += -DBOOTLOADER_SIZE=512
 
 
 # Build Options

+ 3 - 3
quantum/template/README.md

@@ -88,7 +88,7 @@ Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` -
 
 ## Macro shortcuts: Send a whole string when pressing just one key
 
-Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c).
+Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymaps/default.c).
 
 ```c
 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
@@ -171,10 +171,10 @@ Depending on which keymap you would like to use, you will have to compile slight
 To build with the default keymap, simply run `make`.
 
 ### 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 file named `keymap_<name>.c` and see keymap document (you can find in top README.md) and existent keymap files.
+Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top README.md) and existent keymap files.
 
 To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
 ```
 $ make KEYMAP=[default|jack|<name>]
 ```
-Keymaps follow the format **__keymap\_\<name\>.c__** and are stored in the `keymaps` folder.
+Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

+ 4 - 4
quantum/template/config.h

@@ -29,14 +29,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define DESCRIPTION     A custom keyboard
 
 /* key matrix size */
-#define MATRIX_ROWS 4
-#define MATRIX_COLS 12
+#define MATRIX_ROWS 2
+#define MATRIX_COLS 3
 
 // Planck PCB default pin-out
 // Change this to how you wired your keyboard
 // COLS: Left to right, ROWS: Top to bottom
-#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
-#define ROWS (int []){ D0, D5, B5, B6 }
+#define COLS (int []){ F1, F0, B0 }
+#define ROWS (int []){ D0, D5 }
 
 /* COL2ROW or ROW2COL */
 #define DIODE_DIRECTION COL2ROW

+ 4 - 8
quantum/template/template.h

@@ -11,16 +11,12 @@
 // 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,   k37, k38, k39, k3a, k3b \
+    k00, k01, k02, \
+      k10,  k11,   \
 ) \
 { \
-	{ 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, k35, k37, k38, k39, k3a, k3b } \
+    { k00, k01,   k02 }, \
+    { k10, KC_NO, k11 }, \
 } 
 
 void * matrix_init_user(void);

+ 265 - 0
quantum/wave.h

@@ -0,0 +1,265 @@
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <avr/pgmspace.h>
+
+#define SINE_LENGTH 2048
+
+const uint8_t sinewave[] PROGMEM= //2048 values
+{
+0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82,
+0x83,0x83,0x83,0x84,0x84,0x85,0x85,0x85,
+0x86,0x86,0x87,0x87,0x87,0x88,0x88,0x88,
+0x89,0x89,0x8a,0x8a,0x8a,0x8b,0x8b,0x8c,
+0x8c,0x8c,0x8d,0x8d,0x8e,0x8e,0x8e,0x8f,
+0x8f,0x8f,0x90,0x90,0x91,0x91,0x91,0x92,
+0x92,0x93,0x93,0x93,0x94,0x94,0x95,0x95,
+0x95,0x96,0x96,0x96,0x97,0x97,0x98,0x98,
+0x98,0x99,0x99,0x9a,0x9a,0x9a,0x9b,0x9b,
+0x9b,0x9c,0x9c,0x9d,0x9d,0x9d,0x9e,0x9e,
+0x9e,0x9f,0x9f,0xa0,0xa0,0xa0,0xa1,0xa1,
+0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa4,0xa4,
+0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa7,0xa7,
+0xa7,0xa8,0xa8,0xa9,0xa9,0xa9,0xaa,0xaa,
+0xaa,0xab,0xab,0xac,0xac,0xac,0xad,0xad,
+0xad,0xae,0xae,0xae,0xaf,0xaf,0xb0,0xb0,
+0xb0,0xb1,0xb1,0xb1,0xb2,0xb2,0xb2,0xb3,
+0xb3,0xb4,0xb4,0xb4,0xb5,0xb5,0xb5,0xb6,
+0xb6,0xb6,0xb7,0xb7,0xb7,0xb8,0xb8,0xb8,
+0xb9,0xb9,0xba,0xba,0xba,0xbb,0xbb,0xbb,
+0xbc,0xbc,0xbc,0xbd,0xbd,0xbd,0xbe,0xbe,
+0xbe,0xbf,0xbf,0xbf,0xc0,0xc0,0xc0,0xc1,
+0xc1,0xc1,0xc2,0xc2,0xc2,0xc3,0xc3,0xc3,
+0xc4,0xc4,0xc4,0xc5,0xc5,0xc5,0xc6,0xc6,
+0xc6,0xc7,0xc7,0xc7,0xc8,0xc8,0xc8,0xc9,
+0xc9,0xc9,0xca,0xca,0xca,0xcb,0xcb,0xcb,
+0xcb,0xcc,0xcc,0xcc,0xcd,0xcd,0xcd,0xce,
+0xce,0xce,0xcf,0xcf,0xcf,0xcf,0xd0,0xd0,
+0xd0,0xd1,0xd1,0xd1,0xd2,0xd2,0xd2,0xd2,
+0xd3,0xd3,0xd3,0xd4,0xd4,0xd4,0xd5,0xd5,
+0xd5,0xd5,0xd6,0xd6,0xd6,0xd7,0xd7,0xd7,
+0xd7,0xd8,0xd8,0xd8,0xd9,0xd9,0xd9,0xd9,
+0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdc,
+0xdc,0xdc,0xdc,0xdd,0xdd,0xdd,0xdd,0xde,
+0xde,0xde,0xde,0xdf,0xdf,0xdf,0xe0,0xe0,
+0xe0,0xe0,0xe1,0xe1,0xe1,0xe1,0xe2,0xe2,
+0xe2,0xe2,0xe3,0xe3,0xe3,0xe3,0xe4,0xe4,
+0xe4,0xe4,0xe4,0xe5,0xe5,0xe5,0xe5,0xe6,
+0xe6,0xe6,0xe6,0xe7,0xe7,0xe7,0xe7,0xe8,
+0xe8,0xe8,0xe8,0xe8,0xe9,0xe9,0xe9,0xe9,
+0xea,0xea,0xea,0xea,0xea,0xeb,0xeb,0xeb,
+0xeb,0xeb,0xec,0xec,0xec,0xec,0xec,0xed,
+0xed,0xed,0xed,0xed,0xee,0xee,0xee,0xee,
+0xee,0xef,0xef,0xef,0xef,0xef,0xf0,0xf0,
+0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,
+0xf1,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf3,
+0xf3,0xf3,0xf3,0xf3,0xf3,0xf4,0xf4,0xf4,
+0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf5,
+0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,
+0xf6,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,
+0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
+0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,
+0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,
+0xfa,0xfa,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,
+0xfb,0xfb,0xfb,0xfb,0xfc,0xfc,0xfc,0xfc,
+0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
+0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,
+0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
+0xfe,0xfe,0xfe,0xfd,0xfd,0xfd,0xfd,0xfd,
+0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,
+0xfd,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
+0xfc,0xfc,0xfc,0xfc,0xfc,0xfb,0xfb,0xfb,
+0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfa,
+0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,
+0xfa,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,
+0xf9,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
+0xf8,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,
+0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf5,
+0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf4,0xf4,
+0xf4,0xf4,0xf4,0xf4,0xf3,0xf3,0xf3,0xf3,
+0xf3,0xf3,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,
+0xf1,0xf1,0xf1,0xf1,0xf1,0xf0,0xf0,0xf0,
+0xf0,0xf0,0xf0,0xef,0xef,0xef,0xef,0xef,
+0xee,0xee,0xee,0xee,0xee,0xed,0xed,0xed,
+0xed,0xed,0xec,0xec,0xec,0xec,0xec,0xeb,
+0xeb,0xeb,0xeb,0xeb,0xea,0xea,0xea,0xea,
+0xea,0xe9,0xe9,0xe9,0xe9,0xe8,0xe8,0xe8,
+0xe8,0xe8,0xe7,0xe7,0xe7,0xe7,0xe6,0xe6,
+0xe6,0xe6,0xe5,0xe5,0xe5,0xe5,0xe4,0xe4,
+0xe4,0xe4,0xe4,0xe3,0xe3,0xe3,0xe3,0xe2,
+0xe2,0xe2,0xe2,0xe1,0xe1,0xe1,0xe1,0xe0,
+0xe0,0xe0,0xe0,0xdf,0xdf,0xdf,0xde,0xde,
+0xde,0xde,0xdd,0xdd,0xdd,0xdd,0xdc,0xdc,
+0xdc,0xdc,0xdb,0xdb,0xdb,0xda,0xda,0xda,
+0xda,0xd9,0xd9,0xd9,0xd9,0xd8,0xd8,0xd8,
+0xd7,0xd7,0xd7,0xd7,0xd6,0xd6,0xd6,0xd5,
+0xd5,0xd5,0xd5,0xd4,0xd4,0xd4,0xd3,0xd3,
+0xd3,0xd2,0xd2,0xd2,0xd2,0xd1,0xd1,0xd1,
+0xd0,0xd0,0xd0,0xcf,0xcf,0xcf,0xcf,0xce,
+0xce,0xce,0xcd,0xcd,0xcd,0xcc,0xcc,0xcc,
+0xcb,0xcb,0xcb,0xcb,0xca,0xca,0xca,0xc9,
+0xc9,0xc9,0xc8,0xc8,0xc8,0xc7,0xc7,0xc7,
+0xc6,0xc6,0xc6,0xc5,0xc5,0xc5,0xc4,0xc4,
+0xc4,0xc3,0xc3,0xc3,0xc2,0xc2,0xc2,0xc1,
+0xc1,0xc1,0xc0,0xc0,0xc0,0xbf,0xbf,0xbf,
+0xbe,0xbe,0xbe,0xbd,0xbd,0xbd,0xbc,0xbc,
+0xbc,0xbb,0xbb,0xbb,0xba,0xba,0xba,0xb9,
+0xb9,0xb8,0xb8,0xb8,0xb7,0xb7,0xb7,0xb6,
+0xb6,0xb6,0xb5,0xb5,0xb5,0xb4,0xb4,0xb4,
+0xb3,0xb3,0xb2,0xb2,0xb2,0xb1,0xb1,0xb1,
+0xb0,0xb0,0xb0,0xaf,0xaf,0xae,0xae,0xae,
+0xad,0xad,0xad,0xac,0xac,0xac,0xab,0xab,
+0xaa,0xaa,0xaa,0xa9,0xa9,0xa9,0xa8,0xa8,
+0xa7,0xa7,0xa7,0xa6,0xa6,0xa6,0xa5,0xa5,
+0xa5,0xa4,0xa4,0xa3,0xa3,0xa3,0xa2,0xa2,
+0xa2,0xa1,0xa1,0xa0,0xa0,0xa0,0x9f,0x9f,
+0x9e,0x9e,0x9e,0x9d,0x9d,0x9d,0x9c,0x9c,
+0x9b,0x9b,0x9b,0x9a,0x9a,0x9a,0x99,0x99,
+0x98,0x98,0x98,0x97,0x97,0x96,0x96,0x96,
+0x95,0x95,0x95,0x94,0x94,0x93,0x93,0x93,
+0x92,0x92,0x91,0x91,0x91,0x90,0x90,0x8f,
+0x8f,0x8f,0x8e,0x8e,0x8e,0x8d,0x8d,0x8c,
+0x8c,0x8c,0x8b,0x8b,0x8a,0x8a,0x8a,0x89,
+0x89,0x88,0x88,0x88,0x87,0x87,0x87,0x86,
+0x86,0x85,0x85,0x85,0x84,0x84,0x83,0x83,
+0x83,0x82,0x82,0x81,0x81,0x81,0x80,0x80,
+0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,
+0x7c,0x7c,0x7c,0x7b,0x7b,0x7a,0x7a,0x7a,
+0x79,0x79,0x78,0x78,0x78,0x77,0x77,0x77,
+0x76,0x76,0x75,0x75,0x75,0x74,0x74,0x73,
+0x73,0x73,0x72,0x72,0x71,0x71,0x71,0x70,
+0x70,0x70,0x6f,0x6f,0x6e,0x6e,0x6e,0x6d,
+0x6d,0x6c,0x6c,0x6c,0x6b,0x6b,0x6a,0x6a,
+0x6a,0x69,0x69,0x69,0x68,0x68,0x67,0x67,
+0x67,0x66,0x66,0x65,0x65,0x65,0x64,0x64,
+0x64,0x63,0x63,0x62,0x62,0x62,0x61,0x61,
+0x61,0x60,0x60,0x5f,0x5f,0x5f,0x5e,0x5e,
+0x5d,0x5d,0x5d,0x5c,0x5c,0x5c,0x5b,0x5b,
+0x5a,0x5a,0x5a,0x59,0x59,0x59,0x58,0x58,
+0x58,0x57,0x57,0x56,0x56,0x56,0x55,0x55,
+0x55,0x54,0x54,0x53,0x53,0x53,0x52,0x52,
+0x52,0x51,0x51,0x51,0x50,0x50,0x4f,0x4f,
+0x4f,0x4e,0x4e,0x4e,0x4d,0x4d,0x4d,0x4c,
+0x4c,0x4b,0x4b,0x4b,0x4a,0x4a,0x4a,0x49,
+0x49,0x49,0x48,0x48,0x48,0x47,0x47,0x47,
+0x46,0x46,0x45,0x45,0x45,0x44,0x44,0x44,
+0x43,0x43,0x43,0x42,0x42,0x42,0x41,0x41,
+0x41,0x40,0x40,0x40,0x3f,0x3f,0x3f,0x3e,
+0x3e,0x3e,0x3d,0x3d,0x3d,0x3c,0x3c,0x3c,
+0x3b,0x3b,0x3b,0x3a,0x3a,0x3a,0x39,0x39,
+0x39,0x38,0x38,0x38,0x37,0x37,0x37,0x36,
+0x36,0x36,0x35,0x35,0x35,0x34,0x34,0x34,
+0x34,0x33,0x33,0x33,0x32,0x32,0x32,0x31,
+0x31,0x31,0x30,0x30,0x30,0x30,0x2f,0x2f,
+0x2f,0x2e,0x2e,0x2e,0x2d,0x2d,0x2d,0x2d,
+0x2c,0x2c,0x2c,0x2b,0x2b,0x2b,0x2a,0x2a,
+0x2a,0x2a,0x29,0x29,0x29,0x28,0x28,0x28,
+0x28,0x27,0x27,0x27,0x26,0x26,0x26,0x26,
+0x25,0x25,0x25,0x25,0x24,0x24,0x24,0x23,
+0x23,0x23,0x23,0x22,0x22,0x22,0x22,0x21,
+0x21,0x21,0x21,0x20,0x20,0x20,0x1f,0x1f,
+0x1f,0x1f,0x1e,0x1e,0x1e,0x1e,0x1d,0x1d,
+0x1d,0x1d,0x1c,0x1c,0x1c,0x1c,0x1b,0x1b,
+0x1b,0x1b,0x1b,0x1a,0x1a,0x1a,0x1a,0x19,
+0x19,0x19,0x19,0x18,0x18,0x18,0x18,0x17,
+0x17,0x17,0x17,0x17,0x16,0x16,0x16,0x16,
+0x15,0x15,0x15,0x15,0x15,0x14,0x14,0x14,
+0x14,0x14,0x13,0x13,0x13,0x13,0x13,0x12,
+0x12,0x12,0x12,0x12,0x11,0x11,0x11,0x11,
+0x11,0x10,0x10,0x10,0x10,0x10,0xf,0xf,
+0xf,0xf,0xf,0xf,0xe,0xe,0xe,0xe,
+0xe,0xd,0xd,0xd,0xd,0xd,0xd,0xc,
+0xc,0xc,0xc,0xc,0xc,0xb,0xb,0xb,
+0xb,0xb,0xb,0xa,0xa,0xa,0xa,0xa,
+0xa,0xa,0x9,0x9,0x9,0x9,0x9,0x9,
+0x9,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
+0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,
+0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x6,
+0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,
+0x5,0x5,0x4,0x4,0x4,0x4,0x4,0x4,
+0x4,0x4,0x4,0x4,0x3,0x3,0x3,0x3,
+0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,
+0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,
+0x2,0x2,0x2,0x2,0x2,0x2,0x1,0x1,
+0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,
+0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,
+0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1,
+0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,
+0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,
+0x1,0x1,0x1,0x2,0x2,0x2,0x2,0x2,
+0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,
+0x2,0x3,0x3,0x3,0x3,0x3,0x3,0x3,
+0x3,0x3,0x3,0x3,0x3,0x4,0x4,0x4,
+0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x5,
+0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,
+0x5,0x6,0x6,0x6,0x6,0x6,0x6,0x6,
+0x6,0x7,0x7,0x7,0x7,0x7,0x7,0x7,
+0x7,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
+0x9,0x9,0x9,0x9,0x9,0x9,0x9,0xa,
+0xa,0xa,0xa,0xa,0xa,0xa,0xb,0xb,
+0xb,0xb,0xb,0xb,0xc,0xc,0xc,0xc,
+0xc,0xc,0xd,0xd,0xd,0xd,0xd,0xd,
+0xe,0xe,0xe,0xe,0xe,0xf,0xf,0xf,
+0xf,0xf,0xf,0x10,0x10,0x10,0x10,0x10,
+0x11,0x11,0x11,0x11,0x11,0x12,0x12,0x12,
+0x12,0x12,0x13,0x13,0x13,0x13,0x13,0x14,
+0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,
+0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,
+0x17,0x17,0x18,0x18,0x18,0x18,0x19,0x19,
+0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,
+0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1d,
+0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,
+0x1f,0x1f,0x1f,0x20,0x20,0x20,0x21,0x21,
+0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,
+0x23,0x23,0x24,0x24,0x24,0x25,0x25,0x25,
+0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,
+0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x2a,
+0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2c,0x2c,
+0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,
+0x2f,0x2f,0x2f,0x30,0x30,0x30,0x30,0x31,
+0x31,0x31,0x32,0x32,0x32,0x33,0x33,0x33,
+0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x36,
+0x36,0x36,0x37,0x37,0x37,0x38,0x38,0x38,
+0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,
+0x3b,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3e,
+0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x40,
+0x41,0x41,0x41,0x42,0x42,0x42,0x43,0x43,
+0x43,0x44,0x44,0x44,0x45,0x45,0x45,0x46,
+0x46,0x47,0x47,0x47,0x48,0x48,0x48,0x49,
+0x49,0x49,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,
+0x4c,0x4c,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,
+0x4f,0x4f,0x4f,0x50,0x50,0x51,0x51,0x51,
+0x52,0x52,0x52,0x53,0x53,0x53,0x54,0x54,
+0x55,0x55,0x55,0x56,0x56,0x56,0x57,0x57,
+0x58,0x58,0x58,0x59,0x59,0x59,0x5a,0x5a,
+0x5a,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,
+0x5d,0x5e,0x5e,0x5f,0x5f,0x5f,0x60,0x60,
+0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63,
+0x64,0x64,0x64,0x65,0x65,0x65,0x66,0x66,
+0x67,0x67,0x67,0x68,0x68,0x69,0x69,0x69,
+0x6a,0x6a,0x6a,0x6b,0x6b,0x6c,0x6c,0x6c,
+0x6d,0x6d,0x6e,0x6e,0x6e,0x6f,0x6f,0x70,
+0x70,0x70,0x71,0x71,0x71,0x72,0x72,0x73,
+0x73,0x73,0x74,0x74,0x75,0x75,0x75,0x76,
+0x76,0x77,0x77,0x77,0x78,0x78,0x78,0x79,
+0x79,0x7a,0x7a,0x7a,0x7b,0x7b,0x7c,0x7c,
+0x7c,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f
+};

+ 3 - 0
tmk_core/common.mk

@@ -53,6 +53,9 @@ ifdef MIDI_ENABLE
     OPT_DEFS += -DMIDI_ENABLE
 endif
 
+ifdef AUDIO_ENABLE
+    OPT_DEFS += -DAUDIO_ENABLE
+endif
 
 ifdef USB_6KRO_ENABLE
     OPT_DEFS += -DUSB_6KRO_ENABLE

+ 5 - 2
tmk_core/protocol/lufa/lufa.c

@@ -52,8 +52,8 @@
 #include "descriptor.h"
 #include "lufa.h"
 
-#ifdef MIDI_ENABLE
-    #include <beeps.h>
+#ifdef AUDIO_ENABLE
+    #include <audio.h>
 #endif
 
 #ifdef BLUETOOTH_ENABLE
@@ -946,6 +946,8 @@ int main(void)
 #ifdef MIDI_ENABLE
 void fallthrough_callback(MidiDevice * device,
     uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2){
+
+#ifdef AUDIO_ENABLE
   if (cnt == 3) {
     switch (byte0 & 0xF0) {
         case MIDI_NOTEON:
@@ -959,6 +961,7 @@ void fallthrough_callback(MidiDevice * device,
   if (byte0 == MIDI_STOP) {
     stop_all_notes();
   }
+#endif
 }
 
 void cc_callback(MidiDevice * device,