From 8052dc49557ab5d50c8f2ff9168250b15c84ff78 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 13 Aug 2016 16:01:50 -0600 Subject: [PATCH] STM32 SPI: nbits should be unsigned. Valid range is 4-16 for F3 and L4. 8 or 16 for others. --- ChangeLog | 4 ++-- arch/arm/src/stm32/stm32_spi.c | 2 +- arch/arm/src/stm32l4/stm32l4_spi.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 716f99760c7..5b01e5e1425 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12393,7 +12393,6 @@ (2016-07-23). * Freedom-K64F: Add PWM support. From Jordan MacIntyre (2016-07-25). - 7.18 2016-xx-xx Gregory Nutt * drivers/serial/pty.c, serial.c, usbdev/cdcacm.c, include/nuttx/fs/ioctl.h: @@ -12564,7 +12563,8 @@ (2016-08-12). * arch/sim/src: Add a simulated oneshot lowerhalf driver (2016-08-12). * arch/arm/src/stm32: STM32F3 SPI: Fix the number of bit setting for - the F3. It works differently than for other STM32 parts (2016-08-12). + the F3. That and data packing work differently on the STM32F3 than + for other STM32 parts (2016-08-12). * arch/arm/stm32 and stm32l4: Enabling SPI DMA loses other bits in CR2 (2016-08-13). * arch/arm/src/stm32: STM32F3 SPI: Cannot write always 16-bit value to diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index f0173cadda6..b8400c6564f 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -182,7 +182,7 @@ struct stm32_spidev_s sem_t exclsem; /* Held while chip is selected for mutual exclusion */ uint32_t frequency; /* Requested clock frequency */ uint32_t actual; /* Actual clock frequency */ - int8_t nbits; /* Width of word in bits (8 or 16) */ + uint8_t nbits; /* Width of word in bits (4 through 16) */ uint8_t mode; /* Mode 0,1,2,3 */ }; diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index 7cd6f3268ec..27937c30c92 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -163,7 +163,7 @@ struct stm32l4_spidev_s sem_t exclsem; /* Held while chip is selected for mutual exclusion */ uint32_t frequency; /* Requested clock frequency */ uint32_t actual; /* Actual clock frequency */ - int8_t nbits; /* Width of word in bits (8 or 16) */ + uint8_t nbits; /* Width of word in bits (4 through 16) */ uint8_t mode; /* Mode 0,1,2,3 */ };