Attached is the first working version of Kye's FAT32 Driver that I converted to run under P2 SPIN2.
I haven't included all the re-direction objects that make this run, but I thought I would post it here in case anyone was interested.
Note there is a problem that the code uses the P1 ROM space to write to when skipping bytes. This will need to be fixed.
I have used this in my P2 OS here
forums.parallax.com/discussion/171600/propeller-2-os-its-alive
@Cluso99
It appears that changing directories does not work as far as listing entries.
I can successfully change directories to a subfolder, but using listEntries immediately afterwards returns filenames in the root directory, not the subfolder.
Attached is the first working version of Kye's FAT32 Driver that I converted to run under P2 SPIN2.
I haven't included all the re-direction objects that make this run, but I thought I would post it here in case anyone was interested.
Note there is a problem that the code uses the P1 ROM space to write to when skipping bytes. This will need to be fixed.
I have used this in my P2 OS here
forums.parallax.com/discussion/171600/propeller-2-os-its-alive
@Cluso99
It appears that changing directories does not work as far as listing entries.
I can successfully change directories to a subfolder, but using listEntries immediately afterwards returns filenames in the root directory, not the subfolder.
You may be correct. I have never use directories even on P1 so I guess maybe it's never been tested
I have just done a conversion of Kye's FAT32 driver to spin2. I've added a few things and fixed a couple of things I've needed but I haven't ever bothered to understand his code.
I'm unsure if the problem is in my listEntries spin code or in Kye's code. I'm busy ATM but will take a look when I get a chance.
I seem to have fixed the issue by adding a listingUncache() call within the changeDirectory method...
...
currentWorkingDirectory := readDIRCluster() listUncache() ' <=== Added to fix issue with not listing in subdirectory
unlockFileSystem()
I suspect this works because the previous (root) directory was already cached and the cache needed to be reset. Or I may be wrong. Wouldn't be the first time.
@wmosscrop said:
I seem to have fixed the issue by adding a listingUncache() call within the changeDirectory method...
...
currentWorkingDirectory := readDIRCluster() listUncache() ' <=== Added to fix issue with not listing in subdirectory
unlockFileSystem()
I suspect this works because the previous (root) directory was already cached and the cache needed to be reset. Or I may be wrong. Wouldn't be the first time.
Thankyou. Please let me know when you’re happy with the fix and I’ll add it into my next release.
@wmosscrop said:
I seem to have fixed the issue by adding a listingUncache() call within the changeDirectory method...
...
currentWorkingDirectory := readDIRCluster() listUncache() ' <=== Added to fix issue with not listing in subdirectory
unlockFileSystem()
I suspect this works because the previous (root) directory was already cached and the cache needed to be reset. Or I may be wrong. Wouldn't be the first time.
Thankyou. Please let me know when you’re happy with the fix and I’ll add it into my next release.
It works for me, tried several different directories and they all listed correctly. Thanks!
Comments
FWIW I have now posted the FAT32 object over on my new P2 OS thread here
https://forums.parallax.com/discussion/173395/clusos-propeller-os-v2-38-includes-sd-driver-and-fat32-object-plus-serial-driver
AFAIK it is now working fine and ready for prime time. I found my problems with not being able to use duplicate copies of FAT32 concurrently.
First post updated to include links to my P2 OS and FAT32 drivers using my current SD Driver.
@Cluso99
It appears that changing directories does not work as far as listing entries.
I can successfully change directories to a subfolder, but using listEntries immediately afterwards returns filenames in the root directory, not the subfolder.
You may be correct. I have never use directories even on P1 so I guess maybe it's never been tested
I have just done a conversion of Kye's FAT32 driver to spin2. I've added a few things and fixed a couple of things I've needed but I haven't ever bothered to understand his code.
I'm unsure if the problem is in my listEntries spin code or in Kye's code. I'm busy ATM but will take a look when I get a chance.
I seem to have fixed the issue by adding a listingUncache() call within the changeDirectory method...
...
currentWorkingDirectory := readDIRCluster()
listUncache() ' <=== Added to fix issue with not listing in subdirectory
unlockFileSystem()
I suspect this works because the previous (root) directory was already cached and the cache needed to be reset. Or I may be wrong. Wouldn't be the first time.
Thankyou. Please let me know when you’re happy with the fix and I’ll add it into my next release.
It works for me, tried several different directories and they all listed correctly. Thanks!