Skip to content
Discussion options

You must be logged in to vote

Please see here, Rafi:
https://github.com/rokath/trice/blob/main/docs/TriceUserManual.md#346-runtime-generated-0-terminated-strings-transfer-with-trices

trice macros that do enable several %s parameters ?

Trice was designed mainly for speed. An universal trice like printf would cost too much runtime and destroy this main Trice advantage.

If you need several %s, like in

char* n = "Ann";
char* f = "Fox";
uint8_t dd = 22;
uint8_t mm = 11;
uint16_t yyyy = 1988;
// ...
print( "Name: %12s, Family: %s, Birthday %2u-%02u-%4u\n",  n, f, dd, mm, yyyy );

you can do:

// ...
triceS( "Name: %12s, ",  n );
triceS( "Family: %s, ", f );
trice( "Birthday %2u-%02u-%4u\n", dd, mm, yyyy );

or also

// ...
tr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rokath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants