Skip to content

Commit 1216d80

Browse files
authored
Merge pull request #2092 from akselsm/spi-init-fix
SPI: Properly aquire peripheral in constructor
2 parents b29e9d0 + b09a87f commit 1216d80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hal/common/SPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
3636
// No lock needed in the constructor
3737

3838
spi_init(&_spi, mosi, miso, sclk, ssel);
39-
spi_format(&_spi, _bits, _mode, 0);
40-
spi_frequency(&_spi, _hz);
39+
aquire();
4140
}
4241

4342
void SPI::format(int bits, int mode) {

0 commit comments

Comments
 (0)