[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [4968]
From: |
antoine drouin |
Subject: |
[paparazzi-commits] [4968] |
Date: |
Thu, 17 Jun 2010 10:28:30 +0000 |
Revision: 4968
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4968
Author: poine
Date: 2010-06-17 10:28:26 +0000 (Thu, 17 Jun 2010)
Log Message:
-----------
Added Paths:
-----------
paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c
Removed Paths:
-------------
paparazzi3/trunk/sw/airborne/fms/overo_test_link.c
Deleted: paparazzi3/trunk/sw/airborne/fms/overo_test_link.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/overo_test_link.c 2010-06-16 12:50:15 UTC
(rev 4967)
+++ paparazzi3/trunk/sw/airborne/fms/overo_test_link.c 2010-06-17 10:28:26 UTC
(rev 4968)
@@ -1,77 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi 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; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi 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 paparazzi; see the file COPYING. If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <stdint.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-#include "fms_debug.h"
-#include "fms_spi_link.h"
-#include "fms_autopilot_msg.h"
-
-static void fill_msg(struct AutopilotMessageFoo* msg);
-
-int main(int argc, char *argv[]) {
-
- if (spi_link_init()) {
- TRACE(TRACE_ERROR, "%s", "failed to open SPI link \n");
- return -1;
- }
- while (1) {
- struct AutopilotMessageFoo msg_out_prev;
- struct AutopilotMessageFoo msg_out;
- memcpy(&msg_out_prev, &msg_out, sizeof(msg_out));
- fill_msg(&msg_out);
- struct AutopilotMessageFoo msg_in;
- spi_link_send(&msg_out, sizeof(struct AutopilotMessageFoo), &msg_in);
- if (memcmp(&msg_in, &msg_out_prev, sizeof(msg_in))) {
- printf("compare failed\n");
- printf("expected %d %d %d\n", msg_out_prev.foo, msg_out_prev.bar,
msg_out_prev.blaa);
- printf("got %d %d %d\n\n", msg_in.foo, msg_in.bar, msg_in.blaa);
- }
- else {
- static uint32_t foo = 0;
- if (!msg_in.foo) {
- printf("passed %d\n", foo );
- foo++;
- }
- }
- usleep(1953);
- //usleep(50000);
- }
-
- return 0;
-}
-
-
-
-static void fill_msg(struct AutopilotMessageFoo* msg) {
- static uint32_t foo = 0;
- msg->foo = foo;
- msg->bar = foo+1;
- msg->blaa = foo+2;
- foo++;
-}
Copied: paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c (from rev 4955,
paparazzi3/trunk/sw/airborne/fms/overo_test_link.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c
(rev 0)
+++ paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c 2010-06-17
10:28:26 UTC (rev 4968)
@@ -0,0 +1,77 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi 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; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi 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 paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stdint.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#include "fms_debug.h"
+#include "fms_spi_link.h"
+#include "fms_autopilot_msg.h"
+
+static void fill_msg(struct AutopilotMessageFoo* msg);
+
+int main(int argc, char *argv[]) {
+
+ if (spi_link_init()) {
+ TRACE(TRACE_ERROR, "%s", "failed to open SPI link \n");
+ return -1;
+ }
+ while (1) {
+ struct AutopilotMessageFoo msg_out_prev;
+ struct AutopilotMessageFoo msg_out;
+ memcpy(&msg_out_prev, &msg_out, sizeof(msg_out));
+ fill_msg(&msg_out);
+ struct AutopilotMessageFoo msg_in;
+ spi_link_send(&msg_out, sizeof(struct AutopilotMessageFoo), &msg_in);
+ if (memcmp(&msg_in, &msg_out_prev, sizeof(msg_in))) {
+ printf("compare failed\n");
+ printf("expected %d %d %d\n", msg_out_prev.foo, msg_out_prev.bar,
msg_out_prev.blaa);
+ printf("got %d %d %d\n\n", msg_in.foo, msg_in.bar, msg_in.blaa);
+ }
+ else {
+ static uint32_t foo = 0;
+ if (!msg_in.foo) {
+ printf("passed %d\n", foo );
+ foo++;
+ }
+ }
+ usleep(1953);
+ //usleep(50000);
+ }
+
+ return 0;
+}
+
+
+
+static void fill_msg(struct AutopilotMessageFoo* msg) {
+ static uint32_t foo = 0;
+ msg->foo = foo;
+ msg->bar = foo+1;
+ msg->blaa = foo+2;
+ foo++;
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [4968],
antoine drouin <=