add static test start and stop commands to radio protocol for telefiretwo
authorBdale Garbee <bdale@gag.com>
Sun, 23 Apr 2017 05:01:44 +0000 (23:01 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 23 Apr 2017 05:01:44 +0000 (23:01 -0600)
src/drivers/ao_pad.c
src/drivers/ao_pad.h

index ffa833fef341341eca543fe12077dbe578fd3c32..28c00fe33ed51385a9384c08af5328a5d6b6b3b0 100644 (file)
@@ -316,7 +316,7 @@ ao_pad(void)
                        command.tick, command.box, ao_pad_box, command.cmd, command.channels);
 
                switch (command.cmd) {
-               case AO_LAUNCH_ARM:
+               case AO_PAD_ARM:
                        if (command.box != ao_pad_box) {
                                PRINTD ("box number mismatch\n");
                                break;
@@ -338,7 +338,7 @@ ao_pad(void)
                        ao_pad_arm_time = ao_time();
                        break;
 
-               case AO_LAUNCH_QUERY:
+               case AO_PAD_QUERY:
                        if (command.box != ao_pad_box) {
                                PRINTD ("box number mismatch\n");
                                break;
@@ -357,7 +357,7 @@ ao_pad(void)
                                query.igniter_status[3]);
                        ao_radio_cmac_send(&query, sizeof (query));
                        break;
-               case AO_LAUNCH_FIRE:
+               case AO_PAD_FIRE:
                        if (!ao_pad_armed) {
                                PRINTD ("not armed\n");
                                break;
@@ -373,6 +373,31 @@ ao_pad(void)
                        ao_wakeup(&ao_pad_ignite);
                        break;
                }
+               case AO_PAD_STATIC:
+                       if (!ao_pad_armed) {
+                               PRINTD ("not armed\n");
+                               break;
+                       }
+#ifdef HAS_LOG
+                       if (!ao_log_running) ao_log_start();
+#endif
+                       if ((uint16_t) (ao_time() - ao_pad_arm_time) > AO_SEC_TO_TICKS(20)) {
+                               PRINTD ("late pad arm_time %d time %d\n",
+                                       ao_pad_arm_time, ao_time());
+                               break;
+                       }
+                       PRINTD ("ignite\n");
+                       ao_pad_ignite = ao_pad_armed;
+                       ao_pad_arm_time = ao_time();
+                       ao_wakeup(&ao_pad_ignite);
+                       break;
+               }
+               case AO_PAD_ENDSTATIC:
+#ifdef HAS_LOG
+                       ao_log_stop();
+#endif
+                       break;
+               }
        }
 }
 
index 648d3005f000172babbfc594cebb6aeaa5bb86af..e41152224257db8ef4f74dca5bcbd6d88c48554d 100644 (file)
@@ -54,6 +54,11 @@ struct ao_pad_query {
  */
 #define AO_PAD_FIRE            3
 
+/* Fire current armed pads for 200ms, no report, logging test stand sensors
+ */
+#define AO_PAD_STATIC          4
+#define AO_PAD_ENDSTATIC       5
+
 #define AO_PAD_FIRE_TIME       AO_MS_TO_TICKS(200)
 
 #define AO_PAD_ARM_STATUS_DISARMED     0