From 422799d9be36ef71b63c1c0fd80d5e76da802949 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 8 Oct 2012 21:59:55 -0700 Subject: altos: Compute desired frequency when upgrading from pre-1.1 Instead of just smashing the frequency to 434.550, compute the frequency from the old radio channel value Signed-off-by: Keith Packard --- src/core/ao_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/ao_config.c b/src/core/ao_config.c index ce855ad1..e8ff95b7 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -102,6 +102,7 @@ _ao_config_get(void) ao_xmemset(&ao_config.callsign, '\0', sizeof (ao_config.callsign)); ao_xmemcpy(&ao_config.callsign, CODE_TO_XDATA(AO_CONFIG_DEFAULT_CALLSIGN), sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1); + ao_config._legacy_radio_channel = 0; } minor = ao_config.minor; if (minor != AO_CONFIG_MINOR) { @@ -131,7 +132,7 @@ _ao_config_get(void) if (minor < 9) ao_xmemset(&ao_config.aes_key, '\0', AO_AES_LEN); if (minor < 10) - ao_config.frequency = 434550; + ao_config.frequency = 434550 + ao_config._legacy_radio_channel * 100; if (minor < 11) ao_config.apogee_lockout = 0; #if AO_PYRO_NUM -- cgit v1.2.3 From a07b8ba166e05e7d1722c59651ef00e9fb7580d5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 13:31:17 -0700 Subject: altos: Split task definitions out to ao_task.h And only include them if using tasks Signed-off-by: Keith Packard --- src/core/ao.h | 63 ++++-------------------------------------- src/core/ao_task.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 57 deletions(-) create mode 100644 src/core/ao_task.h (limited to 'src/core') diff --git a/src/core/ao.h b/src/core/ao.h index 31ec4686..711b3533 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -39,64 +39,13 @@ #define CODE_TO_XDATA(a) (a) #endif -/* An AltOS task */ -struct ao_task { - __xdata void *wchan; /* current wait channel (NULL if running) */ - uint16_t alarm; /* abort ao_sleep time */ - ao_arch_task_members /* any architecture-specific fields */ - uint8_t task_id; /* unique id */ - __code char *name; /* task name */ - uint8_t stack[AO_STACK_SIZE]; /* saved stack */ -}; - -extern __xdata struct ao_task *__data ao_cur_task; - -#define AO_NUM_TASKS 16 /* maximum number of tasks */ -#define AO_NO_TASK 0 /* no task id */ - -/* - ao_task.c - */ - -/* Suspend the current task until wchan is awoken. - * returns: - * 0 on normal wake - * 1 on alarm - */ -uint8_t -ao_sleep(__xdata void *wchan); - -/* Wake all tasks sleeping on wchan */ -void -ao_wakeup(__xdata void *wchan); - -/* set an alarm to go off in 'delay' ticks */ -void -ao_alarm(uint16_t delay); - -/* Clear any pending alarm */ -void -ao_clear_alarm(void); - -/* Yield the processor to another task */ -void -ao_yield(void) ao_arch_naked_declare; - -/* Add a task to the run queue */ -void -ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant; - -/* Terminate the current task */ -void -ao_exit(void); - -/* Dump task info to console */ -void -ao_task_info(void); +#ifndef HAS_TASK +#define HAS_TASK 1 +#endif -/* Start the scheduler. This will not return */ -void -ao_start_scheduler(void); +#if HAS_TASK +#include +#endif /* * ao_panic.c diff --git a/src/core/ao_task.h b/src/core/ao_task.h new file mode 100644 index 00000000..18edd866 --- /dev/null +++ b/src/core/ao_task.h @@ -0,0 +1,80 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef _AO_TASK_H_ +#define _AO_TASK_H_ + +/* An AltOS task */ +struct ao_task { + __xdata void *wchan; /* current wait channel (NULL if running) */ + uint16_t alarm; /* abort ao_sleep time */ + ao_arch_task_members /* any architecture-specific fields */ + uint8_t task_id; /* unique id */ + __code char *name; /* task name */ + uint8_t stack[AO_STACK_SIZE]; /* saved stack */ +}; + +extern __xdata struct ao_task *__data ao_cur_task; + +#define AO_NUM_TASKS 16 /* maximum number of tasks */ +#define AO_NO_TASK 0 /* no task id */ + +/* + ao_task.c + */ + +/* Suspend the current task until wchan is awoken. + * returns: + * 0 on normal wake + * 1 on alarm + */ +uint8_t +ao_sleep(__xdata void *wchan); + +/* Wake all tasks sleeping on wchan */ +void +ao_wakeup(__xdata void *wchan); + +/* set an alarm to go off in 'delay' ticks */ +void +ao_alarm(uint16_t delay); + +/* Clear any pending alarm */ +void +ao_clear_alarm(void); + +/* Yield the processor to another task */ +void +ao_yield(void) ao_arch_naked_declare; + +/* Add a task to the run queue */ +void +ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant; + +/* Terminate the current task */ +void +ao_exit(void); + +/* Dump task info to console */ +void +ao_task_info(void); + +/* Start the scheduler. This will not return */ +void +ao_start_scheduler(void); + +#endif -- cgit v1.2.3 From 6a3ee911353291b04e161d50a181ed4211d467a2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 13:54:37 -0700 Subject: altos: Allow projects to specify clock at other than 100Hz Leave the default at 100Hz, but allow it to be overridden Signed-off-by: Keith Packard --- src/core/ao.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/ao.h b/src/core/ao.h index 711b3533..9d801489 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -85,7 +85,9 @@ ao_panic(uint8_t reason); extern volatile __data AO_TICK_TYPE ao_tick_count; /* Our timer runs at 100Hz */ +#ifndef AO_HERTZ #define AO_HERTZ 100 +#endif #define AO_MS_TO_TICKS(ms) ((ms) / (1000 / AO_HERTZ)) #define AO_SEC_TO_TICKS(s) ((s) * AO_HERTZ) -- cgit v1.2.3 From be0a28ee7a6fbd98fc8113db8501bb791a112fa0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 13:55:33 -0700 Subject: altos: Allow for other mutex implementations Allow projects to replace ao_mutex_get and ao_mutex_put with macros Signed-off-by: Keith Packard --- src/core/ao.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/ao.h b/src/core/ao.h index 9d801489..200d4bc4 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -119,11 +119,13 @@ ao_clock_init(void); * ao_mutex.c */ +#ifndef ao_mutex_get void ao_mutex_get(__xdata uint8_t *ao_mutex) __reentrant; void ao_mutex_put(__xdata uint8_t *ao_mutex) __reentrant; +#endif /* * ao_cmd.c -- cgit v1.2.3 From 175380a436efa35bbfae2ee5e29e12e9ef86fbde Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 13:57:49 -0700 Subject: altos: Use alt_t for all Pascal-based altitude data This allows alt_t to be overridden for systems using the MS5607/MS5611 sensors Signed-off-by: Keith Packard --- src/core/ao.h | 6 ++++-- src/core/ao_convert_pa.c | 6 +++--- src/core/ao_convert_pa_test.c | 1 + src/core/ao_data.h | 11 ++++++++++- 4 files changed, 18 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/ao.h b/src/core/ao.h index 200d4bc4..e559e876 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -272,11 +272,13 @@ ao_temp_to_dC(int16_t temp) __reentrant; * Convert between pressure in Pa and altitude in meters */ -int32_t +#include + +alt_t ao_pa_to_altitude(int32_t pa); int32_t -ao_altitude_to_pa(int32_t alt); +ao_altitude_to_pa(alt_t alt); #if HAS_DBG #include diff --git a/src/core/ao_convert_pa.c b/src/core/ao_convert_pa.c index 0c93caea..1413681d 100644 --- a/src/core/ao_convert_pa.c +++ b/src/core/ao_convert_pa.c @@ -26,7 +26,7 @@ static const int32_t altitude_table[] = { #define ALT_SCALE (1 << ALT_SHIFT) #define ALT_MASK (ALT_SCALE - 1) -int32_t +alt_t ao_pa_to_altitude(int32_t pa) { int16_t o; @@ -40,8 +40,8 @@ ao_pa_to_altitude(int32_t pa) o = pa >> ALT_SHIFT; part = pa & ALT_MASK; - low = (int32_t) altitude_table[o] * (ALT_SCALE - part); - high = (int32_t) altitude_table[o+1] * part + (ALT_SCALE >> 1); + low = (alt_t) FETCH_ALT(o) * (ALT_SCALE - part); + high = (alt_t) FETCH_ALT(o+1) * part + (ALT_SCALE >> 1); return (low + high) >> ALT_SHIFT; } diff --git a/src/core/ao_convert_pa_test.c b/src/core/ao_convert_pa_test.c index 972a4d4c..143ce958 100644 --- a/src/core/ao_convert_pa_test.c +++ b/src/core/ao_convert_pa_test.c @@ -17,6 +17,7 @@ #include #define AO_CONVERT_TEST +typedef int32_t alt_t; #include "ao_host.h" #include "ao_convert_pa.c" diff --git a/src/core/ao_data.h b/src/core/ao_data.h index 2b9ef5ac..90182b12 100644 --- a/src/core/ao_data.h +++ b/src/core/ao_data.h @@ -110,7 +110,12 @@ extern volatile __data uint8_t ao_data_count; #define HAS_BARO 1 typedef int32_t pres_t; -typedef int32_t alt_t; + +#ifndef AO_ALT_TYPE +#define AO_ALT_TYPE int32_t +#endif + +typedef AO_ALT_TYPE alt_t; #define ao_data_pres_cook(packet) ao_ms5607_convert(&packet->ms5607_raw, &packet->ms5607_cooked) @@ -135,6 +140,10 @@ typedef int16_t alt_t; #endif +#if !HAS_BARO +typedef int16_t alt_t; +#endif + /* * Need a few macros to pull data from the sensors: * -- cgit v1.2.3 From 68308908afbd1f04b17056d2be408c89b3578c86 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 13:59:50 -0700 Subject: altos: Parameterize altitude table access and initialization This allows projects to store the altitude data in different representations or with different access modes. By default, altitude data is stored in meters, but the initializers include decimeter values so those can be used instead if desired. Signed-off-by: Keith Packard --- src/core/ao_convert_pa.c | 10 +++++++++- src/util/make-altitude-pa | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_convert_pa.c b/src/core/ao_convert_pa.c index 1413681d..2793b77c 100644 --- a/src/core/ao_convert_pa.c +++ b/src/core/ao_convert_pa.c @@ -19,10 +19,18 @@ #include "ao.h" #endif -static const int32_t altitude_table[] = { +#ifndef AO_CONST_ATTRIB +#define AO_CONST_ATTRIB +#endif + +static const alt_t altitude_table[] AO_CONST_ATTRIB = { #include "altitude-pa.h" }; +#ifndef FETCH_ALT +#define FETCH_ALT(o) altitude_table[o] +#endif + #define ALT_SCALE (1 << ALT_SHIFT) #define ALT_MASK (ALT_SCALE - 1) diff --git a/src/util/make-altitude-pa b/src/util/make-altitude-pa index eae5ebe9..22831d50 100644 --- a/src/util/make-altitude-pa +++ b/src/util/make-altitude-pa @@ -239,8 +239,8 @@ real sample_to_fit_altitude(int sample) { real i_v; r_v = sample * l.m + l.b; - i_v = (round(alt_part[sub]) * (seg_len - off) + round(alt_part[sub+1]) * off) / seg_len; - return i_v; + i_v = (round(alt_part[sub]*10) * (seg_len - off) + round(alt_part[sub+1]*10) * off) / seg_len; + return i_v/10; } real max_error = 0; @@ -279,11 +279,11 @@ printf ("/*max error %f at %7.3f kPa. Average error %f*/\n", printf ("#define NALT %d\n", dim(alt_part)); printf ("#define ALT_SHIFT %d\n", pa_part_shift + pa_sample_shift); -printf ("#ifndef SATURATE\n#define SATURATE(x) (x)\n#endif\n"); +printf ("#ifndef AO_ALT_VALUE\n#define AO_ALT_VALUE(x) (alt_t) (x)\n#endif\n"); for (int part = 0; part < dim(alt_part); part++) { real kPa = sample_to_Pa(part_to_sample(part)) / 1000; - printf ("SATURATE(%9d), /* %6.2f kPa error %6.2fm */\n", - round (alt_part[part]), kPa, + printf ("AO_ALT_VALUE(%10.1f), /* %6.2f kPa error %6.2fm */\n", + round (alt_part[part]*10) / 10, kPa, alt_error[part]); } -- cgit v1.2.3 From 866d10b3faa96f6c5a2c495a2c12a0d2bc8259ef Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 14:01:16 -0700 Subject: altos: Elide ao_altitude_to_pa in flight firmware Only the conversion testing code needs to get back from altitude to pressure, so don't include that code in other environments. Signed-off-by: Keith Packard --- src/core/ao_convert_pa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/ao_convert_pa.c b/src/core/ao_convert_pa.c index 2793b77c..55fe6e7d 100644 --- a/src/core/ao_convert_pa.c +++ b/src/core/ao_convert_pa.c @@ -53,6 +53,7 @@ ao_pa_to_altitude(int32_t pa) return (low + high) >> ALT_SHIFT; } +#ifdef AO_CONVERT_TEST int32_t ao_altitude_to_pa(int32_t alt) { @@ -78,3 +79,4 @@ ao_altitude_to_pa(int32_t alt) pa = 0; return pa; } +#endif -- cgit v1.2.3 From 7751c9cbc630f7251b8988f8da68be9a54ff552c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 14:02:29 -0700 Subject: altos: Clean up types in Pa conversion testing code. Only test to 40km A couple of missing 'int' declarations. Only test to 40km as above that there aren't enough data points to do anything reasonable Signed-off-by: Keith Packard --- src/core/ao_convert_pa_test.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_convert_pa_test.c b/src/core/ao_convert_pa_test.c index 143ce958..7d5b1922 100644 --- a/src/core/ao_convert_pa_test.c +++ b/src/core/ao_convert_pa_test.c @@ -24,9 +24,10 @@ typedef int32_t alt_t; #define STEP_P 1 #define STEP_A 1 -static inline i_abs(int i) { return i < 0 ? -i : i; } +static inline int i_abs(int i) { return i < 0 ? -i : i; } -main () +int +main (int argc, char **argv) { int i; int32_t p_to_a, p_to_a_to_p; @@ -50,9 +51,7 @@ main () // printf ("pa %d alt %d pa %d\n", // i, p_to_a, p_to_a_to_p); } - for (i = -1450; i < 74250 + STEP_A; i += STEP_A) { - if (i > 74250) - i = 74250; + for (i = -1450; i < 40000 + STEP_A; i += STEP_A) { a_to_p = ao_altitude_to_pa(i); a_to_p_to_a = ao_pa_to_altitude(a_to_p); a_error = i_abs(a_to_p_to_a - i); -- cgit v1.2.3 From 16bad3b6ab65cf31b19152127cb6af69142c5c12 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 14:03:28 -0700 Subject: altos: Include struct ao_data declaration only when used Leave it out for products that don't have a ring of sensor data Signed-off-by: Keith Packard --- src/core/ao_data.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core') diff --git a/src/core/ao_data.h b/src/core/ao_data.h index 90182b12..1153d433 100644 --- a/src/core/ao_data.h +++ b/src/core/ao_data.h @@ -52,6 +52,8 @@ #define AO_DATA_MMA655X 0 #endif +#ifdef AO_DATA_RING + #define AO_DATA_ALL (AO_DATA_ADC|AO_DATA_MS5607|AO_DATA_MPU6000|AO_DATA_HMC5883|AO_DATA_MMA655X) struct ao_data { @@ -102,6 +104,8 @@ extern volatile __data uint8_t ao_data_count; ao_sleep((void *) &ao_data_count); \ } while (0) +#endif /* AO_DATA_RING */ + #if !HAS_BARO && HAS_MS5607 /* Either an MS5607 or an MS5611 hooked to a SPI port -- cgit v1.2.3 From 9c732effeb2ef4a4d8bc9599febed74a6ec2f466 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Oct 2012 14:18:37 -0700 Subject: altos: Allow products to define which LED to panic with Continue to use AO_LED_RED by default. Signed-off-by: Keith Packard --- src/core/ao_panic.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_panic.c b/src/core/ao_panic.c index 52433044..3c0b471e 100644 --- a/src/core/ao_panic.c +++ b/src/core/ao_panic.c @@ -29,6 +29,10 @@ #define ao_led_off(x) #endif +#ifndef AO_LED_PANIC +#define AO_LED_PANIC AO_LED_RED +#endif + static void ao_panic_delay(uint8_t n) { @@ -52,10 +56,10 @@ ao_panic(uint8_t reason) __critical for (;;) { ao_panic_delay(20); for (n = 0; n < 5; n++) { - ao_led_on(AO_LED_RED); + ao_led_on(AO_LED_PANIC); ao_beep(AO_BEEP_HIGH); ao_panic_delay(1); - ao_led_off(AO_LED_RED); + ao_led_off(AO_LED_PANIC); ao_beep(AO_BEEP_LOW); ao_panic_delay(1); } @@ -66,18 +70,18 @@ ao_panic(uint8_t reason) #pragma disable_warning 126 #endif if (reason & 0x40) { - ao_led_on(AO_LED_RED); + ao_led_on(AO_LED_PANIC); ao_beep(AO_BEEP_HIGH); ao_panic_delay(40); - ao_led_off(AO_LED_RED); + ao_led_off(AO_LED_PANIC); ao_beep(AO_BEEP_OFF); ao_panic_delay(10); } for (n = 0; n < (reason & 0x3f); n++) { - ao_led_on(AO_LED_RED); + ao_led_on(AO_LED_PANIC); ao_beep(AO_BEEP_MID); ao_panic_delay(10); - ao_led_off(AO_LED_RED); + ao_led_off(AO_LED_PANIC); ao_beep(AO_BEEP_OFF); ao_panic_delay(10); } -- cgit v1.2.3 From eea1c8da986f9dbd0ca58c926a2bbe01721c1bda Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Oct 2012 13:33:45 -0700 Subject: altos: Document a few member offsets in struct ao_log_record Incomplete, but useful even so Signed-off-by: Keith Packard --- src/core/ao_log.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_log.h b/src/core/ao_log.h index 04abeb7e..30ef03f2 100644 --- a/src/core/ao_log.h +++ b/src/core/ao_log.h @@ -138,17 +138,17 @@ ao_log_full(void); #define AO_LOG_POS_NONE (~0UL) struct ao_log_record { - char type; - uint8_t csum; - uint16_t tick; + char type; /* 0 */ + uint8_t csum; /* 1 */ + uint16_t tick; /* 2 */ union { struct { - int16_t ground_accel; - uint16_t flight; + int16_t ground_accel; /* 4 */ + uint16_t flight; /* 6 */ } flight; struct { - int16_t accel; - int16_t pres; + int16_t accel; /* 4 */ + int16_t pres; /* 6 */ } sensor; struct { int16_t temp; -- cgit v1.2.3 From 46abd248fb2eb84f161672ffce121b2203d42be0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Oct 2012 13:34:28 -0700 Subject: altos: struct ao_log_mega doesn't have a ground temp value There's no averaged ground temperature recorded in the flight system to save there, so just remove the field Signed-off-by: Keith Packard --- src/core/ao_log.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_log.h b/src/core/ao_log.h index 30ef03f2..eaaca444 100644 --- a/src/core/ao_log.h +++ b/src/core/ao_log.h @@ -201,8 +201,7 @@ struct ao_log_mega { uint16_t flight; /* 4 */ int16_t ground_accel; /* 6 */ uint32_t ground_pres; /* 8 */ - uint32_t ground_temp; /* 12 */ - } flight; /* 16 */ + } flight; /* 12 */ struct { uint16_t state; uint16_t reason; -- cgit v1.2.3 From 5caf56e89678637c1afa79700a2fa09aa67dea9b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Oct 2012 15:02:42 -0700 Subject: altos: When missing MMA655x, create fake Z accel value This avoids overwriting the MPU6000 y acceleration value so that other computations using that value can work unmodified. Signed-off-by: Keith Packard --- src/core/ao_data.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/ao_data.h b/src/core/ao_data.h index 1153d433..86acd48f 100644 --- a/src/core/ao_data.h +++ b/src/core/ao_data.h @@ -67,6 +67,9 @@ struct ao_data { #endif #if HAS_MPU6000 struct ao_mpu6000_sample mpu6000; +#if !HAS_MMA655X + int16_t z_accel; +#endif #endif #if HAS_HMC5883 struct ao_hmc5883_sample hmc5883; @@ -285,9 +288,9 @@ typedef int16_t accel_t; typedef int16_t accel_t; /* MPU6000 is hooked up so that positive y is positive acceleration */ -#define ao_data_accel(packet) ((packet)->mpu6000.accel_y) +#define ao_data_accel(packet) ((packet)->z_accel) #define ao_data_accel_cook(packet) (-(packet)->mpu6000.accel_y) -#define ao_data_set_accel(packet, accel) ((packet)->mpu6000.accel_y = (accel)) +#define ao_data_set_accel(packet, accel) ((packet)->z_accel = (accel)) #define ao_data_accel_invert(a) (-(a)) #endif -- cgit v1.2.3