From 82ca461580a39abb65d76fe6d3745a0776f465fd Mon Sep 17 00:00:00 2001 From: CrazyRedMachine <36906596+CrazyRedMachine@users.noreply.github.com> Date: Wed, 3 Nov 2021 08:47:18 +0100 Subject: [PATCH] fix PS1 compatibility (fixed by Zoids) --- README.md | 2 +- popnController/popnController.ino | 45 ++++++++++++++++--------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 0a076ce..d967ba8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The keypad code uses the Keypad library by Mark Stanley and Alexander Brevig. Switch debouncing is done with Bounce2 library by Thomas O Fredericks. -PSX Controller code is based on busslave's PSX_RECEIVER.cpp +PSX Controller code is based on busslave's PSX_RECEIVER.cpp, with PS1 compatibility fixes by [veroxzik](https://github.com/veroxzik) # Supported devices and requirements diff --git a/popnController/popnController.ino b/popnController/popnController.ino index fbd1768..9d38eec 100644 --- a/popnController/popnController.ino +++ b/popnController/popnController.ino @@ -156,17 +156,21 @@ void convertPopn(uint32_t buttons){ ISR(SPI_STC_vect) { uint8_t inbyte=SPDR; - if (inbyte==command_buff[curr_byte]) { + if (inbyte==command_buff[curr_byte]) { + + SPI_DDR |= (1< 0)) { + SPI_DDR &= ~(1 << DATA_PIN); // input + SPI_PORT &= ~(1 << DATA_PIN); // ensure pullup is off + } + #endif /* USB DATA */ if ( ( (micros() - lastReport) >= REPORT_DELAY) )