mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/soft_spi: fix over-allocation of locks
The intent was to allocate one lock per device, but that was not the case in practice. This patch fixes this.
This commit is contained in:
parent
d786883859
commit
022192ecee
@ -48,6 +48,11 @@ static soft_spi_conf_t soft_spi_config[] = {
|
|||||||
SOFT_SPI_PARAMS,
|
SOFT_SPI_PARAMS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Number of software SPI buses
|
||||||
|
*/
|
||||||
|
#define SOFT_SPI_NUMOF ARRAY_SIZE(soft_spi_config)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Allocate one lock per SPI device
|
* @brief Allocate one lock per SPI device
|
||||||
*/
|
*/
|
||||||
static mutex_t locks[sizeof soft_spi_config];
|
static mutex_t locks[SOFT_SPI_NUMOF];
|
||||||
|
|
||||||
static inline bool soft_spi_bus_is_valid(soft_spi_t bus)
|
static inline bool soft_spi_bus_is_valid(soft_spi_t bus)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user