Declare sending buffer as constant.
authorNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 11 Mar 2013 17:13:15 +0000 (18:13 +0100)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/serial.c
include/drivers/serial.h

index b8d8406..ba11e77 100644 (file)
@@ -37,7 +37,7 @@ struct uart_device
        uint32_t baudrate;
 
        /* Output buffer */
-       volatile char* out_buff;
+       volatile const char* out_buff;
        volatile uint32_t sending; /* Actual sending position in out buffer */
        volatile uint32_t out_lock;
        volatile uint32_t out_length; /* actual position to add in out buffer */
@@ -116,7 +116,7 @@ static void uart_start_sending(uint32_t uart_num)
 /***************************************************************************** */
 /*    Serial Write    */
 
-int serial_write(uint32_t uart_num, char *buf, uint32_t length)
+int serial_write(uint32_t uart_num, const char *buf, uint32_t length)
 {
        struct uart_device* uart = NULL;
 
index f70a1a7..4ab049c 100644 (file)
@@ -28,7 +28,7 @@
 /***************************************************************************** */
 /*    Serial Write    */
 
-int serial_write(uint32_t uart_num, char *buf, uint32_t length);
+int serial_write(uint32_t uart_num, const char *buf, uint32_t length);