From 4b3042e83f019d24c2d1ff2fa1bc7214cf2f90f9 Mon Sep 17 00:00:00 2001 From: MMS Date: Thu, 17 Nov 2022 16:58:55 -0500 Subject: [PATCH] 7.1.3 --- .gitignore | 1 + doxygen/Doxyfile | 134 ++----------------------- doxygen/Doxyfile-CHM | 5 +- doxygen/Doxyfile-LATEX | 11 +++ doxygen/history.dox | 8 ++ doxygen/make.bat | 28 +++++- doxygen/qclean.dox | 63 +++++++----- doxygen/qpspy.dox | 13 +-- qclean/include/qclean.h | 6 +- qclean/source/main.c | 75 +++++++++----- qspy/include/qpc_qs.h | 200 ++++++++++++++++++++++++++++---------- qspy/include/qpc_qs_pkg.h | 2 +- 12 files changed, 302 insertions(+), 244 deletions(-) create mode 100644 doxygen/Doxyfile-LATEX diff --git a/.gitignore b/.gitignore index 1a35c3f..4adb62f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ version-* html/ +latex/ test_priv/ bin/*.exe bin/*.dll diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index 9b1cc28..caa1aa9 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -1,11 +1,13 @@ # Doxyfile 1.9.5 +@INCLUDE = ../../ql-doxygen/ql-doxyfile + #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = QTools -PROJECT_NUMBER = 7.1.2 +PROJECT_NUMBER = 7.1.3 PROJECT_BRIEF = "Collection of Host-Based Tools" PROJECT_LOGO = ../../ql-doxygen/images/logo_ql.png OUTPUT_DIRECTORY = @@ -40,18 +42,7 @@ PYTHON_DOCSTRING = YES INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 -ALIASES = "nav{2}=@ref \1@ref \2" \ - "nav_prev{1}=@ref \1" \ - "nav_next{1}=@ref \1" \ - "next{1}=@ref \1" \ - "description=@par Description" \ - "usage=@par Usage" \ - "hint=@par Hint" \ - "label{1}=
\1
" \ - "caption{1}=
\1
" \ - "webref{2}=\2" \ - "tr{1}=@xrefitem tr \"Traceability\" \"\" traces to: @ref \1" -OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO @@ -184,7 +175,7 @@ FORTRAN_COMMENT_AFTER = 72 #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES +STRIP_CODE_COMMENTS = NO REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES @@ -272,68 +263,6 @@ SEARCHDATA_FILE = searchdata.xml EXTERNAL_SEARCH_ID = QTOOLS EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -LATEX_MAKEINDEX_CMD = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = letter -EXTRA_PACKAGES = -LATEX_HEADER = -LATEX_FOOTER = -LATEX_EXTRA_STYLESHEET = -LATEX_EXTRA_FILES = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -LATEX_BIB_STYLE = plain -LATEX_TIMESTAMP = NO -LATEX_EMOJI_DIRECTORY = -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_SUBDIR = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_PROGRAMLISTING = YES -XML_NS_MEMB_FILE_SCOPE = NO -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- -GENERATE_DOCBOOK = NO -DOCBOOK_OUTPUT = docbook -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES @@ -343,54 +272,9 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = Q_SPY \ - Q_UTEST + Q_UTEST \ + QS_OBJ_PTR_SIZE=4U \ + QS_FUN_PTR_SIZE=4U \ + Q_SIGNAL_SIZE=2U EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -EXTERNAL_PAGES = YES -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -DIA_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -DOT_NUM_THREADS = 0 -DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" -DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -GROUP_GRAPHS = YES -UML_LOOK = YES -UML_LIMIT_NUM_FIELDS = 10 -DOT_UML_DETAILS = NO -DOT_WRAP_THRESHOLD = 17 -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DIR_GRAPH_MAX_DEPTH = 1 -DOT_IMAGE_FORMAT = png -INTERACTIVE_SVG = NO -DOT_PATH = C:/tools/graphviz/bin -DOTFILE_DIRS = -MSCFILE_DIRS = -DIAFILE_DIRS = -PLANTUML_JAR_PATH = -PLANTUML_CFG_FILE = -PLANTUML_INCLUDE_PATH = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/doxygen/Doxyfile-CHM b/doxygen/Doxyfile-CHM index 3755a35..75b0149 100644 --- a/doxygen/Doxyfile-CHM +++ b/doxygen/Doxyfile-CHM @@ -1,10 +1,7 @@ -# Doxyfile 1.9.4 +# Doxyfile 1.9.5 @INCLUDE = Doxyfile -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- PROJECT_LOGO = images/logo_ql-comp.png HTML_OUTPUT = tmp diff --git a/doxygen/Doxyfile-LATEX b/doxygen/Doxyfile-LATEX new file mode 100644 index 0000000..f4b4479 --- /dev/null +++ b/doxygen/Doxyfile-LATEX @@ -0,0 +1,11 @@ +# Doxyfile 1.9.5 + +@INCLUDE = Doxyfile + +GENERATE_HTML = NO +GENERATE_LATEX = YES +ENABLED_SECTIONS += LATEX + +# no source code in latex +SOURCE_BROWSER = NO +VERBATIM_HEADERS = NO diff --git a/doxygen/history.dox b/doxygen/history.dox index 6388058..8e9f035 100644 --- a/doxygen/history.dox +++ b/doxygen/history.dox @@ -1,6 +1,14 @@ /** @page history Revision History +@section qtools_7_1_3 Version 7.1.3, 2022-11-18 +@ref qclean "QCLEAN host application": +- Added new file types and changing some cleaning rules for white-space cleaning. + +__Documentation__ +- Modified the `doxygen/` folder for generation of QM Manual in LaTeX (enables generation of PDF) + + @section qtools_7_1_2 Version 7.1.2, 2022-09-28 __QSPY host application:__ - Added pre-defined "Scheduler" records: diff --git a/doxygen/make.bat b/doxygen/make.bat index dd2603b..5eb9af3 100644 --- a/doxygen/make.bat +++ b/doxygen/make.bat @@ -28,12 +28,13 @@ @echo usage: @echo make @echo make -CHM -@echo make ... +@echo make -LATEX -:: Doxygen tool (adjust to your system) ...................................... +:: tools (adjust to your system)--------------------------------------------- +:: Doxygen tool @set DOXYGEN=doxygen -:: HTML Help tool (needed only with the -CHM option, (adjust to your system) . +:: HTML Help tool (needed only with the -CHM option) . @set HHC="C:\tools\HTML Help Workshop\hhc.exe" :: QTOOLS directory .......................................................... @@ -42,8 +43,9 @@ :: HTML outut directory ...................................................... @set HTML_OUT=%QTOOLS%\html -:: Generate Doxygen Documentation... +:: Generate Doxygen Documentation ------------------------------------------- if "%1"=="-CHM" ( + @echo Generating HTML... %DOXYGEN% Doxyfile-CHM @@ -59,7 +61,23 @@ if "%1"=="-CHM" ( @rmdir /S /Q tmp @echo CHM file generated +) else if "%1"=="-LATEX" ( + + @echo. + @echo Cleanup... + rmdir /S /Q %LATEX_OUT% + + @echo Generating LATEX... + %DOXYGEN% Doxyfile-LATEX + + @echo Adding custom files... + xcopy img %LATEX_OUT%\img\ + + @cd %LATEX_OUT% + @call make.bat + ) else ( + @echo. @echo Cleanup... rmdir /S /Q %HTML_OUT% @@ -67,7 +85,7 @@ if "%1"=="-CHM" ( @echo Generating HTML... %DOXYGEN% Doxyfile%1 - @echo Adding custom images... + @echo Adding custom files... xcopy img %HTML_OUT%\img\ xcopy /Y ..\..\ql-doxygen\jquery.js %HTML_OUT% @qclean %HTML_OUT% diff --git a/doxygen/qclean.dox b/doxygen/qclean.dox index c0b7ef5..2442341 100644 --- a/doxygen/qclean.dox +++ b/doxygen/qclean.dox @@ -72,30 +72,45 @@ QClean can optionally check the code for **long lines of code** that exceed a sp QClean applies the following rules for cleaning the whitespace depending on the file types:
-FILE TYPE | END-OF-LINE | TRAILING WS | TABS | LONG-LINES -:--------------|:------------|:-----------:|:--------:|:------------: -`.c` | Unix (LF) | remove | replace | check -`.h` | Unix (LF) | remove | replace | check -`.cpp` | Unix (LF) | remove | replace | check -`.hpp` | Unix (LF) | remove | replace | check -`.s` | Unix (LF) | remove | replace | check -`.asm` | Unix (LF) | remove | replace | check -`.lnt` | Unix (LF) | remove | replace | check -`.txt` | Unix (LF) | remove | replace | don't check -`.md` | Unix (LF) | remove | replace | don't check -`.bat` | DOS (CR,LF) | remove | replace | don't check -`.ld` | Unix (LF) | remove | replace | check -`.py` | Unix (LF) | remove | replace | check -`.pyw` | Unix (LF) | remove | replace | check -`.tcl` | Unix (LF) | remove | replace | check -`.java` | Unix (LF) | remove | replace | check -`Makefile` | Unix (LF) | remove | leave | check -`.mak` | Unix (LF) | remove | leave | check -`.html` | Unix (LF) | remove | replace | don't check -`.htm` | Unix (LF) | remove | replace | don't check -`.php` | Unix (LF) | remove | replace | don't check -`.dox` | Unix (LF) | remove | replace | don't check -`.m` | Unix (LF) | remove | replace | check +FILE TYPE | END-OF-LINE | TRAILING WS | TABS | LONG-LINES +:---------------|:------------|:-----------:|:--------:|:------------: +`.c` | Unix (LF) | remove | replace | check +`.h` | Unix (LF) | remove | replace | check +`.cpp` | Unix (LF) | remove | replace | check +`.hpp` | Unix (LF) | remove | replace | check +`.s/.S` | Unix (LF) | remove | replace | check +`.asm` | Unix (LF) | remove | replace | check +`.txt` | Unix (LF) | remove | replace | don't check +`.xml` | Unix (LF) | remove | replace | don't check +`.dox` | Unix (LF) | remove | replace | don't check +`.md` | Unix (LF) | remove | replace | don't check +`.bat` | Unix (LF) | remove | replace | don't check +`.ld` | Unix (LF) | remove | replace | check +`.py` | Unix (LF) | remove | replace | check +`.pyw` | Unix (LF) | remove | replace | check +`.java` | Unix (LF) | remove | replace | check +`Makefile` | Unix (LF) | remove | leave | check +`mak_*` | Unix (LF) | remove | leave | check +`.mak` | Unix (LF) | remove | leave | check +`.make` | Unix (LF) | remove | leave | check +`.html` | Unix (LF) | remove | replace | don't check +`.htm` | Unix (LF) | remove | replace | don't check +`.css` | Unix (LF) | remove | replace | don't check +`.eww` | Unix (LF) | remove | replace | don't check +`.ewp` | Unix (LF) | remove | replace | don't check +`.ewd` | Unix (LF) | remove | replace | don't check +`.icf` | Unix (LF) | remove | replace | don't check +`.sln` | Unix (LF) | remove | replace | don't check +`.vcxproj` | Unix (LF) | remove | replace | don't check +`.filters` | Unix (LF) | remove | replace | don't check +`.vcxproj.filters` | Unix (LF) | remove | replace | don't check +`.project` | Unix (LF) | remove | replace | don't check +`.cproject` | Unix (LF) | remove | replace | don't check +`.pro` | Unix (LF) | remove | replace | don't check +`.m` | Unix (LF) | remove | replace | check +`.lnt` | Unix (LF) | remove | replace | check +`.cfg` | Unix (LF) | remove | replace | don't check +`.properties` | Unix (LF) | remove | replace | don't check

diff --git a/doxygen/qpspy.dox b/doxygen/qpspy.dox index f509bd4..4d3f053 100644 --- a/doxygen/qpspy.dox +++ b/doxygen/qpspy.dox @@ -9,7 +9,7 @@ So the questions are: How can you monitor the behavior of a running real-time sy Techniques based on **software tracing** can answer many of these questions. Software tracing is a method for obtaining diagnostic information in a live environment without the need to stop the application to get system feedback. Software tracing always involves some form of target system instrumentation to log interesting discrete events for subsequent retrieval from the system and analysis. @anchor qpspy_framework -@note +@remarks Software tracing is particularly effective and powerful in combination with the event-driven **reactive programming** model, such as the one implemented in QP™ real-time frameworks. Due to the inversion of control, a real-time framework controls almost all interesting interactions in the system, so an instrumented real-time framework can provide much **more comprehensive** and detailed information than can any traditional RTOS kernel.
![Comprehensive tracing information available in a Real-Time Embedded Framework](qspy-funnel.png) @@ -122,19 +122,20 @@ Of course, now the Escape byte itself must also be transparent to avoid interpre The transparency of the Flag and Escape bytes complicates slightly the computation of the Checksum. The transmitter computes the Checksum over the Frame Sequence Number, the Record-Type, and all Data bytes before performing any “byte-stuffing”. The receiver must apply the exact reversed procedure of performing the “byte-un-stuffing” before computing the Checksum. -An example may make this clearer. Suppose that the following trace record needs to be inserted into the trace buffer (the transparent bytes are shown in bold): +An example may make this clearer. Suppose that the following trace record needs to be inserted into the trace buffer (the transparent bytes are shown in in `code` format): -> Record-Type = 0x7D, Record Data = 0x7D 0x08 0x01 +     Record-Type = `0x7D`, Record Data = `0x7D` 0x08 0x01 Assuming that the current Frame Sequence Number is, say `0x7E`, the Checksum will be computed over the following bytes: -> Checksum == (uint8_t)(~(0x7E + 0x7D + 0x7D + 0x08 + 0x01)) == 0x7E +     Checksum == (uint8_t)(~(0x7E + `0x7D` + `0x7D` + 0x08 + 0x01)) == 0x7E and the actual frame inserted into the QS trace buffer will be as follows: -> 0x7D 0x5E 0x7D 0x5D 0x7D 0x5D 0x08 0x01 0x7D 0x5E 0x7E +     0x7D `0x5E` 0x7D `0x5D` 0x7D `0x5D` 0x08 0x01 0x7D `0x5E` 0x7E -Obviously, this is a degenerate example, where the Frame Sequence Number, the Record-Type, a Data byte, and the Checksum itself turned out to be the transparent bytes. Typical overhead of transparency with real trace data is one escape sequence per several trace records. +@note +This is a degenerate example, where the Frame Sequence Number, the Record-Type, a Data byte, and the Checksum itself turned out to be the transparent bytes. A more typical overhead of transparency with real trace data is one escape sequence per several trace records. @section qpspy_endianness Endianness diff --git a/qclean/include/qclean.h b/qclean/include/qclean.h index 2b36fb2..4a1bb90 100644 --- a/qclean/include/qclean.h +++ b/qclean/include/qclean.h @@ -23,8 +23,8 @@ * ============================================================================*/ /*! -* @date Last updated on: 2021-12-23 -* @version Last updated for version: 7.0.0 +* @date Last updated on: 2022-10-28 +* @version Last updated for version: 7.1.3 * * @file * @brief QClean internal interface @@ -33,7 +33,7 @@ #ifndef qclean_h #define qclean_h -#define VERSION "7.0.0" +#define VERSION "7.1.3" unsigned isMatching (char const *fullPath); void onMatchFound(char const *fullPath, unsigned flags, int ro_info); diff --git a/qclean/source/main.c b/qclean/source/main.c index 8d69c75..9d2dc8a 100644 --- a/qclean/source/main.c +++ b/qclean/source/main.c @@ -23,8 +23,8 @@ * ============================================================================*/ /*! -* @date Last updated on: 2022-02-22 -* @version Last updated for version: 7.0.0 +* @date Last updated on: 2022-10-28 +* @version Last updated for version: 7.1.3 * * @file * @brief main for QClean host utility @@ -52,8 +52,8 @@ enum Constants { TAB = 0x09, LF = 0x0A, CR = 0x0D, - TAB_SIZE = 4, /* default TAB size */ - LINE_LIMIT = 80 /* default line limit */ + TAB_SIZE = 4, /* default TAB size */ + LINE_LIMIT = 80 /* default line limit */ }; enum TodoFlags { @@ -65,7 +65,7 @@ enum TodoFlags { }; typedef struct { - char ending[14]; + char pattern[32]; uint8_t len; uint8_t flags; } FileType; @@ -74,31 +74,59 @@ typedef struct { * NOTE: For greater flexibility, this array could be read from an external * config file in the future. */ -static FileType l_fileTypes[] = { +static FileType const l_fileTypes[] = { { ".c", 2, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".h", 2, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".cpp", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".hpp", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".s", 2, CR_FLG | TAB_FLG | LONG_LINE_FLG }, + { ".S", 2, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".asm", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, - { ".lnt", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, /* Lint */ { ".txt", 4, CR_FLG | TAB_FLG }, + { ".xml", 4, CR_FLG | TAB_FLG }, + { ".dox", 4, CR_FLG | TAB_FLG }, /* Doxygen */ { ".md", 3, CR_FLG | TAB_FLG }, /* markdown */ - { ".bat", 4, /*CRLF*/ TAB_FLG }, - { ".ld", 3, CR_FLG | TAB_FLG | LONG_LINE_FLG }, /* GNU ld */ - { ".tcl", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, + { ".bat", 4, CR_FLG | TAB_FLG }, + { ".ld", 3, CR_FLG | TAB_FLG | LONG_LINE_FLG }, /* GNU linker */ { ".py", 3, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".pyw", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, { ".java", 5, CR_FLG | TAB_FLG | LONG_LINE_FLG }, + { "Makefile", 8, CR_FLG | LONG_LINE_FLG }, + { "mak_", 4, CR_FLG | LONG_LINE_FLG }, { ".mak", 4, CR_FLG | LONG_LINE_FLG }, + { ".make", 5, CR_FLG | LONG_LINE_FLG }, + { ".html", 5, CR_FLG | TAB_FLG }, { ".htm", 4, CR_FLG | TAB_FLG }, - { ".php", 4, CR_FLG | TAB_FLG }, - { ".dox", 4, CR_FLG | TAB_FLG }, /* Doxygen */ + { ".css", 4, CR_FLG | TAB_FLG }, + + { ".eww", 4, CR_FLG }, /* IAR workspace */ + { ".ewp", 4, CR_FLG }, /* IAR project */ + { ".ewd", 4, CR_FLG }, /* IAR debug config */ + { ".icf", 4, CR_FLG | TAB_FLG }, /* IAR linker */ + + { ".uvprojx", 8, CR_FLG }, /* uVision project */ + { ".uvoptx", 7, CR_FLG }, /* uVision option */ + + { ".sln", 4, CR_FLG }, /* VS solution */ + { ".vcxproj", 8, CR_FLG }, /* VS project */ + { ".filters", 8, CR_FLG }, /* VS sub-folders */ + { ".vcxproj.filters",16, CR_FLG }, /* VS sub-folders */ + + { ".project", 8, CR_FLG }, /* Eclipse project */ + { ".cproject",9, CR_FLG }, /* Eclipse CDT project */ + + { ".pro", 4, CR_FLG | TAB_FLG }, /* Qt project */ + { ".m", 2, CR_FLG | TAB_FLG | LONG_LINE_FLG }, /* MATLAB*/ + + { ".lnt", 4, CR_FLG | TAB_FLG | LONG_LINE_FLG }, /* PC-Lint */ + { ".cfg", 4, CR_FLG | TAB_FLG }, /* RSM config */ + + { ".properties",11, CR_FLG }, /* MPLABX properties */ }; -static int l_fileNum = sizeof(l_fileTypes)/sizeof(l_fileTypes[0]); +static int const l_fileNum = sizeof(l_fileTypes)/sizeof(l_fileTypes[0]); /*..........................................................................*/ /* This function looks for a match between the fname and any of the file @@ -107,19 +135,18 @@ static int l_fileNum = sizeof(l_fileTypes)/sizeof(l_fileTypes[0]); * the function returns 0. */ unsigned isMatching(char const *fname) { - int len = strlen(fname); - FileType const *ft = &l_fileTypes[0]; + int const flen = strlen(fname); - int n; - for (n = l_fileNum; n > 0; --n, ++ft) { /* go over all file types... */ - char const *s = &ft->ending[0]; - if (((*s == '.') && (len > ft->len)) - || (len == ft->len)) + FileType const *ft = &l_fileTypes[0]; + for (int n = l_fileNum; n > 0; --n, ++ft) { /* go over all file types.. */ + char const *s = &ft->pattern[0]; + if (((*s == '.') && (flen > ft->len)) /* extension */ + || (flen >= ft->len)) /* beginning of file name */ { - char const *t = &fname[len - ft->len]; + char const *t = &fname[flen - ft->len]; int i; - for (i = ft->len; i > 0; --i, ++s, ++t) { /* compare the names */ - if (*s != *t) { /* missmatch? */ + for (i = ft->len; i > 0; --i, ++s, ++t) { /* compare to pattern */ + if (*s != *t) { /* mismatch? */ break; } } @@ -132,7 +159,7 @@ unsigned isMatching(char const *fname) { } } } - return 0; + return 0U; } /*..........................................................................*/ void onMatchFound(char const *fname, unsigned flags, int ro_info) { diff --git a/qspy/include/qpc_qs.h b/qspy/include/qpc_qs.h index 9092d64..a83b59f 100644 --- a/qspy/include/qpc_qs.h +++ b/qspy/include/qpc_qs.h @@ -3,7 +3,7 @@ * Model: qpc.qm * File: ${include::qs.h} * -* This code has been generated by QM 5.2.2 . +* This code has been generated by QM 5.2.3 . * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost. * * This code is covered by the following QP license: @@ -114,6 +114,7 @@ typedef uint_fast16_t QSCtr; /*${QS::QSpyPre} ...........................................................*/ /*! QS pre-defined record types (TX channel) +* @static @public @memberof QS_tx * * @details * This enumeration specifies the record types used in the QP components. @@ -248,7 +249,9 @@ enum QSpyPre { }; /*${QS::QSpyGroups} ........................................................*/ -/*! QS record groups for QS_GLB_FILTER() */ +/*! QS record groups for QS_GLB_FILTER() +* @static @public @memberof QS_tx +*/ enum QSpyGroups { QS_ALL_RECORDS = 0xF0,/*!< all maskable QS records */ QS_SM_RECORDS, /*!< State Machine QS records */ @@ -269,7 +272,9 @@ enum QSpyGroups { }; /*${QS::QSpyUserOffsets} ...................................................*/ -/*! QS user record group offsets for QS_GLB_FILTER() */ +/*! QS user record group offsets for QS_GLB_FILTER() +* @static @public @memberof QS_tx +*/ enum QSpyUserOffsets { QS_USER = 100, /*!< the first record available to QS users */ QS_USER0 = (enum_t)QS_USER, /*!< offset for User Group 0 */ @@ -280,7 +285,9 @@ enum QSpyUserOffsets { }; /*${QS::QSpyIdOffsets} .....................................................*/ -/*! QS ID offsets for QS_LOC_FILTER() */ +/*! QS ID offsets for QS_LOC_FILTER() +* @static @public @memberof QS_tx +*/ enum QSpyIdOffsets { QS_AO_ID = 0, /*!< offset for AO priorities */ QS_EP_ID = 64, /*!< offset for event-pool IDs */ @@ -289,7 +296,9 @@ enum QSpyIdOffsets { }; /*${QS::QSpyIdGroups} ......................................................*/ -/*! QS ID groups for QS_LOC_FILTER() */ +/*! QS ID groups for QS_LOC_FILTER() +* @static @public @memberof QS_tx +*/ enum QSpyIdGroups { QS_ALL_IDS = 0xF0, /*!< all QS IDs */ QS_AO_IDS = (0x80 + (enum_t)QS_AO_ID), /*!< AO IDs (priorities) */ @@ -299,17 +308,22 @@ enum QSpyIdGroups { }; /*${QS::QSpyFunPtr} ........................................................*/ -/*! function pointer type for QS_fun_dict_pre_() */ +/*! function pointer type for QS_fun_dict_pre_() +* @static @private @memberof QS_tx +*/ typedef void (* QSpyFunPtr )(void); /*${QS::QS_EOD} ............................................................*/ /*! Constant representing End-Of-Data condition returned from the * QS_getByte() function. +* @static @public @memberof QS_tx */ #define QS_EOD ((uint16_t)0xFFFFU) /*${QS::QSpyId} ............................................................*/ -/*! @brief QS ID type for applying local filtering */ +/*! @brief QS ID type for applying local filtering +* @static @public @memberof QS_tx +*/ typedef struct { uint8_t prio; } QSpyId; /*${QS::QS-tx::tx} .........................................................*/ @@ -387,15 +401,19 @@ extern QS_tx QS_priv_; /*${QS::QS-tx::initBuf} ....................................................*/ /*! Initialize the QS-TX data buffer +* @static @public @memberof QS_tx * * @details * This function should be called from QS_onStartup() to provide -* QS with the data buffer. The first argument `sto[]` is the address +* QS with the data buffer. The first argument `sto` is the address * of the memory block, and the second argument `stoSize` is the size * of this block [in bytes]. Currently the size of the QS buffer cannot * exceed 64KB. * -* @note +* @param[in] sto pointer to the storage for the transmit buffer +* @param[in] stoSize size in [bytes] of the storage buffer +* +* @remark * QS can work with quite small data buffers, but you will start losing * data if the buffer is too small for the bursts of tracing activity. * The right size of the buffer depends on the data production rate and @@ -415,6 +433,7 @@ void QS_initBuf( /*${QS::QS-tx::getByte} ....................................................*/ /*! Byte-oriented interface to the QS-TX data buffer +* @static @public @memberof QS_tx * * @details * This function delivers one byte at a time from the QS data buffer. @@ -431,6 +450,7 @@ uint16_t QS_getByte(void); /*${QS::QS-tx::getBlock} ...................................................*/ /*! Block-oriented interface to the QS-TX data buffer +* @static @public @memberof QS_tx * * @details * This function delivers a contiguous block of data from the QS data @@ -440,6 +460,11 @@ uint16_t QS_getByte(void); * input to provide the maximum size of the data block that the caller * can accept. * +* @param[in,out] pNbytes pointer to the number of bytes to send. +* On input, `pNbytes` specifies the maximum number +* of bytes that the function can provide. +* On output, `pNbytes` contains the actual number +* of bytes available. * @returns * if data is available, the function returns pointer to the * contiguous block of data and sets the value pointed to by `pNbytes` @@ -459,8 +484,9 @@ uint16_t QS_getByte(void); uint8_t const * QS_getBlock(uint16_t * const pNbytes); /*${QS::QS-tx::glbFilter_} .................................................*/ -/*! Set/clear the global Filter for a given QS record -* or a group of records +/*! Set/clear the global Filter for a given QS record or a group +* of records +* @static @public @memberof QS_tx * * @details * This function sets up the QS filter to enable record types specified @@ -484,6 +510,7 @@ void QS_glbFilter_(int_fast16_t const filter); /*${QS::QS-tx::locFilter_} .................................................*/ /*! Set/clear the local Filter for a given object-id * or a group of object-ids +* @static @public @memberof QS_tx * * @details * This function sets up the local QS filter to enable or disable the @@ -505,11 +532,14 @@ void QS_glbFilter_(int_fast16_t const filter); void QS_locFilter_(int_fast16_t const filter); /*${QS::QS-tx::doOutput} ...................................................*/ -/*! Perform the QS-TX output (implemented in some QS ports) */ +/*! Perform the QS-TX output (implemented in some QS ports) +* @static @public @memberof QS_tx +*/ void QS_doOutput(void); /*${QS::QS-tx::beginRec_} ..................................................*/ /*! Mark the begin of a QS record `rec` +* @static @private @memberof QS_tx * * @details * This function must be called at the beginning of each QS record. @@ -521,6 +551,7 @@ void QS_beginRec_(uint_fast8_t const rec); /*${QS::QS-tx::endRec_} ....................................................*/ /*! Mark the end of a QS record `rec` +* @static @private @memberof QS_tx * * @details * This function must be called at the end of each QS record. @@ -531,25 +562,34 @@ void QS_beginRec_(uint_fast8_t const rec); void QS_endRec_(void); /*${QS::QS-tx::u8_raw_} ....................................................*/ -/*! output uint8_t data element without format information */ +/*! output uint8_t data element without format information +* @static @private @memberof QS_tx +*/ void QS_u8_raw_(uint8_t const d); /*${QS::QS-tx::2u8_raw_} ...................................................*/ -/*! output two uint8_t data elements without format information */ +/*! output two uint8_t data elements without format information +* @static @private @memberof QS_tx +*/ void QS_2u8_raw_( uint8_t const d1, uint8_t const d2); /*${QS::QS-tx::u16_raw_} ...................................................*/ -/*! output uint16_t data element without format information */ -void QS_u16_raw_(uint16_t d); +/*! output uint16_t data element without format information +* @static @private @memberof QS_tx +*/ +void QS_u16_raw_(uint16_t const d); /*${QS::QS-tx::u32_raw_} ...................................................*/ -/*! output uint32_t data element without format information */ -void QS_u32_raw_(uint32_t d); +/*! output uint32_t data element without format information +* @static @private @memberof QS_tx +*/ +void QS_u32_raw_(uint32_t const d); /*${QS::QS-tx::obj_raw_} ...................................................*/ /*! Output obj pointer data element without format information +* @static @private @memberof QS_tx * * @note This function is only to be used through macros, never in the * client code directly. @@ -558,14 +598,16 @@ void QS_obj_raw_(void const * const obj); /*${QS::QS-tx::str_raw_} ...................................................*/ /*! Output raw zero-terminated string element (without format information) +* @static @private @memberof QS_tx * * @note This function is only to be used through macros, never in the * client code directly. */ -void QS_str_raw_(char const * str); +void QS_str_raw_(char const * const str); /*${QS::QS-tx::u8_fmt_} ....................................................*/ /*! Output uint8_t data element with format information +* @static @private @memberof QS_tx * * @details * @note This function is only to be used through macros, never in the @@ -577,37 +619,44 @@ void QS_u8_fmt_( /*${QS::QS-tx::u16_fmt_} ...................................................*/ /*! output uint16_t data element with format information +* @static @private @memberof QS_tx * * @details * This function is only to be used through macros, never in the * client code directly. */ void QS_u16_fmt_( - uint8_t format, - uint16_t d); + uint8_t const format, + uint16_t const d); /*${QS::QS-tx::u32_fmt_} ...................................................*/ /*! Output uint32_t data element with format information +* @static @private @memberof QS_tx * * @note This function is only to be used through macros, never in the * client code directly. */ void QS_u32_fmt_( - uint8_t format, - uint32_t d); + uint8_t const format, + uint32_t const d); /*${QS::QS-tx::str_fmt_} ...................................................*/ -/*! Output formatted zero-terminated ASCII string to the QS record */ -void QS_str_fmt_(char const * str); +/*! Output formatted zero-terminated ASCII string to the QS record +* @static @private @memberof QS_tx +*/ +void QS_str_fmt_(char const * const str); /*${QS::QS-tx::mem_fmt_} ...................................................*/ -/*! Output formatted memory block of up to 255 bytes to the QS record */ +/*! Output formatted memory block of up to 255 bytes to the QS record +* @static @private @memberof QS_tx +*/ void QS_mem_fmt_( - uint8_t const * blk, - uint8_t size); + uint8_t const * const blk, + uint8_t const size); /*${QS::QS-tx::sig_dict_pre_} ..............................................*/ /*! Output predefined signal-dictionary record +* @static @private @memberof QS_tx * * @note This function is only to be used through macro QS_SIG_DICTIONARY() */ @@ -618,6 +667,7 @@ void QS_sig_dict_pre_( /*${QS::QS-tx::obj_dict_pre_} ..............................................*/ /*! Output predefined object-dictionary record +* @static @private @memberof QS_tx * * @note This function is only to be used through macro QS_OBJ_DICTIONARY() */ @@ -627,6 +677,7 @@ void QS_obj_dict_pre_( /*${QS::QS-tx::obj_arr_dict_pre_} ..........................................*/ /*! Output predefined object-array dictionary record +* @static @private @memberof QS_tx * * @note This function is only to be used through macro QS_OBJ_ARR_DICTIONARY() */ @@ -637,15 +688,17 @@ void QS_obj_arr_dict_pre_( /*${QS::QS-tx::fun_dict_pre_} ..............................................*/ /*! Output predefined function-dictionary record +* @static @private @memberof QS_tx * * @note This function is only to be used through macro QS_FUN_DICTIONARY() */ void QS_fun_dict_pre_( - QSpyFunPtr fun, + QSpyFunPtr const fun, char const * const name); /*${QS::QS-tx::usr_dict_pre_} ..............................................*/ /*! Output predefined user-dictionary record +* @static @private @memberof QS_tx * * @note This function is only to be used through macro QS_USR_DICTIONARY() */ @@ -655,6 +708,7 @@ void QS_usr_dict_pre_( /*${QS::QS-tx::ASSERTION} ..................................................*/ /*! Output the predefined assertion failure trace record +* @static @public @memberof QS_tx * * @details * This trace record is intended to use from the Q_onAssert() callback. @@ -665,28 +719,44 @@ void QS_ASSERTION( uint32_t const delay); /*${QS::QS-tx::target_info_pre_} ...........................................*/ -/*! Helper function to output the predefined Target-info trace record. */ +/*! Helper function to output the predefined Target-info trace record +* @static @private @memberof QS_tx +*/ void QS_target_info_pre_(uint8_t const isReset); /*${QS::QS-tx::onStartup} ..................................................*/ -/*! Callback to startup the QS facility */ +/*! Callback to startup the QS facility +* @static @public @memberof QS_tx +*/ uint8_t QS_onStartup(void const * arg); /*${QS::QS-tx::onCleanup} ..................................................*/ +/*! Callback to cleanup the QS facility +* @static @public @memberof QS_tx +*/ void QS_onCleanup(void); /*${QS::QS-tx::onFlush} ....................................................*/ +/*! Callback to flush the QS trace data to the host +* @static @public @memberof QS_tx +*/ void QS_onFlush(void); /*${QS::QS-tx::onGetTime} ..................................................*/ +/*! Callback to obtain a timestamp for a QS record +* @static @public @memberof QS_tx +*/ QSTimeCtr QS_onGetTime(void); /*${QS::QS-tx-64bit::u64_raw_} .............................................*/ -/*! Output uint64_t data element without format information */ +/*! Output uint64_t data element without format information +* @static @private @memberof QS_tx +*/ void QS_u64_raw_(uint64_t d); /*${QS::QS-tx-64bit::u64_fmt_} .............................................*/ /*! Output uint64_t data element with format information +* @static @private @memberof QS_tx * * @sa QS_U64(), QS_I64() */ @@ -696,21 +766,23 @@ void QS_u64_fmt_( /*${QS::QS-tx-fp::f32_fmt_} ................................................*/ /*! Output 32-bit floating point data element with format information +* @static @private @memberof QS_tx * * @sa QS_F32() */ void QS_f32_fmt_( - uint8_t format, - float32_t d); + uint8_t const format, + float32_t const d); /*${QS::QS-tx-fp::f64_fmt_} ................................................*/ /*! Output 64-bit floating point data element with format information +* @static @private @memberof QS_tx * * @sa QS_F64() */ void QS_f64_fmt_( - uint8_t format, - float64_t d); + uint8_t const format, + float64_t const d); /*${QS::QS-rx::rx} .........................................................*/ /*! @brief QS software tracing parameters for QS input (QS-RX) */ @@ -727,11 +799,15 @@ typedef struct { } QS_rx; /*${QS::QS-rx::rxPriv_} ....................................................*/ -/*! the only instance of the QS-RX object (Singleton) */ +/*! the only instance of the QS-RX object (Singleton) +* @static @private @memberof QS_rx +*/ extern QS_rx QS_rxPriv_; /*${QS::QS-rx::QSpyObjKind} ................................................*/ -/*! Kinds of objects used in QS_setCurrObj() and QS_queryCurrObj() */ +/*! Kinds of objects used in QS_setCurrObj() and QS_queryCurrObj() +* @static @public @memberof QS_rx +*/ enum QS_QSpyObjKind { SM_OBJ, /*!< state machine object */ AO_OBJ, /*!< active object */ @@ -743,21 +819,24 @@ enum QS_QSpyObjKind { }; /*${QS::QS-rx::OSpyObjCombnation} ..........................................*/ -/*! Object combinations for QS_setCurrObj() and QS_queryCurrObj() */ +/*! Object combinations for QS_setCurrObj() and QS_queryCurrObj() +* @static @public @memberof QS_rx +*/ enum QS_OSpyObjCombnation { SM_AO_OBJ = (enum_t)MAX_OBJ /*!< combination of SM and AO */ }; /*${QS::QS-rx::rxInitBuf} ..................................................*/ /*! Initialize the QS-RX data buffer +* @static @public @memberof QS_rx * * @details * This function should be called from QS::onStartup() to provide QS-RX * with the receive data buffer. * -* @param[in] sto[] the address of the memory block +* @param[in] sto pointer to the memory block for input buffer * @param[in] stoSize the size of this block [bytes]. The size of the -* QS RX buffer cannot exceed 64KB. +* QS-RX buffer cannot exceed 64KB. * * @note * QS-RX can work with quite small data buffers, but you will start @@ -778,7 +857,9 @@ void QS_rxInitBuf( uint16_t const stoSize); /*${QS::QS-rx::rxPut} ......................................................*/ -/*! Put one byte into the QS-RX lock-free buffer */ +/*! Put one byte into the QS-RX lock-free buffer +* @static @public @memberof QS_rx +*/ static inline bool QS_rxPut(uint8_t const b) { QSCtr head = QS_rxPriv_.head + 1U; if (head == QS_rxPriv_.end) { @@ -796,6 +877,7 @@ static inline bool QS_rxPut(uint8_t const b) { /*${QS::QS-rx::rxGetNfree} .................................................*/ /*! Obtain the number of free bytes in the QS-RX data buffer +* @static @public @memberof QS_rx * * @details * This function is intended to be called from the ISR that reads the @@ -808,42 +890,54 @@ static inline bool QS_rxPut(uint8_t const b) { uint16_t QS_rxGetNfree(void); /*${QS::QS-rx::doInput} ....................................................*/ -/*! Perform the QS-RX input (implemented in some QS ports) */ +/*! Perform the QS-RX input (implemented in some QS ports) +* @static @public @memberof QS_rx +*/ void QS_doInput(void); /*${QS::QS-rx::setCurrObj} .................................................*/ /*! Set the "current object" in the Target +* @static @public @memberof QS_rx * * @details * This function sets the "current object" in the Target. */ void QS_setCurrObj( - uint8_t obj_kind, - void * obj_ptr); + uint8_t const obj_kind, + void * const obj_ptr); /*${QS::QS-rx::queryCurrObj} ...............................................*/ /*! Query the "current object" in the Target +* @static @public @memberof QS_rx * * @details * This function programmatically generates the response to the query for * a "current object". */ -void QS_queryCurrObj(uint8_t obj_kind); +void QS_queryCurrObj(uint8_t const obj_kind); /*${QS::QS-rx::rxParse} ....................................................*/ -/*! Parse all bytes present in the QS-RX data buffer */ +/*! Parse all bytes present in the QS-RX data buffer +* @static @public @memberof QS_rx +*/ void QS_rxParse(void); /*${QS::QS-rx::rxHandleGoodFrame_} .........................................*/ -/*! internal function to handle incoming (QS-RX) packet */ +/*! internal function to handle incoming (QS-RX) packet +* @static @private @memberof QS_rx +*/ void QS_rxHandleGoodFrame_(uint8_t const state); /*${QS::QS-rx::onReset} ....................................................*/ -/*! callback function to reset the Target (to be implemented in the BSP) */ +/*! callback function to reset the Target (to be implemented in the BSP) +* @static @public @memberof QS_rx +*/ void QS_onReset(void); /*${QS::QS-rx::onCommand} ..................................................*/ -/*! Callback function to execute user commands (to be implemented in BSP) */ +/*! Callback function to execute user commands (to be implemented in BSP) +* @static @public @memberof QS_rx +*/ void QS_onCommand( uint8_t cmdId, uint32_t param1, @@ -851,7 +945,9 @@ void QS_onCommand( uint32_t param3); /*${QS::QS-rx::RX_PUT} .....................................................*/ -/*! Put one byte into the QS RX lock-free buffer */ +/*! Put one byte into the QS RX lock-free buffer +* @static @public @memberof QS_rx +*/ bool QS_RX_PUT(uint8_t const b); /*$enddecl${QS} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -1375,7 +1471,7 @@ void QS_test_pause_(void); /*${QUTest::QS::getTestProbe_} .............................................*/ /*! get the test probe data for the given API */ -uint32_t QS_getTestProbe_(QSpyFunPtr api); +uint32_t QS_getTestProbe_(QSpyFunPtr const api); /*${QUTest::QS::onTestSetup} ...............................................*/ /*! callback to setup a unit test inside the Target */ diff --git a/qspy/include/qpc_qs_pkg.h b/qspy/include/qpc_qs_pkg.h index 34ecaf2..1d977a3 100644 --- a/qspy/include/qpc_qs_pkg.h +++ b/qspy/include/qpc_qs_pkg.h @@ -3,7 +3,7 @@ * Model: qpc.qm * File: ${include::qs_pkg.h} * -* This code has been generated by QM 5.2.2 . +* This code has been generated by QM 5.2.3 . * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost. * * This code is covered by the following QP license: