this version has all of Jim's fixes for reading the GPS and IMU data synchronously

Dependencies:   MODSERIAL SDFileSystem mbed SDShell CRC CommHandler FP LinkedList LogUtil

Files at this revision

API Documentation at this revision

Comitter:
jekain314
Date:
Tue May 14 23:32:15 2013 +0000
Parent:
20:3f04a0bde484
Child:
22:1cbdbc856660
Commit message:
Moved CRC functions from OEM615.h to crc.cpp/h. Also updated SDShell and un-nested the dependencies because of a merge issue. Will nest later when the code is more fully vetted.

Changed in this revision

CRC.lib Show annotated file Show diff for this revision Revisions of this file
CommHandler.lib Show annotated file Show diff for this revision Revisions of this file
FP.lib Show annotated file Show diff for this revision Revisions of this file
LinkedList.lib Show annotated file Show diff for this revision Revisions of this file
LogUtil.lib Show annotated file Show diff for this revision Revisions of this file
OEM615.h Show annotated file Show diff for this revision Revisions of this file
SDShell.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CRC.lib	Tue May 14 23:32:15 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/sam_grove/code/CRC/#ec8513f94d23
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CommHandler.lib	Tue May 14 23:32:15 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sam_grove/code/CommHandler/#83b252ec0afd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FP.lib	Tue May 14 23:32:15 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sam_grove/code/FP/#e9a4765b560f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LinkedList.lib	Tue May 14 23:32:15 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sam_grove/code/LinkedList/#e3ab7684c395
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LogUtil.lib	Tue May 14 23:32:15 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sam_grove/code/LogUtil/#ef45bd2cd9bb
--- a/OEM615.h	Tue May 14 00:59:34 2013 +0000
+++ b/OEM615.h	Tue May 14 23:32:15 2013 +0000
@@ -1,4 +1,5 @@
-    
+#include "crc.h"
+
 #pragma pack(1)  //this forces the structure to be packed on byte boundaries (with no byte filler)
 //set up the GPS message header in a structure to enable easy reading -- see the OEM615 manual (Table 4, page 24)
 struct MESSAGEHEADER   
@@ -121,88 +122,6 @@
 unsigned short endByteForCRCcomputation[maxGPSMessagesPerSec];
 bool completeMessageAvailable = false;
 
-//this code was taken from the Novatel Firmware document page 35
-//#define CRC32_POLYNOMIAL 0xEDB88320L
-/* --------------------------------------------------------------------------
-Calculate a CRC value to be used by CRC calculation functions.
--------------------------------------------------------------------------- */
-/*
-////////////////////////////////////////////
-//original code from the OEM615 manual
-////////////////////////////////////////////
-unsigned long CRC32Value(int i)
-{
-    int j;
-    unsigned long ulCRC;
-    ulCRC = i;
-    for ( j = 8 ; j > 0; j-- )
-    {
-        if ( ulCRC & 1 )
-        ulCRC = ( ulCRC >> 1 ) ^ CRC32_POLYNOMIAL;
-        else
-        ulCRC >>= 1;
-    }
-    return ulCRC;
-} 
-*/
-
-#define CRC32_POLYNOMIAL 0xEDB88320L
-void CRC32Value(unsigned long &CRC, unsigned char c)
-{
-    /////////////////////////////////////////////////////////////////////////////////////
-    //CRC must be initialized as zero 
-    //c is a character from the sequence that is used to form the CRC
-    //this code is a modification of the code from the Novatel OEM615 specification
-    /////////////////////////////////////////////////////////////////////////////////////
-    unsigned long ulTemp1 = ( CRC >> 8 ) & 0x00FFFFFFL;
-    unsigned long ulCRC = ((int) CRC ^ c ) & 0xff ;
-    for (int  j = 8 ; j > 0; j-- )
-    {
-        if ( ulCRC & 1 )
-            ulCRC = ( ulCRC >> 1 ) ^ CRC32_POLYNOMIAL;
-        else
-            ulCRC >>= 1;
-    }
-    CRC = ulTemp1 ^ ulCRC;
-} 
-
-/* --------------------------------------------------------------------------
-Calculates the CRC-32 of a block of data all at once
-//the CRC is from the complete message (header plus data) 
-//but excluding (of course) the CRC at the end
--------------------------------------------------------------------------- */
-unsigned long CalculateBlockCRC32(
-        unsigned long ulCount,    /* Number of bytes in the data block */
-        unsigned char *ucBuffer ) /* Data block */
-{
-    //////////////////////////////////////////////////////////////////////
-    //the below code tests the CRC32Value procedure used in a markov form
-    //////////////////////////////////////////////////////////////////////
-    unsigned long CRC = 0;
-    for (int i = 0; i<ulCount; i++)  CRC32Value( CRC, *ucBuffer++ );
-    return  CRC;
-}
-
-/*
-unsigned long CalculateBlockCRC32(
-        unsigned long ulCount, 
-        unsigned char *ucBuffer )
-{
-////////////////////////////////////////////
-//original code from the OEM615 manual
-////////////////////////////////////////////
-    unsigned long ulTemp1;
-    unsigned long ulTemp2;
-    unsigned long ulCRC = 0;
-    while ( ulCount-- != 0 )
-    {
-        ulTemp1 = ( ulCRC >> 8 ) & 0x00FFFFFFL;
-        ulTemp2 = CRC32Value( ((int) ulCRC ^ *ucBuffer++ ) & 0xff );
-        ulCRC = ulTemp1 ^ ulTemp2;
-    }
-    return( ulCRC );
-}
-*/
 void sendASCII(char* ASCI_message, int numChars)
 {
     /////////////////////////////////////////////////
--- a/SDShell.lib	Tue May 14 00:59:34 2013 +0000
+++ b/SDShell.lib	Tue May 14 23:32:15 2013 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/sam_grove/code/SDShell/#1478b4882244
+https://mbed.org/users/sam_grove/code/SDShell/#4d357eedd670