mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2092 from akselsm/spi-init-fix
SPI: Properly aquire peripheral in constructorpull/2094/head
commit
1216d8088d
|
@ -36,8 +36,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
|
||||||
// No lock needed in the constructor
|
// No lock needed in the constructor
|
||||||
|
|
||||||
spi_init(&_spi, mosi, miso, sclk, ssel);
|
spi_init(&_spi, mosi, miso, sclk, ssel);
|
||||||
spi_format(&_spi, _bits, _mode, 0);
|
aquire();
|
||||||
spi_frequency(&_spi, _hz);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPI::format(int bits, int mode) {
|
void SPI::format(int bits, int mode) {
|
||||||
|
|
Loading…
Reference in New Issue