Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into xap
Browse files Browse the repository at this point in the history
  • Loading branch information
qmk-bot committed Oct 28, 2024
2 parents 2088bb3 + 01f6fa7 commit b394a46
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 11 deletions.
55 changes: 55 additions & 0 deletions keyboards/madjax_macropad/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"manufacturer": "MadJax",
"keyboard_name": "madjax_macropad",
"maintainer": "guidoism",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"cols": ["GP26", "GP27", "GP28", "GP29"],
"rows": ["GP6", "GP7", "GP0", "GP4", "GP3"]
},
"encoder": {
"rotary": [
{"pin_a": "GP1", "pin_b": "GP2"}
]
},
"processor": "RP2040",
"url": "https://github.com/guidoism/madjax_macropad",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3},
{"matrix": [4, 0], "x": 0, "y": 4},
{"matrix": [4, 1], "x": 1, "y": 4},
{"matrix": [4, 2], "x": 2, "y": 4},
{"matrix": [4, 3], "x": 3, "y": 4}
]
}
}
}
49 changes: 49 additions & 0 deletions keyboards/madjax_macropad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

enum custom_keycodes {
KC_P00 = SAFE_RANGE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌───┐
* │ - │
* ┌───┬───┬───┼───┤
* │ 7 │ 8 │ 9 │ + │
* ├───┼───┼───┼───┤
* │ 4 │ 5 │ 6 │ % │
* ├───┼───┼───┼───┤
* │ 1 │ 2 │ 3 │ = │
* ├───┼───┼───┼───┤
* │ 0 │00 │ . │Ent│
* └───┴───┴───┴───┘
*/
[0] = LAYOUT(
KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PERC,
KC_P1, KC_P2, KC_P3, KC_EQL,
KC_P0, KC_P00, KC_PDOT, KC_PENT
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case KC_P00:
tap_code(KC_P0);
tap_code(KC_P0);
return false;
}
}
return true;
}

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) }
};
#endif
1 change: 1 addition & 0 deletions keyboards/madjax_macropad/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
24 changes: 24 additions & 0 deletions keyboards/madjax_macropad/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# MadJax Macropad

* Keyboard Maintainer: [Guido Bartolucci](https://github.com/guidoism)
* Hardware Supported: Seeed Studio XIAO RP2040
* Hardware Availability: https://github.com/guidoism/madjax_macropad

Make example for this keyboard (after setting up your build environment):

make madjax_macropad:default

Flashing example for this keyboard:

make madjax_macropad:default:flash

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

## Bootloader

Enter the bootloader in 3 ways:

* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

18 changes: 7 additions & 11 deletions quantum/rgb_matrix/animations/riverflow_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ RGB_MATRIX_EFFECT(RIVERFLOW)

// inspired by @PleasureTek's Massdrop Alt LED animation

bool RIVERFLOW(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
for (uint8_t i = led_min; i < led_max; i++) {
RGB_MATRIX_TEST_LED_FLAGS();
hsv_t hsv = rgb_matrix_config.hsv;
uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8);
hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}
hsv_t RIVERFLOW_math(hsv_t hsv, uint8_t i, uint8_t time) {
time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8);
hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
return hsv;
}

return rgb_matrix_check_finished_leds(led_max);
bool RIVERFLOW(effect_params_t* params) {
return effect_runner_i(params, &RIVERFLOW_math);
}

# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
Expand Down

0 comments on commit b394a46

Please sign in to comment.