diff options
Diffstat (limited to 'users/wanleg')
-rw-r--r-- | users/wanleg/config.h | 19 | ||||
-rw-r--r-- | users/wanleg/readme.md | 133 | ||||
-rw-r--r-- | users/wanleg/rules.mk | 6 | ||||
-rw-r--r-- | users/wanleg/wanleg.c | 41 | ||||
-rw-r--r-- | users/wanleg/wanleg.h | 45 |
5 files changed, 209 insertions, 35 deletions
diff --git a/users/wanleg/config.h b/users/wanleg/config.h index 0c8b048af7..d29054694c 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -6,9 +6,9 @@ //MIGHT HAVE TO SPLIT THIS INTO TWO CONDITIONS -#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_iris_rev2) +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_keebio_iris_rev2) //Kailh Coppers activate quickly and don't need a long tapping term -#define TAPPING_TERM 100 +#define TAPPING_TERM 180 #elif defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_bigswitch) #define TAPPING_TERM 700 @@ -38,7 +38,14 @@ #define NO_ACTION_FUNCTION #define NO_ACTION_ONESHOT -// Disable mod tap interrrupt -#ifndef IGNORE_MOD_TAP_INTERRUPT -#define IGNORE_MOD_TAP_INTERRUPT -#endif // !mod tap interrrupt
\ No newline at end of file + +#define PERMISSIVE_HOLD +//// Disable mod tap interrrupt +//#ifndef IGNORE_MOD_TAP_INTERRUPT +//#define IGNORE_MOD_TAP_INTERRUPT +//#endif // !mod tap interrrupt + +//set max breathing brightness on kbd6x +#if defined(KEYBOARD_kbdfans_kbd6x) +#define RGBLIGHT_EFFECT_BREATHE_MAX 128 // 0-255 +#endif diff --git a/users/wanleg/readme.md b/users/wanleg/readme.md index f687b92f48..4276111280 100644 --- a/users/wanleg/readme.md +++ b/users/wanleg/readme.md @@ -1,14 +1,125 @@ -Copyright 2018 Brian Fong @wanleg +# Contents + * [Git Basics](#git-basics) + * [Update a Feature Branch](#update-a-development-branch) + * [Delete Branch Locally and Remotely](#delete-branch-locally-and-remotely) + * [Merge TEST branch into DEV branch](#merge-test-branch-into-dev-branch) + * [STM32F103C8T6 Setup](#STM32F103C8T6-setup) + * [Bootloader](#bootloader) + * [Flashing QMK](#flashing-qmk) -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. +--- +## Git Basics +### Update a Development Branch -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. +This is how to update a working branch with upstream changes. +First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch) +```bash +$ git checkout master +``` -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. +Fetch the remote, bringing the branches and their commits from the remote repository. +You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master +```bash +$ git fetch -p origin +``` + +Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward". +```bash +$ git merge origin/master +``` + +Checkout the branch you want to merge into +```bash +$ git checkout <feature-branch> +``` + +Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team. +```bash +$ git merge master +``` + +This will open your git-configured text editor. Edit the message as desired, save, and exit the editor. + +The above steps only update your local feature branch. To update it on GitHub, push your changes. +```bash +$ git push origin <feature-branch> +``` + +### Delete Branch Locally and Remotely + +Executive Summary +```bash +$ git push --delete <remote_name> <branch_name> +$ git branch -d <branch_name> +``` +Note that in most cases the remote name is origin. + +Delete Local Branch +To delete the local branch use one of the following: +```bash +$ git branch -d branch_name +$ git branch -D branch_name +``` +Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its merged status." [Source: man git-branch] + +Delete Remote Branch [Updated on 8-Sep-2017] +As of Git v1.7.0, you can delete a remote branch using +```bash +$ git push <remote_name> --delete <branch_name> +``` +which might be easier to remember than +```bash +$ git push <remote_name> :<branch_name> +``` +which was added in Git v1.5.0 "to delete a remote branch or a tag." + +Starting on Git v2.8.0 you can also use `git push` with the `-d` option as an alias for `--delete`. + +Therefore, the version of Git you have installed will dictate whether you need to use the easier or harder syntax. + +### Merge TEST branch into DEV branch + +Executive Summary +```bash +$ git checkout DEV +$ git merge TEST +$ git push <remote_name> DEV +$ git branch -d TEST +$ git push <remote_name> :TEST +``` +Note that in most cases the remote name is origin. +The above code will merge, push to remote, and delete both the local and remote TEST branches + +--- +## STM32F103C8T6 Setup +Cheap "Blue/Black Pills" typically do not come with a bootloader installed. The Black Pill uses [generic_boot20_pb12.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pb12.bin). The Blue Pill uses [generic_boot20_pc13.bin](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pc13.bin). +The following instructions have been adapted from [here](http://wiki.stm32duino.com/index.php?title=Burning_the_bootloader). +### Bootloader +Flashing a bootloader on to a Black Pill can be done via a USB to Serial converter (e.g. CP2102). This process should be roughly the same for all F103 boards. + +1. Download the correct bootloader binary +2. Set the 'boot 0' pin/jumper high, and 'boot 1' low + B0+ to center pin + B1- to center pin +3. Connect the board to the PC using a USB to serial converter + RX to PA9 + TX to PA10 + GND to Ground + 3.3V to 3.3 Volts +4. Download and install __Flash Loader Demonstrator__ from [here](http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html) +5. Use __Flash Loader Demonstrator__ to flash the bootloader + Ensure the correct COM port is selected. Leave other options with their default values/selections. + Use the "Download to Device" option, with "Erase necessary pages" selected +6. After a successful flash, set 'boot 0' pin/jumper low + B0- to center pin + B1- to center pin (no change) + +### Flashing QMK +As of April 2019, the `:dfu-util` target doesn't work on a \*Pill. You will need to use dfu-util directly. +1. Use QMK to build your `.bin` +2. Run `dfu-util.exe -d 1eaf:0003 -a 2 -D YOUR_FIRMWARE.bin"` + If this is the first QMK flash on the \*Pill, you will need to synchronize your Reset Button-push with starting the command. By default, the \*Pill only stays in bootloader mode for about 3 seconds before returning to normal operation. + +See [this page](https://docs.qmk.fm/#/faq_build?id=unknown-device-for-dfu-bootloader) if Windows can't see anything to upload to. + +--- diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index b069cd8d38..eb66a49e6f 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -36,4 +36,10 @@ ifeq ($(strip $(padc)), yes) endif ifeq ($(strip $(padl)), yes) OPT_DEFS += -DPADL +endif + +#change gherkin orientation (i.e. move USB port from right side to left side) +#example usage: make gherkin:wanleg flip=yes +ifeq ($(strip $(flip)), yes) + OPT_DEFS += -DFLIP endif
\ No newline at end of file diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 274c74f728..aa7b1c9a4c 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -6,20 +6,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); set_single_persistent_default_layer(_QW); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(0,0,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING); + #endif } return false; break; case GHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(_GK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,64); + #endif } return false; break; case gGHERKIN: if (record->event.pressed) { set_single_persistent_default_layer(gGK); + #if defined(RGBLIGHT_ENABLE) + rgblight_sethsv_noeeprom(128,255,128); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT); + #endif } return false; break; @@ -113,6 +123,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + //on RESET, underglow red if present + case RESET: + if (record->event.pressed) { + #if defined(RGBLIGHT_ENABLE) + rgblight_enable_noeeprom(); // enables Rgb, without saving settings + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom_red(); + #endif + } + return true; // Let QMK send the press/release events as normal + break; } return true; } @@ -128,6 +149,7 @@ void matrix_init_keymap(void) {} // Call user matrix init, then call the keymap's init function void matrix_init_user(void) { +//turn off pro micro LEDs #if defined(KEYBOARD_lets_split_rev2) DDRD &= ~(1<<5); PORTD &= ~(1<<5); @@ -135,5 +157,20 @@ void matrix_init_user(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); #endif + +//disable backlight breathing for keyboard using random flashing RGB LEDs for backlight +//(breathing provides insufficient power to integrated LED IC) +#if defined(KEYBOARD_kbdfans_kbd6x) && defined(BACKLIGHT_BREATHING) + breathing_disable(); +#endif matrix_init_keymap(); -}
\ No newline at end of file +} + +//at end of firmware startup process, change powerup default layer and underglow colour for kbd6x +void keyboard_post_init_user(void) { + #if defined(KEYBOARD_kbdfans_kbd6x) + set_single_persistent_default_layer(_QW); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5); + rgblight_sethsv_noeeprom(0,0,128); + #endif +} diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 9d07760a7b..2aea1a31e7 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -3,7 +3,7 @@ #include "quantum.h" // Define layer names and order -#ifdef KEYBOARD_gherkin +#if defined(KEYBOARD_40percentclub_gherkin) || defined(KEYBOARD_kbdfans_kbd6x) enum userspace_layers { gGK = 0, gNUM, @@ -118,22 +118,22 @@ enum { // lengths consistent. -/* Pure Gherkin +/* Gherkin * .-----------------------------------------------------------------------------------------. * | Q//ESC | W | E | R | T | Y | U | I | O | P | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | A | S | D | F | G | H | J | K | L | SPACE | * | | | | | | | | | |SFThold | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BSPC | + * | Z | X | C | V/gNUM | B/gETC | N/Fn | M/gDIR | ,/GUI | ./ALT | BSPC | * | SFThold| | | | | | | | |CTRLhold| * '-----------------------------------------------------------------------------------------' */ #define _______________Gherkin_Row_0_______________ TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P #define _______________Gherkin_Row_1_______________ KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC) -#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), KC_N, LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) +#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), LT(_FN,KC_N), LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Directional Keys +/* Gherkin Directional Keys * .-----------------------------------------------------------------------------------------. * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -146,7 +146,7 @@ enum { #define _______________Gherkin_DIR_1_______________ KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC #define _______________Gherkin_DIR_2_______________ KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH -/* Numbers +/* Gherkin Numbers * .-----------------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -160,16 +160,16 @@ enum { #define _______________Gherkin_NUM_1_______________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 #define _______________Gherkin_NUM_2_______________ KC_F11, KC_F12, _______,_______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) -/* Et Cetera +/* Gherkin Et Cetera * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | + * | ` | mUP | | ESC | RESET | SHIFT | mScrDn | mScrUp | | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Sft//Cp| CAPS | | | | C-A-D | mScrL | mScrR | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ -#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS +#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,KC_ESC, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS #define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT #define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),KC_CAPS, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL @@ -180,7 +180,7 @@ enum { * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| + * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N/Fn | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| * | |SFThold | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | LCTRL | LGUI | ALT | ONEHAND| NUM | ETC | SPACE | DIR | RGUI | ALT | DEL | CTRL | @@ -188,7 +188,7 @@ enum { */ #define _______________GherkinLike_0_______________ KC_ESC, _______________Gherkin_Row_0_______________, KC_BSPC #define _______________GherkinLike_1_______________ KC_TAB, _______________Gherkin_Row_1_______________, KC_QUOT -#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) +#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),LT(_FN,KC_N), LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) #define _______________GherkinLike_3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL #define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, ONEHAND, KC_RCTL @@ -241,7 +241,7 @@ enum { #define _______________SUBTER_Row__2_______________ _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_RGUI,ALT_T(KC_DOT), CTL_T(KC_BSPC), _______ #define _______________SUBTER_Row__3_______________ _______, _______, GHERKIN, _______, _______, _______, KC_ENT, KC_LSFT, _______,_______, _______, _______ -/* Gherkin Numbers +/* Gherkin-Like Numbers * .-----------------------------------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -259,7 +259,7 @@ enum { #define _______________NUMBERS_Row_3_______________ _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______, _______ -/* Gherkin Directional Keys +/* Gherkin-Like Directional Keys * .-----------------------------------------------------------------------------------------------------------. * | | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -275,9 +275,9 @@ enum { #define _____________DIRECTIONS_Row__2_____________ _______, _______________Gherkin_DIR_2_______________, _______ #define _____________DIRECTIONS_Row__3_____________ _______, _______, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, _______ -/* Gherkin Et Cetera +/* Gherkin-Like Et Cetera * .-----------------------------------------------------------------------------------------------------------. - * | | ` | mUP | | | RESET | SHIFT | mScrUp |mScrDown| | \ | DEL | + * | | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -290,7 +290,7 @@ enum { #define ______________ETCETERA_Row__1______________ _______, _______________Gherkin_ETC_1_______________, _______ #define ______________ETCETERA_Row__2______________ _______, _______________Gherkin_ETC_2_______________, _______ #define ______________ETCETERA_Row__3______________ _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______, _______ - + /* Single 4x4 board only * .-----------------------------------. * | 7 | 8 | 9 | BSPC | @@ -307,3 +307,16 @@ enum { #define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC #define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT #define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS + +/* Gherkin FN/Lighting + * .-----------------------------------------------------------------------------------------------------. + * | BL_breathe | BL_brite- | BL_brite+ | BL_toggle | BL_briteCyc | BL_briteMax | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_breathe | UG_brite- | UG_brite+ | UG_toggle | UG_modeCycle| | | | | | + * |------------+-----------+-----------+-----------+-------------+-------------+-----+-----+-----+------| + * | UG_hue- | UG_hue+ | UG_sat- | UG_sat+ | | | | | |QWERTY| + * '-----------------------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_FN_0________________ BL_BRTG, BL_DEC, BL_INC, BL_TOGG, BL_STEP, BL_ON, _______, _______, _______, _______ +#define _______________Gherkin_FN_1________________ RGB_M_B, RGB_VAD, RGB_VAI, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______ +#define _______________Gherkin_FN_2________________ RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, QWERTY |