1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Remove USE_RTC6705_CLK_HACK.

For hardware SPI the GPIO pin is in Alternate Function mode, so setting
the bit in BSRR (via IOHi) won't have any affect on the IO level.
This commit is contained in:
Dominic Clifton 2019-05-21 18:49:08 +02:00
parent 165a760f1a
commit 2466f43abd
3 changed files with 0 additions and 23 deletions

View file

@ -55,14 +55,7 @@ static busDevice_t busInstance;
static busDevice_t *busdev; static busDevice_t *busdev;
#define DISABLE_RTC6705() IOHi(busdev->busdev_u.spi.csnPin) #define DISABLE_RTC6705() IOHi(busdev->busdev_u.spi.csnPin)
#ifdef USE_RTC6705_CLK_HACK
static IO_t vtxCLKPin = IO_NONE;
// HACK for missing pull up on CLK line - drive the CLK high *before* enabling the CS pin.
#define ENABLE_RTC6705() {IOHi(vtxCLKPin); delayMicroseconds(5); IOLo(busdev->busdev_u.spi.csnPin); }
#else
#define ENABLE_RTC6705() IOLo(busdev->busdev_u.spi.csnPin) #define ENABLE_RTC6705() IOLo(busdev->busdev_u.spi.csnPin)
#endif
#define DP_5G_MASK 0x7000 // b111000000000000 #define DP_5G_MASK 0x7000 // b111000000000000
#define PA5G_BS_MASK 0x0E00 // b000111000000000 #define PA5G_BS_MASK 0x0E00 // b000111000000000
@ -113,16 +106,6 @@ bool rtc6705IOInit(const vtxIOConfig_t *vtxIOConfig)
rtc6705HaveRequiredResources = rtc6705HaveRequiredResources && vtxPowerPin; rtc6705HaveRequiredResources = rtc6705HaveRequiredResources && vtxPowerPin;
#endif #endif
#ifdef USE_RTC6705_CLK_HACK
SPIDevice device = SPI_CFG_TO_DEV(vtxIOConfig->spiDevice);
spiDevice_t *spi = &(spiDevice[device]);
vtxCLKPin = IOGetByTag(spi->sck);
// we assume the CLK pin will have been initialised by the SPI code.
rtc6705HaveRequiredResources = rtc6705HaveRequiredResources && vtxCLKPin;
#endif
if (!rtc6705HaveRequiredResources) { if (!rtc6705HaveRequiredResources) {
return false; return false;
} }

View file

@ -101,9 +101,6 @@
#define RTC6705_SPI_INSTANCE SPI3 #define RTC6705_SPI_INSTANCE SPI3
#define RTC6705_POWER_PIN PC3 #define RTC6705_POWER_PIN PC3
#define USE_RTC6705_CLK_HACK
#define RTC6705_CLK_PIN SPI3_SCK_PIN
#define USE_MAX7456 #define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI3 #define MAX7456_SPI_INSTANCE SPI3
#define MAX7456_SPI_CS_PIN PA15 #define MAX7456_SPI_CS_PIN PA15

View file

@ -147,9 +147,6 @@
#define RTC6705_SPI_INSTANCE SPI3 #define RTC6705_SPI_INSTANCE SPI3
#define RTC6705_POWER_PIN PC3 #define RTC6705_POWER_PIN PC3
#define USE_RTC6705_CLK_HACK
#define RTC6705_CLK_PIN SPI3_SCK_PIN
// Bus Switched Device, Device A. // Bus Switched Device, Device A.
#define USE_MAX7456 #define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI3 #define MAX7456_SPI_INSTANCE SPI3