300TC 机载系统 完整功能,(1)采集影像(2)采集和解析惯导数据(3)惯导磁场校正

This commit is contained in:
tangchao0503
2022-06-13 12:01:30 +08:00
commit 1452bcc2b9
21 changed files with 4316 additions and 0 deletions

67
Source_Files/sbgcrc.cpp Normal file
View File

@ -0,0 +1,67 @@
#include "Header_Files/sbgcrc.h"
uint16_t sbgtc::sbgCrc16Compute(const void *pData, size_t dataSize)
{
SbgCrc16 crcInst;
//
// Initialize the CRC system
//
sbgCrc16Initialize(&crcInst);
//
// Compute the CRC
//
sbgCrc16Update(&crcInst, pData, dataSize);
//
// Return it
//
return sbgCrc16Get(&crcInst);
}
void sbgtc::sbgCrc16Initialize(SbgCrc16 *pInstance)
{
//
// Test input argument
//
//assert(pInstance);
*pInstance = 0;
}
void sbgtc::sbgCrc16Update(SbgCrc16 *pInstance, const void *pData, size_t dataSize)
{
const uint8_t *pBuffer = (const uint8_t*)pData;
uint8_t index;
size_t i;
//
// Test input arguments
//
//assert(pInstance);
//assert(pData);
//
// For each byte in our buffer
//
for (i = 0; i < dataSize; i++)
{
//
// Update the current CRC
//
index = (pBuffer[i] ^ *pInstance) & 0xFF;
*pInstance = crc16LookupTable[index] ^ (*pInstance >> 8);
}
}
uint16_t sbgtc::sbgCrc16Get(const SbgCrc16 *pInstance)
{
return *pInstance;
}
uint32_t sbgtc::sbgCrc32Get(const SbgCrc32 *pInstance)
{
return *pInstance;
}