|
发表于 2013-7-15 17:53:18
|
显示全部楼层
enterpriseZ 发表于 2013-7-15 17:35
我确实找到了那个文件,也尝试过更改,但是组建工程的时候总是不成功,能给个示例的看一下么?
或者说具 ...
之前的宏有更改的话,这是syscall.c里的内容,已更改过。- #include <stdlib.h> /* ANSI memory controls */
- #include "../ff.h"
- #if _FS_REENTRANT
- /* This function is called in f_mount function to create a new
- / synchronization object, such as semaphore and mutex. When a zero is
- / returned, the f_mount function fails with FR_INT_ERR.
- */
- int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to any error */
- BYTE vol, /* Corresponding logical drive being processed */
- _SYNC_t *sobj /* Pointer to return the created sync object */
- )
- {
- int ret;
- u8 err;
-
- *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
- ret = (err == OS_ERR_NONE);
-
- return ret;
- }
- /*------------------------------------------------------------------------*/
- /* Delete a Synchronization Object */
- /*------------------------------------------------------------------------*/
- /* This function is called in f_mount function to delete a synchronization
- / object that created with ff_cre_syncobj function. When a zero is
- / returned, the f_mount function fails with FR_INT_ERR.
- */
- int ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to any error */
- _SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
- )
- {
- int ret;
- u8 err;
-
- OSMutexDel(sobj, OS_DEL_ALWAYS, &err); /* uC/OS-II */
- ret = (err == OS_ERR_NONE);
- return ret;
- }
- /*------------------------------------------------------------------------*/
- /* Request Grant to Access the Volume */
- /*------------------------------------------------------------------------*/
- /* This function is called on entering file functions to lock the volume.
- / When a zero is returned, the file function fails with FR_TIMEOUT.
- */
- int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
- _SYNC_t sobj /* Sync object to wait */
- )
- {
- int ret;
- u8 err;
-
- OSMutexPend(sobj, _FS_TIMEOUT, &err); /* uC/OS-II */
- ret = (err == OS_ERR_NONE);
- return ret;
- }
- /*------------------------------------------------------------------------*/
- /* Release Grant to Access the Volume */
- /*------------------------------------------------------------------------*/
- /* This function is called on leaving file functions to unlock the volume.
- */
- void ff_rel_grant (
- _SYNC_t sobj /* Sync object to be signaled */
- )
- {
- OSMutexPost(sobj); /* uC/OS-II */
- }
- #endif
复制代码 |
|