CLEON  Version 1
Cloud-Offloaded GPS Receiver
app_usb.h File Reference

Communication via USB. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void APP_USB_ProcessingRcvdFrame (void)
 Processing USB frame.
 

Detailed Description

Communication via USB.

Definition in file app_usb.h.

Function Documentation

void APP_USB_ProcessingRcvdFrame ( void  )

Processing USB frame.

            - For every received USB frame, there will be an ack 
            - Ack frame will contain received command as data in data field
Returns
void
Parameters
void

Definition at line 53 of file app_usb.c.

{
// Check if USB frame has been received
// Identify command contained in the USB frame
// Transmit ACK
break;
// Transmit ACK
break;
// Transmit ACK
// Wait until millisecond part becomes zero
// Read RTC time and save it to 'uniRTCTime'
// Store 'uniRTCTime (8 bytes)' to the first entry of internal FLASH bank 3 (0x038000)
// This information will later be used to restore system time
HAL_FLASH_Write(sizeof(uniRTCTime), (unsigned char *)&uniRTCTime, (unsigned char *)MSP430_INTERNAL_FLASH_BANK3_ADDRESS);
// Store 'uniSecondTimeTick (8bytes)' next to 'uniRTCTime' stored to internal FLASH bank 3 (0x038008)
// This information will later be used to restore system time
HAL_FLASH_Write(sizeof(uniSecondTimeTick), (unsigned char *)&uniSecondTimeTick, (unsigned char *)(MSP430_INTERNAL_FLASH_BANK3_ADDRESS + sizeof(uniRTCTime)));
if(ulSampleCount == 1){
// Initailize filename
memset(sFilename, 0, sizeof(sFilename));
// File name will start with CLEON's current system time
#if (APP_LOG_TEMP_AND_HUM_SENSORS == _ENABLE_) || (APP_LOG_LIGHT_SENSORS == _ENABLE_)
#else
#endif
// The created file will remain openned until the number of samples defined in 'APP_LOG_SAMPLES_IN_A_FILE' are captured
}
}
}
// Now that time is synchronized, set flag
// Turn LED3 off
break;
// Transmit ACK
ulSampleCount = ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[3] << 24)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[2] << 16)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[1] << 8)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[0]);
break;
// Transmit ACK
ulSampleGap = ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[3] << 24)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[2] << 16)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[1] << 8)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[0]);
break;
// Transmit ACK
ulChunkCount = ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[3] << 24)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[2] << 16)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[1] << 8)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[0]);
break;
// Transmit ACK
ulChunkGap = ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[3] << 24)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[2] << 16)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[1] << 8)
+ ((unsigned long)uniUSBRecvFrame.stUSBFrame.ucData[0]);
break;
default: break;
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function: