summaryrefslogtreecommitdiff
path: root/fatfs/src/option
diff options
context:
space:
mode:
authorLeo C2014-11-17 14:47:05 +0100
committerLeo C2014-11-17 14:47:05 +0100
commit7b78a5a287827db9e9b16286f3604aef69b37c5c (patch)
tree6a3788876f5d701f42663f0a498068f18e39df79 /fatfs/src/option
parent5366852335044c1e68a5c32548d3051cc943552f (diff)
downloadz180-stamp-7b78a5a287827db9e9b16286f3604aef69b37c5c.zip
Import fatfs R0.10cfatfs-0.10c
Diffstat (limited to 'fatfs/src/option')
-rw-r--r--fatfs/src/option/cc932.c6
-rw-r--r--fatfs/src/option/cc936.c4
-rw-r--r--fatfs/src/option/cc949.c4
-rw-r--r--fatfs/src/option/cc950.c4
-rw-r--r--fatfs/src/option/ccsbcs.c2
-rw-r--r--fatfs/src/option/syscall.c38
6 files changed, 28 insertions, 30 deletions
diff --git a/fatfs/src/option/cc932.c b/fatfs/src/option/cc932.c
index 26ac70f..36db384 100644
--- a/fatfs/src/option/cc932.c
+++ b/fatfs/src/option/cc932.c
@@ -3739,10 +3739,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
#if !_TINY_TABLE
if (dir) { /* OEMCP to unicode */
p = sjis2uni;
- hi = sizeof(sjis2uni) / 4 - 1;
+ hi = sizeof sjis2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2sjis;
- hi = sizeof(uni2sjis) / 4 - 1;
+ hi = sizeof uni2sjis / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
@@ -3764,7 +3764,7 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
p -= 3;
c = *p;
} else { /* Unicode to OEMCP */
- li = 0; hi = sizeof(uni2sjis) / 4 - 1;
+ li = 0; hi = sizeof uni2sjis / 4 - 1;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
if (chr == uni2sjis[i * 2]) break;
diff --git a/fatfs/src/option/cc936.c b/fatfs/src/option/cc936.c
index 07a7c1c..84bc329 100644
--- a/fatfs/src/option/cc936.c
+++ b/fatfs/src/option/cc936.c
@@ -10936,10 +10936,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/cc949.c b/fatfs/src/option/cc949.c
index 1fd075d..0abda85 100644
--- a/fatfs/src/option/cc949.c
+++ b/fatfs/src/option/cc949.c
@@ -8565,10 +8565,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/cc950.c b/fatfs/src/option/cc950.c
index a3c9c44..d914b6d 100644
--- a/fatfs/src/option/cc950.c
+++ b/fatfs/src/option/cc950.c
@@ -6791,10 +6791,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/ccsbcs.c b/fatfs/src/option/ccsbcs.c
index d6897bc..b16db30 100644
--- a/fatfs/src/option/ccsbcs.c
+++ b/fatfs/src/option/ccsbcs.c
@@ -444,7 +444,7 @@ const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
-}
+};
#elif _CODE_PAGE == 1257
#define _TBLDEF 1
diff --git a/fatfs/src/option/syscall.c b/fatfs/src/option/syscall.c
index ccfd47e..2036cb7 100644
--- a/fatfs/src/option/syscall.c
+++ b/fatfs/src/option/syscall.c
@@ -1,10 +1,8 @@
/*------------------------------------------------------------------------*/
/* Sample code of OS dependent controls for FatFs */
-/* (C)ChaN, 2012 */
+/* (C)ChaN, 2014 */
/*------------------------------------------------------------------------*/
-#include <stdlib.h> /* ANSI memory controls */
-#include <malloc.h> /* ANSI memory controls */
#include "../ff.h"
@@ -13,14 +11,14 @@
/*------------------------------------------------------------------------*/
/* Create a Synchronization Object
/*------------------------------------------------------------------------*/
-/* This function is called by f_mount() function to create a new
-/ synchronization object, such as semaphore and mutex. When a 0 is
-/ returned, the f_mount() function fails with FR_INT_ERR.
+/* This function is called in f_mount() function to create a new
+/ synchronization object, such as semaphore and mutex. When a 0 is returned,
+/ the f_mount() function fails with FR_INT_ERR.
*/
-int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */
+int ff_cre_syncobj ( /* !=0:Function succeeded, ==0:Could not create due to any error */
BYTE vol, /* Corresponding logical drive being processed */
- _SYNC_t* sobj /* Pointer to return the created sync object */
+ _SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
@@ -29,13 +27,13 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any erro
*sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
ret = (int)(*sobj != INVALID_HANDLE_VALUE);
-// *sobj = SyncObjects[vol]; /* uITRON (give a static created semaphore) */
-// ret = 1;
+// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
+// ret = 1; /* The initial value of the semaphore must be 1. */
-// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
+// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
// ret = (int)(err == OS_NO_ERR);
-// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
+// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
// ret = (int)(*sobj != NULL);
return ret;
@@ -47,11 +45,11 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any erro
/* 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 0 is
-/ returned, the f_mount() function fails with FR_INT_ERR.
+/ object that created with ff_cre_syncobj function. When a 0 is returned,
+/ the f_mount() function fails with FR_INT_ERR.
*/
-int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */
+int ff_del_syncobj ( /* !=0:Function succeeded, ==0:Could not delete due to any error */
_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
)
{
@@ -65,7 +63,7 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); /* uC/OS-II */
// ret = (int)(err == OS_NO_ERR);
-// xSemaphoreDelete(sobj); /* FreeRTOS */
+// vSemaphoreDelete(sobj); /* FreeRTOS */
// ret = 1;
return ret;
@@ -77,10 +75,10 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
/* Request Grant to Access the Volume */
/*------------------------------------------------------------------------*/
/* This function is called on entering file functions to lock the volume.
-/ When a FALSE is returned, the file function fails with FR_TIMEOUT.
+/ When a 0 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 */
+int ff_req_grant ( /* 1:Got a grant to access the volume, 0:Could not get a grant */
_SYNC_t sobj /* Sync object to wait */
)
{
@@ -135,7 +133,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block */
UINT msize /* Number of bytes to allocate */
)
{
- return malloc(msize);
+ return malloc(msize); /* Allocate a new memory block with POSIX API */
}
@@ -147,7 +145,7 @@ void ff_memfree (
void* mblock /* Pointer to the memory block to free */
)
{
- free(mblock);
+ free(mblock); /* Discard the memory block with POSIX API */
}
#endif