Merge pull request #2092 from akselsm/spi-init-fix

SPI: Properly aquire peripheral in constructor
pull/2094/head
Martin Kojtal 2016-07-04 10:10:11 +01:00 committed by GitHub
commit 1216d8088d
1 changed files with 1 additions and 2 deletions

View File

@ -36,8 +36,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
// No lock needed in the constructor
spi_init(&_spi, mosi, miso, sclk, ssel);
spi_format(&_spi, _bits, _mode, 0);
spi_frequency(&_spi, _hz);
aquire();
}
void SPI::format(int bits, int mode) {