Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Deprecate SPLIT_TRANSPORT #17685

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Convert custom split transport keyboards
  • Loading branch information
KarlK90 committed Jul 15, 2022
commit d8563e1cb046aea1c23a5d9767d4d5b233d610d7
3 changes: 3 additions & 0 deletions keyboards/handwired/lagrange/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@

#define LED_CAPS_LOCK_PIN D1
#define LED_SCROLL_LOCK_PIN D2

/* Split communication */
#define SOFT_SERIAL_PIN B0
42 changes: 0 additions & 42 deletions keyboards/handwired/lagrange/lagrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,4 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include <LUFA/Drivers/USB/USB.h>

#include "lagrange.h"

#ifndef SPLIT_USB_TIMEOUT_POLL
# define SPLIT_USB_TIMEOUT_POLL 10
#endif

/* Instead of timing out, the slave waits indefinitely for the other
* side to signal that it has become master. This avoids both sides
* assuming the slave role when the USB port is powered but not
* otherwise active (e.g. when the host is turned off, or suspended).
* The SPI SS line is used for signaling. On power-up it is
* configured as input with pull-up enabled. When one side assumes
* the master role, it reconfigures the line for SPI, and pulls it low
* to select the slave, which doubles as the signal. */

bool is_keyboard_master(void) {
static int8_t is_master = -1;

if (is_master < 0) {
while (readPin(SPI_SS_PIN)) {
if (USB_Device_IsAddressSet()) {
is_master = 1;
return is_master;
}
wait_ms(SPLIT_USB_TIMEOUT_POLL);
}

is_master = 0;

USB_Disable();
USB_DeviceState = DEVICE_STATE_Unattached;
}

return is_master;
}

void keyboard_pre_init_kb(void) {
setPinInputHigh(SPI_SS_PIN);

keyboard_pre_init_user();
}
8 changes: 0 additions & 8 deletions keyboards/handwired/lagrange/lagrange.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@

#include "quantum.h"

#if !defined(SPI_SS_PIN)
# define SPI_SS_PIN B0
#endif

#define SPI_SCK_PIN B1
#define SPI_MOSI_PIN B2
#define SPI_MISO_PIN B3

#define LAYOUT( \
l00, l01, l02, l03, l04, l05, r05, r04, r03, r02, r01, r00, \
l10, l11, l12, l13, l14, l15, r15, r14, r13, r12, r11, r10, \
Expand Down
3 changes: 0 additions & 3 deletions keyboards/handwired/lagrange/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = yes
SPLIT_KEYBOARD = yes
SPLIT_TRANSPORT = custom

SRC += transport.c spi_master.c
208 changes: 0 additions & 208 deletions keyboards/handwired/lagrange/transport.c

This file was deleted.

3 changes: 3 additions & 0 deletions keyboards/whale/sk/v3/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 3

/* Split communication */
#define SOFT_SERIAL_PIN D3
1 change: 0 additions & 1 deletion keyboards/whale/sk/v3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output

SPLIT_KEYBOARD = yes
SPLIT_TRANSPORT = custom
Loading