From 664de9110fcbd097ce8f74867ea571eaa608747f Mon Sep 17 00:00:00 2001 From: harvey-splitkb <126267034+harvey-splitkb@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:57:39 +0100 Subject: [PATCH] Add fixes --- keyboards/splitkb/elora/config.h | 17 +++++++++++++++++ keyboards/splitkb/elora/rev1/config.h | 8 ++++++++ keyboards/splitkb/elora/rev1/myriad.c | 1 + keyboards/splitkb/elora/rev1/rev1.c | 6 ++++++ 4 files changed, 32 insertions(+) create mode 100644 keyboards/splitkb/elora/config.h diff --git a/keyboards/splitkb/elora/config.h b/keyboards/splitkb/elora/config.h new file mode 100644 index 00000000000..e1dd3c1dcdd --- /dev/null +++ b/keyboards/splitkb/elora/config.h @@ -0,0 +1,17 @@ +/* Copyright 2023 splitkb.com + * + * 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 . + */ + +#pragma once diff --git a/keyboards/splitkb/elora/rev1/config.h b/keyboards/splitkb/elora/rev1/config.h index b1dee3e44bb..e684e63199e 100644 --- a/keyboards/splitkb/elora/rev1/config.h +++ b/keyboards/splitkb/elora/rev1/config.h @@ -48,6 +48,13 @@ #define SPLIT_POINTING_ENABLE #define POINTING_DEVICE_COMBINED +// Watchdog +#define SPLIT_WATCHDOG_ENABLE +#define SPLIT_WATCHDOG_TIMEOUT 3000 + +// VBUS detection +#define USB_VBUS_PIN GP25 + // Handedness #define SPLIT_HAND_PIN GP14 @@ -62,6 +69,7 @@ // 3 onboard, 1 for Myriad #define NUM_ENCODERS_LEFT 4 #define NUM_ENCODERS_RIGHT 4 +#define ENCODER_RESOLUTION 2 // OLED display #ifdef OLED_ENABLE diff --git a/keyboards/splitkb/elora/rev1/myriad.c b/keyboards/splitkb/elora/rev1/myriad.c index b7681602e1b..ea4dfb7bcc9 100644 --- a/keyboards/splitkb/elora/rev1/myriad.c +++ b/keyboards/splitkb/elora/rev1/myriad.c @@ -155,6 +155,7 @@ static bool read_card_identity(uint8_t *data, uint16_t length, identity_record_t static myriad_card_t _detect_myriad(void) { setPinInput(MYRIAD_PRESENT); + wait_ms(100); // The pin has an external pull-up, and a Myriad card shorts it to ground. #ifndef MYRIAD_OVERRIDE_PRESENCE if (readPin(MYRIAD_PRESENT)) { diff --git a/keyboards/splitkb/elora/rev1/rev1.c b/keyboards/splitkb/elora/rev1/rev1.c index 534d61be540..1f06b12c26f 100644 --- a/keyboards/splitkb/elora/rev1/rev1.c +++ b/keyboards/splitkb/elora/rev1/rev1.c @@ -80,6 +80,12 @@ void keyboard_pre_init_kb(void) { setPinOutput(GP9); writePinHigh(GP9); + setPinOutput(ELORA_CC1_PIN); + writePinLow(ELORA_CC1_PIN); + + setPinOutput(ELORA_CC2_PIN); + writePinLow(ELORA_CC2_PIN); + // We have to get the SPI interface working quite early, // So make sure it is available well before we need it spi_init();