Browse Source

fix the returned value of rt_serial_getc function which is reported by macroz.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@24 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 16 years ago
parent
commit
3e58b1940f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libcpu/arm/stm32/serial.c

+ 2 - 2
libcpu/arm/stm32/serial.c

@@ -27,10 +27,10 @@ static void rt_serial_enable_dma(DMA_Channel_TypeDef* dma_channel,
  *
  *
  * @return the read char
  * @return the read char
  */
  */
-char rt_serial_getc(struct stm32_serial_device* uart)
+int rt_serial_getc(struct stm32_serial_device* uart)
 {
 {
 	rt_base_t level;
 	rt_base_t level;
-	char ch = 0;
+	int ch = -1;
 	
 	
 	/* disable interrupt */
 	/* disable interrupt */
 	level = rt_hw_interrupt_disable();
 	level = rt_hw_interrupt_disable();