altos: Adapt micro log to MicroPeak V3
authorKeith Packard <keithp@keithp.com>
Fri, 28 Apr 2017 06:52:29 +0000 (23:52 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 28 Apr 2017 06:52:29 +0000 (23:52 -0700)
Allow use of regular serial API for sending data.
Allow application to specify different storage size.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_log_micro.c
src/kernel/ao_log_micro.h

index aa0f5c76c45f9c3277d638fa090f777b5946d55f..d6f9c5a84e85c480549fef6621793796819e2dc9 100644 (file)
 #include <ao.h>
 #include <ao_micropeak.h>
 #include <ao_log_micro.h>
+#ifndef ao_async_byte
 #include <ao_async.h>
+#else
+#include <ao_serial.h>
+#endif
+#include <ao_storage.h>
 
 static uint16_t ao_log_offset = STARTING_LOG_OFFSET;
 
index ec5cf3ed60409860ac04c9b6b189015f78c63b24..f0243028adc1a22a5686f518cffc994eead7dac4 100644 (file)
@@ -23,7 +23,9 @@
 #define PA_MIN_OFFSET          4
 #define N_SAMPLES_OFFSET       8
 #define STARTING_LOG_OFFSET    10
+#ifndef MAX_LOG_OFFSET
 #define MAX_LOG_OFFSET         512
+#endif
 
 void
 ao_log_micro_save(void);