diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-01-27 20:09:45 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-01-27 20:09:45 +0100 |
commit | d326c7e54390eeeed86922849066f5f575ff2a7c (patch) | |
tree | 96fc67ebcae4eaf9ded254326a328009a2a9e94c /src | |
parent | 02306ebc435d7ff665f08b5dc0b9a5c3353a39db (diff) |
msp430fr5994: run with interrupts enabled
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/msp430fr5994lp/arch.cc | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/arch/msp430fr5994lp/arch.cc b/src/arch/msp430fr5994lp/arch.cc index a09d28c..66f63ab 100644 --- a/src/arch/msp430fr5994lp/arch.cc +++ b/src/arch/msp430fr5994lp/arch.cc @@ -132,25 +132,6 @@ extern void loop(); volatile char run_loop = 0; #endif -void Arch::delay_us(unsigned int const us) -{ - if (us < 10) { - for (unsigned int i = 0; i < us; i++) { - __delay_cycles(F_CPU / 1000000UL); - } - } else { - for (unsigned int i = 0; i < us/10; i++) { - __delay_cycles(F_CPU / 100000UL); - } - } -} -void Arch::delay_ms(unsigned int const ms) -{ - for (unsigned int i = 0; i < ms; i++) { - __delay_cycles(F_CPU / 1000UL); - } -} - inline static unsigned int irq_enabled() { unsigned int sr; @@ -205,13 +186,31 @@ void Arch::sleep_ms(unsigned int const ms) TA3CTL = TASSEL__SMCLK; } +void Arch::delay_us(unsigned int const us) +{ + if (us < 10) { + for (unsigned int i = 0; i < us; i++) { + __delay_cycles(F_CPU / 1000000UL); + } + } else { + for (unsigned int i = 0; i < us/10; i++) { + __delay_cycles(F_CPU / 100000UL); + } + } +} +void Arch::delay_ms(unsigned int const ms) +{ + for (unsigned int i = 0; i < ms; i++) { + __delay_cycles(F_CPU / 1000UL); + } +} + void Arch::idle_loop(void) { while (1) { asm volatile("nop"); __bis_SR_register(GIE | LPM2_bits); asm volatile("nop"); - __dint(); #if defined(CONFIG_loop) if (run_loop) { loop(); @@ -229,7 +228,6 @@ void Arch::idle(void) asm volatile("nop"); __bis_SR_register(GIE | LPM2_bits); asm volatile("nop"); - __dint(); #ifdef CONFIG_wakeup wakeup(); #endif |