X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fkernel%2Fao_pyro.c;fp=src%2Fkernel%2Fao_pyro.c;h=d4091205d2114afff64d11c1bea194a6f70f2936;hp=ee94eca35c5c22c461cc576b3bf04cd7a4fadd8b;hb=c49bd3cb0c31a51fae79ddc92237cc309be9a242;hpb=d225adc3af9e5726d436cbbdbf8dcc5837e50804 diff --git a/src/kernel/ao_pyro.c b/src/kernel/ao_pyro.c index ee94eca3..d4091205 100644 --- a/src/kernel/ao_pyro.c +++ b/src/kernel/ao_pyro.c @@ -303,7 +303,18 @@ ao_pyro_check(void) if (delay < 0) delay = 0; delay_done = ao_time() + (AO_TICK_TYPE) delay; - if (!delay_done) + + /* + * delay_done is the time at which the + * delay ends, but it is also used as + * an indication that a delay is + * active -- non-zero values indicate + * an active delay. This code ensures + * the value is non-zero, which might + * introduce an additional tick + * of delay. + */ + if (delay_done == 0) delay_done = 1; pyro_delay_done[p] = delay_done; } @@ -312,7 +323,7 @@ ao_pyro_check(void) /* Check to see if we're just waiting for * the delay to expire */ - if (pyro_delay_done[p]) { + if (pyro_delay_done[p] != 0) { /* Check to make sure the required conditions * remain valid. If not, inhibit the channel