Skip to content

Commit dc4fb8d

Browse files
committed
Use fixed wait time
1 parent c1d33d2 commit dc4fb8d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "drivers/InterruptIn.h"
2323
#if !defined(CYW43XXX_UNBUFFERED_UART)
2424
#include "cybsp_types.h"
25+
#else
26+
#include "mbed_wait_api.h"
2527
#endif
2628
#include "Callback.h"
2729
#include "rtos/ThisThread.h"
@@ -255,7 +257,12 @@ uint16_t CyH4TransportDriver::write(uint8_t type, uint16_t len, uint8_t *pData)
255257
++i;
256258
}
257259
#if defined(CYW43XXX_UNBUFFERED_UART)
258-
while (uart.writeable() == 0);
260+
/* Assuming a 16 byte FIFO as worst case this will ensure all bytes are sent before deasserting bt_dev_wake */
261+
#ifndef BT_UART_NO_3M_SUPPORT
262+
wait_us(50); // 3000000 bps
263+
#else
264+
rtos::ThisThread::sleep_for(2ms); // 115200 bps
265+
#endif
259266
#else
260267
while(cyhal_uart_is_tx_active(&uart));
261268
#endif

0 commit comments

Comments
 (0)