Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d6e0be1
UM updated with compiler setup infos
rokath Jul 29, 2026
3fb4f25
Issue #712 implemented
rokath Jul 29, 2026
2d4bfa0
limit max number of make jobs to kernel count in windows
rokath Jul 29, 2026
638fcbb
limit max number of make jobs to kernel count in windows
rokath Jul 29, 2026
711d02e
Win compiler setup chapter updated
rokath Jul 30, 2026
1a5a29a
Merge remote-tracking branch 'origin/wip' into wip
rokath Jul 30, 2026
51dad3b
cppcheck old version tolerance added
rokath Jul 31, 2026
3464c60
PoC v2 trice build
rokath Aug 1, 2026
2815b97
Merge remote-tracking branch 'origin/wip' into wip
rokath Aug 1, 2026
f4e38a9
trice bind spec draft
rokath Aug 1, 2026
ea944bf
trice bind spec v2 added
rokath Aug 2, 2026
e720340
>DISCUSSION added to trice bind draft v2
rokath Aug 2, 2026
ceb46b9
wip v3 bind spec
rokath Aug 4, 2026
9d92c20
renamed
rokath Aug 5, 2026
910948a
renamed
rokath Aug 5, 2026
5d8f8d9
renamed
rokath Aug 5, 2026
283b211
trice bind PoCs added
rokath Aug 5, 2026
0498f22
trice bind spec v4
rokath Aug 5, 2026
d9147ad
trice bind spec v4 minimal updated
rokath Aug 5, 2026
69be890
v4 codex Prompt
rokath Aug 5, 2026
4164a7c
codex v4 trice bind spec output
rokath Aug 5, 2026
8353157
formatting adjusted
rokath Aug 5, 2026
990f479
files moved
rokath Aug 5, 2026
3945df1
moved/renamed
rokath Aug 5, 2026
4350505
trice bind UM updated
rokath Aug 5, 2026
1a3f86e
wip
rokath Aug 5, 2026
0f16047
TriceBind folder moved from ./docs/scratchpad into ./docs
rokath Aug 7, 2026
e7e0a06
Merge branch 'main' into wip
rokath Aug 7, 2026
efb67f9
obsolete files deleted
rokath Aug 7, 2026
c937672
renamed
rokath Aug 7, 2026
41d360b
new
rokath Aug 7, 2026
66d0353
Complete trice bind test implementation - not reviewed yet
rokath Aug 7, 2026
cd1011f
minor corrections and chmod +x for *.sh scripts
rokath Aug 7, 2026
a049796
MVP2v1 PoC More than one trice in a single line
rokath Aug 8, 2026
35afa6f
MVP2 PoC update
rokath Aug 8, 2026
adad8b1
trice bind mvp2 PoC added
rokath Aug 9, 2026
c2b5cd3
typo corrected
rokath Aug 9, 2026
4466296
notes
rokath Aug 9, 2026
edfd30a
minor fix
rokath Aug 9, 2026
90e9259
Merge remote-tracking branch 'origin/wip' into wip
rokath Aug 9, 2026
c609eae
bind state && clean
rokath Aug 9, 2026
11901d4
wip
rokath Aug 9, 2026
89a6a03
shell script formatted
rokath Aug 9, 2026
7065282
minor
rokath Aug 10, 2026
3dcb780
Fix cppcheck capability detection
rokath Aug 10, 2026
6ddece4
Handle switched Go toolchains in test scripts
rokath Aug 10, 2026
d1c3756
Skip manual formatting check without mdtoc
rokath Aug 10, 2026
ab00516
legacy path corrected
rokath Aug 10, 2026
0d610f6
Organize Trice bind documentation and experiments
rokath Aug 11, 2026
c3d959a
trice bind MVP2 codex implemented - not reviewed
rokath Aug 11, 2026
adf4dbe
Implement Trice bind MVP2 rebasing
rokath Aug 13, 2026
b09ba0c
Keep canonical Trice fixtures in bind state
rokath Aug 13, 2026
7002eb3
Document Trice bind MVP2 usage
rokath Aug 13, 2026
44f3636
Make C formatting selection deterministic
rokath Aug 13, 2026
c9ec57e
Apply repository C formatting
rokath Aug 13, 2026
650a225
exclude vendor sources from formatting
rokath Aug 13, 2026
4edbe06
buildTriceTool.sh now mor roust
rokath Aug 13, 2026
51e9d11
demo for trice bind added
rokath Aug 14, 2026
203604b
./demo reworked
rokath Aug 14, 2026
83cb293
trice bind now in root README.md and UM
rokath Aug 14, 2026
f13b401
Merge branch 'main' into feature/trice-bind-mvp2-rebase
rokath Aug 14, 2026
34ebffd
./scripts/format_repo.sh fix to leave repo not in trice clean state
rokath Aug 14, 2026
01f9429
minor fix to silence shellcheck
rokath Aug 14, 2026
2231799
content now in UM
rokath Aug 14, 2026
fb401d4
trice bind test adapted to Windos
rokath Aug 14, 2026
86c1d86
__COUNTER__ workaround added
rokath Aug 14, 2026
dba1296
now only ./scripts/testAll.sh full tests trice insert/clean
rokath Aug 14, 2026
04bf7f7
format-repo.sh now formats after trice bind
rokath Aug 14, 2026
9f82f90
links corrected after file move
rokath Aug 14, 2026
4d4637a
trice bind tree behaviour stabilized
rokath Aug 16, 2026
0a5a51a
perf(bind): cache metadata and batch source edits
rokath Aug 17, 2026
2c9ef14
fix(emitter): isolate display server lifecycle
rokath Aug 17, 2026
3610e59
fix(test): terminate error example messages
rokath Aug 18, 2026
faa0fcf
test: streamline quick target coverage
rokath Aug 18, 2026
10399b8
fix(test): run L432 matrix in bound state
rokath Aug 18, 2026
220f956
ci: pin clang-format 19.1.7
rokath Aug 18, 2026
9ff4da8
fix(examples): prepare bind sidecars before builds
rokath Aug 18, 2026
73fe9c4
test(bind): cover metadata recovery paths
rokath Aug 18, 2026
7de9d94
docs: mark trice bind as experimental
rokath Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: Always
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
Expand Down
6 changes: 6 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ examples/*_bare/**
# STM32 HAL driver code is machine-generated and should not be modified.
examples/*_inst/Drivers/**

# 3) Ignore every vendor middleware tree below ./examples/.
#
# These directories contain third-party sources such as FreeRTOS and must stay
# byte-identical to the versions supplied by their vendors.
examples/**/Middlewares/**



###############################################################################
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Clang-Format Check
# are formatted according to the .clang-format rules.
#
# It uses:
# - clang-format (installed via apt)
# - clang-format 19.1.7 (installed in an isolated Python environment)
# - a Go-based helper (cmd/clang-filter) via `go run`
# - the shell script `./scripts/_format_c_code.sh` to orchestrate everything
#
Expand Down Expand Up @@ -39,15 +39,20 @@ jobs:
fetch-depth: 0

#########################################################################
# 2) Install clang-format on the runner.
# 2) Install the repository's canonical clang-format release.
#
# We rely on Ubuntu's clang-format package. If you require a specific
# version, you can pin it here or use a prebuilt toolchain image.
# clang-format output changes between releases. An unversioned apt package
# therefore makes local formatting and CI checks disagree when the hosted
# runner changes its Ubuntu image. The PyPI package supplies the exact
# native formatter binary in an isolated environment.
#########################################################################
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
python3 -m venv "$RUNNER_TEMP/clang-format"
"$RUNNER_TEMP/clang-format/bin/python" -m pip install \
--disable-pip-version-check \
"clang-format==19.1.7"
echo "$RUNNER_TEMP/clang-format/bin" >> "$GITHUB_PATH"

- name: Show clang-format version
run: clang-format --version
Expand Down
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@ Choose one first path:

For most existing projects, the non-blocking byte writer path is the least disruptive first integration.

## Coming soon
## Recommended ID workflow: `trice bind`

`trice bind ...` stores the IDs in sidecar build artifacts avoiding this way source code changes. This is complete compiler independent. Try it now in branch `wip`.
`trice bind` is the successor to the legacy `trice insert` / `trice clean` workflow. It keeps numeric IDs out of bind-managed Trice calls by generating sidecar headers as temporary build artefacts. Existing `insert` / `clean` projects remain fully supported and continue to work unchanged. This technique does not patch the user sources anymore during the build process. See [Trice Bind in User Manual](./docs/TriceUserManual.md#trice-bind) for details.

`trice bind` is currently experimental and is not yet included in an official release. To try it before the next release, build the `trice` tool from this repository and ensure the resulting executable is in your `PATH`:

```sh
./scripts/buildTriceTool.sh
```

Try the minimal [`demo`](./demo). It uses only the installed `trice` binary and the target sources in [`src`](./src) from this repository.

## Details and advanced topics

Expand All @@ -70,6 +78,8 @@ This reduces target FLASH usage, transfer bandwidth, log files and log-call exec

<details markdown="1"><summary>How ID-based decoding works</summary>

The recommended workflow uses `trice bind` as described above. The following steps describe the legacy source-modifying workflow, which remains supported:

1. Write `trice(...)` calls in firmware code.
2. Run `trice insert` before compilation.
3. The compiler sees stable numeric IDs.
Expand All @@ -85,9 +95,9 @@ A typical source-level idea is:

</details>

<details markdown="1"><summary>What about source code modification?</summary>
<details markdown="1"><summary>Legacy source-code ID workflow (still supported)</summary>

Trice assigns IDs by processing source files with `trice insert`.
The legacy workflow assigns IDs by processing source files with `trice insert`. This workflow remains supported for existing and new projects.
A call such as this:

```c
Expand Down Expand Up @@ -166,10 +176,16 @@ You can also build your own receiver that reads Trice packages, maps IDs to form

Keep the one accumulated `til.json` to decode all previously released firmware versions.
The repository example file is [demoTIL.json](./demoTIL.json).
Each `li.json` entry stores a normalized `File` path relative to the location-file
directory by default. Use `-liRoot` to select a different project root when
creating location data. Log output shows only the file name by default; use
`-liMaxDirs` to include trailing parent directories.

</details>

<details markdown="1"><summary>Three common ID workflows</summary>
<details markdown="1"><summary>Legacy insert/clean ID workflows (still supported)</summary>

These three source-modifying workflows remain fully supported:

**Keep IDs in source** - good for small projects and maximum robustness.

Expand Down Expand Up @@ -200,7 +216,7 @@ If other tools also rewrite source files, such as formatters or code generators,

</details>

<details markdown="1"><summary>Trice cache</summary>
<details markdown="1"><summary>Legacy insert/clean cache (still supported)</summary>

The Trice cache avoids unnecessary rebuilds when using `trice insert` and `trice clean` around the build.
It keeps cached inserted and cleaned copies of unchanged files.
Expand All @@ -225,7 +241,7 @@ See [Trice Cache for Compilation Speed](./docs/TriceUserManual.md#trice-cache-fo

</details>

<details markdown="1"><summary>Normal workflow</summary>
<details markdown="1"><summary>Legacy insert workflow (still supported)</summary>

1. Add the Trice target sources from [`src/`](./src) to your firmware project.
2. Add a project-specific `triceConfig.h`.
Expand Down
14 changes: 7 additions & 7 deletions _test/abc_rx_host/device_abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "triceRx.h"

const triceAbc_t triceAbc[] = {
/* Trice type */ /* id, bitWidth, function pointer */
/* TRICe_C */ { 1001u, 0u, rx_no_payload },
/* TRICE8_C */ { 1006u, 8u, rx_i8_bulk },
/* TRICE16_C */ { 1002u, 16u, rx_i16 },
/* TRIce32_C */ { 1003u, 32u, rx_i32 },
/* Trice64C */ { 1004u, 64u, rx_i64 },
/* TRiceC */ { 1005u, 0u, rx_nested },
/* Trice type */ /* id, bitWidth, function pointer */
/* TRICe_C */ {1001u, 0u, rx_no_payload},
/* TRICE8_C */ {1006u, 8u, rx_i8_bulk},
/* TRICE16_C */ {1002u, 16u, rx_i16},
/* TRIce32_C */ {1003u, 32u, rx_i32},
/* Trice64C */ {1004u, 64u, rx_i64},
/* TRiceC */ {1005u, 0u, rx_nested},
};

const unsigned triceAbcElements = sizeof(triceAbc) / sizeof(triceAbc[0]);
36 changes: 18 additions & 18 deletions _test/abc_rx_host/triceAbcReceiveTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// triceLog is a small generated-table stand-in for testing log resolution
// without adding another generated fixture file.
const triceLog_t triceLog[] = {
{ 2001u, TRICE_DEFAULT_PARAMETER_BIT_WIDTH, 1u, "default:%d" },
{ 2002u, 0u, 0u, "cmd:no-payload" },
{ 2003u, 16u, TRICE_LOG_PARAM_COUNT_DYNAMIC, "cmd:%d" },
{2001u, TRICE_DEFAULT_PARAMETER_BIT_WIDTH, 1u, "default:%d"},
{2002u, 0u, 0u, "cmd:no-payload"},
{2003u, 16u, TRICE_LOG_PARAM_COUNT_DYNAMIC, "cmd:%d"},
};

// triceLogElements mirrors the generated element-count symbol used by runtime wrappers.
Expand Down Expand Up @@ -154,8 +154,8 @@ static int TriceAbcOnReceive(const uint8_t* pBuf, int len) {
}

rx.abcFnHandler(&rx);
//e = TriceDispatchAbc(&rx);
return used; //TRICE_RX_RESULT_OK; // (e == TRICE_RX_RESULT_OK || e == TRICE_RX_ERR_NOT_FOUND) ? used : TRICE_RX_ERR_PAYLOAD_LEN_BITWIDTH_MISMATCH;
// e = TriceDispatchAbc(&rx);
return used; // TRICE_RX_RESULT_OK; // (e == TRICE_RX_RESULT_OK || e == TRICE_RX_ERR_NOT_FOUND) ? used : TRICE_RX_ERR_PAYLOAD_LEN_BITWIDTH_MISMATCH;
}

// rx_i8_bulk verifies the long-count path and byte-granular payload handling.
Expand Down Expand Up @@ -263,7 +263,7 @@ static int triceValidateLogPayload(const triceRx_t* rx) {
return (rx->payloadBytes == 0u && rx->paramCount == 0u) ? TRICE_RX_RESULT_OK : TRICE_RX_ERR_PAYLOAD_LEN_BITWIDTH_MISMATCH;
}
{
uint32_t expectedBytes = (uint32_t)rx->paramCount * (uint32_t)(rx->bitWidth>>3);
uint32_t expectedBytes = (uint32_t)rx->paramCount * (uint32_t)(rx->bitWidth >> 3);
return (rx->payloadBytes == expectedBytes) ? TRICE_RX_RESULT_OK : TRICE_RX_ERR_PAYLOAD_LEN_BITWIDTH_MISMATCH;
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 2: { // Selected int16 payload ABC with 32-bit stamp dispatches one aligned payload record.
int16_t payload[2] = { 123, -456 };
int16_t payload[2] = {123, -456};
uint8_t record[16];
int used = rxBuildAbcRecord(record, 1002u, 32u, 0x12345678u, payload, (uint16_t)sizeof(payload), 0);
result = TriceAbcOnReceive(record, used);
Expand All @@ -330,7 +330,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 3: { // Selected int32 payload ABC without stamp dispatches one no-stamp record.
int32_t payload[1] = { 0x11223344 };
int32_t payload[1] = {0x11223344};
uint8_t record[8];
int used = rxBuildAbcRecord(record, 1003u, 0u, 0u, payload, (uint16_t)sizeof(payload), 0);
result = TriceAbcOnReceive(record, used);
Expand All @@ -339,7 +339,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 4: { // Selected int64 payload ABC with 16-bit stamp returns logical length without padding.
int64_t payload[1] = { (int64_t)0x1122334455667788ll };
int64_t payload[1] = {(int64_t)0x1122334455667788ll};
uint8_t record[16];
int used = rxBuildAbcRecord(record, 1004u, 16u, 0x8877u, payload, (uint16_t)sizeof(payload), 1);
result = TriceAbcOnReceive(record, used);
Expand All @@ -365,7 +365,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 7: { // Misaligned int32 payload size is rejected before handler execution.
uint8_t payload[2] = { 1u, 2u };
uint8_t payload[2] = {1u, 2u};
uint8_t record[8];
int used = rxBuildAbcRecord(record, 1003u, 0u, 0u, payload, (uint16_t)sizeof(payload), 0);
result = TriceAbcOnReceive(record, used);
Expand All @@ -374,7 +374,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 8: { // Truncated selected record is rejected before handler execution.
int16_t payload[2] = { 123, -456 };
int16_t payload[2] = {123, -456};
uint8_t record[16];
int used = rxBuildAbcRecord(record, 1002u, 32u, 0x12345678u, payload, (uint16_t)sizeof(payload), 0);
result = TriceAbcOnReceive(record, used - 1);
Expand Down Expand Up @@ -404,7 +404,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 11: { // Log resolver applies the configured default bit width to no-width log names.
int32_t payload[1] = { 0x01020304 };
int32_t payload[1] = {0x01020304};
uint8_t record[8];
triceRx_t rx;
int used = rxBuildAbcRecord(record, 2001u, 0u, 0u, payload, (uint16_t)sizeof(payload), 0);
Expand Down Expand Up @@ -433,12 +433,12 @@ int TriceAbcRxHostCheck(int n) {
rxFailUnless(rx.payload == 0);
rxFailUnless(rx.payloadBytes == 0u);
result = triceValidateLogPayload(&rx);
//rxFailUnless(result == TRICE_RX_ERR_UNSUPPORTED_X0_FRAME);
// rxFailUnless(result == TRICE_RX_ERR_UNSUPPORTED_X0_FRAME);
rxFailUnless(rxCalls == 0);
break;
}
case 13: { // Explicit log bit widths still win over the no-width default for resolved metadata.
int16_t payload[2] = { 11, 22 };
int16_t payload[2] = {11, 22};
uint8_t record[8];
triceRx_t rx;
int used = rxBuildAbcRecord(record, 2003u, 0u, 0u, payload, (uint16_t)sizeof(payload), 0);
Expand All @@ -451,16 +451,16 @@ int TriceAbcRxHostCheck(int n) {
rxFailUnless(rx.paramCount == TRICE_LOG_PARAM_COUNT_DYNAMIC);
rxFailUnless(rx.payloadBytes == sizeof(payload));
result = triceValidateLogPayload(&rx);
//rxFailUnless(result == TRICE_RX_ERR_UNSUPPORTED_X0_FRAME);
// rxFailUnless(result == TRICE_RX_ERR_UNSUPPORTED_X0_FRAME);
rxFailUnless(rxCalls == 0);
break;
}
case 14: { // TriceLogOnReceive consumes known and unknown log IDs without dispatch side effects.
int32_t payload[1] = { 0x55667788 };
int32_t payload[1] = {0x55667788};
uint8_t record[8];
int used = rxBuildAbcRecord(record, 2001u, 0u, 0u, payload, (uint16_t)sizeof(payload), 0);
result = TriceLogOnReceive(record, used);
//rxFailUnless(result == used);
// rxFailUnless(result == used);
used = rxBuildAbcRecord(record, 2999u, 0u, 0u, 0, 0u, 0);
result = TriceLogOnReceive(record, used);
rxFailUnless(result == used);
Expand All @@ -473,7 +473,7 @@ int TriceAbcRxHostCheck(int n) {
break;
}
case 15: { // A caller advances through a stream because TriceAbcOnReceive consumes only one record.
int32_t payload[1] = { 0x11223344 };
int32_t payload[1] = {0x11223344};
uint8_t stream[16];
int firstLen;
int secondLen;
Expand Down
20 changes: 10 additions & 10 deletions _test/abc_tx_host/triceAbcTransmitTest.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

// TRICE_INSERT_OFF - Trice parser exclusion marker
// TRICE_INSERT_OFF - Trice parser exclusion marker
// This is a test file. It must not get the Trice IDs changed!

#include <string.h>
Expand Down Expand Up @@ -29,35 +29,35 @@ int TriceAbcTxHostCheck(int n) {
abcTxReset();
switch (n) {
case 1: {
static const uint8_t expected[] = { 0x34u, 0x52u, 0xc0u, 0x00u };
static const uint8_t expected[] = {0x34u, 0x52u, 0xc0u, 0x00u};
triceC(iD(0x1234), "cmd:stop");
return abcTxEquals(expected, sizeof(expected)) ? 0 : 1;
}
case 2: {
static const uint8_t expected[] = { 0x23u, 0x81u, 0x23u, 0x81u, 0xcdu, 0xabu, 0xc0u, 0x00u };
static const uint8_t expected[] = {0x23u, 0x81u, 0x23u, 0x81u, 0xcdu, 0xabu, 0xc0u, 0x00u};
TriceC(iD(0x0123), "cmd:stop", 0xabcdu);
return abcTxEquals(expected, sizeof(expected)) ? 0 : 2;
}
case 3: {
static const uint8_t expected[] = { 0x23u, 0xc1u, 0x44u, 0x33u, 0x22u, 0x11u, 0xc0u, 0x00u };
static const uint8_t expected[] = {0x23u, 0xc1u, 0x44u, 0x33u, 0x22u, 0x11u, 0xc0u, 0x00u};
TRiceC(iD(0x0123), "cmd:stop", 0x11223344u);
return abcTxEquals(expected, sizeof(expected)) ? 0 : 3;
}
case 4: {
int8_t payload[] = { 1, 2, 3 };
static const uint8_t expected[] = { 0x55u, 0x40u, 0xc0u, 0x03u, 0x01u, 0x02u, 0x03u, 0x00u };
int8_t payload[] = {1, 2, 3};
static const uint8_t expected[] = {0x55u, 0x40u, 0xc0u, 0x03u, 0x01u, 0x02u, 0x03u, 0x00u};
trice8C(iD(0x0055), "cmd:set_leds", payload, 3);
return abcTxEquals(expected, sizeof(expected)) ? 0 : 4;
}
case 5: {
int16_t payload[] = { 0x1122, 0x3344 };
static const uint8_t expected[] = { 0x23u, 0x81u, 0x23u, 0x81u, 0xcdu, 0xabu, 0xc0u, 0x04u, 0x22u, 0x11u, 0x44u, 0x33u };
int16_t payload[] = {0x1122, 0x3344};
static const uint8_t expected[] = {0x23u, 0x81u, 0x23u, 0x81u, 0xcdu, 0xabu, 0xc0u, 0x04u, 0x22u, 0x11u, 0x44u, 0x33u};
Trice16C(iD(0x0123), "cmd:set_pwm", 0xabcdu, payload, 2);
return abcTxEquals(expected, sizeof(expected)) ? 0 : 5;
}
case 6: {
int32_t payload[] = { 0x11223344 };
static const uint8_t expected[] = { 0x23u, 0xc1u, 0x04u, 0x03u, 0x02u, 0x01u, 0xc0u, 0x04u, 0x44u, 0x33u, 0x22u, 0x11u };
int32_t payload[] = {0x11223344};
static const uint8_t expected[] = {0x23u, 0xc1u, 0x04u, 0x03u, 0x02u, 0x01u, 0xc0u, 0x04u, 0x44u, 0x33u, 0x22u, 0x11u};
TRice32C(iD(0x0123), "cmd:set_time", 0x01020304u, payload, 1);
return abcTxEquals(expected, sizeof(expected)) ? 0 : 6;
}
Expand Down
10 changes: 8 additions & 2 deletions _test/abc_tx_host/triceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ extern "C" {
extern uint32_t abcTxWords[];
extern uint32_t abcTxLength;

#define TRICE_ENTER do { uint32_t* TriceBufferWritePosition = abcTxWords;
#define TRICE_LEAVE abcTxLength = (uint32_t)((uint8_t*)TriceBufferWritePosition - (uint8_t*)abcTxWords); } while (0);
#define TRICE_ENTER \
do { \
uint32_t* TriceBufferWritePosition = abcTxWords;
#define TRICE_LEAVE \
abcTxLength = (uint32_t)((uint8_t*)TriceBufferWritePosition - (uint8_t*)abcTxWords); \
} \
while (0) \
;

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions _test/alias_dblB_de_tcobs_ua/TargetActivity.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! \details Go func triceLogSpecialTest parses additionally this file to collect the expected results line by line for later test execution.

#include "trice.h"
#include "trice_TargetActivity_c_KF1E016F27623CC56.h" // trice-bind: keep as last include before this file's Trice calls

// The strings behind "//exp:" are the expected result for each line (-color=off)
// Lines ending with a comment starting with `//exp:` are executed during the automatic Go tests.
Expand Down
14 changes: 9 additions & 5 deletions _test/alias_dblB_de_tcobs_ua/triceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ extern "C" {
//! prints is a user print example with string, float and integer values.
//! We have to perform a normal print into a buffer, which then is passed to triceS.
//! This is slow but we can integrate user code without changing it.
#define prints(id, ...) \
do { \
char buf[96]; \
npf_snprintf(buf, sizeof(buf), __VA_ARGS__); \
triceS(id, "%s", buf); \
// Route the registered simple alias at its invocation site so bound sources
// obtain the ID from their sidecar and inserted sources retain their ID argument.
#define PRINTS_WITH_ID(id, ...) \
do { \
char buf[96]; \
npf_snprintf(buf, sizeof(buf), __VA_ARGS__); \
TRICE_INSERT_triceS(id, "%s", buf); \
} while (0)
#define prints(...) \
TRICE_BIND_DISPATCH(TRICE_BIND_ROUTE(TRICE_BIND_FILE_KEY), PRINTS_WITH_ID, __VA_ARGS__)

//
//////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions _test/aliasassert_dblB_de_tcobs_ua/TargetActivity.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! \details Go func triceLogSpecialTest parses additionally this file to collect the expected results line by line for later test execution.

#include "trice.h"
#include "trice_TargetActivity_c_K707A6451A08AFEBA.h" // trice-bind: keep as last include before this file's Trice calls

// The strings behind "//exp:" are the expected result for each line (-color=off)
// Lines ending with a comment starting with `//exp:` are executed during the automatic Go tests.
Expand Down
Loading
Loading