diff options
| author | Maxr1998 <max.rumpf1998@gmail.com> | 2020-05-14 01:33:29 +0200 |
|---|---|---|
| committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-05-17 13:05:06 -0700 |
| commit | 4161573b2829ff1e1f17cb6b37b16d45e785f909 (patch) | |
| tree | 009fa10f232f5578bcf6c271b00445eda5e067d1 /keyboards/maxr1998/pulse4k | |
| parent | d0e684ef55fdcea2019eebdd0dd54903b3d67af3 (diff) | |
| download | qmk_firmware-4161573b2829ff1e1f17cb6b37b16d45e785f909.tar.gz qmk_firmware-4161573b2829ff1e1f17cb6b37b16d45e785f909.zip | |
[Pulse4k] Various improvements
Rework led adjustment combo (have it defined by keymap now), reformat code, update copyright
Diffstat (limited to 'keyboards/maxr1998/pulse4k')
| -rw-r--r-- | keyboards/maxr1998/pulse4k/config.h | 30 | ||||
| -rw-r--r-- | keyboards/maxr1998/pulse4k/keymaps/default/keymap.c | 34 | ||||
| -rw-r--r-- | keyboards/maxr1998/pulse4k/pulse4k.c | 48 | ||||
| -rw-r--r-- | keyboards/maxr1998/pulse4k/pulse4k.h | 30 |
4 files changed, 66 insertions, 76 deletions
diff --git a/keyboards/maxr1998/pulse4k/config.h b/keyboards/maxr1998/pulse4k/config.h index d1bfaf300..078b91499 100644 --- a/keyboards/maxr1998/pulse4k/config.h +++ b/keyboards/maxr1998/pulse4k/config.h | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright (C) 2012-2019 Jun Wako <wakojun@gmail.com>, Maxr1998 <max.rumpf1998@gmail.com> | 2 | * Copyright (C) 2019-2020 Maxr1998 <max.rumpf1998@gmail.com> |
| 3 | 3 | * | |
| 4 | This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 2 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | (at your option) any later version. | 7 | * (at your option) any later version. |
| 8 | 8 | * | |
| 9 | This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | 13 | * | |
| 14 | You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #pragma once | 18 | #pragma once |
| 19 | 19 | ||
diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c index 67331235b..46de247aa 100644 --- a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c +++ b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c | |||
| @@ -1,26 +1,28 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com> | 2 | * Copyright (C) 2019-2020 Maxr1998 <max.rumpf1998@gmail.com> |
| 3 | 3 | * | |
| 4 | This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 2 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | (at your option) any later version. | 7 | * (at your option) any later version. |
| 8 | 8 | * | |
| 9 | This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | 13 | * | |
| 14 | You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include QMK_KEYBOARD_H | 18 | #include QMK_KEYBOARD_H |
| 19 | 19 | ||
| 20 | enum layers { | 20 | enum layers { |
| 21 | DEFAULT | 21 | DEFAULT |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END}; | ||
| 25 | |||
| 24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 26 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 25 | [DEFAULT] = { | 27 | [DEFAULT] = { |
| 26 | { KC_END, KC_UP, KC_MUTE }, | 28 | { KC_END, KC_UP, KC_MUTE }, |
diff --git a/keyboards/maxr1998/pulse4k/pulse4k.c b/keyboards/maxr1998/pulse4k/pulse4k.c index 2ec9dca73..61a18af74 100644 --- a/keyboards/maxr1998/pulse4k/pulse4k.c +++ b/keyboards/maxr1998/pulse4k/pulse4k.c | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com> | 2 | * Copyright (C) 2019-2020 Maxr1998 <max.rumpf1998@gmail.com> |
| 3 | 3 | * | |
| 4 | This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 2 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | (at your option) any later version. | 7 | * (at your option) any later version. |
| 8 | 8 | * | |
| 9 | This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | 13 | * | |
| 14 | You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "pulse4k.h" | 18 | #include "pulse4k.h" |
| 19 | #include "rgblight.h" | 19 | #include "rgblight.h" |
| @@ -22,7 +22,7 @@ enum combo_events { | |||
| 22 | LED_ADJUST | 22 | LED_ADJUST |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END}; | 25 | extern const uint16_t PROGMEM led_adjust_combo[3]; |
| 26 | 26 | ||
| 27 | combo_t key_combos[COMBO_COUNT] = { | 27 | combo_t key_combos[COMBO_COUNT] = { |
| 28 | [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) | 28 | [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) |
| @@ -30,10 +30,6 @@ combo_t key_combos[COMBO_COUNT] = { | |||
| 30 | 30 | ||
| 31 | bool led_adjust_active = false; | 31 | bool led_adjust_active = false; |
| 32 | 32 | ||
| 33 | void matrix_init_kb(void) { | ||
| 34 | matrix_init_user(); | ||
| 35 | } | ||
| 36 | |||
| 37 | void process_combo_event(uint8_t combo_index, bool pressed) { | 33 | void process_combo_event(uint8_t combo_index, bool pressed) { |
| 38 | if (combo_index == LED_ADJUST) { | 34 | if (combo_index == LED_ADJUST) { |
| 39 | led_adjust_active = pressed; | 35 | led_adjust_active = pressed; |
| @@ -61,17 +57,9 @@ void encoder_update_kb(uint8_t index, bool clockwise) { | |||
| 61 | } | 57 | } |
| 62 | 58 | ||
| 63 | __attribute__((weak)) void encoder_one_update(bool clockwise) { | 59 | __attribute__((weak)) void encoder_one_update(bool clockwise) { |
| 64 | if (clockwise) { | 60 | tap_code(!clockwise ? KC_PGUP : KC_PGDN); |
| 65 | tap_code(KC_PGDN); | ||
| 66 | } else { | ||
| 67 | tap_code(KC_PGUP); | ||
| 68 | } | ||
| 69 | } | 61 | } |
| 70 | 62 | ||
| 71 | __attribute__((weak)) void encoder_two_update(bool clockwise) { | 63 | __attribute__((weak)) void encoder_two_update(bool clockwise) { |
| 72 | if (clockwise) { | 64 | tap_code(!clockwise ? KC_VOLD : KC_VOLU); |
| 73 | tap_code(KC_VOLU); | ||
| 74 | } else { | ||
| 75 | tap_code(KC_VOLD); | ||
| 76 | } | ||
| 77 | } | 65 | } |
diff --git a/keyboards/maxr1998/pulse4k/pulse4k.h b/keyboards/maxr1998/pulse4k/pulse4k.h index 7c34870d6..cc0a373b6 100644 --- a/keyboards/maxr1998/pulse4k/pulse4k.h +++ b/keyboards/maxr1998/pulse4k/pulse4k.h | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com> | 2 | * Copyright (C) 2019-2020 Maxr1998 <max.rumpf1998@gmail.com> |
| 3 | 3 | * | |
| 4 | This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 2 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | (at your option) any later version. | 7 | * (at your option) any later version. |
| 8 | 8 | * | |
| 9 | This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | 13 | * | |
| 14 | You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #pragma once | 18 | #pragma once |
| 19 | 19 | ||
