mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Handle NULL SPI instance case
This commit is contained in:
parent
9cec06dfc5
commit
4193890b27
5 changed files with 17 additions and 3 deletions
|
@ -62,7 +62,7 @@ SPIDevice spiDeviceByInstance(SPI_TypeDef *instance)
|
|||
|
||||
SPI_TypeDef *spiInstanceByDevice(SPIDevice device)
|
||||
{
|
||||
if (device >= SPIDEV_COUNT) {
|
||||
if (device == SPIINVALID || device >= SPIDEV_COUNT) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue