From 8665ed3efc62e649d0eac5b88761d7b3f8f30cd7 Mon Sep 17 00:00:00 2001 From: Stick Date: Tue, 18 Apr 2017 09:46:07 -0500 Subject: small changes --- keyboards/ergodox/keymaps/familiar/README.md | 4 ++-- keyboards/ergodox/keymaps/familiar/keymap.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/ergodox/keymaps/familiar/README.md b/keyboards/ergodox/keymaps/familiar/README.md index e4336d9b5..8db9a7712 100644 --- a/keyboards/ergodox/keymaps/familiar/README.md +++ b/keyboards/ergodox/keymaps/familiar/README.md @@ -1,5 +1,5 @@ # ErgoDox Familiar Layout -Familiar layout for those who regularly switch back and forth from ErgoDox to regular QWERTY. +Familiar layout for those who regularly switch back and forth from ErgoDox to "normal" QWERTY. [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](../../../../license_GPLv3.md../../../../license_GPLv3.md) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme) @@ -50,7 +50,7 @@ $ make ergodox-ez-familiar-teensy ### Layers 1. Base Layer: QWERTY, with arrow keys at bottom right. 1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster). -1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed through holding shift while the UCIS layer is active (toggles the `INSF` layer). +1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed by holding shift while the UCIS layer is active (toggles the `INSF` layer). 1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster). 1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions. diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index c5f94afda..0e3958de0 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. - * | VOL- | VOL+ | | | | + * | VOL- | VOL+ | |PRTSCR| | * ,------|------|------| |------+------+------. * | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ | * | ALT | MO(1)|------| |------|MO(1) | ALT | @@ -54,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, - _______, _______, + KC_PSCR, _______, KC_NLCK, TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC) ), @@ -202,7 +202,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | HOME | PGDN | END | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. - * | | PAUSE| | | | + * | | PAUSE| |SYSREQ| | * ,------|------|------| |------+------+------. * | | | | |SCRLK | | | * | | |------| |------| | | @@ -225,7 +225,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, - _______, _______, + KC_SYSREQ, _______, KC_SLCK, _______, _______, _______ ), -- cgit v1.2.3 From 4cf17210b60eb7da77f66b8e5af1947a3d168f2f Mon Sep 17 00:00:00 2001 From: Stick Date: Fri, 2 Jun 2017 19:51:29 -0500 Subject: moved alt out from under space --- keyboards/ergodox/keymaps/familiar/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index 0e3958de0..714118d93 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -28,13 +28,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------| * | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT | + * | LCTRL | LGUI | MENU | ' | LALT | |[/RALT| ] | LEFT | DOWN | RIGHT | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. * | VOL- | VOL+ | |PRTSCR| | * ,------|------|------| |------+------+------. - * | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ | - * | ALT | MO(1)|------| |------|MO(1) | ALT | + * | |SLASH/| MUTE | |NUMLCK|WHACK/| | + * | SPC | MO(1)|------| |------|MO(1) | SPC | * | | | LAY3 | | LAY2 | | | * `--------------------' `--------------------' */ @@ -44,19 +44,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, - KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, S(KC_QUOT), + KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, KC_LALT, KC_VOLD, KC_VOLU, KC_MUTE, - ALT_T(KC_SPC), LT(ARRW,KC_SLSH), TG(INTL), + KC_SPC, LT(ARRW, KC_SLSH), TG(INTL), // right hand KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC, - KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, + MT(MOD_RALT, KC_LBRC), KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, _______, KC_NLCK, - TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC) + TG(NUMP), LT(ARRW, C_BSLS), KC_SPC ), /* layer 1: International symbols, etc -- cgit v1.2.3 From f397402e101774eedd1748b1e31c7386f927d4ed Mon Sep 17 00:00:00 2001 From: Stick Date: Fri, 2 Jun 2017 20:02:02 -0500 Subject: ugly workaround for ErgoDoxEZ LED bugs: turn 'em all off --- keyboards/ergodox/ez/ez.c | 42 +++++++++++++-------------- keyboards/ergodox/ez/matrix.c | 3 +- keyboards/ergodox/keymaps/familiar/keymap.c | 44 ++++++++++++++--------------- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c index 3e19f2302..55b51f6fa 100644 --- a/keyboards/ergodox/ez/ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -22,30 +22,30 @@ void matrix_init_kb(void) { PORTD |= (1<<5 | 1<<4); PORTE |= (1<<6); - ergodox_blink_all_leds(); + //ergodox_blink_all_leds(); matrix_init_user(); } -void ergodox_blink_all_leds(void) -{ - ergodox_led_all_off(); - ergodox_led_all_set(LED_BRIGHTNESS_HI); - ergodox_right_led_1_on(); - _delay_ms(50); - ergodox_right_led_2_on(); - _delay_ms(50); - ergodox_right_led_3_on(); - _delay_ms(50); - ergodox_right_led_1_off(); - _delay_ms(50); - ergodox_right_led_2_off(); - _delay_ms(50); - ergodox_right_led_3_off(); - //ergodox_led_all_on(); - //_delay_ms(333); - ergodox_led_all_off(); -} +// void ergodox_blink_all_leds(void) +// { +// ergodox_led_all_off(); +// ergodox_led_all_set(LED_BRIGHTNESS_HI); +// ergodox_right_led_1_on(); +// _delay_ms(50); +// ergodox_right_led_2_on(); +// _delay_ms(50); +// ergodox_right_led_3_on(); +// _delay_ms(50); +// ergodox_right_led_1_off(); +// _delay_ms(50); +// ergodox_right_led_2_off(); +// _delay_ms(50); +// ergodox_right_led_3_off(); +// //ergodox_led_all_on(); +// //_delay_ms(333); +// ergodox_led_all_off(); +// } uint8_t init_mcp23018(void) { mcp23018_status = 0x20; @@ -57,7 +57,7 @@ uint8_t init_mcp23018(void) { // cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) - i2c_initialized++; + i2c_initialized = 1; _delay_ms(1000); } diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c index 21b60a542..a489e5b5c 100644 --- a/keyboards/ergodox/ez/matrix.c +++ b/keyboards/ergodox/ez/matrix.c @@ -183,7 +183,7 @@ uint8_t matrix_scan(void) print("left side not responding\n"); } else { print("left side attached\n"); - ergodox_blink_all_leds(); +// ergodox_blink_all_leds(); } } } @@ -391,4 +391,3 @@ static void select_row(uint8_t row) } } } - diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index 714118d93..513bb5541 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MT(MOD_RALT, KC_LBRC), KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, _______, KC_NLCK, - TG(NUMP), LT(ARRW, C_BSLS), KC_SPC + TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC ), /* layer 1: International symbols, etc @@ -242,26 +242,26 @@ void matrix_init_user(void) { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case INTL: - case INSF: - ergodox_right_led_1_on(); - break; - case NUMP: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } + // uint8_t layer = biton32(layer_state); + // + // ergodox_board_led_off(); + // ergodox_right_led_1_off(); + // ergodox_right_led_2_off(); + // ergodox_right_led_3_off(); + // switch (layer) { + // case INTL: + // case INSF: + // ergodox_right_led_1_on(); + // break; + // case NUMP: + // ergodox_right_led_2_on(); + // break; + // case ARRW: + // ergodox_right_led_3_on(); + // break; + // default: + // // none + // break; + // } }; -- cgit v1.2.3 From 5a70cb30eecc8b76410e4b21a225b10c344e12c7 Mon Sep 17 00:00:00 2001 From: Stick Date: Thu, 8 Jun 2017 08:59:30 -0500 Subject: trying to fix LEDs --- keyboards/ergodox/keymaps/familiar/keymap.c | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index 513bb5541..1dd1d5cbc 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -242,26 +242,26 @@ void matrix_init_user(void) { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { - // uint8_t layer = biton32(layer_state); - // - // ergodox_board_led_off(); - // ergodox_right_led_1_off(); - // ergodox_right_led_2_off(); - // ergodox_right_led_3_off(); - // switch (layer) { - // case INTL: - // case INSF: - // ergodox_right_led_1_on(); - // break; - // case NUMP: - // ergodox_right_led_2_on(); - // break; - // case ARRW: - // ergodox_right_led_3_on(); - // break; - // default: - // // none - // break; - // } + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case INTL: + case INSF: + ergodox_right_led_1_on(); + break; + case NUMP: + ergodox_right_led_2_on(); + break; + case ARRW: + ergodox_right_led_3_on(); + break; + default: + // none + break; + } }; -- cgit v1.2.3 From 4b50ab029d49830cf0efd0e5e0606cb39c8dabae Mon Sep 17 00:00:00 2001 From: Stick Date: Thu, 8 Jun 2017 08:59:33 -0500 Subject: Revert "ugly workaround for ErgoDoxEZ LED bugs: turn 'em all off" This reverts commit f397402e101774eedd1748b1e31c7386f927d4ed. --- keyboards/ergodox/ez/ez.c | 42 ++++++++++++++--------------- keyboards/ergodox/ez/matrix.c | 3 ++- keyboards/ergodox/keymaps/familiar/keymap.c | 2 +- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c index 55b51f6fa..3e19f2302 100644 --- a/keyboards/ergodox/ez/ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -22,30 +22,30 @@ void matrix_init_kb(void) { PORTD |= (1<<5 | 1<<4); PORTE |= (1<<6); - //ergodox_blink_all_leds(); + ergodox_blink_all_leds(); matrix_init_user(); } -// void ergodox_blink_all_leds(void) -// { -// ergodox_led_all_off(); -// ergodox_led_all_set(LED_BRIGHTNESS_HI); -// ergodox_right_led_1_on(); -// _delay_ms(50); -// ergodox_right_led_2_on(); -// _delay_ms(50); -// ergodox_right_led_3_on(); -// _delay_ms(50); -// ergodox_right_led_1_off(); -// _delay_ms(50); -// ergodox_right_led_2_off(); -// _delay_ms(50); -// ergodox_right_led_3_off(); -// //ergodox_led_all_on(); -// //_delay_ms(333); -// ergodox_led_all_off(); -// } +void ergodox_blink_all_leds(void) +{ + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + _delay_ms(50); + ergodox_right_led_2_on(); + _delay_ms(50); + ergodox_right_led_3_on(); + _delay_ms(50); + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + //ergodox_led_all_on(); + //_delay_ms(333); + ergodox_led_all_off(); +} uint8_t init_mcp23018(void) { mcp23018_status = 0x20; @@ -57,7 +57,7 @@ uint8_t init_mcp23018(void) { // cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) - i2c_initialized = 1; + i2c_initialized++; _delay_ms(1000); } diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c index a489e5b5c..21b60a542 100644 --- a/keyboards/ergodox/ez/matrix.c +++ b/keyboards/ergodox/ez/matrix.c @@ -183,7 +183,7 @@ uint8_t matrix_scan(void) print("left side not responding\n"); } else { print("left side attached\n"); -// ergodox_blink_all_leds(); + ergodox_blink_all_leds(); } } } @@ -391,3 +391,4 @@ static void select_row(uint8_t row) } } } + diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index 1dd1d5cbc..714118d93 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MT(MOD_RALT, KC_LBRC), KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, _______, KC_NLCK, - TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC + TG(NUMP), LT(ARRW, C_BSLS), KC_SPC ), /* layer 1: International symbols, etc -- cgit v1.2.3 From 23b0fc20e3c94972db7ff897854d2b0513937d71 Mon Sep 17 00:00:00 2001 From: npoirey Date: Fri, 7 Oct 2016 17:18:49 +0200 Subject: Frenchdev v1 --- keyboards/frenchdev/Makefile | 5 + keyboards/frenchdev/config.h | 34 ++ keyboards/frenchdev/frenchdev.c | 4 + keyboards/frenchdev/frenchdev.h | 7 + .../frenchdev/keymaps/default/keyboard-layout.png | Bin 0 -> 138511 bytes keyboards/frenchdev/keymaps/default/keymap.c | 409 +++++++++++++++++++++ keyboards/frenchdev/readme.md | 53 +++ keyboards/frenchdev/rules.mk | 79 ++++ keyboards/frenchdev/v1/Makefile | 8 + keyboards/frenchdev/v1/config.h | 68 ++++ keyboards/frenchdev/v1/i2cmaster.h | 178 +++++++++ keyboards/frenchdev/v1/matrix.c | 394 ++++++++++++++++++++ keyboards/frenchdev/v1/rules.mk | 80 ++++ keyboards/frenchdev/v1/twimaster.c | 208 +++++++++++ keyboards/frenchdev/v1/v1.c | 86 +++++ keyboards/frenchdev/v1/v1.h | 116 ++++++ 16 files changed, 1729 insertions(+) create mode 100644 keyboards/frenchdev/Makefile create mode 100644 keyboards/frenchdev/config.h create mode 100644 keyboards/frenchdev/frenchdev.c create mode 100644 keyboards/frenchdev/frenchdev.h create mode 100644 keyboards/frenchdev/keymaps/default/keyboard-layout.png create mode 100644 keyboards/frenchdev/keymaps/default/keymap.c create mode 100644 keyboards/frenchdev/readme.md create mode 100644 keyboards/frenchdev/rules.mk create mode 100644 keyboards/frenchdev/v1/Makefile create mode 100644 keyboards/frenchdev/v1/config.h create mode 100644 keyboards/frenchdev/v1/i2cmaster.h create mode 100644 keyboards/frenchdev/v1/matrix.c create mode 100644 keyboards/frenchdev/v1/rules.mk create mode 100644 keyboards/frenchdev/v1/twimaster.c create mode 100644 keyboards/frenchdev/v1/v1.c create mode 100644 keyboards/frenchdev/v1/v1.h diff --git a/keyboards/frenchdev/Makefile b/keyboards/frenchdev/Makefile new file mode 100644 index 000000000..73a289f1d --- /dev/null +++ b/keyboards/frenchdev/Makefile @@ -0,0 +1,5 @@ +SUBPROJECT_DEFAULT = v1 + +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/frenchdev/config.h b/keyboards/frenchdev/config.h new file mode 100644 index 000000000..f535010ef --- /dev/null +++ b/keyboards/frenchdev/config.h @@ -0,0 +1,34 @@ +#ifndef KEYBOARDS_ERGODOX_CONFIG_H_ +#define KEYBOARDS_ERGODOX_CONFIG_H_ + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +#ifdef SUBPROJECT_v1 + #include "v1/config.h" +#endif + + +#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ diff --git a/keyboards/frenchdev/frenchdev.c b/keyboards/frenchdev/frenchdev.c new file mode 100644 index 000000000..ecc102169 --- /dev/null +++ b/keyboards/frenchdev/frenchdev.c @@ -0,0 +1,4 @@ +#include "frenchdev.h" +#include "debug.h" +#include "action_layer.h" + diff --git a/keyboards/frenchdev/frenchdev.h b/keyboards/frenchdev/frenchdev.h new file mode 100644 index 000000000..60afda21d --- /dev/null +++ b/keyboards/frenchdev/frenchdev.h @@ -0,0 +1,7 @@ +#ifndef KEYBOARDS_ERGODOX_ERGODOX_H_ +#define KEYBOARDS_ERGODOX_ERGODOX_H_ +#ifdef SUBPROJECT_v1 + #include "v1.h" +#endif + +#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */ diff --git a/keyboards/frenchdev/keymaps/default/keyboard-layout.png b/keyboards/frenchdev/keymaps/default/keyboard-layout.png new file mode 100644 index 000000000..40f556f43 Binary files /dev/null and b/keyboards/frenchdev/keymaps/default/keyboard-layout.png differ diff --git a/keyboards/frenchdev/keymaps/default/keymap.c b/keyboards/frenchdev/keymaps/default/keymap.c new file mode 100644 index 000000000..e0a05cb3c --- /dev/null +++ b/keyboards/frenchdev/keymaps/default/keymap.c @@ -0,0 +1,409 @@ +#include "frenchdev.h" +#include "mousekey.h" +#include "action.h" +#include "action_layer.h" +#include "keymap_extras/keymap_bepo.h" + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +#define _BASE 0 +#define _SYMBOLS 1 +#define _MEDIA 2 +#define _TRNS 8 + +#define PEDAL_DELAY 250 +#define KEY_DELAY 130 + +enum macros { + M_LP, // left pedal + M_RP, // right pedal + M_SF, // shift + M_SFS, // shift and space + M_L1E, // L1 and space + L2INS, // L2 and insert + L2LOC, // Lock L2 + M_UN, // undo + M_CUT, // cut + M_CP, // copy + M_PS, // paste + M_SE, // search + M_SFU, // shift and underscore +}; + +static uint16_t key_timer_left_pedal; +static uint16_t key_timer_right_pedal; +static uint16_t key_timer_shift; +static uint16_t key_timer_1; +static uint16_t key_timer_2; + +static uint16_t shift_count = 0; //this is used to keep track of shift state and avoid inserting non breakable space +static uint16_t l2_locked = 0; //this indicate wether L2 is locked + +#define BP_CBSP CTL_T(KC_BSPC) +#define BP_CDEL CTL_T(KC_DEL) + +//layout : http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* base + * left foot clicked is right click + * left foot pressed is layer 2 + * right foot clicked is left click + * right foot pressed is layer 1 + scroll lock (used with autohotkey for easier scrolling with trackballs) + * ,------. .. ,------. * + * ,------| F3 |-------------. .. ,-------------| F10 |------. * + * ,------| F2 |------| F4 | F5 |------. .. ,------| F8 | F9 |------| F11 |------. * + * | F1 |------| »/3 |------|------| F6 | .. | F7 |------|------| -/8 |------| F12 | * + * ,------+------| «/2 |------| (/4 | )/5 |------| .. |------| @/6 | +/7 |------| //9 |------+------. * + * | ESC | "/1 |------| O |------|------| ¨ | .. | ^ |------|------| D |------| * /0 |BCKSP | * + * |------+------| É |------| P | È |------| .. |------| K | V |------| L |------+------| * + * | TAB | B |------| E |------|------| _ | .. | =/° |------|------| S |------| J |ENTER | * + * |------+------| U |------| I | F |------| .. |------| C | T |------| R |------+------| * + * | ` | A |------| Y |------|------| ; | .. | ! |------|------| UP |------| N | '/? | * + * |------+------| À |------| X | W |------|-------------. .. .-------------|------| M | G |------| H |------+------| * + * | SHIFT| Z |------| . |------|------|sp/sh |bsp/ct|L2/ins| .. |L2lock|del/CT|sp/sh |------|------| DOWN |------| Q |SHIFT | * + * |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| * + * | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + *M(M_LP) + */ +[_BASE] = KEYMAP( + 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_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ + KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ + BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \ + M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, BP_W, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \ + KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ + //left pedals + M(M_LP), M(M_RP), KC_TRNS, \ + //right pedals + M(M_LP), M(M_RP), KC_TRNS \ +), + + /* Larer 1 for symbols. + * left foot is middle click + * ,------. .. ,------. * + * ,------| |-------------. .. ,-------------| |------. * + * ,------| |------| | |------. .. ,------| | |------| |------. * + * | |------| § |------|------| | .. | |------|------| ± |------| | * + * ,------+------| ¶ |------| µ | |------| .. |------| ≤ | ≥ |------| ÷ |------+------. * + * | | ¤ |------| { |------|------| ~ | .. | ˇ |------|------| ] |------| × | | * + * |------+------| * |------| } | ` |------| .. |------| # | [ |------| % |------+------| * + * | | \ |------| ( |------|------| | .. | ≠ |------|------| > |------| ‰ | | * + * |------+------| Ù |------| ) | + |------| .. |------| Ç | < |------| & |------+------| * + * | | = |------| copy |------|------| : | .. | ? |------|------| PGUP |------| _ | | * + * |------+------| cut |------| paste|search|------|-------------. .. .-------------|------| $ | = |------| | |------+------| * + * | | undo |------| \ |------|------| | | | .. | | | |------|------| PGDN |------| / | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | HOME |------| PGDN |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ +[_SYMBOLS] = KEYMAP( + 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, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ + KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ + KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \ + KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ + KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \ + //left pedals + KC_TRNS, KC_BTN1, KC_TRNS, \ + //right pedals + KC_TRNS, KC_BTN1, KC_TRNS \ +), + + /* MEDIA, mouse and numpad. + * right pedal is left clic + * ,------. .. ,------. * + * ,------|PAUSE |-------------. .. ,-------------| PRINT|------. * + * ,------|SCROLL|------|MUTE |VOLUD |------. .. ,------| pre | next |------| calc |------. * + * |RESET |------| stop |------|------|VOLDU | .. | play |------|------| stop |------| num | * + * ,------+------| |------| pre | next |------| .. |------| pre | next |------| |------+------. * + * | | |------|scrolu|------|------| play | .. | play |------|------| 8 |------| - | | * + * |------+------| |------| | bt4 |------| .. |------| next | 7 |------| 9 |------+------| * + * | | |------|scrold|------|------| bt5 | .. | pre |------|------| 5 |------| + | | * + * |------+------| |------|mclic | rclic|------| .. |------| rclic| 4 |------| 6 |------+------| * + * | | |------| |------|------| lclic| .. | lclic|------|------| 2 |------| * | | * + * |------+------| |------| | mclck|------|-------------. .. .-------------|------| mclic| 1 |------| 3 |------+------| * + * | | |------| |------|------| | | | .. | | | |------|------| num. |------| / | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | 0 |------| . |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| , | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ +[_MEDIA] = KEYMAP( + RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \ + KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, 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_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \ + //left pedals + KC_BTN3, M(M_RP), KC_TRNS, \ + //right pedals + KC_BTN3, M(M_RP), KC_TRNS \ +), + +/* TRNS - skeleton for laters + * ,------. .. ,------. * + * ,------| |-------------. .. ,-------------| |------. * + * ,------| |------| | |------. .. ,------| | |------| |------. * + * | |------| |------|------| | .. | |------|------| |------| | * + * ,------+------| |------| | |------| .. |------| | |------| |------+------. * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------| .. |------| | |------| |------+------| * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------| .. |------| | |------| |------+------| * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------|-------------. .. .-------------|------| | |------| |------+------| * + * | | |------| |------|------| | | | .. | | | |------|------| |------| | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | |------| |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ + +[_TRNS] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_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, \ + //left pedals + KC_BTN3, M(M_RP), KC_TRNS, \ + //right pedals + KC_BTN3, M(M_RP), KC_TRNS \ +), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void hold_shift(void) { + shift_count = shift_count + 1; + register_code(KC_LSHIFT); +} + +void release_shift(void) { + shift_count = shift_count - 1; + if(shift_count <= 0){ + unregister_code(KC_LSHIFT); + shift_count = 0; + } +} + +void press_space(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code (KC_SPACE); + unregister_code (KC_SPACE); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +void press_enter(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code (KC_ENT); + unregister_code (KC_ENT); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +void press_underscore(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code (BP_UNDS); + unregister_code (BP_UNDS); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case M_LP: //left pedal + if (record->event.pressed) { + layer_on(1); + register_code (KC_SLCK); + key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) { + mousekey_on (KC_BTN2); + mousekey_send(); + mousekey_off (KC_BTN2); + mousekey_send(); + } + unregister_code (KC_SLCK); + layer_off(1); + } + break; + case M_RP: //right pedal + if (record->event.pressed) { + layer_on(2); + key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) { + mousekey_on (KC_BTN1); + mousekey_send(); + mousekey_off (KC_BTN1); + mousekey_send(); + } + layer_off(2); + } + break; + case M_SF: // shift, using macro to keep track of shift state and avoid inserting nbsp by mistake + if (record->event.pressed) { + hold_shift(); + } else { + release_shift(); + } + break; + case M_SFS: // shift when held, space when tapped + if (record->event.pressed) { + hold_shift(); + key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_shift) < KEY_DELAY) { + press_space(); + } + release_shift(); + } + break; + case M_SFU: // shift when held, _ when tapped + if (record->event.pressed) { + hold_shift(); + key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_shift) < KEY_DELAY) { + press_space(); + } + release_shift(); + } + break; + case M_L1E: // L1 when held, space when tapped + if (record->event.pressed) { + layer_on(1); + key_timer_1 = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_1) < KEY_DELAY) { + press_enter(); + } + layer_off(1); + } + break; + case L2INS: //activate layer 2, if released before 100ms trigger INS. basicaly equivalent to LT(2, KC_INS) but without delay for activation of layer 2 + if (record->event.pressed) { + layer_on(2); + key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_2) < KEY_DELAY) { + register_code (KC_INS); + unregister_code (KC_INS); + } + l2_locked = 0; + layer_off(2); + } + break; + case L2LOC: //lock L2 + if (record->event.pressed) { + key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. + layer_on(2); + } else { + if (timer_elapsed(key_timer_2) < KEY_DELAY && l2_locked == 0) { + l2_locked = 1; + layer_on(2); + } else { + l2_locked = 0; + layer_off(2); + } + } + break; + case M_UN: // undo + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_Z); + unregister_code(BP_Z); + unregister_code(KC_LCTL); + } + break; + case M_CUT: // cut + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_X); + unregister_code(BP_X); + unregister_code(KC_LCTL); + } + break; + case M_CP: // copy + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_C); + unregister_code(BP_C); + unregister_code(KC_LCTL); + } + break; + case M_PS: // paste + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_V); + unregister_code(BP_V); + unregister_code(KC_LCTL); + } + break; + case M_SE: // search + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_F); + unregister_code(BP_F); + unregister_code(KC_LCTL); + } + break; + } + return MACRO_NONE; +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + +} + +void matrix_init_user(void) { +} + +// Bleah globals need to be initialized. +uint8_t old_layer=_BASE; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + switch (layer) { + case _BASE: + ergodox_right_led_2_on(); + break; + case _SYMBOLS: + ergodox_right_led_1_on(); + break; + case _MEDIA: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + default: + // none + break; + } +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef FRENCHDEV_V1_CONFIG_H +#define FRENCHDEV_V1_CONFIG_H + +#include "../config.h" + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1307 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sacapuces +#define PRODUCT Frenchdev V1 +#define DESCRIPTION QMK keyboard firmware for Frenchdev + +/* key matrix size */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 6 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#define USB_MAX_POWER_CONSUMPTION 500 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +//#define DEBUG_MATRIX_SCAN_RATE + +#endif diff --git a/keyboards/frenchdev/v1/i2cmaster.h b/keyboards/frenchdev/v1/i2cmaster.h new file mode 100644 index 000000000..3917b9e6c --- /dev/null +++ b/keyboards/frenchdev/v1/i2cmaster.h @@ -0,0 +1,178 @@ +#ifndef _I2CMASTER_H +#define _I2CMASTER_H 1 +/************************************************************************* +* Title: C include file for the I2C master interface +* (i2cmaster.S or twimaster.c) +* Author: Peter Fleury http://jump.to/fleury +* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device +* Usage: see Doxygen manual +**************************************************************************/ + +#ifdef DOXYGEN +/** + @defgroup pfleury_ic2master I2C Master library + @code #include @endcode + + @brief I2C (TWI) Master Software Library + + Basic routines for communicating with I2C slave devices. This single master + implementation is limited to one bus master on the I2C bus. + + This I2c library is implemented as a compact assembler software implementation of the I2C protocol + which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). + Since the API for these two implementations is exactly the same, an application can be linked either against the + software I2C implementation or the hardware I2C implementation. + + Use 4.7k pull-up resistor on the SDA and SCL pin. + + Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module + i2cmaster.S to your target when using the software I2C implementation ! + + Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. + + @note + The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted + to GNU assembler and AVR-GCC C call interface. + Replaced the incorrect quarter period delays found in AVR300 with + half period delays. + + @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury + + @par API Usage Example + The following code shows typical usage of this library, see example test_i2cmaster.c + + @code + + #include + + + #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet + + int main(void) + { + unsigned char ret; + + i2c_init(); // initialize I2C library + + // write 0x75 to EEPROM address 5 (Byte Write) + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + i2c_write(0x05); // write address = 5 + i2c_write(0x75); // write value 0x75 to EEPROM + i2c_stop(); // set stop conditon = release bus + + + // read previously written value back from EEPROM address 5 + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + + i2c_write(0x05); // write address = 5 + i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode + + ret = i2c_readNak(); // read one byte from EEPROM + i2c_stop(); + + for(;;); + } + @endcode + +*/ +#endif /* DOXYGEN */ + +/**@{*/ + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 +#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" +#endif + +#include + +/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_READ 1 + +/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_WRITE 0 + + +/** + @brief initialize the I2C master interace. Need to be called only once + @param void + @return none + */ +extern void i2c_init(void); + + +/** + @brief Terminates the data transfer and releases the I2C bus + @param void + @return none + */ +extern void i2c_stop(void); + + +/** + @brief Issues a start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_start(unsigned char addr); + + +/** + @brief Issues a repeated start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_rep_start(unsigned char addr); + + +/** + @brief Issues a start condition and sends address and transfer direction + + If device is busy, use ack polling to wait until device ready + @param addr address and transfer direction of I2C device + @return none + */ +extern void i2c_start_wait(unsigned char addr); + + +/** + @brief Send one byte to I2C device + @param data byte to be transfered + @retval 0 write successful + @retval 1 write failed + */ +extern unsigned char i2c_write(unsigned char data); + + +/** + @brief read one byte from the I2C device, request more data from device + @return byte read from I2C device + */ +extern unsigned char i2c_readAck(void); + +/** + @brief read one byte from the I2C device, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_readNak(void); + +/** + @brief read one byte from the I2C device + + Implemented as a macro, which calls either i2c_readAck or i2c_readNak + + @param ack 1 send ack, request more data from device
+ 0 send nak, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_read(unsigned char ack); +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + + +/**@}*/ +#endif diff --git a/keyboards/frenchdev/v1/matrix.c b/keyboards/frenchdev/v1/matrix.c new file mode 100644 index 000000000..70fa6a696 --- /dev/null +++ b/keyboards/frenchdev/v1/matrix.c @@ -0,0 +1,394 @@ +/* + +Note for ErgoDox EZ customizers: Here be dragons! +This is not a file you want to be messing with. +All of the interesting stuff for you is under keymaps/ :) +Love, Erez + +Note to self, the "column" and "row" in here actually refers to the opposite on the keyboard +see definition of KEYMAP in v1.h, the grid is transposed so that a "row" in here is actually a "column" on the physical keyboard +Nicolas + +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "v1.h" +#include "i2cmaster.h" +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + debug_enable = true; + debug_matrix = true; + debug_keyboard = true; + debug_mouse = true; + + mcp23018_status = init_mcp23018(); + + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + + matrix_init_quantum(); + +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +uint8_t matrix_scan(void) +{ + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + ergodox_blink_all_leds(); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(i); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_us(1); + // this should be wait_ms(1) but has been left as-is at EZ's request + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< http://jump.to/fleury +* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device with hardware TWI +* Usage: API compatible with I2C Software Library i2cmaster.h +**************************************************************************/ +#include +#include + +#include + + +/* define CPU frequency in Mhz here if not defined in Makefile */ +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +/* I2C clock in Hz */ +#define SCL_CLOCK 400000L + + +/************************************************************************* + Initialization of the I2C bus interface. Need to be called only once +*************************************************************************/ +void i2c_init(void) +{ + /* initialize TWI clock + * minimal values in Bit Rate Register (TWBR) and minimal Prescaler + * bits in the TWI Status Register should give us maximal possible + * I2C bus speed - about 444 kHz + * + * for more details, see 20.5.2 in ATmega16/32 secification + */ + + TWSR = 0; /* no prescaler */ + TWBR = 10; /* must be >= 10 for stable operation */ + +}/* i2c_init */ + + +/************************************************************************* + Issues a start condition and sends address and transfer direction. + return 0 = device accessible, 1= failed to access device +*************************************************************************/ +unsigned char i2c_start(unsigned char address) +{ + uint8_t twst; + + // send START condition + TWCR = (1< +#include +#include "i2cmaster.h" +#include + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +extern uint8_t mcp23018_status; + +void init_ergodox(void); +void ergodox_blink_all_leds(void); +uint8_t init_mcp23018(void); +uint8_t ergodox_left_leds_update(void); + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + + +inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); } +inline void ergodox_right_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } +inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } +inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } +inline void ergodox_right_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); } + +inline void ergodox_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); } +inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } +inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } +inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } +inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); } + +inline void ergodox_led_all_on(void) +{ + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) +{ + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; } +inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; } +inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; } +inline void ergodox_right_led_set(uint8_t led, uint8_t n) { + (led == 1) ? (OCR1A = n) : + (led == 2) ? (OCR1B = n) : + (OCR1C = n); +} + +inline void ergodox_led_all_set(uint8_t n) +{ + ergodox_right_led_1_set(n); + ergodox_right_led_2_set(n); + ergodox_right_led_3_set(n); +} + +#define KEYMAP( \ + \ + k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \ + k20, k21, k22, k23, k24, k25, k26, k29, k2a, k2b, k2c, k2d, k2e, k2f, \ + k30, k31, k32, k33, k34, k35, k36, k39, k3a, k3b, k3c, k3d, k3e, k3f, \ + k40, k41, k42, k43, k44, k45, k46, k47, k37, k38, k48, k49, k4a, k4b, k4c, k4d, k4e, k4f, \ + k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5e, k5f, \ + \ + PL1, PL2, PL3, \ + PR1, PR2, PR3 \ + ) \ + \ + /* matrix positions, inverted left and right for I2C to be on row 0-7 */\ + { \ + \ + { k5f, k4f, k3f, k2f, k1f, KC_NO}, \ + { k5e, k4e, k3e, k2e, k1e, k0e }, \ + { k5d, k4d, k3d, k2d, k1d, k0d }, \ + { k5c, k4c, k3c, k2c, k1c, k0c }, \ + { k5b, k4b, k3b, k2b, k1b, k0b }, \ + { k5a, k4a, k3a, k2a, k1a, k0a }, \ + { k59, k49, k39, k29, k19, k09 }, \ + { k58, k48, k38, PR1, PR2, PR3 }, \ + \ + { k57, k47, k37, PL1, PL2, PL3 }, \ + { k56, k46, k36, k26, k16, k06 }, \ + { k55, k44, k35, k25, k15, k05 }, \ + { k54, k44, k34, k24, k14, k04 }, \ + { k53, k43, k33, k23, k13, k03 }, \ + { k52, k42, k32, k22, k12, k02 }, \ + { k51, k41, k31, k21, k11, k01 }, \ + { k50, k40, k30, k20, k10, KC_NO } \ + } + +#endif -- cgit v1.2.3 From 0fb835c54c02926ec76635741567bf63bd55dce4 Mon Sep 17 00:00:00 2001 From: npoirey Date: Thu, 22 Jun 2017 10:47:44 +0200 Subject: Fix warning in frenchdev --- keyboards/frenchdev/keymaps/default/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/frenchdev/keymaps/default/keymap.c b/keyboards/frenchdev/keymaps/default/keymap.c index e0a05cb3c..035e0179d 100644 --- a/keyboards/frenchdev/keymaps/default/keymap.c +++ b/keyboards/frenchdev/keymaps/default/keymap.c @@ -212,8 +212,8 @@ void press_enter(void) { void press_underscore(void) { if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (BP_UNDS); - unregister_code (BP_UNDS); + register_code ((unsigned char) BP_UNDS); + unregister_code ((unsigned char) BP_UNDS); if(shift_count > 0) register_code (KC_LSHIFT); } -- cgit v1.2.3 From a012c24225e2deb1269d2a9bd2e1e76b0a6a4375 Mon Sep 17 00:00:00 2001 From: npoirey Date: Thu, 22 Jun 2017 22:19:50 +0200 Subject: Removed image from git and added references to imgur album for Frenchdev keyboard. --- .../frenchdev/keymaps/default/keyboard-layout.png | Bin 138511 -> 0 bytes keyboards/frenchdev/readme.md | 9 +++++++++ 2 files changed, 9 insertions(+) delete mode 100644 keyboards/frenchdev/keymaps/default/keyboard-layout.png diff --git a/keyboards/frenchdev/keymaps/default/keyboard-layout.png b/keyboards/frenchdev/keymaps/default/keyboard-layout.png deleted file mode 100644 index 40f556f43..000000000 Binary files a/keyboards/frenchdev/keymaps/default/keyboard-layout.png and /dev/null differ diff --git a/keyboards/frenchdev/readme.md b/keyboards/frenchdev/readme.md index 34962bad5..0d79930ac 100644 --- a/keyboards/frenchdev/readme.md +++ b/keyboards/frenchdev/readme.md @@ -1,5 +1,14 @@ # My take on a splitted keyboard +default layout : +[default layout](http://i.imgur.com/r2Nvr4p.png) + +the thing when finished : +http://imgur.com/a/6FY8v + +concept and mockup: +http://imgur.com/a/R0vvs + to build : docker run --rm -e keymap=default -e subproject=v1 -e keyboard=frenchdev --rm -v D:/Repositories/qmk:/qmk:rw edasque/qmk_firmware -- cgit v1.2.3 From 98373f2fc1ee149a2fd0ac9fab74464f2cfd4b81 Mon Sep 17 00:00:00 2001 From: Stick Date: Thu, 22 Jun 2017 22:22:43 -0500 Subject: added tapdance locking --- keyboards/ergodox/keymaps/familiar/Makefile | 1 + keyboards/ergodox/keymaps/familiar/keymap.c | 109 +++++++++++++++++----------- 2 files changed, 66 insertions(+), 44 deletions(-) create mode 100644 keyboards/ergodox/keymaps/familiar/Makefile diff --git a/keyboards/ergodox/keymaps/familiar/Makefile b/keyboards/ergodox/keymaps/familiar/Makefile new file mode 100644 index 000000000..31e0fcf29 --- /dev/null +++ b/keyboards/ergodox/keymaps/familiar/Makefile @@ -0,0 +1 @@ +TAP_DANCE_ENABLE=yes diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index 714118d93..fb326b3dd 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -3,10 +3,13 @@ #include "action_layer.h" #include "version.h" +// Leader Key Timeout +//#define LEADER_TIMEOUT 300 + // Layers #define BASE 0 // default layer -#define INTL 1 // international symbols -#define INSF 2 // international symbols shifted +#define SYMB 1 // international symbols +#define CSYM 2 // international symbols shifted #define NUMP 3 // numpad #define ARRW 4 // function, media, arrow keys @@ -14,63 +17,81 @@ #define _______ KC_TRNS #define XXXXXXX KC_NO +// Tap Dancing +void dance_lock (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { // Press once for NUMLOCK + register_code (KC_NLCK); + unregister_code (KC_NLCK); + } else if (state->count == 2) { // Press twice for CAPSLOCK + register_code (KC_CAPS); + unregister_code (KC_CAPS); + } else if (state->count == 3) { //Press thrice for SCROLLLOCK + register_code (KC_SLCK); + unregister_code (KC_SLCK); + } +} +enum {LOCKS = 0}; +qk_tap_dance_action_t tap_dance_actions[] = { + [LOCKS] = ACTION_TAP_DANCE_FN(dance_lock) +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* /* layer 0 : default * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ` | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER | + * | ' | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER | * |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------| * | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTRL | LGUI | MENU | ' | LALT | |[/RALT| ] | LEFT | DOWN | RIGHT | + * | LCTRL | LGUI | MENU | LEAD | LALT | |[/RALT|]/RCTL| LEFT | DOWN | RIGHT | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. - * | VOL- | VOL+ | |PRTSCR| | + * |PRTSCR| ESC | | VOL- | VOL+ | * ,------|------|------| |------+------+------. - * | |SLASH/| MUTE | |NUMLCK|WHACK/| | - * | SPC | MO(1)|------| |------|MO(1) | SPC | - * | | | LAY3 | | LAY2 | | | + * | |SLASH/| LOCKS| | MUTE |WHACK/| | + * | SPC | MO(4)|------| |------|MO(4) | SPC | + * | | | TO(3)| |TO(1) | | | * `--------------------' `--------------------' */ [BASE] = KEYMAP( // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, - KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_QUOT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, - KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, KC_LALT, - KC_VOLD, KC_VOLU, - KC_MUTE, - KC_SPC, LT(ARRW, KC_SLSH), TG(INTL), + KC_LCTL, KC_LGUI, KC_MENU, KC_LEAD, KC_LALT, + KC_PSCR, KC_ESC, + TD(LOCKS), + KC_SPC, LT(ARRW, KC_SLSH), TG(SYMB), // right hand KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC, MT(MOD_RALT, KC_LBRC), KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, - KC_PSCR, _______, - KC_NLCK, - TG(NUMP), LT(ARRW, C_BSLS), KC_SPC + KC_VOLD, KC_VOLU, + KC_MUTE, + TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC ), /* layer 1: International symbols, etc * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ´ | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | | + * | ¬ | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | á | ß | ð | | |------| |------| | | | ø | ¶ | | + * | ´ | á | ß | ð | | |------| |------| | | | ø | ¶ | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |MO(INSF)| æ | | © | | | | | | ñ | µ | ç | | |MO(INSF)| + * |MO(CSYM)| æ | ¿ | © | | | | | | ñ | µ | ç | | |MO(CSYM)| * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | ¬ | ¿ | | « | » | | | | + * | | | | | | | « | » | | | | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -80,13 +101,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -[INTL] = KEYMAP( +[SYMB] = KEYMAP( // left hand - UC(0x00B4), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC), + UC(0x00AC), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC), _______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______, - _______, UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______, - MO(INSF), UC(0x00E6), _______, UC(0x00A9), _______, _______, _______, - _______, _______, _______, UC(0x00AC), UC(0x00BF), + UC(0x00B4), UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______, + MO(CSYM), UC(0x00E6), UC(0x00BF), UC(0x00A9), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -94,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______, _______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______, _______, _______, _______, UC(0x00F8), UC(0x00B6), _______, - _______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(INSF), + _______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(CSYM), UC(0x00AB), UC(0x00BB), _______, _______, _______, _______, _______, _______, @@ -106,11 +127,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * which don't produce an "upper case" or "shifted" international symobol. * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ¨ | ¹ | | | £ | | | | | | | | — | ÷ | | + * | | ¹ | | | £ | | | | | | | | — | ÷ | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Á | § | Ð | | |------| |------| | | | Ø | ° | | + * | ¨ | Á | § | Ð | | |------| |------| | | | Ø | ° | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | Æ | | ¢ | | | | | | Ñ | | Ç | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -124,11 +145,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -[INSF] = KEYMAP( +[CSYM] = KEYMAP( // left hand - UC(0x00A8), UC(0x00B9), _______, _______, UC(0x00A3), _______, _______, - _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), _______, UC(0x00DE), _______, - _______, UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G), + _______, UC(0x00B9), _______, _______, UC(0x00A3), _______, _______, + _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), S(KC_R), UC(0x00DE), _______, + UC(0x00A8), UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G), _______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______, _______, _______, _______, UC(0x00A6), _______, _______, _______, @@ -191,20 +212,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * This layer is at the top so that the functions still work no matter what layers are active. * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | SYSREQ | + * | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | UP | | | | | | | | | | | INSERT | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |CAPSLOCK| | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | | + * | | | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | HOME | PGDN | END | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. - * | | PAUSE| |SYSREQ| | + * | PAUSE|SYSREQ| | | | * ,------|------|------| |------+------+------. - * | | | | |SCRLK | | | + * | | | | | | | | * | | |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' @@ -213,10 +234,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, KC_UP, _______, _______, _______, - KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_PAUSE, + KC_PAUSE, _______, _______, _______, _______, _______, // right hand @@ -225,8 +246,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, - KC_SYSREQ, _______, - KC_SLCK, + _______, _______, + _______, _______, _______, _______ ), }; @@ -249,8 +270,8 @@ void matrix_scan_user(void) { ergodox_right_led_2_off(); ergodox_right_led_3_off(); switch (layer) { - case INTL: - case INSF: + case SYMB: + case CSYM: ergodox_right_led_1_on(); break; case NUMP: -- cgit v1.2.3 From 67b8bf8f70303741027575428a53513c6610d22c Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Sat, 17 Jun 2017 19:29:47 +0200 Subject: Move Phantom LED handling to phantom.c This is more in line with the structure provided by the keyboard template. --- keyboards/phantom/led.c | 43 ----------------------------- keyboards/phantom/phantom.c | 66 ++++++++++++++++++++++++++++++++++++++++----- keyboards/phantom/rules.mk | 4 --- 3 files changed, 60 insertions(+), 53 deletions(-) delete mode 100644 keyboards/phantom/led.c diff --git a/keyboards/phantom/led.c b/keyboards/phantom/led.c deleted file mode 100644 index 69dba7d40..000000000 --- a/keyboards/phantom/led.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include "stdint.h" -#include "led.h" - -void led_init_ports(void) { - // * Set our LED pins as output - DDRB |= (1<<6); - DDRB |= (1<<7); -} - -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "phantom.h" -#include "led.h" void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -}; + // put your keyboard start-up code here + // runs once when the firmware starts up + led_init_ports(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_init_ports(void) { + DDRB |= (1<<6) | (1<<7); // OUT +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION ROW2COL +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Underlight configuration + */ +#define RGB_DI_PIN E2 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -55,19 +68,79 @@ along with this program. If not, see . /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* Underlight configuration - */ -#define RGB_DI_PIN E2 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z /* * Feature disable options @@ -87,4 +160,27 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + #endif diff --git a/keyboards/phantom/rules.mk b/keyboards/phantom/rules.mk index cb3274d73..23b42cf98 100644 --- a/keyboards/phantom/rules.mk +++ b/keyboards/phantom/rules.mk @@ -49,17 +49,21 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# comment out to disable the options. +# change yes to no to disable # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches -- cgit v1.2.3 From 7ca335cf5b86e7d59de5daabeb75bea43d8f0ced Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Sat, 17 Jun 2017 19:56:49 +0200 Subject: Adjust Phantom for standard PCB The previous default configuration and keymap was made for a Phantom modified with RGB underlight. This commit makes the default more in line with the "official" configurations provided by the PCB. The previous default have been moved to a separate keymap named `rgbmod`. It has also been updated to better match the template keymap. --- keyboards/phantom/config.h | 6 +- keyboards/phantom/keymaps/default/Makefile | 37 +++++++ keyboards/phantom/keymaps/default/config.h | 24 +++++ keyboards/phantom/keymaps/default/keymap.c | 145 ++++++++++++---------------- keyboards/phantom/keymaps/default/readme.md | 45 +++++++++ keyboards/phantom/keymaps/rgbmod/Makefile | 37 +++++++ keyboards/phantom/keymaps/rgbmod/config.h | 24 +++++ keyboards/phantom/keymaps/rgbmod/keymap.c | 77 +++++++++++++++ keyboards/phantom/phantom.h | 129 +++++++++++++++++++------ keyboards/phantom/rules.mk | 2 +- 10 files changed, 405 insertions(+), 121 deletions(-) create mode 100644 keyboards/phantom/keymaps/default/Makefile create mode 100644 keyboards/phantom/keymaps/default/config.h create mode 100644 keyboards/phantom/keymaps/default/readme.md create mode 100644 keyboards/phantom/keymaps/rgbmod/Makefile create mode 100644 keyboards/phantom/keymaps/rgbmod/config.h create mode 100644 keyboards/phantom/keymaps/rgbmod/keymap.c diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index e073cd8dc..5b7fa62ff 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -24,9 +24,9 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0003 -#define MANUFACTURER PHANTOM -#define PRODUCT PHANTOM RGB MOD -#define DESCRIPTION QMK keyboard firmware for PHANTOM TKL +#define MANUFACTURER bpiphany +#define PRODUCT PHANTOM +#define DESCRIPTION QMK keyboard firmware for PHANTOM /* key matrix size */ #define MATRIX_ROWS 6 diff --git a/keyboards/phantom/keymaps/default/Makefile b/keyboards/phantom/keymaps/default/Makefile new file mode 100644 index 000000000..555ac79fa --- /dev/null +++ b/keyboards/phantom/keymaps/default/Makefile @@ -0,0 +1,37 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# QMK Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/phantom/keymaps/default/config.h b/keyboards/phantom/keymaps/default/config.h new file mode 100644 index 000000000..a3828f7d5 --- /dev/null +++ b/keyboards/phantom/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c index a4fc319ac..1568d0a14 100644 --- a/keyboards/phantom/keymaps/default/keymap.c +++ b/keyboards/phantom/keymaps/default/keymap.c @@ -1,7 +1,22 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "phantom.h" -// Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +// Helpful defines +#define _______ KC_TRNS // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -11,92 +26,52 @@ #define _FL 1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |_FL |CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ -[_BL] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DELETE, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _FL: Function Layer - * ,-----------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| |--------------| - * | | | | | | | | | | | | | | Reset | | | | | - * |-----------------------------------------------------------| |--------------| - * | | | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| `--------------' - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------| ,----. - * | | F1| F2| F3| F4| F5|F6 |F7 |F8 | | | | | | - * |-----------------------------------------------------------| ,-------------. - * | | | | | | | | | | | | | - * `-----------------------------------------------------------' `-------------' - */ -[_FL] = KEYMAP( - #ifdef RGBLIGHT_ENABLE - 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, RESET, 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_UP, KC_TRNS, \ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - #else - 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, RESET, 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_UP, 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), - #endif + [_BL] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSEL, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), }; -enum function_id { - SHIFT_ESC, +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/phantom/keymaps/default/readme.md b/keyboards/phantom/keymaps/default/readme.md new file mode 100644 index 000000000..f58f4f0f3 --- /dev/null +++ b/keyboards/phantom/keymaps/default/readme.md @@ -0,0 +1,45 @@ +# Keymap for a standard winkey ANSI configuration of the Phantom + +A basic keymap intended for a Phantom using the standard ANSI layout. + +See [keymap.c](keymap.c) for details. + +## Layers + +The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. + +### Layer 1: Default Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Function Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | |Stp|Ply|Prv|Nxt| |Mut|Vo-|Vo+| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | Media | + |-----------------------------------------------------------| ,---. + | | | |Cal| | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' + +## Building + +To build the firmware with the default keymap, run `make default`. diff --git a/keyboards/phantom/keymaps/rgbmod/Makefile b/keyboards/phantom/keymaps/rgbmod/Makefile new file mode 100644 index 000000000..38c23a1b8 --- /dev/null +++ b/keyboards/phantom/keymaps/rgbmod/Makefile @@ -0,0 +1,37 @@ +# Copyright 2013 Jun Wako +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# QMK Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/phantom/keymaps/rgbmod/config.h b/keyboards/phantom/keymaps/rgbmod/config.h new file mode 100644 index 000000000..a3828f7d5 --- /dev/null +++ b/keyboards/phantom/keymaps/rgbmod/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/phantom/keymaps/rgbmod/keymap.c b/keyboards/phantom/keymaps/rgbmod/keymap.c new file mode 100644 index 000000000..baef27a26 --- /dev/null +++ b/keyboards/phantom/keymaps/rgbmod/keymap.c @@ -0,0 +1,77 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "phantom.h" + +// Helpful defines +#define _______ KC_TRNS + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/phantom/phantom.h b/keyboards/phantom/phantom.h index 420826bec..784fca21f 100644 --- a/keyboards/phantom/phantom.h +++ b/keyboards/phantom/phantom.h @@ -1,40 +1,105 @@ +/* Copyright 2017 Mathias Andersson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #ifndef PHANTOM_H #define PHANTOM_H #include "quantum.h" -/* Phantom matrix layout - * ,-----------------------------------------------------------------------------. - * |00 |02| 03| 04| 05| | 06| 07| 08| 09| | 0a|0b |0c |0d | |0e |0f |0g | - * |-----------------------------------------------------------| |--------------| - * | 01| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1d | |1e |1f |1g | - * |-----------------------------------------------------------| |--------------| - * |20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c| 2d| | 2e | 2f | 2g | - * |-----------------------------------------------------------| `--------------' - * |30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | - * |-----------------------------------------------------------| ,----. - * | 40 | 42| 43| 44| 45| 46| 47| 48| 49| 4a| 4b| 4d | | 4f | - * |-----------------------------------------------------------| ,-------------. - * | 50 | 51 | 52 | 57 |5a | 5b | 5c | 5d | | 5e| 5f | 5g | - * `-----------------------------------------------------------' `-------------' - */ -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array -#define KEYMAP( \ - k00, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ - k01, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1d, k1e, k1f, k1g, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ - k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4d, k4f, \ - k50, k51, k52, k57, k5a, k5b, k5c, k5d, k5e, k5f, k5g \ -) \ -{ \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1d, k1d, k1e, k1f, k1g}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3d, k3d, k3d, k3d}, \ - {k40, k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4d, k4d, k4f, k4f, k4f}, \ - {k50, k51, k52, k57, k57, k57, k57, k57, k57, k57, k5a, k5b, k5c, k5d, k5e, k5f, k5g} \ +// Keymap utilizing all the possible keys on the PCB. +#define KEYMAP_7BIT( \ + K00, K53, K02, K03, K04, K05, K56, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K4G, \ + K50, K51, K52, K54, K55, K57, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F G */ \ +/* 0 */ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G }, \ +/* 1 */ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ +/* 2 */ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ +/* 3 */ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G }, \ +/* 4 */ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K4G }, \ +/* 5 */ { K50, K51, K52, K53, K54, K55, K56, K57, K58, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ } + +// Keymap for a standard ANSI layout. +#define KEYMAP( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4F, \ + K50, K51, K52, K57, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) KEYMAP_7BIT( \ + K00, KC_NO, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO, KC_NO, KC_NO, \ + K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, KC_NO, K4D, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) + +#define KEYMAP_WINKEYLESS( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4F, \ + K50, K51, K52, K57, K5B, K5C, K5D, K5E, K5F, K5G \ +) KEYMAP_7BIT( \ + K00, KC_NO, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO, KC_NO, KC_NO, \ + K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, KC_NO, K4D, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, KC_NO, K5B, K5C, K5D, K5E, K5F, K5G \ +) + +#define KEYMAP_ISO( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4F, \ + K50, K51, K52, K57, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) KEYMAP_7BIT( \ + K00, KC_NO, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO, KC_NO, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, KC_NO, K4D, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) + +#define KEYMAP_ISO_WINKEYLESS( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4F, \ + K50, K51, K52, K57, K5B, K5C, K5D, K5E, K5F, K5G \ +) KEYMAP_7BIT( \ + K00, KC_NO, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO, KC_NO, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, KC_NO, K4D, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, KC_NO, K5B, K5C, K5D, K5E, K5F, K5G \ +) + #endif diff --git a/keyboards/phantom/rules.mk b/keyboards/phantom/rules.mk index 23b42cf98..c07593961 100644 --- a/keyboards/phantom/rules.mk +++ b/keyboards/phantom/rules.mk @@ -61,7 +61,7 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE ?= yes # USB Nkey Rollover BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -- cgit v1.2.3 From dd9b00543b4fd08d851d91bd917615fc8fc0911e Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Sat, 17 Jun 2017 20:03:58 +0200 Subject: Update Phantom readme Added basic description of the keyboard and some build and configuration instructions. Also moved the RGB underlight modification instructions to the readme. --- keyboards/phantom/pinout.txt | 1 - keyboards/phantom/readme.md | 48 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) delete mode 100644 keyboards/phantom/pinout.txt diff --git a/keyboards/phantom/pinout.txt b/keyboards/phantom/pinout.txt deleted file mode 100644 index 415ad46d9..000000000 --- a/keyboards/phantom/pinout.txt +++ /dev/null @@ -1 +0,0 @@ -For WS2812B LED strip support, connect DIN from strip to PE2 on Teensy (see reference image https://i.imgur.com/aDfNoHT.jpg) \ No newline at end of file diff --git a/keyboards/phantom/readme.md b/keyboards/phantom/readme.md index 190f738fa..614c21fda 100644 --- a/keyboards/phantom/readme.md +++ b/keyboards/phantom/readme.md @@ -1,4 +1,48 @@ Phantom keyboard firmware -====================== +========================= -TODO: to be updated. +A community-developed keyboard PCB designed to fit inside the case of a Filco Majestouch. + +See the [Deskthority wiki](https://deskthority.net/wiki/Phantom) for more information. + +## Bootloader + +The Phantom uses a [Teensy 2.0](https://www.pjrc.com/store/teensy.html) as a controller. + +The Teensy has a special bootloader that can be accessed by pressing the button on the Teensy PCB. It is also possible to use Boot Magic and Command to access the bootloader. + +To write the firmware to the Teensy use [Teensy loader](https://www.pjrc.com/teensy/loader.html). + +## Quantum MK Firmware + +For the full Quantum feature list, see the [documentation](https://docs.qmk.fm). + +## RGB underlight + +It is possible to connect a WS2812B LED strip to the Teensy for RGB underlight support. + +For this to work the DIN connection on the WS2812B strip should be soldered to PE2 on the Teensy (see reference image https://i.imgur.com/aDfNoHT.jpg). + +See [rgbmod](keymaps/rgbmod) for a keymap that utilizes the RGB underlight feature. + +## Building + +The Phantom allows for a huge amount of different layouts. + +Depending on which layout and keymap you would like to use, you will have to compile the firmware slightly differently. All of the commands should be run in the [keyboards/phantom](/keyboards/phantom) folder. + +### Custom keymaps + +To define your own keymap, copy one of the [existing keymap](keymaps) folders and give it the name of your keymap. Then check the [keymap documentation](https://docs.qmk.fm/Keymap.html) for details on how to modify the keymap. + +To make it easy to define keymaps for the most common layouts a few macros are provided. + +| Layout | Macro | +| --------------- | ------------------------- | +| Winkey ANSI | `KEYMAP()` | +| Winkeyless ANSI | `KEYMAP_WINKEYLESS()` | +| Winkey ISO | `KEYMAP_ISO()` | +| Winkeyless ISO | `KEYMAP_ISO_WINKEYLESS()` | +| 7BIT | `KEYMAP_7BIT()` | + +To build the firmware with a custom keymap, run `make ` -- cgit v1.2.3 From 7389beb18c557403939e60ae36b0a51b481d80a9 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 9 Jun 2017 15:01:01 -0700 Subject: Small keymap layout updates --- keyboards/ergodox/keymaps/333fred/README.md | 14 +++++++----- keyboards/ergodox/keymaps/333fred/config.h | 9 ++++++++ keyboards/ergodox/keymaps/333fred/keymap.c | 34 +++++++++++++++++++---------- 3 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 keyboards/ergodox/keymaps/333fred/config.h diff --git a/keyboards/ergodox/keymaps/333fred/README.md b/keyboards/ergodox/keymaps/333fred/README.md index af8042d85..d3f591361 100644 --- a/keyboards/ergodox/keymaps/333fred/README.md +++ b/keyboards/ergodox/keymaps/333fred/README.md @@ -38,7 +38,7 @@ | | | | | | | | | | | | `----------------------------------' `----------------------------------' ,-------------. ,---------------. - |Format| | | Test | DTest | + |Format|Build | | Test | DTest | ,------|------|------| |------+--------+------. | | |Refact| | | | | | | |------| |------| | | @@ -49,6 +49,7 @@ * Refact - Visual Studio Refactor. Sends `CTRL + R, R` * Test - Visual Studio Run Test. Sends `CTRL + R, T` * DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T` +* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` ### Keymap 2: Symbol Layer ``` @@ -100,11 +101,11 @@ ,--------------------------------------------------. ,--------------------------------------------------. | | | | | | | | | | | | | | | | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | +| |KOpen |KType | | | | | | | | | | | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | |DLeft |DRight|LShift| | |------| |------| Left | Down | Up | Right| | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |KOpen |KType | | | | | | | | | | | | | +| |SFT_TB| Tab | | | | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | | | | | | | | | | | | `----------------------------------' `----------------------------------' @@ -116,7 +117,8 @@ | | | | | | | | `--------------------' `--------------------' ``` -* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow` +* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow` * DRight - Move to the right Desktop. Sends `Ctrl + Win + Right Arrow` -* KOpen - Opens KeePass. Sends `Ctrl + Alt + k` -* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a` +* KOpen - Opens KeePass. Sends `Ctrl + Alt + k` +* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a` +* SFT_TB - Sends `CTRL + TAB`. diff --git a/keyboards/ergodox/keymaps/333fred/config.h b/keyboards/ergodox/keymaps/333fred/config.h new file mode 100644 index 000000000..32d190de7 --- /dev/null +++ b/keyboards/ergodox/keymaps/333fred/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_H_ +#define CONFIG_H_ + +#include "../../config.h" + +#undef TAPPING_TERM +#define TAPPING_TERM 150 + +#endif diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c index 070ad1f72..893ba12ea 100644 --- a/keyboards/ergodox/keymaps/333fred/keymap.c +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -23,12 +23,14 @@ enum custom_macros { DLEFT, DRIGHT, PSCREEN_APP, + LSFT_TAB, // VS Macros REFACTOR, TEST, DEBUG_TEST, FORMAT, + BUILD, // KeePass macros KEEPASS_OPEN, @@ -104,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. - * |Format| | | Test | DTest | + * |Format|Build | | Test | DTest | * ,------|------|------| |------+--------+------. * | | |Refact| | | | | * | | |------| |------| | | @@ -120,9 +122,9 @@ 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - M(FORMAT), KC_TRNS, - M(REFACTOR), - KC_TRNS, KC_TRNS, KC_TRNS, + M(FORMAT),M(BUILD), + M(REFACTOR), + KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -222,11 +224,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | + * | |KOpen |KType | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |DLeft |DRight|LShift|ACCESS| |------| |------| Left | Down | Up | Right| | | + * | |DLeft |DRight|LCTRL |ACCESS| |------| |------| Left | Down | Up | Right| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |KOpen |KType | | | | | | | | | | | | | + * | |SFT_TB| TAB | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' @@ -234,20 +236,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * ,------|------|------| |------+------+------. * | | | | | | | | - * | | CTRL |------| |------| | | + * | |LSHIFT|------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ // MEDIA AND MOUSE [MOVE] = KEYMAP( 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, M(DLEFT), M(DRIGHT), KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_TRNS, KC_TRNS, + KC_TRNS, M(LSFT_TAB), KC_TAB, 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_LCTRL,KC_TRNS, + KC_TRNS, KC_LSFT, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -291,9 +293,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case PSCREEN_APP: if (record->event.pressed) { - return MACRO(D(LALT), T(PSCR), U(LALT)); + return MACRO(D(LALT), T(PSCR), U(LALT), END); } break; + case LSFT_TAB: + if (record->event.pressed) { + return MACRO(D(LSFT), T(TAB), U(LSFT), END); + } case REFACTOR: if (record->event.pressed) { // VS Refactor CTRL+R, R return MACRO(D(LCTL), T(R), U(LCTL), T(R), END); @@ -314,6 +320,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO(D(LCTL), T(K), T(D), U(LCTL), END); } break; + case BUILD: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END); + } case KEEPASS_OPEN: if (record->event.pressed) { // Keepass open application return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END); -- cgit v1.2.3 From a2fbd671ad6edde77fe8f3c1a05c73c6b7056f00 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 15 Jun 2017 13:49:16 -0700 Subject: Added a few more VS macros and another ctrl --- keyboards/ergodox/keymaps/333fred/keymap.c | 41 ++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c index 893ba12ea..c4f28feb0 100644 --- a/keyboards/ergodox/keymaps/333fred/keymap.c +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -31,6 +31,9 @@ enum custom_macros { DEBUG_TEST, FORMAT, BUILD, + GO_TO_IMPL, + FIND_ALL_REF, + REMOVE_SORT_USINGS, // KeePass macros KEEPASS_OPEN, @@ -67,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,------|------|------| |------+--------+------. * | | | PgUp | | PgDn | | | * | Bcksp|OSL(2)|------| |------| Ent |Space | - * | | | Del | |OSL(2)| | | + * | | | Del | | RCtrl| | | * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. @@ -88,9 +91,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_J, KC_K, KC_L, TD(TD_SEMICOLON_COLON),KC_QUOT, MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, - KC_RALT, CTL_T(KC_ESC), + KC_RALT, CTL_T(KC_ESC), KC_PGDN, - OSL(SYMB),KC_ENT, KC_SPC + KC_RCTL, KC_ENT, KC_SPC ), /* Keymap 1: Code Layer * @@ -103,12 +106,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | + * | | | | | | | F12 |GoToIm| FAR | | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. * |Format|Build | | Test | DTest | * ,------|------|------| |------+--------+------. - * | | |Refact| | | | | + * | | |Refact| |Sort U| | | * | | |------| |------| | | * | | | | | | | | * `--------------------' `----------------------' @@ -127,13 +130,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F11, 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_F11, 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_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS, M(TEST), M(DEBUG_TEST), - KC_TRNS, + M(REMOVE_SORT_USINGS), KC_TRNS, KC_TRNS, KC_TRNS ), /* Keymap 2: Symbol Layer @@ -324,6 +327,22 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END); } + break; + case GO_TO_IMPL: + if (record->event.pressed) { + return MACRO(D(LCTL), T(F12), U(LCTL), END); + } + break; + case FIND_ALL_REF: + if (record->event.pressed) { + return MACRO(D(LCTL), T(K), U(LCTL), T(R), END); + } + break; + case REMOVE_SORT_USINGS: + if (record->event.pressed) { + return MACRO(D(LCTL), T(R), T(G), U(LCTL), END); + } + break; case KEEPASS_OPEN: if (record->event.pressed) { // Keepass open application return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END); -- cgit v1.2.3 From 946f4854c5e219ceec39103bdec1502293e4d79c Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 15 Jun 2017 16:41:21 -0700 Subject: Added backlight control keys --- keyboards/ergodox/keymaps/333fred/Makefile | 1 - keyboards/ergodox/keymaps/333fred/keymap.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/keyboards/ergodox/keymaps/333fred/Makefile b/keyboards/ergodox/keymaps/333fred/Makefile index b977722a2..17f736458 100644 --- a/keyboards/ergodox/keymaps/333fred/Makefile +++ b/keyboards/ergodox/keymaps/333fred/Makefile @@ -2,7 +2,6 @@ SUBPROJECT_DEFAULT = infinity LCD_BACKLIGHT_ENABLE = yes LCD_ENABLE = yes BACKLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes NKRO_ENABLE = yes TAP_DANCE_ENABLE = yes diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c index c4f28feb0..ce30a22b9 100644 --- a/keyboards/ergodox/keymaps/333fred/keymap.c +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -195,9 +195,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | Lclk | Rclk | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | | | Vol+ | | + * | Back+| Back-| | Vol+ | | * ,------|------|------| |------+------+------. - * | | | | | Vol- | | | + * | | |BackTg| | Vol- | | | * | | |------| |------| PL/PS| Next | * | | | | | Back | | | * `--------------------' `--------------------' @@ -209,8 +209,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, + BL_INC, BL_DEC, + BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3 From 2b26abf9a90a562438126c7933fe00221b7ce67c Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 23 Jun 2017 11:24:55 -0700 Subject: Copy/paste additions. --- keyboards/ergodox/keymaps/333fred/config.h | 2 ++ keyboards/ergodox/keymaps/333fred/keymap.c | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/keyboards/ergodox/keymaps/333fred/config.h b/keyboards/ergodox/keymaps/333fred/config.h index 32d190de7..f19a52bca 100644 --- a/keyboards/ergodox/keymaps/333fred/config.h +++ b/keyboards/ergodox/keymaps/333fred/config.h @@ -6,4 +6,6 @@ #undef TAPPING_TERM #define TAPPING_TERM 150 +#define PERMISSIVE_HOLD + #endif diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c index ce30a22b9..fdbfddd0c 100644 --- a/keyboards/ergodox/keymaps/333fred/keymap.c +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Home | End | | Alt |Ctrl/Esc| + * | Copy | Paste| | Alt |Ctrl/Esc| * ,------|------|------| |------+--------+------. * | | | PgUp | | PgDn | | | * | Bcksp|OSL(2)|------| |------| Ent |Space | @@ -80,16 +80,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), KC_ESC, KC_A, KC_S, KC_D, LT(MOVE, KC_F),KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE), - KC_LCTRL, KC_F4, KC_F5, KC_LGUI,KC_LALT, - KC_HOME, KC_END, - KC_PGUP, - KC_BSPC,OSL(SYMB),KC_DEL, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE), + OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT, + LCTL(KC_C),LCTL(KC_V), + KC_PGUP, + KC_BSPC,OSL(SYMB), KC_DEL, // right hand TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, TD(TD_SEMICOLON_COLON),KC_QUOT, - MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, KC_RALT, CTL_T(KC_ESC), KC_PGDN, @@ -227,7 +227,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |KOpen |KType | | | | | | | | | | | | | + * | |KOpen |KType | | | | | | | Copy | | | | Paste| | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |DLeft |DRight|LCTRL |ACCESS| |------| |------| Left | Down | Up | Right| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -236,7 +236,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | | | | | + * | | | | Home | End | * ,------|------|------| |------+------+------. * | | | | | | | | * | |LSHIFT|------| |------| | | @@ -254,12 +254,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,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, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,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_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -- cgit v1.2.3 From 67944953369b3430d44bbb400220529586b947f7 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 23 Jun 2017 11:36:14 -0700 Subject: Doc updates --- keyboards/ergodox/keymaps/333fred/README.md | 28 ++++++++++++++++------------ keyboards/ergodox/keymaps/333fred/keymap.c | 12 ++++++------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/keyboards/ergodox/keymaps/333fred/README.md b/keyboards/ergodox/keymaps/333fred/README.md index d3f591361..f7b4ca42f 100644 --- a/keyboards/ergodox/keymaps/333fred/README.md +++ b/keyboards/ergodox/keymaps/333fred/README.md @@ -14,7 +14,7 @@ |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | `----------------------------------' `----------------------------------' ,-------------. ,-------------. - | Home | End | | Alt |Ctrl/Esc| + | Copy | Paste| | Alt |Ctrl/Esc| ,------|------|------| |------+--------+------. | | | PgUp | | PgDn | | | | Bcksp|OSL(2)|------| |------| Ent |Space | @@ -32,24 +32,28 @@ | | | | | | | F10 | | F11 | | | | | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | | | | | | |------| |------| | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +|--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------| | | | | | | | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | + | | | | | | | F12 |GoToIm| FAR | | | `----------------------------------' `----------------------------------' ,-------------. ,---------------. |Format|Build | | Test | DTest | ,------|------|------| |------+--------+------. - | | |Refact| | | | | + | | |Refact| |Sort U| | | | | |------| |------| | | | | | | | | | | `--------------------' `----------------------' ``` +* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` +* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T` +* FAR - Visual Studio Find All References. Sends `CTRL + K, R` * Format - Visual Studio Format. Sends `CTRL + K, CTRL + D` +* GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12` * Refact - Visual Studio Refactor. Sends `CTRL + R, R` +* Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G` * Test - Visual Studio Run Test. Sends `CTRL + R, T` -* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T` -* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` + ### Keymap 2: Symbol Layer ``` @@ -88,9 +92,9 @@ | | | | Lclk | Rclk | | | | | | | `----------------------------------' `----------------------------------' ,-------------. ,-------------. - | | | | Vol+ | | + | Back+| Back-| | Vol+ | | ,------|------|------| |------+------+------. - | | | | | Vol- | | | + | | |BL_TOG| | Vol- | | | | | |------| |------| PL/PS| Next | | | | | | Back | | | `--------------------' `--------------------' @@ -101,19 +105,19 @@ ,--------------------------------------------------. ,--------------------------------------------------. | | | | | | | | | | | | | | | | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| |KOpen |KType | | | | | | | | | | | | | +| |KOpen |KType | | | | | | | Copy | | | | Paste| | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |DLeft |DRight|LShift| | |------| |------| Left | Down | Up | Right| | | +| |DLeft |DRight| LCTL | | |------| |------| Left | Down | Up | Right| | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | |SFT_TB| Tab | | | | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | | | | | | | | | | | | `----------------------------------' `----------------------------------' ,-------------. ,-------------. - | | | | | | + | | | | Home | End | ,------|------|------| |------+------+------. | | | | | | | | - | | CTRL |------| |------| | | + | | LSFT |------| |------| | | | | | | | | | | `--------------------' `--------------------' ``` diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c index fdbfddd0c..e3f95132d 100644 --- a/keyboards/ergodox/keymaps/333fred/keymap.c +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | F10 | | F11 | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | F12 |GoToIm| FAR | | | @@ -123,7 +123,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, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, 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, TG(SYMB), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(FORMAT),M(BUILD), M(REFACTOR), @@ -147,7 +147,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | ! | @ | ( | ) | | |ACCESS| |ACCESS| Up | 7 | 8 | 9 | * | F12 | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |---------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | EPRM | | | | | | 0 | 0 | . | = | | @@ -324,17 +324,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } break; case BUILD: - if (record->event.pressed) { + if (record->event.pressed) { // VS Build. Sends CTRL+SHFT+B return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END); } break; case GO_TO_IMPL: - if (record->event.pressed) { + if (record->event.pressed) { // VS Go To Implementation. Sends CTRL+F12 return MACRO(D(LCTL), T(F12), U(LCTL), END); } break; case FIND_ALL_REF: - if (record->event.pressed) { + if (record->event.pressed) { // VS Find All References. Sends CTRL+K, R return MACRO(D(LCTL), T(K), U(LCTL), T(R), END); } break; -- cgit v1.2.3 From de80e2c756508fbd14562ece23b0cbdfbb959e1f Mon Sep 17 00:00:00 2001 From: npoirey Date: Fri, 23 Jun 2017 21:25:46 +0200 Subject: Moved frenchdev to handwired --- keyboards/frenchdev/Makefile | 5 - keyboards/frenchdev/config.h | 34 -- keyboards/frenchdev/frenchdev.c | 4 - keyboards/frenchdev/frenchdev.h | 7 - keyboards/frenchdev/keymaps/default/keymap.c | 409 --------------------- keyboards/frenchdev/readme.md | 62 ---- keyboards/frenchdev/rules.mk | 79 ---- keyboards/frenchdev/v1/Makefile | 8 - keyboards/frenchdev/v1/config.h | 68 ---- keyboards/frenchdev/v1/i2cmaster.h | 178 --------- keyboards/frenchdev/v1/matrix.c | 394 -------------------- keyboards/frenchdev/v1/rules.mk | 80 ---- keyboards/frenchdev/v1/twimaster.c | 208 ----------- keyboards/frenchdev/v1/v1.c | 86 ----- keyboards/frenchdev/v1/v1.h | 116 ------ keyboards/handwired/frenchdev/Makefile | 3 + keyboards/handwired/frenchdev/config.h | 85 +++++ keyboards/handwired/frenchdev/frenchdev.c | 86 +++++ keyboards/handwired/frenchdev/frenchdev.h | 116 ++++++ keyboards/handwired/frenchdev/i2cmaster.h | 178 +++++++++ .../handwired/frenchdev/keymaps/default/keymap.c | 409 +++++++++++++++++++++ .../handwired/frenchdev/keymaps/default/readme.md | 13 + keyboards/handwired/frenchdev/matrix.c | 394 ++++++++++++++++++++ keyboards/handwired/frenchdev/readme.md | 64 ++++ keyboards/handwired/frenchdev/rules.mk | 92 +++++ keyboards/handwired/frenchdev/twimaster.c | 208 +++++++++++ 26 files changed, 1648 insertions(+), 1738 deletions(-) delete mode 100644 keyboards/frenchdev/Makefile delete mode 100644 keyboards/frenchdev/config.h delete mode 100644 keyboards/frenchdev/frenchdev.c delete mode 100644 keyboards/frenchdev/frenchdev.h delete mode 100644 keyboards/frenchdev/keymaps/default/keymap.c delete mode 100644 keyboards/frenchdev/readme.md delete mode 100644 keyboards/frenchdev/rules.mk delete mode 100644 keyboards/frenchdev/v1/Makefile delete mode 100644 keyboards/frenchdev/v1/config.h delete mode 100644 keyboards/frenchdev/v1/i2cmaster.h delete mode 100644 keyboards/frenchdev/v1/matrix.c delete mode 100644 keyboards/frenchdev/v1/rules.mk delete mode 100644 keyboards/frenchdev/v1/twimaster.c delete mode 100644 keyboards/frenchdev/v1/v1.c delete mode 100644 keyboards/frenchdev/v1/v1.h create mode 100644 keyboards/handwired/frenchdev/Makefile create mode 100644 keyboards/handwired/frenchdev/config.h create mode 100644 keyboards/handwired/frenchdev/frenchdev.c create mode 100644 keyboards/handwired/frenchdev/frenchdev.h create mode 100644 keyboards/handwired/frenchdev/i2cmaster.h create mode 100644 keyboards/handwired/frenchdev/keymaps/default/keymap.c create mode 100644 keyboards/handwired/frenchdev/keymaps/default/readme.md create mode 100644 keyboards/handwired/frenchdev/matrix.c create mode 100644 keyboards/handwired/frenchdev/readme.md create mode 100644 keyboards/handwired/frenchdev/rules.mk create mode 100644 keyboards/handwired/frenchdev/twimaster.c diff --git a/keyboards/frenchdev/Makefile b/keyboards/frenchdev/Makefile deleted file mode 100644 index 73a289f1d..000000000 --- a/keyboards/frenchdev/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -SUBPROJECT_DEFAULT = v1 - -ifndef MAKEFILE_INCLUDED - include ../../Makefile -endif diff --git a/keyboards/frenchdev/config.h b/keyboards/frenchdev/config.h deleted file mode 100644 index f535010ef..000000000 --- a/keyboards/frenchdev/config.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef KEYBOARDS_ERGODOX_CONFIG_H_ -#define KEYBOARDS_ERGODOX_CONFIG_H_ - -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 5 -#define MOUSEKEY_MAX_SPEED 2 -#define MOUSEKEY_WHEEL_DELAY 0 - -#define TAPPING_TOGGLE 1 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ -) - -#ifdef SUBPROJECT_v1 - #include "v1/config.h" -#endif - - -#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ diff --git a/keyboards/frenchdev/frenchdev.c b/keyboards/frenchdev/frenchdev.c deleted file mode 100644 index ecc102169..000000000 --- a/keyboards/frenchdev/frenchdev.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "frenchdev.h" -#include "debug.h" -#include "action_layer.h" - diff --git a/keyboards/frenchdev/frenchdev.h b/keyboards/frenchdev/frenchdev.h deleted file mode 100644 index 60afda21d..000000000 --- a/keyboards/frenchdev/frenchdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef KEYBOARDS_ERGODOX_ERGODOX_H_ -#define KEYBOARDS_ERGODOX_ERGODOX_H_ -#ifdef SUBPROJECT_v1 - #include "v1.h" -#endif - -#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */ diff --git a/keyboards/frenchdev/keymaps/default/keymap.c b/keyboards/frenchdev/keymaps/default/keymap.c deleted file mode 100644 index 035e0179d..000000000 --- a/keyboards/frenchdev/keymaps/default/keymap.c +++ /dev/null @@ -1,409 +0,0 @@ -#include "frenchdev.h" -#include "mousekey.h" -#include "action.h" -#include "action_layer.h" -#include "keymap_extras/keymap_bepo.h" - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -#define _BASE 0 -#define _SYMBOLS 1 -#define _MEDIA 2 -#define _TRNS 8 - -#define PEDAL_DELAY 250 -#define KEY_DELAY 130 - -enum macros { - M_LP, // left pedal - M_RP, // right pedal - M_SF, // shift - M_SFS, // shift and space - M_L1E, // L1 and space - L2INS, // L2 and insert - L2LOC, // Lock L2 - M_UN, // undo - M_CUT, // cut - M_CP, // copy - M_PS, // paste - M_SE, // search - M_SFU, // shift and underscore -}; - -static uint16_t key_timer_left_pedal; -static uint16_t key_timer_right_pedal; -static uint16_t key_timer_shift; -static uint16_t key_timer_1; -static uint16_t key_timer_2; - -static uint16_t shift_count = 0; //this is used to keep track of shift state and avoid inserting non breakable space -static uint16_t l2_locked = 0; //this indicate wether L2 is locked - -#define BP_CBSP CTL_T(KC_BSPC) -#define BP_CDEL CTL_T(KC_DEL) - -//layout : http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* base - * left foot clicked is right click - * left foot pressed is layer 2 - * right foot clicked is left click - * right foot pressed is layer 1 + scroll lock (used with autohotkey for easier scrolling with trackballs) - * ,------. .. ,------. * - * ,------| F3 |-------------. .. ,-------------| F10 |------. * - * ,------| F2 |------| F4 | F5 |------. .. ,------| F8 | F9 |------| F11 |------. * - * | F1 |------| »/3 |------|------| F6 | .. | F7 |------|------| -/8 |------| F12 | * - * ,------+------| «/2 |------| (/4 | )/5 |------| .. |------| @/6 | +/7 |------| //9 |------+------. * - * | ESC | "/1 |------| O |------|------| ¨ | .. | ^ |------|------| D |------| * /0 |BCKSP | * - * |------+------| É |------| P | È |------| .. |------| K | V |------| L |------+------| * - * | TAB | B |------| E |------|------| _ | .. | =/° |------|------| S |------| J |ENTER | * - * |------+------| U |------| I | F |------| .. |------| C | T |------| R |------+------| * - * | ` | A |------| Y |------|------| ; | .. | ! |------|------| UP |------| N | '/? | * - * |------+------| À |------| X | W |------|-------------. .. .-------------|------| M | G |------| H |------+------| * - * | SHIFT| Z |------| . |------|------|sp/sh |bsp/ct|L2/ins| .. |L2lock|del/CT|sp/sh |------|------| DOWN |------| Q |SHIFT | * - * |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| * - * | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | * - * `-------------/ \-------------/ .. \-------------/ \-------------/ * - *M(M_LP) - */ -[_BASE] = KEYMAP( - 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_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ - KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ - BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \ - M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, BP_W, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \ - KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ - //left pedals - M(M_LP), M(M_RP), KC_TRNS, \ - //right pedals - M(M_LP), M(M_RP), KC_TRNS \ -), - - /* Larer 1 for symbols. - * left foot is middle click - * ,------. .. ,------. * - * ,------| |-------------. .. ,-------------| |------. * - * ,------| |------| | |------. .. ,------| | |------| |------. * - * | |------| § |------|------| | .. | |------|------| ± |------| | * - * ,------+------| ¶ |------| µ | |------| .. |------| ≤ | ≥ |------| ÷ |------+------. * - * | | ¤ |------| { |------|------| ~ | .. | ˇ |------|------| ] |------| × | | * - * |------+------| * |------| } | ` |------| .. |------| # | [ |------| % |------+------| * - * | | \ |------| ( |------|------| | .. | ≠ |------|------| > |------| ‰ | | * - * |------+------| Ù |------| ) | + |------| .. |------| Ç | < |------| & |------+------| * - * | | = |------| copy |------|------| : | .. | ? |------|------| PGUP |------| _ | | * - * |------+------| cut |------| paste|search|------|-------------. .. .-------------|------| $ | = |------| | |------+------| * - * | | undo |------| \ |------|------| | | | .. | | | |------|------| PGDN |------| / | | * - * |------+------| |------| | |------|------|------ .. ------|------|------| | HOME |------| PGDN |------+------| * - * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * - * `-------------/ \-------------/ .. \-------------/ \-------------/ * - * - */ -[_SYMBOLS] = KEYMAP( - 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, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ - KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ - KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ - KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \ - //left pedals - KC_TRNS, KC_BTN1, KC_TRNS, \ - //right pedals - KC_TRNS, KC_BTN1, KC_TRNS \ -), - - /* MEDIA, mouse and numpad. - * right pedal is left clic - * ,------. .. ,------. * - * ,------|PAUSE |-------------. .. ,-------------| PRINT|------. * - * ,------|SCROLL|------|MUTE |VOLUD |------. .. ,------| pre | next |------| calc |------. * - * |RESET |------| stop |------|------|VOLDU | .. | play |------|------| stop |------| num | * - * ,------+------| |------| pre | next |------| .. |------| pre | next |------| |------+------. * - * | | |------|scrolu|------|------| play | .. | play |------|------| 8 |------| - | | * - * |------+------| |------| | bt4 |------| .. |------| next | 7 |------| 9 |------+------| * - * | | |------|scrold|------|------| bt5 | .. | pre |------|------| 5 |------| + | | * - * |------+------| |------|mclic | rclic|------| .. |------| rclic| 4 |------| 6 |------+------| * - * | | |------| |------|------| lclic| .. | lclic|------|------| 2 |------| * | | * - * |------+------| |------| | mclck|------|-------------. .. .-------------|------| mclic| 1 |------| 3 |------+------| * - * | | |------| |------|------| | | | .. | | | |------|------| num. |------| / | | * - * |------+------| |------| | |------|------|------ .. ------|------|------| | 0 |------| . |------+------| * - * | | |------/ \-------------| | | .. | | |-------------/ \------| , | | * - * `-------------/ \-------------/ .. \-------------/ \-------------/ * - * - */ -[_MEDIA] = KEYMAP( - RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \ - KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, 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_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \ - //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ - //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ -), - -/* TRNS - skeleton for laters - * ,------. .. ,------. * - * ,------| |-------------. .. ,-------------| |------. * - * ,------| |------| | |------. .. ,------| | |------| |------. * - * | |------| |------|------| | .. | |------|------| |------| | * - * ,------+------| |------| | |------| .. |------| | |------| |------+------. * - * | | |------| |------|------| | .. | |------|------| |------| | | * - * |------+------| |------| | |------| .. |------| | |------| |------+------| * - * | | |------| |------|------| | .. | |------|------| |------| | | * - * |------+------| |------| | |------| .. |------| | |------| |------+------| * - * | | |------| |------|------| | .. | |------|------| |------| | | * - * |------+------| |------| | |------|-------------. .. .-------------|------| | |------| |------+------| * - * | | |------| |------|------| | | | .. | | | |------|------| |------| | | * - * |------+------| |------| | |------|------|------ .. ------|------|------| | |------| |------+------| * - * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * - * `-------------/ \-------------/ .. \-------------/ \-------------/ * - * - */ - -[_TRNS] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_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, \ - //left pedals - KC_BTN3, M(M_RP), KC_TRNS, \ - //right pedals - KC_BTN3, M(M_RP), KC_TRNS \ -), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void hold_shift(void) { - shift_count = shift_count + 1; - register_code(KC_LSHIFT); -} - -void release_shift(void) { - shift_count = shift_count - 1; - if(shift_count <= 0){ - unregister_code(KC_LSHIFT); - shift_count = 0; - } -} - -void press_space(void) { - if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_SPACE); - unregister_code (KC_SPACE); - if(shift_count > 0) register_code (KC_LSHIFT); -} - -void press_enter(void) { - if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code (KC_ENT); - unregister_code (KC_ENT); - if(shift_count > 0) register_code (KC_LSHIFT); -} - -void press_underscore(void) { - if(shift_count > 0) unregister_code (KC_LSHIFT); - register_code ((unsigned char) BP_UNDS); - unregister_code ((unsigned char) BP_UNDS); - if(shift_count > 0) register_code (KC_LSHIFT); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case M_LP: //left pedal - if (record->event.pressed) { - layer_on(1); - register_code (KC_SLCK); - key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) { - mousekey_on (KC_BTN2); - mousekey_send(); - mousekey_off (KC_BTN2); - mousekey_send(); - } - unregister_code (KC_SLCK); - layer_off(1); - } - break; - case M_RP: //right pedal - if (record->event.pressed) { - layer_on(2); - key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) { - mousekey_on (KC_BTN1); - mousekey_send(); - mousekey_off (KC_BTN1); - mousekey_send(); - } - layer_off(2); - } - break; - case M_SF: // shift, using macro to keep track of shift state and avoid inserting nbsp by mistake - if (record->event.pressed) { - hold_shift(); - } else { - release_shift(); - } - break; - case M_SFS: // shift when held, space when tapped - if (record->event.pressed) { - hold_shift(); - key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_shift) < KEY_DELAY) { - press_space(); - } - release_shift(); - } - break; - case M_SFU: // shift when held, _ when tapped - if (record->event.pressed) { - hold_shift(); - key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_shift) < KEY_DELAY) { - press_space(); - } - release_shift(); - } - break; - case M_L1E: // L1 when held, space when tapped - if (record->event.pressed) { - layer_on(1); - key_timer_1 = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_1) < KEY_DELAY) { - press_enter(); - } - layer_off(1); - } - break; - case L2INS: //activate layer 2, if released before 100ms trigger INS. basicaly equivalent to LT(2, KC_INS) but without delay for activation of layer 2 - if (record->event.pressed) { - layer_on(2); - key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. - } else { - if (timer_elapsed(key_timer_2) < KEY_DELAY) { - register_code (KC_INS); - unregister_code (KC_INS); - } - l2_locked = 0; - layer_off(2); - } - break; - case L2LOC: //lock L2 - if (record->event.pressed) { - key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. - layer_on(2); - } else { - if (timer_elapsed(key_timer_2) < KEY_DELAY && l2_locked == 0) { - l2_locked = 1; - layer_on(2); - } else { - l2_locked = 0; - layer_off(2); - } - } - break; - case M_UN: // undo - if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_Z); - unregister_code(BP_Z); - unregister_code(KC_LCTL); - } - break; - case M_CUT: // cut - if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_X); - unregister_code(BP_X); - unregister_code(KC_LCTL); - } - break; - case M_CP: // copy - if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_C); - unregister_code(BP_C); - unregister_code(KC_LCTL); - } - break; - case M_PS: // paste - if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_V); - unregister_code(BP_V); - unregister_code(KC_LCTL); - } - break; - case M_SE: // search - if (record->event.pressed) { - register_code(KC_LCTL); - register_code(BP_F); - unregister_code(BP_F); - unregister_code(KC_LCTL); - } - break; - } - return MACRO_NONE; -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - -} - -void matrix_init_user(void) { -} - -// Bleah globals need to be initialized. -uint8_t old_layer=_BASE; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - switch (layer) { - case _BASE: - ergodox_right_led_2_on(); - break; - case _SYMBOLS: - ergodox_right_led_1_on(); - break; - case _MEDIA: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - default: - // none - break; - } -} - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1< -Copyright 2013 Oleg Kostyuk - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef FRENCHDEV_V1_CONFIG_H -#define FRENCHDEV_V1_CONFIG_H - -#include "../config.h" - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1307 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Sacapuces -#define PRODUCT Frenchdev V1 -#define DESCRIPTION QMK keyboard firmware for Frenchdev - -/* key matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 6 - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -#define LED_BRIGHTNESS_LO 15 -#define LED_BRIGHTNESS_HI 255 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - -#define USB_MAX_POWER_CONSUMPTION 500 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION -//#define DEBUG_MATRIX_SCAN_RATE - -#endif diff --git a/keyboards/frenchdev/v1/i2cmaster.h b/keyboards/frenchdev/v1/i2cmaster.h deleted file mode 100644 index 3917b9e6c..000000000 --- a/keyboards/frenchdev/v1/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -extern void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -extern void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -extern void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -extern unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -extern unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/frenchdev/v1/matrix.c b/keyboards/frenchdev/v1/matrix.c deleted file mode 100644 index 70fa6a696..000000000 --- a/keyboards/frenchdev/v1/matrix.c +++ /dev/null @@ -1,394 +0,0 @@ -/* - -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - -Note to self, the "column" and "row" in here actually refers to the opposite on the keyboard -see definition of KEYMAP in v1.h, the grid is transposed so that a "row" in here is actually a "column" on the physical keyboard -Nicolas - -Copyright 2013 Oleg Kostyuk - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "action_layer.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "v1.h" -#include "i2cmaster.h" -#ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" -#endif - -/* - * This constant define not debouncing time in msecs, but amount of matrix - * scan loops which should be made to get stable debounced results. - * - * On Ergodox matrix scan rate is relatively low, because of slow I2C. - * Now it's only 317 scans/second, or about 3.15 msec/scan. - * According to Cherry specs, debouncing time is 5 msec. - * - * And so, there is no sense to have DEBOUNCE higher than 2. - */ - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -static uint8_t mcp23018_reset_loop; - -#ifdef DEBUG_MATRIX_SCAN_RATE -uint32_t matrix_timer; -uint32_t matrix_scan_count; -#endif - - -__attribute__ ((weak)) -void matrix_init_user(void) {} - -__attribute__ ((weak)) -void matrix_scan_user(void) {} - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - debug_enable = true; - debug_matrix = true; - debug_keyboard = true; - debug_mouse = true; - - mcp23018_status = init_mcp23018(); - - - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif - - matrix_init_quantum(); - -} - -void matrix_power_up(void) { - mcp23018_status = init_mcp23018(); - - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif - -} - -uint8_t matrix_scan(void) -{ - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans - // this will be approx bit more frequent than once per second - print("trying to reset mcp23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - print("left side not responding\n"); - } else { - print("left side attached\n"); - ergodox_blink_all_leds(); - } - } - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_scan_count++; - - uint32_t timer_now = timer_read32(); - if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { - print("matrix scan frequency: "); - pdec(matrix_scan_count); - print("\n"); - - matrix_timer = timer_now; - matrix_scan_count = 0; - } -#endif - - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(i); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - wait_us(1); - // this should be wait_ms(1) but has been left as-is at EZ's request - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< http://jump.to/fleury -* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device with hardware TWI -* Usage: API compatible with I2C Software Library i2cmaster.h -**************************************************************************/ -#include -#include - -#include - - -/* define CPU frequency in Mhz here if not defined in Makefile */ -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -/* I2C clock in Hz */ -#define SCL_CLOCK 400000L - - -/************************************************************************* - Initialization of the I2C bus interface. Need to be called only once -*************************************************************************/ -void i2c_init(void) -{ - /* initialize TWI clock - * minimal values in Bit Rate Register (TWBR) and minimal Prescaler - * bits in the TWI Status Register should give us maximal possible - * I2C bus speed - about 444 kHz - * - * for more details, see 20.5.2 in ATmega16/32 secification - */ - - TWSR = 0; /* no prescaler */ - TWBR = 10; /* must be >= 10 for stable operation */ - -}/* i2c_init */ - - -/************************************************************************* - Issues a start condition and sends address and transfer direction. - return 0 = device accessible, 1= failed to access device -*************************************************************************/ -unsigned char i2c_start(unsigned char address) -{ - uint8_t twst; - - // send START condition - TWCR = (1< -#include -#include "i2cmaster.h" -#include - -#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) -#define CPU_16MHz 0x00 - -// I2C aliases and register addresses (see "mcp23018.md") -#define I2C_ADDR 0b0100000 -#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) -#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) -#define IODIRA 0x00 // i/o direction register -#define IODIRB 0x01 -#define GPPUA 0x0C // GPIO pull-up resistor register -#define GPPUB 0x0D -#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) -#define GPIOB 0x13 -#define OLATA 0x14 // output latch register -#define OLATB 0x15 - -extern uint8_t mcp23018_status; - -void init_ergodox(void); -void ergodox_blink_all_leds(void); -uint8_t init_mcp23018(void); -uint8_t ergodox_left_leds_update(void); - -#define LED_BRIGHTNESS_LO 15 -#define LED_BRIGHTNESS_HI 255 - - -inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); } -inline void ergodox_right_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } -inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } -inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } -inline void ergodox_right_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); } - -inline void ergodox_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); } -inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } -inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } -inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } -inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); } - -inline void ergodox_led_all_on(void) -{ - ergodox_board_led_on(); - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); -} - -inline void ergodox_led_all_off(void) -{ - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); -} - -inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; } -inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; } -inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; } -inline void ergodox_right_led_set(uint8_t led, uint8_t n) { - (led == 1) ? (OCR1A = n) : - (led == 2) ? (OCR1B = n) : - (OCR1C = n); -} - -inline void ergodox_led_all_set(uint8_t n) -{ - ergodox_right_led_1_set(n); - ergodox_right_led_2_set(n); - ergodox_right_led_3_set(n); -} - -#define KEYMAP( \ - \ - k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \ - k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \ - k20, k21, k22, k23, k24, k25, k26, k29, k2a, k2b, k2c, k2d, k2e, k2f, \ - k30, k31, k32, k33, k34, k35, k36, k39, k3a, k3b, k3c, k3d, k3e, k3f, \ - k40, k41, k42, k43, k44, k45, k46, k47, k37, k38, k48, k49, k4a, k4b, k4c, k4d, k4e, k4f, \ - k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5e, k5f, \ - \ - PL1, PL2, PL3, \ - PR1, PR2, PR3 \ - ) \ - \ - /* matrix positions, inverted left and right for I2C to be on row 0-7 */\ - { \ - \ - { k5f, k4f, k3f, k2f, k1f, KC_NO}, \ - { k5e, k4e, k3e, k2e, k1e, k0e }, \ - { k5d, k4d, k3d, k2d, k1d, k0d }, \ - { k5c, k4c, k3c, k2c, k1c, k0c }, \ - { k5b, k4b, k3b, k2b, k1b, k0b }, \ - { k5a, k4a, k3a, k2a, k1a, k0a }, \ - { k59, k49, k39, k29, k19, k09 }, \ - { k58, k48, k38, PR1, PR2, PR3 }, \ - \ - { k57, k47, k37, PL1, PL2, PL3 }, \ - { k56, k46, k36, k26, k16, k06 }, \ - { k55, k44, k35, k25, k15, k05 }, \ - { k54, k44, k34, k24, k14, k04 }, \ - { k53, k43, k33, k23, k13, k03 }, \ - { k52, k42, k32, k22, k12, k02 }, \ - { k51, k41, k31, k21, k11, k01 }, \ - { k50, k40, k30, k20, k10, KC_NO } \ - } - -#endif diff --git a/keyboards/handwired/frenchdev/Makefile b/keyboards/handwired/frenchdev/Makefile new file mode 100644 index 000000000..57b2ef62e --- /dev/null +++ b/keyboards/handwired/frenchdev/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/handwired/frenchdev/config.h b/keyboards/handwired/frenchdev/config.h new file mode 100644 index 000000000..dd386402c --- /dev/null +++ b/keyboards/handwired/frenchdev/config.h @@ -0,0 +1,85 @@ +/* +Copyright 201 Nicolas Poirey + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef FRENCHDEV_V1_CONFIG_H +#define FRENCHDEV_V1_CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1307 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Nicolas Poirey +#define PRODUCT Frenchdev V1 +#define DESCRIPTION QMK keyboard firmware for Frenchdev + +/* key matrix size */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 6 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +#define USB_MAX_POWER_CONSUMPTION 500 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +//#define DEBUG_MATRIX_SCAN_RATE + +#endif //FRENCHDEV_V1_CONFIG_H diff --git a/keyboards/handwired/frenchdev/frenchdev.c b/keyboards/handwired/frenchdev/frenchdev.c new file mode 100644 index 000000000..101fe92e0 --- /dev/null +++ b/keyboards/handwired/frenchdev/frenchdev.c @@ -0,0 +1,86 @@ +#include "frenchdev.h" +#include "i2cmaster.h" + +bool i2c_initialized = 0; +uint8_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") + TCCR1A = 0b10101001; // set and configure fast PWM + TCCR1B = 0b00001001; // set and configure fast PWM + + + + // unused pins - D4, D5, D7, E6 + // set as input with internal pull-ip enabled + DDRD &= ~(1<<5 | 1<<4); + DDRE &= ~(1<<6); + PORTD |= (1<<5 | 1<<4); + PORTE |= (1<<6); + + ergodox_blink_all_leds(); + + matrix_init_user(); +} + +void ergodox_blink_all_leds(void) +{ + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + _delay_ms(50); + ergodox_right_led_2_on(); + _delay_ms(50); + ergodox_right_led_3_on(); + _delay_ms(50); + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + //ergodox_led_all_on(); + //_delay_ms(333); + ergodox_led_all_off(); +} + +uint8_t init_mcp23018(void) { + mcp23018_status = 0x20; + + // I2C subsystem + + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized++; + _delay_ms(1000); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + +out: + i2c_stop(); + + // SREG=sreg_prev; + + return mcp23018_status; +} + diff --git a/keyboards/handwired/frenchdev/frenchdev.h b/keyboards/handwired/frenchdev/frenchdev.h new file mode 100644 index 000000000..bf4df18ef --- /dev/null +++ b/keyboards/handwired/frenchdev/frenchdev.h @@ -0,0 +1,116 @@ +#ifndef FRENCHDEV_V1_H +#define FRENCHDEV_V1_H + +#include "quantum.h" +#include +#include +#include "i2cmaster.h" +#include + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +extern uint8_t mcp23018_status; + +void init_ergodox(void); +void ergodox_blink_all_leds(void); +uint8_t init_mcp23018(void); +uint8_t ergodox_left_leds_update(void); + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + + +inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); } +inline void ergodox_right_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } +inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } +inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } +inline void ergodox_right_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); } + +inline void ergodox_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); } +inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } +inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } +inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } +inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); } + +inline void ergodox_led_all_on(void) +{ + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) +{ + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; } +inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; } +inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; } +inline void ergodox_right_led_set(uint8_t led, uint8_t n) { + (led == 1) ? (OCR1A = n) : + (led == 2) ? (OCR1B = n) : + (OCR1C = n); +} + +inline void ergodox_led_all_set(uint8_t n) +{ + ergodox_right_led_1_set(n); + ergodox_right_led_2_set(n); + ergodox_right_led_3_set(n); +} + +#define KEYMAP( \ + \ + k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \ + k20, k21, k22, k23, k24, k25, k26, k29, k2a, k2b, k2c, k2d, k2e, k2f, \ + k30, k31, k32, k33, k34, k35, k36, k39, k3a, k3b, k3c, k3d, k3e, k3f, \ + k40, k41, k42, k43, k44, k45, k46, k47, k37, k38, k48, k49, k4a, k4b, k4c, k4d, k4e, k4f, \ + k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5e, k5f, \ + \ + PL1, PL2, PL3, \ + PR1, PR2, PR3 \ + ) \ + \ + /* matrix positions, inverted left and right for I2C to be on row 0-7 */\ + { \ + \ + { k5f, k4f, k3f, k2f, k1f, KC_NO}, \ + { k5e, k4e, k3e, k2e, k1e, k0e }, \ + { k5d, k4d, k3d, k2d, k1d, k0d }, \ + { k5c, k4c, k3c, k2c, k1c, k0c }, \ + { k5b, k4b, k3b, k2b, k1b, k0b }, \ + { k5a, k4a, k3a, k2a, k1a, k0a }, \ + { k59, k49, k39, k29, k19, k09 }, \ + { k58, k48, k38, PR1, PR2, PR3 }, \ + \ + { k57, k47, k37, PL1, PL2, PL3 }, \ + { k56, k46, k36, k26, k16, k06 }, \ + { k55, k45, k35, k25, k15, k05 }, \ + { k54, k44, k34, k24, k14, k04 }, \ + { k53, k43, k33, k23, k13, k03 }, \ + { k52, k42, k32, k22, k12, k02 }, \ + { k51, k41, k31, k21, k11, k01 }, \ + { k50, k40, k30, k20, k10, KC_NO } \ + } + +#endif diff --git a/keyboards/handwired/frenchdev/i2cmaster.h b/keyboards/handwired/frenchdev/i2cmaster.h new file mode 100644 index 000000000..3917b9e6c --- /dev/null +++ b/keyboards/handwired/frenchdev/i2cmaster.h @@ -0,0 +1,178 @@ +#ifndef _I2CMASTER_H +#define _I2CMASTER_H 1 +/************************************************************************* +* Title: C include file for the I2C master interface +* (i2cmaster.S or twimaster.c) +* Author: Peter Fleury http://jump.to/fleury +* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device +* Usage: see Doxygen manual +**************************************************************************/ + +#ifdef DOXYGEN +/** + @defgroup pfleury_ic2master I2C Master library + @code #include @endcode + + @brief I2C (TWI) Master Software Library + + Basic routines for communicating with I2C slave devices. This single master + implementation is limited to one bus master on the I2C bus. + + This I2c library is implemented as a compact assembler software implementation of the I2C protocol + which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). + Since the API for these two implementations is exactly the same, an application can be linked either against the + software I2C implementation or the hardware I2C implementation. + + Use 4.7k pull-up resistor on the SDA and SCL pin. + + Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module + i2cmaster.S to your target when using the software I2C implementation ! + + Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. + + @note + The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted + to GNU assembler and AVR-GCC C call interface. + Replaced the incorrect quarter period delays found in AVR300 with + half period delays. + + @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury + + @par API Usage Example + The following code shows typical usage of this library, see example test_i2cmaster.c + + @code + + #include + + + #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet + + int main(void) + { + unsigned char ret; + + i2c_init(); // initialize I2C library + + // write 0x75 to EEPROM address 5 (Byte Write) + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + i2c_write(0x05); // write address = 5 + i2c_write(0x75); // write value 0x75 to EEPROM + i2c_stop(); // set stop conditon = release bus + + + // read previously written value back from EEPROM address 5 + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + + i2c_write(0x05); // write address = 5 + i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode + + ret = i2c_readNak(); // read one byte from EEPROM + i2c_stop(); + + for(;;); + } + @endcode + +*/ +#endif /* DOXYGEN */ + +/**@{*/ + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 +#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" +#endif + +#include + +/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_READ 1 + +/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_WRITE 0 + + +/** + @brief initialize the I2C master interace. Need to be called only once + @param void + @return none + */ +extern void i2c_init(void); + + +/** + @brief Terminates the data transfer and releases the I2C bus + @param void + @return none + */ +extern void i2c_stop(void); + + +/** + @brief Issues a start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_start(unsigned char addr); + + +/** + @brief Issues a repeated start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_rep_start(unsigned char addr); + + +/** + @brief Issues a start condition and sends address and transfer direction + + If device is busy, use ack polling to wait until device ready + @param addr address and transfer direction of I2C device + @return none + */ +extern void i2c_start_wait(unsigned char addr); + + +/** + @brief Send one byte to I2C device + @param data byte to be transfered + @retval 0 write successful + @retval 1 write failed + */ +extern unsigned char i2c_write(unsigned char data); + + +/** + @brief read one byte from the I2C device, request more data from device + @return byte read from I2C device + */ +extern unsigned char i2c_readAck(void); + +/** + @brief read one byte from the I2C device, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_readNak(void); + +/** + @brief read one byte from the I2C device + + Implemented as a macro, which calls either i2c_readAck or i2c_readNak + + @param ack 1 send ack, request more data from device
+ 0 send nak, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_read(unsigned char ack); +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + + +/**@}*/ +#endif diff --git a/keyboards/handwired/frenchdev/keymaps/default/keymap.c b/keyboards/handwired/frenchdev/keymaps/default/keymap.c new file mode 100644 index 000000000..74b20cb0f --- /dev/null +++ b/keyboards/handwired/frenchdev/keymaps/default/keymap.c @@ -0,0 +1,409 @@ +#include "frenchdev.h" +#include "mousekey.h" +#include "action.h" +#include "action_layer.h" +#include "keymap_extras/keymap_bepo.h" + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +#define _BASE 0 +#define _SYMBOLS 1 +#define _MEDIA 2 +#define _TRNS 8 + +#define PEDAL_DELAY 250 +#define KEY_DELAY 130 + +enum macros { + M_LP, // left pedal + M_RP, // right pedal + M_SF, // shift + M_SFS, // shift and space + M_L1E, // L1 and space + L2INS, // L2 and insert + L2LOC, // Lock L2 + M_UN, // undo + M_CUT, // cut + M_CP, // copy + M_PS, // paste + M_SE, // search + M_SFU, // shift and underscore +}; + +static uint16_t key_timer_left_pedal; +static uint16_t key_timer_right_pedal; +static uint16_t key_timer_shift; +static uint16_t key_timer_1; +static uint16_t key_timer_2; + +static uint16_t shift_count = 0; //this is used to keep track of shift state and avoid inserting non breakable space +static uint16_t l2_locked = 0; //this indicate wether L2 is locked + +#define BP_CBSP CTL_T(KC_BSPC) +#define BP_CDEL CTL_T(KC_DEL) + +//layout : http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* base + * left foot clicked is right click + * left foot pressed is layer 2 + * right foot clicked is left click + * right foot pressed is layer 1 + scroll lock (used with autohotkey for easier scrolling with trackballs) + * ,------. .. ,------. * + * ,------| F3 |-------------. .. ,-------------| F10 |------. * + * ,------| F2 |------| F4 | F5 |------. .. ,------| F8 | F9 |------| F11 |------. * + * | F1 |------| »/3 |------|------| F6 | .. | F7 |------|------| -/8 |------| F12 | * + * ,------+------| «/2 |------| (/4 | )/5 |------| .. |------| @/6 | +/7 |------| //9 |------+------. * + * | ESC | "/1 |------| O |------|------| ¨ | .. | ^ |------|------| D |------| * /0 |BCKSP | * + * |------+------| É |------| P | È |------| .. |------| K | V |------| L |------+------| * + * | TAB | B |------| E |------|------| _ | .. | =/° |------|------| S |------| J |ENTER | * + * |------+------| U |------| I | F |------| .. |------| C | T |------| R |------+------| * + * | ` | A |------| Y |------|------| ; | .. | ! |------|------| UP |------| N | '/? | * + * |------+------| À |------| X | W |------|-------------. .. .-------------|------| M | G |------| H |------+------| * + * | SHIFT| Z |------| . |------|------|sp/sh |bsp/ct|L2/ins| .. |L2lock|del/CT|sp/sh |------|------| DOWN |------| Q |SHIFT | * + * |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| * + * | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + *M(M_LP) + */ +[_BASE] = KEYMAP( + 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_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ + KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ + BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \ + M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRACKET, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \ + KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \ + //left pedals + M(M_LP), M(M_RP), KC_TRNS, \ + //right pedals + M(M_LP), M(M_RP), KC_TRNS \ +), + + /* Larer 1 for symbols. + * left foot is middle click + * ,------. .. ,------. * + * ,------| |-------------. .. ,-------------| |------. * + * ,------| |------| | |------. .. ,------| | |------| |------. * + * | |------| § |------|------| | .. | |------|------| ± |------| | * + * ,------+------| ¶ |------| µ | |------| .. |------| ≤ | ≥ |------| ÷ |------+------. * + * | | ¤ |------| { |------|------| ~ | .. | ˇ |------|------| ] |------| × | | * + * |------+------| * |------| } | ` |------| .. |------| # | [ |------| % |------+------| * + * | | \ |------| ( |------|------| | .. | ≠ |------|------| > |------| ‰ | | * + * |------+------| Ù |------| ) | + |------| .. |------| Ç | < |------| & |------+------| * + * | | = |------| copy |------|------| : | .. | ? |------|------| PGUP |------| _ | | * + * |------+------| cut |------| paste|search|------|-------------. .. .-------------|------| $ | = |------| | |------+------| * + * | | undo |------| \ |------|------| | | | .. | | | |------|------| PGDN |------| / | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | HOME |------| PGDN |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ +[_SYMBOLS] = KEYMAP( + 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, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ + KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ + KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \ + KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \ + KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \ + //left pedals + KC_TRNS, KC_BTN1, KC_TRNS, \ + //right pedals + KC_TRNS, KC_BTN1, KC_TRNS \ +), + + /* MEDIA, mouse and numpad. + * right pedal is left clic + * ,------. .. ,------. * + * ,------|PAUSE |-------------. .. ,-------------| PRINT|------. * + * ,------|SCROLL|------|MUTE |VOLUD |------. .. ,------| pre | next |------| calc |------. * + * |RESET |------| stop |------|------|VOLDU | .. | play |------|------| stop |------| num | * + * ,------+------| |------| pre | next |------| .. |------| pre | next |------| |------+------. * + * | | |------|scrolu|------|------| play | .. | play |------|------| 8 |------| - | | * + * |------+------| |------| | bt4 |------| .. |------| next | 7 |------| 9 |------+------| * + * | | |------|scrold|------|------| bt5 | .. | pre |------|------| 5 |------| + | | * + * |------+------| |------|mclic | rclic|------| .. |------| rclic| 4 |------| 6 |------+------| * + * | | |------| |------|------| lclic| .. | lclic|------|------| 2 |------| * | | * + * |------+------| |------| | mclck|------|-------------. .. .-------------|------| mclic| 1 |------| 3 |------+------| * + * | | |------| |------|------| | | | .. | | | |------|------| num. |------| / | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | 0 |------| . |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| , | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ +[_MEDIA] = KEYMAP( + RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \ + KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, 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_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \ + //left pedals + KC_BTN3, M(M_RP), KC_TRNS, \ + //right pedals + KC_BTN3, M(M_RP), KC_TRNS \ +), + +/* TRNS - skeleton for laters + * ,------. .. ,------. * + * ,------| |-------------. .. ,-------------| |------. * + * ,------| |------| | |------. .. ,------| | |------| |------. * + * | |------| |------|------| | .. | |------|------| |------| | * + * ,------+------| |------| | |------| .. |------| | |------| |------+------. * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------| .. |------| | |------| |------+------| * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------| .. |------| | |------| |------+------| * + * | | |------| |------|------| | .. | |------|------| |------| | | * + * |------+------| |------| | |------|-------------. .. .-------------|------| | |------| |------+------| * + * | | |------| |------|------| | | | .. | | | |------|------| |------| | | * + * |------+------| |------| | |------|------|------ .. ------|------|------| | |------| |------+------| * + * | | |------/ \-------------| | | .. | | |-------------/ \------| | | * + * `-------------/ \-------------/ .. \-------------/ \-------------/ * + * + */ + +[_TRNS] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_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, \ + //left pedals + KC_BTN3, M(M_RP), KC_TRNS, \ + //right pedals + KC_BTN3, M(M_RP), KC_TRNS \ +), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void hold_shift(void) { + shift_count = shift_count + 1; + register_code(KC_LSHIFT); +} + +void release_shift(void) { + shift_count = shift_count - 1; + if(shift_count <= 0){ + unregister_code(KC_LSHIFT); + shift_count = 0; + } +} + +void press_space(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code (KC_SPACE); + unregister_code (KC_SPACE); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +void press_enter(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code (KC_ENT); + unregister_code (KC_ENT); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +void press_underscore(void) { + if(shift_count > 0) unregister_code (KC_LSHIFT); + register_code ((unsigned char) BP_UNDS); + unregister_code ((unsigned char) BP_UNDS); + if(shift_count > 0) register_code (KC_LSHIFT); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case M_LP: //left pedal + if (record->event.pressed) { + layer_on(1); + register_code (KC_SLCK); + key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) { + mousekey_on (KC_BTN2); + mousekey_send(); + mousekey_off (KC_BTN2); + mousekey_send(); + } + unregister_code (KC_SLCK); + layer_off(1); + } + break; + case M_RP: //right pedal + if (record->event.pressed) { + layer_on(2); + key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) { + mousekey_on (KC_BTN1); + mousekey_send(); + mousekey_off (KC_BTN1); + mousekey_send(); + } + layer_off(2); + } + break; + case M_SF: // shift, using macro to keep track of shift state and avoid inserting nbsp by mistake + if (record->event.pressed) { + hold_shift(); + } else { + release_shift(); + } + break; + case M_SFS: // shift when held, space when tapped + if (record->event.pressed) { + hold_shift(); + key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_shift) < KEY_DELAY) { + press_space(); + } + release_shift(); + } + break; + case M_SFU: // shift when held, _ when tapped + if (record->event.pressed) { + hold_shift(); + key_timer_shift = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_shift) < KEY_DELAY) { + press_space(); + } + release_shift(); + } + break; + case M_L1E: // L1 when held, space when tapped + if (record->event.pressed) { + layer_on(1); + key_timer_1 = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_1) < KEY_DELAY) { + press_enter(); + } + layer_off(1); + } + break; + case L2INS: //activate layer 2, if released before 100ms trigger INS. basicaly equivalent to LT(2, KC_INS) but without delay for activation of layer 2 + if (record->event.pressed) { + layer_on(2); + key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. + } else { + if (timer_elapsed(key_timer_2) < KEY_DELAY) { + register_code (KC_INS); + unregister_code (KC_INS); + } + l2_locked = 0; + layer_off(2); + } + break; + case L2LOC: //lock L2 + if (record->event.pressed) { + key_timer_2 = timer_read(); // if the key is being pressed, we start the timer. + layer_on(2); + } else { + if (timer_elapsed(key_timer_2) < KEY_DELAY && l2_locked == 0) { + l2_locked = 1; + layer_on(2); + } else { + l2_locked = 0; + layer_off(2); + } + } + break; + case M_UN: // undo + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_Z); + unregister_code(BP_Z); + unregister_code(KC_LCTL); + } + break; + case M_CUT: // cut + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_X); + unregister_code(BP_X); + unregister_code(KC_LCTL); + } + break; + case M_CP: // copy + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_C); + unregister_code(BP_C); + unregister_code(KC_LCTL); + } + break; + case M_PS: // paste + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_V); + unregister_code(BP_V); + unregister_code(KC_LCTL); + } + break; + case M_SE: // search + if (record->event.pressed) { + register_code(KC_LCTL); + register_code(BP_F); + unregister_code(BP_F); + unregister_code(KC_LCTL); + } + break; + } + return MACRO_NONE; +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + +} + +void matrix_init_user(void) { +} + +// Bleah globals need to be initialized. +uint8_t old_layer=_BASE; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + switch (layer) { + case _BASE: + ergodox_right_led_2_on(); + break; + case _SYMBOLS: + ergodox_right_led_1_on(); + break; + case _MEDIA: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + default: + // none + break; + } +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "frenchdev.h" +#include "i2cmaster.h" +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + debug_enable = true; + debug_matrix = true; + debug_keyboard = true; + debug_mouse = true; + + mcp23018_status = init_mcp23018(); + + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + + matrix_init_quantum(); + +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +uint8_t matrix_scan(void) +{ + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + ergodox_blink_all_leds(); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(i); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_us(1); + // this should be wait_ms(1) but has been left as-is at EZ's request + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< http://jump.to/fleury +* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device with hardware TWI +* Usage: API compatible with I2C Software Library i2cmaster.h +**************************************************************************/ +#include +#include + +#include + + +/* define CPU frequency in Mhz here if not defined in Makefile */ +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +/* I2C clock in Hz */ +#define SCL_CLOCK 400000L + + +/************************************************************************* + Initialization of the I2C bus interface. Need to be called only once +*************************************************************************/ +void i2c_init(void) +{ + /* initialize TWI clock + * minimal values in Bit Rate Register (TWBR) and minimal Prescaler + * bits in the TWI Status Register should give us maximal possible + * I2C bus speed - about 444 kHz + * + * for more details, see 20.5.2 in ATmega16/32 secification + */ + + TWSR = 0; /* no prescaler */ + TWBR = 10; /* must be >= 10 for stable operation */ + +}/* i2c_init */ + + +/************************************************************************* + Issues a start condition and sends address and transfer direction. + return 0 = device accessible, 1= failed to access device +*************************************************************************/ +unsigned char i2c_start(unsigned char address) +{ + uint8_t twst; + + // send START condition + TWCR = (1< +Copyright 2013 Nicolas Poirey This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -164,7 +166,7 @@ uint8_t matrix_scan(void) print("left side not responding\n"); } else { print("left side attached\n"); - ergodox_blink_all_leds(); + frenchdev_blink_all_leds(); } } } diff --git a/keyboards/handwired/frenchdev/rules.mk b/keyboards/handwired/frenchdev/rules.mk index 40a3e4676..16203a5f5 100644 --- a/keyboards/handwired/frenchdev/rules.mk +++ b/keyboards/handwired/frenchdev/rules.mk @@ -75,7 +75,7 @@ MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) COMMAND_ENABLE ?= yes # Commands for debug and configuration -CUSTOM_MATRIX ?= yes # Custom matrix file (taken and adapted from the ErgoDox EZ to acomodate custom number of columns) +CUSTOM_MATRIX ?= yes # Custom matrix file (taken and adapted from the ErgoDox EZ to handle custom number of columns) SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work UNICODE_ENABLE ?= yes # Unicode -- cgit v1.2.3 From 37987837b18a758dffbed2b01ab34103f4f6f69f Mon Sep 17 00:00:00 2001 From: Stick Date: Fri, 23 Jun 2017 16:02:01 -0500 Subject: added media keys; many bug fixes --- keyboards/ergodox/keymaps/familiar/README.md | 18 +++++++------- keyboards/ergodox/keymaps/familiar/keymap.c | 35 +++++++++++++--------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/keyboards/ergodox/keymaps/familiar/README.md b/keyboards/ergodox/keymaps/familiar/README.md index 7e3bce406..4438fccf0 100644 --- a/keyboards/ergodox/keymaps/familiar/README.md +++ b/keyboards/ergodox/keymaps/familiar/README.md @@ -23,12 +23,12 @@ Key features of the familiar layout: 1. QWERTY default layout. 1. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable). 1. Numpad layer on right hand. -1. Thumb cluster holds spacebar, ALT, and access to secondary layers. +1. Thumb cluster holds spacebar and access to secondary layers. 1. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations. ## Install -If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 235). +If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 253). ```c void matrix_init_user(void) { set_unicode_input_mode(UC_LNX); // Linux @@ -45,13 +45,15 @@ $ make ergodox-ez-familiar-teensy ## Usage +NOTE: The keymap below is out of date. + [![Familiar Layout](https://i.imgur.com/jflmkBb.png)](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644) ### Layers 1. Base Layer: QWERTY, with arrow keys at bottom right. -1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster). -1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed by holding shift while the UCIS layer is active (toggles the `INSF` layer). -1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster). +1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `SYMB` layer using the UCIS key (bottom of left thumb cluster). +1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed by holding shift while the `SYMB` layer is active (toggles the `CSYM` layer). +1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NUMP key (bottom of right thumb cluster). 1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions. ## Contribute @@ -61,9 +63,9 @@ $ make ergodox-ez-familiar-teensy I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it. ### Issues -1. The top two keys of the right thumb cluster are currently unused. I wanted them for screen brightness, but I haven't found a solution I like. -1. The `'`, `"`, `[`, and `]` keys are terrible to access; I want to put them somewhere else but I haven't figured out where. -1. The `INSF` layer is an ugly workaround. I should write a function for doing different things in the `INTL` layer depending on whether SHIFT is being held. Or something. Ideas? +1. The `CSYM` layer is an ugly workaround. I should write a function for doing different things in the `SYMB` layer depending on whether SHIFT is being held. Or something. Ideas? +1. Right now, the thumb cluster function keys double as slash and whack... this really isnt a great solution. +1. `MENU` and `LEAD` are useless, at the moment. ## License QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](blob/master/license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md). diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index fb326b3dd..e45751565 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -3,9 +3,6 @@ #include "action_layer.h" #include "version.h" -// Leader Key Timeout -//#define LEADER_TIMEOUT 300 - // Layers #define BASE 0 // default layer #define SYMB 1 // international symbols @@ -56,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,------|------|------| |------+------+------. * | |SLASH/| LOCKS| | MUTE |WHACK/| | * | SPC | MO(4)|------| |------|MO(4) | SPC | - * | | | TO(3)| |TO(1) | | | + * | | | TO(1)| |TO(3) | | | * `--------------------' `--------------------' */ [BASE] = KEYMAP( @@ -74,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC, - MT(MOD_RALT, KC_LBRC), KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT, + MT(MOD_RALT, KC_LBRC), MT(MOD_RCTL, KC_RBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_VOLD, KC_VOLU, KC_MUTE, TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC @@ -83,13 +80,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* layer 1: International symbols, etc * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ¬ | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | | + * | | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ´ | á | ß | ð | | |------| |------| | | | ø | ¶ | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |MO(CSYM)| æ | ¿ | © | | | | | | ñ | µ | ç | | |MO(CSYM)| + * |MO(CSYM)| æ | ¿ | © | ¬ | | | | | ñ | µ | ç | | |MO(CSYM)| * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | « | » | | | | * `------------------------------------' `------------------------------------' @@ -103,10 +100,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [SYMB] = KEYMAP( // left hand - UC(0x00AC), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC), + _______, UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC), _______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______, UC(0x00B4), UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______, - MO(CSYM), UC(0x00E6), UC(0x00BF), UC(0x00A9), _______, _______, _______, + MO(CSYM), UC(0x00E6), UC(0x00BF), _______, UC(0x00AC), UC(0x00A9), _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -133,9 +130,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ¨ | Á | § | Ð | | |------| |------| | | | Ø | ° | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Æ | | ¢ | | | | | | Ñ | | Ç | | | | + * | | Æ | | ¢ | ¦ | | | | | Ñ | | Ç | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | ¦ | | | | | | | | + * | | | | | | | | | | | | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -150,8 +147,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, UC(0x00B9), _______, _______, UC(0x00A3), _______, _______, _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), S(KC_R), UC(0x00DE), _______, UC(0x00A8), UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G), - _______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______, - _______, _______, _______, UC(0x00A6), _______, + _______, UC(0x00C6), UC(0x00A6), UC(0x00A2), S(KC_V), S(KC_B), _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -177,7 +174,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | 1 | 2 | 3 | = | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | , | ENTER| | + * | | | | | | |0/RALT|./RCTL| , | ENTER| | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -202,7 +199,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______, - KC_KP_0, KC_KP_DOT, KC_PCMM, KC_PENT, _______, + MT(MOD_RALT, KC_KP_0), MT(MOD_RCTL, KC_KP_DOT),KC_PCMM, KC_PENT, _______, _______, _______, _______, _______, _______, _______ @@ -223,7 +220,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | HOME | PGDN | END | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. - * | PAUSE|SYSREQ| | | | + * | SYSRQ| PAUSE| | | | * ,------|------|------| |------+------+------. * | | | | | | | | * | | |------| |------| | | @@ -235,13 +232,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, - _______, _______, _______, _______, _______, _______, _______, + _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, - KC_PAUSE, _______, + KC_SYSREQ, KC_PAUSE, _______, _______, _______, _______, // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SYSREQ, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, -- cgit v1.2.3 From e43e58aad15da922b05b75a682a338dc19680c7a Mon Sep 17 00:00:00 2001 From: Stick Date: Fri, 23 Jun 2017 16:28:06 -0500 Subject: updated README.md --- keyboards/ergodox/keymaps/familiar/README.md | 4 +--- keyboards/ergodox/keymaps/familiar/keymap.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/keyboards/ergodox/keymaps/familiar/README.md b/keyboards/ergodox/keymaps/familiar/README.md index 4438fccf0..536179337 100644 --- a/keyboards/ergodox/keymaps/familiar/README.md +++ b/keyboards/ergodox/keymaps/familiar/README.md @@ -45,9 +45,7 @@ $ make ergodox-ez-familiar-teensy ## Usage -NOTE: The keymap below is out of date. - -[![Familiar Layout](https://i.imgur.com/jflmkBb.png)](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644) +[![Familiar Layout](http://i.imgur.com/6nLN9UT.png)](https://gist.github.com/nstickney/13508a9f99cff381d58b7be6f7dcc644) ### Layers 1. Base Layer: QWERTY, with arrow keys at bottom right. diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c index e45751565..c0334615b 100644 --- a/keyboards/ergodox/keymaps/familiar/keymap.c +++ b/keyboards/ergodox/keymaps/familiar/keymap.c @@ -132,7 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | Æ | | ¢ | ¦ | | | | | Ñ | | Ç | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | + * | | | | | | | “ | ” | | | | * `------------------------------------' `------------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______, S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______, _______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______, - _______, _______, _______, _______, _______, + UC(0x201C), UC(0x201D), _______, _______, _______, _______, _______, _______, _______, _______, _______ -- cgit v1.2.3 From 8ad12b1eb7cc196943b26a7becfdab209789cdc3 Mon Sep 17 00:00:00 2001 From: npoirey Date: Fri, 23 Jun 2017 23:59:30 +0200 Subject: Updated frenchdev readme --- keyboards/handwired/frenchdev/readme.md | 58 +++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/keyboards/handwired/frenchdev/readme.md b/keyboards/handwired/frenchdev/readme.md index 47e4ade16..698b4befb 100644 --- a/keyboards/handwired/frenchdev/readme.md +++ b/keyboards/handwired/frenchdev/readme.md @@ -1,18 +1,55 @@ -# My take on a splitted keyboard +# Frenchdev : My take on a splitted keyboard for dev and french language +Concept based on + - [ergodox](https://ergodox-ez.com/) + - [katy](https://deskthority.net/workshop-f7/katy-keyboard-or-k80cs-key80-contoured-split-t8524.html) -default layout : -[default layout](http://i.imgur.com/r2Nvr4p.png) +with the added possibility to connect up to 6 external switches like pedals, + and somewhat like the katy, not all keys are on the same level for easier reach. -the thing when finished : -http://imgur.com/a/6FY8v +###Photos +- [default layout](http://i.imgur.com/r2Nvr4p.png) +- [editable layout on keyboard layout editor](http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa) (keys placement is NOT precise on this) +- [the thing when finished](http://imgur.com/a/6FY8v) +- [concept and cardboard mockup](http://imgur.com/a/R0vvs) -concept and mockup: -http://imgur.com/a/R0vvs - -to build : +##Build instructions docker run --rm -e keymap=default -e keyboard=frenchdev --rm -v D:/Repositories/qmk:/qmk:rw edasque/qmk_firmware +##Laser-cuttable file +There is intentionnaly no hole for the TRRS connector, you are supposed to use a drill for it. +This way if you don't want to use the pedals you don't have a useless hole. Plus it's cleaner. +http://qmk.fm/frenchdev/frenchdev_v1_lasercut_template.svg + +##Side stickers +You can find my original file here : http://qmk.fm/frenchdev/example_printable_stickers.svg + +I used it when training but now I use blanks and the layout is different. +I still uploaded it because I think it can be a good jumpstart for any temporary stickers on the +side of keycaps. + +##List of parts +- I2C mcp23018 +- [teensy 2](https://www.pjrc.com/store/teensy.html) +- 3 LED, 5mm tall with flat head +- 3 330 ohm resistor +- 2 470 ohm resistor +- 2 TRRS connectors +- 1 [micro usb breakout board](http://www.ebay.com/itm/-/201387922085?) +- 88 cherry/gateron switchs +- 94 4148 diodes +- 34 R4 keys +- 14 R3 keys +- 20 R2 keys +- 22 R1 keys + +if you fancy adding pedals : +[these are good enough and cheap](https://www.amazon.fr/gp/product/B00V7WITKI/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1). You also need a RCA connector for each of those to replace the included cable + +If you (or your coworkers) find them too loud you can replace the switch inside them. +For once we don't really care about what's inside :) + +##Various indications The PHYSICAL rows and columns are connected as such : @@ -57,8 +94,9 @@ and on left hand (main) : | E6 GND | `------------------' -we use pull up resistor for SCL et VDA, see https://github.com/ErgoDox-EZ/docs/blob/master/ErgoDox%20EZ%20Schematic.pdf for example +We use pull up resistor for SCL and VDA, see https://github.com/ErgoDox-EZ/docs/blob/master/ErgoDox%20EZ%20Schematic.pdf for example the connector is a standard TRRS (jack with audio + mic) Diode direction is row to column + -- cgit v1.2.3 From b4f2f44a6f4e80ab358e439ec3c4695fccdba189 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 23 Jun 2017 21:29:04 -0400 Subject: Create isp_flashing_guide.md --- docs/isp_flashing_guide.md | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 docs/isp_flashing_guide.md diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md new file mode 100644 index 000000000..02b34497e --- /dev/null +++ b/docs/isp_flashing_guide.md @@ -0,0 +1,106 @@ +# ISP Flashing Guide + +If you're having trouble flashing/erasing your board, and running into cryptic error messages like any of the following: + + libusb: warning [darwin_transfer_status] transfer error: timed out + dfu.c:844: -ETIMEDOUT: Transfer timed out, NAK 0xffffffc4 (-60) + atmel.c:1627: atmel_flash: flash data dfu_download failed. + atmel.c:1629: Expected message length of 1072, got -60. + atmel.c:1434: Error flashing the block: err -2. + ERROR + Memory write error, use debug for more info. + commands.c:360: Error writing memory data. (err -4) + + dfu.c:844: -EPIPE: a) Babble detect or b) Endpoint stalled 0xffffffe0 (-32) + Device is write protected. + dfu.c:252: dfu_clear_status( 0x7fff4fc2ea80 ) + atmel.c:1434: Error flashing the block: err -2. + ERROR + Memory write error, use debug for more info. + commands.c:360: Error writing memory data. (err -4) + +You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions! + +## Software needed + +* [The Arduino IDE](https://www.arduino.cc/en/Main/Software) +* [Teensyduino](https://www.pjrc.com/teensy/td_download.html) (if you're using a Teensy) +* [WinAVR](http://www.ladyada.net/learn/avr/setup-win.html) (Windows) + +## Wiring + +This is pretty straight-forward - we'll be connecting like-things to like-things in the following manner: + + Flasher B0 <-> Keyboard RESET + Flasher B1 <-> Keyboard B1 (SCLK) + Flasher B2 <-> Keyboard B2 (MOSI) + Flasher B3 <-> Keyboard B3 (MISO) + Flasher VCC <-> Keyboard VCC + Flasher GND <-> Keyboard GND + +## The ISP firmware + +Make sure your keyboard is unplugged from any device, and plug in your Teensy. + +1. Run Arduino after you have everything installed +2. Select `Tools > Board * > Teensy 2.0` +3. Click `File > Examples > 11.ArduinoISP > ArduinoISP` + +Then scroll down until you see something that looks like this block of code: + + // Configure which pins to use: + + // The standard pin configuration. + #ifndef ARDUINO_HOODLOADER2 + + #define RESET 0 // Use 0 (B0) instead of 10 + #define LED_HB 11 // Use 11 (LED on the Teensy 2.0) + #define LED_ERR 8 // This won't be used unless you have an LED hooked-up to 8 (D3) + #define LED_PMODE 7 // This won't be used unless you have an LED hooked-up to 7 (D2) + +And make the changes in the last four lines. If you're using something besides the Teenys 2.0, you'll want to choose something else that makes sense for `LED_HB`. We define `RESET` as `0`/`B0` because that's what's close - if you want to use another pin for some reason, [you can use the pinouts to choose something else](https://www.pjrc.com/teensy/pinout.html). + +Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action. + +## The .hex file + +Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it. + +It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard. + +## Flashing your firmware + +Make sure your keyboard is unplugged from any device, and plug in your Teensy. + +Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with: + + avrdude -c avrisp -P COM3 -p atmega32u4 + +and you should get something like the following output: + + avrdude: AVR device initialized and ready to accept instructions + + Reading | ################################################## | 100% 0.02s + + avrdude: Device signature = 0x1e9587 + + avrdude: safemode: Fuses OK + + avrdude done. Thank you. + +Since our keyboard uses an `atmega32u4` (common), that is the chip we'll specify. This is the full command: + + avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i + +You should see a couple of progress bars, then you should see: + + avrdude: verifying ... + avrdude: 32768 bytes of flash verified + + avrdude: safemode: Fuses OK + + avrdude done. Thank you. + +Which means everything should be ok! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works. + +If you have any questions/problems, feel free to [open an issue](https://github.com/qmk/qmk_firmware/issues/new)! -- cgit v1.2.3 From 918aea5b473ebc1dee99c8ac967b8167e8b852b6 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 23 Jun 2017 21:29:35 -0400 Subject: Update _summary.md --- docs/_summary.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_summary.md b/docs/_summary.md index 23128cafe..88ed75117 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -23,6 +23,7 @@ * [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md) * [Modding your keyboard](modding_your_keyboard.md) * [Adding features to QMK](adding_features_to_qmk.md) +* [ISP flashing guide](isp_flashing_guide.md) ### Other topics * [General FAQ](faq.md) -- cgit v1.2.3