summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-05-28 15:17:20 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-05-28 15:17:20 +0200
commit460ecf074d133cbe026cbddb7cf5fad1180c9831 (patch)
tree2beb0cfa84698dbb723c7c62acec703fad3437da /src/arch/arduino-nano
parentcf3ba89c46301bb8c0a1eda470c353801117fc0b (diff)
Set loop/wakeup/ostream either via .config or via app/commandline
Diffstat (limited to 'src/arch/arduino-nano')
-rw-r--r--src/arch/arduino-nano/arch.cc16
-rw-r--r--src/arch/arduino-nano/driver/counter.cc2
2 files changed, 9 insertions, 9 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