ao_delay hasn't been chip-specific for a long time, and it had a bug
in not calling ao_clear_alarm.
Signed-off-by: Keith Packard <keithp@keithp.com>
return v;
}
-static __xdata uint8_t ao_forever;
-
-void
-ao_delay(uint16_t ticks)
-{
- ao_alarm(ticks);
- ao_sleep(&ao_forever);
-}
-
#define T1_CLOCK_DIVISOR 8 /* 24e6/8 = 3e6 */
#define T1_SAMPLE_TIME 30000 /* 3e6/30000 = 100 */
return ao_tick_count;
}
-static __xdata uint8_t ao_forever;
-
-void
-ao_delay(uint16_t ticks)
-{
- ao_alarm(ticks);
- ao_sleep(&ao_forever);
- ao_clear_alarm();
-}
-
#define T1_CLOCK_DIVISOR 8 /* 24e6/8 = 3e6 */
#define T1_SAMPLE_TIME 30000 /* 3e6/30000 = 100 */
ao_yield();
if (ao_cur_task->wchan) {
ao_cur_task->wchan = NULL;
+ ao_cur_task->alarm = 0;
return 1;
}
return 0;
ao_cur_task->alarm = 0;
}
+static __xdata uint8_t ao_forever;
+
+void
+ao_delay(uint16_t ticks)
+{
+ ao_alarm(ticks);
+ ao_sleep(&ao_forever);
+ ao_clear_alarm();
+}
+
void
ao_exit(void)
{
return v;
}
-static __xdata uint8_t ao_forever;
-
-void
-ao_delay(uint16_t ticks)
-{
- ao_alarm(ticks);
- ao_sleep(&ao_forever);
-}
-
#if AO_DATA_ALL
volatile __data uint8_t ao_data_interval = 1;
volatile __data uint8_t ao_data_count;