Rev 282 | Rev 349 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 282 | Rev 324 | ||
---|---|---|---|
Line 540... | Line 540... | ||
540 | u8 cnt; |
540 | u8 cnt; |
Line 541... | Line 541... | ||
541 | 541 | ||
542 | UART1_PutString("\r\n FAT16 deinit..."); |
542 | UART1_PutString("\r\n FAT16 deinit..."); |
543 | // declare the filepointers as unused. |
543 | // declare the filepointers as unused. |
544 | for(cnt = 0; cnt < FILE_MAX_OPEN; cnt++) |
544 | for(cnt = 0; cnt < FILE_MAX_OPEN; cnt++) |
545 | { |
- | |
546 | if(FilePointer[cnt].State == FSTATE_USED) |
- | |
547 | { |
- | |
548 | returnvalue += fclose_(&FilePointer[cnt]); // try to close open file pointers |
- | |
549 | } |
545 | { |
550 | else UnlockFilePointer(&FilePointer[cnt]); |
- | |
551 | 546 | UnlockFilePointer(&FilePointer[cnt]); |
|
552 | } |
547 | } |
553 | SDC_Deinit(); // uninitialize interface to sd-card |
548 | returnvalue = SDC_Deinit(); // uninitialize interface to sd-card |
554 | Partition.IsValid = 0; // mark data in partition structure as invalid |
549 | Partition.IsValid = 0; // mark data in partition structure as invalid |
555 | Partition.VolumeLabel[0]='\0'; |
550 | Partition.VolumeLabel[0]='\0'; |
556 | UART1_PutString("ok"); |
551 | UART1_PutString("ok"); |
557 | return(returnvalue); |
552 | return(returnvalue); |
Line 1611... | Line 1606... | ||
1611 | Fat16_Deinit(); |
1606 | Fat16_Deinit(); |
1612 | return(EOF); |
1607 | return(EOF); |
1613 | } |
1608 | } |
Line 1614... | Line 1609... | ||
1614 | 1609 | ||
1615 | dir = (DirEntry_t *)file->Cache; |
1610 | dir = (DirEntry_t *)file->Cache; |
1616 | // update dile size and modification time & date |
1611 | // update file size and modification time & date |
1617 | dir[file->DirectoryIndex].ModTime = FileTime(&SystemTime); |
1612 | dir[file->DirectoryIndex].ModTime = FileTime(&SystemTime); |
1618 | dir[file->DirectoryIndex].ModDate = FileDate(&SystemTime); |
1613 | dir[file->DirectoryIndex].ModDate = FileDate(&SystemTime); |
1619 | dir[file->DirectoryIndex].LastAccessDate = dir[file->DirectoryIndex].ModDate; |
1614 | dir[file->DirectoryIndex].LastAccessDate = dir[file->DirectoryIndex].ModDate; |
1620 | dir[file->DirectoryIndex].Size = file->Size; // update file size |
1615 | dir[file->DirectoryIndex].Size = file->Size; // update file size |