static void z16f_restoreuartirq(struct uart_dev_s *dev, uint8_t state) { irqstate_t flags = enter_critical_section(); z16f_txint(dev, (state & STATE_TXENABLED) ? true : false); z16f_rxint(dev, (state & STATE_RXENABLED) ? true : false); leave_critical_section(flags); }
static void z16f_restoreuartirq(struct uart_dev_s *dev, uint8_t state) { irqstate_t flags = irqsave(); z16f_txint(dev, (state & STATE_TXENABLED) ? true : false); z16f_rxint(dev, (state & STATE_RXENABLED) ? true : false); irqrestore(flags); }
static uint8_t z16f_disableuartirq(struct uart_dev_s *dev) { struct z16f_uart_s *priv = (struct z16f_uart_s*)dev->priv; irqstate_t flags = enter_critical_section(); uint8_t state = priv->rxenabled ? STATE_RXENABLED : STATE_DISABLED | \ priv->txenabled ? STATE_TXENABLED : STATE_DISABLED; z16f_txint(dev, false); z16f_rxint(dev, false); leave_critical_section(flags); return state; }
static uint8_t z16f_disableuartirq(struct uart_dev_s *dev) { struct z16f_uart_s *priv = (struct z16f_uart_s*)dev->priv; irqstate_t flags = irqsave(); uint8_t state = priv->rxenabled ? STATE_RXENABLED : STATE_DISABLED | \ priv->txenabled ? STATE_TXENABLED : STATE_DISABLED; z16f_txint(dev, false); z16f_rxint(dev, false); irqrestore(flags); return state; }