483
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
.Setsector Method
Function:
Writes a specified sector with the data from the currently
selected RAM buffer of the flash memory (selection is
made through the
property).
Syntax:
fd.getsector(num as word) as pl_fd_status_codes
Returns:
One of the following
, also affects
:
0- PL_FD_STATUS_OK: Completed successfully.
1- PL_FD_STATUS_FAIL : Physical flash memory failure
(fatal).
See Also:
,
,
,
Par
t
Description
nu
m
Sector to write to. Acceptable range is 0 -
-1.
Details
Each physical sector of the flash memory has 264 bytes of data, and all 264 bytes
will be written to.
You can only write to "free" flash sectors that are not occupied by the firmware or
Tibbo Basic application of your device. The number of free sectors can be
determined through the fd.availableflashspace R/O property. Trespassing this
boundary will result in the 1- PL_FD_STATUS_FAIL status code. This is done to
prevent your applications from inadvertently damaging its own code or the
firmware. If you want to write into the firmware/application area, use
instead.
Flash area lying within the fd.availableflashspace boundary may house a formatted
flash disk (see
). Writing to the sector that belongs to a
flash disk when the disk is mounted will automatically dismount the disk (set
= 0- NO).
Writing to sectors that belong to the flash disk may
corrupt the disk and render it unusable
.
All status codes generated by this method are "generic" and are not described
here.
.Totalsize R/O Property
Function:
Returns the total number of sectors occupied by the
currently existing flash disk.
Type:
Word
Value Range:
0-65535
See Also:
,
458
472
472
448
472
468
479
459
457
460
467
474
476
441
457