Skip to content

Commit 389ed27

Browse files
committed
Working on changes from code review
1 parent 47aab97 commit 389ed27

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ void CyH4TransportDriver::initialize()
126126
sleep_manager_lock_deep_sleep();
127127

128128
cyhal_gpio_write(CYBSP_BT_POWER, 0);
129-
rtos::ThisThread::sleep_for(20ms);
129+
rtos::ThisThread::sleep_for(1ms);
130130

131-
cyhal_uart_init(&uart, tx, rx, NULL, NULL);
131+
cy_rslt_t rslt = cyhal_uart_init(&uart, tx, rx, NULL, NULL);
132+
// MBED_WARNING
132133

133134
const cyhal_uart_cfg_t uart_cfg = { .data_bits = 8, .stop_bits = 1, .parity = CYHAL_UART_PARITY_NONE, .rx_buffer = NULL, .rx_buffer_size = 0 };
134135
cyhal_uart_configure(&uart, &uart_cfg);
@@ -138,7 +139,6 @@ void CyH4TransportDriver::initialize()
138139
cyhal_uart_enable_event(&uart, CYHAL_UART_IRQ_RX_NOT_EMPTY, CYHAL_ISR_PRIORITY_DEFAULT, true);
139140

140141
cyhal_gpio_write(CYBSP_BT_POWER, 1);
141-
rtos::ThisThread::sleep_for(10ms);
142142

143143
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
144144
if (bt_host_wake_name != NC) {
@@ -156,7 +156,7 @@ void CyH4TransportDriver::initialize()
156156
bt_device_wake = WAKE_EVENT_ACTIVE_HIGH;
157157
}
158158
sleep_manager_unlock_deep_sleep();
159-
rtos::ThisThread::sleep_for(500ms);
159+
// rtos::ThisThread::sleep_for(500ms);
160160
}
161161

162162
void CyH4TransportDriver::terminate()
@@ -178,13 +178,9 @@ void CyH4TransportDriver::terminate()
178178

179179
if(CYBSP_BT_DEVICE_WAKE != NC) cyhal_gpio_free(CYBSP_BT_DEVICE_WAKE);
180180

181-
182181
if(CYBSP_BT_HOST_WAKE != NC) cyhal_gpio_write(CYBSP_BT_DEVICE_WAKE, false);
183182

184-
if(CYBSP_BT_POWER != NC)
185-
{
186-
cyhal_gpio_write(CYBSP_BT_POWER, false);
187-
}
183+
if(CYBSP_BT_POWER != NC) cyhal_gpio_write(CYBSP_BT_POWER, false); //BT_POWER is an output, should not be freed only set inactive
188184

189185
cyhal_uart_free(&uart);
190186
}

0 commit comments

Comments
 (0)