Skip to content

Commit 3cbfbbf

Browse files
authored
Merge pull request #2657 from jeremybrodt/serial_mod
[MAX326xx] Removed echoing of characters and carriage return.
2 parents 3806c87 + 6689db1 commit 3cbfbbf

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

hal/targets/hal/TARGET_Maxim/TARGET_MAX32600/serial_api.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,27 +250,15 @@ int serial_getc(serial_t *obj)
250250
while(obj->uart->status & MXC_F_UART_STATUS_RX_FIFO_EMPTY) {}
251251
c = obj->uart->tx_rx_fifo & 0xFF;
252252

253-
// Echo characters for stdio
254-
if (obj->uart == (mxc_uart_regs_t*)STDIO_UART) {
255-
obj->uart->tx_rx_fifo = c;
256-
}
257-
258253
return c;
259254
}
260255

261256
//******************************************************************************
262257
void serial_putc(serial_t *obj, int c)
263258
{
264-
// Append a carriage return for stdio
265-
if ((c == (int)'\n') && (obj->uart == (mxc_uart_regs_t*)STDIO_UART)) {
266-
while(obj->uart->status & MXC_F_UART_STATUS_TX_FIFO_FULL) {}
267-
obj->uart->tx_rx_fifo = '\r';
268-
}
269-
270259
// Wait for TXFIFO to not be full
271260
while(obj->uart->status & MXC_F_UART_STATUS_TX_FIFO_FULL) {}
272261
obj->uart->tx_rx_fifo = c;
273-
274262
}
275263

276264
//******************************************************************************

hal/targets/hal/TARGET_Maxim/TARGET_MAX32610/serial_api.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,27 +250,15 @@ int serial_getc(serial_t *obj)
250250
while(obj->uart->status & MXC_F_UART_STATUS_RX_FIFO_EMPTY) {}
251251
c = obj->uart->tx_rx_fifo & 0xFF;
252252

253-
// Echo characters for stdio
254-
if (obj->uart == (mxc_uart_regs_t*)STDIO_UART) {
255-
obj->uart->tx_rx_fifo = c;
256-
}
257-
258253
return c;
259254
}
260255

261256
//******************************************************************************
262257
void serial_putc(serial_t *obj, int c)
263258
{
264-
// Append a carriage return for stdio
265-
if ((c == (int)'\n') && (obj->uart == (mxc_uart_regs_t*)STDIO_UART)) {
266-
while(obj->uart->status & MXC_F_UART_STATUS_TX_FIFO_FULL) {}
267-
obj->uart->tx_rx_fifo = '\r';
268-
}
269-
270259
// Wait for TXFIFO to not be full
271260
while(obj->uart->status & MXC_F_UART_STATUS_TX_FIFO_FULL) {}
272261
obj->uart->tx_rx_fifo = c;
273-
274262
}
275263

276264
//******************************************************************************

hal/targets/hal/TARGET_Maxim/TARGET_MAX32620/serial_api.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,12 @@ int serial_getc(serial_t *obj)
303303

304304
c = *obj->fifo->rx_8;
305305

306-
// Echo characters for stdio
307-
if (obj->uart == (mxc_uart_regs_t*)STDIO_UART) {
308-
*obj->fifo->tx_8 = (uint8_t)c;
309-
}
310-
311306
return c;
312307
}
313308

314309
//******************************************************************************
315310
void serial_putc(serial_t *obj, int c)
316311
{
317-
// Append a carriage return for stdio
318-
if ((c == (int)'\n') && (obj->uart == (mxc_uart_regs_t*)STDIO_UART)) {
319-
while ( ((obj->uart->tx_fifo_ctrl & MXC_F_UART_TX_FIFO_CTRL_FIFO_ENTRY)
320-
>> MXC_F_UART_TX_FIFO_CTRL_FIFO_ENTRY_POS)
321-
>= MXC_UART_FIFO_DEPTH );
322-
323-
// Must clear before every write to the buffer to know that the fifo
324-
// is empty when the TX DONE bit is set
325-
obj->uart->intfl = MXC_F_UART_INTFL_TX_DONE;
326-
*obj->fifo->tx_8 = (uint8_t)'\r';
327-
}
328-
329312
// Wait for TXFIFO to not be full
330313
while ( ((obj->uart->tx_fifo_ctrl & MXC_F_UART_TX_FIFO_CTRL_FIFO_ENTRY)
331314
>> MXC_F_UART_TX_FIFO_CTRL_FIFO_ENTRY_POS)

0 commit comments

Comments
 (0)