diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-05-28 15:17:20 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-05-28 15:17:20 +0200 |
commit | 460ecf074d133cbe026cbddb7cf5fad1180c9831 (patch) | |
tree | 2beb0cfa84698dbb723c7c62acec703fad3437da /src/arch/msp430fr5969lp/arch.cc | |
parent | cf3ba89c46301bb8c0a1eda470c353801117fc0b (diff) |
Set loop/wakeup/ostream either via .config or via app/commandline
Diffstat (limited to 'src/arch/msp430fr5969lp/arch.cc')
-rw-r--r-- | src/arch/msp430fr5969lp/arch.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc index df27f33..a9e1a57 100644 --- a/src/arch/msp430fr5969lp/arch.cc +++ b/src/arch/msp430fr5969lp/arch.cc @@ -46,7 +46,7 @@ void Arch::setup(void) #error Unsupported F_CPU #endif -#ifdef WITH_LOOP +#ifdef CONFIG_loop CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK; #else CSCTL2 = SELA__VLOCLK | SELS__DCOCLK | SELM__DCOCLK; @@ -55,7 +55,7 @@ void Arch::setup(void) CSCTL0_H = 0; -#ifdef WITH_LOOP +#ifdef CONFIG_loop // enable LXFT for RTC CSCTL0_H = CSKEY >> 8; CSCTL4 &= ~LFXTOFF; @@ -87,7 +87,7 @@ void Arch::setup(void) TA0CTL |= TACLR; #endif /* TIMER_US */ -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) // 1s per wakeup for loop. Independent of SMCLK/F_CPU TA1CTL = TASSEL__ACLK | ID__8 | MC__UP; TA1EX0 = 0; @@ -96,11 +96,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 @@ -171,13 +171,13 @@ void Arch::idle_loop(void) __bis_SR_register(GIE | LPM2_bits); asm volatile("nop"); __dint(); -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) if (run_loop) { loop(); run_loop = 0; } #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } @@ -189,14 +189,14 @@ void Arch::idle(void) __bis_SR_register(GIE | LPM2_bits); asm volatile("nop"); __dint(); -#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" @@ -205,7 +205,7 @@ Arch arch; __attribute__((interrupt(TIMER1_A1_VECTOR))) __attribute__((wakeup)) void handle_timer1_overflow() { if (TA1IV == 0x0e) { -#ifdef WITH_LOOP +#ifdef CONFIG_loop run_loop = 1; #endif #ifdef TIMER_S @@ -215,7 +215,7 @@ __attribute__((interrupt(TIMER1_A1_VECTOR))) __attribute__((wakeup)) void handle } #endif -#endif /* defined(WITH_LOOP) || defined(TIMER_S) */ +#endif /* defined(CONFIG_loop) || defined(TIMER_S) */ #ifndef __acweaving // CCR0 interrupts are exclusive to A0 |