Skip to content

Commit bf7adcf

Browse files
committed
Adding to BLE terminate method code that releases the UART and disables interrupts and GPIO
1 parent d2adc9e commit bf7adcf

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,27 @@ void CyH4TransportDriver::initialize()
149149
rtos::ThisThread::sleep_for(500ms);
150150
}
151151

152-
void CyH4TransportDriver::terminate() { }
152+
void CyH4TransportDriver::terminate()
153+
{
154+
cyhal_uart_event_t enable_irq_event = (cyhal_uart_event_t)(CYHAL_UART_IRQ_RX_DONE
155+
| CYHAL_UART_IRQ_TX_DONE
156+
| CYHAL_UART_IRQ_RX_NOT_EMPTY
157+
);
158+
159+
cyhal_uart_enable_event(&uart,
160+
enable_irq_event,
161+
CYHAL_ISR_PRIORITY_DEFAULT,
162+
false
163+
);
164+
165+
cyhal_uart_register_callback(&uart, NULL, NULL);
166+
cyhal_uart_free(&uart);
167+
168+
cyhal_gpio_free(CYBSP_BT_DEVICE_WAKE);
169+
cyhal_gpio_free(CYBSP_BT_HOST_WAKE);
170+
cyhal_gpio_write(CYBSP_BT_POWER, false);
171+
cyhal_gpio_free(CYBSP_BT_POWER);
172+
}
153173

154174
uint16_t CyH4TransportDriver::write(uint8_t type, uint16_t len, uint8_t *pData)
155175
{

0 commit comments

Comments
 (0)