static void z8_restoreuartirq(FAR struct uart_dev_s *dev, uint8_t state) { irqstate_t flags = enter_critical_section(); z8_txint(dev, (state & STATE_TXENABLED) ? true : false); z8_rxint(dev, (state & STATE_RXENABLED) ? true : false); leave_critical_section(flags); }
static void z8_restoreuartirq(FAR struct uart_dev_s *dev, uint8_t state) { struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; irqstate_t flags = irqsave(); z8_txint(dev, (state & STATE_TXENABLED) ? true : false); z8_rxint(dev, (state & STATE_RXENABLED) ? true : false); irqrestore(flags); }
static uint8_t z8_disableuartirq(FAR struct uart_dev_s *dev) { struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; irqstate_t flags = irqsave(); uint8_t state = priv->rxenabled ? STATE_RXENABLED : STATE_DISABLED | \ priv->txenabled ? STATE_TXENABLED : STATE_DISABLED; z8_txint(dev, false); z8_rxint(dev, false); irqrestore(flags); return state; }
static uint8_t z8_disableuartirq(FAR struct uart_dev_s *dev) { struct z8_uart_s *priv = (struct z8_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; z8_txint(dev, false); z8_rxint(dev, false); leave_critical_section(flags); return state; }