/*------------------------------------------------------------------------*/\r
-/* Unicode handling functions for FatFs R0.13b */\r
+/* Unicode Handling Functions for FatFs R0.13 and Later */\r
+/*------------------------------------------------------------------------*/\r
+/* This module will occupy a huge memory in the .rodata section when the */\r
+/* FatFs is configured for LFN with DBCS. If the system has a Unicode */\r
+/* library for the code conversion, this module should be modified to use */\r
+/* it to avoid silly memory consumption. */\r
/*------------------------------------------------------------------------*/\r
-/* This module will occupy a huge memory in the .const section when the /\r
-/ FatFs is configured for LFN with DBCS. If the system has any Unicode /\r
-/ utilitiy for the code conversion, this module should be modified to use /\r
-/ that function to avoid silly memory consumption. /\r
-/-------------------------------------------------------------------------*/\r
/*\r
-/ Copyright (C) 2018, ChaN, all right reserved.\r
+/ Copyright (C) 2022, ChaN, all right reserved.\r
/\r
/ FatFs module is an open source software. Redistribution and use of FatFs in\r
/ source and binary forms, with or without modification, are permitted provided\r
\r
#include "ff.h"\r
\r
-#if FF_USE_LFN /* This module is blanked when non-LFN configuration */\r
-\r
-#if FF_DEFINED != 63463 /* Revision ID */\r
-#error Wrong include file (ff.h).\r
-#endif\r
+#if FF_USE_LFN != 0 /* This module will be blanked if in non-LFN configuration */\r
\r
#if defined(__GNUC__) && defined(__FLASH)\r
#define FLASH __flash\r
\r
\r
/*------------------------------------------------------------------------*/\r
-/* OEM <==> Unicode conversions for static code page configuration */\r
-/* SBCS fixed code page */\r
+/* OEM <==> Unicode Conversions for Static Code Page Configuration with */\r
+/* SBCS Fixed Code Page */\r
/*------------------------------------------------------------------------*/\r
\r
#if FF_CODE_PAGE != 0 && FF_CODE_PAGE < 900\r
)\r
{\r
WCHAR c = 0;\r
- const FLASH WCHAR *p = CVTBL(uc, FF_CODE_PAGE);\r
+ const FLASH WCHAR* p = CVTBL(uc, FF_CODE_PAGE);\r
\r
\r
if (uni < 0x80) { /* ASCII? */\r
return c;\r
}\r
\r
-WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */\r
+WCHAR ff_oem2uni ( /* Returns Unicode character in UTF-16, zero on error */\r
WCHAR oem, /* OEM code to be converted */\r
WORD cp /* Code page for the conversion */\r
)\r
{\r
WCHAR c = 0;\r
- const FLASH WCHAR *p = CVTBL(uc, FF_CODE_PAGE);\r
+ const FLASH WCHAR* p = CVTBL(uc, FF_CODE_PAGE);\r
\r
\r
if (oem < 0x80) { /* ASCII? */\r
\r
\r
/*------------------------------------------------------------------------*/\r
-/* OEM <==> Unicode conversions for static code page configuration */\r
-/* DBCS fixed code page */\r
+/* OEM <==> Unicode Conversions for Static Code Page Configuration with */\r
+/* DBCS Fixed Code Page */\r
/*------------------------------------------------------------------------*/\r
\r
#if FF_CODE_PAGE >= 900\r
WORD cp /* Code page for the conversion */\r
)\r
{\r
- const FLASH WCHAR *p;\r
+ const FLASH WCHAR* p;\r
WCHAR c = 0, uc;\r
UINT i = 0, n, li, hi;\r
\r
}\r
\r
\r
-WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */\r
+WCHAR ff_oem2uni ( /* Returns Unicode character in UTF-16, zero on error */\r
WCHAR oem, /* OEM code to be converted */\r
WORD cp /* Code page for the conversion */\r
)\r
{\r
- const FLASH WCHAR *p;\r
+ const FLASH WCHAR* p;\r
WCHAR c = 0;\r
UINT i = 0, n, li, hi;\r
\r
\r
\r
/*------------------------------------------------------------------------*/\r
-/* OEM <==> Unicode conversions for dynamic code page configuration */\r
+/* OEM <==> Unicode Conversions for Dynamic Code Page Configuration */\r
/*------------------------------------------------------------------------*/\r
\r
#if FF_CODE_PAGE == 0\r
WORD cp /* Code page for the conversion */\r
)\r
{\r
- const FLASH WCHAR *p;\r
+ const FLASH WCHAR* p;\r
WCHAR c = 0, uc;\r
UINT i, n, li, hi;\r
\r
}\r
\r
\r
-WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */\r
+WCHAR ff_oem2uni ( /* Returns Unicode character in UTF-16, zero on error */\r
WCHAR oem, /* OEM code to be converted (DBC if >=0x100) */\r
WORD cp /* Code page for the conversion */\r
)\r
{\r
- const FLASH WCHAR *p;\r
+ const FLASH WCHAR* p;\r
WCHAR c = 0;\r
UINT i, n, li, hi;\r
\r
\r
\r
/*------------------------------------------------------------------------*/\r
-/* Unicode up-case conversion */\r
+/* Unicode Up-case Conversion */\r
/*------------------------------------------------------------------------*/\r
\r
DWORD ff_wtoupper ( /* Returns up-converted code point */\r
DWORD uni /* Unicode code point to be up-converted */\r
)\r
{\r
- const FLASH WORD *p;\r
+ const FLASH WORD* p;\r
WORD uc, bc, nc, cmd;\r
static const FLASH WORD cvt1[] = { /* Compressed up conversion table for U+0000 - U+0FFF */\r
/* Basic Latin */\r
}\r
\r
\r
-#endif /* #if FF_USE_LFN */\r
+#endif /* #if FF_USE_LFN != 0 */\r