Skip to content

Commit bf77857

Browse files
committed
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).
1 parent 7fc73e4 commit bf77857

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void spi_format(spi_t *obj, int bits, int mode, int slave)
6565
spi_master_config_t master_config;
6666
spi_slave_config_t slave_config;
6767

68-
if ((bits != 8) || (bits != 16)) {
68+
if ((bits != 8) && (bits != 16)) {
6969
error("Only 8bits and 16bits SPI supported");
7070
return;
7171
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void spi_format(spi_t *obj, int bits, int mode, int slave)
6565
spi_master_config_t master_config;
6666
spi_slave_config_t slave_config;
6767

68-
if ((bits != 8) || (bits != 16)) {
68+
if ((bits != 8) && (bits != 16)) {
6969
error("Only 8bits and 16bits SPI supported");
7070
return;
7171
}

0 commit comments

Comments
 (0)