NXP KL43Z/KL27Z: fix spi format bits check

Fixes #2989. It was always true for valid values (if its not 8 neither 16 bits, fail).
pull/3806/head
0xc0170 2017-02-20 10:32:34 +00:00
parent 7fc73e42f2
commit bf77857641
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ void spi_format(spi_t *obj, int bits, int mode, int slave)
spi_master_config_t master_config;
spi_slave_config_t slave_config;
if ((bits != 8) || (bits != 16)) {
if ((bits != 8) && (bits != 16)) {
error("Only 8bits and 16bits SPI supported");
return;
}

View File

@ -65,7 +65,7 @@ void spi_format(spi_t *obj, int bits, int mode, int slave)
spi_master_config_t master_config;
spi_slave_config_t slave_config;
if ((bits != 8) || (bits != 16)) {
if ((bits != 8) && (bits != 16)) {
error("Only 8bits and 16bits SPI supported");
return;
}