Merge pull request #684 from adafruit/fix-uarte-not-power-down-correctly
Fix uarte not power down correctly
This commit is contained in:
1 file changed
+8
@@ -156,9 +156,17 @@ void Uart::end()
|
||||
|
||||
nrfUart->INTENCLR = UARTE_INTENSET_ENDRX_Msk | UARTE_INTENSET_ENDTX_Msk;
|
||||
|
||||
nrfUart->EVENTS_RXTO = 0;
|
||||
nrfUart->EVENTS_TXSTOPPED = 0;
|
||||
|
||||
nrfUart->TASKS_STOPRX = 0x1UL;
|
||||
nrfUart->TASKS_STOPTX = 0x1UL;
|
||||
|
||||
// Wait for TXSTOPPED event and for RXTO event
|
||||
// This is required before disabling UART to fully power down transceiver PHY.
|
||||
// Otherwise transceiver will continue to consume ~900uA
|
||||
while ( !(nrfUart->EVENTS_TXSTOPPED && nrfUart->EVENTS_RXTO) ) yield();
|
||||
|
||||
nrfUart->ENABLE = UARTE_ENABLE_ENABLE_Disabled;
|
||||
|
||||
nrfUart->PSEL.TXD = 0xFFFFFFFF;
|
||||
|
||||
Reference in new issue
Block a user