From 6280adbb6e077d9c73807788929158bf4a8ca493 Mon Sep 17 00:00:00 2001 From: Lucas Hecht Date: Wed, 24 Feb 2016 22:54:39 +0100 Subject: Added keymap "lucas.c" --- keyboard/planck/dfu-programmer.exe | Bin 0 -> 242280 bytes keyboard/planck/keymaps/dfu-programmer.exe | Bin 0 -> 242280 bytes keyboard/planck/keymaps/keymap_eigen.c | 184 +++++++++++++++++++++++++++ keyboard/planck/keymaps/lucas.c | 198 +++++++++++++++++++++++++++++ 4 files changed, 382 insertions(+) create mode 100644 keyboard/planck/dfu-programmer.exe create mode 100644 keyboard/planck/keymaps/dfu-programmer.exe create mode 100644 keyboard/planck/keymaps/keymap_eigen.c create mode 100644 keyboard/planck/keymaps/lucas.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/dfu-programmer.exe b/keyboard/planck/dfu-programmer.exe new file mode 100644 index 0000000000..a7d2ecbfc5 Binary files /dev/null and b/keyboard/planck/dfu-programmer.exe differ diff --git a/keyboard/planck/keymaps/dfu-programmer.exe b/keyboard/planck/keymaps/dfu-programmer.exe new file mode 100644 index 0000000000..a7d2ecbfc5 Binary files /dev/null and b/keyboard/planck/keymaps/dfu-programmer.exe differ diff --git a/keyboard/planck/keymaps/keymap_eigen.c b/keyboard/planck/keymaps/keymap_eigen.c new file mode 100644 index 0000000000..51b7720593 --- /dev/null +++ b/keyboard/planck/keymaps/keymap_eigen.c @@ -0,0 +1,184 @@ +#include "keymap_common.h" +#include "backlight.h" +#include "debug.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* QWERTY + * 0:Qwerty + * ,-----------------------------------------------------------------------. + * |Esc | q | w | f | p | g | j | l | u | y | ; | BS | + * |-----------------------------------------------------------------------| + * |BS | a | r | s | t | d | h | n | e | i | o | ' | + * |-----------------------------------------------------------------------| + * |Shift| z | x | c | v | b | k | m |, | . | / | Enter| + * |-----------------------------------------------------------------------| + * |FN4 | LCTL| LGUI| LALT|Lower| Space |Raise|Left |Down | Up |Right| + * `-----------------------------------------------------------------------' + */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {FUNC(8), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_LCTL, KC_LCTL, FUNC(5), KC_LALT, FUNC(2), FUNC(3), FUNC(3), FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* Gaming + * 1: Gaming Layer + * ,-----------------------------------------------------------------------. + * | ESC | | 1 | 2 | 3 | 4 | | | | /RC | | | + * |-----------------------------------------------------------------------| + * | | 5 | 6 | 7 | W | 8 | 9 | | | | | | + * |-----------------------------------------------------------------------| + * | | 0 | - | A | S | D | = | | | | | | + * |-----------------------------------------------------------------------| + * |QWERT| |LCTRL| LSFT| LALT| Space | TAB | | |Raise| | + * `-----------------------------------------------------------------------' + */ + {KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, KC_NO, KC_NO, KC_NO, M(1), KC_NO, KC_NO}, + {KC_NO, KC_5, KC_6, KC_7, KC_W, KC_8, KC_9, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, + {KC_NO, KC_0, KC_MINS, KC_A, KC_S, KC_D, KC_EQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, + {FUNC(9), KC_NO, KC_LCTL, KC_LSFT, KC_LALT, KC_SPC, KC_SPC, KC_TAB, KC_NO, KC_NO, FUNC(1), KC_NO} +}, +[2] = { /* Raise + * 2: fn Right/Raise layer + * The top row are standard numbers, 1-9, and minus and equals. + * Middle 2 rows add symbols back. + * Bottom row changes arrow to Home, Page Up, Page Down, and End. + * ,-----------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BS | + * |-----------------------------------------------------------------------| + * | | Game|QWERT| | | | | - | = | [ | ] | \ | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | Space | |Home |PgDn |PgUp | End | + * `-----------------------------------------------------------------------' + */ + { 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(7), FUNC(6), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {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_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[3] = { /* Lower + * 3: Symbols Left/Lower layer + * Top row is number symbols. + * Adds alt symbbols for brackets, etc. + * Bottom row is media control. + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | BS | + * |-----------------------------------------------------------------------| + * | | | | | | | | _ | + | { | } | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | |PrevT|NextT| | | | | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {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, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[4] = { /* TENKEY + * 4: Numpad layer + * ,-----------------------------------------------------------------------. + * | | Num7| Num8| Num9| | |CALC | | | | | | + * |-----------------------------------------------------------------------| + * | | Num4| Num5| Num6| | | | | | | | | + * |-----------------------------------------------------------------------| + * | | Num1| Num2| Num3| | | | | | | | | + * |-----------------------------------------------------------------------| + * | | Num0| Num0| Num.| | | | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS, KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, + {KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, + {KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, + {KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, +}, +[5] = { /* Funtion Keys + * 5: Function + * Backlight control at Arrows + * ,-----------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 |F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | |Light|BL DN|BL UP| + * `-----------------------------------------------------------------------' + */ + {KC_FN1, KC_FN2, KC_FN3, KC_FN4, KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC}, +}, +[6] = { /* In-Game QWERTY + * 0:Qwerty + * ,-----------------------------------------------------------------------. + * | | q | w | e | r | t | y | u | i | o | p | BS | + * |-----------------------------------------------------------------------| + * | | a | s | d | f | g | h | j | k | l | | " | + * |-----------------------------------------------------------------------| + * |Shift| z | x | c | v | b | n | m | , | . | / |Enter| + * |-----------------------------------------------------------------------| + * | | | | | | Space | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_TRNS, S(KC_QUOT)}, + {FUNC(8), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[7] = { /* More Functions + * 7: Function + * More Space Later + * ,-----------------------------------------------------------------------. + * | F13 | F14 | F15 | F16 |F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, KC_FN22, KC_FN23, KC_FN24}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, +}, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + [3] = ACTION_LAYER_TAP_KEY(4,KC_SPC), // to TENKEY + [4] = ACTION_LAYER_MOMENTARY(5), // to Function + [5] = ACTION_LAYER_TAP_KEY(7,KC_LGUI), // to More Functions + + [6] = ACTION_DEFAULT_LAYER_SET(0), // QWERTY + [7] = ACTION_DEFAULT_LAYER_SET(1), // Gaming + [8] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_CAPS), //Shift on press, Caps on tap + [9] = ACTION_LAYER_TAP_TOGGLE(6), //QWERTY in game +}; + +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); + backlight_step(); + } else { + unregister_code(KC_RSFT); + } + break; + case 1: + return MACRODOWN(TYPE(KC_SLSH), TYPE(KC_R), TYPE(KC_C), TYPE(KC_ENT) , END); + break; + } + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboard/planck/keymaps/lucas.c b/keyboard/planck/keymaps/lucas.c new file mode 100644 index 0000000000..d8516302c7 --- /dev/null +++ b/keyboard/planck/keymaps/lucas.c @@ -0,0 +1,198 @@ +/* +This is the keymap of /u/deepshitgoeshere! +Layer 1 exists so I can have the symbol positions of QWERTY while having my system in german. +The second layer has all the german umlauts I need and with capital and small letters on the +same layer there is no need to press shift+lower. +This keymap is made to work with software implemented QWERTZ. +The "Gaming" layer is mainly customized for CS:GO. +If you have any question about this keymap feel free to shoot me a message on reddit! +*/ + +#include "keymap_common.h" +#include "keymap_extras/keymap_german.h" +#include "backlight.h" +#include "debug.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Colemak + * ,-----------------------------------------------------------------------. + * | Esc | q | w | f | p | g | j | l | u | y | ; | - | + * |-----------------------------------------------------------------------| + * | BS | a | r | s | t | d | h | n | e | i | o | ' | + * |-----------------------------------------------------------------------| + * | SFT | z | x | c | v | b | k | m | , | . | / | Ent | + * |-----------------------------------------------------------------------| + * | CTL | GUI | Tab | ALT |Lower| Space |Raise|Left |Down | Up |Right| + * `-----------------------------------------------------------------------' + */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Z, DE_SCLN, DE_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, DE_QUOT}, + {M(0), KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, DE_COMM, DE_DOT, DE_SLSH, KC_ENT}, + {KC_LCTL, KC_LGUI, KC_TAB, KC_LALT, F(2), F(3), F(3), F(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[1] = { /* Symbols + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | : | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | " | + * |-----------------------------------------------------------------------| + * | | | | | | | | | < | > | ? | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DOT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DQOT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(5), DE_MORE, DE_QST, 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} +}, +[2] = { /* Raise + * ,-----------------------------------------------------------------------. + * | | Ä | | | | | | | Ü | Ö | |Game | + * |-----------------------------------------------------------------------| + * | Del | ä | | ß | | | | | ü | ö | |FVol+| + * |-----------------------------------------------------------------------| + * | | | | | | | | |Stop | Prv | Nxt |FVol-| + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT |Lower| Space | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_NO, S(DE_AE), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, S(DE_UE), S(DE_OE), KC_NO, F(4)}, + {KC_DEL, DE_AE, KC_NO, DE_SS, KC_NO, KC_NO, KC_NO, KC_NO, DE_UE, DE_OE, KC_NO, RALT(KC_F12)}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MSTP, KC_MPRV, KC_MNXT, RALT(KC_F11)}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Lower + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | + * |-----------------------------------------------------------------------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | + * |-----------------------------------------------------------------------| + * | | | | | | [ | ] | { | } | € | | \ | Ent | + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT | | Space |Raise|Home |PgDn |PgUp | End | + * `-----------------------------------------------------------------------' + */ + {DE_TILD, DE_EXLM, DE_AT, DE_HASH, DE_DLR, DE_PERC, DE_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, DE_PLUS}, + {DE_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_EQL}, + {KC_NO, KC_NO, KC_NO, DE_PIPE, DE_LBRC, DE_RBRC, DE_LCBR, DE_RCBR, DE_EURO, KC_NO, DE_BSLS, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[4] = { /* Function + * ,-----------------------------------------------------------------------. + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |-----------------------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----------------------------------------------------------------------| + * | | | | | | KP- | KP+ | | | | |Reset| + * |-----------------------------------------------------------------------| + * | |Light|BL DN|BL UP| | | | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_NO, KC_NO, KC_NO, RESET, KC_NO}, + {KC_NO, BL_TOGG, BL_DEC, BL_INC, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[5] = { /* Gaming + * ,-----------------------------------------------------------------------. + * | Buy | ESC | q | w | e | r | t | y | u | i | o | p | + * |-----------------------------------------------------------------------| + * | ENT | BS | a | s | d | f | g | h | j | k | l | ; | + * |-----------------------------------------------------------------------| + * | CTL | SFT | z | x | c | v | b | n | m | , | Up | / | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| GUI |Left |Down |Right| + * `-----------------------------------------------------------------------' + */ + {MO(6), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, F(4)}, + {KC_ENT, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_SCLN}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, DE_DOT, KC_UP, DE_SLSH}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT} +}, +[6] = { /* Gaming + /* CS:GO buy binds + * ,-----------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | | + * |-----------------------------------------------------------------------| + * | BS | | | | | | | | 6 | 5 | 4 | End | + * |-----------------------------------------------------------------------| + * | CTL | SFT | | | | | | | 1 | 2 | 3 |Pgdn | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| | 0 | KP+ |PEnt | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_NO, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_P7, KC_P8, KC_P9, KC_NO}, + {KC_BSPC, KC_NO, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_P4, KC_P5, KC_P6, KC_END}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_P1, KC_P2, KC_P3, KC_PGDN}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_NO, KC_P0, KC_PDOT, KC_PENT} +}, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + [3] = ACTION_LAYER_TAP_KEY(4,KC_SPC), // to Function + [4] = ACTION_LAYER_TOGGLE(5), // toggle Gaming + [5] = ACTION_MODS_TAP_KEY(KC_LSFT, KC_CAPS), //Shift on press, Caps on tap +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: // M(0) + if (record->event.pressed) { + register_code(KC_LSFT); + layer_on(1); + } else { + layer_off(1); + unregister_code(KC_LSFT); + } + break; + case 1: // M(1) + if (record->event.pressed) { + register_code(LSFT(DE_SCLN)); + } else { + unregister_code(LSFT(DE_SCLN)); + } + break; + case 2: // M(2) + if (record->event.pressed) { + register_code(DE_MINS); + } else { + unregister_code(DE_MINS); + } + break; + case 3: // M(3) + if (record->event.pressed) { + register_code(DE_COMM); + } else { + unregister_code(DE_COMM); + } + break; + case 4: // M(4) + if (record->event.pressed) { + register_code(DE_DOT); + } else { + unregister_code(DE_DOT); + } + break; + case 5: // M(5) + if (record->event.pressed) { + unregister_code(KC_LSFT); + register_code(DE_MORE); + } else { + unregister_code(DE_MORE); + } + break; + case 6: // M(6) + if (record->event.pressed) { + register_code(DE_LESS); + } else { + unregister_code(DE_LESS); + } + break; + } + return MACRO_NONE; + +}; \ No newline at end of file -- cgit v1.2.3 From bbfdfdcc5f5f610371434c7f4d072c71f1526696 Mon Sep 17 00:00:00 2001 From: Lucas Hecht Date: Thu, 25 Feb 2016 21:39:32 +0100 Subject: delete old keymap (keymap_eigen.c) --- keyboard/planck/keymaps/lucas.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/lucas.c b/keyboard/planck/keymaps/lucas.c index d8516302c7..27672e1bbc 100644 --- a/keyboard/planck/keymaps/lucas.c +++ b/keyboard/planck/keymaps/lucas.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DOT, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DQOT}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(5), DE_MORE, DE_QST, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), DE_MORE, DE_QST, 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} }, [2] = { /* Raise @@ -148,36 +148,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) layer_off(1); unregister_code(KC_LSFT); } - break; + break; case 1: // M(1) - if (record->event.pressed) { - register_code(LSFT(DE_SCLN)); - } else { - unregister_code(LSFT(DE_SCLN)); - } - break; - case 2: // M(2) - if (record->event.pressed) { - register_code(DE_MINS); - } else { - unregister_code(DE_MINS); - } - break; - case 3: // M(3) - if (record->event.pressed) { - register_code(DE_COMM); - } else { - unregister_code(DE_COMM); - } - break; - case 4: // M(4) - if (record->event.pressed) { - register_code(DE_DOT); - } else { - unregister_code(DE_DOT); - } - break; - case 5: // M(5) if (record->event.pressed) { unregister_code(KC_LSFT); register_code(DE_MORE); @@ -185,13 +157,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(DE_MORE); } break; - case 6: // M(6) - if (record->event.pressed) { - register_code(DE_LESS); - } else { - unregister_code(DE_LESS); - } - break; } return MACRO_NONE; -- cgit v1.2.3 From e8f17e51368fabdc9eb226212c7cfcec76f037e1 Mon Sep 17 00:00:00 2001 From: deepshitgoeshere Date: Thu, 25 Feb 2016 22:26:44 +0100 Subject: Delete dfu-programmer.exe --- keyboard/planck/keymaps/dfu-programmer.exe | Bin 242280 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboard/planck/keymaps/dfu-programmer.exe (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/dfu-programmer.exe b/keyboard/planck/keymaps/dfu-programmer.exe deleted file mode 100644 index a7d2ecbfc5..0000000000 Binary files a/keyboard/planck/keymaps/dfu-programmer.exe and /dev/null differ -- cgit v1.2.3 From 8def502eee61cd137789c15842fad6ea881a929f Mon Sep 17 00:00:00 2001 From: deepshitgoeshere Date: Thu, 25 Feb 2016 22:27:17 +0100 Subject: Delete dfu-programmer.exe --- keyboard/planck/dfu-programmer.exe | Bin 242280 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboard/planck/dfu-programmer.exe (limited to 'keyboard/planck') diff --git a/keyboard/planck/dfu-programmer.exe b/keyboard/planck/dfu-programmer.exe deleted file mode 100644 index a7d2ecbfc5..0000000000 Binary files a/keyboard/planck/dfu-programmer.exe and /dev/null differ -- cgit v1.2.3 From 92adbe416c81e6ec24e21cd531eb7e478218803f Mon Sep 17 00:00:00 2001 From: deepshitgoeshere Date: Thu, 25 Feb 2016 22:27:59 +0100 Subject: Delete keymap_eigen.c --- keyboard/planck/keymaps/keymap_eigen.c | 184 --------------------------------- 1 file changed, 184 deletions(-) delete mode 100644 keyboard/planck/keymaps/keymap_eigen.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/keymap_eigen.c b/keyboard/planck/keymaps/keymap_eigen.c deleted file mode 100644 index 51b7720593..0000000000 --- a/keyboard/planck/keymaps/keymap_eigen.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "keymap_common.h" -#include "backlight.h" -#include "debug.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { /* QWERTY - * 0:Qwerty - * ,-----------------------------------------------------------------------. - * |Esc | q | w | f | p | g | j | l | u | y | ; | BS | - * |-----------------------------------------------------------------------| - * |BS | a | r | s | t | d | h | n | e | i | o | ' | - * |-----------------------------------------------------------------------| - * |Shift| z | x | c | v | b | k | m |, | . | / | Enter| - * |-----------------------------------------------------------------------| - * |FN4 | LCTL| LGUI| LALT|Lower| Space |Raise|Left |Down | Up |Right| - * `-----------------------------------------------------------------------' - */ - {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {FUNC(8), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_LCTL, KC_LCTL, FUNC(5), KC_LALT, FUNC(2), FUNC(3), FUNC(3), FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[1] = { /* Gaming - * 1: Gaming Layer - * ,-----------------------------------------------------------------------. - * | ESC | | 1 | 2 | 3 | 4 | | | | /RC | | | - * |-----------------------------------------------------------------------| - * | | 5 | 6 | 7 | W | 8 | 9 | | | | | | - * |-----------------------------------------------------------------------| - * | | 0 | - | A | S | D | = | | | | | | - * |-----------------------------------------------------------------------| - * |QWERT| |LCTRL| LSFT| LALT| Space | TAB | | |Raise| | - * `-----------------------------------------------------------------------' - */ - {KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, KC_NO, KC_NO, KC_NO, M(1), KC_NO, KC_NO}, - {KC_NO, KC_5, KC_6, KC_7, KC_W, KC_8, KC_9, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, - {KC_NO, KC_0, KC_MINS, KC_A, KC_S, KC_D, KC_EQL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, - {FUNC(9), KC_NO, KC_LCTL, KC_LSFT, KC_LALT, KC_SPC, KC_SPC, KC_TAB, KC_NO, KC_NO, FUNC(1), KC_NO} -}, -[2] = { /* Raise - * 2: fn Right/Raise layer - * The top row are standard numbers, 1-9, and minus and equals. - * Middle 2 rows add symbols back. - * Bottom row changes arrow to Home, Page Up, Page Down, and End. - * ,-----------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BS | - * |-----------------------------------------------------------------------| - * | | Game|QWERT| | | | | - | = | [ | ] | \ | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | Space | |Home |PgDn |PgUp | End | - * `-----------------------------------------------------------------------' - */ - { 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(7), FUNC(6), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {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_HOME, KC_PGDN, KC_PGUP, KC_END} -}, -[3] = { /* Lower - * 3: Symbols Left/Lower layer - * Top row is number symbols. - * Adds alt symbbols for brackets, etc. - * Bottom row is media control. - * ,-----------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | BS | - * |-----------------------------------------------------------------------| - * | | | | | | | | _ | + | { | } | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | |PrevT|NextT| | | | | |Mute |Vol- |Vol+ | P/P | - * `-----------------------------------------------------------------------' - */ - {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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, - {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, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[4] = { /* TENKEY - * 4: Numpad layer - * ,-----------------------------------------------------------------------. - * | | Num7| Num8| Num9| | |CALC | | | | | | - * |-----------------------------------------------------------------------| - * | | Num4| Num5| Num6| | | | | | | | | - * |-----------------------------------------------------------------------| - * | | Num1| Num2| Num3| | | | | | | | | - * |-----------------------------------------------------------------------| - * | | Num0| Num0| Num.| | | | | | | | | - * `-----------------------------------------------------------------------' - */ - {KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS, KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, - {KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, - {KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, - {KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS}, -}, -[5] = { /* Funtion Keys - * 5: Function - * Backlight control at Arrows - * ,-----------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 |F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | |Light|BL DN|BL UP| - * `-----------------------------------------------------------------------' - */ - {KC_FN1, KC_FN2, KC_FN3, KC_FN4, KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC}, -}, -[6] = { /* In-Game QWERTY - * 0:Qwerty - * ,-----------------------------------------------------------------------. - * | | q | w | e | r | t | y | u | i | o | p | BS | - * |-----------------------------------------------------------------------| - * | | a | s | d | f | g | h | j | k | l | | " | - * |-----------------------------------------------------------------------| - * |Shift| z | x | c | v | b | n | m | , | . | / |Enter| - * |-----------------------------------------------------------------------| - * | | | | | | Space | | | | | | - * `-----------------------------------------------------------------------' - */ - {KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_TRNS, S(KC_QUOT)}, - {FUNC(8), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} - // Space is repeated to accommadate for both spacebar wiring positions -}, -[7] = { /* More Functions - * 7: Function - * More Space Later - * ,-----------------------------------------------------------------------. - * | F13 | F14 | F15 | F16 |F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------------------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------' - */ - {KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, KC_FN22, KC_FN23, KC_FN24}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, -}, -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - [3] = ACTION_LAYER_TAP_KEY(4,KC_SPC), // to TENKEY - [4] = ACTION_LAYER_MOMENTARY(5), // to Function - [5] = ACTION_LAYER_TAP_KEY(7,KC_LGUI), // to More Functions - - [6] = ACTION_DEFAULT_LAYER_SET(0), // QWERTY - [7] = ACTION_DEFAULT_LAYER_SET(1), // Gaming - [8] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_CAPS), //Shift on press, Caps on tap - [9] = ACTION_LAYER_TAP_TOGGLE(6), //QWERTY in game -}; - -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); - backlight_step(); - } else { - unregister_code(KC_RSFT); - } - break; - case 1: - return MACRODOWN(TYPE(KC_SLSH), TYPE(KC_R), TYPE(KC_C), TYPE(KC_ENT) , END); - break; - } - return MACRO_NONE; -}; \ No newline at end of file -- cgit v1.2.3 From bcf847e58a10b66cff3161dd3503bc839c9745f0 Mon Sep 17 00:00:00 2001 From: Lucas Hecht Date: Sat, 27 Feb 2016 01:26:54 +0100 Subject: added "Troubleshooting" section to PCB guide --- keyboard/planck/PCB_GUIDE.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'keyboard/planck') diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 3daf0e0092..e676c44286 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -8,6 +8,7 @@ 2. Install [DFU-Programmer][dfu-prog] (the -win one). 3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. + ### Mac If you're using homebrew, you can use the following commands: @@ -52,6 +53,27 @@ Generally, the instructions to flash the PCB are as follows: 4. Press the reset button on the PCB/press the key with the `RESET` keycode 5. `make dfu` - use the necessary `KEYMAP=` and/or `COMMON=true` arguments here. +### Troubleshooting +If you see something like this + + 0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142 + 440 [main] sh 13384 sync_with_child: *** child state waiting for longjmp + /usr/bin/sh: fork: Resource temporarily unavailable + +after running 'make' on Windows than you are encountering a very popular issue with WinAVR on Windows 8.1 and 10. +You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip). +Restart your system and everything should work fine! + +If you see this + + dfu-programmer atmega32u4 erase + process_begin: CreateProcess(NULL, dfu-programmer atmega32u4 erase, ...) failed. + make (e=2): The system cannot find the file specified. + make: *** [dfu] Error 2 + +when trying to 'make dfu' on Windows you need to copy the dfu-programmer.exe to qmk_firmware/keyboard/planck. + + ## Quantum MK Firmware ### Keymap -- cgit v1.2.3 From 52b3ddb521ebe510a0674a69ce4f5ef208ea871f Mon Sep 17 00:00:00 2001 From: Lucas Hecht Date: Sat, 27 Feb 2016 02:56:05 +0100 Subject: Update PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index e676c44286..28e8a4b084 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -53,7 +53,7 @@ Generally, the instructions to flash the PCB are as follows: 4. Press the reset button on the PCB/press the key with the `RESET` keycode 5. `make dfu` - use the necessary `KEYMAP=` and/or `COMMON=true` arguments here. -### Troubleshooting +## Troubleshooting If you see something like this 0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142 @@ -64,6 +64,7 @@ after running 'make' on Windows than you are encountering a very popular issue w You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip). Restart your system and everything should work fine! + If you see this dfu-programmer atmega32u4 erase -- cgit v1.2.3 From 06de9628be3ba17e1d6753b9af21c7072d4badd9 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 12:25:21 -0500 Subject: Removed unneeded lines from setup script --- keyboard/planck/PCB_GUIDE.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 3daf0e0092..d2ff703352 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -4,8 +4,21 @@ ### Windows -1. Install [WinAVR Tools](http://sourceforge.net/projects/winavr/) for AVR GCC compiler. -2. Install [DFU-Programmer][dfu-prog] (the -win one). +Options +1. Vagrant (overkill, lack of trust, no driver concerns) +2. Chocolatey / dfu-programmer (more dev work required) +3. Chocolatey / flip +4. Write a batch script that installs dfu-programmer on the path, installs make with MinGW, and uses pnputil to install the proper driver https://technet.microsoft.com/en-us/library/cc732377%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396#BKMK_Anchor2 +4. Look up altenatives ( + +* Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but be sure to leave the option to add the tools to the PATH checked. +* Install the latest version of [the Atmel AVR **8-bit** toolchain](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx) +* Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The script depends on the default location. +* Right-click on the setup-path-win batch script at the root of the project and select "Run as administrator". Press the spacebar to dismiss the success message. +* + +1. Install [Chocolatey](https://chocolatey.org/). It's a package manager for Windows that will make it easy to set up the complete build environment. To install Chocolatey, run the following command in a command line window with administrator privileges (search for command prompt, right-click on it, and select "Run as administrator"). `@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin` +2. Install DFU-Programmer by running (the -win one). 3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac -- cgit v1.2.3 From 45933e84f178ae92506f4c1bfdc5a8dc30e587d2 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 13:02:13 -0500 Subject: Added documentation for new Windows scripts --- keyboard/planck/PCB_GUIDE.md | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index d2ff703352..e396747dff 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,23 +3,11 @@ ## Setting up the environment ### Windows - -Options -1. Vagrant (overkill, lack of trust, no driver concerns) -2. Chocolatey / dfu-programmer (more dev work required) -3. Chocolatey / flip -4. Write a batch script that installs dfu-programmer on the path, installs make with MinGW, and uses pnputil to install the proper driver https://technet.microsoft.com/en-us/library/cc732377%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396#BKMK_Anchor2 -4. Look up altenatives ( - -* Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but be sure to leave the option to add the tools to the PATH checked. -* Install the latest version of [the Atmel AVR **8-bit** toolchain](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx) -* Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The script depends on the default location. -* Right-click on the setup-path-win batch script at the root of the project and select "Run as administrator". Press the spacebar to dismiss the success message. -* - -1. Install [Chocolatey](https://chocolatey.org/). It's a package manager for Windows that will make it easy to set up the complete build environment. To install Chocolatey, run the following command in a command line window with administrator privileges (search for command prompt, right-click on it, and select "Run as administrator"). `@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin` -2. Install DFU-Programmer by running (the -win one). -3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. +1. Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! ### Mac -- cgit v1.2.3 From 140a311e652829cb8c774d3d3bb4acdb7c9f9954 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 13:06:33 -0500 Subject: Fix link to MHV AVR Tools --- keyboard/planck/PCB_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index e396747dff..797cee2e1b 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,7 +3,7 @@ ## Setting up the environment ### Windows -1. Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. 2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. 3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. 4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. -- cgit v1.2.3 From c9c763e0007fa7fcebe8dde64f270258468ca757 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Fri, 4 Mar 2016 14:38:38 -0500 Subject: Cygwin Based Users Guide v0.1 --- keyboard/planck/CYGWIN_GUIDE.md | 237 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100755 keyboard/planck/CYGWIN_GUIDE.md (limited to 'keyboard/planck') diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md new file mode 100755 index 0000000000..896a42c764 --- /dev/null +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -0,0 +1,237 @@ +#Planck Advanced (but not too advanced) Cygwin Users Guide +If you are a user of the [Cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. + + +This guide was written step by step as I went through the process on a Windows10 x86_64 based system. This should be generally applicable to to any Windows Environment with Cygwin. + + +#####Do not skip steps. Do not move past a step until the previous step finishes successfully. + + + +based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) + + +###get the required packages +Download the Cygwin Installer ([x86_64](https://cygwin.com/setup-x86_64.exe) or [x86_32](https://cygwin.com/setup-x86.exe)) and install the default system plus the following if they are not already selected: +-devel/gcc-core +-devel/gcc-g++ +-devel/flex +-devel/git +-libs/libglib2.0_0 +-libs/libgcc1 +-interpreters/m4 +-web/wget + +The following sources will be required: +-get [gmp](https://gmplib.org/) (6.1.0) +-get [mpfr](http://www.mpfr.org/) (3.1.3) +-get [mpc](http://www.multiprecision.org/) (1.0.3) +-get [binutils](https://www.sourceware.org/binutils/) (2.26) +-get [gcc](https://gcc.gnu.org/) (5.3.0) +-get [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) + +The `dfu-programmer` will be required to flash the new firmware +-get [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) + + +The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. note: the expand commands are different depending on if the packages are offered as a bz2 or gz archive + +``` +$ mkdir ~/local/avr +$ mkdir ~/src +$ cd ~/src +$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 +$ wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2 +$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz +$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz +$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz +$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 +$ tar -xjf gmp-6.1.0.tar.bz2 +$ tar -xjf mpfr-3.1.3.tar.bz2 +$ tar -zxf mpc-1.0.3.tar.gz +$ tar -zxf binutils-2.26.tar.gz +$ tar -zxf gcc-5.3.0.tar.gz +$ tar -xjf avr-libc-2.0.0.tar.bz2 +``` + +###setup build environment +These commands will set up the install directory and the PATH variable, which will allow you to access your installed packages. note: if you close the cygwin terminal window, you will need to rerun these commands, they are not permanent +``` +$ PREFIX=$HOME/local/avr +$ export PREFIX +$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS +$ PATH=$PATH:$PREFIX/bin +$ export PATH +``` + +##The gcc required math library packages +The following packages are required to be complied and installed in order to compile gcc. They are not available through the cygwin package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. + +###build and install gmp +``` +$ cd ~/src/gmp-6.1.0 +$ ./configure --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###build and install mpfr +``` +$ cd ~/src/mpfr-3.1.3 +$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###build and install mpc +``` +$ cd ~/src/mpc-1.0.3 +$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +##OPTIONAL Part +You can build and install a brand new gcc or you can use the one supplied by cygwin. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it. +###build and install gcc on your machine +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-local +$ cd obj-local +$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared +$ make +$ make install +``` + +###build and install binutils on your machine +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-local +$ cd obj-local +$ ../configure +$ make +$ make install +``` +##End OPTIONAL Part + +##Buliding binutils, gcc and avr-libc for the AVR system +Now we can make the critical stuff for compiling our firmware, binutils, gcc, and avr-libc for the AVR architectures. These allow us to build and manipulate the firmware for the Keyboard. + +###build binutils for avr +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --disable-nls +$ make +$ make install +``` + +###build gcc for avr +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2 +$ make +$ make install +``` + +For building the avr-libc, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the gcc configure notes for the proper `--build` specification to pass when you configure avr-libc + +###build avr-libc for avr +``` +$ cd ~/src/avr-libc-2.0.0 +$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr +$ make +$ make install +``` + +##Install dfu-programmer +To install the dfu-programmer, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work). +Copy this file into your cygwin home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the Windows PATH and the Cygwin PATH. I achieved this by moving the files in Windows Explorer to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a WINDOWS command prompt running: +``` +C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin +``` +Adjust your path (for username) as needed. Also, `libusb0_x86.dll` needs to be renamed to `libusb0.dll`. Why must this be so hard? You can tell that you were successful this way: +``` +$ which dfu-programmer +/home/Kevin/local/avr/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` +If you are not getting the above result, you will not be able to flash the firmware! +-Try making sure your PATH variables are set correctly for both windows and cygwin. +-Do not try to extract it with cygwin's `unzip` as it does not set the executable permissions correctly. + +####Install the USB drivers +These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the dfu to program the firmware. From an administrator-privileged Windows terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up: +``` +C:\> pnputil -i -a C:\cygwin64\home\Kevin\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf +``` +This should be the result: +``` +Microsoft PnP Utility + +Processing inf : atmel_usb_dfu.inf +Successfully installed the driver on a device on the system. +Driver package added successfully. +Published name : oem104.inf + + +Total attempted: 1 +Number successfully imported: 1 +``` + +##Building and Flashing the Planck firmware! + +If you did everything else right. This part should be a snap! Grab the latest sources from github, make the Plank firmware, then flash it. + +###build Planck and load the firmware +``` +$ cd ~/src +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboard/planck +$ make +``` +Make sure there are no errors. You should end up with this or something similar: + +``` +Creating load file for Flash: planck.hex +avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex + +Creating load file for EEPROM: planck.eep +avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \ +--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0 + +Creating Extended Listing: planck.lss +avr-objdump -h -S -z planck.elf > planck.lss + +Creating Symbol Table: planck.sym +avr-nm -n planck.elf > planck.sym + +Size after: + text data bss dec hex filename + 18602 82 155 18839 4997 planck.elf + +-------- end -------- +``` + +If you don't, you did not build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something in the install process, go check and see what didn't work and threw errors or what steps you might have missed. + +But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: +``` +$ make dfu +``` +. +. +. +profit!!! -- cgit v1.2.3 From 2f6f45aa3ee6cdeaa8e3904926a662d7a0a681c5 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Fri, 4 Mar 2016 15:04:42 -0500 Subject: Cygwin Based Users Guidev0.2 -formatting revisions --- keyboard/planck/CYGWIN_GUIDE.md | 94 ++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md index 896a42c764..2fa4452f1c 100755 --- a/keyboard/planck/CYGWIN_GUIDE.md +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -1,41 +1,41 @@ -#Planck Advanced (but not too advanced) Cygwin Users Guide -If you are a user of the [Cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. +#Planck Advanced (but not too advanced) `cygwin` Users Guide +If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. -This guide was written step by step as I went through the process on a Windows10 x86_64 based system. This should be generally applicable to to any Windows Environment with Cygwin. +This guide was written step by step as I went through the process on a `Windows 10` `x86_64` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. #####Do not skip steps. Do not move past a step until the previous step finishes successfully. -based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) +Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) -###get the required packages -Download the Cygwin Installer ([x86_64](https://cygwin.com/setup-x86_64.exe) or [x86_32](https://cygwin.com/setup-x86.exe)) and install the default system plus the following if they are not already selected: --devel/gcc-core --devel/gcc-g++ --devel/flex --devel/git --libs/libglib2.0_0 --libs/libgcc1 --interpreters/m4 --web/wget +##Get the Required Packages +Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected: +- devel/gcc-core +- devel/gcc-g++ +- devel/flex +- devel/git +- libs/libglib2.0_0 +- libs/libgcc1 +- interpreters/m4 +- web/wget The following sources will be required: --get [gmp](https://gmplib.org/) (6.1.0) --get [mpfr](http://www.mpfr.org/) (3.1.3) --get [mpc](http://www.multiprecision.org/) (1.0.3) --get [binutils](https://www.sourceware.org/binutils/) (2.26) --get [gcc](https://gcc.gnu.org/) (5.3.0) --get [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) +- [gmp](https://gmplib.org/) (6.1.0) +- [mpfr](http://www.mpfr.org/) (3.1.3) +- [mpc](http://www.multiprecision.org/) (1.0.3) +- [binutils](https://www.sourceware.org/binutils/) (2.26) +- [gcc](https://gcc.gnu.org/) (5.3.0) +- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) The `dfu-programmer` will be required to flash the new firmware --get [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) +- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) -The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. note: the expand commands are different depending on if the packages are offered as a bz2 or gz archive +The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive ``` $ mkdir ~/local/avr @@ -55,8 +55,8 @@ $ tar -zxf gcc-5.3.0.tar.gz $ tar -xjf avr-libc-2.0.0.tar.bz2 ``` -###setup build environment -These commands will set up the install directory and the PATH variable, which will allow you to access your installed packages. note: if you close the cygwin terminal window, you will need to rerun these commands, they are not permanent +##Setup the Build Environment +These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent. ``` $ PREFIX=$HOME/local/avr $ export PREFIX @@ -65,10 +65,10 @@ $ PATH=$PATH:$PREFIX/bin $ export PATH ``` -##The gcc required math library packages -The following packages are required to be complied and installed in order to compile gcc. They are not available through the cygwin package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. +##The `gcc` Required Math Library Packages +The following packages are required to be complied and installed in order to compile `gcc`. They are not available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. -###build and install gmp +###Build and Install `gmp` ``` $ cd ~/src/gmp-6.1.0 $ ./configure --enable-static --disable-shared @@ -77,7 +77,7 @@ $ make check $ make install ``` -###build and install mpfr +###Build and Install `mpfr` ``` $ cd ~/src/mpfr-3.1.3 $ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared @@ -86,7 +86,7 @@ $ make check $ make install ``` -###build and install mpc +###Build and Install `mpc` ``` $ cd ~/src/mpc-1.0.3 $ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared @@ -96,8 +96,8 @@ $ make install ``` ##OPTIONAL Part -You can build and install a brand new gcc or you can use the one supplied by cygwin. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it. -###build and install gcc on your machine +You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it. +###Build and Install `gcc` on your Machine ``` $ cd ~/src/gcc-5.3.0 $ mkdir obj-local @@ -107,7 +107,7 @@ $ make $ make install ``` -###build and install binutils on your machine +###Build and Install `binutils` on your Machine ``` $ cd ~/src/binutils-2.26 $ mkdir obj-local @@ -118,10 +118,10 @@ $ make install ``` ##End OPTIONAL Part -##Buliding binutils, gcc and avr-libc for the AVR system -Now we can make the critical stuff for compiling our firmware, binutils, gcc, and avr-libc for the AVR architectures. These allow us to build and manipulate the firmware for the Keyboard. +##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system +Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard. -###build binutils for avr +###Build `binutils` for AVR ``` $ cd ~/src/binutils-2.26 $ mkdir obj-avr @@ -131,7 +131,7 @@ $ make $ make install ``` -###build gcc for avr +###Build `gcc` for AVR ``` $ cd ~/src/gcc-5.3.0 $ mkdir obj-avr @@ -141,9 +141,9 @@ $ make $ make install ``` -For building the avr-libc, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the gcc configure notes for the proper `--build` specification to pass when you configure avr-libc +For building the `avr-libc`, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. -###build avr-libc for avr +###Build `avr-libc` for AVR ``` $ cd ~/src/avr-libc-2.0.0 $ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr @@ -151,9 +151,9 @@ $ make $ make install ``` -##Install dfu-programmer -To install the dfu-programmer, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work). -Copy this file into your cygwin home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the Windows PATH and the Cygwin PATH. I achieved this by moving the files in Windows Explorer to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a WINDOWS command prompt running: +##Install `dfu-programmer` +To install the `dfu-programmer`, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work). +Copy this file into your `cygwin` home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running: ``` C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin ``` @@ -169,11 +169,11 @@ Type 'dfu-programmer --help' for a list of commands 'dfu-programmer --targets' to list supported target devices ``` If you are not getting the above result, you will not be able to flash the firmware! --Try making sure your PATH variables are set correctly for both windows and cygwin. --Do not try to extract it with cygwin's `unzip` as it does not set the executable permissions correctly. +- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. +- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permissions correctly. If you did it anyway, do `chmod 755 dfu-programmer.exe` ####Install the USB drivers -These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the dfu to program the firmware. From an administrator-privileged Windows terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up: +These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the `dfu-programmer` to program the firmware. From an **administrator-privileged** `Windows` terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up: ``` C:\> pnputil -i -a C:\cygwin64\home\Kevin\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf ``` @@ -193,9 +193,9 @@ Number successfully imported: 1 ##Building and Flashing the Planck firmware! -If you did everything else right. This part should be a snap! Grab the latest sources from github, make the Plank firmware, then flash it. +If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it. -###build Planck and load the firmware +###Build Planck and Load the Firmware ``` $ cd ~/src $ git clone https://github.com/jackhumbert/qmk_firmware.git @@ -225,7 +225,7 @@ Size after: -------- end -------- ``` -If you don't, you did not build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something in the install process, go check and see what didn't work and threw errors or what steps you might have missed. +If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed. But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: ``` -- cgit v1.2.3 From 6bfb9d17cfd8185e664bd4b6af1517d7b066549d Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Wed, 9 Mar 2016 12:16:03 -0500 Subject: Cygwin Based Users Guide v0.4 -corrections/dfu build --- keyboard/planck/CYGWIN_GUIDE.md | 146 +++++++++++++++++++++++++++++++++++----- 1 file changed, 128 insertions(+), 18 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md index 2fa4452f1c..a7ac17a7fc 100755 --- a/keyboard/planck/CYGWIN_GUIDE.md +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -2,7 +2,7 @@ If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. -This guide was written step by step as I went through the process on a `Windows 10` `x86_64` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. +This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. #####Do not skip steps. Do not move past a step until the previous step finishes successfully. @@ -18,14 +18,16 @@ Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and - devel/gcc-g++ - devel/flex - devel/git -- libs/libglib2.0_0 +- devel/bison +- devel/make - libs/libgcc1 - interpreters/m4 - web/wget +- archive/unzip The following sources will be required: - [gmp](https://gmplib.org/) (6.1.0) -- [mpfr](http://www.mpfr.org/) (3.1.3) +- [mpfr](http://www.mpfr.org/) (3.1.4) - [mpc](http://www.multiprecision.org/) (1.0.3) - [binutils](https://www.sourceware.org/binutils/) (2.26) - [gcc](https://gcc.gnu.org/) (5.3.0) @@ -38,17 +40,18 @@ The `dfu-programmer` will be required to flash the new firmware The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive ``` +$ mkdir ~/local $ mkdir ~/local/avr $ mkdir ~/src $ cd ~/src $ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 -$ wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2 +$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2 $ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz $ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz $ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz $ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 $ tar -xjf gmp-6.1.0.tar.bz2 -$ tar -xjf mpfr-3.1.3.tar.bz2 +$ tar -xjf mpfr-3.1.4.tar.bz2 $ tar -zxf mpc-1.0.3.tar.gz $ tar -zxf binutils-2.26.tar.gz $ tar -zxf gcc-5.3.0.tar.gz @@ -79,7 +82,7 @@ $ make install ###Build and Install `mpfr` ``` -$ cd ~/src/mpfr-3.1.3 +$ cd ~/src/mpfr-3.1.4 $ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared $ make $ make check @@ -96,7 +99,8 @@ $ make install ``` ##OPTIONAL Part -You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it. +You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). + ###Build and Install `gcc` on your Machine ``` $ cd ~/src/gcc-5.3.0 @@ -141,7 +145,7 @@ $ make $ make install ``` -For building the `avr-libc`, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. +For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. ###Build `avr-libc` for AVR ``` @@ -151,13 +155,34 @@ $ make $ make install ``` -##Install `dfu-programmer` -To install the `dfu-programmer`, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work). -Copy this file into your `cygwin` home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running: +### Build and Install the `dfu-programmer` +We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide. + +The `dfu-programmer` requires `libusb`. So let's go ahead and build that first. + ``` -C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin +$ cd ~/src +$ git clone https://github.com/libusb/libusb.git +$ cd libusb +$ ./bootstrap.sh +$ ./configure --prefix=$PREFIX +$ make +$ make install ``` -Adjust your path (for username) as needed. Also, `libusb0_x86.dll` needs to be renamed to `libusb0.dll`. Why must this be so hard? You can tell that you were successful this way: + +Next, we can build the `dfu-programmer`. This should be quick. +``` +$ cd ~/src +$ git clone https://github.com/dfu-programmer/dfu-programmer.git +$ cd dfu-programmer +$ ./bootstrap.sh +$ ./configure --prefix=$PREFIX +$ make +$ make install +``` + +Verify the installation with: + ``` $ which dfu-programmer /home/Kevin/local/avr/bin/dfu-programmer @@ -169,14 +194,22 @@ Type 'dfu-programmer --help' for a list of commands 'dfu-programmer --targets' to list supported target devices ``` If you are not getting the above result, you will not be able to flash the firmware! -- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. -- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permissions correctly. If you did it anyway, do `chmod 755 dfu-programmer.exe` -####Install the USB drivers -These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the `dfu-programmer` to program the firmware. From an **administrator-privileged** `Windows` terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up: +###Install the USB drivers +The official Atmel drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) and allow the `dfu-programmer` to program the firmware. + ``` -C:\> pnputil -i -a C:\cygwin64\home\Kevin\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf +$ cd ~/src +$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2 + ``` + +Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username as necessary) and accept the prompt that pops up: +``` +C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf +``` + This should be the result: ``` Microsoft PnP Utility @@ -190,6 +223,8 @@ Published name : oem104.inf Total attempted: 1 Number successfully imported: 1 ``` +Alternativly, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file. + ##Building and Flashing the Planck firmware! @@ -235,3 +270,78 @@ $ make dfu . . profit!!! + + + + + +##extra bits... + + + +###Installing Precompiled `dfu-programmer` Binaries (Not recommended) +To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)). +Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running: +``` +C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin +``` +Adjust your path (for username) as needed. +Then, rename `libusb0_x86.dll` to `libusb0.dll`. +You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt: +``` +$ which dfu-programmer +/home/Kevin/local/avr/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` +If you are not getting the above result, you will not be able to flash the firmware! +- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. +- Make sure the `dll` is named correctly. +- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`. + + +##Debugging Tools + +These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your flash memory from wearing out. However, these tool do not work 100% for the Planck firmware. + +### `gdb` for AVR +`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it. + +``` +$ cd ~/src +$ git clone git://sourceware.org/git/binutils-gdb.git +$ cd binutils-gdb +$ ./bootstrap +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static +$ make +$ make install +``` + + +### `simulavr` +`simulavr` is an AVR simulator. It runs the complied AVR elf's. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects. + +This one is a major pain in the butt because it has a lot of dependencies and it is almost always buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`. + + +``` +$ cd ~/src +$ git clone https://github.com/Traumflug/simulavr.git +$ cd simulavr +$ ./bootstrap +$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc +``` + Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places. + +``` +$ make +$ make install +``` + + -- cgit v1.2.3 From 79e0d7cbc3fe18c947ece861843110c648759ad1 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Wed, 9 Mar 2016 15:53:37 -0500 Subject: Cygwin Based Users Guide v0.5 -further corrections --- keyboard/planck/CYGWIN_GUIDE.md | 700 ++++++++++++++++++++-------------------- 1 file changed, 353 insertions(+), 347 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md index a7ac17a7fc..a59eaf6706 100755 --- a/keyboard/planck/CYGWIN_GUIDE.md +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -1,347 +1,353 @@ -#Planck Advanced (but not too advanced) `cygwin` Users Guide -If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. - - -This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. - - -#####Do not skip steps. Do not move past a step until the previous step finishes successfully. - - - -Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) - - -##Get the Required Packages -Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected: -- devel/gcc-core -- devel/gcc-g++ -- devel/flex -- devel/git -- devel/bison -- devel/make -- libs/libgcc1 -- interpreters/m4 -- web/wget -- archive/unzip - -The following sources will be required: -- [gmp](https://gmplib.org/) (6.1.0) -- [mpfr](http://www.mpfr.org/) (3.1.4) -- [mpc](http://www.multiprecision.org/) (1.0.3) -- [binutils](https://www.sourceware.org/binutils/) (2.26) -- [gcc](https://gcc.gnu.org/) (5.3.0) -- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) - -The `dfu-programmer` will be required to flash the new firmware -- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) - - -The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive - -``` -$ mkdir ~/local -$ mkdir ~/local/avr -$ mkdir ~/src -$ cd ~/src -$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 -$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2 -$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz -$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz -$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz -$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 -$ tar -xjf gmp-6.1.0.tar.bz2 -$ tar -xjf mpfr-3.1.4.tar.bz2 -$ tar -zxf mpc-1.0.3.tar.gz -$ tar -zxf binutils-2.26.tar.gz -$ tar -zxf gcc-5.3.0.tar.gz -$ tar -xjf avr-libc-2.0.0.tar.bz2 -``` - -##Setup the Build Environment -These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent. -``` -$ PREFIX=$HOME/local/avr -$ export PREFIX -$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS -$ PATH=$PATH:$PREFIX/bin -$ export PATH -``` - -##The `gcc` Required Math Library Packages -The following packages are required to be complied and installed in order to compile `gcc`. They are not available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. - -###Build and Install `gmp` -``` -$ cd ~/src/gmp-6.1.0 -$ ./configure --enable-static --disable-shared -$ make -$ make check -$ make install -``` - -###Build and Install `mpfr` -``` -$ cd ~/src/mpfr-3.1.4 -$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared -$ make -$ make check -$ make install -``` - -###Build and Install `mpc` -``` -$ cd ~/src/mpc-1.0.3 -$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared -$ make -$ make check -$ make install -``` - -##OPTIONAL Part -You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). - -###Build and Install `gcc` on your Machine -``` -$ cd ~/src/gcc-5.3.0 -$ mkdir obj-local -$ cd obj-local -$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared -$ make -$ make install -``` - -###Build and Install `binutils` on your Machine -``` -$ cd ~/src/binutils-2.26 -$ mkdir obj-local -$ cd obj-local -$ ../configure -$ make -$ make install -``` -##End OPTIONAL Part - -##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system -Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard. - -###Build `binutils` for AVR -``` -$ cd ~/src/binutils-2.26 -$ mkdir obj-avr -$ cd obj-avr -$ ../configure --prefix=$PREFIX --target=avr --disable-nls -$ make -$ make install -``` - -###Build `gcc` for AVR -``` -$ cd ~/src/gcc-5.3.0 -$ mkdir obj-avr -$ cd obj-avr -$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2 -$ make -$ make install -``` - -For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. - -###Build `avr-libc` for AVR -``` -$ cd ~/src/avr-libc-2.0.0 -$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr -$ make -$ make install -``` - -### Build and Install the `dfu-programmer` -We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide. - -The `dfu-programmer` requires `libusb`. So let's go ahead and build that first. - -``` -$ cd ~/src -$ git clone https://github.com/libusb/libusb.git -$ cd libusb -$ ./bootstrap.sh -$ ./configure --prefix=$PREFIX -$ make -$ make install -``` - -Next, we can build the `dfu-programmer`. This should be quick. -``` -$ cd ~/src -$ git clone https://github.com/dfu-programmer/dfu-programmer.git -$ cd dfu-programmer -$ ./bootstrap.sh -$ ./configure --prefix=$PREFIX -$ make -$ make install -``` - -Verify the installation with: - -``` -$ which dfu-programmer -/home/Kevin/local/avr/bin/dfu-programmer - -$ dfu-programmer -dfu-programmer 0.7.2 -https://github.com/dfu-programmer/dfu-programmer -Type 'dfu-programmer --help' for a list of commands - 'dfu-programmer --targets' to list supported target devices -``` -If you are not getting the above result, you will not be able to flash the firmware! - -###Install the USB drivers -The official Atmel drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) and allow the `dfu-programmer` to program the firmware. - -``` -$ cd ~/src -$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip -$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2 - -``` - -Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username as necessary) and accept the prompt that pops up: -``` -C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf -``` - -This should be the result: -``` -Microsoft PnP Utility - -Processing inf : atmel_usb_dfu.inf -Successfully installed the driver on a device on the system. -Driver package added successfully. -Published name : oem104.inf - - -Total attempted: 1 -Number successfully imported: 1 -``` -Alternativly, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file. - - -##Building and Flashing the Planck firmware! - -If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it. - -###Build Planck and Load the Firmware -``` -$ cd ~/src -$ git clone https://github.com/jackhumbert/qmk_firmware.git -$ cd qmk_firmware/keyboard/planck -$ make -``` -Make sure there are no errors. You should end up with this or something similar: - -``` -Creating load file for Flash: planck.hex -avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex - -Creating load file for EEPROM: planck.eep -avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \ ---change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0 - -Creating Extended Listing: planck.lss -avr-objdump -h -S -z planck.elf > planck.lss - -Creating Symbol Table: planck.sym -avr-nm -n planck.elf > planck.sym - -Size after: - text data bss dec hex filename - 18602 82 155 18839 4997 planck.elf - --------- end -------- -``` - -If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed. - -But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: -``` -$ make dfu -``` -. -. -. -profit!!! - - - - - -##extra bits... - - - -###Installing Precompiled `dfu-programmer` Binaries (Not recommended) -To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)). -Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running: -``` -C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin -``` -Adjust your path (for username) as needed. -Then, rename `libusb0_x86.dll` to `libusb0.dll`. -You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt: -``` -$ which dfu-programmer -/home/Kevin/local/avr/bin/dfu-programmer - -$ dfu-programmer -dfu-programmer 0.7.2 -https://github.com/dfu-programmer/dfu-programmer -Type 'dfu-programmer --help' for a list of commands - 'dfu-programmer --targets' to list supported target devices -``` -If you are not getting the above result, you will not be able to flash the firmware! -- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. -- Make sure the `dll` is named correctly. -- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`. - - -##Debugging Tools - -These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your flash memory from wearing out. However, these tool do not work 100% for the Planck firmware. - -### `gdb` for AVR -`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it. - -``` -$ cd ~/src -$ git clone git://sourceware.org/git/binutils-gdb.git -$ cd binutils-gdb -$ ./bootstrap -$ mkdir obj-avr -$ cd obj-avr -$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static -$ make -$ make install -``` - - -### `simulavr` -`simulavr` is an AVR simulator. It runs the complied AVR elf's. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects. - -This one is a major pain in the butt because it has a lot of dependencies and it is almost always buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`. - - -``` -$ cd ~/src -$ git clone https://github.com/Traumflug/simulavr.git -$ cd simulavr -$ ./bootstrap -$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc -``` - Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places. - -``` -$ make -$ make install -``` - - +#Planck Advanced (but not too advanced) `cygwin` Users Guide +If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. + + +This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. + + +#####Do not skip steps. Do not move past a step until the previous step finishes successfully. + + + +Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) + + +##Get the Required Packages +Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected: +- devel/gcc-core +- devel/gcc-g++ +- devel/flex +- devel/git +- devel/bison +- devel/make +- libs/libgcc1 +- interpreters/m4 +- web/wget +- archive/unzip + +The following sources will be required: +- [gmp](https://gmplib.org/) (6.1.0) +- [mpfr](http://www.mpfr.org/) (3.1.4) +- [mpc](http://www.multiprecision.org/) (1.0.3) +- [binutils](https://www.sourceware.org/binutils/) (2.26) +- [gcc](https://gcc.gnu.org/) (5.3.0) +- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) + +The `dfu-programmer` will be required to flash the new firmware +- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) + + +The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive + +``` +$ mkdir ~/local +$ mkdir ~/local/avr +$ mkdir ~/src +$ cd ~/src +$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 +$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2 +$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz +$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz +$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz +$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 +$ tar -xjf gmp-6.1.0.tar.bz2 +$ tar -xjf mpfr-3.1.4.tar.bz2 +$ tar -zxf mpc-1.0.3.tar.gz +$ tar -zxf binutils-2.26.tar.gz +$ tar -zxf gcc-5.3.0.tar.gz +$ tar -xjf avr-libc-2.0.0.tar.bz2 +``` + +##Setup the Build Environment +These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent. +``` +$ PREFIX=$HOME/local/avr +$ export PREFIX +$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS +$ PATH=$PATH:$PREFIX/bin +$ export PATH +``` + +##The `gcc` Required Math Library Packages +The following packages are required to be complied and installed in order to compile `gcc`. They are not sufficiently available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. + +###Build and Install `gmp` +``` +$ cd ~/src/gmp-6.1.0 +$ ./configure --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###Build and Install `mpfr` +``` +$ cd ~/src/mpfr-3.1.4 +$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###Build and Install `mpc` +``` +$ cd ~/src/mpc-1.0.3 +$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +##OPTIONAL Part +You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). + +###Build and Install `gcc` on your Machine +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-local +$ cd obj-local +$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared +$ make +$ make install +``` +##End OPTIONAL Part + +###Build and Install `binutils` on your Machine +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-local +$ cd obj-local +$ ../configure +$ make +$ make install +``` + +##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system +Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard. + +###Build `binutils` for AVR +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --disable-nls +$ make +$ make install +``` + +###Build `gcc` for AVR +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2 +$ make +$ make install +``` + +###Build `avr-libc` for AVR +For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. +``` +$ cd ~/src/avr-libc-2.0.0 +$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr +$ make +$ make install +``` + +### Build and Install the `dfu-programmer` +We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide. + +The `dfu-programmer` requires `libusb`. So let's go ahead and build that first. +``` +$ cd ~/src +$ git clone https://github.com/libusb/libusb.git +$ cd libusb +$ ./bootstrap.sh +$ ./configure --prefix=$PREFIX +$ make +$ make install +``` + +Next, we can build the `dfu-programmer`. This is quick. +``` +$ cd ~/src +$ git clone https://github.com/dfu-programmer/dfu-programmer.git +$ cd dfu-programmer +$ ./bootstrap.sh +$ ./configure --prefix=$PREFIX +$ make +$ make install +``` + +Verify the installation with: +``` +$ which dfu-programmer +/home/Kevin/local/avr/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` +If you are not getting the above result, you will not be able to flash the firmware! + +###Install the USB drivers +The drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip). + +``` +$ cd ~/src +$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2 +``` + +or + +The official drivers are found in [Atmel's `FLIP` installer](http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe). Download and then install `FLIP`. Upon installation, the drivers will be found in `C:\Program Files (x86)\Atmel\Flip 3.4.7\usb`. + +Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username, etc. as necessary) and accept the prompt that pops up: +``` +C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf +or +C:\> pnputil -i -a "C:\Program Files (x86)\Atmel\Flip 3.4.7\usb\atmel_usb_dfu.inf" +``` + +This should be the result: +``` +Microsoft PnP Utility + +Processing inf : atmel_usb_dfu.inf +Successfully installed the driver on a device on the system. +Driver package added successfully. +Published name : oem104.inf + + +Total attempted: 1 +Number successfully imported: 1 +``` + +Alternatively, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file. + + +##Building and Flashing the Planck firmware! + +If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it. + +###Build Planck and Load the Firmware +``` +$ cd ~/src +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboard/planck +$ make +``` +Make sure there are no errors. You should end up with this or something similar: + +``` +Creating load file for Flash: planck.hex +avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex + +Creating load file for EEPROM: planck.eep +avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \ +--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0 + +Creating Extended Listing: planck.lss +avr-objdump -h -S -z planck.elf > planck.lss + +Creating Symbol Table: planck.sym +avr-nm -n planck.elf > planck.sym + +Size after: + text data bss dec hex filename + 18602 82 155 18839 4997 planck.elf + +-------- end -------- +``` + +If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed. + +But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: +``` +$ make dfu +``` +. +. +. +profit!!! + + + + + +##extra bits... + +###Installing Precompiled `dfu-programmer` Binaries (Not recommended) +To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)). +Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. This is because the `dfu-programmer` binary is `mingw` based, not `cygwin` based, so the `dlls` do not cooperate. I achieved acceptable pathing by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running: +``` +C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin +``` +Adjust your path (for username) as needed. +Then, rename `libusb0_x86.dll` to `libusb0.dll`. +You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt: +``` +$ which dfu-programmer +/home/Kevin/local/avr/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` +If you are not getting the above result, you will not be able to flash the firmware! +- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. +- Make sure the `dll` is named correctly. +- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`. +- Still have problems? Try building it instead. + + +##Debugging Tools + +These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your memory from wearing out. However, these tool do not work 100% for the Planck firmware. + +### `gdb` for AVR +`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it. + +``` +$ cd ~/src +$ git clone git://sourceware.org/git/binutils-gdb.git +$ cd binutils-gdb +$ ./bootstrap +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static +$ make +$ make install +``` + + +### `simulavr` +`simulavr` is an AVR simulator. It runs the complied AVR elfs. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects. + +This one is a major pain in the butt because it has a lot of dependencies and it is buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`. + + +``` +$ cd ~/src +$ git clone https://github.com/Traumflug/simulavr.git +$ cd simulavr +$ ./bootstrap +$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc +``` + Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places. + +``` +$ make +$ make install +``` + + +TODO: +git repos for all sources +command line magic for cygwin setup +better options for dfu drivers -- cgit v1.2.3 From 641859df84bf40025b2c14319d1a168a435562e2 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Thu, 10 Mar 2016 11:28:34 -0500 Subject: Addressed void* return warning in all keymaps --- keyboard/planck/keymaps/lock/keymap.c | 2 +- keyboard/planck/planck.c | 24 ++++++++++-------------- keyboard/planck/planck.h | 4 ++-- 3 files changed, 13 insertions(+), 17 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c index 9585764629..f1629492ef 100644 --- a/keyboard/planck/keymaps/lock/keymap.c +++ b/keyboard/planck/keymaps/lock/keymap.c @@ -150,7 +150,7 @@ float start_up[][2] = { {440.0*pow(2.0,(64)/12.0), 1000}, }; -void * matrix_init_user(void) { +void matrix_init_user(void) { init_notes(); play_notes(&start_up, 9, false); } \ No newline at end of file diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index 63ca54761c..fe8731ec7b 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -1,16 +1,16 @@ #include "planck.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { #ifdef BACKLIGHT_ENABLE backlight_init_ports(); #endif @@ -24,13 +24,9 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 00b01b54df..e9566b9228 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -40,7 +40,7 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif -- cgit v1.2.3 From 67624d0b61b88c5e409311ead463d504e3eb1195 Mon Sep 17 00:00:00 2001 From: Mitch Lloyd Date: Wed, 19 Aug 2015 09:53:20 -0700 Subject: First keyboard layout --- keyboard/planck/common_keymaps/keymap_mitch.c | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 keyboard/planck/common_keymaps/keymap_mitch.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/common_keymaps/keymap_mitch.c b/keyboard/planck/common_keymaps/keymap_mitch.c new file mode 100644 index 0000000000..f7df7bbbaa --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_mitch.c @@ -0,0 +1,49 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN3, + ESC, DEL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( + GRV, GRV, FN22, FN19, FN10, TRNS, TRNS, 7, 8, 9, 0, BSPC, + TRNS, LBRC, RBRC, FN23, FN24, TRNS, TRNS, 4, 5, 6, TRNS, BSLS, + TRNS, MINS, FN20, EQL, FN21, TRNS, TRNS, 1, 2, 3, TRNS, ENT, + TRNS, TRNS, TRNS, TRNS, TRNS, SPC, FN1, TRNS, PGDN, PGUP, TRNS), +[2] = KEYMAP( + FN26, FN10, FN11, FN12, FN13, FN14, FN15, FN17, FN18, FN19, FN10, DEL, + TRNS, TRNS, MUTE, VOLD, VOLU, TRNS, BSPC, FN14, FN15, FN16, TRNS, FN25, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN11, FN12, FN13, TRNS, ENT, + TRNS, TRNS, TRNS, TRNS, FN2, ENT, TRNS, TRNS, PGDN, PGUP, TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // Switch layer raise + [2] = ACTION_LAYER_MOMENTARY(2), // Switch layer lower + + [3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Right shift serves as Enter on tap + + // Numeric shift modifiers + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + + // Other shift modifiers + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | + + // Switch windows in app + [26] = ACTION_MODS_KEY(MOD_LGUI, KC_GRV), +}; -- cgit v1.2.3 From b8d4af8d4ad5fba13faf76149e349a1ee04284b9 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Mon, 14 Mar 2016 13:19:29 -0400 Subject: Cygwin Based Users Guide v0.6 -fixes to dfu-programmer build --- keyboard/planck/CYGWIN_GUIDE.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md index 0b08a6aa1e..ac13e745d7 100755 --- a/keyboard/planck/CYGWIN_GUIDE.md +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -17,6 +17,9 @@ Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and - devel/make - devel/texinfo - devel/gettext-devel +- devel/automake +- devel/autoconfig +- devel/libtool - text/gettext - libs/libgcc1 - interpreters/m4 @@ -60,7 +63,7 @@ These commands will set up the install directory and the `PATH` variable, which $ PREFIX=$HOME/local/avr $ export PREFIX $ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS -$ PATH=$PATH:$PREFIX/bin +$ PATH=$PATH:$PREFIX/bin:$PREFIX/lib $ export PATH ``` @@ -155,13 +158,13 @@ $ make install We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide. ### Build and Install the `libusb` -The `dfu-programmer` requires `libusb` so that it can interact with the USB system. +The `dfu-programmer` requires `libusb` so that it can interact with the USB system. These repos must be bootstrapped in order to create an appropriate `./configure` and `Makefile` for your system. ``` $ cd ~/src $ git clone https://github.com/libusb/libusb.git $ cd libusb $ ./bootstrap.sh -$ ./configure --prefix=$PREFIX +$ ./configure $ make $ make install ``` @@ -172,7 +175,7 @@ $ cd ~/src $ git clone https://github.com/dfu-programmer/dfu-programmer.git $ cd dfu-programmer $ ./bootstrap.sh -$ ./configure --prefix=$PREFIX +$ ./configure $ make $ make install ``` @@ -180,7 +183,7 @@ $ make install Verify the installation with: ``` $ which dfu-programmer -/home/Kevin/local/avr/bin/dfu-programmer +/usr/local/bin/dfu-programmer $ dfu-programmer dfu-programmer 0.7.2 @@ -315,7 +318,6 @@ These tools are for debugging your firmware, etc. before flashing. Theoretically $ cd ~/src $ git clone git://sourceware.org/git/binutils-gdb.git $ cd binutils-gdb -$ ./bootstrap $ mkdir obj-avr $ cd obj-avr $ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static -- cgit v1.2.3 From 05b0931cfcb9b137aa013849e5c4a5b504a77559 Mon Sep 17 00:00:00 2001 From: Alex Ives Date: Wed, 16 Mar 2016 20:06:56 -0500 Subject: Added layout diagrams to the default planck keymap Signed-off-by: Alex Ives --- keyboard/planck/keymaps/default/keymap.c | 70 +++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 5 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c index a9c2a06813..d995eb9e58 100644 --- a/keyboard/planck/keymaps/default/keymap.c +++ b/keyboard/planck/keymaps/default/keymap.c @@ -17,31 +17,91 @@ #define _RS 4 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QW] = { {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 */ + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_CM] = { {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 */ + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DV] = { {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 */ + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |Qwerty|Colemk|Dvorak| Reset|Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RS] = { {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 */ + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |Qwerty|Colemk|Dvorak| Reset|Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LW] = { {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}, -- cgit v1.2.3 From bcebb3447c155056819d42668943110ab0868517 Mon Sep 17 00:00:00 2001 From: Damien Pollet Date: Mon, 28 Mar 2016 16:14:54 +0200 Subject: Add action-preprocessing kb/user hooks in planck --- keyboard/planck/planck.c | 32 +++++++++++++++++--------------- keyboard/planck/planck.h | 1 + 2 files changed, 18 insertions(+), 15 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index fe8731ec7b..4b39cf1e8b 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -1,28 +1,26 @@ #include "planck.h" __attribute__ ((weak)) -void matrix_init_user(void) { - -} +void matrix_init_user(void) {} __attribute__ ((weak)) -void matrix_scan_user(void) { +void matrix_scan_user(void) {} -} +__attribute__ ((weak)) +void process_action_user(keyrecord_t *record) {} void matrix_init_kb(void) { - #ifdef BACKLIGHT_ENABLE - backlight_init_ports(); - #endif +#ifdef BACKLIGHT_ENABLE + backlight_init_ports(); +#endif - #ifdef RGBLIGHT_ENABLE - rgblight_init(); - #endif +#ifdef RGBLIGHT_ENABLE + rgblight_init(); +#endif - - // Turn status LED on - DDRE |= (1<<6); - PORTE |= (1<<6); + // Turn status LED on + DDRE |= (1<<6); + PORTE |= (1<<6); matrix_init_user(); } @@ -30,3 +28,7 @@ void matrix_init_kb(void) { void matrix_scan_kb(void) { matrix_scan_user(); } + +void process_action_kb(keyrecord_t *record) { + process_action_user(record); +} diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index e9566b9228..edcb5fbff6 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -42,5 +42,6 @@ void matrix_init_user(void); void matrix_scan_user(void); +void process_action_user(keyrecord_t *record); #endif -- cgit v1.2.3