diff options
author | Drashna Jaelre <drashna@live.com> | 2022-12-31 16:57:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-01 11:57:36 +1100 |
commit | 9b8f18699f3370499fa3edc551c1fe5876754478 (patch) | |
tree | 93e039affee96002acb2bc686f28a2987d242f03 /keyboards/ploopyco/trackball_thumb | |
parent | b585ece5ef9309557ac6b61eadda4f00e4e52b0c (diff) |
Partially revert #18940 for Ploopy Thumb Trackball (#18943)
Diffstat (limited to 'keyboards/ploopyco/trackball_thumb')
-rw-r--r-- | keyboards/ploopyco/trackball_thumb/rev1_001/config.h | 24 | ||||
-rw-r--r-- | keyboards/ploopyco/trackball_thumb/trackball_thumb.c | 13 |
2 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/config.h b/keyboards/ploopyco/trackball_thumb/rev1_001/config.h new file mode 100644 index 0000000000..a648e8e8e4 --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/rev1_001/config.h @@ -0,0 +1,24 @@ +/* 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 UNUSABLE_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 4a90ced8eb..bbc782da45 100644 --- a/keyboards/ploopyco/trackball_thumb/trackball_thumb.c +++ b/keyboards/ploopyco/trackball_thumb/trackball_thumb.c @@ -188,6 +188,19 @@ 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 UNUSABLE_PINS + const pin_t unused_pins[] = UNUSABLE_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); |