📄 update.c
字号:
// position.////****************************************************************************unsigned longFSSeek(void *pFile, unsigned long ulPos){ // // We do not support seeking within the NOR FLASH. // return(0);}//****************************************************************************//// FSDriveNum returns the number of the drive on which the currently opened// file resides.////****************************************************************************unsigned longFSDriveNum(void *pFile){ // // The current file is always on drive zero, since there is only one drive. // return(0);}//****************************************************************************//// FSTell returns the current read/write for the opened file.////****************************************************************************unsigned longFSTell(void *pFile){ // // We do not support reporting the current file pointer. // return(0);}//****************************************************************************//// FSLength returns the length of the currently opened file.////****************************************************************************unsigned longFSLength(void *pFile){ // // We do not support reporting the file length. // return(0);}//****************************************************************************//// FSGetDate returns the modification date/time of the currently opened file.////****************************************************************************unsigned longFSGetDate(void *pFile){ // // We do not support reporting the modification date/time. // return(0);}//****************************************************************************//// FSClose closes the currently opened file.////****************************************************************************unsigned longFSClose(void *pFile){ // // There is nothing to do on close, so return success. // return(1);}//****************************************************************************//// FSDelete removes the specified file from the file system.////****************************************************************************unsigned longFSDelete(unsigned long ulDrive, const char *pcFileName){ // // We do not support deleting files. // return(0);}//****************************************************************************//// FSOpenDir opens the specified directory on the specified drive.////****************************************************************************unsigned longFSOpenDir(void *pDir, unsigned long ulDrive, const char *pcDirName){ // // We do not support directory scans. // return(0);}//****************************************************************************//// FSReadDir reads the next directory entry from the currently opened// directory.////****************************************************************************unsigned longFSReadDir(void *pDir, char *pcFileName, unsigned long ulType){ // // We do not support directory scans. // return(0);}//****************************************************************************//// FSCloseDir closes the currently opened directory.////****************************************************************************unsigned longFSCloseDir(void *pDir){ // // We do not support directory scans. // return(0);}//****************************************************************************//// FSMakeDir creates the specified directory on the specified drive. This// will create any/all directories in the specified path.////****************************************************************************unsigned longFSMakeDir(unsigned long ulDrive, const char *pcDirName){ // // We do not support creating directories. // return(0);}//****************************************************************************//// FSRemoveDir removes the specified directry from the specified drive.////****************************************************************************unsigned longFSRemoveDir(unsigned long ulDrive, const char *pcDirName){ // // We do not support removing directories. // return(0);}//****************************************************************************//// FSTotalSpace returns the total capacity of the specified drive.////****************************************************************************unsigned longFSTotalSpace(unsigned long ulDrive){ // // We do not report the capacity of the NOR FLASH. // return(0);}//****************************************************************************//// FSFreeSpace returns the currently available capacity on the specified// drive.////****************************************************************************unsigned longFSFreeSpace(unsigned long ulDrive){ // // We do not report the available capacity of the NOR FLASH. // return(0);}//****************************************************************************//// FSFormat formats the specified drive.////****************************************************************************unsigned longFSFormat(unsigned long ulDrive){ // // We do not support formatting the NOR FLASH. // return(0);}//****************************************************************************//// TimeSetSystemTime programs the given time (specified in seconds since// January 1, 1970) into the system real time clock.////****************************************************************************voidTimeSetSystemTime(unsigned long ulSeconds){ volatile unsigned long *pulPtr = (unsigned long *)HwBaseAddress; // // Program the given time into the EP7209's RTC. // pulPtr[HwRtcData >> 2] = ulSeconds;}//****************************************************************************//// TimeGetSystemTime returns the current value of the system real time clock// (which is assumed to be the number of seconds since January 1, 1970).////****************************************************************************unsigned longTimeGetSystemTime(void){ volatile unsigned long *pulPtr = (unsigned long *)HwBaseAddress; // // Return the current value of the EP7209's RTC. // return(pulPtr[HwRtcData >> 2]);}//****************************************************************************//// Update handle the actual software update process.////****************************************************************************voidUpdate(unsigned long bConfigured){ volatile unsigned long *pulPtr = (unsigned long *)HwBaseAddress; // // Determine if we have 16 or 32 bit wide program FLASH. // if((pulPtr[HwStatus >> 2] & 0x18000000) == 0x10000000) { // // The width of the program FLASH is 16 bits. // bIs16Bit = 1; } else { // // The width of the program FLASH is 32 bits. // bIs16Bit = 0; } // // Initialize the user interface. // UIEnable(); // // If we are not configured (i.e. if we are not running as a result of the // main application calling us in response to an update request), then // handle configuring the USB controller and waiting for the update // request. // if(!bConfigured) { // // Enable the USB controller. // USBEnable(); // // Indicate that an update needs to occur. // UIRequestUpdate(); } else { // // Force the USB state to indicate that we are configured. // USBForceConfiguration(1); // // Enable the USB interrupt. // pulPtr[HwIntMask >> 2] |= HwIrqUSB; // // Indicate that an update is in progress. // UIUpdate(); } // // Start the software update process. // USBDownload((unsigned char *)ulEndOfRAM); // // Disable the USB controller. // USBDisable(); // // Disable the user interface. // UIDisable();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -