.Formatj Method

Top  Previous  Next

Function:

Formats the flash memory to create a flash disk.

Syntax:

fd.format(totalsize as word, numstoredfiles as byte, maxjournalsectors as byte) as pl_fd_status_codes

Returns:

One of the following pl_fd_status_codes, also affects fd.laststatus:

0- PL_FD_STATUS_OK: Completed successfully.

1- PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).

4- PL_FD_STATUS_INV_PARAM: Invalid argument have been provided for the invoked method.

16- PL_FD_STATUS_FLASH_NOT_DETECTED: Flash IC wasn't detected during boot, fd. object cannot operate normally.

See Also:

Formatting the Flash Disk, Checking Disk Vitals,

fd.mount, fd.ready

 


Part

Description

totalsize

Desired number of sectors occupied by the disk in flash memory. Cannot exceed available space (fd.availableflashspace) and may be slightly corrected downwards for internal housekeeping reasons. Actual total size can be checked through the fd.totalsize.

maxstoredfiles

Desired maximum number of files that the disk will allow to create. Actual maximum number of files will be adjusted automatically to be a multiple of four and not exceed 64 (for example, specifying 6 will result in the actual value of 8). If you specify 0 you will get 4 files.

maxjournalsectors

Number of sectors to allocate for the transaction journal. Give this disk area a generous number of sectors, possibly 50-100. Do not set below 17 — this will limit the transaction capacity of the journal. Setting this parameter to 0 or 1 disables disk transactions completely.

Details

After formatting the disk will be in the dismounted state and will need to be mounted (see fd.mount) before any disk-related activity can be successfully performed.