diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-13 23:36:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-13 23:36:37 +0000 |
commit | 347c8b6af8e7690fbc8a5f3f37c2ac57eeeced42 (patch) | |
tree | 4d99fb8b9fede4bab389bd9639e1396211bef6f5 /nuttx | |
parent | 51ea417e2ea2fb4e339cb55d4e5ccd02368f62ab (diff) | |
download | px4-nuttx-347c8b6af8e7690fbc8a5f3f37c2ac57eeeced42.tar.gz px4-nuttx-347c8b6af8e7690fbc8a5f3f37c2ac57eeeced42.tar.bz2 px4-nuttx-347c8b6af8e7690fbc8a5f3f37c2ac57eeeced42.zip |
Debug output
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@224 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/fs/fs_fat32.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/nuttx/fs/fs_fat32.c b/nuttx/fs/fs_fat32.c index f4bed845e..00515efe7 100644 --- a/nuttx/fs/fs_fat32.c +++ b/nuttx/fs/fs_fat32.c @@ -43,6 +43,7 @@ #include <semaphore.h> #include <assert.h> #include <errno.h> +#include <debug.h> #include <nuttx/fs.h> @@ -476,7 +477,6 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) { uint32 ndatasectors; uint32 fatsize; - uint16 rootentcnt; uint16 rootdirsectors = 0; boolean notfat32 = FALSE; @@ -602,13 +602,13 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) fs->fs_fatbase += fs->fs_fatresvdseccount; if (fs->fs_type == FSTYPE_FAT32) - { + { fs->fs_rootbase = MBR_GETROOTCLUS(fs->fs_buffer); - } + } else - { + { fs->fs_rootbase = fs->fs_fatbase + fatsize; - } + } fs->fs_database = fs->fs_fatbase + fatsize + fs->fs_rootentcnt / (fs->fs_hwsectorsize / 32); fs->fs_fsifreecount = 0xffffffff; @@ -739,6 +739,23 @@ static int fat_mount(struct fat_mountpt_s *fs, boolean writeable) /* We did it! */ + dbg("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32); + dbg("\tHW sector size: %d\n", fs->fs_hwsectorsize); + dbg("\t sectors: %d\n", fs->fs_hwnsectors); + dbg("\tFAT reserved: %d\n", fs->fs_fatresvdseccount); + dbg("\t sectors: %d\n", fs->fs_fattotsec); + dbg("\t start sector: %d\n", fs->fs_fatbase); + dbg("\t root sector: %d\n", fs->fs_rootbase); + dbg("\t root entries: %d\n", fs->fs_rootentcnt); + dbg("\t data sector: %d\n", fs->fs_database); + dbg("\t FSINFO sector: %d\n", fs->fs_fsinfo); + dbg("\t Num FATs: %d\n", fs->fs_fatnumfats); + dbg("\t FAT size: %d\n", fs->fs_fatsize); + dbg("\t sectors/cluster: %d\n", fs->fs_fatsecperclus); + dbg("\t max clusters: %d\n", fs->fs_nclusters); + dbg("\tFSI free count %d\n", fs->fs_fsifreecount); + dbg("\t next free %d\n", fs->fs_fsinextfree); + return OK; errout_with_buffer: |