From e4cf526a15d86a46988c11775d71ee712195706f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 7 Sep 2023 10:18:43 +0200 Subject: [PATCH] example/led_counter: log to packet log --- example/led_counter.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/example/led_counter.c b/example/led_counter.c index fd9e58f66..4e209e17a 100644 --- a/example/led_counter.c +++ b/example/led_counter.c @@ -47,11 +47,8 @@ -#include #include - -#include "btstack_run_loop.h" -#include "btstack_defines.h" +#include "btstack.h" #include "hal_led.h" #define HEARTBEAT_PERIOD_MS 1000 @@ -72,10 +69,12 @@ static void heartbeat_handler(btstack_timer_source_t *ts){ UNUSED(ts); // increment counter - char lineBuffer[30]; - snprintf(lineBuffer, sizeof(lineBuffer), "BTstack counter %04u\n\r", ++counter); - puts(lineBuffer); - + counter++; + + // print and log + log_info("BTstack Counter %u", counter); + printf("BTstack counter %04u\n\r", counter); + // toggle LED hal_led_toggle();