1
0
Fork 0
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:
jflyper 2018-09-16 03:09:45 +09:00
parent 9cec06dfc5
commit 4193890b27
5 changed files with 17 additions and 3 deletions

View file

@ -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;
}