mbed
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_NANO100/serial_api.c
- Revision:
- 177:447f873cad2f
- Parent:
- 175:b96e65c34a4d
--- a/targets/TARGET_NUVOTON/TARGET_NANO100/serial_api.c Wed Oct 11 12:45:49 2017 +0100 +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/serial_api.c Wed Oct 25 14:53:38 2017 +0100 @@ -597,33 +597,6 @@ return (obj->serial.event & (event_rx | event_tx)); } -int serial_allow_powerdown(void) -{ - uint32_t modinit_mask = uart_modinit_mask; - while (modinit_mask) { - int uart_idx = nu_ctz(modinit_mask); - const struct nu_modinit_s *modinit = uart_modinit_tab + uart_idx; - if (modinit->modname != NC) { - UART_T *uart_base = (UART_T *) NU_MODBASE(modinit->modname); - // Disallow entering power-down mode if Tx FIFO has data to flush - if (! UART_IS_TX_EMPTY((uart_base))) { - return 0; - } - // Disallow entering power-down mode if async Rx transfer (not PDMA) is on-going - if (uart_base->IER & (UART_IER_RDA_IE_Msk | UART_IER_RTO_IE_Msk)) { - return 0; - } - // Disallow entering power-down mode if async Rx transfer (PDMA) is on-going - if (uart_base->CTL & UART_CTL_DMA_RX_EN_Msk) { - return 0; - } - } - modinit_mask &= ~(1 << uart_idx); - } - - return 1; -} - static void uart_irq_async(serial_t *obj) { if (serial_is_irq_en(obj, RxIrq)) {