example/led_counter: log to packet log

This commit is contained in:
Matthias Ringwald 2023-09-07 10:18:43 +02:00
parent c6dda3a559
commit e4cf526a15

View File

@ -47,11 +47,8 @@
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "btstack.h"
#include "btstack_run_loop.h"
#include "btstack_defines.h"
#include "hal_led.h" #include "hal_led.h"
#define HEARTBEAT_PERIOD_MS 1000 #define HEARTBEAT_PERIOD_MS 1000
@ -72,10 +69,12 @@ static void heartbeat_handler(btstack_timer_source_t *ts){
UNUSED(ts); UNUSED(ts);
// increment counter // increment counter
char lineBuffer[30]; counter++;
snprintf(lineBuffer, sizeof(lineBuffer), "BTstack counter %04u\n\r", ++counter);
puts(lineBuffer); // print and log
log_info("BTstack Counter %u", counter);
printf("BTstack counter %04u\n\r", counter);
// toggle LED // toggle LED
hal_led_toggle(); hal_led_toggle();