more fixes for new SPI link

This commit is contained in:
Antoine Drouin
2010-07-21 09:08:01 +00:00
parent 7bdfbe0172
commit ac155f45aa
2 changed files with 7 additions and 5 deletions
+1
View File
@@ -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
#
+6 -5
View File
@@ -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++;
}