Fix a readline bug. If a NUL is received, it would return end-of-file

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5633 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-02-10 00:46:27 +00:00
parent 319c9f7783
commit ad447766ff
4 changed files with 16 additions and 15 deletions

View File

@ -4175,3 +4175,5 @@
example "+-" would look weird. From Petteri Aimonen.
* mm/mm_mallinfo.c: Take MM semaphore in mm_mallinfo. From Petteri
Aimonen.
* configs/stm32f3discovery/nsh/defconfig: Disable SPI. It is nto
used.

View File

@ -981,6 +981,8 @@ static void up_setspeed(struct uart_dev_s *dev)
}
else
{
DEBUGASSERT(usartdiv8 >= 8);
/* Perform mysterious operations on bits 0-3 */
brr = ((usartdiv8 & 0xfff0) | ((usartdiv8 & 0x000f) >> 1));

View File

@ -166,7 +166,7 @@ CONFIG_STM32_STM32F30XX=y
# CONFIG_STM32_IWDG is not set
CONFIG_STM32_PWR=y
# CONFIG_STM32_SDIO is not set
CONFIG_STM32_SPI1=y
# CONFIG_STM32_SPI1 is not set
# CONFIG_STM32_SPI2 is not set
CONFIG_STM32_SYSCFG=y
# CONFIG_STM32_TIM1 is not set
@ -184,7 +184,6 @@ CONFIG_STM32_SYSCFG=y
CONFIG_STM32_USART2=y
CONFIG_STM32_USB=y
# CONFIG_STM32_WWDG is not set
CONFIG_STM32_SPI=y
#
# Alternate Pin Mapping
@ -203,16 +202,15 @@ CONFIG_STM32_USART=y
# CONFIG_USART2_RS485 is not set
# CONFIG_STM32_USART_SINGLEWIRE is not set
#
# SPI Configuration
#
# CONFIG_STM32_SPI_INTERRUPTS is not set
# CONFIG_STM32_SPI_DMA is not set
#
# USB Host Configuration
#
#
# USB Device Configuration
#
# CONFIG_STM32_USB_ITRMP is not set
#
# External Memory Configuration
#
@ -345,10 +343,7 @@ CONFIG_DEV_NULL=y
# CONFIG_PWM is not set
# CONFIG_I2C is not set
CONFIG_ARCH_HAVE_I2CRESET=y
CONFIG_SPI=y
# CONFIG_SPI_OWNBUS is not set
CONFIG_SPI_EXCHANGE=y
# CONFIG_SPI_CMDDATA is not set
# CONFIG_SPI is not set
# CONFIG_RTC is not set
# CONFIG_WATCHDOG is not set
# CONFIG_ANALOG is not set

View File

@ -528,7 +528,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
* return what we have.
*/
else if (filep->f_oflags & O_NONBLOCK)
else if ((filep->f_oflags & O_NONBLOCK) != 0)
{
/* If nothing was transferred, then return the -EAGAIN
* error (not zero which means end of file).
@ -560,7 +560,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
* wait.
*/
else if (filep->f_oflags & O_NONBLOCK)
else if ((filep->f_oflags & O_NONBLOCK) != 0)
{
/* Break out of the loop returning -EAGAIN */
@ -1109,7 +1109,9 @@ void uart_connected(FAR uart_dev_t *dev, bool connected)
{
irqstate_t flags;
/* Is the device disconnected? */
/* Is the device disconnected? Interrupts are disabled because this
* function may be called from interrupt handling logic.
*/
flags = irqsave();
dev->disconnected = !connected;