Skip to content

Commit

Permalink
bluetooth: Allow immediate logging with software-based LL
Browse files Browse the repository at this point in the history
Some logging configuration are compatible with software-base Link
Layer. Currently only one configuration is supported:
RTT back-end in drop mode and no clean output

Signed-off-by: Guillaume Lager <[email protected]>
  • Loading branch information
kurddt authored and carlescufi committed Sep 4, 2020
1 parent be7e2fc commit f5cb887
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions subsys/bluetooth/common/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ BUILD_ASSERT(CONFIG_BT_HCI_TX_PRIO < CONFIG_BT_RX_PRIO);
BUILD_ASSERT(CONFIG_BT_DRIVER_RX_HIGH_PRIO < CONFIG_BT_HCI_TX_PRIO);
#endif /* defined(CONFIG_BT_HCI_HOST) */

/* Immediate logging is not supported with the software-based Link Layer
* since it introduces ISR latency due to outputting log messages with
* interrupts disabled.
#if (defined(CONFIG_LOG_BACKEND_RTT) && \
(defined(CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) || \
defined(CONFIG_LOG_BACKEND_RTT_MODE_BLOCK))) || \
defined(CONFIG_LOG_BACKEND_NET) || \
defined(CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT)
#define INCOMPATIBLE_IMMEDIATE_LOG_BACKEND 1
#endif

/* Immediate logging on most backend is not supported
* with the software-based Link Layer since it introduces ISR latency
* due to outputting log messages with interrupts disabled.
*/
#if !defined(CONFIG_TEST) && !defined(CONFIG_ARCH_POSIX) && \
defined(CONFIG_BT_LL_SW_SPLIT)
BUILD_ASSERT(!IS_ENABLED(CONFIG_LOG_IMMEDIATE), "Immediate logging not "
defined(CONFIG_BT_LL_SW_SPLIT) && \
defined(INCOMPATIBLE_IMMEDIATE_LOG_BACKEND)
BUILD_ASSERT(!IS_ENABLED(CONFIG_LOG_IMMEDIATE), "Immediate logging "
"on selected backend(s) not "
"supported with the software Link Layer");
#endif

0 comments on commit f5cb887

Please sign in to comment.