Commit 69c6db98 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

arduino nano: ignore non-timer interrupts for loop

parent fd1aabd0
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -32,10 +32,14 @@ void wakeup();
#if defined(WITH_LOOP) || defined(TIMER_S)

#include "driver/uptime.h"
void loop();

#endif

#if defined(WITH_LOOP)
extern void loop();
volatile char run_loop = 0;
#endif

void Arch::idle_loop(void)
{
	while (1) {
@@ -44,13 +48,13 @@ void Arch::idle_loop(void)
		SMCR = 0;
		asm("wdr");
#ifdef WITH_LOOP
		if (run_loop) {
			loop();
			run_loop = 0;
		}
#endif
#ifdef WITH_WAKEUP
		wakeup();
#endif
#ifdef TIMER_S
		uptime.tick_s();
#endif
	}
}
@@ -79,6 +83,12 @@ Arch arch;

ISR(TIMER1_COMPA_vect)
{
#ifdef WITH_LOOP
	run_loop = 1;
#endif
#ifdef TIMER_S
	uptime.tick_s();
#endif
}

#endif