1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Merge pull request #10694 from hydra/bf-spi-fixes-1

Fix missing SPI5/6 configuration.
This commit is contained in:
haslinghuis 2021-12-18 00:33:51 +01:00 committed by GitHub
commit 4b44378b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 4 deletions

View file

@ -47,23 +47,39 @@ busDevice_t spiBusDevice[SPIDEV_COUNT];
SPIDevice spiDeviceByInstance(SPI_TypeDef *instance)
{
#ifdef USE_SPI_DEVICE_1
if (instance == SPI1)
if (instance == SPI1) {
return SPIDEV_1;
}
#endif
#ifdef USE_SPI_DEVICE_2
if (instance == SPI2)
if (instance == SPI2) {
return SPIDEV_2;
}
#endif
#ifdef USE_SPI_DEVICE_3
if (instance == SPI3)
if (instance == SPI3) {
return SPIDEV_3;
}
#endif
#ifdef USE_SPI_DEVICE_4
if (instance == SPI4)
if (instance == SPI4) {
return SPIDEV_4;
}
#endif
#ifdef USE_SPI_DEVICE_5
if (instance == SPI5) {
return SPIDEV_5;
}
#endif
#ifdef USE_SPI_DEVICE_6
if (instance == SPI6) {
return SPIDEV_6;
}
#endif
return SPIINVALID;