Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
qmk-bot committed Dec 15, 2022
2 parents 9e29fe1 + 33cc81f commit 62b89f8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
36 changes: 11 additions & 25 deletions layouts/community/ortho_4x12/jotix/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

enum layers {
_QWERTY,
_TCURSOR,
_LOWER,
_RAISE,
_NUMPAD,
_ADJUST,
};

#define TCURSOR TG(_TCURSOR)
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define NUMPAD MO(_NUMPAD)
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define NUMPAD TG(_NUMPAD)
#define ADJUST MO(_ADJUST)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

Expand All @@ -24,19 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_ENT,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
KC_LCTL,KC_LGUI,KC_LALT,NUMPAD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),

[_TCURSOR] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_UP, _______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,KC_SLSH,KC_LEFT,KC_DOWN,KC_RGHT
KC_LCTL,KC_LGUI,KC_LALT,KC_RALT,LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),

Expand All @@ -60,13 +47,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END
_______,_______,_______,_______,ADJUST, _______,NUMPAD, _______,KC_HOME,KC_PGDN,KC_PGUP,KC_END
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),

[_NUMPAD] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
_______,KC_BTN1,KC_MS_U,KC_BTN2,KC_WH_U,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,_______,
NUMPAD, KC_BTN1,KC_MS_U,KC_BTN2,KC_WH_U,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_D,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
Expand All @@ -78,21 +65,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_ADJUST] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
_______,QK_BOOT,_______,_______,RGB_TOG,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,_______,_______,_______,
_______,QK_BOOT,_______,_______,QK_RBT, _______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,RGB_SAI,RGB_SAD,_______,_______,RGB_HUI,RGB_HUD,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,RGB_VAI,RGB_VAD,_______,RGB_MOD,RGB_RMOD,TCURSOR,_______,
_______,_______,_______,_______,_______,_______,_______,QK_MAKE,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
};

layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _NUMPAD, _RAISE, _ADJUST);
#ifdef JOTANCK_LEDS
writePin(JOTANCK_LED2, (IS_LAYER_ON(_TCURSOR)));
writePin(JOTANCK_LED2, (IS_LAYER_ON_STATE(state, _NUMPAD)));
#endif
return state;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/community/ortho_4x12/jotix/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DYNAMIC_MACRO_ENABLE = yes
BOOTMAGIC_ENABLE = yes
4 changes: 3 additions & 1 deletion quantum/rgblight/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,8 @@ void rgblight_effect_twinkle(animation_status_t *anim) {
return (v * scale) >> 8;
}

const uint8_t trigger = scale((uint16_t)0xFF * RGBLIGHT_EFFECT_TWINKLE_PROBABILITY, 127 + rgblight_config.val / 2);

for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) {
TwinkleState *t = &(led_twinkle_state[i]);
HSV * c = &(t->hsv);
Expand All @@ -1498,7 +1500,7 @@ void rgblight_effect_twinkle(animation_status_t *anim) {
t->life--;
uint8_t unscaled = frac(breathe_calc(frac(t->life, t->max_life)) - bottom, top - bottom);
c->v = scale(rgblight_config.val, unscaled);
} else if (rand() < scale((uint16_t)RAND_MAX * RGBLIGHT_EFFECT_TWINKLE_PROBABILITY, 127 + rgblight_config.val / 2)) {
} else if ((rand() % 0xFF) < trigger) {
// This LED is off, but was randomly selected to start brightening
if (random_color) {
c->h = rand() % 0xFF;
Expand Down

0 comments on commit 62b89f8

Please sign in to comment.