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/basecmd.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/basecmd.c')
-rw-r--r-- | src/basecmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basecmd.c b/src/basecmd.c index 113cc30e..ab31efc2 100644 --- a/src/basecmd.c +++ b/src/basecmd.c @@ -30,7 +30,7 @@ move_free(struct move *m) struct move * move_alloc(void) { - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); struct move *m = move_free_list; if (!m) shutdown("Move queue empty"); @@ -231,7 +231,7 @@ void command_debug_read16(uint32_t *args) { uint16_t *ptr = (void*)(size_t)args[0]; - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); uint16_t v = *ptr; irq_restore(flag); sendf("debug_result val=%hu", v); @@ -251,7 +251,7 @@ void command_debug_write16(uint32_t *args) { uint16_t *ptr = (void*)(size_t)args[0]; - uint8_t flag = irq_save(); + irqstatus_t flag = irq_save(); *ptr = args[1]; irq_restore(flag); } |