From 17eb72cf7f94375d75ed2d7c0e2893b56c2f8c99 Mon Sep 17 00:00:00 2001 From: wher0001 Date: Tue, 16 Nov 2021 10:30:46 -0600 Subject: [PATCH] Update am_hal_uart.c The call to am_hal_pwrctrl_periph_disable will leave some values of the UARTn->CR register powered up and the current draw to be 200-300nA higher than expected. The below adjustment is acceptable since the pState->sRegState.regCR will retain the state and return the state if requested.. UARTn(ui32Module)->CR = 0; --- mcu/apollo3/hal/am_hal_uart.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mcu/apollo3/hal/am_hal_uart.c b/mcu/apollo3/hal/am_hal_uart.c index 0854454a..c3fb35d8 100644 --- a/mcu/apollo3/hal/am_hal_uart.c +++ b/mcu/apollo3/hal/am_hal_uart.c @@ -334,7 +334,17 @@ am_hal_uart_power_control(void *pHandle, // Clear all interrupts before sleeping as having a pending UART // interrupt burns power. // - am_hal_uart_interrupt_clear(pState, 0xFFFFFFFF); + am_hal_uart_interrupt_clear(pState, 0xFFFFFFFF); + + // + // The call to am_hal_pwrctrl_periph_disable will leave some values + // of the UARTn->CR register powered up which causes hte current + // draw to be 2-3oonA higher than expected. + // + // the below adjustment is acceptable since the pState->sRegState.regCR + // will retain the state if requested. + // + UARTn(ui32Module)->CR = 0; // // Disable power control.