Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Segger RTT from pico-btstack #1995

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/rp2_common/pico_btstack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ if (EXISTS ${PICO_BTSTACK_PATH}/${BTSTACK_TEST_PATH})
target_sources(pico_btstack_base INTERFACE
${PICO_BTSTACK_PATH}/3rd-party/micro-ecc/uECC.c
${PICO_BTSTACK_PATH}/3rd-party/rijndael/rijndael.c
${PICO_BTSTACK_PATH}/3rd-party/segger-rtt/SEGGER_RTT.c
${PICO_BTSTACK_PATH}/3rd-party/segger-rtt/SEGGER_RTT_printf.c
peterharperuk marked this conversation as resolved.
Show resolved Hide resolved
${PICO_BTSTACK_PATH}/platform/embedded/btstack_tlv_flash_bank.c
${PICO_BTSTACK_PATH}/platform/embedded/hci_dump_embedded_stdout.c
Expand Down Expand Up @@ -62,6 +61,13 @@ if (EXISTS ${PICO_BTSTACK_PATH}/${BTSTACK_TEST_PATH})
${PICO_BTSTACK_PATH}/3rd-party/yxml/yxml.c
${CMAKE_CURRENT_LIST_DIR}/btstack_stdin_pico.c
)
# pico-sdk now supports RTT using pico_enable_stdio_rtt in your cmake file or -DPICO_STDIO_RTT=1 on the command line
# Then the output of printf goes to RTT. But if you define ENABLE_SEGGER_RTT=1 it will use the btstack functionality to use RTT
# and we'll have to add the source file it requires.
target_sources(pico_btstack_base INTERFACE
$<IF:$<BOOL:$<IF:$<STREQUAL:$<TARGET_PROPERTY:PICO_TARGET_STDIO_RTT>,>,${PICO_STDIO_RTT},$<TARGET_PROPERTY:PICO_TARGET_STDIO_RTT>>>,,${PICO_BTSTACK_PATH}/3rd-party/segger-rtt/SEGGER_RTT.c>
)

target_include_directories(pico_btstack_base_headers SYSTEM INTERFACE
${PICO_BTSTACK_PATH}/
${PICO_BTSTACK_PATH}/3rd-party/md5
Expand Down
5 changes: 5 additions & 0 deletions src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ Additional information:

#include <string.h> // for memcpy

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wcast-qual"
#pragma GCC diagnostic ignored "-Wcast-align"
#endif

/*********************************************************************
*
* Configuration, default values
Expand Down
4 changes: 2 additions & 2 deletions src/rp2_common/pico_stdio_rtt/stdio_rtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ void stdio_rtt_deinit(void) {
}

static void stdio_rtt_out_chars(const char *buf, int length) {
SEGGER_RTT_Write(0, buf, length);
SEGGER_RTT_Write(0, buf, (unsigned)length);
}
peterharperuk marked this conversation as resolved.
Show resolved Hide resolved

static int stdio_rtt_in_chars(char *buf, int length) {
return SEGGER_RTT_Read(0, buf, length);
return (int)SEGGER_RTT_Read(0, buf, (unsigned)length);
}

stdio_driver_t stdio_rtt = {
Expand Down
Loading