コード例 #1
0
long GSkipDevice::ReadSensorDDSMemory(
	unsigned char *pBuf, 
	unsigned long ddsAddr, 
	unsigned long nBytesToRead, 
	long nTimeoutMs /* = 1000 */, 
	bool *pExitFlag /* = NULL */)
{
	return ReadNonVolatileMemory(false, pBuf, ddsAddr, nBytesToRead, nTimeoutMs, pExitFlag);
}
コード例 #2
0
int GUSBDirectTempDevice::ReadSensorDDSMemory(
	unsigned char *pBuf, 
	unsigned int ddsAddr, 
	unsigned int nBytesToRead, 
	int nTimeoutMs /* = 1000 */, 
	bool *pExitFlag /* = NULL */)
{
	return ReadNonVolatileMemory(true, pBuf, ddsAddr, nBytesToRead, nTimeoutMs, pExitFlag);
}
コード例 #3
0
long GSkipDevice::ReadSkipFlashRecord(
	GSkipFlashMemoryRecord *pFlashRec, //[o] ptr to loc to store flash record. The numeric fields in this record
										//came from Skip in big endian format. This routine converts those fields to
										//the endian format that is native to the CPU currently running.
	long nTimeoutMs)
{
	long nResult = ReadNonVolatileMemory(true, pFlashRec, 0, sizeof(GSkipFlashMemoryRecord), nTimeoutMs);
	if (kResponse_OK != nResult)
		pFlashRec->signature = 0;//flash rec is ignored until this = VALID_FLASH_SIGNATURE
	else
	if (SKIP_VALID_FLASH_SIGNATURE == pFlashRec->signature)
	{
		//Handle endian issues.
		unsigned char * pLSB;
		unsigned char * pLMidB;
		unsigned char * pMMidB;
		unsigned char * pMSB;
		pMSB = (unsigned char *) &(pFlashRec->vinOffset);
		pLSB = pMSB + 1;
		GUtils::OSConvertBytesToShort(*pLSB, *pMSB, &(pFlashRec->vinOffset));
		
		pMSB = (unsigned char *) &(pFlashRec->vinLowOffset);
		pLSB = pMSB + 1;
		GUtils::OSConvertBytesToShort(*pLSB, *pMSB, &(pFlashRec->vinLowOffset));

		pMSB = (unsigned char *) &(pFlashRec->vinSlope);
		pMMidB = pMSB + 1;
		pLMidB = pMMidB + 1;
		pLSB = pLMidB + 1;
		GUtils::OSConvertBytesToFloat(*pLSB, *pLMidB, *pMMidB, *pMSB, &(pFlashRec->vinSlope));

		pMSB = (unsigned char *) &(pFlashRec->vinLowSlope);
		pMMidB = pMSB + 1;
		pLMidB = pMMidB + 1;
		pLSB = pLMidB + 1;
		GUtils::OSConvertBytesToFloat(*pLSB, *pLMidB, *pMMidB, *pMSB, &(pFlashRec->vinLowSlope));
	}

	return nResult;
}