X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdrivers%2Fao_pad.c;h=dc2c83fe0cf3c668668dfbf354cbae020d14533f;hb=adc46e2f1346d98ef4f6c2351fef95fbc8ddf831;hp=62ae68e98d976dcdabee72103ce32300ad355e21;hpb=4ff54bb96f6c00c0c2c7dd32f81403bac331621a;p=fw%2Faltos diff --git a/src/drivers/ao_pad.c b/src/drivers/ao_pad.c index 62ae68e9..dc2c83fe 100644 --- a/src/drivers/ao_pad.c +++ b/src/drivers/ao_pad.c @@ -153,11 +153,11 @@ ao_pad_monitor(void) * * v_pyro \ * 100k igniter - * output / + * output / * 100k \ * sense relay - * 27k / - * gnd --- + * 27k / + * gnd --- * * If the relay is closed, then sense will be 0 * If no igniter is present, then sense will be v_pyro * 27k/227k = pyro * 127 / 227 ~= pyro/2 @@ -362,14 +362,26 @@ ao_pad_test(void) void ao_pad_manual(void) { + uint8_t ignite; + int repeat; ao_cmd_white(); if (!ao_match_word("DoIt")) return; ao_cmd_decimal(); if (ao_cmd_status != ao_cmd_success) return; - ao_pad_ignite = 1 << ao_cmd_lex_i; - ao_wakeup(&ao_pad_ignite); + ignite = 1 << ao_cmd_lex_i; + ao_cmd_decimal(); + if (ao_cmd_status != ao_cmd_success) { + repeat = 1; + ao_cmd_status = ao_cmd_success; + } else + repeat = ao_cmd_lex_i; + while (repeat-- > 0) { + ao_pad_ignite = ignite; + ao_wakeup(&ao_pad_ignite); + ao_delay(AO_PAD_FIRE_TIME>>1); + } } static __xdata struct ao_task ao_pad_task;