From d392ca8840063aab5094eb3df10d6e545747a1c8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 15 Nov 2020 00:38:52 +0100 Subject: [PATCH] msp432p401lp-cc256x: implement LED toggle --- port/msp432p401lp-cc256x/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/port/msp432p401lp-cc256x/main.c b/port/msp432p401lp-cc256x/main.c index d30851f0f..f5878690e 100755 --- a/port/msp432p401lp-cc256x/main.c +++ b/port/msp432p401lp-cc256x/main.c @@ -154,6 +154,19 @@ void hal_cpu_enable_irqs_and_sleep(void){ __asm__("wfe"); // go to sleep if event flag isn't set. if set, just clear it. IRQs set event flag } +// HAL LED +#include "hal_led.h" +void hal_led_toggle(void){ + static bool on = false; + if (on){ + on = false; + GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); + } else { + on = true; + GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0); + } +} + // HAL TIME Implementation static volatile uint32_t systick; @@ -527,6 +540,10 @@ int main(void) init_systick(); + // init led + MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); + hal_led_toggle(); + // start with BTstack init - especially configure HCI Transport btstack_memory_init(); btstack_run_loop_init(btstack_run_loop_embedded_get_instance());