mirror of https://github.com/ARMmbed/mbed-os.git
Rename SPI_COUNT to DEVICE_SPI_COUNT
Avoid collision with some HALs that already define SPI_COUNT.pull/9469/head
parent
df7e3367f7
commit
b12be6bb80
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue