altos/telefire: Leave siren on all the time. Add siren/strobe debugging.
authorKeith Packard <keithp@keithp.com>
Sun, 9 Jun 2013 19:13:06 +0000 (12:13 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 9 Jun 2013 19:13:39 +0000 (12:13 -0700)
The 50% duty cycle wasn't actually loud enough outside.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_pad.c

index e0c03c74fbd9329ab0291a6cb976a14576ff855b..e205f99b5e26a1b360cac76a6f821dd305e565a9 100644 (file)
@@ -182,10 +182,7 @@ ao_pad_monitor(void)
 
                if (ao_pad_armed) {
                        ao_strobe(1);
 
                if (ao_pad_armed) {
                        ao_strobe(1);
-                       if (sample & 2)
-                               ao_siren(1);
-                       else
-                               ao_siren(0);
+                       ao_siren(1);
                        beeping = 1;
                } else if (query.arm_status == AO_PAD_ARM_STATUS_ARMED && !beeping) {
                        if (arm_beep_time == 0) {
                        beeping = 1;
                } else if (query.arm_status == AO_PAD_ARM_STATUS_ARMED && !beeping) {
                        if (arm_beep_time == 0) {
@@ -379,6 +376,26 @@ ao_pad_set_debug(void)
        if (ao_cmd_status == ao_cmd_success)
                ao_pad_debug = ao_cmd_lex_i != 0;
 }
        if (ao_cmd_status == ao_cmd_success)
                ao_pad_debug = ao_cmd_lex_i != 0;
 }
+
+
+static void
+ao_pad_alarm_debug(void)
+{
+       uint8_t which, value;
+       ao_cmd_decimal();
+       if (ao_cmd_status != ao_cmd_success)
+               return;
+       which = ao_cmd_lex_i;
+       ao_cmd_decimal();
+       if (ao_cmd_status != ao_cmd_success)
+               return;
+       value = ao_cmd_lex_i;
+       printf ("Set %s to %d\n", which ? "siren" : "strobe", value);
+       if (which)
+               ao_siren(value);
+       else
+               ao_strobe(value);
+}
 #endif
 
 __code struct ao_cmds ao_pad_cmds[] = {
 #endif
 
 __code struct ao_cmds ao_pad_cmds[] = {
@@ -386,6 +403,7 @@ __code struct ao_cmds ao_pad_cmds[] = {
        { ao_pad_manual,        "i <key> <n>\0Fire igniter. <key> is doit with D&I" },
 #if DEBUG
        { ao_pad_set_debug,     "D <0 off, 1 on>\0Debug" },
        { ao_pad_manual,        "i <key> <n>\0Fire igniter. <key> is doit with D&I" },
 #if DEBUG
        { ao_pad_set_debug,     "D <0 off, 1 on>\0Debug" },
+       { ao_pad_alarm_debug,   "S <0 strobe, 1 siren> <0 off, 1 on>\0Set alarm output" },
 #endif
        { 0, NULL }
 };
 #endif
        { 0, NULL }
 };