Download µC/FS
Transcript
62/123
User's & reference manual for µC/FS
8.3.5. FS_SMC_HW_X_ChkWP()
Description
Check if the current media is write-protected.
Prototype
char FS_SMC_HW_X_ChkWP(FS_u32 id);
Parameter
Id
Meaning
id of card reader (0…N)
Return value
Returns 0 if the media is not write-protected. Any other value means that the
media is write-protected.
Additional information
If your hardware allows to monitor write-protect status of a media directly, you
can use this status. In case your hardware has to execute a status read
command for checking write protect status of a card, you must not do that
operation inside this function because it is called during other device operations
that would be interrupted. Instead, use a variable to keep track of the current
status instead and return the value of that variable.
Example
/* sample taken from ‘device\smc\Hardware\EP7312’ */
char FS_SMC_HW_X_ChkWP(FS_u32 id) {
return _Hw_card_wprotect[id];
}
2002 Micrium Technologies Corporation