Skip to content

Commit 54f52d7

Browse files
committed
TARGET_MCU_NRF51822 - Initialize uninitialized variable in spi_api.c.
Even if that wasn't dangerous, this changes makes the compiler happy.
1 parent 36c001d commit 54f52d7

File tree

1 file changed

+1
-1
lines changed
  • hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822

1 file changed

+1
-1
lines changed

hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern volatile i2c_spi_peripheral_t i2c1_spi1_peripheral;
3232

3333
void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel)
3434
{
35-
SPIName spi;
35+
SPIName spi = SPI_0;
3636

3737
if (ssel == NC && i2c0_spi0_peripheral.usage == I2C_SPI_PERIPHERAL_FOR_SPI &&
3838
i2c0_spi0_peripheral.sda_mosi == (uint8_t)mosi &&

0 commit comments

Comments
 (0)