Function smt387fs_init – Sundance SMT387-FS User Manual
Page 11
Function smt387fs_init
Synopsis
int smt387fs_init(size_t size, void *space);
Definition
The user task making use of the SMT387 File System Package must call this function
exactly once before calling any other API functions.
Donates the size bytes of memory at space for use by the SMT387 File System
Package. This will normally be space allocated from the calling task’s heap but may
have been acquired in any way.
The memory provided should be word aligned, and in on-chip memory. To get a
rough idea of how much memory is required in a particular situation, add together:
• 0.5KB, plus
• 1KB for each volume mounted, plus
• 1KB for every 32GB of disk space or part thereof, plus
• 32.75KB for each open file
At least 50KB of memory should therefore be provided for basic functionality, but any
increase above this will provide performance benefits.
Synchronization
Must be called only once, before all other API calls.
Error Conditions
SMT387FS_MEM_NULL Null pointer passed.
SMT37FS_MEM_ALLOC Not enough memory provided.
SMT387FS_MEM_ALIGN Memory is not word aligned.
SMT387FS_MEM_OFFCHIP Memory is not on-chip.
Page 11