File tree Expand file tree Collapse file tree 3 files changed +15
-19
lines changed
ble-firmware/components/libraries/uart Expand file tree Collapse file tree 3 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -1916,7 +1916,20 @@ static uint8_t calcXor(uint8_t* buf, uint8_t len)
19161916}
19171917static void uart_put_data (uint8_t * pdata , uint8_t lenth )
19181918{
1919- app_uart_put_data (pdata , lenth );
1919+ uint32_t err_code ;
1920+
1921+ while ( lenth -- )
1922+ {
1923+ do
1924+ {
1925+ err_code = app_uart_put (* pdata ++ );
1926+ if ( (err_code != NRF_SUCCESS ) && (err_code != NRF_ERROR_BUSY ) )
1927+ {
1928+ APP_ERROR_CHECK (err_code );
1929+ }
1930+ }
1931+ while ( err_code == NRF_ERROR_BUSY );
1932+ }
19201933}
19211934
19221935static void send_stm_data (uint8_t * pdata , uint8_t lenth )
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ uint32_t app_uart_flush(void);
251251 */
252252uint32_t app_uart_close (void );
253253
254- uint32_t app_uart_put_data ( uint8_t * pdata , uint8_t lenth );
254+
255255
256256#ifdef __cplusplus
257257}
Original file line number Diff line number Diff line change 4343#include "app_fifo.h"
4444#include "nrf_drv_uart.h"
4545#include "nrf_assert.h"
46- #include "nrf_delay.h"
4746
4847static nrf_drv_uart_t app_uart_inst = NRF_DRV_UART_INSTANCE (APP_UART_DRIVER_INSTANCE );
4948
@@ -244,22 +243,6 @@ uint32_t app_uart_put(uint8_t byte)
244243 return err_code ;
245244}
246245
247- uint32_t app_uart_put_data (uint8_t * pdata , uint8_t lenth )
248- {
249- uint32_t count = 0 ;
250- while (nrf_drv_uart_tx_in_progress (& app_uart_inst ))
251- {
252- nrf_delay_ms (10 );
253- count ++ ;
254- }
255- if (count > 50 )
256- {
257- return NRF_ERROR_BUSY ;
258- }
259- ret_code_t ret = nrf_drv_uart_tx (& app_uart_inst , pdata , lenth );
260- return ret ;
261- }
262-
263246
264247uint32_t app_uart_close (void )
265248{
You can’t perform that action at this time.
0 commit comments