Linux: Default SPI driver set to SPIDEV (#847)
This commit is contained in:
@@ -334,10 +334,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
||||
|
||||
// Transport drivers
|
||||
#if defined(MY_RADIO_RF24)
|
||||
#if defined(__linux__) && !(defined(LINUX_SPI_BCM) || defined(LINUX_SPI_SPIDEV))
|
||||
#error No support for nRF24 radio on this platform
|
||||
#endif
|
||||
|
||||
#if defined(MY_RF24_ENABLE_ENCRYPTION)
|
||||
#include "drivers/AES/AES.cpp"
|
||||
#endif
|
||||
|
||||
@@ -510,12 +510,16 @@ if [ -z "${SPI_DRIVER}" ]; then
|
||||
if [ -n "${SPI_DRIVER}" ]; then
|
||||
echo " [OK] SPI driver detected:${SPI_DRIVER}."
|
||||
else
|
||||
echo " [WARNING] No supported SPI driver detected."
|
||||
echo " [WARNING] No supported SPI driver detected. Using SPIDEV."
|
||||
SPI_DRIVER=SPIDEV
|
||||
fi
|
||||
fi
|
||||
if [ -n "${SPI_DRIVER}" ]; then
|
||||
case ${SPI_DRIVER} in
|
||||
BCM)
|
||||
if [[ $SOC != "BCM2835" && $SOC != "BCM2836" && $SOC != "BCM2837" ]]; then
|
||||
die "BCM SPI driver is only supported for SOCs BCM2835, BCM2836 or BCM2837" 5
|
||||
fi
|
||||
CPPFLAGS="-DLINUX_SPI_BCM $CPPFLAGS"
|
||||
;;
|
||||
SPIDEV)
|
||||
|
||||
@@ -125,7 +125,7 @@ SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, RFM69_S
|
||||
#define _SPI SPI
|
||||
#endif
|
||||
#else
|
||||
#if defined(__arm__)
|
||||
#if defined(__arm__) || defined(__linux__)
|
||||
#include <SPI.h>
|
||||
#else
|
||||
extern HardwareSPI SPI; //!< SPI
|
||||
|
||||
@@ -120,7 +120,7 @@ _SPI;
|
||||
#define _SPI SPI //!< SPI
|
||||
#endif
|
||||
#else
|
||||
#if defined(__arm__)
|
||||
#if defined(__arm__) || defined(__linux__)
|
||||
#include <SPI.h>
|
||||
#else
|
||||
extern HardwareSPI SPI; //!< SPI
|
||||
|
||||
Reference in New Issue
Block a user