diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-06-08 21:13:53 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-06-13 23:18:59 -0400 |
commit | fa85094cbb139c734150802b02e22913abcfccb3 (patch) | |
tree | 980eccc8282acfb602a96523488f033bb368fcd4 /src/sched.c | |
parent | 9dd101c26fff95e596039d6168d4ad25e080071c (diff) | |
download | kutter-fa85094cbb139c734150802b02e22913abcfccb3.tar.gz kutter-fa85094cbb139c734150802b02e22913abcfccb3.tar.xz kutter-fa85094cbb139c734150802b02e22913abcfccb3.zip |
irq: Allow boards to define the return type of irq_save()
The AVR wants a uint8_t return type for irq_save(), but other
architectures will generally prefer int. Allow the board to configure
the size of the flag by introducing an irqstatus_t typedef.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sched.c')
-rw-r--r-- | src/sched.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sched.c b/src/sched.c index 539cb57b..99e37dd6 100644 --- a/src/sched.c +++ b/src/sched.c @@ -43,7 +43,7 @@ uint8_t sched_check_periodic(uint16_t time, uint16_t *pnext) { uint16_t next = *pnext, cur; - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); cur = millis; irq_restore(flag); if ((int16_t)(cur - next) < 0) @@ -82,7 +82,7 @@ void sched_timer(struct timer *add) { uint32_t waketime = add->waketime; - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); if (sched_is_before(waketime, timer_list->waketime)) { // This timer is the next - insert at front of list and reschedule add->next = timer_list; @@ -105,7 +105,7 @@ sched_timer(struct timer *add) void sched_del_timer(struct timer *del) { - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); if (timer_list == del) { // Deleting the next active timer - delete and reschedule timer_list = del->next; |