summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-12 21:43:56 -0700
committerKeith Packard <keithp@keithp.com>2011-08-13 18:44:26 -0700
commitbf06af154e232d4caa1585a1d6d5279a075292e4 (patch)
treef3e6a4f162eef9284996b7637e360422a9b12ba5 /src
parentc2f2f519dbc8ce233ab36222088c1be6b1362f01 (diff)
altos/altosui: Report log format in the version command
This will make it easier to figure out what the contents of the flash should look like from altosui; the current 'guessing' mechanism will not scale to many more formats. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/ao.h9
-rw-r--r--src/ao_cmd.c3
-rw-r--r--src/ao_log.c2
-rw-r--r--src/ao_log_tiny.c2
-rw-r--r--src/ao_telebt.c2
5 files changed, 18 insertions, 0 deletions
diff --git a/src/ao.h b/src/ao.h
index 0699fc2c..1c8f5bbf 100644
--- a/src/ao.h
+++ b/src/ao.h
@@ -539,6 +539,15 @@ extern __pdata enum flight_state ao_log_state;
/* required functions from the underlying log system */
+#define AO_LOG_FORMAT_UNKNOWN 0 /* unknown; altosui will have to guess */
+#define AO_LOG_FORMAT_FULL 1 /* 8 byte typed log records */
+#define AO_LOG_FORMAT_TINY 2 /* two byte state/baro records */
+#define AO_LOG_FORMAT_TELEMETRY 3 /* 32 byte ao_telemetry records */
+#define AO_LOG_FORMAT_TELESCIENCE 4 /* 32 byte typed telescience records */
+#define AO_LOG_FORMAT_NONE 127 /* No log at all */
+
+extern __code uint8_t ao_log_format;
+
/* Return the flight number from the given log slot, 0 if none */
uint16_t
ao_log_flight(uint8_t slot);
diff --git a/src/ao_cmd.c b/src/ao_cmd.c
index 6d3ae38d..1442ebea 100644
--- a/src/ao_cmd.c
+++ b/src/ao_cmd.c
@@ -219,6 +219,9 @@ version(void)
printf("manufacturer %s\n", ao_manufacturer);
printf("product %s\n", ao_product);
printf("serial-number %u\n", ao_serial_number);
+#if HAS_EEPROM
+ printf("log-format %u\n", ao_log_format);
+#endif
printf("software-version %s\n", ao_version);
}
diff --git a/src/ao_log.c b/src/ao_log.c
index 80d7243d..6d3ad535 100644
--- a/src/ao_log.c
+++ b/src/ao_log.c
@@ -24,6 +24,8 @@ __xdata uint8_t ao_log_running;
__pdata enum flight_state ao_log_state;
__xdata uint16_t ao_flight_number;
+__code uint8_t ao_log_format = AO_LOG_FORMAT_FULL;
+
void
ao_log_flush(void)
{
diff --git a/src/ao_log_tiny.c b/src/ao_log_tiny.c
index d26e0080..d5a3b99f 100644
--- a/src/ao_log_tiny.c
+++ b/src/ao_log_tiny.c
@@ -28,6 +28,8 @@ static __data uint16_t ao_log_tiny_interval;
#define AO_PAD_RING 2
#endif
+__code uint8_t ao_log_format = AO_LOG_FORMAT_TINY;
+
void
ao_log_tiny_set_interval(uint16_t ticks)
{
diff --git a/src/ao_telebt.c b/src/ao_telebt.c
index 8e77c4d9..85565172 100644
--- a/src/ao_telebt.c
+++ b/src/ao_telebt.c
@@ -17,6 +17,8 @@
#include "ao.h"
+__code uint8_t ao_log_format = AO_LOG_FORMAT_NONE; /* until we actually log stuff */
+
void
main(void)
{