MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_uart_getc

Function mtk_uart_getc

freebsd/mips/mediatek/uart_dev_mtk.c:163–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static int
164mtk_uart_getc(struct uart_bas *bas, struct mtx *hwmtx)
165{
166 int c;
167
168 uart_lock(hwmtx);
169
170 while (!(uart_getreg(bas, UART_LSR_REG) & UART_LSR_DR)) {
171 uart_unlock(hwmtx);
172 DELAY(10);
173 uart_lock(hwmtx);
174 }
175
176 c = uart_getreg(bas, UART_RX_REG);
177
178 uart_unlock(hwmtx);
179
180 return (c);
181}
182
183/*
184 * High-level UART interface.

Callers

nothing calls this directly

Calls 1

DELAYFunction · 0.50

Tested by

no test coverage detected