Kye
12-18-2009, 12:16 PM
Hey guys, I've been making some good progress on my FAT driver, however I'm expierencing a little problem that I can't quite figure out. Its with the code below.
unformatName(listFind(listDotDotDot(directoryName, formatName(directoryName)), @directoryNotFound))
When I execute the piece of above code everything works fine as long as no abort is called. However, if the "listfind" function in there calls an abort some really wierd stuff happens.
Its like there's some sort of delayed crash. The abort is handled okay for like a second as it starts printing out some·random characters·and then you get the fun effects of either the screen being covered in·garbage·and or the chip resetting as the main memory is overwritten.
I'm only using four processors right now, one for vga, one for keyboard and mouse, one for SD card acess, and one for the spin code.
...
So I've tried increassing the amout of extra ram space free for the stack but that doesn't seem to be the problem. The problem does disapear if I make the function call like this however:
listFind(listDotDotDot(directoryName, formatName(directoryName)), @directoryNotFound)
But the unformat name function only runs this piece of code which should all be ignored under an abort situation.
PRI unformatName(name) ' 4 Stack Longs
if(name)
bytefill(@DIRName, " ", 12)
bytemove(@DIRName, name, 8)
repeat while(DIRName[++result] <> " ")
DIRName[result++] := "."
bytemove(@DIRName[result], @byte[name][8], 3)
if(DIRName[result] == " ")
DIRName[--result] := " "
return @DIRName
And even if the code would be executed it should not cause a system crash.
EDIT (Commenting out all the code in the above function does not fix the problem like removing the function call does... must be problem with call stack or something.) ***
...
Is there any thing I should know about abort? Could there be a bug in the spin interpreter with it?
I'm posting the code I was using below. Just modify the FAT engine's pins int he constant section of the code(very top) and try running the comman "cd <name>" on a file that does not exist and you'll see the error.
You'll need a keyboard and vga monitor to run the Main file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 12/18/2009 5:25:24 AM GMT
unformatName(listFind(listDotDotDot(directoryName, formatName(directoryName)), @directoryNotFound))
When I execute the piece of above code everything works fine as long as no abort is called. However, if the "listfind" function in there calls an abort some really wierd stuff happens.
Its like there's some sort of delayed crash. The abort is handled okay for like a second as it starts printing out some·random characters·and then you get the fun effects of either the screen being covered in·garbage·and or the chip resetting as the main memory is overwritten.
I'm only using four processors right now, one for vga, one for keyboard and mouse, one for SD card acess, and one for the spin code.
...
So I've tried increassing the amout of extra ram space free for the stack but that doesn't seem to be the problem. The problem does disapear if I make the function call like this however:
listFind(listDotDotDot(directoryName, formatName(directoryName)), @directoryNotFound)
But the unformat name function only runs this piece of code which should all be ignored under an abort situation.
PRI unformatName(name) ' 4 Stack Longs
if(name)
bytefill(@DIRName, " ", 12)
bytemove(@DIRName, name, 8)
repeat while(DIRName[++result] <> " ")
DIRName[result++] := "."
bytemove(@DIRName[result], @byte[name][8], 3)
if(DIRName[result] == " ")
DIRName[--result] := " "
return @DIRName
And even if the code would be executed it should not cause a system crash.
EDIT (Commenting out all the code in the above function does not fix the problem like removing the function call does... must be problem with call stack or something.) ***
...
Is there any thing I should know about abort? Could there be a bug in the spin interpreter with it?
I'm posting the code I was using below. Just modify the FAT engine's pins int he constant section of the code(very top) and try running the comman "cd <name>" on a file that does not exist and you'll see the error.
You'll need a keyboard and vga monitor to run the Main file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 12/18/2009 5:25:24 AM GMT