File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52 Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ SerialBase::~SerialBase()
272
272
for (int irq = 0 ; irq < IrqCnt; irq++) {
273
273
attach (NULL , (IrqType)irq);
274
274
}
275
+ serial_free (&_serial);
275
276
}
276
277
277
278
#if DEVICE_SERIAL_FC
Original file line number Diff line number Diff line change @@ -1009,6 +1009,21 @@ void serial_free(serial_t *obj)
1009
1009
if (nordic_nrf5_uart_state [instance ].usage_counter == 0 ) {
1010
1010
1011
1011
nrf_uarte_disable (nordic_nrf5_uart_register [instance ]);
1012
+
1013
+ /* Turn NRF_UARTE0_BASE or NRF_UARTE1_BASE power off and on to reset peripheral. */
1014
+ if (instance == 0 ) {
1015
+ * (volatile uint32_t * )0x40002FFC = 0 ;
1016
+ * (volatile uint32_t * )0x40002FFC ;
1017
+ * (volatile uint32_t * )0x40002FFC = 1 ;
1018
+ }
1019
+ #if UART1_ENABLED
1020
+ else {
1021
+ * (volatile uint32_t * )0x40028FFC = 0 ;
1022
+ * (volatile uint32_t * )0x40028FFC ;
1023
+ * (volatile uint32_t * )0x40028FFC = 1 ;
1024
+ }
1025
+ #endif
1026
+
1012
1027
}
1013
1028
}
1014
1029
}
You can’t perform that action at this time.
0 commit comments