Browse code

Add a XiPC IO Board firmware

Pawel Jablonski authored on 11/06/2024 08:55:31
Showing 62 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+UV4 ?= UV4.exe
2
+
3
+FW_HEX = src/Objects/io.hex
4
+FW_PRO = io.uvprojx
5
+FW_LOG = build.log
6
+
7
+.PHONY: all
8
+all: src doc
9
+
10
+.PHONY: src
11
+src: $(FW_HEX)
12
+
13
+$(FW_HEX): src/*.c src/*.h
14
+ifeq ($(OS),Windows_NT)
15
+ifndef WINE
16
+	cd src; \
17
+	$(UV4) -j0 -b $(FW_PRO) -o $(FW_LOG)
18
+endif
19
+endif
20
+
21
+.PHONY: doc
22
+doc:
23
+	$(MAKE) -C doc
24
+
25
+.PHONY: clean
26
+clean: clean_src clean_doc
27
+	
28
+.PHONY: clean_src
29
+clean_src:
30
+	cd src; \
31
+	rm -rf DebugConfig; \
32
+	rm -rf Listings; \
33
+	rm -rf Objects; \
34
+	rm -rf $(FW_LOG)
35
+
36
+.PHONY: clean_doc
37
+clean_doc:
38
+	$(MAKE) -C doc clean
0 39
new file mode 100644
... ...
@@ -0,0 +1,2717 @@
1
+# Doxyfile 1.9.7
2
+
3
+# This file describes the settings to be used by the documentation system
4
+# doxygen (www.doxygen.org) for a project.
5
+#
6
+# All text after a double hash (##) is considered a comment and is placed in
7
+# front of the TAG it is preceding.
8
+#
9
+# All text after a single hash (#) is considered a comment and will be ignored.
10
+# The format is:
11
+# TAG = value [value, ...]
12
+# For lists, items can also be appended using:
13
+# TAG += value [value, ...]
14
+# Values that contain spaces should be placed between quotes (\" \").
15
+#
16
+# Note:
17
+#
18
+# Use doxygen to compare the used configuration file with the template
19
+# configuration file:
20
+# doxygen -x [configFile]
21
+# Use doxygen to compare the used configuration file with the template
22
+# configuration file without replacing the environment variables or CMake type
23
+# replacement variables:
24
+# doxygen -x_noenv [configFile]
25
+
26
+#---------------------------------------------------------------------------
27
+# Project related configuration options
28
+#---------------------------------------------------------------------------
29
+
30
+# This tag specifies the encoding used for all characters in the configuration
31
+# file that follow. The default is UTF-8 which is also the encoding used for all
32
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
33
+# iconv built into libc) for the transcoding. See
34
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
35
+# The default value is: UTF-8.
36
+
37
+DOXYFILE_ENCODING      = UTF-8
38
+
39
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
40
+# double-quotes, unless you are using Doxywizard) that should identify the
41
+# project for which the documentation is generated. This name is used in the
42
+# title of most generated pages and in a few other places.
43
+# The default value is: My Project.
44
+
45
+PROJECT_NAME           = "XiPU IO Board"
46
+
47
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
48
+# could be handy for archiving the generated documentation or if some version
49
+# control system is used.
50
+
51
+PROJECT_NUMBER         =
52
+
53
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
54
+# for a project that appears at the top of each page and should give viewer a
55
+# quick idea about the purpose of the project. Keep the description short.
56
+
57
+PROJECT_BRIEF          =
58
+
59
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
60
+# in the documentation. The maximum height of the logo should not exceed 55
61
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
62
+# the logo to the output directory.
63
+
64
+PROJECT_LOGO           =
65
+
66
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
67
+# into which the generated documentation will be written. If a relative path is
68
+# entered, it will be relative to the location where doxygen was started. If
69
+# left blank the current directory will be used.
70
+
71
+OUTPUT_DIRECTORY       =
72
+
73
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
74
+# sub-directories (in 2 levels) under the output directory of each output format
75
+# and will distribute the generated files over these directories. Enabling this
76
+# option can be useful when feeding doxygen a huge amount of source files, where
77
+# putting all generated files in the same directory would otherwise causes
78
+# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to
79
+# control the number of sub-directories.
80
+# The default value is: NO.
81
+
82
+CREATE_SUBDIRS         = NO
83
+
84
+# Controls the number of sub-directories that will be created when
85
+# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every
86
+# level increment doubles the number of directories, resulting in 4096
87
+# directories at level 8 which is the default and also the maximum value. The
88
+# sub-directories are organized in 2 levels, the first level always has a fixed
89
+# number of 16 directories.
90
+# Minimum value: 0, maximum value: 8, default value: 8.
91
+# This tag requires that the tag CREATE_SUBDIRS is set to YES.
92
+
93
+CREATE_SUBDIRS_LEVEL   = 8
94
+
95
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
96
+# characters to appear in the names of generated files. If set to NO, non-ASCII
97
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
98
+# U+3044.
99
+# The default value is: NO.
100
+
101
+ALLOW_UNICODE_NAMES    = NO
102
+
103
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
104
+# documentation generated by doxygen is written. Doxygen will use this
105
+# information to generate all constant output in the proper language.
106
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,
107
+# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English
108
+# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,
109
+# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with
110
+# English messages), Korean, Korean-en (Korean with English messages), Latvian,
111
+# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,
112
+# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,
113
+# Swedish, Turkish, Ukrainian and Vietnamese.
114
+# The default value is: English.
115
+
116
+OUTPUT_LANGUAGE        = English
117
+
118
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
119
+# descriptions after the members that are listed in the file and class
120
+# documentation (similar to Javadoc). Set to NO to disable this.
121
+# The default value is: YES.
122
+
123
+BRIEF_MEMBER_DESC      = YES
124
+
125
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
126
+# description of a member or function before the detailed description
127
+#
128
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
129
+# brief descriptions will be completely suppressed.
130
+# The default value is: YES.
131
+
132
+REPEAT_BRIEF           = YES
133
+
134
+# This tag implements a quasi-intelligent brief description abbreviator that is
135
+# used to form the text in various listings. Each string in this list, if found
136
+# as the leading text of the brief description, will be stripped from the text
137
+# and the result, after processing the whole list, is used as the annotated
138
+# text. Otherwise, the brief description is used as-is. If left blank, the
139
+# following values are used ($name is automatically replaced with the name of
140
+# the entity):The $name class, The $name widget, The $name file, is, provides,
141
+# specifies, contains, represents, a, an and the.
142
+
143
+ABBREVIATE_BRIEF       =
144
+
145
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
146
+# doxygen will generate a detailed section even if there is only a brief
147
+# description.
148
+# The default value is: NO.
149
+
150
+ALWAYS_DETAILED_SEC    = NO
151
+
152
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
153
+# inherited members of a class in the documentation of that class as if those
154
+# members were ordinary class members. Constructors, destructors and assignment
155
+# operators of the base classes will not be shown.
156
+# The default value is: NO.
157
+
158
+INLINE_INHERITED_MEMB  = NO
159
+
160
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
161
+# before files name in the file list and in the header files. If set to NO the
162
+# shortest path that makes the file name unique will be used
163
+# The default value is: YES.
164
+
165
+FULL_PATH_NAMES        = NO
166
+
167
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
168
+# Stripping is only done if one of the specified strings matches the left-hand
169
+# part of the path. The tag can be used to show relative paths in the file list.
170
+# If left blank the directory from which doxygen is run is used as the path to
171
+# strip.
172
+#
173
+# Note that you can specify absolute paths here, but also relative paths, which
174
+# will be relative from the directory where doxygen is started.
175
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
176
+
177
+STRIP_FROM_PATH        =
178
+
179
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
180
+# path mentioned in the documentation of a class, which tells the reader which
181
+# header file to include in order to use a class. If left blank only the name of
182
+# the header file containing the class definition is used. Otherwise one should
183
+# specify the list of include paths that are normally passed to the compiler
184
+# using the -I flag.
185
+
186
+STRIP_FROM_INC_PATH    =
187
+
188
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
189
+# less readable) file names. This can be useful is your file systems doesn't
190
+# support long names like on DOS, Mac, or CD-ROM.
191
+# The default value is: NO.
192
+
193
+SHORT_NAMES            = NO
194
+
195
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
196
+# first line (until the first dot) of a Javadoc-style comment as the brief
197
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
198
+# style comments (thus requiring an explicit @brief command for a brief
199
+# description.)
200
+# The default value is: NO.
201
+
202
+JAVADOC_AUTOBRIEF      = NO
203
+
204
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
205
+# such as
206
+# /***************
207
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
208
+# Javadoc-style will behave just like regular comments and it will not be
209
+# interpreted by doxygen.
210
+# The default value is: NO.
211
+
212
+JAVADOC_BANNER         = NO
213
+
214
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
215
+# line (until the first dot) of a Qt-style comment as the brief description. If
216
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
217
+# requiring an explicit \brief command for a brief description.)
218
+# The default value is: NO.
219
+
220
+QT_AUTOBRIEF           = NO
221
+
222
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
223
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
224
+# a brief description. This used to be the default behavior. The new default is
225
+# to treat a multi-line C++ comment block as a detailed description. Set this
226
+# tag to YES if you prefer the old behavior instead.
227
+#
228
+# Note that setting this tag to YES also means that rational rose comments are
229
+# not recognized any more.
230
+# The default value is: NO.
231
+
232
+MULTILINE_CPP_IS_BRIEF = NO
233
+
234
+# By default Python docstrings are displayed as preformatted text and doxygen's
235
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
236
+# doxygen's special commands can be used and the contents of the docstring
237
+# documentation blocks is shown as doxygen documentation.
238
+# The default value is: YES.
239
+
240
+PYTHON_DOCSTRING       = YES
241
+
242
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
243
+# documentation from any documented member that it re-implements.
244
+# The default value is: YES.
245
+
246
+INHERIT_DOCS           = YES
247
+
248
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
249
+# page for each member. If set to NO, the documentation of a member will be part
250
+# of the file/class/namespace that contains it.
251
+# The default value is: NO.
252
+
253
+SEPARATE_MEMBER_PAGES  = NO
254
+
255
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
256
+# uses this value to replace tabs by spaces in code fragments.
257
+# Minimum value: 1, maximum value: 16, default value: 4.
258
+
259
+TAB_SIZE               = 4
260
+
261
+# This tag can be used to specify a number of aliases that act as commands in
262
+# the documentation. An alias has the form:
263
+# name=value
264
+# For example adding
265
+# "sideeffect=@par Side Effects:^^"
266
+# will allow you to put the command \sideeffect (or @sideeffect) in the
267
+# documentation, which will result in a user-defined paragraph with heading
268
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
269
+# to insert newlines (in the resulting output). You can put ^^ in the value part
270
+# of an alias to insert a newline as if a physical newline was in the original
271
+# file. When you need a literal { or } or , in the value part of an alias you
272
+# have to escape them by means of a backslash (\), this can lead to conflicts
273
+# with the commands \{ and \} for these it is advised to use the version @{ and
274
+# @} or use a double escape (\\{ and \\})
275
+
276
+ALIASES                =
277
+
278
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
279
+# only. Doxygen will then generate output that is more tailored for C. For
280
+# instance, some of the names that are used will be different. The list of all
281
+# members will be omitted, etc.
282
+# The default value is: NO.
283
+
284
+OPTIMIZE_OUTPUT_FOR_C  = YES
285
+
286
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
287
+# Python sources only. Doxygen will then generate output that is more tailored
288
+# for that language. For instance, namespaces will be presented as packages,
289
+# qualified scopes will look different, etc.
290
+# The default value is: NO.
291
+
292
+OPTIMIZE_OUTPUT_JAVA   = NO
293
+
294
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
295
+# sources. Doxygen will then generate output that is tailored for Fortran.
296
+# The default value is: NO.
297
+
298
+OPTIMIZE_FOR_FORTRAN   = NO
299
+
300
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
301
+# sources. Doxygen will then generate output that is tailored for VHDL.
302
+# The default value is: NO.
303
+
304
+OPTIMIZE_OUTPUT_VHDL   = NO
305
+
306
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
307
+# sources only. Doxygen will then generate output that is more tailored for that
308
+# language. For instance, namespaces will be presented as modules, types will be
309
+# separated into more groups, etc.
310
+# The default value is: NO.
311
+
312
+OPTIMIZE_OUTPUT_SLICE  = NO
313
+
314
+# Doxygen selects the parser to use depending on the extension of the files it
315
+# parses. With this tag you can assign which parser to use for a given
316
+# extension. Doxygen has a built-in mapping, but you can override or extend it
317
+# using this tag. The format is ext=language, where ext is a file extension, and
318
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
319
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
320
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
321
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
322
+# tries to guess whether the code is fixed or free formatted code, this is the
323
+# default for Fortran type files). For instance to make doxygen treat .inc files
324
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
325
+# use: inc=Fortran f=C.
326
+#
327
+# Note: For files without extension you can use no_extension as a placeholder.
328
+#
329
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
330
+# the files are not read by doxygen. When specifying no_extension you should add
331
+# * to the FILE_PATTERNS.
332
+#
333
+# Note see also the list of default file extension mappings.
334
+
335
+EXTENSION_MAPPING      =
336
+
337
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
338
+# according to the Markdown format, which allows for more readable
339
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
340
+# The output of markdown processing is further processed by doxygen, so you can
341
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
342
+# case of backward compatibilities issues.
343
+# The default value is: YES.
344
+
345
+MARKDOWN_SUPPORT       = NO
346
+
347
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
348
+# to that level are automatically included in the table of contents, even if
349
+# they do not have an id attribute.
350
+# Note: This feature currently applies only to Markdown headings.
351
+# Minimum value: 0, maximum value: 99, default value: 5.
352
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
353
+
354
+TOC_INCLUDE_HEADINGS   = 5
355
+
356
+# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
357
+# generate identifiers for the Markdown headings. Note: Every identifier is
358
+# unique.
359
+# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a
360
+# sequence number starting at 0. and GITHUB Use the lower case version of title
361
+# with any whitespace replaced by '-' and punctations characters removed..
362
+# The default value is: DOXYGEN.
363
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
364
+
365
+MARKDOWN_ID_STYLE      = DOXYGEN
366
+
367
+# When enabled doxygen tries to link words that correspond to documented
368
+# classes, or namespaces to their corresponding documentation. Such a link can
369
+# be prevented in individual cases by putting a % sign in front of the word or
370
+# globally by setting AUTOLINK_SUPPORT to NO.
371
+# The default value is: YES.
372
+
373
+AUTOLINK_SUPPORT       = YES
374
+
375
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
376
+# to include (a tag file for) the STL sources as input, then you should set this
377
+# tag to YES in order to let doxygen match functions declarations and
378
+# definitions whose arguments contain STL classes (e.g. func(std::string);
379
+# versus func(std::string) {}). This also make the inheritance and collaboration
380
+# diagrams that involve STL classes more complete and accurate.
381
+# The default value is: NO.
382
+
383
+BUILTIN_STL_SUPPORT    = YES
384
+
385
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
386
+# enable parsing support.
387
+# The default value is: NO.
388
+
389
+CPP_CLI_SUPPORT        = NO
390
+
391
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
392
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
393
+# will parse them like normal C++ but will assume all classes use public instead
394
+# of private inheritance when no explicit protection keyword is present.
395
+# The default value is: NO.
396
+
397
+SIP_SUPPORT            = NO
398
+
399
+# For Microsoft's IDL there are propget and propput attributes to indicate
400
+# getter and setter methods for a property. Setting this option to YES will make
401
+# doxygen to replace the get and set methods by a property in the documentation.
402
+# This will only work if the methods are indeed getting or setting a simple
403
+# type. If this is not the case, or you want to show the methods anyway, you
404
+# should set this option to NO.
405
+# The default value is: YES.
406
+
407
+IDL_PROPERTY_SUPPORT   = YES
408
+
409
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
410
+# tag is set to YES then doxygen will reuse the documentation of the first
411
+# member in the group (if any) for the other members of the group. By default
412
+# all members of a group must be documented explicitly.
413
+# The default value is: NO.
414
+
415
+DISTRIBUTE_GROUP_DOC   = NO
416
+
417
+# If one adds a struct or class to a group and this option is enabled, then also
418
+# any nested class or struct is added to the same group. By default this option
419
+# is disabled and one has to add nested compounds explicitly via \ingroup.
420
+# The default value is: NO.
421
+
422
+GROUP_NESTED_COMPOUNDS = NO
423
+
424
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
425
+# (for instance a group of public functions) to be put as a subgroup of that
426
+# type (e.g. under the Public Functions section). Set it to NO to prevent
427
+# subgrouping. Alternatively, this can be done per class using the
428
+# \nosubgrouping command.
429
+# The default value is: YES.
430
+
431
+SUBGROUPING            = YES
432
+
433
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
434
+# are shown inside the group in which they are included (e.g. using \ingroup)
435
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
436
+# and RTF).
437
+#
438
+# Note that this feature does not work in combination with
439
+# SEPARATE_MEMBER_PAGES.
440
+# The default value is: NO.
441
+
442
+INLINE_GROUPED_CLASSES = NO
443
+
444
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
445
+# with only public data fields or simple typedef fields will be shown inline in
446
+# the documentation of the scope in which they are defined (i.e. file,
447
+# namespace, or group documentation), provided this scope is documented. If set
448
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
449
+# Man pages) or section (for LaTeX and RTF).
450
+# The default value is: NO.
451
+
452
+INLINE_SIMPLE_STRUCTS  = NO
453
+
454
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
455
+# enum is documented as struct, union, or enum with the name of the typedef. So
456
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
457
+# with name TypeT. When disabled the typedef will appear as a member of a file,
458
+# namespace, or class. And the struct will be named TypeS. This can typically be
459
+# useful for C code in case the coding convention dictates that all compound
460
+# types are typedef'ed and only the typedef is referenced, never the tag name.
461
+# The default value is: NO.
462
+
463
+TYPEDEF_HIDES_STRUCT   = NO
464
+
465
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
466
+# cache is used to resolve symbols given their name and scope. Since this can be
467
+# an expensive process and often the same symbol appears multiple times in the
468
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
469
+# doxygen will become slower. If the cache is too large, memory is wasted. The
470
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
471
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
472
+# symbols. At the end of a run doxygen will report the cache usage and suggest
473
+# the optimal cache size from a speed point of view.
474
+# Minimum value: 0, maximum value: 9, default value: 0.
475
+
476
+LOOKUP_CACHE_SIZE      = 0
477
+
478
+# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use
479
+# during processing. When set to 0 doxygen will based this on the number of
480
+# cores available in the system. You can set it explicitly to a value larger
481
+# than 0 to get more control over the balance between CPU load and processing
482
+# speed. At this moment only the input processing can be done using multiple
483
+# threads. Since this is still an experimental feature the default is set to 1,
484
+# which effectively disables parallel processing. Please report any issues you
485
+# encounter. Generating dot graphs in parallel is controlled by the
486
+# DOT_NUM_THREADS setting.
487
+# Minimum value: 0, maximum value: 32, default value: 1.
488
+
489
+NUM_PROC_THREADS       = 1
490
+
491
+# If the TIMESTAMP tag is set different from NO then each generated page will
492
+# contain the date or date and time when the page was generated. Setting this to
493
+# NO can help when comparing the output of multiple runs.
494
+# Possible values are: YES, NO, DATETIME and DATE.
495
+# The default value is: NO.
496
+
497
+TIMESTAMP              = YES
498
+
499
+#---------------------------------------------------------------------------
500
+# Build related configuration options
501
+#---------------------------------------------------------------------------
502
+
503
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
504
+# documentation are documented, even if no documentation was available. Private
505
+# class members and static file members will be hidden unless the
506
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
507
+# Note: This will also disable the warnings about undocumented members that are
508
+# normally produced when WARNINGS is set to YES.
509
+# The default value is: NO.
510
+
511
+EXTRACT_ALL            = YES
512
+
513
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
514
+# be included in the documentation.
515
+# The default value is: NO.
516
+
517
+EXTRACT_PRIVATE        = YES
518
+
519
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
520
+# methods of a class will be included in the documentation.
521
+# The default value is: NO.
522
+
523
+EXTRACT_PRIV_VIRTUAL   = NO
524
+
525
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
526
+# scope will be included in the documentation.
527
+# The default value is: NO.
528
+
529
+EXTRACT_PACKAGE        = NO
530
+
531
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
532
+# included in the documentation.
533
+# The default value is: NO.
534
+
535
+EXTRACT_STATIC         = YES
536
+
537
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
538
+# locally in source files will be included in the documentation. If set to NO,
539
+# only classes defined in header files are included. Does not have any effect
540
+# for Java sources.
541
+# The default value is: YES.
542
+
543
+EXTRACT_LOCAL_CLASSES  = YES
544
+
545
+# This flag is only useful for Objective-C code. If set to YES, local methods,
546
+# which are defined in the implementation section but not in the interface are
547
+# included in the documentation. If set to NO, only methods in the interface are
548
+# included.
549
+# The default value is: NO.
550
+
551
+EXTRACT_LOCAL_METHODS  = NO
552
+
553
+# If this flag is set to YES, the members of anonymous namespaces will be
554
+# extracted and appear in the documentation as a namespace called
555
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
556
+# the file that contains the anonymous namespace. By default anonymous namespace
557
+# are hidden.
558
+# The default value is: NO.
559
+
560
+EXTRACT_ANON_NSPACES   = YES
561
+
562
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
563
+# will be determined by the corresponding definition. By default unnamed
564
+# parameters remain unnamed in the output.
565
+# The default value is: YES.
566
+
567
+RESOLVE_UNNAMED_PARAMS = YES
568
+
569
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
570
+# undocumented members inside documented classes or files. If set to NO these
571
+# members will be included in the various overviews, but no documentation
572
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
573
+# The default value is: NO.
574
+
575
+HIDE_UNDOC_MEMBERS     = NO
576
+
577
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
578
+# undocumented classes that are normally visible in the class hierarchy. If set
579
+# to NO, these classes will be included in the various overviews. This option
580
+# will also hide undocumented C++ concepts if enabled. This option has no effect
581
+# if EXTRACT_ALL is enabled.
582
+# The default value is: NO.
583
+
584
+HIDE_UNDOC_CLASSES     = NO
585
+
586
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
587
+# declarations. If set to NO, these declarations will be included in the
588
+# documentation.
589
+# The default value is: NO.
590
+
591
+HIDE_FRIEND_COMPOUNDS  = NO
592
+
593
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
594
+# documentation blocks found inside the body of a function. If set to NO, these
595
+# blocks will be appended to the function's detailed documentation block.
596
+# The default value is: NO.
597
+
598
+HIDE_IN_BODY_DOCS      = NO
599
+
600
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
601
+# \internal command is included. If the tag is set to NO then the documentation
602
+# will be excluded. Set it to YES to include the internal documentation.
603
+# The default value is: NO.
604
+
605
+INTERNAL_DOCS          = NO
606
+
607
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
608
+# able to match the capabilities of the underlying filesystem. In case the
609
+# filesystem is case sensitive (i.e. it supports files in the same directory
610
+# whose names only differ in casing), the option must be set to YES to properly
611
+# deal with such files in case they appear in the input. For filesystems that
612
+# are not case sensitive the option should be set to NO to properly deal with
613
+# output files written for symbols that only differ in casing, such as for two
614
+# classes, one named CLASS and the other named Class, and to also support
615
+# references to files without having to specify the exact matching casing. On
616
+# Windows (including Cygwin) and MacOS, users should typically set this option
617
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
618
+# YES.
619
+# Possible values are: SYSTEM, NO and YES.
620
+# The default value is: SYSTEM.
621
+
622
+CASE_SENSE_NAMES       = NO
623
+
624
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
625
+# their full class and namespace scopes in the documentation. If set to YES, the
626
+# scope will be hidden.
627
+# The default value is: NO.
628
+
629
+HIDE_SCOPE_NAMES       = NO
630
+
631
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
632
+# append additional text to a page's title, such as Class Reference. If set to
633
+# YES the compound reference will be hidden.
634
+# The default value is: NO.
635
+
636
+HIDE_COMPOUND_REFERENCE= NO
637
+
638
+# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
639
+# will show which file needs to be included to use the class.
640
+# The default value is: YES.
641
+
642
+SHOW_HEADERFILE        = YES
643
+
644
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
645
+# the files that are included by a file in the documentation of that file.
646
+# The default value is: YES.
647
+
648
+SHOW_INCLUDE_FILES     = YES
649
+
650
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
651
+# grouped member an include statement to the documentation, telling the reader
652
+# which file to include in order to use the member.
653
+# The default value is: NO.
654
+
655
+SHOW_GROUPED_MEMB_INC  = YES
656
+
657
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
658
+# files with double quotes in the documentation rather than with sharp brackets.
659
+# The default value is: NO.
660
+
661
+FORCE_LOCAL_INCLUDES   = NO
662
+
663
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
664
+# documentation for inline members.
665
+# The default value is: YES.
666
+
667
+INLINE_INFO            = YES
668
+
669
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
670
+# (detailed) documentation of file and class members alphabetically by member
671
+# name. If set to NO, the members will appear in declaration order.
672
+# The default value is: YES.
673
+
674
+SORT_MEMBER_DOCS       = YES
675
+
676
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
677
+# descriptions of file, namespace and class members alphabetically by member
678
+# name. If set to NO, the members will appear in declaration order. Note that
679
+# this will also influence the order of the classes in the class list.
680
+# The default value is: NO.
681
+
682
+SORT_BRIEF_DOCS        = NO
683
+
684
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
685
+# (brief and detailed) documentation of class members so that constructors and
686
+# destructors are listed first. If set to NO the constructors will appear in the
687
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
688
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
689
+# member documentation.
690
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
691
+# detailed member documentation.
692
+# The default value is: NO.
693
+
694
+SORT_MEMBERS_CTORS_1ST = NO
695
+
696
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
697
+# of group names into alphabetical order. If set to NO the group names will
698
+# appear in their defined order.
699
+# The default value is: NO.
700
+
701
+SORT_GROUP_NAMES       = NO
702
+
703
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
704
+# fully-qualified names, including namespaces. If set to NO, the class list will
705
+# be sorted only by class name, not including the namespace part.
706
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
707
+# Note: This option applies only to the class list, not to the alphabetical
708
+# list.
709
+# The default value is: NO.
710
+
711
+SORT_BY_SCOPE_NAME     = NO
712
+
713
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
714
+# type resolution of all parameters of a function it will reject a match between
715
+# the prototype and the implementation of a member function even if there is
716
+# only one candidate or it is obvious which candidate to choose by doing a
717
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
718
+# accept a match between prototype and implementation in such cases.
719
+# The default value is: NO.
720
+
721
+STRICT_PROTO_MATCHING  = NO
722
+
723
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
724
+# list. This list is created by putting \todo commands in the documentation.
725
+# The default value is: YES.
726
+
727
+GENERATE_TODOLIST      = YES
728
+
729
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
730
+# list. This list is created by putting \test commands in the documentation.
731
+# The default value is: YES.
732
+
733
+GENERATE_TESTLIST      = YES
734
+
735
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
736
+# list. This list is created by putting \bug commands in the documentation.
737
+# The default value is: YES.
738
+
739
+GENERATE_BUGLIST       = YES
740
+
741
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
742
+# the deprecated list. This list is created by putting \deprecated commands in
743
+# the documentation.
744
+# The default value is: YES.
745
+
746
+GENERATE_DEPRECATEDLIST= YES
747
+
748
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
749
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
750
+# ... \endcond blocks.
751
+
752
+ENABLED_SECTIONS       =
753
+
754
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
755
+# initial value of a variable or macro / define can have for it to appear in the
756
+# documentation. If the initializer consists of more lines than specified here
757
+# it will be hidden. Use a value of 0 to hide initializers completely. The
758
+# appearance of the value of individual variables and macros / defines can be
759
+# controlled using \showinitializer or \hideinitializer command in the
760
+# documentation regardless of this setting.
761
+# Minimum value: 0, maximum value: 10000, default value: 30.
762
+
763
+MAX_INITIALIZER_LINES  = 30
764
+
765
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
766
+# the bottom of the documentation of classes and structs. If set to YES, the
767
+# list will mention the files that were used to generate the documentation.
768
+# The default value is: YES.
769
+
770
+SHOW_USED_FILES        = YES
771
+
772
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
773
+# will remove the Files entry from the Quick Index and from the Folder Tree View
774
+# (if specified).
775
+# The default value is: YES.
776
+
777
+SHOW_FILES             = YES
778
+
779
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
780
+# page. This will remove the Namespaces entry from the Quick Index and from the
781
+# Folder Tree View (if specified).
782
+# The default value is: YES.
783
+
784
+SHOW_NAMESPACES        = YES
785
+
786
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
787
+# doxygen should invoke to get the current version for each file (typically from
788
+# the version control system). Doxygen will invoke the program by executing (via
789
+# popen()) the command command input-file, where command is the value of the
790
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
791
+# by doxygen. Whatever the program writes to standard output is used as the file
792
+# version. For an example see the documentation.
793
+
794
+FILE_VERSION_FILTER    =
795
+
796
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
797
+# by doxygen. The layout file controls the global structure of the generated
798
+# output files in an output format independent way. To create the layout file
799
+# that represents doxygen's defaults, run doxygen with the -l option. You can
800
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
801
+# will be used as the name of the layout file. See also section "Changing the
802
+# layout of pages" for information.
803
+#
804
+# Note that if you run doxygen from a directory containing a file called
805
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
806
+# tag is left empty.
807
+
808
+LAYOUT_FILE            =
809
+
810
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
811
+# the reference definitions. This must be a list of .bib files. The .bib
812
+# extension is automatically appended if omitted. This requires the bibtex tool
813
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
814
+# For LaTeX the style of the bibliography can be controlled using
815
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
816
+# search path. See also \cite for info how to create references.
817
+
818
+CITE_BIB_FILES         =
819
+
820
+#---------------------------------------------------------------------------
821
+# Configuration options related to warning and progress messages
822
+#---------------------------------------------------------------------------
823
+
824
+# The QUIET tag can be used to turn on/off the messages that are generated to
825
+# standard output by doxygen. If QUIET is set to YES this implies that the
826
+# messages are off.
827
+# The default value is: NO.
828
+
829
+QUIET                  = NO
830
+
831
+# The WARNINGS tag can be used to turn on/off the warning messages that are
832
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
833
+# this implies that the warnings are on.
834
+#
835
+# Tip: Turn warnings on while writing the documentation.
836
+# The default value is: YES.
837
+
838
+WARNINGS               = YES
839
+
840
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
841
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
842
+# will automatically be disabled.
843
+# The default value is: YES.
844
+
845
+WARN_IF_UNDOCUMENTED   = YES
846
+
847
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
848
+# potential errors in the documentation, such as documenting some parameters in
849
+# a documented function twice, or documenting parameters that don't exist or
850
+# using markup commands wrongly.
851
+# The default value is: YES.
852
+
853
+WARN_IF_DOC_ERROR      = YES
854
+
855
+# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
856
+# function parameter documentation. If set to NO, doxygen will accept that some
857
+# parameters have no documentation without warning.
858
+# The default value is: YES.
859
+
860
+WARN_IF_INCOMPLETE_DOC = YES
861
+
862
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
863
+# are documented, but have no documentation for their parameters or return
864
+# value. If set to NO, doxygen will only warn about wrong parameter
865
+# documentation, but not about the absence of documentation. If EXTRACT_ALL is
866
+# set to YES then this flag will automatically be disabled. See also
867
+# WARN_IF_INCOMPLETE_DOC
868
+# The default value is: NO.
869
+
870
+WARN_NO_PARAMDOC       = YES
871
+
872
+# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about
873
+# undocumented enumeration values. If set to NO, doxygen will accept
874
+# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag
875
+# will automatically be disabled.
876
+# The default value is: NO.
877
+
878
+WARN_IF_UNDOC_ENUM_VAL = NO
879
+
880
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
881
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
882
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
883
+# at the end of the doxygen process doxygen will return with a non-zero status.
884
+# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves
885
+# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not
886
+# write the warning messages in between other messages but write them at the end
887
+# of a run, in case a WARN_LOGFILE is defined the warning messages will be
888
+# besides being in the defined file also be shown at the end of a run, unless
889
+# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case
890
+# the behavior will remain as with the setting FAIL_ON_WARNINGS.
891
+# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT.
892
+# The default value is: NO.
893
+
894
+WARN_AS_ERROR          = YES
895
+
896
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
897
+# can produce. The string should contain the $file, $line, and $text tags, which
898
+# will be replaced by the file and line number from which the warning originated
899
+# and the warning text. Optionally the format may contain $version, which will
900
+# be replaced by the version of the file (if it could be obtained via
901
+# FILE_VERSION_FILTER)
902
+# See also: WARN_LINE_FORMAT
903
+# The default value is: $file:$line: $text.
904
+
905
+WARN_FORMAT            = "$file:$line: $text"
906
+
907
+# In the $text part of the WARN_FORMAT command it is possible that a reference
908
+# to a more specific place is given. To make it easier to jump to this place
909
+# (outside of doxygen) the user can define a custom "cut" / "paste" string.
910
+# Example:
911
+# WARN_LINE_FORMAT = "'vi $file +$line'"
912
+# See also: WARN_FORMAT
913
+# The default value is: at line $line of file $file.
914
+
915
+WARN_LINE_FORMAT       = "at line $line of file $file"
916
+
917
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
918
+# messages should be written. If left blank the output is written to standard
919
+# error (stderr). In case the file specified cannot be opened for writing the
920
+# warning and error messages are written to standard error. When as file - is
921
+# specified the warning and error messages are written to standard output
922
+# (stdout).
923
+
924
+WARN_LOGFILE           = warnings.log
925
+
926
+#---------------------------------------------------------------------------
927
+# Configuration options related to the input files
928
+#---------------------------------------------------------------------------
929
+
930
+# The INPUT tag is used to specify the files and/or directories that contain
931
+# documented source files. You may enter file names like myfile.cpp or
932
+# directories like /usr/src/myproject. Separate the files or directories with
933
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
934
+# Note: If this tag is empty the current directory is searched.
935
+
936
+INPUT                  = ../src
937
+
938
+# This tag can be used to specify the character encoding of the source files
939
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
940
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
941
+# documentation (see:
942
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
943
+# See also: INPUT_FILE_ENCODING
944
+# The default value is: UTF-8.
945
+
946
+INPUT_ENCODING         = UTF-8
947
+
948
+# This tag can be used to specify the character encoding of the source files
949
+# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
950
+# character encoding on a per file pattern basis. Doxygen will compare the file
951
+# name with each pattern and apply the encoding instead of the default
952
+# INPUT_ENCODING) if there is a match. The character encodings are a list of the
953
+# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
954
+# "INPUT_ENCODING" for further information on supported encodings.
955
+
956
+INPUT_FILE_ENCODING    =
957
+
958
+# If the value of the INPUT tag contains directories, you can use the
959
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
960
+# *.h) to filter out the source-files in the directories.
961
+#
962
+# Note that for custom extensions or not directly supported extensions you also
963
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
964
+# read by doxygen.
965
+#
966
+# Note the list of default checked file patterns might differ from the list of
967
+# default file extension mappings.
968
+#
969
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
970
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
971
+# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
972
+# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
973
+# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
974
+# *.vhdl, *.ucf, *.qsf and *.ice.
975
+
976
+FILE_PATTERNS          = *.h \
977
+                         *.c
978
+
979
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
980
+# be searched for input files as well.
981
+# The default value is: NO.
982
+
983
+RECURSIVE              = NO
984
+
985
+# The EXCLUDE tag can be used to specify files and/or directories that should be
986
+# excluded from the INPUT source files. This way you can easily exclude a
987
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
988
+#
989
+# Note that relative paths are relative to the directory from which doxygen is
990
+# run.
991
+
992
+EXCLUDE                =
993
+
994
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
995
+# directories that are symbolic links (a Unix file system feature) are excluded
996
+# from the input.
997
+# The default value is: NO.
998
+
999
+EXCLUDE_SYMLINKS       = NO
1000
+
1001
+# If the value of the INPUT tag contains directories, you can use the
1002
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
1003
+# certain files from those directories.
1004
+#
1005
+# Note that the wildcards are matched against the file with absolute path, so to
1006
+# exclude all test directories for example use the pattern */test/*
1007
+
1008
+EXCLUDE_PATTERNS       =
1009
+
1010
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
1011
+# (namespaces, classes, functions, etc.) that should be excluded from the
1012
+# output. The symbol name can be a fully qualified name, a word, or if the
1013
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
1014
+# ANamespace::AClass, ANamespace::*Test
1015
+
1016
+EXCLUDE_SYMBOLS        =
1017
+
1018
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
1019
+# that contain example code fragments that are included (see the \include
1020
+# command).
1021
+
1022
+EXAMPLE_PATH           =
1023
+
1024
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
1025
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
1026
+# *.h) to filter out the source-files in the directories. If left blank all
1027
+# files are included.
1028
+
1029
+EXAMPLE_PATTERNS       =
1030
+
1031
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
1032
+# searched for input files to be used with the \include or \dontinclude commands
1033
+# irrespective of the value of the RECURSIVE tag.
1034
+# The default value is: NO.
1035
+
1036
+EXAMPLE_RECURSIVE      = NO
1037
+
1038
+# The IMAGE_PATH tag can be used to specify one or more files or directories
1039
+# that contain images that are to be included in the documentation (see the
1040
+# \image command).
1041
+
1042
+IMAGE_PATH             =
1043
+
1044
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
1045
+# invoke to filter for each input file. Doxygen will invoke the filter program
1046
+# by executing (via popen()) the command:
1047
+#
1048
+# <filter> <input-file>
1049
+#
1050
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
1051
+# name of an input file. Doxygen will then use the output that the filter
1052
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
1053
+# will be ignored.
1054
+#
1055
+# Note that the filter must not add or remove lines; it is applied before the
1056
+# code is scanned, but not when the output code is generated. If lines are added
1057
+# or removed, the anchors will not be placed correctly.
1058
+#
1059
+# Note that doxygen will use the data processed and written to standard output
1060
+# for further processing, therefore nothing else, like debug statements or used
1061
+# commands (so in case of a Windows batch file always use @echo OFF), should be
1062
+# written to standard output.
1063
+#
1064
+# Note that for custom extensions or not directly supported extensions you also
1065
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
1066
+# properly processed by doxygen.
1067
+
1068
+INPUT_FILTER           =
1069
+
1070
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
1071
+# basis. Doxygen will compare the file name with each pattern and apply the
1072
+# filter if there is a match. The filters are a list of the form: pattern=filter
1073
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
1074
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
1075
+# patterns match the file name, INPUT_FILTER is applied.
1076
+#
1077
+# Note that for custom extensions or not directly supported extensions you also
1078
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
1079
+# properly processed by doxygen.
1080
+
1081
+FILTER_PATTERNS        =
1082
+
1083
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
1084
+# INPUT_FILTER) will also be used to filter the input files that are used for
1085
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
1086
+# The default value is: NO.
1087
+
1088
+FILTER_SOURCE_FILES    = NO
1089
+
1090
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
1091
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
1092
+# it is also possible to disable source filtering for a specific pattern using
1093
+# *.ext= (so without naming a filter).
1094
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
1095
+
1096
+FILTER_SOURCE_PATTERNS =
1097
+
1098
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
1099
+# is part of the input, its contents will be placed on the main page
1100
+# (index.html). This can be useful if you have a project on for instance GitHub
1101
+# and want to reuse the introduction page also for the doxygen output.
1102
+
1103
+USE_MDFILE_AS_MAINPAGE =
1104
+
1105
+# The Fortran standard specifies that for fixed formatted Fortran code all
1106
+# characters from position 72 are to be considered as comment. A common
1107
+# extension is to allow longer lines before the automatic comment starts. The
1108
+# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
1109
+# be processed before the automatic comment starts.
1110
+# Minimum value: 7, maximum value: 10000, default value: 72.
1111
+
1112
+FORTRAN_COMMENT_AFTER  = 72
1113
+
1114
+#---------------------------------------------------------------------------
1115
+# Configuration options related to source browsing
1116
+#---------------------------------------------------------------------------
1117
+
1118
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
1119
+# generated. Documented entities will be cross-referenced with these sources.
1120
+#
1121
+# Note: To get rid of all source code in the generated output, make sure that
1122
+# also VERBATIM_HEADERS is set to NO.
1123
+# The default value is: NO.
1124
+
1125
+SOURCE_BROWSER         = YES
1126
+
1127
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
1128
+# classes and enums directly into the documentation.
1129
+# The default value is: NO.
1130
+
1131
+INLINE_SOURCES         = YES
1132
+
1133
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
1134
+# special comment blocks from generated source code fragments. Normal C, C++ and
1135
+# Fortran comments will always remain visible.
1136
+# The default value is: YES.
1137
+
1138
+STRIP_CODE_COMMENTS    = NO
1139
+
1140
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
1141
+# entity all documented functions referencing it will be listed.
1142
+# The default value is: NO.
1143
+
1144
+REFERENCED_BY_RELATION = YES
1145
+
1146
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
1147
+# all documented entities called/used by that function will be listed.
1148
+# The default value is: NO.
1149
+
1150
+REFERENCES_RELATION    = YES
1151
+
1152
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
1153
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
1154
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
1155
+# link to the documentation.
1156
+# The default value is: YES.
1157
+
1158
+REFERENCES_LINK_SOURCE = YES
1159
+
1160
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
1161
+# source code will show a tooltip with additional information such as prototype,
1162
+# brief description and links to the definition and documentation. Since this
1163
+# will make the HTML file larger and loading of large files a bit slower, you
1164
+# can opt to disable this feature.
1165
+# The default value is: YES.
1166
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
1167
+
1168
+SOURCE_TOOLTIPS        = YES
1169
+
1170
+# If the USE_HTAGS tag is set to YES then the references to source code will
1171
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
1172
+# source browser. The htags tool is part of GNU's global source tagging system
1173
+# (see https://www.gnu.org/software/global/global.html). You will need version
1174
+# 4.8.6 or higher.
1175
+#
1176
+# To use it do the following:
1177
+# - Install the latest version of global
1178
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
1179
+# - Make sure the INPUT points to the root of the source tree
1180
+# - Run doxygen as normal
1181
+#
1182
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
1183
+# tools must be available from the command line (i.e. in the search path).
1184
+#
1185
+# The result: instead of the source browser generated by doxygen, the links to
1186
+# source code will now point to the output of htags.
1187
+# The default value is: NO.
1188
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
1189
+
1190
+USE_HTAGS              = NO
1191
+
1192
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
1193
+# verbatim copy of the header file for each class for which an include is
1194
+# specified. Set to NO to disable this.
1195
+# See also: Section \class.
1196
+# The default value is: YES.
1197
+
1198
+VERBATIM_HEADERS       = YES
1199
+
1200
+#---------------------------------------------------------------------------
1201
+# Configuration options related to the alphabetical class index
1202
+#---------------------------------------------------------------------------
1203
+
1204
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
1205
+# compounds will be generated. Enable this if the project contains a lot of
1206
+# classes, structs, unions or interfaces.
1207
+# The default value is: YES.
1208
+
1209
+ALPHABETICAL_INDEX     = YES
1210
+
1211
+# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
1212
+# that should be ignored while generating the index headers. The IGNORE_PREFIX
1213
+# tag works for classes, function and member names. The entity will be placed in
1214
+# the alphabetical list under the first letter of the entity name that remains
1215
+# after removing the prefix.
1216
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
1217
+
1218
+IGNORE_PREFIX          =
1219
+
1220
+#---------------------------------------------------------------------------
1221
+# Configuration options related to the HTML output
1222
+#---------------------------------------------------------------------------
1223
+
1224
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
1225
+# The default value is: YES.
1226
+
1227
+GENERATE_HTML          = YES
1228
+
1229
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
1230
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1231
+# it.
1232
+# The default directory is: html.
1233
+# This tag requires that the tag GENERATE_HTML is set to YES.
1234
+
1235
+HTML_OUTPUT            =
1236
+
1237
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
1238
+# generated HTML page (for example: .htm, .php, .asp).
1239
+# The default value is: .html.
1240
+# This tag requires that the tag GENERATE_HTML is set to YES.
1241
+
1242
+HTML_FILE_EXTENSION    = .html
1243
+
1244
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
1245
+# each generated HTML page. If the tag is left blank doxygen will generate a
1246
+# standard header.
1247
+#
1248
+# To get valid HTML the header file that includes any scripts and style sheets
1249
+# that doxygen needs, which is dependent on the configuration options used (e.g.
1250
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
1251
+# default header using
1252
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
1253
+# YourConfigFile
1254
+# and then modify the file new_header.html. See also section "Doxygen usage"
1255
+# for information on how to generate the default header that doxygen normally
1256
+# uses.
1257
+# Note: The header is subject to change so you typically have to regenerate the
1258
+# default header when upgrading to a newer version of doxygen. For a description
1259
+# of the possible markers and block names see the documentation.
1260
+# This tag requires that the tag GENERATE_HTML is set to YES.
1261
+
1262
+HTML_HEADER            =
1263
+
1264
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
1265
+# generated HTML page. If the tag is left blank doxygen will generate a standard
1266
+# footer. See HTML_HEADER for more information on how to generate a default
1267
+# footer and what special commands can be used inside the footer. See also
1268
+# section "Doxygen usage" for information on how to generate the default footer
1269
+# that doxygen normally uses.
1270
+# This tag requires that the tag GENERATE_HTML is set to YES.
1271
+
1272
+HTML_FOOTER            =
1273
+
1274
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
1275
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
1276
+# the HTML output. If left blank doxygen will generate a default style sheet.
1277
+# See also section "Doxygen usage" for information on how to generate the style
1278
+# sheet that doxygen normally uses.
1279
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
1280
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
1281
+# obsolete.
1282
+# This tag requires that the tag GENERATE_HTML is set to YES.
1283
+
1284
+HTML_STYLESHEET        =
1285
+
1286
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
1287
+# cascading style sheets that are included after the standard style sheets
1288
+# created by doxygen. Using this option one can overrule certain style aspects.
1289
+# This is preferred over using HTML_STYLESHEET since it does not replace the
1290
+# standard style sheet and is therefore more robust against future updates.
1291
+# Doxygen will copy the style sheet files to the output directory.
1292
+# Note: The order of the extra style sheet files is of importance (e.g. the last
1293
+# style sheet in the list overrules the setting of the previous ones in the
1294
+# list).
1295
+# Note: Since the styling of scrollbars can currently not be overruled in
1296
+# Webkit/Chromium, the styling will be left out of the default doxygen.css if
1297
+# one or more extra stylesheets have been specified. So if scrollbar
1298
+# customization is desired it has to be added explicitly. For an example see the
1299
+# documentation.
1300
+# This tag requires that the tag GENERATE_HTML is set to YES.
1301
+
1302
+HTML_EXTRA_STYLESHEET  =
1303
+
1304
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
1305
+# other source files which should be copied to the HTML output directory. Note
1306
+# that these files will be copied to the base HTML output directory. Use the
1307
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
1308
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
1309
+# files will be copied as-is; there are no commands or markers available.
1310
+# This tag requires that the tag GENERATE_HTML is set to YES.
1311
+
1312
+HTML_EXTRA_FILES       =
1313
+
1314
+# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
1315
+# should be rendered with a dark or light theme.
1316
+# Possible values are: LIGHT always generate light mode output, DARK always
1317
+# generate dark mode output, AUTO_LIGHT automatically set the mode according to
1318
+# the user preference, use light mode if no preference is set (the default),
1319
+# AUTO_DARK automatically set the mode according to the user preference, use
1320
+# dark mode if no preference is set and TOGGLE allow to user to switch between
1321
+# light and dark mode via a button.
1322
+# The default value is: AUTO_LIGHT.
1323
+# This tag requires that the tag GENERATE_HTML is set to YES.
1324
+
1325
+HTML_COLORSTYLE        = AUTO_LIGHT
1326
+
1327
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
1328
+# will adjust the colors in the style sheet and background images according to
1329
+# this color. Hue is specified as an angle on a color-wheel, see
1330
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
1331
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
1332
+# purple, and 360 is red again.
1333
+# Minimum value: 0, maximum value: 359, default value: 220.
1334
+# This tag requires that the tag GENERATE_HTML is set to YES.
1335
+
1336
+HTML_COLORSTYLE_HUE    = 220
1337
+
1338
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
1339
+# in the HTML output. For a value of 0 the output will use gray-scales only. A
1340
+# value of 255 will produce the most vivid colors.
1341
+# Minimum value: 0, maximum value: 255, default value: 100.
1342
+# This tag requires that the tag GENERATE_HTML is set to YES.
1343
+
1344
+HTML_COLORSTYLE_SAT    = 100
1345
+
1346
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
1347
+# luminance component of the colors in the HTML output. Values below 100
1348
+# gradually make the output lighter, whereas values above 100 make the output
1349
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
1350
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
1351
+# change the gamma.
1352
+# Minimum value: 40, maximum value: 240, default value: 80.
1353
+# This tag requires that the tag GENERATE_HTML is set to YES.
1354
+
1355
+HTML_COLORSTYLE_GAMMA  = 80
1356
+
1357
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
1358
+# documentation will contain a main index with vertical navigation menus that
1359
+# are dynamically created via JavaScript. If disabled, the navigation index will
1360
+# consists of multiple levels of tabs that are statically embedded in every HTML
1361
+# page. Disable this option to support browsers that do not have JavaScript,
1362
+# like the Qt help browser.
1363
+# The default value is: YES.
1364
+# This tag requires that the tag GENERATE_HTML is set to YES.
1365
+
1366
+HTML_DYNAMIC_MENUS     = NO
1367
+
1368
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
1369
+# documentation will contain sections that can be hidden and shown after the
1370
+# page has loaded.
1371
+# The default value is: NO.
1372
+# This tag requires that the tag GENERATE_HTML is set to YES.
1373
+
1374
+HTML_DYNAMIC_SECTIONS  = NO
1375
+
1376
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
1377
+# shown in the various tree structured indices initially; the user can expand
1378
+# and collapse entries dynamically later on. Doxygen will expand the tree to
1379
+# such a level that at most the specified number of entries are visible (unless
1380
+# a fully collapsed tree already exceeds this amount). So setting the number of
1381
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
1382
+# representing an infinite number of entries and will result in a full expanded
1383
+# tree by default.
1384
+# Minimum value: 0, maximum value: 9999, default value: 100.
1385
+# This tag requires that the tag GENERATE_HTML is set to YES.
1386
+
1387
+HTML_INDEX_NUM_ENTRIES = 100
1388
+
1389
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
1390
+# generated that can be used as input for Apple's Xcode 3 integrated development
1391
+# environment (see:
1392
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
1393
+# create a documentation set, doxygen will generate a Makefile in the HTML
1394
+# output directory. Running make will produce the docset in that directory and
1395
+# running make install will install the docset in
1396
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
1397
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
1398
+# genXcode/_index.html for more information.
1399
+# The default value is: NO.
1400
+# This tag requires that the tag GENERATE_HTML is set to YES.
1401
+
1402
+GENERATE_DOCSET        = NO
1403
+
1404
+# This tag determines the name of the docset feed. A documentation feed provides
1405
+# an umbrella under which multiple documentation sets from a single provider
1406
+# (such as a company or product suite) can be grouped.
1407
+# The default value is: Doxygen generated docs.
1408
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
1409
+
1410
+DOCSET_FEEDNAME        = "Doxygen docs"
1411
+
1412
+# This tag determines the URL of the docset feed. A documentation feed provides
1413
+# an umbrella under which multiple documentation sets from a single provider
1414
+# (such as a company or product suite) can be grouped.
1415
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
1416
+
1417
+DOCSET_FEEDURL         =
1418
+
1419
+# This tag specifies a string that should uniquely identify the documentation
1420
+# set bundle. This should be a reverse domain-name style string, e.g.
1421
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
1422
+# The default value is: org.doxygen.Project.
1423
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
1424
+
1425
+DOCSET_BUNDLE_ID       = org.doxygen.Doxygen
1426
+
1427
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
1428
+# the documentation publisher. This should be a reverse domain-name style
1429
+# string, e.g. com.mycompany.MyDocSet.documentation.
1430
+# The default value is: org.doxygen.Publisher.
1431
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
1432
+
1433
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
1434
+
1435
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
1436
+# The default value is: Publisher.
1437
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
1438
+
1439
+DOCSET_PUBLISHER_NAME  = Publisher
1440
+
1441
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
1442
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
1443
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
1444
+# on Windows. In the beginning of 2021 Microsoft took the original page, with
1445
+# a.o. the download links, offline the HTML help workshop was already many years
1446
+# in maintenance mode). You can download the HTML help workshop from the web
1447
+# archives at Installation executable (see:
1448
+# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
1449
+# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
1450
+#
1451
+# The HTML Help Workshop contains a compiler that can convert all HTML output
1452
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
1453
+# files are now used as the Windows 98 help format, and will replace the old
1454
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
1455
+# HTML files also contain an index, a table of contents, and you can search for
1456
+# words in the documentation. The HTML workshop also contains a viewer for
1457
+# compressed HTML files.
1458
+# The default value is: NO.
1459
+# This tag requires that the tag GENERATE_HTML is set to YES.
1460
+
1461
+GENERATE_HTMLHELP      = NO
1462
+
1463
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
1464
+# file. You can add a path in front of the file if the result should not be
1465
+# written to the html output directory.
1466
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1467
+
1468
+CHM_FILE               =
1469
+
1470
+# The HHC_LOCATION tag can be used to specify the location (absolute path
1471
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
1472
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
1473
+# The file has to be specified with full path.
1474
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1475
+
1476
+HHC_LOCATION           =
1477
+
1478
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
1479
+# (YES) or that it should be included in the main .chm file (NO).
1480
+# The default value is: NO.
1481
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1482
+
1483
+GENERATE_CHI           = NO
1484
+
1485
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
1486
+# and project file content.
1487
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1488
+
1489
+CHM_INDEX_ENCODING     =
1490
+
1491
+# The BINARY_TOC flag controls whether a binary table of contents is generated
1492
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
1493
+# enables the Previous and Next buttons.
1494
+# The default value is: NO.
1495
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1496
+
1497
+BINARY_TOC             = NO
1498
+
1499
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
1500
+# the table of contents of the HTML help documentation and to the tree view.
1501
+# The default value is: NO.
1502
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1503
+
1504
+TOC_EXPAND             = NO
1505
+
1506
+# The SITEMAP_URL tag is used to specify the full URL of the place where the
1507
+# generated documentation will be placed on the server by the user during the
1508
+# deployment of the documentation. The generated sitemap is called sitemap.xml
1509
+# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL
1510
+# is specified no sitemap is generated. For information about the sitemap
1511
+# protocol see https://www.sitemaps.org
1512
+# This tag requires that the tag GENERATE_HTML is set to YES.
1513
+
1514
+SITEMAP_URL            =
1515
+
1516
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
1517
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
1518
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
1519
+# (.qch) of the generated HTML documentation.
1520
+# The default value is: NO.
1521
+# This tag requires that the tag GENERATE_HTML is set to YES.
1522
+
1523
+GENERATE_QHP           = NO
1524
+
1525
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
1526
+# the file name of the resulting .qch file. The path specified is relative to
1527
+# the HTML output folder.
1528
+# This tag requires that the tag GENERATE_QHP is set to YES.
1529
+
1530
+QCH_FILE               =
1531
+
1532
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
1533
+# Project output. For more information please see Qt Help Project / Namespace
1534
+# (see:
1535
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
1536
+# The default value is: org.doxygen.Project.
1537
+# This tag requires that the tag GENERATE_QHP is set to YES.
1538
+
1539
+QHP_NAMESPACE          = org.doxygen.Project
1540
+
1541
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
1542
+# Help Project output. For more information please see Qt Help Project / Virtual
1543
+# Folders (see:
1544
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
1545
+# The default value is: doc.
1546
+# This tag requires that the tag GENERATE_QHP is set to YES.
1547
+
1548
+QHP_VIRTUAL_FOLDER     = doc
1549
+
1550
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
1551
+# filter to add. For more information please see Qt Help Project / Custom
1552
+# Filters (see:
1553
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
1554
+# This tag requires that the tag GENERATE_QHP is set to YES.
1555
+
1556
+QHP_CUST_FILTER_NAME   =
1557
+
1558
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
1559
+# custom filter to add. For more information please see Qt Help Project / Custom
1560
+# Filters (see:
1561
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
1562
+# This tag requires that the tag GENERATE_QHP is set to YES.
1563
+
1564
+QHP_CUST_FILTER_ATTRS  =
1565
+
1566
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1567
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
1568
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
1569
+# This tag requires that the tag GENERATE_QHP is set to YES.
1570
+
1571
+QHP_SECT_FILTER_ATTRS  =
1572
+
1573
+# The QHG_LOCATION tag can be used to specify the location (absolute path
1574
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
1575
+# run qhelpgenerator on the generated .qhp file.
1576
+# This tag requires that the tag GENERATE_QHP is set to YES.
1577
+
1578
+QHG_LOCATION           =
1579
+
1580
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
1581
+# generated, together with the HTML files, they form an Eclipse help plugin. To
1582
+# install this plugin and make it available under the help contents menu in
1583
+# Eclipse, the contents of the directory containing the HTML and XML files needs
1584
+# to be copied into the plugins directory of eclipse. The name of the directory
1585
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
1586
+# After copying Eclipse needs to be restarted before the help appears.
1587
+# The default value is: NO.
1588
+# This tag requires that the tag GENERATE_HTML is set to YES.
1589
+
1590
+GENERATE_ECLIPSEHELP   = NO
1591
+
1592
+# A unique identifier for the Eclipse help plugin. When installing the plugin
1593
+# the directory name containing the HTML and XML files should also have this
1594
+# name. Each documentation set should have its own identifier.
1595
+# The default value is: org.doxygen.Project.
1596
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
1597
+
1598
+ECLIPSE_DOC_ID         = org.doxygen.Project
1599
+
1600
+# If you want full control over the layout of the generated HTML pages it might
1601
+# be necessary to disable the index and replace it with your own. The
1602
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
1603
+# of each HTML page. A value of NO enables the index and the value YES disables
1604
+# it. Since the tabs in the index contain the same information as the navigation
1605
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
1606
+# The default value is: NO.
1607
+# This tag requires that the tag GENERATE_HTML is set to YES.
1608
+
1609
+DISABLE_INDEX          = NO
1610
+
1611
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1612
+# structure should be generated to display hierarchical information. If the tag
1613
+# value is set to YES, a side panel will be generated containing a tree-like
1614
+# index structure (just like the one that is generated for HTML Help). For this
1615
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
1616
+# (i.e. any modern browser). Windows users are probably better off using the
1617
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
1618
+# further fine tune the look of the index (see "Fine-tuning the output"). As an
1619
+# example, the default style sheet generated by doxygen has an example that
1620
+# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
1621
+# Since the tree basically has the same information as the tab index, you could
1622
+# consider setting DISABLE_INDEX to YES when enabling this option.
1623
+# The default value is: NO.
1624
+# This tag requires that the tag GENERATE_HTML is set to YES.
1625
+
1626
+GENERATE_TREEVIEW      = YES
1627
+
1628
+# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
1629
+# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
1630
+# area (value NO) or if it should extend to the full height of the window (value
1631
+# YES). Setting this to YES gives a layout similar to
1632
+# https://docs.readthedocs.io with more room for contents, but less room for the
1633
+# project logo, title, and description. If either GENERATE_TREEVIEW or
1634
+# DISABLE_INDEX is set to NO, this option has no effect.
1635
+# The default value is: NO.
1636
+# This tag requires that the tag GENERATE_HTML is set to YES.
1637
+
1638
+FULL_SIDEBAR           = NO
1639
+
1640
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
1641
+# doxygen will group on one line in the generated HTML documentation.
1642
+#
1643
+# Note that a value of 0 will completely suppress the enum values from appearing
1644
+# in the overview section.
1645
+# Minimum value: 0, maximum value: 20, default value: 4.
1646
+# This tag requires that the tag GENERATE_HTML is set to YES.
1647
+
1648
+ENUM_VALUES_PER_LINE   = 4
1649
+
1650
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
1651
+# to set the initial width (in pixels) of the frame in which the tree is shown.
1652
+# Minimum value: 0, maximum value: 1500, default value: 250.
1653
+# This tag requires that the tag GENERATE_HTML is set to YES.
1654
+
1655
+TREEVIEW_WIDTH         = 250
1656
+
1657
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
1658
+# external symbols imported via tag files in a separate window.
1659
+# The default value is: NO.
1660
+# This tag requires that the tag GENERATE_HTML is set to YES.
1661
+
1662
+EXT_LINKS_IN_WINDOW    = NO
1663
+
1664
+# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
1665
+# addresses.
1666
+# The default value is: YES.
1667
+# This tag requires that the tag GENERATE_HTML is set to YES.
1668
+
1669
+OBFUSCATE_EMAILS       = YES
1670
+
1671
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
1672
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
1673
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
1674
+# the HTML output. These images will generally look nicer at scaled resolutions.
1675
+# Possible values are: png (the default) and svg (looks nicer but requires the
1676
+# pdf2svg or inkscape tool).
1677
+# The default value is: png.
1678
+# This tag requires that the tag GENERATE_HTML is set to YES.
1679
+
1680
+HTML_FORMULA_FORMAT    = png
1681
+
1682
+# Use this tag to change the font size of LaTeX formulas included as images in
1683
+# the HTML documentation. When you change the font size after a successful
1684
+# doxygen run you need to manually remove any form_*.png images from the HTML
1685
+# output directory to force them to be regenerated.
1686
+# Minimum value: 8, maximum value: 50, default value: 10.
1687
+# This tag requires that the tag GENERATE_HTML is set to YES.
1688
+
1689
+FORMULA_FONTSIZE       = 10
1690
+
1691
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
1692
+# to create new LaTeX commands to be used in formulas as building blocks. See
1693
+# the section "Including formulas" for details.
1694
+
1695
+FORMULA_MACROFILE      =
1696
+
1697
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
1698
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
1699
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
1700
+# installed or if you want to formulas look prettier in the HTML output. When
1701
+# enabled you may also need to install MathJax separately and configure the path
1702
+# to it using the MATHJAX_RELPATH option.
1703
+# The default value is: NO.
1704
+# This tag requires that the tag GENERATE_HTML is set to YES.
1705
+
1706
+USE_MATHJAX            = NO
1707
+
1708
+# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
1709
+# Note that the different versions of MathJax have different requirements with
1710
+# regards to the different settings, so it is possible that also other MathJax
1711
+# settings have to be changed when switching between the different MathJax
1712
+# versions.
1713
+# Possible values are: MathJax_2 and MathJax_3.
1714
+# The default value is: MathJax_2.
1715
+# This tag requires that the tag USE_MATHJAX is set to YES.
1716
+
1717
+MATHJAX_VERSION        = MathJax_2
1718
+
1719
+# When MathJax is enabled you can set the default output format to be used for
1720
+# the MathJax output. For more details about the output format see MathJax
1721
+# version 2 (see:
1722
+# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
1723
+# (see:
1724
+# http://docs.mathjax.org/en/latest/web/components/output.html).
1725
+# Possible values are: HTML-CSS (which is slower, but has the best
1726
+# compatibility. This is the name for Mathjax version 2, for MathJax version 3
1727
+# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
1728
+# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
1729
+# is the name for Mathjax version 3, for MathJax version 2 this will be
1730
+# translated into HTML-CSS) and SVG.
1731
+# The default value is: HTML-CSS.
1732
+# This tag requires that the tag USE_MATHJAX is set to YES.
1733
+
1734
+MATHJAX_FORMAT         = HTML-CSS
1735
+
1736
+# When MathJax is enabled you need to specify the location relative to the HTML
1737
+# output directory using the MATHJAX_RELPATH option. The destination directory
1738
+# should contain the MathJax.js script. For instance, if the mathjax directory
1739
+# is located at the same level as the HTML output directory, then
1740
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
1741
+# Content Delivery Network so you can quickly see the result without installing
1742
+# MathJax. However, it is strongly recommended to install a local copy of
1743
+# MathJax from https://www.mathjax.org before deployment. The default value is:
1744
+# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
1745
+# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
1746
+# This tag requires that the tag USE_MATHJAX is set to YES.
1747
+
1748
+MATHJAX_RELPATH        =
1749
+
1750
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
1751
+# extension names that should be enabled during MathJax rendering. For example
1752
+# for MathJax version 2 (see
1753
+# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
1754
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
1755
+# For example for MathJax version 3 (see
1756
+# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
1757
+# MATHJAX_EXTENSIONS = ams
1758
+# This tag requires that the tag USE_MATHJAX is set to YES.
1759
+
1760
+MATHJAX_EXTENSIONS     =
1761
+
1762
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
1763
+# of code that will be used on startup of the MathJax code. See the MathJax site
1764
+# (see:
1765
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
1766
+# example see the documentation.
1767
+# This tag requires that the tag USE_MATHJAX is set to YES.
1768
+
1769
+MATHJAX_CODEFILE       =
1770
+
1771
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
1772
+# the HTML output. The underlying search engine uses javascript and DHTML and
1773
+# should work on any modern browser. Note that when using HTML help
1774
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
1775
+# there is already a search function so this one should typically be disabled.
1776
+# For large projects the javascript based search engine can be slow, then
1777
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
1778
+# search using the keyboard; to jump to the search box use <access key> + S
1779
+# (what the <access key> is depends on the OS and browser, but it is typically
1780
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
1781
+# key> to jump into the search results window, the results can be navigated
1782
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
1783
+# the search. The filter options can be selected when the cursor is inside the
1784
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
1785
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
1786
+# option.
1787
+# The default value is: YES.
1788
+# This tag requires that the tag GENERATE_HTML is set to YES.
1789
+
1790
+SEARCHENGINE           = NO
1791
+
1792
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1793
+# implemented using a web server instead of a web client using JavaScript. There
1794
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
1795
+# setting. When disabled, doxygen will generate a PHP script for searching and
1796
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
1797
+# and searching needs to be provided by external tools. See the section
1798
+# "External Indexing and Searching" for details.
1799
+# The default value is: NO.
1800
+# This tag requires that the tag SEARCHENGINE is set to YES.
1801
+
1802
+SERVER_BASED_SEARCH    = NO
1803
+
1804
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
1805
+# script for searching. Instead the search results are written to an XML file
1806
+# which needs to be processed by an external indexer. Doxygen will invoke an
1807
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
1808
+# search results.
1809
+#
1810
+# Doxygen ships with an example indexer (doxyindexer) and search engine
1811
+# (doxysearch.cgi) which are based on the open source search engine library
1812
+# Xapian (see:
1813
+# https://xapian.org/).
1814
+#
1815
+# See the section "External Indexing and Searching" for details.
1816
+# The default value is: NO.
1817
+# This tag requires that the tag SEARCHENGINE is set to YES.
1818
+
1819
+EXTERNAL_SEARCH        = NO
1820
+
1821
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
1822
+# which will return the search results when EXTERNAL_SEARCH is enabled.
1823
+#
1824
+# Doxygen ships with an example indexer (doxyindexer) and search engine
1825
+# (doxysearch.cgi) which are based on the open source search engine library
1826
+# Xapian (see:
1827
+# https://xapian.org/). See the section "External Indexing and Searching" for
1828
+# details.
1829
+# This tag requires that the tag SEARCHENGINE is set to YES.
1830
+
1831
+SEARCHENGINE_URL       =
1832
+
1833
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
1834
+# search data is written to a file for indexing by an external tool. With the
1835
+# SEARCHDATA_FILE tag the name of this file can be specified.
1836
+# The default file is: searchdata.xml.
1837
+# This tag requires that the tag SEARCHENGINE is set to YES.
1838
+
1839
+SEARCHDATA_FILE        = searchdata.xml
1840
+
1841
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
1842
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
1843
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
1844
+# projects and redirect the results back to the right project.
1845
+# This tag requires that the tag SEARCHENGINE is set to YES.
1846
+
1847
+EXTERNAL_SEARCH_ID     =
1848
+
1849
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
1850
+# projects other than the one defined by this configuration file, but that are
1851
+# all added to the same external search index. Each project needs to have a
1852
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
1853
+# to a relative location where the documentation can be found. The format is:
1854
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
1855
+# This tag requires that the tag SEARCHENGINE is set to YES.
1856
+
1857
+EXTRA_SEARCH_MAPPINGS  =
1858
+
1859
+#---------------------------------------------------------------------------
1860
+# Configuration options related to the LaTeX output
1861
+#---------------------------------------------------------------------------
1862
+
1863
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
1864
+# The default value is: YES.
1865
+
1866
+GENERATE_LATEX         = NO
1867
+
1868
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
1869
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1870
+# it.
1871
+# The default directory is: latex.
1872
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1873
+
1874
+LATEX_OUTPUT           = latex
1875
+
1876
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1877
+# invoked.
1878
+#
1879
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
1880
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
1881
+# chosen this is overwritten by pdflatex. For specific output languages the
1882
+# default can have been set differently, this depends on the implementation of
1883
+# the output language.
1884
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1885
+
1886
+LATEX_CMD_NAME         =
1887
+
1888
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
1889
+# index for LaTeX.
1890
+# Note: This tag is used in the Makefile / make.bat.
1891
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
1892
+# (.tex).
1893
+# The default file is: makeindex.
1894
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1895
+
1896
+MAKEINDEX_CMD_NAME     = makeindex
1897
+
1898
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
1899
+# generate index for LaTeX. In case there is no backslash (\) as first character
1900
+# it will be automatically added in the LaTeX code.
1901
+# Note: This tag is used in the generated output file (.tex).
1902
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
1903
+# The default value is: makeindex.
1904
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1905
+
1906
+LATEX_MAKEINDEX_CMD    = makeindex
1907
+
1908
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
1909
+# documents. This may be useful for small projects and may help to save some
1910
+# trees in general.
1911
+# The default value is: NO.
1912
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1913
+
1914
+COMPACT_LATEX          = NO
1915
+
1916
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
1917
+# printer.
1918
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
1919
+# 14 inches) and executive (7.25 x 10.5 inches).
1920
+# The default value is: a4.
1921
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1922
+
1923
+PAPER_TYPE             = a4
1924
+
1925
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
1926
+# that should be included in the LaTeX output. The package can be specified just
1927
+# by its name or with the correct syntax as to be used with the LaTeX
1928
+# \usepackage command. To get the times font for instance you can specify :
1929
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
1930
+# To use the option intlimits with the amsmath package you can specify:
1931
+# EXTRA_PACKAGES=[intlimits]{amsmath}
1932
+# If left blank no extra packages will be included.
1933
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1934
+
1935
+EXTRA_PACKAGES         =
1936
+
1937
+# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
1938
+# the generated LaTeX document. The header should contain everything until the
1939
+# first chapter. If it is left blank doxygen will generate a standard header. It
1940
+# is highly recommended to start with a default header using
1941
+# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
1942
+# and then modify the file new_header.tex. See also section "Doxygen usage" for
1943
+# information on how to generate the default header that doxygen normally uses.
1944
+#
1945
+# Note: Only use a user-defined header if you know what you are doing!
1946
+# Note: The header is subject to change so you typically have to regenerate the
1947
+# default header when upgrading to a newer version of doxygen. The following
1948
+# commands have a special meaning inside the header (and footer): For a
1949
+# description of the possible markers and block names see the documentation.
1950
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1951
+
1952
+LATEX_HEADER           =
1953
+
1954
+# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
1955
+# the generated LaTeX document. The footer should contain everything after the
1956
+# last chapter. If it is left blank doxygen will generate a standard footer. See
1957
+# LATEX_HEADER for more information on how to generate a default footer and what
1958
+# special commands can be used inside the footer. See also section "Doxygen
1959
+# usage" for information on how to generate the default footer that doxygen
1960
+# normally uses. Note: Only use a user-defined footer if you know what you are
1961
+# doing!
1962
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1963
+
1964
+LATEX_FOOTER           =
1965
+
1966
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
1967
+# LaTeX style sheets that are included after the standard style sheets created
1968
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
1969
+# will copy the style sheet files to the output directory.
1970
+# Note: The order of the extra style sheet files is of importance (e.g. the last
1971
+# style sheet in the list overrules the setting of the previous ones in the
1972
+# list).
1973
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1974
+
1975
+LATEX_EXTRA_STYLESHEET =
1976
+
1977
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
1978
+# other source files which should be copied to the LATEX_OUTPUT output
1979
+# directory. Note that the files will be copied as-is; there are no commands or
1980
+# markers available.
1981
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1982
+
1983
+LATEX_EXTRA_FILES      =
1984
+
1985
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
1986
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
1987
+# contain links (just like the HTML output) instead of page references. This
1988
+# makes the output suitable for online browsing using a PDF viewer.
1989
+# The default value is: YES.
1990
+# This tag requires that the tag GENERATE_LATEX is set to YES.
1991
+
1992
+PDF_HYPERLINKS         = YES
1993
+
1994
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
1995
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
1996
+# files. Set this option to YES, to get a higher quality PDF documentation.
1997
+#
1998
+# See also section LATEX_CMD_NAME for selecting the engine.
1999
+# The default value is: YES.
2000
+# This tag requires that the tag GENERATE_LATEX is set to YES.
2001
+
2002
+USE_PDFLATEX           = YES
2003
+
2004
+# The LATEX_BATCHMODE tag ignals the behavior of LaTeX in case of an error.
2005
+# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch
2006
+# mode nothing is printed on the terminal, errors are scrolled as if <return> is
2007
+# hit at every error; missing files that TeX tries to input or request from
2008
+# keyboard input (\read on a not open input stream) cause the job to abort,
2009
+# NON_STOP In nonstop mode the diagnostic message will appear on the terminal,
2010
+# but there is no possibility of user interaction just like in batch mode,
2011
+# SCROLL In scroll mode, TeX will stop only for missing files to input or if
2012
+# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at
2013
+# each error, asking for user intervention.
2014
+# The default value is: NO.
2015
+# This tag requires that the tag GENERATE_LATEX is set to YES.
2016
+
2017
+LATEX_BATCHMODE        = NO
2018
+
2019
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
2020
+# index chapters (such as File Index, Compound Index, etc.) in the output.
2021
+# The default value is: NO.
2022
+# This tag requires that the tag GENERATE_LATEX is set to YES.
2023
+
2024
+LATEX_HIDE_INDICES     = NO
2025
+
2026
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
2027
+# bibliography, e.g. plainnat, or ieeetr. See
2028
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
2029
+# The default value is: plain.
2030
+# This tag requires that the tag GENERATE_LATEX is set to YES.
2031
+
2032
+LATEX_BIB_STYLE        = plain
2033
+
2034
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
2035
+# path from which the emoji images will be read. If a relative path is entered,
2036
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
2037
+# LATEX_OUTPUT directory will be used.
2038
+# This tag requires that the tag GENERATE_LATEX is set to YES.
2039
+
2040
+LATEX_EMOJI_DIRECTORY  =
2041
+
2042
+#---------------------------------------------------------------------------
2043
+# Configuration options related to the RTF output
2044
+#---------------------------------------------------------------------------
2045
+
2046
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
2047
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
2048
+# readers/editors.
2049
+# The default value is: NO.
2050
+
2051
+GENERATE_RTF           = NO
2052
+
2053
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
2054
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
2055
+# it.
2056
+# The default directory is: rtf.
2057
+# This tag requires that the tag GENERATE_RTF is set to YES.
2058
+
2059
+RTF_OUTPUT             =
2060
+
2061
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
2062
+# documents. This may be useful for small projects and may help to save some
2063
+# trees in general.
2064
+# The default value is: NO.
2065
+# This tag requires that the tag GENERATE_RTF is set to YES.
2066
+
2067
+COMPACT_RTF            = NO
2068
+
2069
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
2070
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
2071
+# output) instead of page references. This makes the output suitable for online
2072
+# browsing using Word or some other Word compatible readers that support those
2073
+# fields.
2074
+#
2075
+# Note: WordPad (write) and others do not support links.
2076
+# The default value is: NO.
2077
+# This tag requires that the tag GENERATE_RTF is set to YES.
2078
+
2079
+RTF_HYPERLINKS         = NO
2080
+
2081
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
2082
+# configuration file, i.e. a series of assignments. You only have to provide
2083
+# replacements, missing definitions are set to their default value.
2084
+#
2085
+# See also section "Doxygen usage" for information on how to generate the
2086
+# default style sheet that doxygen normally uses.
2087
+# This tag requires that the tag GENERATE_RTF is set to YES.
2088
+
2089
+RTF_STYLESHEET_FILE    =
2090
+
2091
+# Set optional variables used in the generation of an RTF document. Syntax is
2092
+# similar to doxygen's configuration file. A template extensions file can be
2093
+# generated using doxygen -e rtf extensionFile.
2094
+# This tag requires that the tag GENERATE_RTF is set to YES.
2095
+
2096
+RTF_EXTENSIONS_FILE    =
2097
+
2098
+#---------------------------------------------------------------------------
2099
+# Configuration options related to the man page output
2100
+#---------------------------------------------------------------------------
2101
+
2102
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
2103
+# classes and files.
2104
+# The default value is: NO.
2105
+
2106
+GENERATE_MAN           = NO
2107
+
2108
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
2109
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
2110
+# it. A directory man3 will be created inside the directory specified by
2111
+# MAN_OUTPUT.
2112
+# The default directory is: man.
2113
+# This tag requires that the tag GENERATE_MAN is set to YES.
2114
+
2115
+MAN_OUTPUT             =
2116
+
2117
+# The MAN_EXTENSION tag determines the extension that is added to the generated
2118
+# man pages. In case the manual section does not start with a number, the number
2119
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
2120
+# optional.
2121
+# The default value is: .3.
2122
+# This tag requires that the tag GENERATE_MAN is set to YES.
2123
+
2124
+MAN_EXTENSION          = .3
2125
+
2126
+# The MAN_SUBDIR tag determines the name of the directory created within
2127
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
2128
+# MAN_EXTENSION with the initial . removed.
2129
+# This tag requires that the tag GENERATE_MAN is set to YES.
2130
+
2131
+MAN_SUBDIR             =
2132
+
2133
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
2134
+# will generate one additional man file for each entity documented in the real
2135
+# man page(s). These additional files only source the real man page, but without
2136
+# them the man command would be unable to find the correct page.
2137
+# The default value is: NO.
2138
+# This tag requires that the tag GENERATE_MAN is set to YES.
2139
+
2140
+MAN_LINKS              = NO
2141
+
2142
+#---------------------------------------------------------------------------
2143
+# Configuration options related to the XML output
2144
+#---------------------------------------------------------------------------
2145
+
2146
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
2147
+# captures the structure of the code including all documentation.
2148
+# The default value is: NO.
2149
+
2150
+GENERATE_XML           = NO
2151
+
2152
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
2153
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
2154
+# it.
2155
+# The default directory is: xml.
2156
+# This tag requires that the tag GENERATE_XML is set to YES.
2157
+
2158
+XML_OUTPUT             = xml
2159
+
2160
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
2161
+# listings (including syntax highlighting and cross-referencing information) to
2162
+# the XML output. Note that enabling this will significantly increase the size
2163
+# of the XML output.
2164
+# The default value is: YES.
2165
+# This tag requires that the tag GENERATE_XML is set to YES.
2166
+
2167
+XML_PROGRAMLISTING     = YES
2168
+
2169
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
2170
+# namespace members in file scope as well, matching the HTML output.
2171
+# The default value is: NO.
2172
+# This tag requires that the tag GENERATE_XML is set to YES.
2173
+
2174
+XML_NS_MEMB_FILE_SCOPE = NO
2175
+
2176
+#---------------------------------------------------------------------------
2177
+# Configuration options related to the DOCBOOK output
2178
+#---------------------------------------------------------------------------
2179
+
2180
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
2181
+# that can be used to generate PDF.
2182
+# The default value is: NO.
2183
+
2184
+GENERATE_DOCBOOK       = NO
2185
+
2186
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
2187
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
2188
+# front of it.
2189
+# The default directory is: docbook.
2190
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
2191
+
2192
+DOCBOOK_OUTPUT         = docbook
2193
+
2194
+#---------------------------------------------------------------------------
2195
+# Configuration options for the AutoGen Definitions output
2196
+#---------------------------------------------------------------------------
2197
+
2198
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
2199
+# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures
2200
+# the structure of the code including all documentation. Note that this feature
2201
+# is still experimental and incomplete at the moment.
2202
+# The default value is: NO.
2203
+
2204
+GENERATE_AUTOGEN_DEF   = NO
2205
+
2206
+#---------------------------------------------------------------------------
2207
+# Configuration options related to the Perl module output
2208
+#---------------------------------------------------------------------------
2209
+
2210
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
2211
+# file that captures the structure of the code including all documentation.
2212
+#
2213
+# Note that this feature is still experimental and incomplete at the moment.
2214
+# The default value is: NO.
2215
+
2216
+GENERATE_PERLMOD       = NO
2217
+
2218
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
2219
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
2220
+# output from the Perl module output.
2221
+# The default value is: NO.
2222
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
2223
+
2224
+PERLMOD_LATEX          = NO
2225
+
2226
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
2227
+# formatted so it can be parsed by a human reader. This is useful if you want to
2228
+# understand what is going on. On the other hand, if this tag is set to NO, the
2229
+# size of the Perl module output will be much smaller and Perl will parse it
2230
+# just the same.
2231
+# The default value is: YES.
2232
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
2233
+
2234
+PERLMOD_PRETTY         = YES
2235
+
2236
+# The names of the make variables in the generated doxyrules.make file are
2237
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
2238
+# so different doxyrules.make files included by the same Makefile don't
2239
+# overwrite each other's variables.
2240
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
2241
+
2242
+PERLMOD_MAKEVAR_PREFIX =
2243
+
2244
+#---------------------------------------------------------------------------
2245
+# Configuration options related to the preprocessor
2246
+#---------------------------------------------------------------------------
2247
+
2248
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
2249
+# C-preprocessor directives found in the sources and include files.
2250
+# The default value is: YES.
2251
+
2252
+ENABLE_PREPROCESSING   = YES
2253
+
2254
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
2255
+# in the source code. If set to NO, only conditional compilation will be
2256
+# performed. Macro expansion can be done in a controlled way by setting
2257
+# EXPAND_ONLY_PREDEF to YES.
2258
+# The default value is: NO.
2259
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2260
+
2261
+MACRO_EXPANSION        = YES
2262
+
2263
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
2264
+# the macro expansion is limited to the macros specified with the PREDEFINED and
2265
+# EXPAND_AS_DEFINED tags.
2266
+# The default value is: NO.
2267
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2268
+
2269
+EXPAND_ONLY_PREDEF     = YES
2270
+
2271
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
2272
+# INCLUDE_PATH will be searched if a #include is found.
2273
+# The default value is: YES.
2274
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2275
+
2276
+SEARCH_INCLUDES        = NO
2277
+
2278
+# The INCLUDE_PATH tag can be used to specify one or more directories that
2279
+# contain include files that are not input files but should be processed by the
2280
+# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of
2281
+# RECURSIVE has no effect here.
2282
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
2283
+
2284
+INCLUDE_PATH           =
2285
+
2286
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
2287
+# patterns (like *.h and *.hpp) to filter out the header-files in the
2288
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
2289
+# used.
2290
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2291
+
2292
+INCLUDE_FILE_PATTERNS  =
2293
+
2294
+# The PREDEFINED tag can be used to specify one or more macro names that are
2295
+# defined before the preprocessor is started (similar to the -D option of e.g.
2296
+# gcc). The argument of the tag is a list of macros of the form: name or
2297
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
2298
+# is assumed. To prevent a macro definition from being undefined via #undef or
2299
+# recursively expanded use the := operator instead of the = operator.
2300
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2301
+
2302
+PREDEFINED             =
2303
+
2304
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
2305
+# tag can be used to specify a list of macro names that should be expanded. The
2306
+# macro definition that is found in the sources will be used. Use the PREDEFINED
2307
+# tag if you want to use a different macro definition that overrules the
2308
+# definition found in the source code.
2309
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2310
+
2311
+EXPAND_AS_DEFINED      =
2312
+
2313
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
2314
+# remove all references to function-like macros that are alone on a line, have
2315
+# an all uppercase name, and do not end with a semicolon. Such function macros
2316
+# are typically used for boiler-plate code, and will confuse the parser if not
2317
+# removed.
2318
+# The default value is: YES.
2319
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2320
+
2321
+SKIP_FUNCTION_MACROS   = YES
2322
+
2323
+#---------------------------------------------------------------------------
2324
+# Configuration options related to external references
2325
+#---------------------------------------------------------------------------
2326
+
2327
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
2328
+# file the location of the external documentation should be added. The format of
2329
+# a tag file without this location is as follows:
2330
+# TAGFILES = file1 file2 ...
2331
+# Adding location for the tag files is done as follows:
2332
+# TAGFILES = file1=loc1 "file2 = loc2" ...
2333
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
2334
+# section "Linking to external documentation" for more information about the use
2335
+# of tag files.
2336
+# Note: Each tag file must have a unique name (where the name does NOT include
2337
+# the path). If a tag file is not located in the directory in which doxygen is
2338
+# run, you must also specify the path to the tagfile here.
2339
+
2340
+TAGFILES               =
2341
+
2342
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
2343
+# tag file that is based on the input files it reads. See section "Linking to
2344
+# external documentation" for more information about the usage of tag files.
2345
+
2346
+GENERATE_TAGFILE       = doxygen.tag
2347
+
2348
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
2349
+# the class index. If set to NO, only the inherited external classes will be
2350
+# listed.
2351
+# The default value is: NO.
2352
+
2353
+ALLEXTERNALS           = NO
2354
+
2355
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
2356
+# in the modules index. If set to NO, only the current project's groups will be
2357
+# listed.
2358
+# The default value is: YES.
2359
+
2360
+EXTERNAL_GROUPS        = YES
2361
+
2362
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
2363
+# the related pages index. If set to NO, only the current project's pages will
2364
+# be listed.
2365
+# The default value is: YES.
2366
+
2367
+EXTERNAL_PAGES         = YES
2368
+
2369
+#---------------------------------------------------------------------------
2370
+# Configuration options related to diagram generator tools
2371
+#---------------------------------------------------------------------------
2372
+
2373
+# If set to YES the inheritance and collaboration graphs will hide inheritance
2374
+# and usage relations if the target is undocumented or is not a class.
2375
+# The default value is: YES.
2376
+
2377
+HIDE_UNDOC_RELATIONS   = NO
2378
+
2379
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
2380
+# available from the path. This tool is part of Graphviz (see:
2381
+# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
2382
+# Bell Labs. The other options in this section have no effect if this option is
2383
+# set to NO
2384
+# The default value is: NO.
2385
+
2386
+HAVE_DOT               = YES
2387
+
2388
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
2389
+# to run in parallel. When set to 0 doxygen will base this on the number of
2390
+# processors available in the system. You can set it explicitly to a value
2391
+# larger than 0 to get control over the balance between CPU load and processing
2392
+# speed.
2393
+# Minimum value: 0, maximum value: 32, default value: 0.
2394
+# This tag requires that the tag HAVE_DOT is set to YES.
2395
+
2396
+DOT_NUM_THREADS        = 1
2397
+
2398
+# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
2399
+# subgraphs. When you want a differently looking font in the dot files that
2400
+# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
2401
+# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,
2402
+# Edge and Graph Attributes specification</a> You need to make sure dot is able
2403
+# to find the font, which can be done by putting it in a standard location or by
2404
+# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
2405
+# directory containing the font. Default graphviz fontsize is 14.
2406
+# The default value is: fontname=Helvetica,fontsize=10.
2407
+# This tag requires that the tag HAVE_DOT is set to YES.
2408
+
2409
+DOT_COMMON_ATTR        = "fontname=Helvetica,fontsize=10"
2410
+
2411
+# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
2412
+# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a
2413
+# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about
2414
+# arrows shapes.</a>
2415
+# The default value is: labelfontname=Helvetica,labelfontsize=10.
2416
+# This tag requires that the tag HAVE_DOT is set to YES.
2417
+
2418
+DOT_EDGE_ATTR          = "labelfontname=Helvetica,labelfontsize=10"
2419
+
2420
+# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
2421
+# around nodes set 'shape=plain' or 'shape=plaintext' <a
2422
+# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>
2423
+# The default value is: shape=box,height=0.2,width=0.4.
2424
+# This tag requires that the tag HAVE_DOT is set to YES.
2425
+
2426
+DOT_NODE_ATTR          = "shape=box,height=0.2,width=0.4"
2427
+
2428
+# You can set the path where dot can find font specified with fontname in
2429
+# DOT_COMMON_ATTR and others dot attributes.
2430
+# This tag requires that the tag HAVE_DOT is set to YES.
2431
+
2432
+DOT_FONTPATH           =
2433
+
2434
+# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will
2435
+# generate a graph for each documented class showing the direct and indirect
2436
+# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and
2437
+# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case
2438
+# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the
2439
+# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used.
2440
+# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance
2441
+# relations will be shown as texts / links.
2442
+# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN.
2443
+# The default value is: YES.
2444
+
2445
+CLASS_GRAPH            = YES
2446
+
2447
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
2448
+# graph for each documented class showing the direct and indirect implementation
2449
+# dependencies (inheritance, containment, and class references variables) of the
2450
+# class with other documented classes.
2451
+# The default value is: YES.
2452
+# This tag requires that the tag HAVE_DOT is set to YES.
2453
+
2454
+COLLABORATION_GRAPH    = YES
2455
+
2456
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
2457
+# groups, showing the direct groups dependencies. See also the chapter Grouping
2458
+# in the manual.
2459
+# The default value is: YES.
2460
+# This tag requires that the tag HAVE_DOT is set to YES.
2461
+
2462
+GROUP_GRAPHS           = YES
2463
+
2464
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
2465
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
2466
+# Language.
2467
+# The default value is: NO.
2468
+# This tag requires that the tag HAVE_DOT is set to YES.
2469
+
2470
+UML_LOOK               = NO
2471
+
2472
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
2473
+# class node. If there are many fields or methods and many nodes the graph may
2474
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
2475
+# number of items for each type to make the size more manageable. Set this to 0
2476
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
2477
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
2478
+# but if the number exceeds 15, the total amount of fields shown is limited to
2479
+# 10.
2480
+# Minimum value: 0, maximum value: 100, default value: 10.
2481
+# This tag requires that the tag UML_LOOK is set to YES.
2482
+
2483
+UML_LIMIT_NUM_FIELDS   = 10
2484
+
2485
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
2486
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
2487
+# tag is set to YES, doxygen will add type and arguments for attributes and
2488
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
2489
+# will not generate fields with class member information in the UML graphs. The
2490
+# class diagrams will look similar to the default class diagrams but using UML
2491
+# notation for the relationships.
2492
+# Possible values are: NO, YES and NONE.
2493
+# The default value is: NO.
2494
+# This tag requires that the tag UML_LOOK is set to YES.
2495
+
2496
+DOT_UML_DETAILS        = NO
2497
+
2498
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
2499
+# to display on a single line. If the actual line length exceeds this threshold
2500
+# significantly it will wrapped across multiple lines. Some heuristics are apply
2501
+# to avoid ugly line breaks.
2502
+# Minimum value: 0, maximum value: 1000, default value: 17.
2503
+# This tag requires that the tag HAVE_DOT is set to YES.
2504
+
2505
+DOT_WRAP_THRESHOLD     = 17
2506
+
2507
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
2508
+# collaboration graphs will show the relations between templates and their
2509
+# instances.
2510
+# The default value is: NO.
2511
+# This tag requires that the tag HAVE_DOT is set to YES.
2512
+
2513
+TEMPLATE_RELATIONS     = YES
2514
+
2515
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
2516
+# YES then doxygen will generate a graph for each documented file showing the
2517
+# direct and indirect include dependencies of the file with other documented
2518
+# files.
2519
+# The default value is: YES.
2520
+# This tag requires that the tag HAVE_DOT is set to YES.
2521
+
2522
+INCLUDE_GRAPH          = YES
2523
+
2524
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
2525
+# set to YES then doxygen will generate a graph for each documented file showing
2526
+# the direct and indirect include dependencies of the file with other documented
2527
+# files.
2528
+# The default value is: YES.
2529
+# This tag requires that the tag HAVE_DOT is set to YES.
2530
+
2531
+INCLUDED_BY_GRAPH      = YES
2532
+
2533
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
2534
+# dependency graph for every global function or class method.
2535
+#
2536
+# Note that enabling this option will significantly increase the time of a run.
2537
+# So in most cases it will be better to enable call graphs for selected
2538
+# functions only using the \callgraph command. Disabling a call graph can be
2539
+# accomplished by means of the command \hidecallgraph.
2540
+# The default value is: NO.
2541
+# This tag requires that the tag HAVE_DOT is set to YES.
2542
+
2543
+CALL_GRAPH             = YES
2544
+
2545
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
2546
+# dependency graph for every global function or class method.
2547
+#
2548
+# Note that enabling this option will significantly increase the time of a run.
2549
+# So in most cases it will be better to enable caller graphs for selected
2550
+# functions only using the \callergraph command. Disabling a caller graph can be
2551
+# accomplished by means of the command \hidecallergraph.
2552
+# The default value is: NO.
2553
+# This tag requires that the tag HAVE_DOT is set to YES.
2554
+
2555
+CALLER_GRAPH           = YES
2556
+
2557
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
2558
+# hierarchy of all classes instead of a textual one.
2559
+# The default value is: YES.
2560
+# This tag requires that the tag HAVE_DOT is set to YES.
2561
+
2562
+GRAPHICAL_HIERARCHY    = YES
2563
+
2564
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
2565
+# dependencies a directory has on other directories in a graphical way. The
2566
+# dependency relations are determined by the #include relations between the
2567
+# files in the directories.
2568
+# The default value is: YES.
2569
+# This tag requires that the tag HAVE_DOT is set to YES.
2570
+
2571
+DIRECTORY_GRAPH        = YES
2572
+
2573
+# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels
2574
+# of child directories generated in directory dependency graphs by dot.
2575
+# Minimum value: 1, maximum value: 25, default value: 1.
2576
+# This tag requires that the tag DIRECTORY_GRAPH is set to YES.
2577
+
2578
+DIR_GRAPH_MAX_DEPTH    = 1
2579
+
2580
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
2581
+# generated by dot. For an explanation of the image formats see the section
2582
+# output formats in the documentation of the dot tool (Graphviz (see:
2583
+# https://www.graphviz.org/)).
2584
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
2585
+# to make the SVG files visible in IE 9+ (other browsers do not have this
2586
+# requirement).
2587
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
2588
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
2589
+# png:gdiplus:gdiplus.
2590
+# The default value is: png.
2591
+# This tag requires that the tag HAVE_DOT is set to YES.
2592
+
2593
+DOT_IMAGE_FORMAT       = svg
2594
+
2595
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
2596
+# enable generation of interactive SVG images that allow zooming and panning.
2597
+#
2598
+# Note that this requires a modern browser other than Internet Explorer. Tested
2599
+# and working are Firefox, Chrome, Safari, and Opera.
2600
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
2601
+# the SVG files visible. Older versions of IE do not have SVG support.
2602
+# The default value is: NO.
2603
+# This tag requires that the tag HAVE_DOT is set to YES.
2604
+
2605
+INTERACTIVE_SVG        = YES
2606
+
2607
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
2608
+# found. If left blank, it is assumed the dot tool can be found in the path.
2609
+# This tag requires that the tag HAVE_DOT is set to YES.
2610
+
2611
+DOT_PATH               =
2612
+
2613
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
2614
+# contain dot files that are included in the documentation (see the \dotfile
2615
+# command).
2616
+# This tag requires that the tag HAVE_DOT is set to YES.
2617
+
2618
+DOTFILE_DIRS           =
2619
+
2620
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
2621
+# then run dia to produce the diagram and insert it in the documentation. The
2622
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
2623
+# If left empty dia is assumed to be found in the default search path.
2624
+
2625
+DIA_PATH               =
2626
+
2627
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
2628
+# contain dia files that are included in the documentation (see the \diafile
2629
+# command).
2630
+
2631
+DIAFILE_DIRS           =
2632
+
2633
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
2634
+# path where java can find the plantuml.jar file or to the filename of jar file
2635
+# to be used. If left blank, it is assumed PlantUML is not used or called during
2636
+# a preprocessing step. Doxygen will generate a warning when it encounters a
2637
+# \startuml command in this case and will not generate output for the diagram.
2638
+
2639
+PLANTUML_JAR_PATH      =
2640
+
2641
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
2642
+# configuration file for plantuml.
2643
+
2644
+PLANTUML_CFG_FILE      =
2645
+
2646
+# When using plantuml, the specified paths are searched for files specified by
2647
+# the !include statement in a plantuml block.
2648
+
2649
+PLANTUML_INCLUDE_PATH  =
2650
+
2651
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
2652
+# that will be shown in the graph. If the number of nodes in a graph becomes
2653
+# larger than this value, doxygen will truncate the graph, which is visualized
2654
+# by representing a node as a red box. Note that doxygen if the number of direct
2655
+# children of the root node in a graph is already larger than
2656
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
2657
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
2658
+# Minimum value: 0, maximum value: 10000, default value: 50.
2659
+# This tag requires that the tag HAVE_DOT is set to YES.
2660
+
2661
+DOT_GRAPH_MAX_NODES    = 100
2662
+
2663
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
2664
+# generated by dot. A depth value of 3 means that only nodes reachable from the
2665
+# root by following a path via at most 3 edges will be shown. Nodes that lay
2666
+# further from the root node will be omitted. Note that setting this option to 1
2667
+# or 2 may greatly reduce the computation time needed for large code bases. Also
2668
+# note that the size of a graph can be further restricted by
2669
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
2670
+# Minimum value: 0, maximum value: 1000, default value: 0.
2671
+# This tag requires that the tag HAVE_DOT is set to YES.
2672
+
2673
+MAX_DOT_GRAPH_DEPTH    = 0
2674
+
2675
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
2676
+# files in one run (i.e. multiple -o and -T options on the command line). This
2677
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
2678
+# this, this feature is disabled by default.
2679
+# The default value is: NO.
2680
+# This tag requires that the tag HAVE_DOT is set to YES.
2681
+
2682
+DOT_MULTI_TARGETS      = NO
2683
+
2684
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
2685
+# explaining the meaning of the various boxes and arrows in the dot generated
2686
+# graphs.
2687
+# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
2688
+# graphical representation for inheritance and collaboration diagrams is used.
2689
+# The default value is: YES.
2690
+# This tag requires that the tag HAVE_DOT is set to YES.
2691
+
2692
+GENERATE_LEGEND        = YES
2693
+
2694
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
2695
+# files that are used to generate the various graphs.
2696
+#
2697
+# Note: This setting is not only used for dot files but also for msc temporary
2698
+# files.
2699
+# The default value is: YES.
2700
+
2701
+DOT_CLEANUP            = NO
2702
+
2703
+# You can define message sequence charts within doxygen comments using the \msc
2704
+# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will
2705
+# use a built-in version of mscgen tool to produce the charts. Alternatively,
2706
+# the MSCGEN_TOOL tag can also specify the name an external tool. For instance,
2707
+# specifying prog as the value, doxygen will call the tool as prog -T
2708
+# <outfile_format> -o <outputfile> <inputfile>. The external tool should support
2709
+# output file formats "png", "eps", "svg", and "ismap".
2710
+
2711
+MSCGEN_TOOL            =
2712
+
2713
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
2714
+# contain msc files that are included in the documentation (see the \mscfile
2715
+# command).
2716
+
2717
+MSCFILE_DIRS           =
0 2718
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+DOXYGEN = doxygen
2
+
3
+DOC_DIR = html
4
+DOC_TAG = doxygen.tag
5
+DOC_LOG = warnings.log
6
+
7
+SRC_FILES := $(wildcard ../src/*.c ../src/*.h)
8
+
9
+.PHONY: all
10
+all: html
11
+
12
+html: $(SRC_FILES)
13
+	rm -rf html
14
+	$(DOXYGEN) Doxyfile
15
+
16
+.PHONY: clean
17
+clean:
18
+	rm -rf $(DOC_DIR)
19
+	rm -f $(DOC_TAG)
20
+	rm -f $(DOC_LOG)
0 21
new file mode 100644
... ...
@@ -0,0 +1,269 @@
1
+;******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
2
+;* File Name          : startup_stm32f072xb.s
3
+;* Author             : MCD Application Team
4
+;* Description        : STM32F072x8/STM32F072xB devices vector table for MDK-ARM toolchain.
5
+;*                      This module performs:
6
+;*                      - Set the initial SP
7
+;*                      - Set the initial PC == Reset_Handler
8
+;*                      - Set the vector table entries with the exceptions ISR address
9
+;*                      - Branches to __main in the C library (which eventually
10
+;*                        calls main()).
11
+;*                      After Reset the CortexM0 processor is in Thread mode,
12
+;*                      priority is Privileged, and the Stack is set to Main.
13
+;* <<< Use Configuration Wizard in Context Menu >>>
14
+;*******************************************************************************
15
+;*
16
+;* Redistribution and use in source and binary forms, with or without modification,
17
+;* are permitted provided that the following conditions are met:
18
+;*   1. Redistributions of source code must retain the above copyright notice,
19
+;*      this list of conditions and the following disclaimer.
20
+;*   2. Redistributions in binary form must reproduce the above copyright notice,
21
+;*      this list of conditions and the following disclaimer in the documentation
22
+;*      and/or other materials provided with the distribution.
23
+;*   3. Neither the name of STMicroelectronics nor the names of its contributors
24
+;*      may be used to endorse or promote products derived from this software
25
+;*      without specific prior written permission.
26
+;*
27
+;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33
+;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35
+;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+;
38
+;*******************************************************************************
39
+
40
+; Amount of memory (in bytes) allocated for Stack
41
+; Tailor this value to your application needs
42
+; <h> Stack Configuration
43
+;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
44
+; </h>
45
+
46
+Stack_Size      EQU     0x00000800
47
+
48
+                AREA    STACK, NOINIT, READWRITE, ALIGN=3
49
+Stack_Mem       SPACE   Stack_Size
50
+__initial_sp
51
+
52
+
53
+; <h> Heap Configuration
54
+;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
55
+; </h>
56
+
57
+Heap_Size       EQU     0x00000010
58
+
59
+                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
60
+__heap_base
61
+Heap_Mem        SPACE   Heap_Size
62
+__heap_limit
63
+
64
+                PRESERVE8
65
+                THUMB
66
+
67
+
68
+; Vector Table Mapped to Address 0 at Reset
69
+                AREA    RESET, DATA, READONLY
70
+                EXPORT  __Vectors
71
+                EXPORT  __Vectors_End
72
+                EXPORT  __Vectors_Size
73
+
74
+__Vectors       DCD     __initial_sp                   ; Top of Stack
75
+                DCD     Reset_Handler                  ; Reset Handler
76
+                DCD     NMI_Handler                    ; NMI Handler
77
+                DCD     HardFault_Handler              ; Hard Fault Handler
78
+                DCD     0                              ; Reserved
79
+                DCD     0                              ; Reserved
80
+                DCD     0                              ; Reserved
81
+                DCD     0                              ; Reserved
82
+                DCD     0                              ; Reserved
83
+                DCD     0                              ; Reserved
84
+                DCD     0                              ; Reserved
85
+                DCD     SVC_Handler                    ; SVCall Handler
86
+                DCD     0                              ; Reserved
87
+                DCD     0                              ; Reserved
88
+                DCD     PendSV_Handler                 ; PendSV Handler
89
+                DCD     SysTick_Handler                ; SysTick Handler
90
+
91
+                ; External Interrupts
92
+                DCD     WWDG_IRQHandler                ; Window Watchdog
93
+                DCD     PVD_VDDIO2_IRQHandler          ; PVD through EXTI Line detect
94
+                DCD     RTC_IRQHandler                 ; RTC through EXTI Line
95
+                DCD     FLASH_IRQHandler               ; FLASH
96
+                DCD     RCC_CRS_IRQHandler             ; RCC and CRS
97
+                DCD     EXTI0_1_IRQHandler             ; EXTI Line 0 and 1
98
+                DCD     EXTI2_3_IRQHandler             ; EXTI Line 2 and 3
99
+                DCD     EXTI4_15_IRQHandler            ; EXTI Line 4 to 15
100
+                DCD     TSC_IRQHandler                 ; TS
101
+                DCD     DMA1_Channel1_IRQHandler       ; DMA1 Channel 1
102
+                DCD     DMA1_Channel2_3_IRQHandler     ; DMA1 Channel 2 and Channel 3
103
+                DCD     DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7
104
+                DCD     ADC1_COMP_IRQHandler           ; ADC1, COMP1 and COMP2 
105
+                DCD     TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
106
+                DCD     TIM1_CC_IRQHandler             ; TIM1 Capture Compare
107
+                DCD     TIM2_IRQHandler                ; TIM2
108
+                DCD     TIM3_IRQHandler                ; TIM3
109
+                DCD     TIM6_DAC_IRQHandler            ; TIM6 and DAC
110
+                DCD     TIM7_IRQHandler                ; TIM7
111
+                DCD     TIM14_IRQHandler               ; TIM14
112
+                DCD     TIM15_IRQHandler               ; TIM15
113
+                DCD     TIM16_IRQHandler               ; TIM16
114
+                DCD     TIM17_IRQHandler               ; TIM17
115
+                DCD     I2C1_IRQHandler                ; I2C1
116
+                DCD     I2C2_IRQHandler                ; I2C2
117
+                DCD     SPI1_IRQHandler                ; SPI1
118
+                DCD     SPI2_IRQHandler                ; SPI2
119
+                DCD     USART1_IRQHandler              ; USART1
120
+                DCD     USART2_IRQHandler              ; USART2
121
+                DCD     USART3_4_IRQHandler            ; USART3 & USART4
122
+                DCD     CEC_CAN_IRQHandler             ; CEC and CAN
123
+                DCD     USB_IRQHandler                 ; USB
124
+
125
+__Vectors_End
126
+
127
+__Vectors_Size  EQU  __Vectors_End - __Vectors
128
+
129
+                AREA    |.text|, CODE, READONLY
130
+
131
+; Reset handler routine
132
+Reset_Handler    PROC
133
+                 EXPORT  Reset_Handler                 [WEAK]
134
+        IMPORT  __main
135
+        IMPORT  SystemInit  
136
+                 LDR     R0, =SystemInit
137
+                 BLX     R0
138
+                 LDR     R0, =__main
139
+                 BX      R0
140
+                 ENDP
141
+
142
+; Dummy Exception Handlers (infinite loops which can be modified)
143
+
144
+NMI_Handler     PROC
145
+                EXPORT  NMI_Handler                    [WEAK]
146
+                B       .
147
+                ENDP
148
+HardFault_Handler\
149
+                PROC
150
+                EXPORT  HardFault_Handler              [WEAK]
151
+                B       .
152
+                ENDP
153
+SVC_Handler     PROC
154
+                EXPORT  SVC_Handler                    [WEAK]
155
+                B       .
156
+                ENDP
157
+PendSV_Handler  PROC
158
+                EXPORT  PendSV_Handler                 [WEAK]
159
+                B       .
160
+                ENDP
161
+SysTick_Handler PROC
162
+                EXPORT  SysTick_Handler                [WEAK]
163
+                B       .
164
+                ENDP
165
+
166
+Default_Handler PROC
167
+
168
+                EXPORT  WWDG_IRQHandler                [WEAK]
169
+                EXPORT  PVD_VDDIO2_IRQHandler          [WEAK]
170
+                EXPORT  RTC_IRQHandler                 [WEAK]
171
+                EXPORT  FLASH_IRQHandler               [WEAK]
172
+                EXPORT  RCC_CRS_IRQHandler             [WEAK]
173
+                EXPORT  EXTI0_1_IRQHandler             [WEAK]
174
+                EXPORT  EXTI2_3_IRQHandler             [WEAK]
175
+                EXPORT  EXTI4_15_IRQHandler            [WEAK]
176
+                EXPORT  TSC_IRQHandler                 [WEAK]
177
+                EXPORT  DMA1_Channel1_IRQHandler       [WEAK]
178
+                EXPORT  DMA1_Channel2_3_IRQHandler     [WEAK]
179
+                EXPORT  DMA1_Channel4_5_6_7_IRQHandler [WEAK]
180
+                EXPORT  ADC1_COMP_IRQHandler           [WEAK]
181
+                EXPORT  TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK]
182
+                EXPORT  TIM1_CC_IRQHandler             [WEAK]
183
+                EXPORT  TIM2_IRQHandler                [WEAK]
184
+                EXPORT  TIM3_IRQHandler                [WEAK]
185
+                EXPORT  TIM6_DAC_IRQHandler            [WEAK]
186
+                EXPORT  TIM7_IRQHandler                [WEAK]
187
+                EXPORT  TIM14_IRQHandler               [WEAK]
188
+                EXPORT  TIM15_IRQHandler               [WEAK]
189
+                EXPORT  TIM16_IRQHandler               [WEAK]
190
+                EXPORT  TIM17_IRQHandler               [WEAK]
191
+                EXPORT  I2C1_IRQHandler                [WEAK]
192
+                EXPORT  I2C2_IRQHandler                [WEAK]
193
+                EXPORT  SPI1_IRQHandler                [WEAK]
194
+                EXPORT  SPI2_IRQHandler                [WEAK]
195
+                EXPORT  USART1_IRQHandler              [WEAK]
196
+                EXPORT  USART2_IRQHandler              [WEAK]
197
+                EXPORT  USART3_4_IRQHandler            [WEAK]
198
+                EXPORT  CEC_CAN_IRQHandler             [WEAK]
199
+                EXPORT  USB_IRQHandler                 [WEAK]
200
+
201
+
202
+WWDG_IRQHandler
203
+PVD_VDDIO2_IRQHandler
204
+RTC_IRQHandler
205
+FLASH_IRQHandler
206
+RCC_CRS_IRQHandler
207
+EXTI0_1_IRQHandler
208
+EXTI2_3_IRQHandler
209
+EXTI4_15_IRQHandler
210
+TSC_IRQHandler
211
+DMA1_Channel1_IRQHandler
212
+DMA1_Channel2_3_IRQHandler
213
+DMA1_Channel4_5_6_7_IRQHandler
214
+ADC1_COMP_IRQHandler
215
+TIM1_BRK_UP_TRG_COM_IRQHandler
216
+TIM1_CC_IRQHandler
217
+TIM2_IRQHandler
218
+TIM3_IRQHandler
219
+TIM6_DAC_IRQHandler
220
+TIM7_IRQHandler
221
+TIM14_IRQHandler
222
+TIM15_IRQHandler
223
+TIM16_IRQHandler
224
+TIM17_IRQHandler
225
+I2C1_IRQHandler
226
+I2C2_IRQHandler
227
+SPI1_IRQHandler
228
+SPI2_IRQHandler
229
+USART1_IRQHandler
230
+USART2_IRQHandler
231
+USART3_4_IRQHandler
232
+CEC_CAN_IRQHandler
233
+USB_IRQHandler
234
+
235
+                B       .
236
+
237
+                ENDP
238
+
239
+                ALIGN
240
+
241
+;*******************************************************************************
242
+; User Stack and Heap initialization
243
+;*******************************************************************************
244
+                 IF      :DEF:__MICROLIB
245
+
246
+                 EXPORT  __initial_sp
247
+                 EXPORT  __heap_base
248
+                 EXPORT  __heap_limit
249
+
250
+                 ELSE
251
+
252
+                 IMPORT  __use_two_region_memory
253
+                 EXPORT  __user_initial_stackheap
254
+
255
+__user_initial_stackheap
256
+
257
+                 LDR     R0, =  Heap_Mem
258
+                 LDR     R1, =(Stack_Mem + Stack_Size)
259
+                 LDR     R2, = (Heap_Mem +  Heap_Size)
260
+                 LDR     R3, = Stack_Mem
261
+                 BX      LR
262
+
263
+                 ALIGN
264
+
265
+                 ENDIF
266
+
267
+                 END
268
+
269
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
0 270
new file mode 100644
... ...
@@ -0,0 +1,374 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    stm32f0xx_hal_conf.h
4
+  * @author  MCD Application Team
5
+  * @brief   HAL configuration file.
6
+  *
7
+  * @note    modified by ARM
8
+  *          The modifications allow to use this file as User Code Template
9
+  *          within the Device Family Pack.
10
+  ******************************************************************************
11
+  * @attention
12
+  *
13
+  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
14
+  *
15
+  * Redistribution and use in source and binary forms, with or without modification,
16
+  * are permitted provided that the following conditions are met:
17
+  *   1. Redistributions of source code must retain the above copyright notice,
18
+  *      this list of conditions and the following disclaimer.
19
+  *   2. Redistributions in binary form must reproduce the above copyright notice,
20
+  *      this list of conditions and the following disclaimer in the documentation
21
+  *      and/or other materials provided with the distribution.
22
+  *   3. Neither the name of STMicroelectronics nor the names of its contributors
23
+  *      may be used to endorse or promote products derived from this software
24
+  *      without specific prior written permission.
25
+  *
26
+  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+  *
37
+  ******************************************************************************
38
+  */ 
39
+
40
+/* Define to prevent recursive inclusion -------------------------------------*/
41
+#ifndef __STM32F0xx_HAL_CONF_H
42
+#define __STM32F0xx_HAL_CONF_H
43
+
44
+#ifdef _RTE_
45
+#include "RTE_Components.h"             /* Component selection */
46
+#endif
47
+
48
+#ifdef __cplusplus
49
+ extern "C" {
50
+#endif
51
+
52
+/* Exported types ------------------------------------------------------------*/
53
+/* Exported constants --------------------------------------------------------*/
54
+
55
+/* ########################## Module Selection ############################## */
56
+/**
57
+  * @brief This is the list of modules to be used in the HAL driver 
58
+  */
59
+#ifdef RTE_DEVICE_HAL_COMMON
60
+#define HAL_MODULE_ENABLED
61
+#endif
62
+#ifdef RTE_DEVICE_HAL_ADC
63
+#define HAL_ADC_MODULE_ENABLED
64
+#endif
65
+#ifdef RTE_DEVICE_HAL_CAN
66
+#define HAL_CAN_MODULE_ENABLED
67
+#endif
68
+#ifdef RTE_DEVICE_HAL_CEC
69
+#define HAL_CEC_MODULE_ENABLED
70
+#endif
71
+#ifdef RTE_DEVICE_HAL_COMP
72
+#define HAL_COMP_MODULE_ENABLED
73
+#endif
74
+#ifdef RTE_DEVICE_HAL_CORTEX
75
+#define HAL_CORTEX_MODULE_ENABLED
76
+#endif
77
+#ifdef RTE_DEVICE_HAL_CRC
78
+#define HAL_CRC_MODULE_ENABLED
79
+#endif
80
+#ifdef RTE_DEVICE_HAL_DAC
81
+#define HAL_DAC_MODULE_ENABLED
82
+#endif
83
+#ifdef RTE_DEVICE_HAL_DMA
84
+#define HAL_DMA_MODULE_ENABLED
85
+#endif
86
+#ifdef RTE_DEVICE_HAL_FLASH
87
+#define HAL_FLASH_MODULE_ENABLED
88
+#endif
89
+#ifdef RTE_DEVICE_HAL_GPIO
90
+#define HAL_GPIO_MODULE_ENABLED
91
+#endif
92
+#ifdef RTE_DEVICE_HAL_I2C
93
+#define HAL_I2C_MODULE_ENABLED
94
+#endif
95
+#ifdef RTE_DEVICE_HAL_I2S
96
+#define HAL_I2S_MODULE_ENABLED
97
+#endif
98
+#ifdef RTE_DEVICE_HAL_IRDA
99
+#define HAL_IRDA_MODULE_ENABLED
100
+#endif
101
+#ifdef RTE_DEVICE_HAL_IWDG
102
+#define HAL_IWDG_MODULE_ENABLED
103
+#endif
104
+#ifdef RTE_DEVICE_HAL_PCD
105
+#define HAL_PCD_MODULE_ENABLED
106
+#endif
107
+#ifdef RTE_DEVICE_HAL_PWR
108
+#define HAL_PWR_MODULE_ENABLED
109
+#endif
110
+#ifdef RTE_DEVICE_HAL_RCC
111
+#define HAL_RCC_MODULE_ENABLED
112
+#endif
113
+#ifdef RTE_DEVICE_HAL_RTC
114
+#define HAL_RTC_MODULE_ENABLED
115
+#endif
116
+#ifdef RTE_DEVICE_HAL_SMARTCARD
117
+#define HAL_SMARTCARD_MODULE_ENABLED
118
+#endif
119
+#ifdef RTE_DEVICE_HAL_SMBUS
120
+#define HAL_SMBUS_MODULE_ENABLED
121
+#endif
122
+#ifdef RTE_DEVICE_HAL_SPI
123
+#define HAL_SPI_MODULE_ENABLED
124
+#endif
125
+#ifdef RTE_DEVICE_HAL_TIM
126
+#define HAL_TIM_MODULE_ENABLED
127
+#endif
128
+#ifdef RTE_DEVICE_HAL_TSC
129
+#define HAL_TSC_MODULE_ENABLED
130
+#endif
131
+#ifdef RTE_DEVICE_HAL_UART
132
+#define HAL_UART_MODULE_ENABLED
133
+#endif
134
+#ifdef RTE_DEVICE_HAL_USART
135
+#define HAL_USART_MODULE_ENABLED
136
+#endif
137
+#ifdef RTE_DEVICE_HAL_WWDG
138
+#define HAL_WWDG_MODULE_ENABLED
139
+#endif
140
+
141
+/* ######################### Oscillator Values adaptation ################### */
142
+/**
143
+  * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
144
+  *        This value is used by the RCC HAL module to compute the system frequency
145
+  *        (when HSE is used as system clock source, directly or through the PLL).  
146
+  */
147
+#if !defined  (HSE_VALUE) 
148
+  #define HSE_VALUE            8000000U  /*!< Value of the External oscillator in Hz */
149
+#endif /* HSE_VALUE */
150
+
151
+/**
152
+  * @brief In the following line adjust the External High Speed oscillator (HSE) Startup 
153
+  *        Timeout value 
154
+  */
155
+#if !defined  (HSE_STARTUP_TIMEOUT)
156
+  #define HSE_STARTUP_TIMEOUT  100U      /*!< Time out for HSE start up, in ms */
157
+#endif /* HSE_STARTUP_TIMEOUT */
158
+
159
+/**
160
+  * @brief Internal High Speed oscillator (HSI) value.
161
+  *        This value is used by the RCC HAL module to compute the system frequency
162
+  *        (when HSI is used as system clock source, directly or through the PLL). 
163
+  */
164
+#if !defined  (HSI_VALUE)
165
+  #define HSI_VALUE            8000000U  /*!< Value of the Internal oscillator in Hz*/
166
+#endif /* HSI_VALUE */
167
+
168
+/**
169
+  * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup 
170
+  *        Timeout value 
171
+  */
172
+#if !defined  (HSI_STARTUP_TIMEOUT) 
173
+  #define HSI_STARTUP_TIMEOUT  5000U     /*!< Time out for HSI start up */
174
+#endif /* HSI_STARTUP_TIMEOUT */  
175
+
176
+/**
177
+  * @brief Internal High Speed oscillator for ADC (HSI14) value.
178
+  */
179
+#if !defined  (HSI14_VALUE) 
180
+  #define HSI14_VALUE          14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz.
181
+                                             The real value may vary depending on the variations
182
+                                             in voltage and temperature.  */
183
+#endif /* HSI14_VALUE */
184
+
185
+/**
186
+  * @brief Internal High Speed oscillator for USB (HSI48) value.
187
+  */
188
+#if !defined  (HSI48_VALUE) 
189
+  #define HSI48_VALUE          48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz.
190
+                                             The real value may vary depending on the variations
191
+                                             in voltage and temperature.  */
192
+#endif /* HSI48_VALUE */
193
+
194
+/**
195
+  * @brief Internal Low Speed oscillator (LSI) value.
196
+  */
197
+#if !defined  (LSI_VALUE) 
198
+  #define LSI_VALUE            40000U    
199
+#endif /* LSI_VALUE */                   /*!< Value of the Internal Low Speed oscillator in Hz
200
+                                             The real value may vary depending on the variations
201
+                                             in voltage and temperature.  */
202
+/**
203
+  * @brief External Low Speed oscillator (LSE) value.
204
+  */
205
+#if !defined  (LSE_VALUE)
206
+  #define LSE_VALUE            32768U    /*!< Value of the External Low Speed oscillator in Hz */
207
+#endif /* LSE_VALUE */
208
+
209
+/**
210
+  * @brief Time out for LSE start up value in ms.
211
+  */
212
+#if !defined  (LSE_STARTUP_TIMEOUT)
213
+  #define LSE_STARTUP_TIMEOUT  5000U     /*!< Time out for LSE start up, in ms */
214
+#endif /* LSE_STARTUP_TIMEOUT */     
215
+
216
+
217
+/* Tip: To avoid modifying this file each time you need to use different HSE,
218
+   ===  you can define the HSE value in your toolchain compiler preprocessor. */
219
+
220
+/* ########################### System Configuration ######################### */
221
+/**
222
+  * @brief This is the HAL system configuration section
223
+  */     
224
+#define  VDD_VALUE                    3300U  /*!< Value of VDD in mv */           
225
+#define  TICK_INT_PRIORITY            ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default)             */
226
+                                                                              /*  Warning: Must be set to higher priority for HAL_Delay()  */
227
+                                                                              /*  and HAL_GetTick() usage under interrupt context          */
228
+#define  USE_RTOS                     0U
229
+#define  PREFETCH_ENABLE              1U
230
+#define  INSTRUCTION_CACHE_ENABLE     0U
231
+#define  DATA_CACHE_ENABLE            0U
232
+#define  USE_SPI_CRC                  1U
233
+
234
+/* ########################## Assert Selection ############################## */
235
+/**
236
+  * @brief Uncomment the line below to expanse the "assert_param" macro in the 
237
+  *        HAL drivers code
238
+  */
239
+/*#define USE_FULL_ASSERT    1*/
240
+
241
+/* Includes ------------------------------------------------------------------*/
242
+/**
243
+  * @brief Include module's header file 
244
+  */
245
+
246
+#ifdef HAL_RCC_MODULE_ENABLED
247
+ #include "stm32f0xx_hal_rcc.h"
248
+#endif /* HAL_RCC_MODULE_ENABLED */
249
+
250
+#ifdef HAL_GPIO_MODULE_ENABLED
251
+ #include "stm32f0xx_hal_gpio.h"
252
+#endif /* HAL_GPIO_MODULE_ENABLED */
253
+
254
+#ifdef HAL_DMA_MODULE_ENABLED
255
+  #include "stm32f0xx_hal_dma.h"
256
+#endif /* HAL_DMA_MODULE_ENABLED */
257
+
258
+#ifdef HAL_CORTEX_MODULE_ENABLED
259
+ #include "stm32f0xx_hal_cortex.h"
260
+#endif /* HAL_CORTEX_MODULE_ENABLED */
261
+
262
+#ifdef HAL_ADC_MODULE_ENABLED
263
+ #include "stm32f0xx_hal_adc.h"
264
+#endif /* HAL_ADC_MODULE_ENABLED */
265
+
266
+#ifdef HAL_CAN_MODULE_ENABLED
267
+ #include "stm32f0xx_hal_can.h"
268
+#endif /* HAL_CAN_MODULE_ENABLED */
269
+
270
+#ifdef HAL_CEC_MODULE_ENABLED
271
+ #include "stm32f0xx_hal_cec.h"
272
+#endif /* HAL_CEC_MODULE_ENABLED */
273
+
274
+#ifdef HAL_COMP_MODULE_ENABLED
275
+ #include "stm32f0xx_hal_comp.h"
276
+#endif /* HAL_COMP_MODULE_ENABLED */
277
+
278
+#ifdef HAL_CRC_MODULE_ENABLED
279
+ #include "stm32f0xx_hal_crc.h"
280
+#endif /* HAL_CRC_MODULE_ENABLED */
281
+
282
+#ifdef HAL_DAC_MODULE_ENABLED
283
+ #include "stm32f0xx_hal_dac.h"
284
+#endif /* HAL_DAC_MODULE_ENABLED */
285
+
286
+#ifdef HAL_FLASH_MODULE_ENABLED
287
+ #include "stm32f0xx_hal_flash.h"
288
+#endif /* HAL_FLASH_MODULE_ENABLED */
289
+
290
+#ifdef HAL_I2C_MODULE_ENABLED
291
+ #include "stm32f0xx_hal_i2c.h"
292
+#endif /* HAL_I2C_MODULE_ENABLED */
293
+
294
+#ifdef HAL_I2S_MODULE_ENABLED
295
+ #include "stm32f0xx_hal_i2s.h"
296
+#endif /* HAL_I2S_MODULE_ENABLED */
297
+
298
+#ifdef HAL_IRDA_MODULE_ENABLED
299
+ #include "stm32f0xx_hal_irda.h"
300
+#endif /* HAL_IRDA_MODULE_ENABLED */
301
+
302
+#ifdef HAL_IWDG_MODULE_ENABLED
303
+ #include "stm32f0xx_hal_iwdg.h"
304
+#endif /* HAL_IWDG_MODULE_ENABLED */
305
+
306
+#ifdef HAL_PCD_MODULE_ENABLED
307
+ #include "stm32f0xx_hal_pcd.h"
308
+#endif /* HAL_PCD_MODULE_ENABLED */
309
+
310
+#ifdef HAL_PWR_MODULE_ENABLED
311
+ #include "stm32f0xx_hal_pwr.h"
312
+#endif /* HAL_PWR_MODULE_ENABLED */
313
+
314
+#ifdef HAL_RTC_MODULE_ENABLED
315
+ #include "stm32f0xx_hal_rtc.h"
316
+#endif /* HAL_RTC_MODULE_ENABLED */
317
+
318
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
319
+ #include "stm32f0xx_hal_smartcard.h"
320
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
321
+
322
+#ifdef HAL_SMBUS_MODULE_ENABLED
323
+ #include "stm32f0xx_hal_smbus.h"
324
+#endif /* HAL_SMBUS_MODULE_ENABLED */
325
+
326
+#ifdef HAL_SPI_MODULE_ENABLED
327
+ #include "stm32f0xx_hal_spi.h"
328
+#endif /* HAL_SPI_MODULE_ENABLED */
329
+
330
+#ifdef HAL_TIM_MODULE_ENABLED
331
+ #include "stm32f0xx_hal_tim.h"
332
+#endif /* HAL_TIM_MODULE_ENABLED */
333
+
334
+#ifdef HAL_TSC_MODULE_ENABLED
335
+ #include "stm32f0xx_hal_tsc.h"
336
+#endif /* HAL_TSC_MODULE_ENABLED */
337
+
338
+#ifdef HAL_UART_MODULE_ENABLED
339
+ #include "stm32f0xx_hal_uart.h"
340
+#endif /* HAL_UART_MODULE_ENABLED */
341
+
342
+#ifdef HAL_USART_MODULE_ENABLED
343
+ #include "stm32f0xx_hal_usart.h"
344
+#endif /* HAL_USART_MODULE_ENABLED */
345
+
346
+#ifdef HAL_WWDG_MODULE_ENABLED
347
+ #include "stm32f0xx_hal_wwdg.h"
348
+#endif /* HAL_WWDG_MODULE_ENABLED */
349
+
350
+/* Exported macro ------------------------------------------------------------*/
351
+#ifdef  USE_FULL_ASSERT
352
+/**
353
+  * @brief  The assert_param macro is used for function's parameters check.
354
+  * @param  expr: If expr is false, it calls assert_failed function
355
+  *         which reports the name of the source file and the source
356
+  *         line number of the call that failed. 
357
+  *         If expr is true, it returns no value.
358
+  * @retval None
359
+  */
360
+  #define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__))
361
+/* Exported functions ------------------------------------------------------- */
362
+  void assert_failed(char* file, uint32_t line);
363
+#else
364
+  #define assert_param(expr) ((void)0U)
365
+#endif /* USE_FULL_ASSERT */    
366
+    
367
+#ifdef __cplusplus
368
+}
369
+#endif
370
+
371
+#endif /* __STM32F0xx_HAL_CONF_H */
372
+
373
+
374
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 375
new file mode 100644
... ...
@@ -0,0 +1,333 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    system_stm32f0xx.c
4
+  * @author  MCD Application Team
5
+  * @brief   CMSIS Cortex-M0 Device Peripheral Access Layer System Source File.
6
+  *
7
+  * 1. This file provides two functions and one global variable to be called from
8
+  *    user application:
9
+  *      - SystemInit(): This function is called at startup just after reset and 
10
+  *                      before branch to main program. This call is made inside
11
+  *                      the "startup_stm32f0xx.s" file.
12
+  *
13
+  *      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
14
+  *                                  by the user application to setup the SysTick
15
+  *                                  timer or configure other parameters.
16
+  *
17
+  *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
18
+  *                                 be called whenever the core clock is changed
19
+  *                                 during program execution.
20
+  *
21
+  * 2. After each device reset the HSI (8 MHz) is used as system clock source.
22
+  *    Then SystemInit() function is called, in "startup_stm32f0xx.s" file, to
23
+  *    configure the system clock before to branch to main program.
24
+  *
25
+  * 3. This file configures the system clock as follows:
26
+  *=============================================================================
27
+  *                         Supported STM32F0xx device
28
+  *-----------------------------------------------------------------------------
29
+  *        System Clock source                    | HSI
30
+  *-----------------------------------------------------------------------------
31
+  *        SYSCLK(Hz)                             | 8000000
32
+  *-----------------------------------------------------------------------------
33
+  *        HCLK(Hz)                               | 8000000
34
+  *-----------------------------------------------------------------------------
35
+  *        AHB Prescaler                          | 1
36
+  *-----------------------------------------------------------------------------
37
+  *        APB1 Prescaler                         | 1
38
+  *-----------------------------------------------------------------------------
39
+  *=============================================================================
40
+  ******************************************************************************
41
+  * @attention
42
+  *
43
+  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
44
+  *
45
+  * Redistribution and use in source and binary forms, with or without modification,
46
+  * are permitted provided that the following conditions are met:
47
+  *   1. Redistributions of source code must retain the above copyright notice,
48
+  *      this list of conditions and the following disclaimer.
49
+  *   2. Redistributions in binary form must reproduce the above copyright notice,
50
+  *      this list of conditions and the following disclaimer in the documentation
51
+  *      and/or other materials provided with the distribution.
52
+  *   3. Neither the name of STMicroelectronics nor the names of its contributors
53
+  *      may be used to endorse or promote products derived from this software
54
+  *      without specific prior written permission.
55
+  *
56
+  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
57
+  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
59
+  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
60
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
61
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
62
+  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
63
+  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
64
+  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
65
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66
+  *
67
+  ******************************************************************************
68
+  */
69
+
70
+/** @addtogroup CMSIS
71
+  * @{
72
+  */
73
+
74
+/** @addtogroup stm32f0xx_system
75
+  * @{
76
+  */
77
+
78
+/** @addtogroup STM32F0xx_System_Private_Includes
79
+  * @{
80
+  */
81
+
82
+#include "stm32f0xx.h"
83
+
84
+/**
85
+  * @}
86
+  */
87
+
88
+/** @addtogroup STM32F0xx_System_Private_TypesDefinitions
89
+  * @{
90
+  */
91
+
92
+/**
93
+  * @}
94
+  */
95
+
96
+/** @addtogroup STM32F0xx_System_Private_Defines
97
+  * @{
98
+  */
99
+#if !defined  (HSE_VALUE) 
100
+  #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz.
101
+                                                This value can be provided and adapted by the user application. */
102
+#endif /* HSE_VALUE */
103
+
104
+#if !defined  (HSI_VALUE)
105
+  #define HSI_VALUE    ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz.
106
+                                                This value can be provided and adapted by the user application. */
107
+#endif /* HSI_VALUE */
108
+
109
+#if !defined (HSI48_VALUE)
110
+#define HSI48_VALUE    ((uint32_t)48000000) /*!< Default value of the HSI48 Internal oscillator in Hz.
111
+                                                 This value can be provided and adapted by the user application. */
112
+#endif /* HSI48_VALUE */
113
+/**
114
+  * @}
115
+  */
116
+
117
+/** @addtogroup STM32F0xx_System_Private_Macros
118
+  * @{
119
+  */
120
+
121
+/**
122
+  * @}
123
+  */
124
+
125
+/** @addtogroup STM32F0xx_System_Private_Variables
126
+  * @{
127
+  */
128
+  /* This variable is updated in three ways:
129
+      1) by calling CMSIS function SystemCoreClockUpdate()
130
+      2) by calling HAL API function HAL_RCC_GetHCLKFreq()
131
+      3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
132
+         Note: If you use this function to configure the system clock there is no need to
133
+               call the 2 first functions listed above, since SystemCoreClock variable is 
134
+               updated automatically.
135
+  */
136
+uint32_t SystemCoreClock = 8000000;
137
+
138
+const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
139
+const uint8_t APBPrescTable[8]  = {0, 0, 0, 0, 1, 2, 3, 4};
140
+
141
+/**
142
+  * @}
143
+  */
144
+
145
+/** @addtogroup STM32F0xx_System_Private_FunctionPrototypes
146
+  * @{
147
+  */
148
+
149
+/**
150
+  * @}
151
+  */
152
+
153
+/** @addtogroup STM32F0xx_System_Private_Functions
154
+  * @{
155
+  */
156
+
157
+/**
158
+  * @brief  Setup the microcontroller system.
159
+  *         Initialize the default HSI clock source, vector table location and the PLL configuration is reset.
160
+  * @param  None
161
+  * @retval None
162
+  */
163
+void SystemInit(void)
164
+{
165
+  /* Reset the RCC clock configuration to the default reset state ------------*/
166
+  /* Set HSION bit */
167
+  RCC->CR |= (uint32_t)0x00000001U;
168
+
169
+#if defined (STM32F051x8) || defined (STM32F058x8)
170
+  /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE and MCOSEL[2:0] bits */
171
+  RCC->CFGR &= (uint32_t)0xF8FFB80CU;
172
+#else
173
+  /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE, MCOSEL[2:0], MCOPRE[2:0] and PLLNODIV bits */
174
+  RCC->CFGR &= (uint32_t)0x08FFB80CU;
175
+#endif /* STM32F051x8 or STM32F058x8 */
176
+  
177
+  /* Reset HSEON, CSSON and PLLON bits */
178
+  RCC->CR &= (uint32_t)0xFEF6FFFFU;
179
+
180
+  /* Reset HSEBYP bit */
181
+  RCC->CR &= (uint32_t)0xFFFBFFFFU;
182
+
183
+  /* Reset PLLSRC, PLLXTPRE and PLLMUL[3:0] bits */
184
+  RCC->CFGR &= (uint32_t)0xFFC0FFFFU;
185
+
186
+  /* Reset PREDIV[3:0] bits */
187
+  RCC->CFGR2 &= (uint32_t)0xFFFFFFF0U;
188
+
189
+#if defined (STM32F072xB) || defined (STM32F078xx)
190
+  /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */
191
+  RCC->CFGR3 &= (uint32_t)0xFFFCFE2CU;
192
+#elif defined (STM32F071xB)
193
+  /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
194
+  RCC->CFGR3 &= (uint32_t)0xFFFFCEACU;
195
+#elif defined (STM32F091xC) || defined (STM32F098xx)
196
+  /* Reset USART3SW[1:0], USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
197
+  RCC->CFGR3 &= (uint32_t)0xFFF0FEACU;
198
+#elif defined (STM32F030x6) || defined (STM32F030x8) || defined (STM32F031x6) || defined (STM32F038xx) || defined (STM32F030xC)
199
+  /* Reset USART1SW[1:0], I2C1SW and ADCSW bits */
200
+  RCC->CFGR3 &= (uint32_t)0xFFFFFEECU;
201
+#elif defined (STM32F051x8) || defined (STM32F058xx)
202
+  /* Reset USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
203
+  RCC->CFGR3 &= (uint32_t)0xFFFFFEACU;
204
+#elif defined (STM32F042x6) || defined (STM32F048xx)
205
+  /* Reset USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */
206
+  RCC->CFGR3 &= (uint32_t)0xFFFFFE2CU;
207
+#elif defined (STM32F070x6) || defined (STM32F070xB)
208
+  /* Reset USART1SW[1:0], I2C1SW, USBSW and ADCSW bits */
209
+  RCC->CFGR3 &= (uint32_t)0xFFFFFE6CU;
210
+  /* Set default USB clock to PLLCLK, since there is no HSI48 */
211
+  RCC->CFGR3 |= (uint32_t)0x00000080U;  
212
+#else
213
+ #warning "No target selected"
214
+#endif
215
+
216
+  /* Reset HSI14 bit */
217
+  RCC->CR2 &= (uint32_t)0xFFFFFFFEU;
218
+
219
+  /* Disable all interrupts */
220
+  RCC->CIR = 0x00000000U;
221
+
222
+}
223
+
224
+/**
225
+   * @brief  Update SystemCoreClock variable according to Clock Register Values.
226
+  *         The SystemCoreClock variable contains the core clock (HCLK), it can
227
+  *         be used by the user application to setup the SysTick timer or configure
228
+  *         other parameters.
229
+  *
230
+  * @note   Each time the core clock (HCLK) changes, this function must be called
231
+  *         to update SystemCoreClock variable value. Otherwise, any configuration
232
+  *         based on this variable will be incorrect.
233
+  *
234
+  * @note   - The system frequency computed by this function is not the real
235
+  *           frequency in the chip. It is calculated based on the predefined
236
+  *           constant and the selected clock source:
237
+  *
238
+  *           - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
239
+  *
240
+  *           - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
241
+  *
242
+  *           - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
243
+  *             or HSI_VALUE(*) multiplied/divided by the PLL factors.
244
+  *
245
+  *         (*) HSI_VALUE is a constant defined in stm32f0xx_hal.h file (default value
246
+  *             8 MHz) but the real value may vary depending on the variations
247
+  *             in voltage and temperature.
248
+  *
249
+  *         (**) HSE_VALUE is a constant defined in stm32f0xx_hal.h file (default value
250
+  *              8 MHz), user has to ensure that HSE_VALUE is same as the real
251
+  *              frequency of the crystal used. Otherwise, this function may
252
+  *              have wrong result.
253
+  *
254
+  *         - The result of this function could be not correct when using fractional
255
+  *           value for HSE crystal.
256
+  *
257
+  * @param  None
258
+  * @retval None
259
+  */
260
+void SystemCoreClockUpdate (void)
261
+{
262
+  uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0;
263
+
264
+  /* Get SYSCLK source -------------------------------------------------------*/
265
+  tmp = RCC->CFGR & RCC_CFGR_SWS;
266
+
267
+  switch (tmp)
268
+  {
269
+    case RCC_CFGR_SWS_HSI:  /* HSI used as system clock */
270
+      SystemCoreClock = HSI_VALUE;
271
+      break;
272
+    case RCC_CFGR_SWS_HSE:  /* HSE used as system clock */
273
+      SystemCoreClock = HSE_VALUE;
274
+      break;
275
+    case RCC_CFGR_SWS_PLL:  /* PLL used as system clock */
276
+      /* Get PLL clock source and multiplication factor ----------------------*/
277
+      pllmull = RCC->CFGR & RCC_CFGR_PLLMUL;
278
+      pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
279
+      pllmull = ( pllmull >> 18) + 2;
280
+      predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1;
281
+
282
+      if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV)
283
+      {
284
+        /* HSE used as PLL clock source : SystemCoreClock = HSE/PREDIV * PLLMUL */
285
+        SystemCoreClock = (HSE_VALUE/predivfactor) * pllmull;
286
+      }
287
+#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx)
288
+      else if (pllsource == RCC_CFGR_PLLSRC_HSI48_PREDIV)
289
+      {
290
+        /* HSI48 used as PLL clock source : SystemCoreClock = HSI48/PREDIV * PLLMUL */
291
+        SystemCoreClock = (HSI48_VALUE/predivfactor) * pllmull;
292
+      }
293
+#endif /* STM32F042x6 || STM32F048xx || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */
294
+      else
295
+      {
296
+#if defined(STM32F042x6) || defined(STM32F048xx)  || defined(STM32F070x6) \
297
+ || defined(STM32F078xx) || defined(STM32F071xB)  || defined(STM32F072xB) \
298
+ || defined(STM32F070xB) || defined(STM32F091xC) || defined(STM32F098xx)  || defined(STM32F030xC)
299
+        /* HSI used as PLL clock source : SystemCoreClock = HSI/PREDIV * PLLMUL */
300
+        SystemCoreClock = (HSI_VALUE/predivfactor) * pllmull;
301
+#else
302
+        /* HSI used as PLL clock source : SystemCoreClock = HSI/2 * PLLMUL */
303
+        SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
304
+#endif /* STM32F042x6 || STM32F048xx || STM32F070x6 || 
305
+          STM32F071xB || STM32F072xB || STM32F078xx || STM32F070xB ||
306
+          STM32F091xC || STM32F098xx || STM32F030xC */
307
+      }
308
+      break;
309
+    default: /* HSI used as system clock */
310
+      SystemCoreClock = HSI_VALUE;
311
+      break;
312
+  }
313
+  /* Compute HCLK clock frequency ----------------*/
314
+  /* Get HCLK prescaler */
315
+  tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
316
+  /* HCLK clock frequency */
317
+  SystemCoreClock >>= tmp;
318
+}
319
+
320
+/**
321
+  * @}
322
+  */
323
+
324
+/**
325
+  * @}
326
+  */
327
+
328
+/**
329
+  * @}
330
+  */
331
+
332
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
333
+
0 334
new file mode 100644
... ...
@@ -0,0 +1,18 @@
1
+
2
+/*
3
+ * Auto generated Run-Time-Environment Configuration File
4
+ *      *** Do not modify ! ***
5
+ *
6
+ * Project: 'io' 
7
+ * Target:  'IO' 
8
+ */
9
+
10
+#ifndef PRE_INCLUDE_GLOBAL_H
11
+#define PRE_INCLUDE_GLOBAL_H
12
+
13
+/* Keil.Standalone::Device:Startup:1.0.0 */
14
+#define USE_HAL_DRIVER
15
+          #define USE_FULL_LL_DRIVER
16
+
17
+
18
+#endif /* PRE_INCLUDE_GLOBAL_H */
0 19
new file mode 100644
... ...
@@ -0,0 +1,51 @@
1
+
2
+/*
3
+ * Auto generated Run-Time-Environment Configuration File
4
+ *      *** Do not modify ! ***
5
+ *
6
+ * Project: 'io' 
7
+ * Target:  'IO' 
8
+ */
9
+
10
+#ifndef RTE_COMPONENTS_H
11
+#define RTE_COMPONENTS_H
12
+
13
+
14
+/*
15
+ * Define the Device Header File: 
16
+ */
17
+#define CMSIS_device_header "stm32f0xx.h"
18
+
19
+/* Keil.Standalone::Device:STM32Cube HAL:ADC:1.11.3 */
20
+#define RTE_DEVICE_HAL_ADC
21
+/* Keil.Standalone::Device:STM32Cube HAL:COMMON:1.11.3 */
22
+#define RTE_DEVICE_HAL_COMMON
23
+/* Keil.Standalone::Device:STM32Cube HAL:CORTEX:1.11.3 */
24
+#define RTE_DEVICE_HAL_CORTEX
25
+/* Keil.Standalone::Device:STM32Cube HAL:DAC:1.11.3 */
26
+#define RTE_DEVICE_HAL_DAC
27
+/* Keil.Standalone::Device:STM32Cube HAL:DMA:1.11.3 */
28
+#define RTE_DEVICE_HAL_DMA
29
+/* Keil.Standalone::Device:STM32Cube HAL:FLASH:1.11.3 */
30
+#define RTE_DEVICE_HAL_FLASH
31
+/* Keil.Standalone::Device:STM32Cube HAL:GPIO:1.11.3 */
32
+#define RTE_DEVICE_HAL_GPIO
33
+/* Keil.Standalone::Device:STM32Cube HAL:PCD:1.11.3 */
34
+#define RTE_DEVICE_HAL_PCD
35
+/* Keil.Standalone::Device:STM32Cube HAL:RCC:1.11.3 */
36
+#define RTE_DEVICE_HAL_RCC
37
+/* Keil.Standalone::Device:STM32Cube HAL:RTC:1.11.3 */
38
+#define RTE_DEVICE_HAL_RTC
39
+/* Keil.Standalone::Device:STM32Cube HAL:SPI:1.11.3 */
40
+#define RTE_DEVICE_HAL_SPI
41
+/* Keil.Standalone::Device:STM32Cube HAL:TIM:1.11.3 */
42
+#define RTE_DEVICE_HAL_TIM
43
+/* Keil.Standalone::Device:STM32Cube HAL:UART:1.11.3 */
44
+#define RTE_DEVICE_HAL_UART
45
+/* Keil.Standalone::Device:STM32Cube HAL:USART:1.11.3 */
46
+#define RTE_DEVICE_HAL_USART
47
+/* Keil.Standalone::Device:Startup:1.0.0 */
48
+#define RTE_DEVICE_STARTUP_STM32F0XX    /* Device Startup for STM32F0 */
49
+
50
+
51
+#endif /* RTE_COMPONENTS_H */
0 52
new file mode 100644
... ...
@@ -0,0 +1,180 @@
1
+/*-----------------------------------------------------------------------*/
2
+/* Low level disk I/O module skeleton for FatFs     (C)ChaN, 2014        */
3
+/*                                                                       */
4
+/*   Portions COPYRIGHT 2017 STMicroelectronics                          */
5
+/*   Portions Copyright (C) 2014, ChaN, all right reserved               */
6
+/*-----------------------------------------------------------------------*/
7
+/* If a working storage control module is available, it should be        */
8
+/* attached to the FatFs via a glue function rather than modifying it.   */
9
+/* This is an example of glue functions to attach various exsisting      */
10
+/* storage control modules to the FatFs module with a defined API.       */
11
+/*-----------------------------------------------------------------------*/
12
+
13
+/**
14
+  ******************************************************************************
15
+  * @file    diskio.c 
16
+  * @author  MCD Application Team
17
+  * @version V1.4.1
18
+  * @date    14-February-2017
19
+  * @brief   FatFs low level disk I/O module.
20
+  ******************************************************************************
21
+  * @attention
22
+  *
23
+  *
24
+  * Redistribution and use in source and binary forms, with or without 
25
+  * modification, are permitted, provided that the following conditions are met:
26
+  *
27
+  * 1. Redistribution of source code must retain the above copyright notice, 
28
+  *    this list of conditions and the following disclaimer.
29
+  * 2. Redistributions in binary form must reproduce the above copyright notice,
30
+  *    this list of conditions and the following disclaimer in the documentation
31
+  *    and/or other materials provided with the distribution.
32
+  * 3. Neither the name of STMicroelectronics nor the names of other 
33
+  *    contributors to this software may be used to endorse or promote products 
34
+  *    derived from this software without specific written permission.
35
+  * 4. This software, including modifications and/or derivative works of this 
36
+  *    software, must execute solely and exclusively on microcontroller or
37
+  *    microprocessor devices manufactured by or for STMicroelectronics.
38
+  * 5. Redistribution and use of this software other than as permitted under 
39
+  *    this license is void and will automatically terminate your rights under 
40
+  *    this license. 
41
+  *
42
+  * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 
43
+  * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 
44
+  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
45
+  * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
46
+  * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 
47
+  * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
48
+  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49
+  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
50
+  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
51
+  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
52
+  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
53
+  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
+  *
55
+  ******************************************************************************
56
+  */
57
+
58
+/* Includes ------------------------------------------------------------------*/
59
+#include "diskio.h"
60
+#include "ff_gen_drv.h"
61
+
62
+/* Private typedef -----------------------------------------------------------*/
63
+/* Private define ------------------------------------------------------------*/
64
+/* Private variables ---------------------------------------------------------*/
65
+extern Disk_drvTypeDef  disk;
66
+
67
+/* Private function prototypes -----------------------------------------------*/
68
+/* Private functions ---------------------------------------------------------*/
69
+
70
+/**
71
+  * @brief  Gets Disk Status 
72
+  * @param  pdrv: Physical drive number (0..)
73
+  * @retval DSTATUS: Operation status
74
+  */
75
+DSTATUS disk_status (
76
+	BYTE pdrv		/* Physical drive nmuber to identify the drive */
77
+)
78
+{
79
+  DSTATUS stat;
80
+  
81
+  stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]);
82
+  return stat;
83
+}
84
+
85
+/**
86
+  * @brief  Initializes a Drive
87
+  * @param  pdrv: Physical drive number (0..)
88
+  * @retval DSTATUS: Operation status
89
+  */
90
+DSTATUS disk_initialize (
91
+	BYTE pdrv				/* Physical drive nmuber to identify the drive */
92
+)
93
+{
94
+  DSTATUS stat = RES_OK;
95
+  
96
+  if(disk.is_initialized[pdrv] == 0)
97
+  { 
98
+    disk.is_initialized[pdrv] = 1;
99
+    stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]);
100
+  }
101
+  return stat;
102
+}
103
+
104
+/**
105
+  * @brief  Reads Sector(s) 
106
+  * @param  pdrv: Physical drive number (0..)
107
+  * @param  *buff: Data buffer to store read data
108
+  * @param  sector: Sector address (LBA)
109
+  * @param  count: Number of sectors to read (1..128)
110
+  * @retval DRESULT: Operation result
111
+  */
112
+DRESULT disk_read (
113
+	BYTE pdrv,		/* Physical drive nmuber to identify the drive */
114
+	BYTE *buff,		/* Data buffer to store read data */
115
+	DWORD sector,	        /* Sector address in LBA */
116
+	UINT count		/* Number of sectors to read */
117
+)
118
+{
119
+  DRESULT res;
120
+ 
121
+  res = disk.drv[pdrv]->disk_read(disk.lun[pdrv], buff, sector, count);
122
+  return res;
123
+}
124
+
125
+/**
126
+  * @brief  Writes Sector(s)  
127
+  * @param  pdrv: Physical drive number (0..)
128
+  * @param  *buff: Data to be written
129
+  * @param  sector: Sector address (LBA)
130
+  * @param  count: Number of sectors to write (1..128)
131
+  * @retval DRESULT: Operation result
132
+  */
133
+#if _USE_WRITE == 1
134
+DRESULT disk_write (
135
+	BYTE pdrv,		/* Physical drive nmuber to identify the drive */
136
+	const BYTE *buff,	/* Data to be written */
137
+	DWORD sector,		/* Sector address in LBA */
138
+	UINT count        	/* Number of sectors to write */
139
+)
140
+{
141
+  DRESULT res;
142
+  
143
+  res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count);
144
+  return res;
145
+}
146
+#endif /* _USE_WRITE == 1 */
147
+
148
+/**
149
+  * @brief  I/O control operation  
150
+  * @param  pdrv: Physical drive number (0..)
151
+  * @param  cmd: Control code
152
+  * @param  *buff: Buffer to send/receive control data
153
+  * @retval DRESULT: Operation result
154
+  */
155
+#if _USE_IOCTL == 1
156
+DRESULT disk_ioctl (
157
+	BYTE pdrv,		/* Physical drive nmuber (0..) */
158
+	BYTE cmd,		/* Control code */
159
+	void *buff		/* Buffer to send/receive control data */
160
+)
161
+{
162
+  DRESULT res;
163
+
164
+  res = disk.drv[pdrv]->disk_ioctl(disk.lun[pdrv], cmd, buff);
165
+  return res;
166
+}
167
+#endif /* _USE_IOCTL == 1 */
168
+
169
+/**
170
+  * @brief  Gets Time from RTC 
171
+  * @param  None
172
+  * @retval Time in DWORD
173
+  */
174
+__weak DWORD get_fattime (void)
175
+{
176
+  return 0;
177
+}
178
+
179
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
180
+
0 181
new file mode 100644
... ...
@@ -0,0 +1,80 @@
1
+/*-----------------------------------------------------------------------/
2
+/  Low level disk interface modlue include file   (C)ChaN, 2014          /
3
+/-----------------------------------------------------------------------*/
4
+
5
+#ifndef _DISKIO_DEFINED
6
+#define _DISKIO_DEFINED
7
+
8
+#ifdef __cplusplus
9
+extern "C" {
10
+#endif
11
+
12
+#define _USE_WRITE	1	/* 1: Enable disk_write function */
13
+#define _USE_IOCTL	1	/* 1: Enable disk_ioctl fucntion */
14
+
15
+#include "integer.h"
16
+
17
+
18
+/* Status of Disk Functions */
19
+typedef BYTE	DSTATUS;
20
+
21
+/* Results of Disk Functions */
22
+typedef enum {
23
+	RES_OK = 0,		/* 0: Successful */
24
+	RES_ERROR,		/* 1: R/W Error */
25
+	RES_WRPRT,		/* 2: Write Protected */
26
+	RES_NOTRDY,		/* 3: Not Ready */
27
+	RES_PARERR		/* 4: Invalid Parameter */
28
+} DRESULT;
29
+
30
+
31
+/*---------------------------------------*/
32
+/* Prototypes for disk control functions */
33
+
34
+
35
+DSTATUS disk_initialize (BYTE pdrv);
36
+DSTATUS disk_status (BYTE pdrv);
37
+DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
38
+DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
39
+DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
40
+DWORD get_fattime (void);
41
+
42
+/* Disk Status Bits (DSTATUS) */
43
+
44
+#define STA_NOINIT		0x01	/* Drive not initialized */
45
+#define STA_NODISK		0x02	/* No medium in the drive */
46
+#define STA_PROTECT		0x04	/* Write protected */
47
+
48
+
49
+/* Command code for disk_ioctrl fucntion */
50
+
51
+/* Generic command (Used by FatFs) */
52
+#define CTRL_SYNC		0	/* Complete pending write process (needed at _FS_READONLY == 0) */
53
+#define GET_SECTOR_COUNT	1	/* Get media size (needed at _USE_MKFS == 1) */
54
+#define GET_SECTOR_SIZE		2	/* Get sector size (needed at _MAX_SS != _MIN_SS) */
55
+#define GET_BLOCK_SIZE		3	/* Get erase block size (needed at _USE_MKFS == 1) */
56
+#define CTRL_TRIM		4	/* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
57
+
58
+/* Generic command (Not used by FatFs) */
59
+#define CTRL_POWER			5	/* Get/Set power status */
60
+#define CTRL_LOCK			6	/* Lock/Unlock media removal */
61
+#define CTRL_EJECT			7	/* Eject media */
62
+#define CTRL_FORMAT			8	/* Create physical format on the media */
63
+
64
+/* MMC/SDC specific ioctl command */
65
+#define MMC_GET_TYPE		10	/* Get card type */
66
+#define MMC_GET_CSD			11	/* Get CSD */
67
+#define MMC_GET_CID			12	/* Get CID */
68
+#define MMC_GET_OCR			13	/* Get OCR */
69
+#define MMC_GET_SDSTAT		14	/* Get SD status */
70
+
71
+/* ATA/CF specific ioctl command */
72
+#define ATA_GET_REV			20	/* Get F/W revision */
73
+#define ATA_GET_MODEL		21	/* Get model name */
74
+#define ATA_GET_SN			22	/* Get serial number */
75
+
76
+#ifdef __cplusplus
77
+}
78
+#endif
79
+
80
+#endif
0 81
new file mode 100644
... ...
@@ -0,0 +1,4752 @@
1
+/*----------------------------------------------------------------------------/
2
+/  FatFs - FAT file system module  R0.11                 (C)ChaN, 2015
3
+/-----------------------------------------------------------------------------/
4
+/ FatFs module is a free software that opened under license policy of
5
+/ following conditions.
6
+/
7
+/ Copyright (C) 2015, ChaN, all right reserved.
8
+/
9
+/ 1. Redistributions of source code must retain the above copyright notice,
10
+/    this condition and the following disclaimer.
11
+/
12
+/ This software is provided by the copyright holder and contributors "AS IS"
13
+/ and any warranties related to this software are DISCLAIMED.
14
+/ The copyright owner or contributors be NOT LIABLE for any damages caused
15
+/ by use of this software.
16
+/-----------------------------------------------------------------------------/
17
+/ Feb 26,'06 R0.00  Prototype.
18
+/
19
+/ Apr 29,'06 R0.01  First stable version.
20
+/
21
+/ Jun 01,'06 R0.02  Added FAT12 support.
22
+/                   Removed unbuffered mode.
23
+/                   Fixed a problem on small (<32M) partition.
24
+/ Jun 10,'06 R0.02a Added a configuration option (_FS_MINIMUM).
25
+/
26
+/ Sep 22,'06 R0.03  Added f_rename().
27
+/                   Changed option _FS_MINIMUM to _FS_MINIMIZE.
28
+/ Dec 11,'06 R0.03a Improved cluster scan algorithm to write files fast.
29
+/                   Fixed f_mkdir() creates incorrect directory on FAT32.
30
+/
31
+/ Feb 04,'07 R0.04  Supported multiple drive system.
32
+/                   Changed some interfaces for multiple drive system.
33
+/                   Changed f_mountdrv() to f_mount().
34
+/                   Added f_mkfs().
35
+/ Apr 01,'07 R0.04a Supported multiple partitions on a physical drive.
36
+/                   Added a capability of extending file size to f_lseek().
37
+/                   Added minimization level 3.
38
+/                   Fixed an endian sensitive code in f_mkfs().
39
+/ May 05,'07 R0.04b Added a configuration option _USE_NTFLAG.
40
+/                   Added FSINFO support.
41
+/                   Fixed DBCS name can result FR_INVALID_NAME.
42
+/                   Fixed short seek (<= csize) collapses the file object.
43
+/
44
+/ Aug 25,'07 R0.05  Changed arguments of f_read(), f_write() and f_mkfs().
45
+/                   Fixed f_mkfs() on FAT32 creates incorrect FSINFO.
46
+/                   Fixed f_mkdir() on FAT32 creates incorrect directory.
47
+/ Feb 03,'08 R0.05a Added f_truncate() and f_utime().
48
+/                   Fixed off by one error at FAT sub-type determination.
49
+/                   Fixed btr in f_read() can be mistruncated.
50
+/                   Fixed cached sector is not flushed when create and close without write.
51
+/
52
+/ Apr 01,'08 R0.06  Added fputc(), fputs(), fprintf() and fgets().
53
+/                   Improved performance of f_lseek() on moving to the same or following cluster.
54
+/
55
+/ Apr 01,'09 R0.07  Merged Tiny-FatFs as a configuration option. (_FS_TINY)
56
+/                   Added long file name feature.
57
+/                   Added multiple code page feature.
58
+/                   Added re-entrancy for multitask operation.
59
+/                   Added auto cluster size selection to f_mkfs().
60
+/                   Added rewind option to f_readdir().
61
+/                   Changed result code of critical errors.
62
+/                   Renamed string functions to avoid name collision.
63
+/ Apr 14,'09 R0.07a Separated out OS dependent code on reentrant cfg.
64
+/                   Added multiple sector size feature.
65
+/ Jun 21,'09 R0.07c Fixed f_unlink() can return FR_OK on error.
66
+/                   Fixed wrong cache control in f_lseek().
67
+/                   Added relative path feature.
68
+/                   Added f_chdir() and f_chdrive().
69
+/                   Added proper case conversion to extended character.
70
+/ Nov 03,'09 R0.07e Separated out configuration options from ff.h to ffconf.h.
71
+/                   Fixed f_unlink() fails to remove a sub-directory on _FS_RPATH.
72
+/                   Fixed name matching error on the 13 character boundary.
73
+/                   Added a configuration option, _LFN_UNICODE.
74
+/                   Changed f_readdir() to return the SFN with always upper case on non-LFN cfg.
75
+/
76
+/ May 15,'10 R0.08  Added a memory configuration option. (_USE_LFN = 3)
77
+/                   Added file lock feature. (_FS_SHARE)
78
+/                   Added fast seek feature. (_USE_FASTSEEK)
79
+/                   Changed some types on the API, XCHAR->TCHAR.
80
+/                   Changed .fname in the FILINFO structure on Unicode cfg.
81
+/                   String functions support UTF-8 encoding files on Unicode cfg.
82
+/ Aug 16,'10 R0.08a Added f_getcwd().
83
+/                   Added sector erase feature. (_USE_ERASE)
84
+/                   Moved file lock semaphore table from fs object to the bss.
85
+/                   Fixed a wrong directory entry is created on non-LFN cfg when the given name contains ';'.
86
+/                   Fixed f_mkfs() creates wrong FAT32 volume.
87
+/ Jan 15,'11 R0.08b Fast seek feature is also applied to f_read() and f_write().
88
+/                   f_lseek() reports required table size on creating CLMP.
89
+/                   Extended format syntax of f_printf().
90
+/                   Ignores duplicated directory separators in given path name.
91
+/
92
+/ Sep 06,'11 R0.09  f_mkfs() supports multiple partition to complete the multiple partition feature.
93
+/                   Added f_fdisk().
94
+/ Aug 27,'12 R0.09a Changed f_open() and f_opendir() reject null object pointer to avoid crash.
95
+/                   Changed option name _FS_SHARE to _FS_LOCK.
96
+/                   Fixed assertion failure due to OS/2 EA on FAT12/16 volume.
97
+/ Jan 24,'13 R0.09b Added f_setlabel() and f_getlabel().
98
+/
99
+/ Oct 02,'13 R0.10  Added selection of character encoding on the file. (_STRF_ENCODE)
100
+/                   Added f_closedir().
101
+/                   Added forced full FAT scan for f_getfree(). (_FS_NOFSINFO)
102
+/                   Added forced mount feature with changes of f_mount().
103
+/                   Improved behavior of volume auto detection.
104
+/                   Improved write throughput of f_puts() and f_printf().
105
+/                   Changed argument of f_chdrive(), f_mkfs(), disk_read() and disk_write().
106
+/                   Fixed f_write() can be truncated when the file size is close to 4GB.
107
+/                   Fixed f_open(), f_mkdir() and f_setlabel() can return incorrect error code.
108
+/ Jan 15,'14 R0.10a Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID)
109
+/                   Added a configuration option of minimum sector size. (_MIN_SS)
110
+/                   2nd argument of f_rename() can have a drive number and it will be ignored.
111
+/                   Fixed f_mount() with forced mount fails when drive number is >= 1.
112
+/                   Fixed f_close() invalidates the file object without volume lock.
113
+/                   Fixed f_closedir() returns but the volume lock is left acquired.
114
+/                   Fixed creation of an entry with LFN fails on too many SFN collisions.
115
+/ May 19,'14 R0.10b Fixed a hard error in the disk I/O layer can collapse the directory entry.
116
+/                   Fixed LFN entry is not deleted on delete/rename an object with lossy converted SFN.
117
+/ Nov  9,'14 R0.10c Added a configuration option for the platforms without RTC. (_FS_NORTC)
118
+/                   Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel(). (appeared at R0.09b)
119
+/                   Fixed a potential problem of FAT access that can appear on disk error.
120
+/                   Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08)
121
+/ Feb 02,'15 R0.11  Added f_findfirst() and f_findnext(). (_USE_FIND)
122
+/                   Fixed f_unlink() does not remove cluster chain of the file. (appeared at R0.10c)
123
+/                   Fixed _FS_NORTC option does not work properly. (appeared at R0.10c)
124
+/---------------------------------------------------------------------------*/
125
+
126
+#include "ff.h"			/* Declarations of FatFs API */
127
+#include "diskio.h"		/* Declarations of disk I/O functions */
128
+
129
+
130
+/*--------------------------------------------------------------------------
131
+
132
+   Module Private Definitions
133
+
134
+---------------------------------------------------------------------------*/
135
+
136
+#if _FATFS != 32020	/* Revision ID */
137
+#error Wrong include file (ff.h).
138
+#endif
139
+
140
+
141
+/* Reentrancy related */
142
+#if _FS_REENTRANT
143
+#if _USE_LFN == 1
144
+#error Static LFN work area cannot be used at thread-safe configuration
145
+#endif
146
+#define	ENTER_FF(fs)		{ if (!lock_fs(fs)) return FR_TIMEOUT; }
147
+#define	LEAVE_FF(fs, res)	{ unlock_fs(fs, res); return res; }
148
+#else
149
+#define	ENTER_FF(fs)
150
+#define LEAVE_FF(fs, res)	return res
151
+#endif
152
+
153
+#define	ABORT(fs, res)		{ fp->err = (BYTE)(res); LEAVE_FF(fs, res); }
154
+
155
+
156
+/* Definitions of sector size */
157
+#if (_MAX_SS < _MIN_SS) || (_MAX_SS != 512 && _MAX_SS != 1024 && _MAX_SS != 2048 && _MAX_SS != 4096) || (_MIN_SS != 512 && _MIN_SS != 1024 && _MIN_SS != 2048 && _MIN_SS != 4096)
158
+#error Wrong sector size configuration
159
+#endif
160
+#if _MAX_SS == _MIN_SS
161
+#define	SS(fs)	((UINT)_MAX_SS)	/* Fixed sector size */
162
+#else
163
+#define	SS(fs)	((fs)->ssize)	/* Variable sector size */
164
+#endif
165
+
166
+
167
+/* Timestamp feature */
168
+#if _FS_NORTC == 1
169
+#if _NORTC_YEAR < 1980 || _NORTC_YEAR > 2107 || _NORTC_MON < 1 || _NORTC_MON > 12 || _NORTC_MDAY < 1 || _NORTC_MDAY > 31
170
+#error Invalid _FS_NORTC settings
171
+#endif
172
+#define GET_FATTIME()	((DWORD)(_NORTC_YEAR - 1980) << 25 | (DWORD)_NORTC_MON << 21 | (DWORD)_NORTC_MDAY << 16)
173
+#else
174
+#define GET_FATTIME()	get_fattime()
175
+#endif
176
+
177
+
178
+/* File access control feature */
179
+#if _FS_LOCK
180
+#if _FS_READONLY
181
+#error _FS_LOCK must be 0 at read-only configuration
182
+#endif
183
+typedef struct {
184
+	FATFS *fs;		/* Object ID 1, volume (NULL:blank entry) */
185
+	DWORD clu;		/* Object ID 2, directory (0:root) */
186
+	WORD idx;		/* Object ID 3, directory index */
187
+	WORD ctr;		/* Object open counter, 0:none, 0x01..0xFF:read mode open count, 0x100:write mode */
188
+} FILESEM;
189
+#endif
190
+
191
+
192
+
193
+/* DBCS code ranges and SBCS extend character conversion table */
194
+
195
+#if _CODE_PAGE == 932	/* Japanese Shift-JIS */
196
+#define _DF1S	0x81	/* DBC 1st byte range 1 start */
197
+#define _DF1E	0x9F	/* DBC 1st byte range 1 end */
198
+#define _DF2S	0xE0	/* DBC 1st byte range 2 start */
199
+#define _DF2E	0xFC	/* DBC 1st byte range 2 end */
200
+#define _DS1S	0x40	/* DBC 2nd byte range 1 start */
201
+#define _DS1E	0x7E	/* DBC 2nd byte range 1 end */
202
+#define _DS2S	0x80	/* DBC 2nd byte range 2 start */
203
+#define _DS2E	0xFC	/* DBC 2nd byte range 2 end */
204
+
205
+#elif _CODE_PAGE == 936	/* Simplified Chinese GBK */
206
+#define _DF1S	0x81
207
+#define _DF1E	0xFE
208
+#define _DS1S	0x40
209
+#define _DS1E	0x7E
210
+#define _DS2S	0x80
211
+#define _DS2E	0xFE
212
+
213
+#elif _CODE_PAGE == 949	/* Korean */
214
+#define _DF1S	0x81
215
+#define _DF1E	0xFE
216
+#define _DS1S	0x41
217
+#define _DS1E	0x5A
218
+#define _DS2S	0x61
219
+#define _DS2E	0x7A
220
+#define _DS3S	0x81
221
+#define _DS3E	0xFE
222
+
223
+#elif _CODE_PAGE == 950	/* Traditional Chinese Big5 */
224
+#define _DF1S	0x81
225
+#define _DF1E	0xFE
226
+#define _DS1S	0x40
227
+#define _DS1E	0x7E
228
+#define _DS2S	0xA1
229
+#define _DS2E	0xFE
230
+
231
+#elif _CODE_PAGE == 437	/* U.S. (OEM) */
232
+#define _DF1S	0
233
+#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
234
+				0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
235
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
236
+				0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
237
+
238
+#elif _CODE_PAGE == 720	/* Arabic (OEM) */
239
+#define _DF1S	0
240
+#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
241
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
242
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
243
+				0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
244
+
245
+#elif _CODE_PAGE == 737	/* Greek (OEM) */
246
+#define _DF1S	0
247
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
248
+				0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
249
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
250
+				0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
251
+
252
+#elif _CODE_PAGE == 775	/* Baltic (OEM) */
253
+#define _DF1S	0
254
+#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
255
+				0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
256
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
257
+				0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
258
+
259
+#elif _CODE_PAGE == 850	/* Multilingual Latin 1 (OEM) */
260
+#define _DF1S	0
261
+#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
262
+				0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
263
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
264
+				0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
265
+
266
+#elif _CODE_PAGE == 852	/* Latin 2 (OEM) */
267
+#define _DF1S	0
268
+#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
269
+				0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
270
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
271
+				0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
272
+
273
+#elif _CODE_PAGE == 855	/* Cyrillic (OEM) */
274
+#define _DF1S	0
275
+#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
276
+				0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
277
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
278
+				0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
279
+
280
+#elif _CODE_PAGE == 857	/* Turkish (OEM) */
281
+#define _DF1S	0
282
+#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
283
+				0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
284
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
285
+				0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
286
+
287
+#elif _CODE_PAGE == 858	/* Multilingual Latin 1 + Euro (OEM) */
288
+#define _DF1S	0
289
+#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
290
+				0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
291
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
292
+				0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
293
+
294
+#elif _CODE_PAGE == 862	/* Hebrew (OEM) */
295
+#define _DF1S	0
296
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
297
+				0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
298
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
299
+				0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
300
+
301
+#elif _CODE_PAGE == 866	/* Russian (OEM) */
302
+#define _DF1S	0
303
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
304
+				0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
305
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
306
+				0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
307
+
308
+#elif _CODE_PAGE == 874	/* Thai (OEM, Windows) */
309
+#define _DF1S	0
310
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
311
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
312
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
313
+				0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
314
+
315
+#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
316
+#define _DF1S	0
317
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
318
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
319
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
320
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
321
+
322
+#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
323
+#define _DF1S	0
324
+#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
325
+				0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
326
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
327
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
328
+
329
+#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
330
+#define _DF1S	0
331
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
332
+				0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
333
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
334
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
335
+
336
+#elif _CODE_PAGE == 1253 /* Greek (Windows) */
337
+#define _DF1S	0
338
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
339
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
340
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
341
+				0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
342
+
343
+#elif _CODE_PAGE == 1254 /* Turkish (Windows) */
344
+#define _DF1S	0
345
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
346
+				0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
347
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
348
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
349
+
350
+#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
351
+#define _DF1S	0
352
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
353
+				0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
354
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
355
+				0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
356
+
357
+#elif _CODE_PAGE == 1256 /* Arabic (Windows) */
358
+#define _DF1S	0
359
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
360
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
361
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
362
+				0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
363
+
364
+#elif _CODE_PAGE == 1257 /* Baltic (Windows) */
365
+#define _DF1S	0
366
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
367
+				0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
368
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
369
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
370
+
371
+#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
372
+#define _DF1S	0
373
+#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
374
+				0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
375
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
376
+				0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
377
+
378
+#elif _CODE_PAGE == 1	/* ASCII (for only non-LFN cfg) */
379
+#if _USE_LFN
380
+#error Cannot use LFN feature without valid code page.
381
+#endif
382
+#define _DF1S	0
383
+
384
+#else
385
+#error Unknown code page
386
+
387
+#endif
388
+
389
+
390
+/* Character code support macros */
391
+#define IsUpper(c)	(((c)>='A')&&((c)<='Z'))
392
+#define IsLower(c)	(((c)>='a')&&((c)<='z'))
393
+#define IsDigit(c)	(((c)>='0')&&((c)<='9'))
394
+
395
+#if _DF1S		/* Code page is DBCS */
396
+
397
+#ifdef _DF2S	/* Two 1st byte areas */
398
+#define IsDBCS1(c)	(((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
399
+#else			/* One 1st byte area */
400
+#define IsDBCS1(c)	((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
401
+#endif
402
+
403
+#ifdef _DS3S	/* Three 2nd byte areas */
404
+#define IsDBCS2(c)	(((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
405
+#else			/* Two 2nd byte areas */
406
+#define IsDBCS2(c)	(((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
407
+#endif
408
+
409
+#else			/* Code page is SBCS */
410
+
411
+#define IsDBCS1(c)	0
412
+#define IsDBCS2(c)	0
413
+
414
+#endif /* _DF1S */
415
+
416
+
417
+/* Name status flags */
418
+#define NSFLAG		11		/* Index of name status byte in fn[] */
419
+#define NS_LOSS		0x01	/* Out of 8.3 format */
420
+#define NS_LFN		0x02	/* Force to create LFN entry */
421
+#define NS_LAST		0x04	/* Last segment */
422
+#define NS_BODY		0x08	/* Lower case flag (body) */
423
+#define NS_EXT		0x10	/* Lower case flag (ext) */
424
+#define NS_DOT		0x20	/* Dot entry */
425
+
426
+
427
+/* FAT sub-type boundaries (Differ from specs but correct for real DOS/Windows) */
428
+#define MIN_FAT16	4086U	/* Minimum number of clusters as FAT16 */
429
+#define	MIN_FAT32	65526U	/* Minimum number of clusters as FAT32 */
430
+
431
+
432
+/* FatFs refers the members in the FAT structures as byte array instead of
433
+/ structure member because the structure is not binary compatible between
434
+/ different platforms */
435
+
436
+#define BS_jmpBoot			0		/* x86 jump instruction (3) */
437
+#define BS_OEMName			3		/* OEM name (8) */
438
+#define BPB_BytsPerSec		11		/* Sector size [byte] (2) */
439
+#define BPB_SecPerClus		13		/* Cluster size [sector] (1) */
440
+#define BPB_RsvdSecCnt		14		/* Size of reserved area [sector] (2) */
441
+#define BPB_NumFATs			16		/* Number of FAT copies (1) */
442
+#define BPB_RootEntCnt		17		/* Number of root directory entries for FAT12/16 (2) */
443
+#define BPB_TotSec16		19		/* Volume size [sector] (2) */
444
+#define BPB_Media			21		/* Media descriptor (1) */
445
+#define BPB_FATSz16			22		/* FAT size [sector] (2) */
446
+#define BPB_SecPerTrk		24		/* Track size [sector] (2) */
447
+#define BPB_NumHeads		26		/* Number of heads (2) */
448
+#define BPB_HiddSec			28		/* Number of special hidden sectors (4) */
449
+#define BPB_TotSec32		32		/* Volume size [sector] (4) */
450
+#define BS_DrvNum			36		/* Physical drive number (2) */
451
+#define BS_BootSig			38		/* Extended boot signature (1) */
452
+#define BS_VolID			39		/* Volume serial number (4) */
453
+#define BS_VolLab			43		/* Volume label (8) */
454
+#define BS_FilSysType		54		/* File system type (1) */
455
+#define BPB_FATSz32			36		/* FAT size [sector] (4) */
456
+#define BPB_ExtFlags		40		/* Extended flags (2) */
457
+#define BPB_FSVer			42		/* File system version (2) */
458
+#define BPB_RootClus		44		/* Root directory first cluster (4) */
459
+#define BPB_FSInfo			48		/* Offset of FSINFO sector (2) */
460
+#define BPB_BkBootSec		50		/* Offset of backup boot sector (2) */
461
+#define BS_DrvNum32			64		/* Physical drive number (2) */
462
+#define BS_BootSig32		66		/* Extended boot signature (1) */
463
+#define BS_VolID32			67		/* Volume serial number (4) */
464
+#define BS_VolLab32			71		/* Volume label (8) */
465
+#define BS_FilSysType32		82		/* File system type (1) */
466
+#define	FSI_LeadSig			0		/* FSI: Leading signature (4) */
467
+#define	FSI_StrucSig		484		/* FSI: Structure signature (4) */
468
+#define	FSI_Free_Count		488		/* FSI: Number of free clusters (4) */
469
+#define	FSI_Nxt_Free		492		/* FSI: Last allocated cluster (4) */
470
+#define MBR_Table			446		/* MBR: Partition table offset (2) */
471
+#define	SZ_PTE				16		/* MBR: Size of a partition table entry */
472
+#define BS_55AA				510		/* Signature word (2) */
473
+
474
+#define	DIR_Name			0		/* Short file name (11) */
475
+#define	DIR_Attr			11		/* Attribute (1) */
476
+#define	DIR_NTres			12		/* Lower case flag (1) */
477
+#define DIR_CrtTimeTenth	13		/* Created time sub-second (1) */
478
+#define	DIR_CrtTime			14		/* Created time (2) */
479
+#define	DIR_CrtDate			16		/* Created date (2) */
480
+#define DIR_LstAccDate		18		/* Last accessed date (2) */
481
+#define	DIR_FstClusHI		20		/* Higher 16-bit of first cluster (2) */
482
+#define	DIR_WrtTime			22		/* Modified time (2) */
483
+#define	DIR_WrtDate			24		/* Modified date (2) */
484
+#define	DIR_FstClusLO		26		/* Lower 16-bit of first cluster (2) */
485
+#define	DIR_FileSize		28		/* File size (4) */
486
+#define	LDIR_Ord			0		/* LFN entry order and LLE flag (1) */
487
+#define	LDIR_Attr			11		/* LFN attribute (1) */
488
+#define	LDIR_Type			12		/* LFN type (1) */
489
+#define	LDIR_Chksum			13		/* Sum of corresponding SFN entry */
490
+#define	LDIR_FstClusLO		26		/* Must be zero (0) */
491
+#define	SZ_DIRE				32		/* Size of a directory entry */
492
+#define	LLEF				0x40	/* Last long entry flag in LDIR_Ord */
493
+#define	DDEM				0xE5	/* Deleted directory entry mark at DIR_Name[0] */
494
+#define	RDDEM				0x05	/* Replacement of the character collides with DDEM */
495
+
496
+
497
+
498
+
499
+/*------------------------------------------------------------*/
500
+/* Module private work area                                   */
501
+/*------------------------------------------------------------*/
502
+/* Remark: Uninitialized variables with static duration are
503
+/  guaranteed zero/null at start-up. If not, either the linker
504
+/  or start-up routine being used is out of ANSI-C standard.
505
+*/
506
+
507
+#if _VOLUMES < 1 || _VOLUMES > 9
508
+#error Wrong _VOLUMES setting
509
+#endif
510
+static FATFS *FatFs[_VOLUMES];	/* Pointer to the file system objects (logical drives) */
511
+static WORD Fsid;				/* File system mount ID */
512
+
513
+#if _FS_RPATH && _VOLUMES >= 2
514
+static BYTE CurrVol;			/* Current drive */
515
+#endif
516
+
517
+#if _FS_LOCK
518
+static FILESEM Files[_FS_LOCK];	/* Open object lock semaphores */
519
+#endif
520
+
521
+#if _USE_LFN == 0			/* Non LFN feature */
522
+#define	DEFINE_NAMEBUF		BYTE sfn[12]
523
+#define INIT_BUF(dobj)		(dobj).fn = sfn
524
+#define	FREE_BUF()
525
+#else
526
+#if _MAX_LFN < 12 || _MAX_LFN > 255
527
+#error Wrong _MAX_LFN setting
528
+#endif
529
+#if _USE_LFN == 1			/* LFN feature with static working buffer */
530
+static WCHAR LfnBuf[_MAX_LFN + 1];
531
+#define	DEFINE_NAMEBUF		BYTE sfn[12]
532
+#define INIT_BUF(dobj)		{ (dobj).fn = sfn; (dobj).lfn = LfnBuf; }
533
+#define	FREE_BUF()
534
+#elif _USE_LFN == 2 		/* LFN feature with dynamic working buffer on the stack */
535
+#define	DEFINE_NAMEBUF		BYTE sfn[12]; WCHAR lbuf[_MAX_LFN + 1]
536
+#define INIT_BUF(dobj)		{ (dobj).fn = sfn; (dobj).lfn = lbuf; }
537
+#define	FREE_BUF()
538
+#elif _USE_LFN == 3 		/* LFN feature with dynamic working buffer on the heap */
539
+#define	DEFINE_NAMEBUF		BYTE sfn[12]; WCHAR *lfn
540
+#define INIT_BUF(dobj)		{ lfn = ff_memalloc((_MAX_LFN + 1) * 2); if (!lfn) LEAVE_FF((dobj).fs, FR_NOT_ENOUGH_CORE); (dobj).lfn = lfn; (dobj).fn = sfn; }
541
+#define	FREE_BUF()			ff_memfree(lfn)
542
+#else
543
+#error Wrong _USE_LFN setting
544
+#endif
545
+#endif
546
+
547
+#ifdef _EXCVT
548
+static const BYTE ExCvt[] = _EXCVT;	/* Upper conversion table for extended characters */
549
+#endif
550
+
551
+
552
+
553
+
554
+
555
+
556
+/*--------------------------------------------------------------------------
557
+
558
+   Module Private Functions
559
+
560
+---------------------------------------------------------------------------*/
561
+DWORD clust2sect (FATFS* fs, DWORD clst);
562
+DWORD get_fat (FATFS* fs,	DWORD clst);
563
+
564
+#if !_FS_READONLY
565
+FRESULT put_fat (FATFS* fs,	DWORD clst,	DWORD val);
566
+#endif /* !_FS_READONLY */
567
+
568
+#if _USE_LFN
569
+static void gen_numname (BYTE* dst, const BYTE* src, const WCHAR* lfn, UINT seq);
570
+#endif /* !_USE_LFN */
571
+
572
+
573
+
574
+/*-----------------------------------------------------------------------*/
575
+/* String functions                                                      */
576
+/*-----------------------------------------------------------------------*/
577
+
578
+/* Copy memory to memory */
579
+static
580
+void mem_cpy (void* dst, const void* src, UINT cnt) {
581
+	BYTE *d = (BYTE*)dst;
582
+	const BYTE *s = (const BYTE*)src;
583
+
584
+#if _WORD_ACCESS == 1
585
+	while (cnt >= sizeof (int)) {
586
+		*(int*)d = *(int*)s;
587
+		d += sizeof (int); s += sizeof (int);
588
+		cnt -= sizeof (int);
589
+	}
590
+#endif
591
+	while (cnt--)
592
+		*d++ = *s++;
593
+}
594
+
595
+/* Fill memory */
596
+static
597
+void mem_set (void* dst, int val, UINT cnt) {
598
+	BYTE *d = (BYTE*)dst;
599
+
600
+	while (cnt--)
601
+		*d++ = (BYTE)val;
602
+}
603
+
604
+/* Compare memory to memory */
605
+static
606
+int mem_cmp (const void* dst, const void* src, UINT cnt) {
607
+	const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src;
608
+	int r = 0;
609
+
610
+	while (cnt-- && (r = *d++ - *s++) == 0) ;
611
+	return r;
612
+}
613
+
614
+/* Check if chr is contained in the string */
615
+static
616
+int chk_chr (const char* str, int chr) {
617
+	while (*str && *str != chr) str++;
618
+	return *str;
619
+}
620
+
621
+
622
+
623
+
624
+/*-----------------------------------------------------------------------*/
625
+/* Request/Release grant to access the volume                            */
626
+/*-----------------------------------------------------------------------*/
627
+#if _FS_REENTRANT
628
+static
629
+int lock_fs (
630
+	FATFS* fs		/* File system object */
631
+)
632
+{
633
+	return ff_req_grant(fs->sobj);
634
+}
635
+
636
+
637
+static
638
+void unlock_fs (
639
+	FATFS* fs,		/* File system object */
640
+	FRESULT res		/* Result code to be returned */
641
+)
642
+{
643
+	if (fs &&
644
+		res != FR_NOT_ENABLED &&
645
+		res != FR_INVALID_DRIVE &&
646
+		res != FR_INVALID_OBJECT &&
647
+		res != FR_TIMEOUT) {
648
+		ff_rel_grant(fs->sobj);
649
+	}
650
+}
651
+#endif
652
+
653
+
654
+
655
+
656
+/*-----------------------------------------------------------------------*/
657
+/* File lock control functions                                           */
658
+/*-----------------------------------------------------------------------*/
659
+#if _FS_LOCK
660
+
661
+static
662
+FRESULT chk_lock (	/* Check if the file can be accessed */
663
+	DIR* dp,		/* Directory object pointing the file to be checked */
664
+	int acc			/* Desired access type (0:Read, 1:Write, 2:Delete/Rename) */
665
+)
666
+{
667
+	UINT i, be;
668
+
669
+	/* Search file semaphore table */
670
+	for (i = be = 0; i < _FS_LOCK; i++) {
671
+		if (Files[i].fs) {	/* Existing entry */
672
+			if (Files[i].fs == dp->fs &&	 	/* Check if the object matched with an open object */
673
+				Files[i].clu == dp->sclust &&
674
+				Files[i].idx == dp->index) break;
675
+		} else {			/* Blank entry */
676
+			be = 1;
677
+		}
678
+	}
679
+	if (i == _FS_LOCK)	/* The object is not opened */
680
+		return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES;	/* Is there a blank entry for new object? */
681
+
682
+	/* The object has been opened. Reject any open against writing file and all write mode open */
683
+	return (acc || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK;
684
+}
685
+
686
+
687
+static
688
+int enq_lock (void)	/* Check if an entry is available for a new object */
689
+{
690
+	UINT i;
691
+
692
+	for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
693
+	return (i == _FS_LOCK) ? 0 : 1;
694
+}
695
+
696
+
697
+static
698
+UINT inc_lock (	/* Increment object open counter and returns its index (0:Internal error) */
699
+	DIR* dp,	/* Directory object pointing the file to register or increment */
700
+	int acc		/* Desired access (0:Read, 1:Write, 2:Delete/Rename) */
701
+)
702
+{
703
+	UINT i;
704
+
705
+
706
+	for (i = 0; i < _FS_LOCK; i++) {	/* Find the object */
707
+		if (Files[i].fs == dp->fs &&
708
+			Files[i].clu == dp->sclust &&
709
+			Files[i].idx == dp->index) break;
710
+	}
711
+
712
+	if (i == _FS_LOCK) {				/* Not opened. Register it as new. */
713
+		for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
714
+		if (i == _FS_LOCK) return 0;	/* No free entry to register (int err) */
715
+		Files[i].fs = dp->fs;
716
+		Files[i].clu = dp->sclust;
717
+		Files[i].idx = dp->index;
718
+		Files[i].ctr = 0;
719
+	}
720
+
721
+	if (acc && Files[i].ctr) return 0;	/* Access violation (int err) */
722
+
723
+	Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1;	/* Set semaphore value */
724
+
725
+	return i + 1;
726
+}
727
+
728
+
729
+static
730
+FRESULT dec_lock (	/* Decrement object open counter */
731
+	UINT i			/* Semaphore index (1..) */
732
+)
733
+{
734
+	WORD n;
735
+	FRESULT res;
736
+
737
+
738
+	if (--i < _FS_LOCK) {	/* Shift index number origin from 0 */
739
+		n = Files[i].ctr;
740
+		if (n == 0x100) n = 0;		/* If write mode open, delete the entry */
741
+		if (n) n--;					/* Decrement read mode open count */
742
+		Files[i].ctr = n;
743
+		if (!n) Files[i].fs = 0;	/* Delete the entry if open count gets zero */
744
+		res = FR_OK;
745
+	} else {
746
+		res = FR_INT_ERR;			/* Invalid index nunber */
747
+	}
748
+	return res;
749
+}
750
+
751
+
752
+static
753
+void clear_lock (	/* Clear lock entries of the volume */
754
+	FATFS *fs
755
+)
756
+{
757
+	UINT i;
758
+
759
+	for (i = 0; i < _FS_LOCK; i++) {
760
+		if (Files[i].fs == fs) Files[i].fs = 0;
761
+	}
762
+}
763
+#endif
764
+
765
+
766
+
767
+
768
+/*-----------------------------------------------------------------------*/
769
+/* Move/Flush disk access window in the file system object               */
770
+/*-----------------------------------------------------------------------*/
771
+#if !_FS_READONLY
772
+static
773
+FRESULT sync_window (
774
+	FATFS* fs		/* File system object */
775
+)
776
+{
777
+	DWORD wsect;
778
+	UINT nf;
779
+	FRESULT res = FR_OK;
780
+
781
+
782
+	if (fs->wflag) {	/* Write back the sector if it is dirty */
783
+		wsect = fs->winsect;	/* Current sector number */
784
+		if (disk_write(fs->drv, fs->win.d8, wsect, 1) != RES_OK) {
785
+			res = FR_DISK_ERR;
786
+		} else {
787
+			fs->wflag = 0;
788
+			if (wsect - fs->fatbase < fs->fsize) {		/* Is it in the FAT area? */
789
+				for (nf = fs->n_fats; nf >= 2; nf--) {	/* Reflect the change to all FAT copies */
790
+					wsect += fs->fsize;
791
+					disk_write(fs->drv, fs->win.d8, wsect, 1);
792
+				}
793
+			}
794
+		}
795
+	}
796
+	return res;
797
+}
798
+#endif
799
+
800
+
801
+static
802
+FRESULT move_window (
803
+	FATFS* fs,		/* File system object */
804
+	DWORD sector	/* Sector number to make appearance in the fs->win[].d8 */
805
+)
806
+{
807
+	FRESULT res = FR_OK;
808
+
809
+
810
+	if (sector != fs->winsect) {	/* Window offset changed? */
811
+#if !_FS_READONLY
812
+		res = sync_window(fs);		/* Write-back changes */
813
+#endif
814
+		if (res == FR_OK) {			/* Fill sector window with new data */
815
+			if (disk_read(fs->drv, fs->win.d8, sector, 1) != RES_OK) {
816
+				sector = 0xFFFFFFFF;	/* Invalidate window if data is not reliable */
817
+				res = FR_DISK_ERR;
818
+			}
819
+			fs->winsect = sector;
820
+		}
821
+	}
822
+	return res;
823
+}
824
+
825
+
826
+
827
+
828
+/*-----------------------------------------------------------------------*/
829
+/* Synchronize file system and strage device                             */
830
+/*-----------------------------------------------------------------------*/
831
+#if !_FS_READONLY
832
+static
833
+FRESULT sync_fs (	/* FR_OK: successful, FR_DISK_ERR: failed */
834
+	FATFS* fs		/* File system object */
835
+)
836
+{
837
+	FRESULT res;
838
+
839
+
840
+	res = sync_window(fs);
841
+	if (res == FR_OK) {
842
+		/* Update FSINFO sector if needed */
843
+		if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) {
844
+			/* Create FSINFO structure */
845
+			mem_set(fs->win.d8, 0, SS(fs));
846
+			ST_WORD(fs->win.d8 + BS_55AA, 0xAA55);
847
+			ST_DWORD(fs->win.d8 + FSI_LeadSig, 0x41615252);
848
+			ST_DWORD(fs->win.d8 + FSI_StrucSig, 0x61417272);
849
+			ST_DWORD(fs->win.d8 + FSI_Free_Count, fs->free_clust);
850
+			ST_DWORD(fs->win.d8 + FSI_Nxt_Free, fs->last_clust);
851
+			/* Write it into the FSINFO sector */
852
+			fs->winsect = fs->volbase + 1;
853
+			disk_write(fs->drv, fs->win.d8, fs->winsect, 1);
854
+			fs->fsi_flag = 0;
855
+		}
856
+		/* Make sure that no pending write process in the physical drive */
857
+		if (disk_ioctl(fs->drv, CTRL_SYNC, 0) != RES_OK)
858
+			res = FR_DISK_ERR;
859
+	}
860
+
861
+	return res;
862
+}
863
+#endif
864
+
865
+
866
+
867
+
868
+/*-----------------------------------------------------------------------*/
869
+/* Get sector# from cluster#                                             */
870
+/*-----------------------------------------------------------------------*/
871
+/* Hidden API for hacks and disk tools */
872
+
873
+DWORD clust2sect (	/* !=0: Sector number, 0: Failed - invalid cluster# */
874
+	FATFS* fs,		/* File system object */
875
+	DWORD clst		/* Cluster# to be converted */
876
+)
877
+{
878
+	clst -= 2;
879
+	if (clst >= fs->n_fatent - 2) return 0;		/* Invalid cluster# */
880
+	return clst * fs->csize + fs->database;
881
+}
882
+
883
+
884
+
885
+
886
+/*-----------------------------------------------------------------------*/
887
+/* FAT access - Read value of a FAT entry                                */
888
+/*-----------------------------------------------------------------------*/
889
+/* Hidden API for hacks and disk tools */
890
+
891
+DWORD get_fat (	/* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
892
+	FATFS* fs,	/* File system object */
893
+	DWORD clst	/* FAT index number (cluster number) to get the value */
894
+)
895
+{
896
+	UINT wc, bc;
897
+	BYTE *p;
898
+	DWORD val;
899
+
900
+
901
+	if (clst < 2 || clst >= fs->n_fatent) {	/* Check range */
902
+		val = 1;	/* Internal error */
903
+
904
+	} else {
905
+		val = 0xFFFFFFFF;	/* Default value falls on disk error */
906
+
907
+		switch (fs->fs_type) {
908
+		case FS_FAT12 :
909
+			bc = (UINT)clst; bc += bc / 2;
910
+			if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
911
+			wc = fs->win.d8[bc++ % SS(fs)];
912
+			if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
913
+			wc |= fs->win.d8[bc % SS(fs)] << 8;
914
+			val = clst & 1 ? wc >> 4 : (wc & 0xFFF);
915
+			break;
916
+
917
+		case FS_FAT16 :
918
+			if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
919
+			p = &fs->win.d8[clst * 2 % SS(fs)];
920
+			val = LD_WORD(p);
921
+			break;
922
+
923
+		case FS_FAT32 :
924
+			if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
925
+			p = &fs->win.d8[clst * 4 % SS(fs)];
926
+			val = LD_DWORD(p) & 0x0FFFFFFF;
927
+			break;
928
+
929
+		default:
930
+			val = 1;	/* Internal error */
931
+		}
932
+	}
933
+
934
+	return val;
935
+}
936
+
937
+
938
+
939
+
940
+/*-----------------------------------------------------------------------*/
941
+/* FAT access - Change value of a FAT entry                              */
942
+/*-----------------------------------------------------------------------*/
943
+/* Hidden API for hacks and disk tools */
944
+
945
+#if !_FS_READONLY
946
+FRESULT put_fat (
947
+	FATFS* fs,	/* File system object */
948
+	DWORD clst,	/* FAT index number (cluster number) to be changed */
949
+	DWORD val	/* New value to be set to the entry */
950
+)
951
+{
952
+	UINT bc;
953
+	BYTE *p;
954
+	FRESULT res;
955
+
956
+
957
+	if (clst < 2 || clst >= fs->n_fatent) {	/* Check range */
958
+		res = FR_INT_ERR;
959
+
960
+	} else {
961
+		switch (fs->fs_type) {
962
+		case FS_FAT12 :
963
+			bc = (UINT)clst; bc += bc / 2;
964
+			res = move_window(fs, fs->fatbase + (bc / SS(fs)));
965
+			if (res != FR_OK) break;
966
+			p = &fs->win.d8[bc++ % SS(fs)];
967
+			*p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val;
968
+			fs->wflag = 1;
969
+			res = move_window(fs, fs->fatbase + (bc / SS(fs)));
970
+			if (res != FR_OK) break;
971
+			p = &fs->win.d8[bc % SS(fs)];
972
+			*p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F));
973
+			fs->wflag = 1;
974
+			break;
975
+
976
+		case FS_FAT16 :
977
+			res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)));
978
+			if (res != FR_OK) break;
979
+			p = &fs->win.d8[clst * 2 % SS(fs)];
980
+			ST_WORD(p, (WORD)val);
981
+			fs->wflag = 1;
982
+			break;
983
+
984
+		case FS_FAT32 :
985
+			res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)));
986
+			if (res != FR_OK) break;
987
+			p = &fs->win.d8[clst * 4 % SS(fs)];
988
+			val |= LD_DWORD(p) & 0xF0000000;
989
+			ST_DWORD(p, val);
990
+			fs->wflag = 1;
991
+			break;
992
+
993
+		default :
994
+			res = FR_INT_ERR;
995
+		}
996
+	}
997
+
998
+	return res;
999
+}
1000
+#endif /* !_FS_READONLY */
1001
+
1002
+
1003
+
1004
+
1005
+/*-----------------------------------------------------------------------*/
1006
+/* FAT handling - Remove a cluster chain                                 */
1007
+/*-----------------------------------------------------------------------*/
1008
+#if !_FS_READONLY
1009
+static
1010
+FRESULT remove_chain (
1011
+	FATFS* fs,			/* File system object */
1012
+	DWORD clst			/* Cluster# to remove a chain from */
1013
+)
1014
+{
1015
+	FRESULT res;
1016
+	DWORD nxt;
1017
+#if _USE_TRIM
1018
+	DWORD scl = clst, ecl = clst, rt[2];
1019
+#endif
1020
+
1021
+	if (clst < 2 || clst >= fs->n_fatent) {	/* Check range */
1022
+		res = FR_INT_ERR;
1023
+
1024
+	} else {
1025
+		res = FR_OK;
1026
+		while (clst < fs->n_fatent) {			/* Not a last link? */
1027
+			nxt = get_fat(fs, clst);			/* Get cluster status */
1028
+			if (nxt == 0) break;				/* Empty cluster? */
1029
+			if (nxt == 1) { res = FR_INT_ERR; break; }	/* Internal error? */
1030
+			if (nxt == 0xFFFFFFFF) { res = FR_DISK_ERR; break; }	/* Disk error? */
1031
+			res = put_fat(fs, clst, 0);			/* Mark the cluster "empty" */
1032
+			if (res != FR_OK) break;
1033
+			if (fs->free_clust != 0xFFFFFFFF) {	/* Update FSINFO */
1034
+				fs->free_clust++;
1035
+				fs->fsi_flag |= 1;
1036
+			}
1037
+#if _USE_TRIM
1038
+			if (ecl + 1 == nxt) {	/* Is next cluster contiguous? */
1039
+				ecl = nxt;
1040
+			} else {				/* End of contiguous clusters */ 
1041
+				rt[0] = clust2sect(fs, scl);					/* Start sector */
1042
+				rt[1] = clust2sect(fs, ecl) + fs->csize - 1;	/* End sector */
1043
+				disk_ioctl(fs->drv, CTRL_TRIM, rt);				/* Erase the block */
1044
+				scl = ecl = nxt;
1045
+			}
1046
+#endif
1047
+			clst = nxt;	/* Next cluster */
1048
+		}
1049
+	}
1050
+
1051
+	return res;
1052
+}
1053
+#endif
1054
+
1055
+
1056
+
1057
+
1058
+/*-----------------------------------------------------------------------*/
1059
+/* FAT handling - Stretch or Create a cluster chain                      */
1060
+/*-----------------------------------------------------------------------*/
1061
+#if !_FS_READONLY
1062
+static
1063
+DWORD create_chain (	/* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */
1064
+	FATFS* fs,			/* File system object */
1065
+	DWORD clst			/* Cluster# to stretch. 0 means create a new chain. */
1066
+)
1067
+{
1068
+	DWORD cs, ncl, scl;
1069
+	FRESULT res;
1070
+
1071
+
1072
+	if (clst == 0) {		/* Create a new chain */
1073
+		scl = fs->last_clust;			/* Get suggested start point */
1074
+		if (!scl || scl >= fs->n_fatent) scl = 1;
1075
+	}
1076
+	else {					/* Stretch the current chain */
1077
+		cs = get_fat(fs, clst);			/* Check the cluster status */
1078
+		if (cs < 2) return 1;			/* Invalid value */
1079
+		if (cs == 0xFFFFFFFF) return cs;	/* A disk error occurred */
1080
+		if (cs < fs->n_fatent) return cs;	/* It is already followed by next cluster */
1081
+		scl = clst;
1082
+	}
1083
+
1084
+	ncl = scl;				/* Start cluster */
1085
+	for (;;) {
1086
+		ncl++;							/* Next cluster */
1087
+		if (ncl >= fs->n_fatent) {		/* Check wrap around */
1088
+			ncl = 2;
1089
+			if (ncl > scl) return 0;	/* No free cluster */
1090
+		}
1091
+		cs = get_fat(fs, ncl);			/* Get the cluster status */
1092
+		if (cs == 0) break;				/* Found a free cluster */
1093
+		if (cs == 0xFFFFFFFF || cs == 1)/* An error occurred */
1094
+			return cs;
1095
+		if (ncl == scl) return 0;		/* No free cluster */
1096
+	}
1097
+
1098
+	res = put_fat(fs, ncl, 0x0FFFFFFF);	/* Mark the new cluster "last link" */
1099
+	if (res == FR_OK && clst != 0) {
1100
+		res = put_fat(fs, clst, ncl);	/* Link it to the previous one if needed */
1101
+	}
1102
+	if (res == FR_OK) {
1103
+		fs->last_clust = ncl;			/* Update FSINFO */
1104
+		if (fs->free_clust != 0xFFFFFFFF) {
1105
+			fs->free_clust--;
1106
+			fs->fsi_flag |= 1;
1107
+		}
1108
+	} else {
1109
+		ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1;
1110
+	}
1111
+
1112
+	return ncl;		/* Return new cluster number or error code */
1113
+}
1114
+#endif /* !_FS_READONLY */
1115
+
1116
+
1117
+
1118
+
1119
+/*-----------------------------------------------------------------------*/
1120
+/* FAT handling - Convert offset into cluster with link map table        */
1121
+/*-----------------------------------------------------------------------*/
1122
+
1123
+#if _USE_FASTSEEK
1124
+static
1125
+DWORD clmt_clust (	/* <2:Error, >=2:Cluster number */
1126
+	FIL* fp,		/* Pointer to the file object */
1127
+	DWORD ofs		/* File offset to be converted to cluster# */
1128
+)
1129
+{
1130
+	DWORD cl, ncl, *tbl;
1131
+
1132
+
1133
+	tbl = fp->cltbl + 1;	/* Top of CLMT */
1134
+	cl = ofs / SS(fp->fs) / fp->fs->csize;	/* Cluster order from top of the file */
1135
+	for (;;) {
1136
+		ncl = *tbl++;			/* Number of cluters in the fragment */
1137
+		if (!ncl) return 0;		/* End of table? (error) */
1138
+		if (cl < ncl) break;	/* In this fragment? */
1139
+		cl -= ncl; tbl++;		/* Next fragment */
1140
+	}
1141
+	return cl + *tbl;	/* Return the cluster number */
1142
+}
1143
+#endif	/* _USE_FASTSEEK */
1144
+
1145
+
1146
+
1147
+
1148
+/*-----------------------------------------------------------------------*/
1149
+/* Directory handling - Set directory index                              */
1150
+/*-----------------------------------------------------------------------*/
1151
+
1152
+static
1153
+FRESULT dir_sdi (
1154
+	DIR* dp,		/* Pointer to directory object */
1155
+	UINT idx		/* Index of directory table */
1156
+)
1157
+{
1158
+	DWORD clst, sect;
1159
+	UINT ic;
1160
+
1161
+
1162
+	dp->index = (WORD)idx;	/* Current index */
1163
+	clst = dp->sclust;		/* Table start cluster (0:root) */
1164
+	if (clst == 1 || clst >= dp->fs->n_fatent)	/* Check start cluster range */
1165
+		return FR_INT_ERR;
1166
+	if (!clst && dp->fs->fs_type == FS_FAT32)	/* Replace cluster# 0 with root cluster# if in FAT32 */
1167
+		clst = dp->fs->dirbase;
1168
+
1169
+	if (clst == 0) {	/* Static table (root-directory in FAT12/16) */
1170
+		if (idx >= dp->fs->n_rootdir)	/* Is index out of range? */
1171
+			return FR_INT_ERR;
1172
+		sect = dp->fs->dirbase;
1173
+	}
1174
+	else {				/* Dynamic table (root-directory in FAT32 or sub-directory) */
1175
+		ic = SS(dp->fs) / SZ_DIRE * dp->fs->csize;	/* Entries per cluster */
1176
+		while (idx >= ic) {	/* Follow cluster chain */
1177
+			clst = get_fat(dp->fs, clst);				/* Get next cluster */
1178
+			if (clst == 0xFFFFFFFF) return FR_DISK_ERR;	/* Disk error */
1179
+			if (clst < 2 || clst >= dp->fs->n_fatent)	/* Reached to end of table or internal error */
1180
+				return FR_INT_ERR;
1181
+			idx -= ic;
1182
+		}
1183
+		sect = clust2sect(dp->fs, clst);
1184
+	}
1185
+	dp->clust = clst;	/* Current cluster# */
1186
+	if (!sect) return FR_INT_ERR;
1187
+	dp->sect = sect + idx / (SS(dp->fs) / SZ_DIRE);					/* Sector# of the directory entry */
1188
+	dp->dir = dp->fs->win.d8 + (idx % (SS(dp->fs) / SZ_DIRE)) * SZ_DIRE;	/* Ptr to the entry in the sector */
1189
+
1190
+	return FR_OK;
1191
+}
1192
+
1193
+
1194
+
1195
+
1196
+/*-----------------------------------------------------------------------*/
1197
+/* Directory handling - Move directory table index next                  */
1198
+/*-----------------------------------------------------------------------*/
1199
+
1200
+static
1201
+FRESULT dir_next (	/* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */
1202
+	DIR* dp,		/* Pointer to the directory object */
1203
+	int stretch		/* 0: Do not stretch table, 1: Stretch table if needed */
1204
+)
1205
+{
1206
+	DWORD clst;
1207
+	UINT i;
1208
+#if !_FS_READONLY
1209
+	UINT c;
1210
+#endif
1211
+
1212
+
1213
+	i = dp->index + 1;
1214
+	if (!(i & 0xFFFF) || !dp->sect)	/* Report EOT when index has reached 65535 */
1215
+		return FR_NO_FILE;
1216
+
1217
+	if (!(i % (SS(dp->fs) / SZ_DIRE))) {	/* Sector changed? */
1218
+		dp->sect++;					/* Next sector */
1219
+
1220
+		if (!dp->clust) {		/* Static table */
1221
+			if (i >= dp->fs->n_rootdir)	/* Report EOT if it reached end of static table */
1222
+				return FR_NO_FILE;
1223
+		}
1224
+		else {					/* Dynamic table */
1225
+			if (((i / (SS(dp->fs) / SZ_DIRE)) & (dp->fs->csize - 1)) == 0) {	/* Cluster changed? */
1226
+				clst = get_fat(dp->fs, dp->clust);				/* Get next cluster */
1227
+				if (clst <= 1) return FR_INT_ERR;
1228
+				if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
1229
+				if (clst >= dp->fs->n_fatent) {					/* If it reached end of dynamic table, */
1230
+#if !_FS_READONLY
1231
+					if (!stretch) return FR_NO_FILE;			/* If do not stretch, report EOT */
1232
+					clst = create_chain(dp->fs, dp->clust);		/* Stretch cluster chain */
1233
+					if (clst == 0) return FR_DENIED;			/* No free cluster */
1234
+					if (clst == 1) return FR_INT_ERR;
1235
+					if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
1236
+					/* Clean-up stretched table */
1237
+					if (sync_window(dp->fs)) return FR_DISK_ERR;/* Flush disk access window */
1238
+					mem_set(dp->fs->win.d8, 0, SS(dp->fs));		/* Clear window buffer */
1239
+					dp->fs->winsect = clust2sect(dp->fs, clst);	/* Cluster start sector */
1240
+					for (c = 0; c < dp->fs->csize; c++) {		/* Fill the new cluster with 0 */
1241
+						dp->fs->wflag = 1;
1242
+						if (sync_window(dp->fs)) return FR_DISK_ERR;
1243
+						dp->fs->winsect++;
1244
+					}
1245
+					dp->fs->winsect -= c;						/* Rewind window offset */
1246
+#else
1247
+					if (!stretch) return FR_NO_FILE;			/* If do not stretch, report EOT (this is to suppress warning) */
1248
+					return FR_NO_FILE;							/* Report EOT */
1249
+#endif
1250
+				}
1251
+				dp->clust = clst;				/* Initialize data for new cluster */
1252
+				dp->sect = clust2sect(dp->fs, clst);
1253
+			}
1254
+		}
1255
+	}
1256
+
1257
+	dp->index = (WORD)i;	/* Current index */
1258
+	dp->dir = dp->fs->win.d8 + (i % (SS(dp->fs) / SZ_DIRE)) * SZ_DIRE;	/* Current entry in the window */
1259
+
1260
+	return FR_OK;
1261
+}
1262
+
1263
+
1264
+
1265
+
1266
+/*-----------------------------------------------------------------------*/
1267
+/* Directory handling - Reserve directory entry                          */
1268
+/*-----------------------------------------------------------------------*/
1269
+
1270
+#if !_FS_READONLY
1271
+static
1272
+FRESULT dir_alloc (
1273
+	DIR* dp,	/* Pointer to the directory object */
1274
+	UINT nent	/* Number of contiguous entries to allocate (1-21) */
1275
+)
1276
+{
1277
+	FRESULT res;
1278
+	UINT n;
1279
+
1280
+
1281
+	res = dir_sdi(dp, 0);
1282
+	if (res == FR_OK) {
1283
+		n = 0;
1284
+		do {
1285
+			res = move_window(dp->fs, dp->sect);
1286
+			if (res != FR_OK) break;
1287
+			if (dp->dir[0] == DDEM || dp->dir[0] == 0) {	/* Is it a free entry? */
1288
+				if (++n == nent) break;	/* A block of contiguous free entries is found */
1289
+			} else {
1290
+				n = 0;					/* Not a blank entry. Restart to search */
1291
+			}
1292
+			res = dir_next(dp, 1);		/* Next entry with table stretch enabled */
1293
+		} while (res == FR_OK);
1294
+	}
1295
+	if (res == FR_NO_FILE) res = FR_DENIED;	/* No directory entry to allocate */
1296
+	return res;
1297
+}
1298
+#endif
1299
+
1300
+
1301
+
1302
+
1303
+/*-----------------------------------------------------------------------*/
1304
+/* Directory handling - Load/Store start cluster number                  */
1305
+/*-----------------------------------------------------------------------*/
1306
+
1307
+static
1308
+DWORD ld_clust (
1309
+	FATFS* fs,	/* Pointer to the fs object */
1310
+	BYTE* dir	/* Pointer to the directory entry */
1311
+)
1312
+{
1313
+	DWORD cl;
1314
+
1315
+	cl = LD_WORD(dir + DIR_FstClusLO);
1316
+	if (fs->fs_type == FS_FAT32)
1317
+		cl |= (DWORD)LD_WORD(dir + DIR_FstClusHI) << 16;
1318
+
1319
+	return cl;
1320
+}
1321
+
1322
+
1323
+#if !_FS_READONLY
1324
+static
1325
+void st_clust (
1326
+	BYTE* dir,	/* Pointer to the directory entry */
1327
+	DWORD cl	/* Value to be set */
1328
+)
1329
+{
1330
+	ST_WORD(dir + DIR_FstClusLO, cl);
1331
+	ST_WORD(dir + DIR_FstClusHI, cl >> 16);
1332
+}
1333
+#endif
1334
+
1335
+
1336
+
1337
+
1338
+/*-----------------------------------------------------------------------*/
1339
+/* LFN handling - Test/Pick/Fit an LFN segment from/to directory entry   */
1340
+/*-----------------------------------------------------------------------*/
1341
+#if _USE_LFN
1342
+static
1343
+const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30};	/* Offset of LFN characters in the directory entry */
1344
+
1345
+
1346
+static
1347
+int cmp_lfn (			/* 1:Matched, 0:Not matched */
1348
+	WCHAR* lfnbuf,		/* Pointer to the LFN to be compared */
1349
+	BYTE* dir			/* Pointer to the directory entry containing a part of LFN */
1350
+)
1351
+{
1352
+	UINT i, s;
1353
+	WCHAR wc, uc;
1354
+
1355
+
1356
+	i = ((dir[LDIR_Ord] & ~LLEF) - 1) * 13;	/* Get offset in the LFN buffer */
1357
+	s = 0; wc = 1;
1358
+	do {
1359
+		uc = LD_WORD(dir + LfnOfs[s]);	/* Pick an LFN character from the entry */
1360
+		if (wc) {	/* Last character has not been processed */
1361
+			wc = ff_wtoupper(uc);		/* Convert it to upper case */
1362
+			if (i >= _MAX_LFN || wc != ff_wtoupper(lfnbuf[i++]))	/* Compare it */
1363
+				return 0;				/* Not matched */
1364
+		} else {
1365
+			if (uc != 0xFFFF) return 0;	/* Check filler */
1366
+		}
1367
+	} while (++s < 13);				/* Repeat until all characters in the entry are checked */
1368
+
1369
+	if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i])	/* Last segment matched but different length */
1370
+		return 0;
1371
+
1372
+	return 1;						/* The part of LFN matched */
1373
+}
1374
+
1375
+
1376
+
1377
+static
1378
+int pick_lfn (			/* 1:Succeeded, 0:Buffer overflow */
1379
+	WCHAR* lfnbuf,		/* Pointer to the Unicode-LFN buffer */
1380
+	BYTE* dir			/* Pointer to the directory entry */
1381
+)
1382
+{
1383
+	UINT i, s;
1384
+	WCHAR wc, uc;
1385
+
1386
+
1387
+	i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13;	/* Offset in the LFN buffer */
1388
+
1389
+	s = 0; wc = 1;
1390
+	do {
1391
+		uc = LD_WORD(dir + LfnOfs[s]);		/* Pick an LFN character from the entry */
1392
+		if (wc) {	/* Last character has not been processed */
1393
+			if (i >= _MAX_LFN) return 0;	/* Buffer overflow? */
1394
+			lfnbuf[i++] = wc = uc;			/* Store it */
1395
+		} else {
1396
+			if (uc != 0xFFFF) return 0;		/* Check filler */
1397
+		}
1398
+	} while (++s < 13);						/* Read all character in the entry */
1399
+
1400
+	if (dir[LDIR_Ord] & LLEF) {				/* Put terminator if it is the last LFN part */
1401
+		if (i >= _MAX_LFN) return 0;		/* Buffer overflow? */
1402
+		lfnbuf[i] = 0;
1403
+	}
1404
+
1405
+	return 1;
1406
+}
1407
+
1408
+
1409
+#if !_FS_READONLY
1410
+static
1411
+void fit_lfn (
1412
+	const WCHAR* lfnbuf,	/* Pointer to the LFN buffer */
1413
+	BYTE* dir,				/* Pointer to the directory entry */
1414
+	BYTE ord,				/* LFN order (1-20) */
1415
+	BYTE sum				/* SFN sum */
1416
+)
1417
+{
1418
+	UINT i, s;
1419
+	WCHAR wc;
1420
+
1421
+
1422
+	dir[LDIR_Chksum] = sum;			/* Set check sum */
1423
+	dir[LDIR_Attr] = AM_LFN;		/* Set attribute. LFN entry */
1424
+	dir[LDIR_Type] = 0;
1425
+	ST_WORD(dir + LDIR_FstClusLO, 0);
1426
+
1427
+	i = (ord - 1) * 13;				/* Get offset in the LFN buffer */
1428
+	s = wc = 0;
1429
+	do {
1430
+		if (wc != 0xFFFF) wc = lfnbuf[i++];	/* Get an effective character */
1431
+		ST_WORD(dir+LfnOfs[s], wc);	/* Put it */
1432
+		if (!wc) wc = 0xFFFF;		/* Padding characters following last character */
1433
+	} while (++s < 13);
1434
+	if (wc == 0xFFFF || !lfnbuf[i]) ord |= LLEF;	/* Bottom LFN part is the start of LFN sequence */
1435
+	dir[LDIR_Ord] = ord;			/* Set the LFN order */
1436
+}
1437
+
1438
+#endif
1439
+#endif
1440
+
1441
+
1442
+
1443
+
1444
+/*-----------------------------------------------------------------------*/
1445
+/* Create numbered name                                                  */
1446
+/*-----------------------------------------------------------------------*/
1447
+#if _USE_LFN
1448
+static
1449
+void gen_numname (
1450
+	BYTE* dst,			/* Pointer to the buffer to store numbered SFN */
1451
+	const BYTE* src,	/* Pointer to SFN */
1452
+	const WCHAR* lfn,	/* Pointer to LFN */
1453
+	UINT seq			/* Sequence number */
1454
+)
1455
+{
1456
+	BYTE ns[8], c;
1457
+	UINT i, j;
1458
+	WCHAR wc;
1459
+	DWORD sr;
1460
+
1461
+
1462
+	mem_cpy(dst, src, 11);
1463
+
1464
+	if (seq > 5) {	/* On many collisions, generate a hash number instead of sequential number */
1465
+		sr = seq;
1466
+		while (*lfn) {	/* Create a CRC */
1467
+			wc = *lfn++;
1468
+			for (i = 0; i < 16; i++) {
1469
+				sr = (sr << 1) + (wc & 1);
1470
+				wc >>= 1;
1471
+				if (sr & 0x10000) sr ^= 0x11021;
1472
+			}
1473
+		}
1474
+		seq = (UINT)sr;
1475
+	}
1476
+
1477
+	/* itoa (hexdecimal) */
1478
+	i = 7;
1479
+	do {
1480
+		c = (seq % 16) + '0';
1481
+		if (c > '9') c += 7;
1482
+		ns[i--] = c;
1483
+		seq /= 16;
1484
+	} while (seq);
1485
+	ns[i] = '~';
1486
+
1487
+	/* Append the number */
1488
+	for (j = 0; j < i && dst[j] != ' '; j++) {
1489
+		if (IsDBCS1(dst[j])) {
1490
+			if (j == i - 1) break;
1491
+			j++;
1492
+		}
1493
+	}
1494
+	do {
1495
+		dst[j++] = (i < 8) ? ns[i++] : ' ';
1496
+	} while (j < 8);
1497
+}
1498
+#endif
1499
+
1500
+
1501
+
1502
+
1503
+/*-----------------------------------------------------------------------*/
1504
+/* Calculate sum of an SFN                                               */
1505
+/*-----------------------------------------------------------------------*/
1506
+#if _USE_LFN
1507
+static
1508
+BYTE sum_sfn (
1509
+	const BYTE* dir		/* Pointer to the SFN entry */
1510
+)
1511
+{
1512
+	BYTE sum = 0;
1513
+	UINT n = 11;
1514
+
1515
+	do sum = (sum >> 1) + (sum << 7) + *dir++; while (--n);
1516
+	return sum;
1517
+}
1518
+#endif
1519
+
1520
+
1521
+
1522
+
1523
+/*-----------------------------------------------------------------------*/
1524
+/* Directory handling - Find an object in the directory                  */
1525
+/*-----------------------------------------------------------------------*/
1526
+
1527
+static
1528
+FRESULT dir_find (
1529
+	DIR* dp			/* Pointer to the directory object linked to the file name */
1530
+)
1531
+{
1532
+	FRESULT res;
1533
+	BYTE c, *dir;
1534
+#if _USE_LFN
1535
+	BYTE a, ord, sum;
1536
+#endif
1537
+
1538
+	res = dir_sdi(dp, 0);			/* Rewind directory object */
1539
+	if (res != FR_OK) return res;
1540
+
1541
+#if _USE_LFN
1542
+	ord = sum = 0xFF; dp->lfn_idx = 0xFFFF;	/* Reset LFN sequence */
1543
+#endif
1544
+	do {
1545
+		res = move_window(dp->fs, dp->sect);
1546
+		if (res != FR_OK) break;
1547
+		dir = dp->dir;					/* Ptr to the directory entry of current index */
1548
+		c = dir[DIR_Name];
1549
+		if (c == 0) { res = FR_NO_FILE; break; }	/* Reached to end of table */
1550
+#if _USE_LFN	/* LFN configuration */
1551
+		a = dir[DIR_Attr] & AM_MASK;
1552
+		if (c == DDEM || ((a & AM_VOL) && a != AM_LFN)) {	/* An entry without valid data */
1553
+			ord = 0xFF; dp->lfn_idx = 0xFFFF;	/* Reset LFN sequence */
1554
+		} else {
1555
+			if (a == AM_LFN) {			/* An LFN entry is found */
1556
+				if (dp->lfn) {
1557
+					if (c & LLEF) {		/* Is it start of LFN sequence? */
1558
+						sum = dir[LDIR_Chksum];
1559
+						c &= ~LLEF; ord = c;	/* LFN start order */
1560
+						dp->lfn_idx = dp->index;	/* Start index of LFN */
1561
+					}
1562
+					/* Check validity of the LFN entry and compare it with given name */
1563
+					ord = (c == ord && sum == dir[LDIR_Chksum] && cmp_lfn(dp->lfn, dir)) ? ord - 1 : 0xFF;
1564
+				}
1565
+			} else {					/* An SFN entry is found */
1566
+				if (!ord && sum == sum_sfn(dir)) break;	/* LFN matched? */
1567
+				if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dir, dp->fn, 11)) break;	/* SFN matched? */
1568
+				ord = 0xFF; dp->lfn_idx = 0xFFFF;	/* Reset LFN sequence */
1569
+			}
1570
+		}
1571
+#else		/* Non LFN configuration */
1572
+		if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dp->fn, 11)) /* Is it a valid entry? */
1573
+			break;
1574
+#endif
1575
+		res = dir_next(dp, 0);		/* Next entry */
1576
+	} while (res == FR_OK);
1577
+
1578
+	return res;
1579
+}
1580
+
1581
+
1582
+
1583
+
1584
+/*-----------------------------------------------------------------------*/
1585
+/* Read an object from the directory                                     */
1586
+/*-----------------------------------------------------------------------*/
1587
+#if _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2
1588
+static
1589
+FRESULT dir_read (
1590
+	DIR* dp,		/* Pointer to the directory object */
1591
+	int vol			/* Filtered by 0:file/directory or 1:volume label */
1592
+)
1593
+{
1594
+	FRESULT res;
1595
+	BYTE a, c, *dir;
1596
+#if _USE_LFN
1597
+	BYTE ord = 0xFF, sum = 0xFF;
1598
+#endif
1599
+
1600
+	res = FR_NO_FILE;
1601
+	while (dp->sect) {
1602
+		res = move_window(dp->fs, dp->sect);
1603
+		if (res != FR_OK) break;
1604
+		dir = dp->dir;					/* Ptr to the directory entry of current index */
1605
+		c = dir[DIR_Name];
1606
+		if (c == 0) { res = FR_NO_FILE; break; }	/* Reached to end of table */
1607
+		a = dir[DIR_Attr] & AM_MASK;
1608
+#if _USE_LFN	/* LFN configuration */
1609
+		if (c == DDEM || (!_FS_RPATH && c == '.') || (int)((a & ~AM_ARC) == AM_VOL) != vol) {	/* An entry without valid data */
1610
+			ord = 0xFF;
1611
+		} else {
1612
+			if (a == AM_LFN) {			/* An LFN entry is found */
1613
+				if (c & LLEF) {			/* Is it start of LFN sequence? */
1614
+					sum = dir[LDIR_Chksum];
1615
+					c &= ~LLEF; ord = c;
1616
+					dp->lfn_idx = dp->index;
1617
+				}
1618
+				/* Check LFN validity and capture it */
1619
+				ord = (c == ord && sum == dir[LDIR_Chksum] && pick_lfn(dp->lfn, dir)) ? ord - 1 : 0xFF;
1620
+			} else {					/* An SFN entry is found */
1621
+				if (ord || sum != sum_sfn(dir))	/* Is there a valid LFN? */
1622
+					dp->lfn_idx = 0xFFFF;		/* It has no LFN. */
1623
+				break;
1624
+			}
1625
+		}
1626
+#else		/* Non LFN configuration */
1627
+		if (c != DDEM && (_FS_RPATH || c != '.') && a != AM_LFN && (int)((a & ~AM_ARC) == AM_VOL) == vol)	/* Is it a valid entry? */
1628
+			break;
1629
+#endif
1630
+		res = dir_next(dp, 0);				/* Next entry */
1631
+		if (res != FR_OK) break;
1632
+	}
1633
+
1634
+	if (res != FR_OK) dp->sect = 0;
1635
+
1636
+	return res;
1637
+}
1638
+#endif	/* _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2 */
1639
+
1640
+
1641
+
1642
+
1643
+/*-----------------------------------------------------------------------*/
1644
+/* Register an object to the directory                                   */
1645
+/*-----------------------------------------------------------------------*/
1646
+#if !_FS_READONLY
1647
+static
1648
+FRESULT dir_register (	/* FR_OK:Successful, FR_DENIED:No free entry or too many SFN collision, FR_DISK_ERR:Disk error */
1649
+	DIR* dp				/* Target directory with object name to be created */
1650
+)
1651
+{
1652
+	FRESULT res;
1653
+#if _USE_LFN	/* LFN configuration */
1654
+	UINT n, nent;
1655
+	BYTE sn[12], *fn, sum;
1656
+	WCHAR *lfn;
1657
+
1658
+
1659
+	fn = dp->fn; lfn = dp->lfn;
1660
+	mem_cpy(sn, fn, 12);
1661
+
1662
+	if (_FS_RPATH && (sn[NSFLAG] & NS_DOT))		/* Cannot create dot entry */
1663
+		return FR_INVALID_NAME;
1664
+
1665
+	if (sn[NSFLAG] & NS_LOSS) {			/* When LFN is out of 8.3 format, generate a numbered name */
1666
+		fn[NSFLAG] = 0; dp->lfn = 0;			/* Find only SFN */
1667
+		for (n = 1; n < 100; n++) {
1668
+			gen_numname(fn, sn, lfn, n);	/* Generate a numbered name */
1669
+			res = dir_find(dp);				/* Check if the name collides with existing SFN */
1670
+			if (res != FR_OK) break;
1671
+		}
1672
+		if (n == 100) return FR_DENIED;		/* Abort if too many collisions */
1673
+		if (res != FR_NO_FILE) return res;	/* Abort if the result is other than 'not collided' */
1674
+		fn[NSFLAG] = sn[NSFLAG]; dp->lfn = lfn;
1675
+	}
1676
+
1677
+	if (sn[NSFLAG] & NS_LFN) {			/* When LFN is to be created, allocate entries for an SFN + LFNs. */
1678
+		for (n = 0; lfn[n]; n++) ;
1679
+		nent = (n + 25) / 13;
1680
+	} else {						/* Otherwise allocate an entry for an SFN  */
1681
+		nent = 1;
1682
+	}
1683
+	res = dir_alloc(dp, nent);		/* Allocate entries */
1684
+
1685
+	if (res == FR_OK && --nent) {	/* Set LFN entry if needed */
1686
+		res = dir_sdi(dp, dp->index - nent);
1687
+		if (res == FR_OK) {
1688
+			sum = sum_sfn(dp->fn);	/* Sum value of the SFN tied to the LFN */
1689
+			do {					/* Store LFN entries in bottom first */
1690
+				res = move_window(dp->fs, dp->sect);
1691
+				if (res != FR_OK) break;
1692
+				fit_lfn(dp->lfn, dp->dir, (BYTE)nent, sum);
1693
+				dp->fs->wflag = 1;
1694
+				res = dir_next(dp, 0);	/* Next entry */
1695
+			} while (res == FR_OK && --nent);
1696
+		}
1697
+	}
1698
+#else	/* Non LFN configuration */
1699
+	res = dir_alloc(dp, 1);		/* Allocate an entry for SFN */
1700
+#endif
1701
+
1702
+	if (res == FR_OK) {				/* Set SFN entry */
1703
+		res = move_window(dp->fs, dp->sect);
1704
+		if (res == FR_OK) {
1705
+			mem_set(dp->dir, 0, SZ_DIRE);	/* Clean the entry */
1706
+			mem_cpy(dp->dir, dp->fn, 11);	/* Put SFN */
1707
+#if _USE_LFN
1708
+			dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT);	/* Put NT flag */
1709
+#endif
1710
+			dp->fs->wflag = 1;
1711
+		}
1712
+	}
1713
+
1714
+	return res;
1715
+}
1716
+#endif /* !_FS_READONLY */
1717
+
1718
+
1719
+
1720
+
1721
+/*-----------------------------------------------------------------------*/
1722
+/* Remove an object from the directory                                   */
1723
+/*-----------------------------------------------------------------------*/
1724
+#if !_FS_READONLY && !_FS_MINIMIZE
1725
+static
1726
+FRESULT dir_remove (	/* FR_OK: Successful, FR_DISK_ERR: A disk error */
1727
+	DIR* dp				/* Directory object pointing the entry to be removed */
1728
+)
1729
+{
1730
+	FRESULT res;
1731
+#if _USE_LFN	/* LFN configuration */
1732
+	UINT i;
1733
+
1734
+	i = dp->index;	/* SFN index */
1735
+	res = dir_sdi(dp, (dp->lfn_idx == 0xFFFF) ? i : dp->lfn_idx);	/* Goto the SFN or top of the LFN entries */
1736
+	if (res == FR_OK) {
1737
+		do {
1738
+			res = move_window(dp->fs, dp->sect);
1739
+			if (res != FR_OK) break;
1740
+			mem_set(dp->dir, 0, SZ_DIRE);	/* Clear and mark the entry "deleted" */
1741
+			*dp->dir = DDEM;
1742
+			dp->fs->wflag = 1;
1743
+			if (dp->index >= i) break;	/* When reached SFN, all entries of the object has been deleted. */
1744
+			res = dir_next(dp, 0);		/* Next entry */
1745
+		} while (res == FR_OK);
1746
+		if (res == FR_NO_FILE) res = FR_INT_ERR;
1747
+	}
1748
+
1749
+#else			/* Non LFN configuration */
1750
+	res = dir_sdi(dp, dp->index);
1751
+	if (res == FR_OK) {
1752
+		res = move_window(dp->fs, dp->sect);
1753
+		if (res == FR_OK) {
1754
+			mem_set(dp->dir, 0, SZ_DIRE);	/* Clear and mark the entry "deleted" */
1755
+			*dp->dir = DDEM;
1756
+			dp->fs->wflag = 1;
1757
+		}
1758
+	}
1759
+#endif
1760
+
1761
+	return res;
1762
+}
1763
+#endif /* !_FS_READONLY */
1764
+
1765
+
1766
+
1767
+
1768
+/*-----------------------------------------------------------------------*/
1769
+/* Get file information from directory entry                             */
1770
+/*-----------------------------------------------------------------------*/
1771
+#if _FS_MINIMIZE <= 1 || _FS_RPATH >= 2
1772
+static
1773
+void get_fileinfo (		/* No return code */
1774
+	DIR* dp,			/* Pointer to the directory object */
1775
+	FILINFO* fno	 	/* Pointer to the file information to be filled */
1776
+)
1777
+{
1778
+	UINT i;
1779
+	TCHAR *p, c;
1780
+	BYTE *dir;
1781
+#if _USE_LFN
1782
+	WCHAR w, *lfn;
1783
+#endif
1784
+
1785
+	p = fno->fname;
1786
+	if (dp->sect) {		/* Get SFN */
1787
+		dir = dp->dir;
1788
+		i = 0;
1789
+		while (i < 11) {		/* Copy name body and extension */
1790
+			c = (TCHAR)dir[i++];
1791
+			if (c == ' ') continue;				/* Skip padding spaces */
1792
+			if (c == RDDEM) c = (TCHAR)DDEM;	/* Restore replaced DDEM character */
1793
+			if (i == 9) *p++ = '.';				/* Insert a . if extension is exist */
1794
+#if _USE_LFN
1795
+			if (IsUpper(c) && (dir[DIR_NTres] & (i >= 9 ? NS_EXT : NS_BODY)))
1796
+				c += 0x20;			/* To lower */
1797
+#if _LFN_UNICODE
1798
+			if (IsDBCS1(c) && i != 8 && i != 11 && IsDBCS2(dir[i]))
1799
+				c = c << 8 | dir[i++];
1800
+			c = ff_convert(c, 1);	/* OEM -> Unicode */
1801
+			if (!c) c = '?';
1802
+#endif
1803
+#endif
1804
+			*p++ = c;
1805
+		}
1806
+		fno->fattrib = dir[DIR_Attr];				/* Attribute */
1807
+		fno->fsize = LD_DWORD(dir + DIR_FileSize);	/* Size */
1808
+		fno->fdate = LD_WORD(dir + DIR_WrtDate);	/* Date */
1809
+		fno->ftime = LD_WORD(dir + DIR_WrtTime);	/* Time */
1810
+	}
1811
+	*p = 0;		/* Terminate SFN string by a \0 */
1812
+
1813
+#if _USE_LFN
1814
+	if (fno->lfname) {
1815
+		i = 0; p = fno->lfname;
1816
+		if (dp->sect && fno->lfsize && dp->lfn_idx != 0xFFFF) {	/* Get LFN if available */
1817
+			lfn = dp->lfn;
1818
+			while ((w = *lfn++) != 0) {		/* Get an LFN character */
1819
+#if !_LFN_UNICODE
1820
+				w = ff_convert(w, 0);		/* Unicode -> OEM */
1821
+				if (!w) { i = 0; break; }	/* No LFN if it could not be converted */
1822
+				if (_DF1S && w >= 0x100)	/* Put 1st byte if it is a DBC (always false on SBCS cfg) */
1823
+					p[i++] = (TCHAR)(w >> 8);
1824
+#endif
1825
+				if (i >= fno->lfsize - 1) { i = 0; break; }	/* No LFN if buffer overflow */
1826
+				p[i++] = (TCHAR)w;
1827
+			}
1828
+		}
1829
+		p[i] = 0;	/* Terminate LFN string by a \0 */
1830
+	}
1831
+#endif
1832
+}
1833
+#endif /* _FS_MINIMIZE <= 1 || _FS_RPATH >= 2 */
1834
+
1835
+
1836
+
1837
+
1838
+/*-----------------------------------------------------------------------*/
1839
+/* Pattern matching                                                      */
1840
+/*-----------------------------------------------------------------------*/
1841
+#if _USE_FIND && _FS_MINIMIZE <= 1
1842
+static
1843
+WCHAR get_achar (		/* Get a character and advances ptr 1 or 2 */
1844
+	const TCHAR** ptr	/* Pointer to pointer to the SBCS/DBCS/Unicode string */
1845
+)
1846
+{
1847
+	WCHAR chr;
1848
+
1849
+#if !_LFN_UNICODE
1850
+	chr = (BYTE)*(*ptr)++;					/* Get a byte */
1851
+	if (IsLower(chr)) chr -= 0x20;			/* To upper ASCII char */
1852
+	if (IsDBCS1(chr) && IsDBCS2(**ptr))		/* Get DBC 2nd byte if needed */
1853
+		chr = chr << 8 | (BYTE)*(*ptr)++;
1854
+#ifdef _EXCVT
1855
+	if (chr >= 0x80) chr = ExCvt[chr - 0x80];	/* To upper SBCS extended char */
1856
+#endif
1857
+#else
1858
+	chr = ff_wtoupper(*(*ptr)++);			/* Get a word and to upper */
1859
+#endif
1860
+	return chr;
1861
+}
1862
+
1863
+
1864
+static
1865
+int pattern_matching (	/* Return value: 0:mismatched, 1:matched */
1866
+	const TCHAR* pat,	/* Matching pattern */
1867
+	const TCHAR* nam,	/* String to be tested */
1868
+	int skip,			/* Number of pre-skip chars (number of ?s) */
1869
+	int inf				/* Infinite search (* specified) */
1870
+)
1871
+{
1872
+	const TCHAR *pp, *np;
1873
+	WCHAR pc, nc;
1874
+	int nm, nx;
1875
+
1876
+
1877
+	while (skip--) {				/* Pre-skip name chars */
1878
+		if (!get_achar(&nam)) return 0;	/* Branch mismatched if less name chars */
1879
+	}
1880
+	if (!*pat && inf) return 1;		/* (short circuit) */
1881
+
1882
+	do {
1883
+		pp = pat; np = nam;			/* Top of pattern and name to match */
1884
+		for (;;) {
1885
+			if (*pp == '?' || *pp == '*') {	/* Wildcard? */
1886
+				nm = nx = 0;
1887
+				do {				/* Analyze the wildcard chars */
1888
+					if (*pp++ == '?') nm++; else nx = 1;
1889
+				} while (*pp == '?' || *pp == '*');
1890
+				if (pattern_matching(pp, np, nm, nx)) return 1;	/* Test new branch (recurs upto number of wildcard blocks in the pattern) */
1891
+				nc = *np; break;	/* Branch mismatched */
1892
+			}
1893
+			pc = get_achar(&pp);	/* Get a pattern char */
1894
+			nc = get_achar(&np);	/* Get a name char */
1895
+			if (pc != nc) break;	/* Branch mismatched? */
1896
+			if (!pc) return 1;		/* Branch matched? (matched at end of both strings) */
1897
+		}
1898
+		get_achar(&nam);			/* nam++ */
1899
+	} while (inf && nc);			/* Retry until end of name if infinite search is specified */
1900
+
1901
+	return 0;
1902
+}
1903
+#endif /* _USE_FIND && _FS_MINIMIZE <= 1 */
1904
+
1905
+
1906
+
1907
+
1908
+/*-----------------------------------------------------------------------*/
1909
+/* Pick a segment and create the object name in directory form           */
1910
+/*-----------------------------------------------------------------------*/
1911
+
1912
+static
1913
+FRESULT create_name (
1914
+	DIR* dp,			/* Pointer to the directory object */
1915
+	const TCHAR** path	/* Pointer to pointer to the segment in the path string */
1916
+)
1917
+{
1918
+#if _USE_LFN	/* LFN configuration */
1919
+	BYTE b, cf;
1920
+	WCHAR w, *lfn;
1921
+	UINT i, ni, si, di;
1922
+	const TCHAR *p;
1923
+
1924
+	/* Create LFN in Unicode */
1925
+	for (p = *path; *p == '/' || *p == '\\'; p++) ;	/* Strip duplicated separator */
1926
+	lfn = dp->lfn;
1927
+	si = di = 0;
1928
+	for (;;) {
1929
+		w = p[si++];					/* Get a character */
1930
+		if (w < ' ' || w == '/' || w == '\\') break;	/* Break on end of segment */
1931
+		if (di >= _MAX_LFN)				/* Reject too long name */
1932
+			return FR_INVALID_NAME;
1933
+#if !_LFN_UNICODE
1934
+		w &= 0xFF;
1935
+		if (IsDBCS1(w)) {				/* Check if it is a DBC 1st byte (always false on SBCS cfg) */
1936
+#if _DF1S
1937
+			b = (BYTE)p[si++];			/* Get 2nd byte */
1938
+			w = (w << 8) + b;			/* Create a DBC */
1939
+			if (!IsDBCS2(b))
1940
+				return FR_INVALID_NAME;	/* Reject invalid sequence */
1941
+#endif
1942
+		}
1943
+		w = ff_convert(w, 1);			/* Convert ANSI/OEM to Unicode */
1944
+		if (!w) return FR_INVALID_NAME;	/* Reject invalid code */
1945
+#endif
1946
+		if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) /* Reject illegal characters for LFN */
1947
+			return FR_INVALID_NAME;
1948
+		lfn[di++] = w;					/* Store the Unicode character */
1949
+	}
1950
+	*path = &p[si];						/* Return pointer to the next segment */
1951
+	cf = (w < ' ') ? NS_LAST : 0;		/* Set last segment flag if end of path */
1952
+#if _FS_RPATH
1953
+	if ((di == 1 && lfn[di - 1] == '.') || /* Is this a dot entry? */
1954
+		(di == 2 && lfn[di - 1] == '.' && lfn[di - 2] == '.')) {
1955
+		lfn[di] = 0;
1956
+		for (i = 0; i < 11; i++)
1957
+			dp->fn[i] = (i < di) ? '.' : ' ';
1958
+		dp->fn[i] = cf | NS_DOT;		/* This is a dot entry */
1959
+		return FR_OK;
1960
+	}
1961
+#endif
1962
+	while (di) {						/* Strip trailing spaces and dots */
1963
+		w = lfn[di - 1];
1964
+		if (w != ' ' && w != '.') break;
1965
+		di--;
1966
+	}
1967
+	if (!di) return FR_INVALID_NAME;	/* Reject nul string */
1968
+
1969
+	lfn[di] = 0;						/* LFN is created */
1970
+
1971
+	/* Create SFN in directory form */
1972
+	mem_set(dp->fn, ' ', 11);
1973
+	for (si = 0; lfn[si] == ' ' || lfn[si] == '.'; si++) ;	/* Strip leading spaces and dots */
1974
+	if (si) cf |= NS_LOSS | NS_LFN;
1975
+	while (di && lfn[di - 1] != '.') di--;	/* Find extension (di<=si: no extension) */
1976
+
1977
+	b = i = 0; ni = 8;
1978
+	for (;;) {
1979
+		w = lfn[si++];					/* Get an LFN character */
1980
+		if (!w) break;					/* Break on end of the LFN */
1981
+		if (w == ' ' || (w == '.' && si != di)) {	/* Remove spaces and dots */
1982
+			cf |= NS_LOSS | NS_LFN; continue;
1983
+		}
1984
+
1985
+		if (i >= ni || si == di) {		/* Extension or end of SFN */
1986
+			if (ni == 11) {				/* Long extension */
1987
+				cf |= NS_LOSS | NS_LFN; break;
1988
+			}
1989
+			if (si != di) cf |= NS_LOSS | NS_LFN;	/* Out of 8.3 format */
1990
+			if (si > di) break;			/* No extension */
1991
+			si = di; i = 8; ni = 11;	/* Enter extension section */
1992
+			b <<= 2; continue;
1993
+		}
1994
+
1995
+		if (w >= 0x80) {				/* Non ASCII character */
1996
+#ifdef _EXCVT
1997
+			w = ff_convert(w, 0);		/* Unicode -> OEM code */
1998
+			if (w) w = ExCvt[w - 0x80];	/* Convert extended character to upper (SBCS) */
1999
+#else
2000
+			w = ff_convert(ff_wtoupper(w), 0);	/* Upper converted Unicode -> OEM code */
2001
+#endif
2002
+			cf |= NS_LFN;				/* Force create LFN entry */
2003
+		}
2004
+
2005
+		if (_DF1S && w >= 0x100) {		/* DBC (always false at SBCS cfg) */
2006
+			if (i >= ni - 1) {
2007
+				cf |= NS_LOSS | NS_LFN; i = ni; continue;
2008
+			}
2009
+			dp->fn[i++] = (BYTE)(w >> 8);
2010
+		} else {						/* SBC */
2011
+			if (!w || chk_chr("+,;=[]", w)) {	/* Replace illegal characters for SFN */
2012
+				w = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */
2013
+			} else {
2014
+				if (IsUpper(w)) {		/* ASCII large capital */
2015
+					b |= 2;
2016
+				} else {
2017
+					if (IsLower(w)) {	/* ASCII small capital */
2018
+						b |= 1; w -= 0x20;
2019
+					}
2020
+				}
2021
+			}
2022
+		}
2023
+		dp->fn[i++] = (BYTE)w;
2024
+	}
2025
+
2026
+	if (dp->fn[0] == DDEM) dp->fn[0] = RDDEM;	/* If the first character collides with deleted mark, replace it with RDDEM */
2027
+
2028
+	if (ni == 8) b <<= 2;
2029
+	if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03)	/* Create LFN entry when there are composite capitals */
2030
+		cf |= NS_LFN;
2031
+	if (!(cf & NS_LFN)) {						/* When LFN is in 8.3 format without extended character, NT flags are created */
2032
+		if ((b & 0x03) == 0x01) cf |= NS_EXT;	/* NT flag (Extension has only small capital) */
2033
+		if ((b & 0x0C) == 0x04) cf |= NS_BODY;	/* NT flag (Filename has only small capital) */
2034
+	}
2035
+
2036
+	dp->fn[NSFLAG] = cf;	/* SFN is created */
2037
+
2038
+	return FR_OK;
2039
+
2040
+
2041
+#else	/* Non-LFN configuration */
2042
+	BYTE b, c, d, *sfn;
2043
+	UINT ni, si, i;
2044
+	const char *p;
2045
+
2046
+	/* Create file name in directory form */
2047
+	for (p = *path; *p == '/' || *p == '\\'; p++) ;	/* Strip duplicated separator */
2048
+	sfn = dp->fn;
2049
+	mem_set(sfn, ' ', 11);
2050
+	si = i = b = 0; ni = 8;
2051
+#if _FS_RPATH
2052
+	if (p[si] == '.') { /* Is this a dot entry? */
2053
+		for (;;) {
2054
+			c = (BYTE)p[si++];
2055
+			if (c != '.' || si >= 3) break;
2056
+			sfn[i++] = c;
2057
+		}
2058
+		if (c != '/' && c != '\\' && c > ' ') return FR_INVALID_NAME;
2059
+		*path = &p[si];									/* Return pointer to the next segment */
2060
+		sfn[NSFLAG] = (c <= ' ') ? NS_LAST | NS_DOT : NS_DOT;	/* Set last segment flag if end of path */
2061
+		return FR_OK;
2062
+	}
2063
+#endif
2064
+	for (;;) {
2065
+		c = (BYTE)p[si++];
2066
+		if (c <= ' ' || c == '/' || c == '\\') break;	/* Break on end of segment */
2067
+		if (c == '.' || i >= ni) {
2068
+			if (ni != 8 || c != '.') return FR_INVALID_NAME;
2069
+			i = 8; ni = 11;
2070
+			b <<= 2; continue;
2071
+		}
2072
+		if (c >= 0x80) {				/* Extended character? */
2073
+			b |= 3;						/* Eliminate NT flag */
2074
+#ifdef _EXCVT
2075
+			c = ExCvt[c - 0x80];		/* To upper extended characters (SBCS cfg) */
2076
+#else
2077
+#if !_DF1S
2078
+			return FR_INVALID_NAME;		/* Reject extended characters (ASCII cfg) */
2079
+#endif
2080
+#endif
2081
+		}
2082
+		if (IsDBCS1(c)) {				/* Check if it is a DBC 1st byte (always false on SBCS cfg) */
2083
+			d = (BYTE)p[si++];			/* Get 2nd byte */
2084
+			if (!IsDBCS2(d) || i >= ni - 1)	/* Reject invalid DBC */
2085
+				return FR_INVALID_NAME;
2086
+			sfn[i++] = c;
2087
+			sfn[i++] = d;
2088
+		} else {						/* SBC */
2089
+			if (chk_chr("\"*+,:;<=>\?[]|\x7F", c))	/* Reject illegal chrs for SFN */
2090
+				return FR_INVALID_NAME;
2091
+			if (IsUpper(c)) {			/* ASCII large capital? */
2092
+				b |= 2;
2093
+			} else {
2094
+				if (IsLower(c)) {		/* ASCII small capital? */
2095
+					b |= 1; c -= 0x20;
2096
+				}
2097
+			}
2098
+			sfn[i++] = c;
2099
+		}
2100
+	}
2101
+	*path = &p[si];						/* Return pointer to the next segment */
2102
+	c = (c <= ' ') ? NS_LAST : 0;		/* Set last segment flag if end of path */
2103
+
2104
+	if (!i) return FR_INVALID_NAME;		/* Reject nul string */
2105
+	if (sfn[0] == DDEM) sfn[0] = RDDEM;	/* When first character collides with DDEM, replace it with RDDEM */
2106
+
2107
+	if (ni == 8) b <<= 2;
2108
+	if ((b & 0x03) == 0x01) c |= NS_EXT;	/* NT flag (Name extension has only small capital) */
2109
+	if ((b & 0x0C) == 0x04) c |= NS_BODY;	/* NT flag (Name body has only small capital) */
2110
+
2111
+	sfn[NSFLAG] = c;		/* Store NT flag, File name is created */
2112
+
2113
+	return FR_OK;
2114
+#endif
2115
+}
2116
+
2117
+
2118
+
2119
+
2120
+/*-----------------------------------------------------------------------*/
2121
+/* Follow a file path                                                    */
2122
+/*-----------------------------------------------------------------------*/
2123
+
2124
+static
2125
+FRESULT follow_path (	/* FR_OK(0): successful, !=0: error code */
2126
+	DIR* dp,			/* Directory object to return last directory and found object */
2127
+	const TCHAR* path	/* Full-path string to find a file or directory */
2128
+)
2129
+{
2130
+	FRESULT res;
2131
+	BYTE *dir, ns;
2132
+
2133
+
2134
+#if _FS_RPATH
2135
+	if (*path == '/' || *path == '\\') {	/* There is a heading separator */
2136
+		path++;	dp->sclust = 0;				/* Strip it and start from the root directory */
2137
+	} else {								/* No heading separator */
2138
+		dp->sclust = dp->fs->cdir;			/* Start from the current directory */
2139
+	}
2140
+#else
2141
+	if (*path == '/' || *path == '\\')		/* Strip heading separator if exist */
2142
+		path++;
2143
+	dp->sclust = 0;							/* Always start from the root directory */
2144
+#endif
2145
+
2146
+	if ((UINT)*path < ' ') {				/* Null path name is the origin directory itself */
2147
+		res = dir_sdi(dp, 0);
2148
+		dp->dir = 0;
2149
+	} else {								/* Follow path */
2150
+		for (;;) {
2151
+			res = create_name(dp, &path);	/* Get a segment name of the path */
2152
+			if (res != FR_OK) break;
2153
+			res = dir_find(dp);				/* Find an object with the sagment name */
2154
+			ns = dp->fn[NSFLAG];
2155
+			if (res != FR_OK) {				/* Failed to find the object */
2156
+				if (res == FR_NO_FILE) {	/* Object is not found */
2157
+					if (_FS_RPATH && (ns & NS_DOT)) {	/* If dot entry is not exist, */
2158
+						dp->sclust = 0; dp->dir = 0;	/* it is the root directory and stay there */
2159
+						if (!(ns & NS_LAST)) continue;	/* Continue to follow if not last segment */
2160
+						res = FR_OK;					/* Ended at the root directroy. Function completed. */
2161
+					} else {							/* Could not find the object */
2162
+						if (!(ns & NS_LAST)) res = FR_NO_PATH;	/* Adjust error code if not last segment */
2163
+					}
2164
+				}
2165
+				break;
2166
+			}
2167
+			if (ns & NS_LAST) break;			/* Last segment matched. Function completed. */
2168
+			dir = dp->dir;						/* Follow the sub-directory */
2169
+			if (!(dir[DIR_Attr] & AM_DIR)) {	/* It is not a sub-directory and cannot follow */
2170
+				res = FR_NO_PATH; break;
2171
+			}
2172
+			dp->sclust = ld_clust(dp->fs, dir);
2173
+		}
2174
+	}
2175
+
2176
+	return res;
2177
+}
2178
+
2179
+
2180
+
2181
+
2182
+/*-----------------------------------------------------------------------*/
2183
+/* Get logical drive number from path name                               */
2184
+/*-----------------------------------------------------------------------*/
2185
+
2186
+static
2187
+int get_ldnumber (		/* Returns logical drive number (-1:invalid drive) */
2188
+	const TCHAR** path	/* Pointer to pointer to the path name */
2189
+)
2190
+{
2191
+	const TCHAR *tp, *tt;
2192
+	UINT i;
2193
+	int vol = -1;
2194
+#if _STR_VOLUME_ID		/* Find string drive id */
2195
+	static const char* const str[] = {_VOLUME_STRS};
2196
+	const char *sp;
2197
+	char c;
2198
+	TCHAR tc;
2199
+#endif
2200
+
2201
+
2202
+	if (*path) {	/* If the pointer is not a null */
2203
+		for (tt = *path; (UINT)*tt >= (_USE_LFN ? ' ' : '!') && *tt != ':'; tt++) ;	/* Find ':' in the path */
2204
+		if (*tt == ':') {	/* If a ':' is exist in the path name */
2205
+			tp = *path;
2206
+			i = *tp++ - '0'; 
2207
+			if (i < 10 && tp == tt) {	/* Is there a numeric drive id? */
2208
+				if (i < _VOLUMES) {	/* If a drive id is found, get the value and strip it */
2209
+					vol = (int)i;
2210
+					*path = ++tt;
2211
+				}
2212
+			}
2213
+#if _STR_VOLUME_ID
2214
+			 else {	/* No numeric drive number, find string drive id */
2215
+				i = 0; tt++;
2216
+				do {
2217
+					sp = str[i]; tp = *path;
2218
+					do {	/* Compare a string drive id with path name */
2219
+						c = *sp++; tc = *tp++;
2220
+						if (IsLower(tc)) tc -= 0x20;
2221
+					} while (c && (TCHAR)c == tc);
2222
+				} while ((c || tp != tt) && ++i < _VOLUMES);	/* Repeat for each id until pattern match */
2223
+				if (i < _VOLUMES) {	/* If a drive id is found, get the value and strip it */
2224
+					vol = (int)i;
2225
+					*path = tt;
2226
+				}
2227
+			}
2228
+#endif
2229
+			return vol;
2230
+		}
2231
+#if _FS_RPATH && _VOLUMES >= 2
2232
+		vol = CurrVol;	/* Current drive */
2233
+#else
2234
+		vol = 0;		/* Drive 0 */
2235
+#endif
2236
+	}
2237
+	return vol;
2238
+}
2239
+
2240
+
2241
+
2242
+
2243
+/*-----------------------------------------------------------------------*/
2244
+/* Load a sector and check if it is an FAT boot sector                   */
2245
+/*-----------------------------------------------------------------------*/
2246
+
2247
+static
2248
+BYTE check_fs (	/* 0:FAT boor sector, 1:Valid boor sector but not FAT, 2:Not a boot sector, 3:Disk error */
2249
+	FATFS* fs,	/* File system object */
2250
+	DWORD sect	/* Sector# (lba) to check if it is an FAT boot record or not */
2251
+)
2252
+{
2253
+	fs->wflag = 0; fs->winsect = 0xFFFFFFFF;	/* Invaidate window */
2254
+	if (move_window(fs, sect) != FR_OK)			/* Load boot record */
2255
+		return 3;
2256
+
2257
+	if (LD_WORD(&fs->win.d8[BS_55AA]) != 0xAA55)	/* Check boot record signature (always placed at offset 510 even if the sector size is >512) */
2258
+		return 2;
2259
+
2260
+	if ((LD_DWORD(&fs->win.d8[BS_FilSysType]) & 0xFFFFFF) == 0x544146)		/* Check "FAT" string */
2261
+		return 0;
2262
+	if ((LD_DWORD(&fs->win.d8[BS_FilSysType32]) & 0xFFFFFF) == 0x544146)	/* Check "FAT" string */
2263
+		return 0;
2264
+
2265
+	return 1;
2266
+}
2267
+
2268
+
2269
+
2270
+
2271
+/*-----------------------------------------------------------------------*/
2272
+/* Find logical drive and check if the volume is mounted                 */
2273
+/*-----------------------------------------------------------------------*/
2274
+
2275
+static
2276
+FRESULT find_volume (	/* FR_OK(0): successful, !=0: any error occurred */
2277
+	FATFS** rfs,		/* Pointer to pointer to the found file system object */
2278
+	const TCHAR** path,	/* Pointer to pointer to the path name (drive number) */
2279
+	BYTE wmode			/* !=0: Check write protection for write access */
2280
+)
2281
+{
2282
+	BYTE fmt, *pt;
2283
+	int vol;
2284
+	DSTATUS stat;
2285
+	DWORD bsect, fasize, tsect, sysect, nclst, szbfat, br[4];
2286
+	WORD nrsv;
2287
+	FATFS *fs;
2288
+	UINT i;
2289
+
2290
+
2291
+	/* Get logical drive number from the path name */
2292
+	*rfs = 0;
2293
+	vol = get_ldnumber(path);
2294
+	if (vol < 0) return FR_INVALID_DRIVE;
2295
+
2296
+	/* Check if the file system object is valid or not */
2297
+	fs = FatFs[vol];					/* Get pointer to the file system object */
2298
+	if (!fs) return FR_NOT_ENABLED;		/* Is the file system object available? */
2299
+
2300
+	ENTER_FF(fs);						/* Lock the volume */
2301
+	*rfs = fs;							/* Return pointer to the file system object */
2302
+
2303
+	if (fs->fs_type) {					/* If the volume has been mounted */
2304
+		stat = disk_status(fs->drv);
2305
+		if (!(stat & STA_NOINIT)) {		/* and the physical drive is kept initialized */
2306
+			if (!_FS_READONLY && wmode && (stat & STA_PROTECT))	/* Check write protection if needed */
2307
+				return FR_WRITE_PROTECTED;
2308
+			return FR_OK;				/* The file system object is valid */
2309
+		}
2310
+	}
2311
+
2312
+	/* The file system object is not valid. */
2313
+	/* Following code attempts to mount the volume. (analyze BPB and initialize the fs object) */
2314
+
2315
+	fs->fs_type = 0;					/* Clear the file system object */
2316
+	fs->drv = LD2PD(vol);				/* Bind the logical drive and a physical drive */
2317
+	stat = disk_initialize(fs->drv);	/* Initialize the physical drive */
2318
+	if (stat & STA_NOINIT)				/* Check if the initialization succeeded */
2319
+		return FR_NOT_READY;			/* Failed to initialize due to no medium or hard error */
2320
+	if (!_FS_READONLY && wmode && (stat & STA_PROTECT))	/* Check disk write protection if needed */
2321
+		return FR_WRITE_PROTECTED;
2322
+#if _MAX_SS != _MIN_SS						/* Get sector size (multiple sector size cfg only) */
2323
+	if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK
2324
+		|| SS(fs) < _MIN_SS || SS(fs) > _MAX_SS) return FR_DISK_ERR;
2325
+#endif
2326
+	/* Find an FAT partition on the drive. Supports only generic partitioning, FDISK and SFD. */
2327
+	bsect = 0;
2328
+	fmt = check_fs(fs, bsect);					/* Load sector 0 and check if it is an FAT boot sector as SFD */
2329
+	if (fmt == 1 || (!fmt && (LD2PT(vol)))) {	/* Not an FAT boot sector or forced partition number */
2330
+		for (i = 0; i < 4; i++) {			/* Get partition offset */
2331
+			pt = fs->win.d8 + MBR_Table + i * SZ_PTE;
2332
+			br[i] = pt[4] ? LD_DWORD(&pt[8]) : 0;
2333
+		}
2334
+		i = LD2PT(vol);						/* Partition number: 0:auto, 1-4:forced */
2335
+		if (i) i--;
2336
+		do {								/* Find an FAT volume */
2337
+			bsect = br[i];
2338
+			fmt = bsect ? check_fs(fs, bsect) : 2;	/* Check the partition */
2339
+		} while (!LD2PT(vol) && fmt && ++i < 4);
2340
+	}
2341
+	if (fmt == 3) return FR_DISK_ERR;		/* An error occured in the disk I/O layer */
2342
+	if (fmt) return FR_NO_FILESYSTEM;		/* No FAT volume is found */
2343
+
2344
+	/* An FAT volume is found. Following code initializes the file system object */
2345
+
2346
+	if (LD_WORD(fs->win.d8 + BPB_BytsPerSec) != SS(fs))	/* (BPB_BytsPerSec must be equal to the physical sector size) */
2347
+		return FR_NO_FILESYSTEM;
2348
+
2349
+	fasize = LD_WORD(fs->win.d8 + BPB_FATSz16);			/* Number of sectors per FAT */
2350
+	if (!fasize) fasize = LD_DWORD(fs->win.d8 + BPB_FATSz32);
2351
+	fs->fsize = fasize;
2352
+
2353
+	fs->n_fats = fs->win.d8[BPB_NumFATs];					/* Number of FAT copies */
2354
+	if (fs->n_fats != 1 && fs->n_fats != 2)				/* (Must be 1 or 2) */
2355
+		return FR_NO_FILESYSTEM;
2356
+	fasize *= fs->n_fats;								/* Number of sectors for FAT area */
2357
+
2358
+	fs->csize = fs->win.d8[BPB_SecPerClus];				/* Number of sectors per cluster */
2359
+	if (!fs->csize || (fs->csize & (fs->csize - 1)))	/* (Must be power of 2) */
2360
+		return FR_NO_FILESYSTEM;
2361
+
2362
+	fs->n_rootdir = LD_WORD(fs->win.d8 + BPB_RootEntCnt);	/* Number of root directory entries */
2363
+	if (fs->n_rootdir % (SS(fs) / SZ_DIRE))				/* (Must be sector aligned) */
2364
+		return FR_NO_FILESYSTEM;
2365
+
2366
+	tsect = LD_WORD(fs->win.d8 + BPB_TotSec16);			/* Number of sectors on the volume */
2367
+	if (!tsect) tsect = LD_DWORD(fs->win.d8 + BPB_TotSec32);
2368
+
2369
+	nrsv = LD_WORD(fs->win.d8 + BPB_RsvdSecCnt);			/* Number of reserved sectors */
2370
+	if (!nrsv) return FR_NO_FILESYSTEM;					/* (Must not be 0) */
2371
+
2372
+	/* Determine the FAT sub type */
2373
+	sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZ_DIRE);	/* RSV + FAT + DIR */
2374
+	if (tsect < sysect) return FR_NO_FILESYSTEM;		/* (Invalid volume size) */
2375
+	nclst = (tsect - sysect) / fs->csize;				/* Number of clusters */
2376
+	if (!nclst) return FR_NO_FILESYSTEM;				/* (Invalid volume size) */
2377
+	fmt = FS_FAT12;
2378
+	if (nclst >= MIN_FAT16) fmt = FS_FAT16;
2379
+	if (nclst >= MIN_FAT32) fmt = FS_FAT32;
2380
+
2381
+	/* Boundaries and Limits */
2382
+	fs->n_fatent = nclst + 2;							/* Number of FAT entries */
2383
+	fs->volbase = bsect;								/* Volume start sector */
2384
+	fs->fatbase = bsect + nrsv; 						/* FAT start sector */
2385
+	fs->database = bsect + sysect;						/* Data start sector */
2386
+	if (fmt == FS_FAT32) {
2387
+		if (fs->n_rootdir) return FR_NO_FILESYSTEM;		/* (BPB_RootEntCnt must be 0) */
2388
+		fs->dirbase = LD_DWORD(fs->win.d8 + BPB_RootClus);	/* Root directory start cluster */
2389
+		szbfat = fs->n_fatent * 4;						/* (Needed FAT size) */
2390
+	} else {
2391
+		if (!fs->n_rootdir)	return FR_NO_FILESYSTEM;	/* (BPB_RootEntCnt must not be 0) */
2392
+		fs->dirbase = fs->fatbase + fasize;				/* Root directory start sector */
2393
+		szbfat = (fmt == FS_FAT16) ?					/* (Needed FAT size) */
2394
+			fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
2395
+	}
2396
+	if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs))	/* (BPB_FATSz must not be less than the size needed) */
2397
+		return FR_NO_FILESYSTEM;
2398
+
2399
+#if !_FS_READONLY
2400
+	/* Initialize cluster allocation information */
2401
+	fs->last_clust = fs->free_clust = 0xFFFFFFFF;
2402
+
2403
+	/* Get fsinfo if available */
2404
+	fs->fsi_flag = 0x80;
2405
+#if (_FS_NOFSINFO & 3) != 3
2406
+	if (fmt == FS_FAT32				/* Enable FSINFO only if FAT32 and BPB_FSInfo is 1 */
2407
+		&& LD_WORD(fs->win.d8 + BPB_FSInfo) == 1
2408
+		&& move_window(fs, bsect + 1) == FR_OK)
2409
+	{
2410
+		fs->fsi_flag = 0;
2411
+		if (LD_WORD(fs->win.d8 + BS_55AA) == 0xAA55	/* Load FSINFO data if available */
2412
+			&& LD_DWORD(fs->win.d8 + FSI_LeadSig) == 0x41615252
2413
+			&& LD_DWORD(fs->win.d8 + FSI_StrucSig) == 0x61417272)
2414
+		{
2415
+#if (_FS_NOFSINFO & 1) == 0
2416
+			fs->free_clust = LD_DWORD(fs->win.d8 + FSI_Free_Count);
2417
+#endif
2418
+#if (_FS_NOFSINFO & 2) == 0
2419
+			fs->last_clust = LD_DWORD(fs->win.d8 + FSI_Nxt_Free);
2420
+#endif
2421
+		}
2422
+	}
2423
+#endif
2424
+#endif
2425
+	fs->fs_type = fmt;	/* FAT sub-type */
2426
+	fs->id = ++Fsid;	/* File system mount ID */
2427
+#if _FS_RPATH
2428
+	fs->cdir = 0;		/* Set current directory to root */
2429
+#endif
2430
+#if _FS_LOCK			/* Clear file lock semaphores */
2431
+	clear_lock(fs);
2432
+#endif
2433
+
2434
+	return FR_OK;
2435
+}
2436
+
2437
+
2438
+
2439
+
2440
+/*-----------------------------------------------------------------------*/
2441
+/* Check if the file/directory object is valid or not                    */
2442
+/*-----------------------------------------------------------------------*/
2443
+
2444
+static
2445
+FRESULT validate (	/* FR_OK(0): The object is valid, !=0: Invalid */
2446
+	void* obj		/* Pointer to the object FIL/DIR to check validity */
2447
+)
2448
+{
2449
+	FIL *fil = (FIL*)obj;	/* Assuming offset of .fs and .id in the FIL/DIR structure is identical */
2450
+
2451
+
2452
+	if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id || (disk_status(fil->fs->drv) & STA_NOINIT))
2453
+		return FR_INVALID_OBJECT;
2454
+
2455
+	ENTER_FF(fil->fs);		/* Lock file system */
2456
+
2457
+	return FR_OK;
2458
+}
2459
+
2460
+
2461
+
2462
+
2463
+/*--------------------------------------------------------------------------
2464
+
2465
+   Public Functions
2466
+
2467
+--------------------------------------------------------------------------*/
2468
+
2469
+
2470
+
2471
+/*-----------------------------------------------------------------------*/
2472
+/* Mount/Unmount a Logical Drive                                         */
2473
+/*-----------------------------------------------------------------------*/
2474
+
2475
+FRESULT f_mount (
2476
+	FATFS* fs,			/* Pointer to the file system object (NULL:unmount)*/
2477
+	const TCHAR* path,	/* Logical drive number to be mounted/unmounted */
2478
+	BYTE opt			/* 0:Do not mount (delayed mount), 1:Mount immediately */
2479
+)
2480
+{
2481
+	FATFS *cfs;
2482
+	int vol;
2483
+	FRESULT res;
2484
+	const TCHAR *rp = path;
2485
+
2486
+
2487
+	vol = get_ldnumber(&rp);
2488
+	if (vol < 0) return FR_INVALID_DRIVE;
2489
+	cfs = FatFs[vol];					/* Pointer to fs object */
2490
+
2491
+	if (cfs) {
2492
+#if _FS_LOCK
2493
+		clear_lock(cfs);
2494
+#endif
2495
+#if _FS_REENTRANT						/* Discard sync object of the current volume */
2496
+		if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR;
2497
+#endif
2498
+		cfs->fs_type = 0;				/* Clear old fs object */
2499
+	}
2500
+
2501
+	if (fs) {
2502
+		fs->fs_type = 0;				/* Clear new fs object */
2503
+#if _FS_REENTRANT						/* Create sync object for the new volume */
2504
+		if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR;
2505
+#endif
2506
+	}
2507
+	FatFs[vol] = fs;					/* Register new fs object */
2508
+
2509
+	if (!fs || opt != 1) return FR_OK;	/* Do not mount now, it will be mounted later */
2510
+
2511
+	res = find_volume(&fs, &path, 0);	/* Force mounted the volume */
2512
+	LEAVE_FF(fs, res);
2513
+}
2514
+
2515
+
2516
+
2517
+
2518
+/*-----------------------------------------------------------------------*/
2519
+/* Open or Create a File                                                 */
2520
+/*-----------------------------------------------------------------------*/
2521
+
2522
+FRESULT f_open (
2523
+	FIL* fp,			/* Pointer to the blank file object */
2524
+	const TCHAR* path,	/* Pointer to the file name */
2525
+	BYTE mode			/* Access mode and file open mode flags */
2526
+)
2527
+{
2528
+	FRESULT res;
2529
+	DIR dj;
2530
+	BYTE *dir;
2531
+	DEFINE_NAMEBUF;
2532
+#if !_FS_READONLY
2533
+	DWORD dw, cl;
2534
+#endif
2535
+
2536
+
2537
+	if (!fp) return FR_INVALID_OBJECT;
2538
+	fp->fs = 0;			/* Clear file object */
2539
+
2540
+	/* Get logical drive number */
2541
+#if !_FS_READONLY
2542
+	mode &= FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW;
2543
+	res = find_volume(&dj.fs, &path, (BYTE)(mode & ~FA_READ));
2544
+#else
2545
+	mode &= FA_READ;
2546
+	res = find_volume(&dj.fs, &path, 0);
2547
+#endif
2548
+	if (res == FR_OK) {
2549
+		INIT_BUF(dj);
2550
+		res = follow_path(&dj, path);	/* Follow the file path */
2551
+		dir = dj.dir;
2552
+#if !_FS_READONLY	/* R/W configuration */
2553
+		if (res == FR_OK) {
2554
+			if (!dir)	/* Default directory itself */
2555
+				res = FR_INVALID_NAME;
2556
+#if _FS_LOCK
2557
+			else
2558
+				res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
2559
+#endif
2560
+		}
2561
+		/* Create or Open a file */
2562
+		if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
2563
+			if (res != FR_OK) {					/* No file, create new */
2564
+				if (res == FR_NO_FILE)			/* There is no file to open, create a new entry */
2565
+#if _FS_LOCK
2566
+					res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
2567
+#else
2568
+					res = dir_register(&dj);
2569
+#endif
2570
+				mode |= FA_CREATE_ALWAYS;		/* File is created */
2571
+				dir = dj.dir;					/* New entry */
2572
+			}
2573
+			else {								/* Any object is already existing */
2574
+				if (dir[DIR_Attr] & (AM_RDO | AM_DIR)) {	/* Cannot overwrite it (R/O or DIR) */
2575
+					res = FR_DENIED;
2576
+				} else {
2577
+					if (mode & FA_CREATE_NEW)	/* Cannot create as new file */
2578
+						res = FR_EXIST;
2579
+				}
2580
+			}
2581
+			if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) {	/* Truncate it if overwrite mode */
2582
+				dw = GET_FATTIME();				/* Created time */
2583
+				ST_DWORD(dir + DIR_CrtTime, dw);
2584
+				dir[DIR_Attr] = 0;				/* Reset attribute */
2585
+				ST_DWORD(dir + DIR_FileSize, 0);/* size = 0 */
2586
+				cl = ld_clust(dj.fs, dir);		/* Get start cluster */
2587
+				st_clust(dir, 0);				/* cluster = 0 */
2588
+				dj.fs->wflag = 1;
2589
+				if (cl) {						/* Remove the cluster chain if exist */
2590
+					dw = dj.fs->winsect;
2591
+					res = remove_chain(dj.fs, cl);
2592
+					if (res == FR_OK) {
2593
+						dj.fs->last_clust = cl - 1;	/* Reuse the cluster hole */
2594
+						res = move_window(dj.fs, dw);
2595
+					}
2596
+				}
2597
+			}
2598
+		}
2599
+		else {	/* Open an existing file */
2600
+			if (res == FR_OK) {					/* Follow succeeded */
2601
+				if (dir[DIR_Attr] & AM_DIR) {	/* It is a directory */
2602
+					res = FR_NO_FILE;
2603
+				} else {
2604
+					if ((mode & FA_WRITE) && (dir[DIR_Attr] & AM_RDO)) /* R/O violation */
2605
+						res = FR_DENIED;
2606
+				}
2607
+			}
2608
+		}
2609
+		if (res == FR_OK) {
2610
+			if (mode & FA_CREATE_ALWAYS)		/* Set file change flag if created or overwritten */
2611
+				mode |= FA__WRITTEN;
2612
+			fp->dir_sect = dj.fs->winsect;		/* Pointer to the directory entry */
2613
+			fp->dir_ptr = dir;
2614
+#if _FS_LOCK
2615
+			fp->lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
2616
+			if (!fp->lockid) res = FR_INT_ERR;
2617
+#endif
2618
+		}
2619
+
2620
+#else				/* R/O configuration */
2621
+		if (res == FR_OK) {					/* Follow succeeded */
2622
+			dir = dj.dir;
2623
+			if (!dir) {						/* Current directory itself */
2624
+				res = FR_INVALID_NAME;
2625
+			} else {
2626
+				if (dir[DIR_Attr] & AM_DIR)	/* It is a directory */
2627
+					res = FR_NO_FILE;
2628
+			}
2629
+		}
2630
+#endif
2631
+		FREE_BUF();
2632
+
2633
+		if (res == FR_OK) {
2634
+			fp->flag = mode;					/* File access mode */
2635
+			fp->err = 0;						/* Clear error flag */
2636
+			fp->sclust = ld_clust(dj.fs, dir);	/* File start cluster */
2637
+			fp->fsize = LD_DWORD(dir + DIR_FileSize);	/* File size */
2638
+			fp->fptr = 0;						/* File pointer */
2639
+			fp->dsect = 0;
2640
+#if _USE_FASTSEEK
2641
+			fp->cltbl = 0;						/* Normal seek mode */
2642
+#endif
2643
+			fp->fs = dj.fs;	 					/* Validate file object */
2644
+			fp->id = fp->fs->id;
2645
+		}
2646
+	}
2647
+
2648
+	LEAVE_FF(dj.fs, res);
2649
+}
2650
+
2651
+
2652
+
2653
+
2654
+/*-----------------------------------------------------------------------*/
2655
+/* Read File                                                             */
2656
+/*-----------------------------------------------------------------------*/
2657
+
2658
+FRESULT f_read (
2659
+	FIL* fp, 		/* Pointer to the file object */
2660
+	void* buff,		/* Pointer to data buffer */
2661
+	UINT btr,		/* Number of bytes to read */
2662
+	UINT* br		/* Pointer to number of bytes read */
2663
+)
2664
+{
2665
+	FRESULT res;
2666
+	DWORD clst, sect, remain;
2667
+	UINT rcnt, cc;
2668
+	BYTE csect, *rbuff = (BYTE*)buff;
2669
+
2670
+
2671
+	*br = 0;	/* Clear read byte counter */
2672
+
2673
+	res = validate(fp);							/* Check validity */
2674
+	if (res != FR_OK) LEAVE_FF(fp->fs, res);
2675
+	if (fp->err)								/* Check error */
2676
+		LEAVE_FF(fp->fs, (FRESULT)fp->err);
2677
+	if (!(fp->flag & FA_READ)) 					/* Check access mode */
2678
+		LEAVE_FF(fp->fs, FR_DENIED);
2679
+	remain = fp->fsize - fp->fptr;
2680
+	if (btr > remain) btr = (UINT)remain;		/* Truncate btr by remaining bytes */
2681
+
2682
+	for ( ;  btr;								/* Repeat until all data read */
2683
+		rbuff += rcnt, fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
2684
+		if ((fp->fptr % SS(fp->fs)) == 0) {		/* On the sector boundary? */
2685
+			csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1));	/* Sector offset in the cluster */
2686
+			if (!csect) {						/* On the cluster boundary? */
2687
+				if (fp->fptr == 0) {			/* On the top of the file? */
2688
+					clst = fp->sclust;			/* Follow from the origin */
2689
+				} else {						/* Middle or end of the file */
2690
+#if _USE_FASTSEEK
2691
+					if (fp->cltbl)
2692
+						clst = clmt_clust(fp, fp->fptr);	/* Get cluster# from the CLMT */
2693
+					else
2694
+#endif
2695
+						clst = get_fat(fp->fs, fp->clust);	/* Follow cluster chain on the FAT */
2696
+				}
2697
+				if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
2698
+				if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
2699
+				fp->clust = clst;				/* Update current cluster */
2700
+			}
2701
+			sect = clust2sect(fp->fs, fp->clust);	/* Get current sector */
2702
+			if (!sect) ABORT(fp->fs, FR_INT_ERR);
2703
+			sect += csect;
2704
+			cc = btr / SS(fp->fs);				/* When remaining bytes >= sector size, */
2705
+			if (cc) {							/* Read maximum contiguous sectors directly */
2706
+				if (csect + cc > fp->fs->csize)	/* Clip at cluster boundary */
2707
+					cc = fp->fs->csize - csect;
2708
+				if (disk_read(fp->fs->drv, rbuff, sect, cc) != RES_OK)
2709
+					ABORT(fp->fs, FR_DISK_ERR);
2710
+#if !_FS_READONLY && _FS_MINIMIZE <= 2			/* Replace one of the read sectors with cached data if it contains a dirty sector */
2711
+#if _FS_TINY
2712
+				if (fp->fs->wflag && fp->fs->winsect - sect < cc)
2713
+					mem_cpy(rbuff + ((fp->fs->winsect - sect) * SS(fp->fs)), fp->fs->win.d8, SS(fp->fs));
2714
+#else
2715
+				if ((fp->flag & FA__DIRTY) && fp->dsect - sect < cc)
2716
+					mem_cpy(rbuff + ((fp->dsect - sect) * SS(fp->fs)), fp->buf.d8, SS(fp->fs));
2717
+#endif
2718
+#endif
2719
+				rcnt = SS(fp->fs) * cc;			/* Number of bytes transferred */
2720
+				continue;
2721
+			}
2722
+#if !_FS_TINY
2723
+			if (fp->dsect != sect) {			/* Load data sector if not in cache */
2724
+#if !_FS_READONLY
2725
+				if (fp->flag & FA__DIRTY) {		/* Write-back dirty sector cache */
2726
+					if (disk_write(fp->fs->drv, fp->buf.d8, fp->dsect, 1) != RES_OK)
2727
+						ABORT(fp->fs, FR_DISK_ERR);
2728
+					fp->flag &= ~FA__DIRTY;
2729
+				}
2730
+#endif
2731
+				if (disk_read(fp->fs->drv, fp->buf.d8, sect, 1) != RES_OK)	/* Fill sector cache */
2732
+					ABORT(fp->fs, FR_DISK_ERR);
2733
+			}
2734
+#endif
2735
+			fp->dsect = sect;
2736
+		}
2737
+		rcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs));	/* Get partial sector data from sector buffer */
2738
+		if (rcnt > btr) rcnt = btr;
2739
+#if _FS_TINY
2740
+		if (move_window(fp->fs, fp->dsect) != FR_OK)		/* Move sector window */
2741
+			ABORT(fp->fs, FR_DISK_ERR);
2742
+		mem_cpy(rbuff, &fp->fs->win.d8[fp->fptr % SS(fp->fs)], rcnt);	/* Pick partial sector */
2743
+#else
2744
+		mem_cpy(rbuff, &fp->buf.d8[fp->fptr % SS(fp->fs)], rcnt);	/* Pick partial sector */
2745
+#endif
2746
+	}
2747
+
2748
+	LEAVE_FF(fp->fs, FR_OK);
2749
+}
2750
+
2751
+
2752
+
2753
+
2754
+#if !_FS_READONLY
2755
+/*-----------------------------------------------------------------------*/
2756
+/* Write File                                                            */
2757
+/*-----------------------------------------------------------------------*/
2758
+
2759
+FRESULT f_write (
2760
+	FIL* fp,			/* Pointer to the file object */
2761
+	const void *buff,	/* Pointer to the data to be written */
2762
+	UINT btw,			/* Number of bytes to write */
2763
+	UINT* bw			/* Pointer to number of bytes written */
2764
+)
2765
+{
2766
+	FRESULT res;
2767
+	DWORD clst, sect;
2768
+	UINT wcnt, cc;
2769
+	const BYTE *wbuff = (const BYTE*)buff;
2770
+	BYTE csect;
2771
+
2772
+
2773
+	*bw = 0;	/* Clear write byte counter */
2774
+
2775
+	res = validate(fp);						/* Check validity */
2776
+	if (res != FR_OK) LEAVE_FF(fp->fs, res);
2777
+	if (fp->err)							/* Check error */
2778
+		LEAVE_FF(fp->fs, (FRESULT)fp->err);
2779
+	if (!(fp->flag & FA_WRITE))				/* Check access mode */
2780
+		LEAVE_FF(fp->fs, FR_DENIED);
2781
+	if (fp->fptr + btw < fp->fptr) btw = 0;	/* File size cannot reach 4GB */
2782
+
2783
+	for ( ;  btw;							/* Repeat until all data written */
2784
+		wbuff += wcnt, fp->fptr += wcnt, *bw += wcnt, btw -= wcnt) {
2785
+		if ((fp->fptr % SS(fp->fs)) == 0) {	/* On the sector boundary? */
2786
+			csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1));	/* Sector offset in the cluster */
2787
+			if (!csect) {					/* On the cluster boundary? */
2788
+				if (fp->fptr == 0) {		/* On the top of the file? */
2789
+					clst = fp->sclust;		/* Follow from the origin */
2790
+					if (clst == 0)			/* When no cluster is allocated, */
2791
+						clst = create_chain(fp->fs, 0);	/* Create a new cluster chain */
2792
+				} else {					/* Middle or end of the file */
2793
+#if _USE_FASTSEEK
2794
+					if (fp->cltbl)
2795
+						clst = clmt_clust(fp, fp->fptr);	/* Get cluster# from the CLMT */
2796
+					else
2797
+#endif
2798
+						clst = create_chain(fp->fs, fp->clust);	/* Follow or stretch cluster chain on the FAT */
2799
+				}
2800
+				if (clst == 0) break;		/* Could not allocate a new cluster (disk full) */
2801
+				if (clst == 1) ABORT(fp->fs, FR_INT_ERR);
2802
+				if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
2803
+				fp->clust = clst;			/* Update current cluster */
2804
+				if (fp->sclust == 0) fp->sclust = clst;	/* Set start cluster if the first write */
2805
+			}
2806
+#if _FS_TINY
2807
+			if (fp->fs->winsect == fp->dsect && sync_window(fp->fs))	/* Write-back sector cache */
2808
+				ABORT(fp->fs, FR_DISK_ERR);
2809
+#else
2810
+			if (fp->flag & FA__DIRTY) {		/* Write-back sector cache */
2811
+				if (disk_write(fp->fs->drv, fp->buf.d8, fp->dsect, 1) != RES_OK)
2812
+					ABORT(fp->fs, FR_DISK_ERR);
2813
+				fp->flag &= ~FA__DIRTY;
2814
+			}
2815
+#endif
2816
+			sect = clust2sect(fp->fs, fp->clust);	/* Get current sector */
2817
+			if (!sect) ABORT(fp->fs, FR_INT_ERR);
2818
+			sect += csect;
2819
+			cc = btw / SS(fp->fs);			/* When remaining bytes >= sector size, */
2820
+			if (cc) {						/* Write maximum contiguous sectors directly */
2821
+				if (csect + cc > fp->fs->csize)	/* Clip at cluster boundary */
2822
+					cc = fp->fs->csize - csect;
2823
+				if (disk_write(fp->fs->drv, wbuff, sect, cc) != RES_OK)
2824
+					ABORT(fp->fs, FR_DISK_ERR);
2825
+#if _FS_MINIMIZE <= 2
2826
+#if _FS_TINY
2827
+				if (fp->fs->winsect - sect < cc) {	/* Refill sector cache if it gets invalidated by the direct write */
2828
+					mem_cpy(fp->fs->win.d8, wbuff + ((fp->fs->winsect - sect) * SS(fp->fs)), SS(fp->fs));
2829
+					fp->fs->wflag = 0;
2830
+				}
2831
+#else
2832
+				if (fp->dsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
2833
+					mem_cpy(fp->buf.d8, wbuff + ((fp->dsect - sect) * SS(fp->fs)), SS(fp->fs));
2834
+					fp->flag &= ~FA__DIRTY;
2835
+				}
2836
+#endif
2837
+#endif
2838
+				wcnt = SS(fp->fs) * cc;		/* Number of bytes transferred */
2839
+				continue;
2840
+			}
2841
+#if _FS_TINY
2842
+			if (fp->fptr >= fp->fsize) {	/* Avoid silly cache filling at growing edge */
2843
+				if (sync_window(fp->fs)) ABORT(fp->fs, FR_DISK_ERR);
2844
+				fp->fs->winsect = sect;
2845
+			}
2846