Skip to content

Commit

Permalink
Merge pull request #1 from solartempest/master
Browse files Browse the repository at this point in the history
solartempest merge
  • Loading branch information
crembz authored Jun 15, 2022
2 parents de207b9 + 29b3de7 commit 6de3040
Show file tree
Hide file tree
Showing 101 changed files with 21,976 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
# QMK-specific
api_data/v1
quantum/version.h
*.bin
#*.bin
*.eep
*.hex
#*.hex
*.qmk
*.uf2
.lnk

# Old-style QMK Makefiles
/keyboards/*/Makefile
Expand Down
2 changes: 1 addition & 1 deletion keyboards/aleblazer/zodiark/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

/* USB Device descriptor parameter */
#define VENDOR_ID 0xF901
#define PRODUCT_ID 0xF902
//#define PRODUCT_ID 0xF902
#define DEVICE_VER 0x0001
#define MANUFACTURER Aleblazer
#define PRODUCT Zodiark
Expand Down

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions keyboards/aleblazer/zodiark/keymaps/solartempest/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Copyright 2021 Spencer Deven <splitlogicdesign@gmail.com>
Copyright 2021 solartempest
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

#define MASTER_LEFT

#undef PRODUCT_ID
#define PRODUCT_ID 0xFF02 //Original was 0xF902. If the same ID is used, VIA will fail to reload saved layouts.

#undef MATRIX_ROWS
#undef MATRIX_COLS
#undef MATRIX_ROW_PINS
#undef MATRIX_COL_PINS
#undef ENCODER_RESOLUTION
#define MATRIX_ROWS 10
#define MATRIX_COLS 8 //Added extra column for rotary encoder VIA mapping.
#define MATRIX_ROW_PINS { C6, D7, E6, B4, F4 }
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, NO_PIN } //A virtual pin is needed for the encoder key matrix in via.
#define ENCODER_RESOLUTION 4 //Reduce encoder double-input issue.

#undef DEBOUNCE
#define DEBOUNCE 6 //Default is 5

// Tapping settings
#define TAP_CODE_DELAY 10
#define TAPPING_TOGGLE 2 //Tap TT twice to toggle layer
#define TAPPING_TERM 160 //Tapping duration in ms

// Disabled to save space
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
#define NO_ACTION_ONESHOT //Save 244 bytes (-244).
#define NO_RESET //Save 40 bytes (-40).
#define LAYER_STATE_8BIT //For less than 8 bits worth of layers.
#undef LOCKING_SUPPORT_ENABLE //For MX lock keys only.
#undef LOCKING_RESYNC_ENABLE //For MX lock keys only.

#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#define OLED_TIMEOUT 80000 //80000 = 80secs, 120000 = 2mins in ms.
#define SPLIT_OLED_ENABLE //Synx on/off OLED state between halves (+100).
#define OLED_LOGO //Enable to print snakey custom logo on slave side (+108).
#endif

#ifdef RGBLIGHT_ENABLE
#undef RGBLIGHT_ANIMATIONS // Very memory intensive (+2604)
#define RGBLIGHT_EFFECT_STATIC_GRADIENT //Preferred RGB effect (+262)
//#define RGBLIGHT_EFFECT_BREATHING //Testing
//#define RGBLIGHT_EFFECT_SNAKE //For testing LED order
#define RGBLIGHT_SLEEP //Turn off LEDs when computer sleeping (+72)
#endif

// Pimoroni trackball settings
#ifdef POINTING_DEVICE_ENABLE
//#define PIMORONI_TRACKBALL_INTERVAL_MS 6 //Default is 8ms
#define POINTING_DEVICE_ROTATION_90
#define PIMORONI_TRACKBALL_INVERT_Y
#define PIMORONI_TRACKBALL_INVERT_X
#endif

#ifdef VIA_ENABLE
#define DYNAMIC_KEYMAP_LAYER_COUNT 5
#endif

#define D2SKATE_MACRO_ENABLE //Enable Destiny 2 hunter skate macro (+224)
48 changes: 48 additions & 0 deletions keyboards/aleblazer/zodiark/keymaps/solartempest/encoder.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* Copyright
* 2021 solartempest
* 2021 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


#ifdef ENCODER_ENABLE
static uint8_t encoder_state[2] = {0};
static keypos_t encoder_ccw[2] = {{7, 4}, {7, 9}}; //Use these keymap positions to specify the encoder functions on rotate.
static keypos_t encoder_cw[2] = {{7, 3}, {7, 8}};

void encoder_action_unregister(void) {
for (int index = 0; index < 2; ++index) {
if (encoder_state[index]) {
keyevent_t encoder_event = (keyevent_t){.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, .time = (timer_read() | 1)};
encoder_state[index] = 0;
action_exec(encoder_event);
}
}
}

void encoder_action_register(uint8_t index, bool clockwise) {
keyevent_t encoder_event = (keyevent_t){.key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, .time = (timer_read() | 1)};
encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
action_exec(encoder_event);
}

//void matrix_scan_user(void) { encoder_action_unregister(); } //Included in keymap.c instead

bool encoder_update_user(uint8_t index, bool clockwise) {
encoder_action_register(index, clockwise);
return false;
};
#endif

Loading

0 comments on commit 6de3040

Please sign in to comment.