Skip to content

Commit

Permalink
Issue [#439](#439) done
Browse files Browse the repository at this point in the history
  • Loading branch information
rokath authored and th-sabik committed Jan 25, 2024
1 parent d446c57 commit efd4e7d
Show file tree
Hide file tree
Showing 29 changed files with 345 additions and 102 deletions.
21 changes: 18 additions & 3 deletions docs/TriceUserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
- [2.5.7. Trice (Time) Stamps](#257-trice-time-stamps)
- [2.5.8. Trice Parameter Bit Widths](#258-trice-parameter-bit-widths)
- [2.6. Avoid it](#26-avoid-it)
- [2.6.1. Parser Limitation](#261-parser-limitation)
- [2.6.2. No _trice_ macros in header files](#262-no-trice-macros-in-header-files)
- [2.6.3. No _trice_ macros inside other macros](#263-no-trice-macros-inside-other-macros)
- [3. Build `trice` tool from Go sources (you can skip that)](#3-build-trice-tool-from-go-sources-you-can-skip-that)
- [4. Embedded system code configuration](#4--embedded-system-code-configuration)
- [5. `trice` tool in logging action](#5-trice-tool-in-logging-action)
Expand Down Expand Up @@ -102,7 +105,6 @@
- [20.11. Option 3: Cleaning on Repository Check-In](#2011-option-3-cleaning-on-repository-check-in)
- [21. Changelog](#21-changelog)


<!-- vscode-markdown-toc-config
numbering=true
autoSave=true
Expand Down Expand Up @@ -461,9 +463,11 @@ Hint: With the defaut TCOBS framing 8-bit values as 32-bit parameters typically
### 2.6. <a name='Avoidit'></a>Avoid it
Because the implemented souce code parser for `trice insert` and `trice clean` is only a simple one, there is one important limitation:
#### 2.6.1. <a name='ParserLimitation'></a>Parser Limitation
Because the implemented source code parser for `trice insert` and `trice clean` is only a simple one, there is one important limitation:
- Do not use an unescaped singe double quote in soure code comments. Example:
- Do not use an unescaped singe double quote in source code comments. Example:
```C
trice( "hi 0" );
Expand All @@ -482,6 +486,17 @@ trice( "hi 4");

(See also [issue #427](https://github.com/rokath/trice/issues/427))

#### 2.6.2. <a name='No_trice_macrosinheaderfiles'></a>No _trice_ macros in header files

- There is nothing wrong, when putting _trice_ macros into header files.
- But: When you use `trice insert` as pre-build command and `trice clean` as post build command, those heder files get touched on each build and therefore all source code files including them will be re-translated every time.
- For efficiency avoid that.

#### 2.6.3. <a name='No_trice_macrosinsideothermacros'></a>No _trice_ macros inside other macros

- There is nothing wrong, when putting _trice_ macros into other macros.
- But: When running the self made macro, the location information of the inner _trice_ macro will point to the self made macro definition and not to its execution location.

<p align="right">(<a href="#top">back to top</a>)</p>

## 3. <a name='BuildtricetoolfromGosourcesyoucanskipthat'></a>Build `trice` tool from Go sources (you can skip that)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ extern "C" {
//#define TRICE_UARTA_MIN_ID 1 //!< TRICE_UARTA_MIN_ID is the smallest ID transferred to UARTA. Define with TRICE_UARTA_MAX_ID if you want select trice output here.
//#define TRICE_UARTA_MAX_ID ((1<<14)-1) //!< TRICE_UARTA_MAX_ID is the biggest ID transferred to UARTA. Define with TRICE_UARTA_MIN_ID if you want select trice output here.

//! This is usable as the very first trice sequence after restart. Adapt it. Use a UTF-8 capable editor like VS-Code or use pure ASCII.
#define TRICE_HEADLINE \
trice( "\n\n โœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจ \n ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ ๐•น๐–€๐•ฎ๐•ท๐•ฐ๐•บ-๐”ฝ๐Ÿ˜๐Ÿ›๐Ÿ˜โ„๐Ÿ  ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ\n ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ \n\n\n");

// Compiler Adaption:

//! USE_SEGGER_RTT_LOCK_UNLOCK_MACROS == 1 includes SEGGER_RTT header files even SEGGER_RTT is not used.
Expand Down
3 changes: 2 additions & 1 deletion examples/MDK-ARM_STM32F030R8_instrumented/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ int main(void)
/* USER CODE BEGIN 1 */
TriceInit();

TRICE_HEADLINE;
//! This is usable as the very first trice sequence after restart. Adapt it. Use a UTF-8 capable editor like VS-Code or use pure ASCII.
trice( "\n\n โœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจโœจ \n ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ ๐•น๐–€๐•ฎ๐•ท๐•ฐ๐•บ-๐”ฝ๐Ÿ˜๐Ÿ›๐Ÿ˜โ„๐Ÿ  ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ๐ŸŽˆ\n ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ \n\n\n");

#if TRICE_CHECK_CODE
int triceCheckIndex = 0;
Expand Down
Loading

0 comments on commit efd4e7d

Please sign in to comment.