diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arduino-nano/arch.cc | 16 | ||||
-rw-r--r-- | src/arch/arduino-nano/driver/counter.cc | 2 | ||||
-rw-r--r-- | src/arch/atmega2560/arch.cc | 16 | ||||
-rw-r--r-- | src/arch/blinkenrocket/arch.cc | 12 | ||||
-rw-r--r-- | src/arch/esp8266/arch.cc | 4 | ||||
-rw-r--r-- | src/arch/esp8266/driver/stdin.cc | 4 | ||||
-rw-r--r-- | src/arch/lm4f120h5qr-stellaris/arch.cc | 10 | ||||
-rw-r--r-- | src/arch/lm4f120h5qr-stellaris/lm4f_cpp_wrapper.c | 2 | ||||
-rw-r--r-- | src/arch/msp430fr5969lp/arch.cc | 22 | ||||
-rw-r--r-- | src/arch/msp430fr5994lp/arch.cc | 24 | ||||
-rw-r--r-- | src/arch/posix/arch.cc | 8 | ||||
-rw-r--r-- | src/arch/stm32f446re-nucleo/arch.cc | 14 |
12 files changed, 67 insertions, 67 deletions
diff --git a/src/arch/arduino-nano/arch.cc b/src/arch/arduino-nano/arch.cc index 8ff93ee..5f72c06 100644 --- a/src/arch/arduino-nano/arch.cc +++ b/src/arch/arduino-nano/arch.cc @@ -43,7 +43,7 @@ void Arch::setup(void) #error Unsupported F_CPU #endif -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10); // /1024 OCR1A = F_CPU / 1024; @@ -61,17 +61,17 @@ void Arch::setup(void) sei(); } -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup void wakeup(); #endif -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #include "driver/uptime.h" #endif -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) extern void loop(); volatile char run_loop = 0; #endif @@ -83,13 +83,13 @@ void Arch::idle_loop(void) asm("sleep"); SMCR = 0; asm("wdr"); -#ifdef WITH_LOOP +#ifdef CONFIG_loop if (run_loop) { loop(); run_loop = 0; } #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } @@ -119,12 +119,12 @@ void Arch::delay_ms(unsigned int const ms) Arch arch; -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #ifndef __acweaving ISR(TIMER1_COMPA_vect) { -#ifdef WITH_LOOP +#ifdef CONFIG_loop run_loop = 1; #endif #ifdef TIMER_S diff --git a/src/arch/arduino-nano/driver/counter.cc b/src/arch/arduino-nano/driver/counter.cc index 0c9f8a4..842bfe8 100644 --- a/src/arch/arduino-nano/driver/counter.cc +++ b/src/arch/arduino-nano/driver/counter.cc @@ -5,7 +5,7 @@ */ #include "driver/counter.h" -#if defined(TIMER_S) || defined(WITH_LOOP) +#if defined(TIMER_S) || defined(CONFIG_loop) #warn "timer/loop and counter are mutually exclusive. Expect odd behaviour." #endif diff --git a/src/arch/atmega2560/arch.cc b/src/arch/atmega2560/arch.cc index 9d7e101..763a920 100644 --- a/src/arch/atmega2560/arch.cc +++ b/src/arch/atmega2560/arch.cc @@ -19,7 +19,7 @@ void Arch::setup(void) #error Unsupported F_CPU #endif -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10); // /1024 OCR1A = F_CPU / 1024; @@ -29,17 +29,17 @@ void Arch::setup(void) sei(); } -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup void wakeup(); #endif -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #include "driver/uptime.h" #endif -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) extern void loop(); volatile char run_loop = 0; #endif @@ -51,13 +51,13 @@ void Arch::idle_loop(void) asm("sleep"); SMCR = 0; asm("wdr"); -#ifdef WITH_LOOP +#ifdef CONFIG_loop if (run_loop) { loop(); run_loop = 0; } #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } @@ -87,12 +87,12 @@ void Arch::delay_ms(unsigned int const ms) Arch arch; -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #ifndef __acweaving ISR(TIMER1_COMPA_vect) { -#ifdef WITH_LOOP +#ifdef CONFIG_loop run_loop = 1; #endif #ifdef TIMER_S diff --git a/src/arch/blinkenrocket/arch.cc b/src/arch/blinkenrocket/arch.cc index ed55d5d..7f9497e 100644 --- a/src/arch/blinkenrocket/arch.cc +++ b/src/arch/blinkenrocket/arch.cc @@ -10,7 +10,7 @@ void Arch::setup(void) { -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10); // /1024 OCR1A = F_CPU / 1024; @@ -27,11 +27,11 @@ void Arch::setup(void) sei(); } -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup void wakeup(); #endif -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #include "driver/uptime.h" void loop(); @@ -45,10 +45,10 @@ void Arch::idle_loop(void) asm("sleep"); SMCR = 0; asm("wdr"); -#ifdef WITH_LOOP +#ifdef CONFIG_loop loop(); #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif #ifdef TIMER_S @@ -81,7 +81,7 @@ void Arch::delay_ms(unsigned int const ms) Arch arch; -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) ISR(TIMER1_COMPA_vect) { diff --git a/src/arch/esp8266/arch.cc b/src/arch/esp8266/arch.cc index 1d63e67..656a700 100644 --- a/src/arch/esp8266/arch.cc +++ b/src/arch/esp8266/arch.cc @@ -22,7 +22,7 @@ extern void (*__init_array_end)(); #define user_procTaskPrio 0 #define user_procTaskQueueLen 1 -#ifdef WITH_LOOP +#ifdef CONFIG_loop LOCAL os_timer_t loop_timer; extern void loop(void); @@ -40,7 +40,7 @@ void ICACHE_FLASH_ATTR jump_to_main(void) for (void (**p)() = &__init_array_start; p != &__init_array_start; p++) { (*p)(); } -#ifdef WITH_LOOP +#ifdef CONFIG_loop os_timer_disarm(&loop_timer); os_timer_setfn(&loop_timer, (os_timer_func_t *)jump_to_loop, (void *)0); os_timer_arm(&loop_timer, 1000, 1); diff --git a/src/arch/esp8266/driver/stdin.cc b/src/arch/esp8266/driver/stdin.cc index bbb3be0..7032d81 100644 --- a/src/arch/esp8266/driver/stdin.cc +++ b/src/arch/esp8266/driver/stdin.cc @@ -38,7 +38,7 @@ void ets_isr_unmask(uint16_t idx); #define UCTOE 31 -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup void wakeup(); #endif @@ -50,7 +50,7 @@ void uart_isr() } } USIC = USIS; -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } diff --git a/src/arch/lm4f120h5qr-stellaris/arch.cc b/src/arch/lm4f120h5qr-stellaris/arch.cc index c87af2f..e613e42 100644 --- a/src/arch/lm4f120h5qr-stellaris/arch.cc +++ b/src/arch/lm4f120h5qr-stellaris/arch.cc @@ -20,16 +20,16 @@ extern "C" { void Arch::setup(void) { arch_clock_init(); -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) arch_init_loop(); #endif } -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup extern void wakeup(); #endif -#if defined(WITH_LOOP) +#if defined(CONFIG_loop) extern void loop(); extern volatile char run_loop; #endif @@ -56,7 +56,7 @@ void Arch::idle_loop(void) { while (1) { __asm__("wfi"); -#ifdef WITH_LOOP +#ifdef CONFIG_loop if (run_loop) { #ifdef TIMER_S uptime.tick_s(); @@ -71,7 +71,7 @@ void Arch::idle_loop(void) void Arch::idle(void) { __asm__("wfi"); -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif } diff --git a/src/arch/lm4f120h5qr-stellaris/lm4f_cpp_wrapper.c b/src/arch/lm4f120h5qr-stellaris/lm4f_cpp_wrapper.c index 62f1c20..877316f 100644 --- a/src/arch/lm4f120h5qr-stellaris/lm4f_cpp_wrapper.c +++ b/src/arch/lm4f120h5qr-stellaris/lm4f_cpp_wrapper.c @@ -17,7 +17,7 @@ void arch_clock_init() rcc_sysclk_config(OSCSRC_MOSC, XTAL_16M, 5); } -#ifdef WITH_LOOP +#ifdef CONFIG_loop volatile char run_loop = 1; void arch_init_loop() 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 diff --git a/src/arch/msp430fr5994lp/arch.cc b/src/arch/msp430fr5994lp/arch.cc index d3d99ae..b79b8b0 100644 --- a/src/arch/msp430fr5994lp/arch.cc +++ b/src/arch/msp430fr5994lp/arch.cc @@ -48,7 +48,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; @@ -57,7 +57,7 @@ void Arch::setup(void) CSCTL0_H = 0; -#if defined(WITH_LOOP) || F_CPU == 32768UL +#if defined(CONFIG_loop) || F_CPU == 32768UL // enable LXFT for RTC CSCTL0_H = CSKEY >> 8; CSCTL4 &= ~LFXTOFF; @@ -100,7 +100,7 @@ void Arch::setup(void) #endif // SELA__LFXTCLK falls back to VLOCLK if LFXT is not available, but set // LFXT_FAULT (LFXTOFFG) in the process. We don't want that. -#if defined(WITH_LOOP) || F_CPU == 32768UL +#if defined(CONFIG_loop) || F_CPU == 32768UL CSCTL2 = SELA__LFXTCLK | SELS__HFXTCLK | SELM__HFXTCLK; #else CSCTL2 = SELA__VLOCLK | SELS__HFXTCLK | SELM__HFXTCLK; @@ -133,7 +133,7 @@ void Arch::setup(void) CSCTL0_H = 0; #endif -#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; @@ -142,11 +142,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 @@ -231,13 +231,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 } @@ -249,14 +249,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" @@ -265,7 +265,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 @@ -275,7 +275,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 diff --git a/src/arch/posix/arch.cc b/src/arch/posix/arch.cc index 83bf845..69dfeac 100644 --- a/src/arch/posix/arch.cc +++ b/src/arch/posix/arch.cc @@ -7,11 +7,11 @@ #include <time.h> #include <unistd.h> -#if defined(WITH_LOOP) || defined(TIMER_S) +#if defined(CONFIG_loop) || defined(TIMER_S) #include "driver/uptime.h" void loop(); #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup void wakeup(); #endif @@ -21,10 +21,10 @@ void Arch::idle_loop(void) { while (1) { sleep(1); -#ifdef WITH_LOOP +#ifdef CONFIG_loop loop(); #endif -#ifdef WITH_WAKEUP +#ifdef CONFIG_wakeup wakeup(); #endif #ifdef TIMER_S 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 |