My bit of test code is:-
Code: Select all
If ErrFlag = 0 Then ' OK to write
RecordLength = SerialBuffer
For I = 2 To RecordLength
SD.Write(SData(I)) ' << WRITE
Next
If AutoFileSave=BTrue Then ' Has auto save been set?
SD.SaveFile()
EndIf
EndIf
Then it highlights (in orange) a line in the SD FIle system file.
Code: Select all
}
Sub WriteSectorByte(pByte As Byte)
If File.CurrentSectorPos = $200 Then ' << ORANGE HIGHLIGHT
File.CurrentSectorPos = $000
EndIf
File.CurrentSectorBuffer(File.CurrentSectorPos) = pByte
If File.CurrentSectorPos = $1FF Then
WriteSector(File.CurrentSector)
Inc(File.CurrentSector)
EndIf
Inc(File.CurrentSectorPos)
End Sub
However, if I stick in another byte in my code then all is well.
E.G.
Code: Select all
SD.Write(SData(I),10) ' Compiles OK with extra byte
Note: The variable is just:
Dim SData(140) As Byte
I'd be very grateful if someone would point out where I've gone wrong please.