mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
nrf5x: add blocking retarget impl
This commit is contained in:
parent
0283db5655
commit
1f450fe42c
@ -71,7 +71,7 @@ INC_PATHS += -I$(abspath ../../../../../components/toolchain/gcc)
|
|||||||
# BTstack territory
|
# BTstack territory
|
||||||
BTSTACK_ROOT = ../../../../../components/btstack
|
BTSTACK_ROOT = ../../../../../components/btstack
|
||||||
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/port/nrf5x/main.c)
|
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/port/nrf5x/main.c)
|
||||||
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/port/retarget.c)
|
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/port/retarget_blocking.c)
|
||||||
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/platform/embedded/btstack_run_loop_embedded.c)
|
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/platform/embedded/btstack_run_loop_embedded.c)
|
||||||
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/src/ble/ad_parser.c)
|
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/src/ble/ad_parser.c)
|
||||||
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/src/btstack_linked_list.c)
|
C_SOURCE_FILES += $(abspath $(BTSTACK_ROOT)/src/btstack_linked_list.c)
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// BTstack patch: block on full outgoing buffer
|
||||||
|
|
||||||
#if !defined(NRF_LOG_USES_RTT) || NRF_LOG_USES_RTT != 1
|
#if !defined(NRF_LOG_USES_RTT) || NRF_LOG_USES_RTT != 1
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -45,7 +47,11 @@ int fputc(int ch, FILE * p_file)
|
|||||||
{
|
{
|
||||||
UNUSED_PARAMETER(p_file);
|
UNUSED_PARAMETER(p_file);
|
||||||
|
|
||||||
UNUSED_VARIABLE(app_uart_put((uint8_t)ch));
|
int res;
|
||||||
|
do {
|
||||||
|
res = app_uart_put((uint8_t)ch);
|
||||||
|
} while (res);
|
||||||
|
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +66,11 @@ int _write(int file, const char * p_char, int len)
|
|||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
UNUSED_VARIABLE(app_uart_put(*p_char++));
|
int res;
|
||||||
|
do {
|
||||||
|
res = app_uart_put((uint8_t)*p_char);
|
||||||
|
} while (res);
|
||||||
|
p_char++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@ -89,7 +99,11 @@ __ATTRIBUTES size_t __write(int file, const unsigned char * p_char, size_t len)
|
|||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
UNUSED_VARIABLE(app_uart_put(*p_char++));
|
int res;
|
||||||
|
do {
|
||||||
|
res = app_uart_put((uint8_t)*p_char);
|
||||||
|
} while (res);
|
||||||
|
p_char++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
Loading…
x
Reference in New Issue
Block a user