Skip to content

Commit

Permalink
os/arch/arm/src/amebasmart: fix pm sleep before loguart flush all data
Browse files Browse the repository at this point in the history
1. there is no domain control for loguart tx irq previously, causing it to enter PG before all logs are printed correctly
2. add domain control similar to UART1, both LOGUART and UART1 shared the same domain.
  • Loading branch information
zhongnuo-tang authored and sunghan-chang committed Nov 11, 2024
1 parent 6af1c19 commit bfd89ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion os/arch/arm/src/amebasmart/amebasmart_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@

static serial_t* sdrv[MAX_UART_INDEX + 1] = {NULL, NULL, NULL, NULL, NULL}; //uart 0~4, uart4 is configured as log uart
#ifdef CONFIG_PM
static bool uart_active_state = 0;
static volatile bool uart_active_state = 0;
static volatile bool log_uart_active_state = 0;
#endif

struct rtl8730e_up_dev_s {
Expand Down Expand Up @@ -767,6 +768,12 @@ static void rtl8730e_log_up_txint(struct uart_dev_s *dev, bool enable)
struct rtl8730e_up_dev_s *priv = (struct rtl8730e_up_dev_s *)dev->priv;
DEBUGASSERT(priv);
priv->txint_enable = enable;
#ifdef CONFIG_PM
if (log_uart_active_state != enable) { /* State has changed */
bsp_pm_domain_control(BSP_UART_DRV, enable);
log_uart_active_state = enable;
}
#endif
if (enable) {
LOGUART_INTConfig(LOGUART_DEV, LOGUART_TX_EMPTY_PATH_4_INTR, ENABLE);
//LOGUART_RxCmd(LOGUART_DEV, ENABLE);
Expand Down

0 comments on commit bfd89ee

Please sign in to comment.