uart: fix return value of send functions
authorOlivier Matz <zer0@droids-corp.org>
Tue, 6 Aug 2013 19:57:03 +0000 (21:57 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 8 Aug 2013 17:59:13 +0000 (19:59 +0200)
the return value is 0 on success

modules/comm/uart/uart_send.c
modules/comm/uart/uart_send9.c
modules/comm/uart/uart_send9_nowait.c
modules/comm/uart/uart_send_nowait.c

index 26bb2a3..e2faed1 100644 (file)
@@ -44,5 +44,5 @@ int uart_send(uint8_t num, char c)
                        while(uart_send_nowait(num, c) == -1);
                }
        }
                        while(uart_send_nowait(num, c) == -1);
                }
        }
-       return c;
+       return 0;
 }
 }
index ba5b898..7967b12 100644 (file)
@@ -44,5 +44,5 @@ int uart_send_9bits(uint8_t num, int c)
                        while(uart_send_9bits_nowait(num, c) == -1);
                }
        }
                        while(uart_send_9bits_nowait(num, c) == -1);
                }
        }
-       return c;
+       return 0;
 }
 }
index d22ef7b..86bed9c 100644 (file)
@@ -25,7 +25,7 @@
 #include <uart_defs.h>
 #include <uart_private.h>
 
 #include <uart_defs.h>
 #include <uart_private.h>
 
-int uart_send_9bits_nowait(int c)
+int uart_send_9bits_nowait(uint8_t num, int c)
 {
        uint8_t flags;
        IRQ_LOCK(flags);
 {
        uint8_t flags;
        IRQ_LOCK(flags);
@@ -36,7 +36,7 @@ int uart_send_9bits_nowait(int c)
                if (*uart_regs[num].ucsra & (1<<UDRE)) {
                        uart_set_udr_9bits(c);
                        IRQ_UNLOCK(flags);
                if (*uart_regs[num].ucsra & (1<<UDRE)) {
                        uart_set_udr_9bits(c);
                        IRQ_UNLOCK(flags);
-                       return c;
+                       return 0;
                }
                else {
                        IRQ_UNLOCK(flags);
                }
                else {
                        IRQ_UNLOCK(flags);
@@ -61,5 +61,5 @@ int uart_send_9bits_nowait(int c)
        }
 
        IRQ_UNLOCK(flags);
        }
 
        IRQ_UNLOCK(flags);
-       return (int)c;
+       return 0;
 }
 }
index 6a0a008..0aad843 100644 (file)
@@ -41,7 +41,7 @@ int uart_send_nowait(uint8_t num, char c)
                if (*uart_regs[num].ucsra & (1<<UDRE)) {
                        uart_set_udr(num, c);
                        IRQ_UNLOCK(flags);
                if (*uart_regs[num].ucsra & (1<<UDRE)) {
                        uart_set_udr(num, c);
                        IRQ_UNLOCK(flags);
-                       return (int)c;
+                       return 0;
                }
                else {
                        IRQ_UNLOCK(flags);
                }
                else {
                        IRQ_UNLOCK(flags);
@@ -65,5 +65,5 @@ int uart_send_nowait(uint8_t num, char c)
        }
 
        IRQ_UNLOCK(flags);
        }
 
        IRQ_UNLOCK(flags);
-       return (int)c;
+       return 0;
 }
 }