]> git.droids-corp.org - aversive.git/commitdiff
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 26bb2a3d694a0ab35a74c8cbf04a7fcea83b3718..e2faed1ec3ce9045415d4368de21181b19392a07 100644 (file)
@@ -44,5 +44,5 @@ int uart_send(uint8_t num, char c)
                        while(uart_send_nowait(num, c) == -1);
                }
        }
-       return c;
+       return 0;
 }
index ba5b8988fa279a44132995f3206c61fdf24e474b..7967b12fdb9887418b24f55aed5078c7c695e5c7 100644 (file)
@@ -44,5 +44,5 @@ int uart_send_9bits(uint8_t num, int c)
                        while(uart_send_9bits_nowait(num, c) == -1);
                }
        }
-       return c;
+       return 0;
 }
index d22ef7bc939813579a070b1cb8dd2c1abe13077d..86bed9cc10f781478452bd6e65bb67eb26b2efa1 100644 (file)
@@ -25,7 +25,7 @@
 #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);
@@ -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);
-                       return c;
+                       return 0;
                }
                else {
                        IRQ_UNLOCK(flags);
@@ -61,5 +61,5 @@ int uart_send_9bits_nowait(int c)
        }
 
        IRQ_UNLOCK(flags);
-       return (int)c;
+       return 0;
 }
index 6a0a008899682bc15d3798b5c6c645f285af68fd..0aad843fd0cb1c002121b7a5b8c84f6cd00c85d3 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);
-                       return (int)c;
+                       return 0;
                }
                else {
                        IRQ_UNLOCK(flags);
@@ -65,5 +65,5 @@ int uart_send_nowait(uint8_t num, char c)
        }
 
        IRQ_UNLOCK(flags);
-       return (int)c;
+       return 0;
 }