From 460ecf074d133cbe026cbddb7cf5fad1180c9831 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 28 May 2021 15:17:20 +0200 Subject: Set loop/wakeup/ostream either via .config or via app/commandline --- src/arch/stm32f446re-nucleo/arch.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/arch/stm32f446re-nucleo/arch.cc') diff --git a/src/arch/stm32f446re-nucleo/arch.cc b/src/arch/stm32f446re-nucleo/arch.cc index 6216843..c7566b6 100644 --- a/src/arch/stm32f446re-nucleo/arch.cc +++ b/src/arch/stm32f446re-nucleo/arch.cc @@ -39,7 +39,7 @@ void Arch::setup(void) timer_set_period(TIM2, 4294967295); timer_enable_irq(TIM2, TIM_DIER_UIE); -#ifdef WITH_LOOP +#ifdef CONFIG_loop rcc_periph_clock_enable(RCC_TIM3); nvic_enable_irq(NVIC_TIM3_IRQ); rcc_periph_reset_pulse(RST_TIM3); @@ -59,11 +59,11 @@ void Arch::setup(void) #endif } -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup extern void wakeup(); #endif -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) extern void loop(); volatile char run_loop = 0; #endif @@ -91,7 +91,7 @@ void Arch::idle_loop(void) while (1) { pwr_set_standby_mode(); __asm__("wfi"); -#ifdef WITH_LOOP +#ifdef CONFIG_loop if (run_loop) { loop(); run_loop = 0; @@ -102,14 +102,14 @@ void Arch::idle_loop(void) void Arch::idle(void) { -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } Arch arch; -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #include "driver/uptime.h" @@ -117,7 +117,7 @@ void tim3_isr(void) { if (timer_get_flag(TIM3, TIM_SR_UIF)) { timer_clear_flag(TIM3, TIM_SR_UIF); -#ifdef WITH_LOOP +#ifdef CONFIG_loop run_loop = 1; #endif #ifdef TIMER_S -- cgit v1.2.3