cobble up a command to toggle logging on/off on TeleFireTwo
authorBdale Garbee <bdale@gag.com>
Sat, 22 Apr 2017 23:20:41 +0000 (17:20 -0600)
committerBdale Garbee <bdale@gag.com>
Sat, 22 Apr 2017 23:20:41 +0000 (17:20 -0600)
src/telefiretwo-v1.0/ao_telefiretwo.c

index fa7b767..115b3e9 100644 (file)
  */
 
 #include <ao.h>
+#include <ao_log.h>
 #include <ao_pad.h>
 #include <ao_exti.h>
 #include <ao_radio_cmac_cmd.h>
 #include <ao_eeprom.h>
 
+static void
+set_logging(void)
+{
+       ao_cmd_hex();
+       ao_log_running = ao_cmd_lex_i;
+       ao_wakeup(&ao_log_running);
+}
+
+__code struct ao_cmds ao_firetwo_cmds[] = {
+        { set_logging,  "L <0 off, 1 on>\0Log sensors to flash" },
+        { 0,    NULL },
+};
+
 void
 main(void)
 {
@@ -36,12 +50,14 @@ main(void)
        ao_dma_init();
        ao_exti_init();
 
+       ao_cmd_register(&ao_firetwo_cmds[0]);
        ao_cmd_init();
 
        ao_adc_init();
 
        ao_eeprom_init();
        ao_storage_init();
+       ao_log_init();
 
        ao_radio_init();