• R/O
  • SSH
  • HTTPS

panda-p: 提交


Commit MetaInfo

修訂16 (tree)
時間2013-01-18 00:35:14
作者tekken_boss

Log Message

001.000.001: 2013/01/18 00:30 : BUG FIX: a fragmented files can not be read correctly.

modification

* [FAT] Bug fixed. The problem is that a fragmented file can not be read.

Uncorrected variable was used in FAT_READ_FILE_04.

Confirmation

* ONLY Compilable.

Change Summary

差異

--- trunk/src/srcver.h (revision 15)
+++ trunk/src/srcver.h (revision 16)
@@ -15,9 +15,10 @@
1515
1616 #define SRCVER_MAJOR 1
1717 #define SRCVER_MINOR 0
18-#define SRCVER_BUILD 0
18+#define SRCVER_BUILD 1
1919
2020 /* --------------------------------------------------------------------
21+001.000.001: 2013/01/18 00:30 : BUG FIX: a fragmented files can not be read correctly.
2122 001.000.000: 2012/10/04 00:02 : Frist major release.
2223 000.001.014: 2012/10/01 22:55 : ROM code maintenance.
2324 000.001.013: 2012/08/24 16:31 : Memory check sequence is added.
--- trunk/src/fat.c (revision 15)
+++ trunk/src/fat.c (revision 16)
@@ -564,27 +564,31 @@
564564 if( res == SUB_PROC_DONE ) {
565565 unsigned long EntryVal;
566566 if(IsFAT32) {
567-#if 1
568567 val = *( (unsigned long*) &WindowBuffer[fat.Offset] );
569568 EntryVal = (val<<24) | ((val<<8) & 0x00FF0000) | ((val>>8) & 0x0000FF00) | ((val>>24) & 0x000000FF);
570569 EntryVal &= 0x0FFFFFFF;
571-#else
572- EntryVal = *(unsigned long*) &WindowBuffer[fat.Offset] & 0x0FFFFFFF;
573-#endif
570+
574571 if( (EntryVal > 0x00000002) && (EntryVal < 0x0FFFFFF6) ) {
572+#if 0 // found bug 2013.01.17
575573 dir_entry.CurrentCluster = EntryVal;
576574 dir_entry.CurrentSector = CLUSTER2SECTOR(dir_entry.CurrentCluster);
575+#else
576+ ReadFileStatus.CurrentCluster = EntryVal;
577+ ReadFileStatus.CurrentSector = CLUSTER2SECTOR(ReadFileStatus.CurrentCluster);
578+#endif
577579 }
578580 } else {
579-#if 1
580581 val = *( (unsigned long*) &WindowBuffer[fat.Offset] );
581582 EntryVal = (unsigned short) (((val<<8) & 0xFF00) | ((val>>8) & 0x00FF));
582-#else
583- EntryVal = *(unsigned short*) &WindowBuffer[fat.Offset];
584-#endif
583+
585584 if( (EntryVal > 0x0002) && (EntryVal < 0xFFF6) ) {
585+#if 0 // found bug 2013.01.17
586586 dir_entry.CurrentCluster = (unsigned long) EntryVal;
587587 dir_entry.CurrentSector = CLUSTER2SECTOR(dir_entry.CurrentCluster);
588+#else
589+ ReadFileStatus.CurrentCluster = (unsigned long) EntryVal;
590+ ReadFileStatus.CurrentSector = CLUSTER2SECTOR(ReadFileStatus.CurrentCluster);
591+#endif
588592 }
589593 }
590594 fat_proc = FAT_READ_FILE_01;
Show on old repository browser