diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index ffb3ff94cc..e46e671c21 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -178,6 +178,7 @@ main_overo.ARCHDIR = omap main_overo.CFLAGS = -I. -I$(SRC_FMS) main_overo.srcs = $(SRC_BETH)/main_overo.c main_overo.srcs += $(SRC_FMS)/fms_spi_link.c +main_overo.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageBethUp -DOVERO_LINK_MSG_DOWN=AutopilotMessageBethDown # diff --git a/sw/airborne/beth/main_overo.c b/sw/airborne/beth/main_overo.c index fbc7e22f68..a5a73332b2 100644 --- a/sw/airborne/beth/main_overo.c +++ b/sw/airborne/beth/main_overo.c @@ -33,13 +33,12 @@ #include "fms_autopilot_msg.h" -static union AutopilotMessageBeth my_buffers[2]; -static struct AutopilotMessageBethUp* msg_in = &my_buffers[0].up; -static struct AutopilotMessageBethDown* msg_out = &my_buffers[1].down; +//static union AutopilotMessageBeth my_buffers[2]; +static struct AutopilotMessageBethUp msg_in; +static struct AutopilotMessageBethDown msg_out; static void send_message(void); int main(int argc, char *argv[]) { - if (spi_link_init()) { TRACE(TRACE_ERROR, "%s", "failed to open SPI link \n"); return -1; @@ -58,14 +57,16 @@ int main(int argc, char *argv[]) { static void send_message() { static uint32_t foo = 0; - spi_link_send(msg_out, sizeof(union AutopilotMessageBeth), msg_in); + spi_link_send(&msg_out, sizeof(struct AutopilotMessageBethUp), &msg_in); // if (!foo%100) { +#if 0 if (0) { printf("%d -> %d %d %d %d %d %d %d %d %d\n", foo, msg_in->bench_sensor.x, msg_in->bench_sensor.y, msg_in->bench_sensor.z, msg_in->gyro.x, msg_in->gyro.y, msg_in->gyro.z, msg_in->accel.x, msg_in->accel.y, msg_in->accel.z); } +#endif foo++; }