You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile without (u)int64 and with 16-bit (u)int, solving #607 and #608 (#609)
* Allow complete (u)int64_t disable (#607). Allow compilation with 16 bit integer width (#608).
* Another trice64 occurrence made conditional. #607
* Explicit casts and library include outside extern C (#610).
* Make TRICE_CYCLE a native uint_fast32_t, following hint by @rokath in #609
Copy file name to clipboardExpand all lines: src/trice.h
+24-15Lines changed: 24 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,9 @@
5
5
#ifndefTRICE_H_
6
6
#defineTRICE_H_
7
7
8
+
#include<stdint.h>
9
+
#include<string.h>
10
+
8
11
#ifdef__cplusplus
9
12
extern"C" {
10
13
#endif
@@ -50,44 +53,42 @@ extern "C" {
50
53
// lint -emacro( 717, DCOPY, SCOPY )
51
54
// lint -emacro( 732, DCOPY )
52
55
53
-
// helper macros (the numbers are 32-bit random values)
56
+
// helper macros (the numbers are 16-bit random values)
54
57
55
58
//! TRICE_SINGLE_PACK_MODE is the recommended TRICE_DEFERRED_TRANSFER_MODE. It packs each trice in a separate TCOBS package with a following 0-delimiter byte.
56
59
//! Single trices need a bit more transfer data. In case of a data disruption, only a single trice messages can get lost.
57
-
#defineTRICE_SINGLE_PACK_MODE787345706U
60
+
#defineTRICE_SINGLE_PACK_MODE5706U
58
61
59
62
//! TRICE_MULTI_PACK_MODE packs all trices of a buffer in a single TCOBS package and a following 0-delimiter byte.
60
63
//! Grouped trices need a bit less transfer data. In case of a data disruption, multiple trice messages can get lost.
61
64
//! Olny relevant when TRICE_DOUBLE_BUFFER is selected
62
-
#defineTRICE_MULTI_PACK_MODE3987862482U
65
+
#defineTRICE_MULTI_PACK_MODE2482U
63
66
64
67
//! With TRICE_BUFFER == TRICE_STACK_BUFFER the internal macro TRICE_PUT writes to the stack.
65
68
//! This is direct logging. This reduces memory needs if only one stack is used.
66
-
#defineTRICE_STACK_BUFFER2645382063U
69
+
#defineTRICE_STACK_BUFFER2063U
67
70
68
71
//! With TRICE_BUFFER == TRICE_STATIC_BUFFER the internal macro TRICE_PUT writes to a static buffer.
69
72
//! This reduces memory needs if many stacks are used.
70
-
#defineTRICE_STATIC_BUFFER1763551404U
73
+
#defineTRICE_STATIC_BUFFER1404U
71
74
72
75
//! With TRICE_BUFFER == TRICE_DOUBLE_BUFFER the internal macro TRICE_PUT writes to a double buffer half.
73
76
//! This is deferred logging using more space but the TRICE macros are executed faster.
74
-
#defineTRICE_DOUBLE_BUFFER1950870368U
77
+
#defineTRICE_DOUBLE_BUFFER368U
75
78
76
79
//! With TRICE_BUFFER == TRICE_RING_BUFFER the internal macro TRICE_PUT writes to a ring buffer segment.
77
80
//! This is deferred logging using less space but the TRICE macros are executed a bit slower.
78
-
#defineTRICE_RING_BUFFER2237719049U
81
+
#defineTRICE_RING_BUFFER9049U
79
82
80
83
//! TRICE_FRAMING_TCOBS is recommended for trice transfer over UART.
81
-
#defineTRICE_FRAMING_TCOBS3745917584U
84
+
#defineTRICE_FRAMING_TCOBS7584U
82
85
83
86
//! TRICE_FRAMING_COBS is recommended for encrypted trices.
84
-
#defineTRICE_FRAMING_COBS2953804234U
87
+
#defineTRICE_FRAMING_COBS4234U
85
88
86
89
//! TRICE_FRAMING_NONE is recommended for RTT in direct mode. One trice costs about 100 clocks and is completely done.
87
-
#defineTRICE_FRAMING_NONE1431860787U
90
+
#defineTRICE_FRAMING_NONE787U
88
91
89
-
#include<stdint.h>
90
-
#include<string.h>
91
92
#include"triceConfig.h"// Project specific settings are overwriting the default settings.
0 commit comments