mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
Remove unused uart functions
Nothing ever called uart_flush_input() or uart_gets(), so remove them. They're dead code, and make implementing UART DMA input more complex. BUG=chrome-os-partner:20485 BRANCH=none TEST=build all platforms; pass unit tests Change-Id: I94c2c372ac3f326b98e819b2c89b8995311b2868 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169345 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
6bfeb49855
commit
40f4d61266
@@ -240,21 +240,6 @@ void uart_flush_output(void)
|
||||
uart_tx_flush();
|
||||
}
|
||||
|
||||
void uart_flush_input(void)
|
||||
{
|
||||
/* Disable interrupts */
|
||||
uart_disable_interrupt();
|
||||
|
||||
/* Empty the hardware FIFO */
|
||||
uart_process_input();
|
||||
|
||||
/* Clear the input buffer */
|
||||
rx_buf_tail = rx_buf_head;
|
||||
|
||||
/* Re-enable interrupts */
|
||||
uart_enable_interrupt();
|
||||
}
|
||||
|
||||
int uart_getc(void)
|
||||
{
|
||||
int c;
|
||||
@@ -278,33 +263,6 @@ int uart_getc(void)
|
||||
return c;
|
||||
}
|
||||
|
||||
int uart_gets(char *dest, int size)
|
||||
{
|
||||
int got = 0;
|
||||
int c;
|
||||
|
||||
/* Read characters */
|
||||
while (got < size - 1) {
|
||||
c = uart_getc();
|
||||
|
||||
/* Stop on input buffer empty */
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
dest[got++] = c;
|
||||
|
||||
/* Stop after newline */
|
||||
if (c == '\n')
|
||||
break;
|
||||
}
|
||||
|
||||
/* Null-terminate */
|
||||
dest[got] = '\0';
|
||||
|
||||
/* Return the length we got */
|
||||
return got;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Host commands */
|
||||
|
||||
|
||||
@@ -79,11 +79,6 @@ void uart_flush_output(void);
|
||||
* are translated to newline.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Flush input buffer, discarding all input.
|
||||
*/
|
||||
void uart_flush_input(void);
|
||||
|
||||
/**
|
||||
* Read a single character of input, similar to fgetc().
|
||||
*
|
||||
@@ -91,27 +86,6 @@ void uart_flush_input(void);
|
||||
*/
|
||||
int uart_getc(void);
|
||||
|
||||
/**
|
||||
* Read characters from the UART, similar to fgets().
|
||||
*
|
||||
* Reads input until one of the following conditions is met:
|
||||
* (1) <size-1> characters have been read.
|
||||
* (2) A newline ('\n') has been read.
|
||||
* (3) The input buffer is empty (this keeps the call from blocking).
|
||||
*
|
||||
* Characters are stored in <dest> and are null-terminated.
|
||||
* Characters include the newline if present, so that the caller can
|
||||
* distinguish between a complete line and a truncated one. If the
|
||||
* input buffer is empty, a null-terminated empty string ("") is
|
||||
* returned.
|
||||
*
|
||||
* @param dest Destination for input
|
||||
* @param size Size of buffer pointed to by dest
|
||||
*
|
||||
* @return the number of characters read, not counting the terminating null.
|
||||
*/
|
||||
int uart_gets(char *dest, int size);
|
||||
|
||||
/*
|
||||
* Hardware UART driver functions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user