irq: Add an irq_poll() stub for board code

Allow the board specific code to run checks prior to running each
task.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-05-07 00:09:11 -04:00
parent c35278e217
commit 969ee4c8f9
6 changed files with 17 additions and 0 deletions

View File

@ -28,4 +28,7 @@ static inline void irq_restore(irqstatus_t flag) {
SREG = flag; SREG = flag;
} }
static inline void irq_poll(void) {
}
#endif // irq.h #endif // irq.h

View File

@ -7,6 +7,7 @@
#include <stdarg.h> // va_start #include <stdarg.h> // va_start
#include <string.h> // memcpy #include <string.h> // memcpy
#include "board/io.h" // readb #include "board/io.h" // readb
#include "board/irq.h" // irq_poll
#include "board/misc.h" // crc16_ccitt #include "board/misc.h" // crc16_ccitt
#include "board/pgm.h" // READP #include "board/pgm.h" // READP
#include "command.h" // output_P #include "command.h" // output_P
@ -306,6 +307,7 @@ command_task(void)
p = parsef(p, msgend, cp, args); p = parsef(p, msgend, cp, args);
if (!p) if (!p)
break; break;
irq_poll();
void (*func)(uint32_t*) = READP(cp->func); void (*func)(uint32_t*) = READP(cp->func);
func(args); func(args);
} }

View File

@ -34,6 +34,11 @@ irq_restore(irqstatus_t flag)
asm volatile("msr primask, %0" :: "r" (flag) : "memory"); asm volatile("msr primask, %0" :: "r" (flag) : "memory");
} }
void
irq_poll(void)
{
}
// Clear the active irq if a shutdown happened in an irq handler // Clear the active irq if a shutdown happened in an irq handler
static void static void
clear_active_irq(void) clear_active_irq(void)

View File

@ -9,5 +9,6 @@ void irq_disable(void);
void irq_enable(void); void irq_enable(void);
irqstatus_t irq_save(void); irqstatus_t irq_save(void);
void irq_restore(irqstatus_t flag); void irq_restore(irqstatus_t flag);
void irq_poll(void);
#endif // irq.h #endif // irq.h

View File

@ -268,6 +268,7 @@ run_task(void)
{ {
struct callback_handler *p; struct callback_handler *p;
foreachdecl(p, taskfuncs) { foreachdecl(p, taskfuncs) {
irq_poll();
void (*func)(void) = READP(p->func); void (*func)(void) = READP(p->func);
func(); func();
} }

View File

@ -47,6 +47,11 @@ irq_restore(irqstatus_t flag)
Interrupt_off = flag; Interrupt_off = flag;
} }
void
irq_poll(void)
{
}
/**************************************************************** /****************************************************************
* Timers * Timers