Rename SPI_COUNT to DEVICE_SPI_COUNT

Avoid collision with some HALs that already define SPI_COUNT.
pull/9469/head
Kevin Bracey 2019-03-01 14:37:04 +02:00
parent df7e3367f7
commit b12be6bb80
4 changed files with 8 additions and 8 deletions

View File

@ -68,7 +68,7 @@ void SPI::_do_construct()
_write_fill = SPI_FILL_CHAR;
// Need backwards compatibility with HALs not providing API
#ifdef SPI_COUNT
#ifdef DEVICE_SPI_COUNT
SPIName name = spi_get_peripheral_name(_mosi, _miso, _sclk);
#else
SPIName name = GlobalSPI;

View File

@ -27,12 +27,12 @@
#include "platform/SingletonPtr.h"
#include "platform/NonCopyable.h"
#if defined MBED_CONF_DRIVERS_SPI_COUNT_MAX && SPI_COUNT > MBED_CONF_DRIVERS_SPI_COUNT_MAX
#if defined MBED_CONF_DRIVERS_SPI_COUNT_MAX && DEVICE_SPI_COUNT > MBED_CONF_DRIVERS_SPI_COUNT_MAX
#define SPI_PERIPHERALS_USED MBED_CONF_DRIVERS_SPI_COUNT_MAX
#elif defined SPI_COUNT
#define SPI_PERIPHERALS_USED SPI_COUNT
#elif defined DEVICE_SPI_COUNT
#define SPI_PERIPHERALS_USED DEVICE_SPI_COUNT
#else
/* Backwards compatibility with HALs not providing SPI_COUNT */
/* Backwards compatibility with HALs not providing DEVICE_SPI_COUNT */
#define SPI_PERIPHERALS_USED 1
#endif
@ -337,7 +337,7 @@ private:
#if !defined(DOXYGEN_ONLY)
protected:
#ifdef SPI_COUNT
#ifdef DEVICE_SPI_COUNT
// HAL must have defined this as a global enum
typedef ::SPIName SPIName;
#else

View File

@ -62,7 +62,7 @@ extern "C" {
* @{
*/
#ifdef SPI_COUNT
#ifdef DEVICE_SPI_COUNT
/**
* Returns a variant of the SPIName enum uniquely identifying a SPI peripheral of the device.
* @param[in] mosi The pin to use for MOSI

View File

@ -57,7 +57,7 @@ typedef enum {
UART_8 = (int)UART8_BASE
} UARTName;
#define SPI_COUNT 6
#define DEVICE_SPI_COUNT 6
typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,