let led blink

This commit is contained in:
matthias.ringwald@gmail.com 2014-09-29 20:29:21 +00:00
parent a2c09c83bb
commit 69deacbacd
2 changed files with 10 additions and 2 deletions

View File

@ -11,9 +11,12 @@
#include "btstack_memory.h"
#include <btstack/hal_led.h>
#include <btstack/run_loop.h>
#include "btstack-config.h"
int btstack_main(void);
#define HEARTBEAT_PERIOD_MS 1000
static int counter = 0;
@ -31,7 +34,7 @@ static void heartbeat_handler(timer_source_t *ts){
printf(lineBuffer);
// toggle LED
// LED_PORT_OUT = LED_PORT_OUT ^ LED_2;
hal_led_toggle();
// re-register timer
register_timer(ts, HEARTBEAT_PERIOD_MS);

View File

@ -65,7 +65,12 @@ void hal_cpu_enable_irqs_and_sleep(void){
}
//
// hal_led.h implementation
#include <btstack/hal_led.h>
void hal_led_toggle(void){
gpio_toggle(GPIOA, GPIO_LED2);
}
/**
* Use USART_CONSOLE as a console.