Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions drivers/serial/uart_mchp_xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,15 @@ static int uart_xec_irq_tx_complete(const struct device *dev)
const struct uart_xec_device_config * const dev_cfg = dev->config;
struct uart_xec_dev_data *dev_data = dev->data;
struct uart_regs *regs = dev_cfg->regs;
int ret;
k_spinlock_key_t key = k_spin_lock(&dev_data->lock);

int ret = ((regs->LSR & (LSR_TEMT | LSR_THRE))
== (LSR_TEMT | LSR_THRE)) ? 1 : 0;
if ((regs->IER & IER_TBE) ||
((regs->LSR & (LSR_TEMT | LSR_THRE)) != (LSR_TEMT | LSR_THRE))) {
ret = 0;
} else {
ret = 1;
}

k_spin_unlock(&dev_data->lock, key);

Expand Down
Loading