altos: Support mega-style logging without ADC
authorKeith Packard <keithp@keithp.com>
Mon, 24 Jun 2013 21:28:06 +0000 (14:28 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 24 Jun 2013 21:30:23 +0000 (14:30 -0700)
Used for TeleGPS, just exposes the necessary log writing function
without also including the ADC writing code.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_log.c
src/core/ao_log_mega.c

index 7884ec3cde155a88102e56db5905f2e57535ae95..8bcb770763c0efe70ad1917c4d8caabc14ab257c 100644 (file)
@@ -278,6 +278,11 @@ ao_log_init(void)
 
        ao_cmd_register(&ao_log_cmds[0]);
 
+#ifndef HAS_ADC
+#error Define HAS_ADC for ao_log.c
+#endif
+#if HAS_ADC
        /* Create a task to log events to eeprom */
        ao_add_task(&ao_log_task, ao_log, "log");
+#endif
 }
index ee12b907b7b7b295ec2ce9e6c4b280e1f9c74d7f..768947d541728159f7e86d16c30d2122ad4a4914 100644 (file)
@@ -65,6 +65,7 @@ ao_log_dump_check_data(void)
        return 1;
 }
 
+#if HAS_ADC
 static __data uint8_t  ao_log_data_pos;
 
 /* a hack to make sure that ao_log_megas fill the eeprom block in even units */
@@ -182,6 +183,7 @@ ao_log(void)
                        ao_sleep(&ao_log_running);
        }
 }
+#endif
 
 uint16_t
 ao_log_flight(uint8_t slot)