paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5350] Update fms_spi_autopilot_msg to new CRC api


From: Allen Ibara
Subject: [paparazzi-commits] [5350] Update fms_spi_autopilot_msg to new CRC api
Date: Thu, 12 Aug 2010 22:28:41 +0000

Revision: 5350
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5350
Author:   aibara
Date:     2010-08-12 22:28:40 +0000 (Thu, 12 Aug 2010)
Log Message:
-----------
Update fms_spi_autopilot_msg to new CRC api

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/fms/fms_spi_autopilot_msg.c

Added Paths:
-----------
    paparazzi3/trunk/conf/autopilot/subsystems/lisa_spi_link.makefile

Added: paparazzi3/trunk/conf/autopilot/subsystems/lisa_spi_link.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/lisa_spi_link.makefile           
                (rev 0)
+++ paparazzi3/trunk/conf/autopilot/subsystems/lisa_spi_link.makefile   
2010-08-12 22:28:40 UTC (rev 5350)
@@ -0,0 +1,25 @@
+# Hey Emacs, this is a -*- makefile -*-
+#
+# $Id: lisa_test_progs.makefile 4982 2010-06-18 13:51:00Z poine $
+# Copyright (C) 2010 Antoine Drouin
+#
+# 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. 
+
+ap.CFLAGS += -DUSE_SPI_LINK -DOVERO_LINK_MSG_UP=AutopilotMessagePTUp 
-DOVERO_LINK_MSG_DOWN=AutopilotMessagePTDown
+ap.srcs += $(SRC_FMS)/fms_spi_autopilot_msg.c
+ap.srcs += $(SRC_FMS)/fms_spi_link.c

Modified: paparazzi3/trunk/sw/airborne/fms/fms_spi_autopilot_msg.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/fms_spi_autopilot_msg.c    2010-08-12 
21:36:29 UTC (rev 5349)
+++ paparazzi3/trunk/sw/airborne/fms/fms_spi_autopilot_msg.c    2010-08-12 
22:28:40 UTC (rev 5350)
@@ -32,7 +32,6 @@
 #include "fms_spi_link.h"
 #include "fms_autopilot_msg.h"
 #include "fms_spi_autopilot_msg.h"
-#include "fms_crc.h"
 
 /* all these for telemetry */
 #include "messages2.h"
@@ -152,17 +151,14 @@
   static struct AutopilotMessageCRCFrame msg_up;
   static struct AutopilotMessageCRCFrame msg_down;
   static uint32_t crc_errors = 0;
-  static uint32_t foo = 0;
-  crc_t crc_in;
+  uint8_t crc_valid;
 
   passthrough_down_fill(&msg_down.payload.msg_down);
-  msg_down.crc = crc__calc_block_crc8(&msg_down, sizeof(union 
AutopilotMessage));
 
   // SPI transcieve
-  spi_link_send(&msg_down, sizeof(struct AutopilotMessageCRCFrame), &msg_up);
-  crc_in = crc__calc_block_crc8(&msg_up, sizeof(union AutopilotMessage));
+  spi_link_send(&msg_down, sizeof(struct AutopilotMessageCRCFrame), &msg_up, 
&crc_valid);
 
-  if(msg_up.crc != crc_in) {
+  if(crc_valid) {
     crc_errors++;
   } else {
     passthrough_up_parse(&msg_up.payload.msg_up);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]