1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

cpu/nrf52: spi_twi_irq add workaround for nRF52810 vendor file

Either nRF52810 should define SPIM_COUNT 2 or nRF52805 should
define SPIM_COUNT 1.
But as it nRF52805 defines SPIM_COUNT 2 and nRF52810 defines SPIM_COUNT 1
even though both have a single SPI and a single, separate TWI peripheral.

Re-define SPIM_COUNT to 2 on nRF52810 as this is the easiest solution.
This commit is contained in:
Benjamin Valentin 2020-07-09 22:19:06 +02:00
parent 5ecf2e8bb1
commit f0e77840dc

View File

@ -40,6 +40,19 @@
#endif
/**
* The vendor file is weird here. nRF52805 is the only other MCU
* that has only 1 SPI and separate 1 TWI interface, but define
* SPIM_COUNT = 2, which is in line with how it is used here.
* nRF52810 has the same set of SPI/TWI peripherals, but defines
* SPIM_COUNT = 1 which is more logical.
* Just re-define it to work around this inconsistency.
*/
#ifdef CPU_MODEL_NRF52810XXAA
#undef SPIM_COUNT
#define SPIM_COUNT 2
#endif
static spi_twi_irq_cb_t _irq[SPIM_COUNT];
static void *_irq_arg[SPIM_COUNT];