diff options
Diffstat (limited to 'keyboards/ploopyco')
-rw-r--r-- | keyboards/ploopyco/mouse/mouse.c | 19 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball/trackball.c | 12 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball_mini/trackball_mini.c | 18 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball_nano/trackball_nano.c | 4 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball_thumb/rev1_001/config.h | 24 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball_thumb/trackball_thumb.c | 13 |
6 files changed, 8 insertions, 82 deletions
diff --git a/keyboards/ploopyco/mouse/mouse.c b/keyboards/ploopyco/mouse/mouse.c index 19bc17738e..72535bf546 100644 --- a/keyboards/ploopyco/mouse/mouse.c +++ b/keyboards/ploopyco/mouse/mouse.c @@ -49,7 +49,7 @@ keyboard_config_t keyboard_config; uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) +#define DPI_OPTION_SIZE ARRAY_SIZE(dpi_array) // TODO: Implement libinput profiles // https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html @@ -167,21 +167,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { #endif } -/* If Mousekeys is disabled, then use handle the mouse button - * keycodes. This makes things simpler, and allows usage of - * the keycodes in a consistent manner. But only do this if - * Mousekeys is not enable, so it's not handled twice. - */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); - pointing_device_send(); - } - -#endif - return true; } @@ -202,7 +187,7 @@ void keyboard_pre_init_kb(void) { #ifdef UNUSABLE_PINS const pin_t unused_pins[] = UNUSABLE_PINS; - for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) { + for (uint8_t i = 0; i < ARRAY_SIZE(unused_pins); i++) { setPinOutput(unused_pins[i]); writePinLow(unused_pins[i]); } diff --git a/keyboards/ploopyco/trackball/trackball.c b/keyboards/ploopyco/trackball/trackball.c index 786b40f9e8..6dbb73e8f8 100644 --- a/keyboards/ploopyco/trackball/trackball.c +++ b/keyboards/ploopyco/trackball/trackball.c @@ -49,7 +49,7 @@ keyboard_config_t keyboard_config; uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) +#define DPI_OPTION_SIZE ARRAY_SIZE(dpi_array) // TODO: Implement libinput profiles // https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html @@ -178,14 +178,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { * the keycodes in a consistent manner. But only do this if * Mousekeys is not enable, so it's not handled twice. */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); - pointing_device_send(); - } -#endif return true; } @@ -207,7 +199,7 @@ void keyboard_pre_init_kb(void) { #ifdef UNUSABLE_PINS const pin_t unused_pins[] = UNUSABLE_PINS; - for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) { + for (uint8_t i = 0; i < ARRAY_SIZE(unused_pins); i++) { setPinOutput(unused_pins[i]); writePinLow(unused_pins[i]); } diff --git a/keyboards/ploopyco/trackball_mini/trackball_mini.c b/keyboards/ploopyco/trackball_mini/trackball_mini.c index df13912af4..1e8212814c 100644 --- a/keyboards/ploopyco/trackball_mini/trackball_mini.c +++ b/keyboards/ploopyco/trackball_mini/trackball_mini.c @@ -57,7 +57,7 @@ keyboard_config_t keyboard_config; uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) +#define DPI_OPTION_SIZE ARRAY_SIZE(dpi_array) // TODO: Implement libinput profiles // https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html @@ -169,20 +169,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { pointing_device_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]); } -/* If Mousekeys is disabled, then use handle the mouse button - * keycodes. This makes things simpler, and allows usage of - * the keycodes in a consistent manner. But only do this if - * Mousekeys is not enable, so it's not handled twice. - */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); - pointing_device_send(); - } -#endif - return true; } @@ -203,7 +189,7 @@ void keyboard_pre_init_kb(void) { #ifdef UNUSABLE_PINS const pin_t unused_pins[] = UNUSABLE_PINS; - for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) { + for (uint8_t i = 0; i < ARRAY_SIZE(unused_pins); i++) { setPinOutput(unused_pins[i]); writePinLow(unused_pins[i]); } diff --git a/keyboards/ploopyco/trackball_nano/trackball_nano.c b/keyboards/ploopyco/trackball_nano/trackball_nano.c index eb1d8e10b0..366918e134 100644 --- a/keyboards/ploopyco/trackball_nano/trackball_nano.c +++ b/keyboards/ploopyco/trackball_nano/trackball_nano.c @@ -50,7 +50,7 @@ keyboard_config_t keyboard_config; uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) +#define DPI_OPTION_SIZE ARRAY_SIZE(dpi_array) void cycle_dpi(void) { keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; @@ -89,7 +89,7 @@ void keyboard_pre_init_kb(void) { #ifdef UNUSABLE_PINS const pin_t unused_pins[] = UNUSABLE_PINS; - for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) { + for (uint8_t i = 0; i < ARRAY_SIZE(unused_pins); i++) { setPinOutput(unused_pins[i]); writePinLow(unused_pins[i]); } diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/config.h b/keyboards/ploopyco/trackball_thumb/rev1_001/config.h deleted file mode 100644 index dc80d9401e..0000000000 --- a/keyboards/ploopyco/trackball_thumb/rev1_001/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2021 Colin Lam (Ploopy Corporation) - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * Copyright 2019 Sunjun Kim - * - * 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/>. - */ - -#pragma once - -// These pins are not broken out, and cannot be used normally. -// They are set as output and pulled high, by default -#define UNUSED_PINS \ - { D1, D3, B4, B7, D6, C7, F6, F5, F3, F7 } diff --git a/keyboards/ploopyco/trackball_thumb/trackball_thumb.c b/keyboards/ploopyco/trackball_thumb/trackball_thumb.c index f76d243f18..123ee57151 100644 --- a/keyboards/ploopyco/trackball_thumb/trackball_thumb.c +++ b/keyboards/ploopyco/trackball_thumb/trackball_thumb.c @@ -188,19 +188,6 @@ void keyboard_pre_init_kb(void) { setPinInput(OPT_ENC1); setPinInput(OPT_ENC2); - /* Ground all output pins connected to ground. This provides additional - * pathways to ground. If you're messing with this, know this: driving ANY - * of these pins high will cause a short. On the MCU. Ka-blooey. - */ -#ifdef UNUSED_PINS - const pin_t unused_pins[] = UNUSED_PINS; - - for (uint8_t i = 0; i < (sizeof(unused_pins) / sizeof(pin_t)); i++) { - setPinOutput(unused_pins[i]); - writePinLow(unused_pins[i]); - } -#endif - // This is the debug LED. #if defined(DEBUG_LED_PIN) setPinOutput(DEBUG_LED_PIN); |