Make some functions reentrant to save DSEG space
authorKeith Packard <keithp@keithp.com>
Sat, 25 Apr 2009 20:13:24 +0000 (13:13 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 25 Apr 2009 20:13:24 +0000 (13:13 -0700)
ao.h
ao_beep.c
ao_led.c
ao_task.c

diff --git a/ao.h b/ao.h
index cbb6b26f4d630c89f6ae33d6bd57918a2187ad32..2cad7621c5e5db33d072954149ed05b66b441924 100644 (file)
--- a/ao.h
+++ b/ao.h
@@ -65,7 +65,7 @@ ao_yield(void) _naked;
 
 /* Add a task to the run queue */
 void
 
 /* Add a task to the run queue */
 void
-ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name);
+ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant;
 
 /* Dump task info to console */
 void
 
 /* Dump task info to console */
 void
@@ -215,7 +215,7 @@ ao_beep(uint8_t beep);
 
 /* Turn on the beeper for the specified time */
 void
 
 /* Turn on the beeper for the specified time */
 void
-ao_beep_for(uint8_t beep, uint16_t ticks);
+ao_beep_for(uint8_t beep, uint16_t ticks) __reentrant;
 
 /* Initialize the beeper */
 void
 
 /* Initialize the beeper */
 void
@@ -243,7 +243,7 @@ ao_led_set(uint8_t colors);
 
 /* Turn on the specified LEDs for the indicated interval */
 void
 
 /* Turn on the specified LEDs for the indicated interval */
 void
-ao_led_for(uint8_t colors, uint16_t ticks);
+ao_led_for(uint8_t colors, uint16_t ticks) __reentrant;
 
 /* Initialize the LEDs */
 void
 
 /* Initialize the LEDs */
 void
index 93c2e890965d80b5690d6ee9cd9e97ed829a31a1..3642f4c6600468371ce580b402e3ed00432e8697 100644 (file)
--- a/ao_beep.c
+++ b/ao_beep.c
@@ -32,7 +32,7 @@ ao_beep(uint8_t beep)
 }
 
 void
 }
 
 void
-ao_beep_for(uint8_t beep, uint16_t ticks)
+ao_beep_for(uint8_t beep, uint16_t ticks) __reentrant
 {
        ao_beep(beep);
        ao_delay(ticks);
 {
        ao_beep(beep);
        ao_delay(ticks);
index f2bc179adfc21663a10d62f984ee5a7f25baeccd..1268ff6952cef8a4a95084214165f986917c5f38 100644 (file)
--- a/ao_led.c
+++ b/ao_led.c
@@ -36,7 +36,7 @@ ao_led_set(uint8_t colors)
 }
 
 void
 }
 
 void
-ao_led_for(uint8_t colors, uint16_t ticks)
+ao_led_for(uint8_t colors, uint16_t ticks) __reentrant
 {
        ao_led_on(colors);
        ao_delay(ticks);
 {
        ao_led_on(colors);
        ao_delay(ticks);
index 47db1277c11c27e20247a0b2d8b3f2f54c04fdf8..81a71dda3d258ba5c24d5691282eab0f73b18c5d 100644 (file)
--- a/ao_task.c
+++ b/ao_task.c
@@ -25,7 +25,7 @@ __data uint8_t ao_cur_task_index;
 __xdata struct ao_task *__data ao_cur_task;
 
 void
 __xdata struct ao_task *__data ao_cur_task;
 
 void
-ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name)
+ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant
 {
        uint8_t __xdata *stack;
        if (ao_num_tasks == AO_NUM_TASKS)
 {
        uint8_t __xdata *stack;
        if (ao_num_tasks == AO_NUM_TASKS)