stm32-l053r8-em9304: support ENABLE_SEGGER_RTT

This commit is contained in:
Matthias Ringwald 2018-02-05 15:16:23 +01:00
parent f50ef7dd1f
commit 387b0525e9
3 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#define ENABLE_LE_DATA_LENGTH_EXTENSION
#define ENABLE_LOG_INFO
#define ENABLE_LOG_ERROR
// #define ENABLE_SEGGER_RTT
// BTstack configuration. buffers, sizes, ...
#define HCI_ACL_PAYLOAD_SIZE 100

View File

@ -51,6 +51,7 @@ VPATH += ${BTSTACK_ROOT}/src/classic
VPATH += ${BTSTACK_ROOT}/platform/embedded
VPATH += ${BTSTACK_ROOT}/example
VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
VPATH += ${BTSTACK_ROOT}/3rd-party/segger-rtt
VPATH += ${BTSTACK_ROOT}/chipset/em9301
######################################
@ -109,6 +110,8 @@ Src/stm32l0xx_it.c \
sm.c \
uECC.c \
0000000_META_hci_patches_v5_iram.c \
SEGGER_RTT.c \
SEGGER_RTT_Syscalls_GCC.c \
# ASM sources
ASM_SOURCES = \
@ -178,6 +181,7 @@ C_INCLUDES += -I${BTSTACK_ROOT}/src/ble/gatt-service
C_INCLUDES += -I${BTSTACK_ROOT}/src/classic
C_INCLUDES += -I${BTSTACK_ROOT}/src
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/segger-rtt
C_INCLUDES += -I${BTSTACK_ROOT}/platform/embedded
# compile gcc flags

View File

@ -59,11 +59,17 @@
#include "hci_dump.h"
#include "btstack_debug.h"
#ifdef ENABLE_SEGGER_RTT
#include "SEGGER_RTT.h"
#endif
// retarget printf
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#ifndef ENABLE_SEGGER_RTT
int _write(int file, char *ptr, int len){
uint8_t cr = '\r';
if (file == STDOUT_FILENO || file == STDERR_FILENO) {
@ -80,6 +86,8 @@ int _write(int file, char *ptr, int len){
return -1;
}
#endif
int _read(int file, char * ptr, int len){
(void)(file);
(void)(ptr);