huangyulong 5 місяці тому
джерело
коміт
52c1697789
48 змінених файлів з 14157 додано та 5 видалено
  1. 77
    0
      EWARM/stm32_broad_mini.ewp
  2. 73
    5
      Middlewares/rtthread/board.c
  3. 76
    0
      Middlewares/trice/ReadMe.md
  4. 2099
    0
      Middlewares/trice/SEGGER_RTT.c
  5. 520
    0
      Middlewares/trice/SEGGER_RTT.h
  6. 24
    0
      Middlewares/trice/cobs.h
  7. 32
    0
      Middlewares/trice/cobsDecode.c
  8. 31
    0
      Middlewares/trice/cobsEncode.c
  9. 3
    0
      Middlewares/trice/example/ReadMe.md
  10. 53
    0
      Middlewares/trice/example/triceConfig.h
  11. 93
    0
      Middlewares/trice/example/triceExamples.c
  12. 104
    0
      Middlewares/trice/example/triceLogDiagData.c
  13. 85
    0
      Middlewares/trice/example/triceUart.h
  14. 42
    0
      Middlewares/trice/tcobs.h
  15. 117
    0
      Middlewares/trice/tcobsv1Decode.c
  16. 400
    0
      Middlewares/trice/tcobsv1Encode.c
  17. 28
    0
      Middlewares/trice/tcobsv1Internal.h
  18. 1127
    0
      Middlewares/trice/trice.c
  19. 787
    0
      Middlewares/trice/trice.h
  20. 560
    0
      Middlewares/trice/trice16.c
  21. 265
    0
      Middlewares/trice/trice16.h
  22. 286
    0
      Middlewares/trice/trice16McuOrder.h
  23. 298
    0
      Middlewares/trice/trice16McuReverse.h
  24. 560
    0
      Middlewares/trice/trice32.c
  25. 299
    0
      Middlewares/trice/trice32.h
  26. 286
    0
      Middlewares/trice/trice32McuOrder.h
  27. 286
    0
      Middlewares/trice/trice32McuReverse.h
  28. 561
    0
      Middlewares/trice/trice64.c
  29. 299
    0
      Middlewares/trice/trice64.h
  30. 286
    0
      Middlewares/trice/trice64McuOrder.h
  31. 286
    0
      Middlewares/trice/trice64McuReverse.h
  32. 560
    0
      Middlewares/trice/trice8.c
  33. 246
    0
      Middlewares/trice/trice8.h
  34. 286
    0
      Middlewares/trice/trice8McuOrder.h
  35. 286
    0
      Middlewares/trice/trice8McuReverse.h
  36. 90
    0
      Middlewares/trice/triceAuxiliary.c
  37. 484
    0
      Middlewares/trice/triceDefaultConfig.h
  38. 350
    0
      Middlewares/trice/triceDoubleBuffer.c
  39. 45
    0
      Middlewares/trice/triceMcuOrder.h
  40. 88
    0
      Middlewares/trice/triceMcuReverse.h
  41. 444
    0
      Middlewares/trice/triceOff.h
  42. 434
    0
      Middlewares/trice/triceOn.h
  43. 503
    0
      Middlewares/trice/triceRingBuffer.c
  44. 12
    0
      Middlewares/trice/triceStackBuffer.c
  45. 16
    0
      Middlewares/trice/triceStaticBuffer.c
  46. 148
    0
      Middlewares/trice/triceUart.c
  47. 89
    0
      Middlewares/trice/xtea.c
  48. 33
    0
      Middlewares/trice/xtea.h

+ 77
- 0
EWARM/stm32_broad_mini.ewp Переглянути файл

@@ -353,6 +353,8 @@
353 353
                     <state>$PROJ_DIR$/../Middlewares/rtthread/include</state>
354 354
                     <state>$PROJ_DIR$/../Middlewares/rtthread/include/libc</state>
355 355
                     <state>$PROJ_DIR$/../Middlewares/rtthread/finsh</state>
356
+                    <state>$PROJ_DIR$\..\Middlewares\trice\example</state>
357
+                    <state>$PROJ_DIR$\..\Middlewares\trice</state>
356 358
                 </option>
357 359
                 <option>
358 360
                     <name>CCStdIncCheck</name>
@@ -1091,6 +1093,9 @@
1091 1093
             </file>
1092 1094
             <file>
1093 1095
                 <name>$PROJ_DIR$\..\Middlewares\coredump\testbug.c</name>
1096
+                <excluded>
1097
+                    <configuration>stm32_broad_mini</configuration>
1098
+                </excluded>
1094 1099
             </file>
1095 1100
         </group>
1096 1101
         <group>
@@ -1224,6 +1229,9 @@
1224 1229
         </group>
1225 1230
         <group>
1226 1231
             <name>RTT</name>
1232
+            <excluded>
1233
+                <configuration>stm32_broad_mini</configuration>
1234
+            </excluded>
1227 1235
             <file>
1228 1236
                 <name>$PROJ_DIR$\..\Middlewares\segger_rtt\SEGGER_RTT.c</name>
1229 1237
             </file>
@@ -1297,5 +1305,74 @@
1297 1305
                 <name>$PROJ_DIR$\..\Middlewares\rtthread\src\timer.c</name>
1298 1306
             </file>
1299 1307
         </group>
1308
+        <group>
1309
+            <name>trice</name>
1310
+            <group>
1311
+                <name>example</name>
1312
+                <file>
1313
+                    <name>$PROJ_DIR$\..\Middlewares\trice\example\triceConfig.h</name>
1314
+                </file>
1315
+                <file>
1316
+                    <name>$PROJ_DIR$\..\Middlewares\trice\example\triceExamples.c</name>
1317
+                </file>
1318
+                <file>
1319
+                    <name>$PROJ_DIR$\..\Middlewares\trice\example\triceLogDiagData.c</name>
1320
+                </file>
1321
+                <file>
1322
+                    <name>$PROJ_DIR$\..\Middlewares\trice\example\triceUart.h</name>
1323
+                </file>
1324
+            </group>
1325
+            <file>
1326
+                <name>$PROJ_DIR$\..\Middlewares\trice\cobsDecode.c</name>
1327
+            </file>
1328
+            <file>
1329
+                <name>$PROJ_DIR$\..\Middlewares\trice\cobsEncode.c</name>
1330
+            </file>
1331
+            <file>
1332
+                <name>$PROJ_DIR$\..\Middlewares\trice\SEGGER_RTT.c</name>
1333
+            </file>
1334
+            <file>
1335
+                <name>$PROJ_DIR$\..\Middlewares\trice\tcobsv1Decode.c</name>
1336
+            </file>
1337
+            <file>
1338
+                <name>$PROJ_DIR$\..\Middlewares\trice\tcobsv1Encode.c</name>
1339
+            </file>
1340
+            <file>
1341
+                <name>$PROJ_DIR$\..\Middlewares\trice\trice.c</name>
1342
+            </file>
1343
+            <file>
1344
+                <name>$PROJ_DIR$\..\Middlewares\trice\trice16.c</name>
1345
+            </file>
1346
+            <file>
1347
+                <name>$PROJ_DIR$\..\Middlewares\trice\trice32.c</name>
1348
+            </file>
1349
+            <file>
1350
+                <name>$PROJ_DIR$\..\Middlewares\trice\trice64.c</name>
1351
+            </file>
1352
+            <file>
1353
+                <name>$PROJ_DIR$\..\Middlewares\trice\trice8.c</name>
1354
+            </file>
1355
+            <file>
1356
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceAuxiliary.c</name>
1357
+            </file>
1358
+            <file>
1359
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceDoubleBuffer.c</name>
1360
+            </file>
1361
+            <file>
1362
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceRingBuffer.c</name>
1363
+            </file>
1364
+            <file>
1365
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceStackBuffer.c</name>
1366
+            </file>
1367
+            <file>
1368
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceStaticBuffer.c</name>
1369
+            </file>
1370
+            <file>
1371
+                <name>$PROJ_DIR$\..\Middlewares\trice\triceUart.c</name>
1372
+            </file>
1373
+            <file>
1374
+                <name>$PROJ_DIR$\..\Middlewares\trice\xtea.c</name>
1375
+            </file>
1376
+        </group>
1300 1377
     </group>
1301 1378
 </project>

+ 73
- 5
Middlewares/rtthread/board.c Переглянути файл

@@ -93,18 +93,86 @@ void SysInit(void)
93 93
     MX_USART1_UART_Init();
94 94
 }
95 95
 
96
+#if !TRICE_OFF
97
+// ms32 is a 32-bit millisecond counter, counting circular in steps of 1 every ms.
98
+uint32_t ms32 = 0;
99
+#endif
100
+
96 101
 int main(void)
97 102
 {
98
-    int i = 1;
99
-    int q = 58;
100
-    int d = i + q;
101
-    //rt_kprintf("%s\n", __func__);
102
-    test_softbreakpoint();
103
+#if !TRICE_OFF
104
+  TriceInit(); // This so early, to allow trice logs inside interrupts from the beginning. Only needed for RTT.
105
+  TriceHeadLine("  ????????????-F030R8    ");
106
+#endif
107
+    //int i = 1;
108
+    //int q = 58;
109
+    //int d = i + q;
110
+    rt_kprintf("%s\n", __func__);
111
+    //test_softbreakpoint();
112
+    
113
+#if !TRICE_OFF
114
+  SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; // enable SysTick interrupt
115
+  LogTriceConfiguration();
116
+  SomeExampleTrices(3);
117
+#endif
118
+  /* USER CODE END 2 */
119
+
120
+  /* Infinite loop */
121
+  /* USER CODE BEGIN WHILE */
122
+  while (1)
123
+  {
124
+#if !TRICE_OFF
125
+        static uint32_t lastMs = 0;
126
+        if( lastMs != ms32 ){ // each ms
127
+            lastMs = ms32;
128
+
129
+#if TRICE_DIAGNOSTICS == 1
130
+            static uint32_t msDiag = 0;
131
+            msDiag++;
132
+            if(msDiag >= 3000 ){
133
+                msDiag = 0;
134
+                TriceLogDiagnosticData();
135
+            }
136
+#endif
137
+            static uint32_t msCheck = 0;
138
+            msCheck++;
139
+            if(msCheck >= 1000 ){
140
+                msCheck = 0; 
141
+                SomeExampleTrices(5);
142
+            }
143
+
144
+            #if (TRICE_BUFFER == TRICE_RING_BUFFER) || (TRICE_BUFFER == TRICE_DOUBLE_BUFFER)
145
+
146
+                static uint32_t msTransfer = 0;
147
+                msTransfer++;
148
+                if(msTransfer >= 100 ){
149
+                    msTransfer = 0;
150
+                    // Serve deferred trice transfer every few ms or if TRICE_BUFFER is getting filled. With an RTOS put this in a separate task.
151
+                    // In TRICE_RING_BUFFER && TRICE_SINGLE_PACK_MODE TriceTransfer can transmit only 1 Trice per call, so call it every 1ms then.
152
+                    // In TRICE_DOUBLE_BUFFER TriceTransfer transmits one half buffer.
153
+                    TriceTransfer(); // serve deferred output
154
+                }
155
+                #if TRICE_RING_BUFFER_OVERFLOW_WATCH == 1
156
+                    WatchRingBufferMargins();
157
+                #endif
158
+
159
+            #endif // #if ( TRICE_BUFFER == TRICE_RING_BUFFER) || ( TRICE_BUFFER == TRICE_DOUBLE_BUFFER)
160
+        }
161
+        
162
+
163
+    /* USER CODE END WHILE */
164
+
165
+    /* USER CODE BEGIN 3 */
166
+#endif // #if !TRICE_OFF
167
+  }
103 168
     return 0;
104 169
 }
105 170
 
106 171
 void SysTick_Handler(void)
107 172
 {
173
+#if !TRICE_OFF
174
+    ms32++;
175
+#endif
108 176
     /* enter interrupt */
109 177
     rt_interrupt_enter();
110 178
 

+ 76
- 0
Middlewares/trice/ReadMe.md Переглянути файл

@@ -0,0 +1,76 @@
1
+# Target Setup
2
+
3
+* See ./doc/TriceUserGuide.md -> [Embedded system code setup](https://github.com/rokath/trice/blob/master/docs/TriceUserGuide.md#24-port-it)
4
+
5
+## Issue Tracking
6
+
7
+### L432 FreeRTOS, `TRICE_RING_BUFFER` with RTT but without reading RTT @115200
8
+
9
+```bash
10
+Jul  9 10:24:58.607462  com3:          triceCheck.c   167
11
+COBS: 08 98 cb 32 32 32 32 3b 01 00 
12
+COBS:          32 32 32 32 5b 01 00 
13
+inconsistent COBS buffer!
14
+
15
+Jul  9 10:24:57.006345  com3:          triceCheck.c  1534  842,150_450 1b43 triceSingleDepthMax = 168 of 168 (TRICE_BUFFER_SIZE)
16
+COBS: 07 41 5a 31 04 98 07 01 01 00 
17
+COBS:       5a 6c 04 d3 31 01 01 00 
18
+inconsistent COBS buffer!
19
+
20
+Jul  9 11:00:54.395380  com3:          triceCheck.c   280  842,150_450 1afd TRICE32_2 line 280,2
21
+COBS: 0b 59 cd 32 32 32 32 3c 10 19 01 01 01 01 01 01 02 02 01 01 01 01 01 01 01 00 
22
+COBS:    59 cd 32 32 32 32 f7 10 19 01 01 01 01 01 01 02 02 01 01 01 01 01 01 01 00 
23
+inconsistent COBS buffer!
24
+
25
+Jul  9 11:02:03.653064  com3:          triceCheck.c  1515              0f89 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJK
26
+COBS: 35 89 4f 09 30 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46 47 48 49 4a 4b 4c 00 
27
+COBS:       4f c4 30 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46 47 48 49 4a 4b 4c 00 
28
+inconsistent COBS buffer!
29
+
30
+Jul  9 11:03:33.892756  com3:          triceCheck.c   182  842,150_450 04ce TRICE64 int -518, double -518.054749 (%f), c080307020601050, 1100000010000000001100000111000000100000011000000001000001010000
31
+COBS: 29 8b d6 32 32 32 32 65 20 b0 ef 9f df 8f cf 7f bf 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 00 
32
+COBS: 29 8b d6 32 32 32 32 1f 20 b0 ef 9f df 8f cf 7f bf 50 10 60                            70 30 80 c0 50 10 60 20 70 30 80 c0 00 
33
+inconsistent COBS buffer!
34
+
35
+Jul  9 11:21:09.519959  com3:          triceCheck.c   298  842,150_450 1c8d Runtime generated strings
36
+COBS: 0a 15 c8 32 32 32 32 6f 04 0c 01 01 01 00 
37
+COBS:                         04       01 01 00 
38
+inconsistent COBS buffer!
39
+
40
+Jul  9 11:22:30.968562  com3:          triceCheck.c   266  842,150_450 1e71 TRICE STOP time message
41
+COBS: 08 83 c7 32 32 32 32 88 01 00 
42
+COBS:       c7 32 32 32 32 43 01 00 
43
+inconsistent COBS buffer!
44
+
45
+Jul  9 11:23:43.414792  com3:          triceCheck.c   137  842,150_450 1620 12 16-bit values -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12 and a 32-bit stamp.
46
+COBS: 1f b8 8a 16 16 b6 18 ff ff fe ff fd ff fc ff fb ff fa ff f9 ff f8 ff f7 ff f6 ff f5 ff f4 ff 00 
47
+COBS:             16 71 18 ff ff fe ff fd ff fc ff fb ff fa ff f9 ff f8 ff f7 ff f6 ff f5 ff f4 ff 00 
48
+inconsistent COBS buffer!
49
+```
50
+
51
+### L432 FreeRTOS, `TRICE_RING_BUFFER` without RTT @115200
52
+
53
+```bash
54
+Jul  9 11:57:15.313061  com3:          triceCheck.c   167              1544 value=88
55
+COBS: 08 98 cb 32 32 32 32 98 01 00
56
+COBS:                32 32 2e 01 00 
57
+inconsistent COBS buffer!
58
+
59
+Jul  9 12:00:44.139512  com3:          triceCheck.c   277  842,150_450 0f9e TRICE64 1, 2
60
+COBS: 0b db d1 32 32 32 32 b5 04 16 01 01 01 00
61
+COBS:          32 32 32 32 6b 04 16 01 01 01 00 
62
+inconsistent COBS buffer!
63
+
64
+
65
+Jul  9 12:05:16.403643  com3:          triceCheck.c   181  842,150_450 1670 TRICE64 int -518, double -518.054749 (%f), c080307020601050, 1100000010000000001100000111000000100000011000000001000001010000
66
+COBS: 29 ce c4 32 32 32 32 a2 20 fa fd ff ff ff ff ff ff 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 00 
67
+COBS:                      5b 20 fa fd ff ff ff ff ff ff 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 50 10 60 20 70 30 80 c0 00 
68
+inconsistent COBS buffer!
69
+
70
+
71
+Jul  9 12:06:41.752570  com3:          triceCheck.c   188  842,150_450 0574 With TRICE_S:abcde 12345
72
+COBS: 14 7a d4 32 32 32 32 c9 0b 61 62 63 64 65 20 31 32 33 34 35 00
73
+COBS: 14 7a d4 32 32 32 32 7f 0b 61 62 63 64 65 20 31       
74
+inconsistent COBS buffer!
75
+```
76
+

+ 2099
- 0
Middlewares/trice/SEGGER_RTT.c
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 520
- 0
Middlewares/trice/SEGGER_RTT.h Переглянути файл

@@ -0,0 +1,520 @@
1
+/*********************************************************************
2
+*                    SEGGER Microcontroller GmbH                     *
3
+*                        The Embedded Experts                        *
4
+**********************************************************************
5
+*                                                                    *
6
+*            (c) 1995 - 2021 SEGGER Microcontroller GmbH             *
7
+*                                                                    *
8
+*       www.segger.com     Support: support@segger.com               *
9
+*                                                                    *
10
+**********************************************************************
11
+*                                                                    *
12
+*       SEGGER RTT * Real Time Transfer for embedded targets         *
13
+*                                                                    *
14
+**********************************************************************
15
+*                                                                    *
16
+* All rights reserved.                                               *
17
+*                                                                    *
18
+* SEGGER strongly recommends to not make any changes                 *
19
+* to or modify the source code of this software in order to stay     *
20
+* compatible with the RTT protocol and J-Link.                       *
21
+*                                                                    *
22
+* Redistribution and use in source and binary forms, with or         *
23
+* without modification, are permitted provided that the following    *
24
+* condition is met:                                                  *
25
+*                                                                    *
26
+* o Redistributions of source code must retain the above copyright   *
27
+*   notice, this condition and the following disclaimer.             *
28
+*                                                                    *
29
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND             *
30
+* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,        *
31
+* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF           *
32
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE           *
33
+* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
34
+* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR           *
35
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  *
36
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;    *
37
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF      *
38
+* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT          *
39
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE  *
40
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH   *
41
+* DAMAGE.                                                            *
42
+*                                                                    *
43
+**********************************************************************
44
+*                                                                    *
45
+*       RTT version: 8.12a                                           *
46
+*                                                                    *
47
+**********************************************************************
48
+
49
+---------------------------END-OF-HEADER------------------------------
50
+File    : SEGGER_RTT.h
51
+Purpose : Implementation of SEGGER real-time transfer which allows
52
+          real-time communication on targets which support debugger
53
+          memory accesses while the CPU is running.
54
+Revision: $Rev: 25842 $
55
+----------------------------------------------------------------------
56
+*/
57
+
58
+#ifndef SEGGER_RTT_H
59
+#define SEGGER_RTT_H
60
+
61
+#include "SEGGER_RTT_Conf.h"
62
+
63
+/*********************************************************************
64
+*
65
+*       Defines, defaults
66
+*
67
+**********************************************************************
68
+*/
69
+
70
+#ifndef RTT_USE_ASM
71
+  //
72
+  // Some cores support out-of-order memory accesses (reordering of memory accesses in the core)
73
+  // For such cores, we need to define a memory barrier to guarantee the order of certain accesses to the RTT ring buffers.
74
+  // Needed for:
75
+  //   Cortex-M7 (ARMv7-M)
76
+  //   Cortex-M23 (ARM-v8M)
77
+  //   Cortex-M33 (ARM-v8M)
78
+  //   Cortex-A/R (ARM-v7A/R)
79
+  //
80
+  // We do not explicitly check for "Embedded Studio" as the compiler in use determines what we support.
81
+  // You can use an external toolchain like IAR inside ES. So there is no point in checking for "Embedded Studio"
82
+  //
83
+  #if (defined __CROSSWORKS_ARM)                  // Rowley Crossworks
84
+    #define _CC_HAS_RTT_ASM_SUPPORT 1
85
+    #if (defined __ARM_ARCH_7M__)                 // Cortex-M3
86
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
87
+    #elif (defined __ARM_ARCH_7EM__)              // Cortex-M4/M7
88
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
89
+      #define _CORE_NEEDS_DMB           1
90
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
91
+    #elif (defined __ARM_ARCH_8M_BASE__)          // Cortex-M23
92
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
93
+      #define _CORE_NEEDS_DMB           1
94
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
95
+    #elif (defined __ARM_ARCH_8M_MAIN__)          // Cortex-M33
96
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
97
+      #define _CORE_NEEDS_DMB           1
98
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
99
+    #elif (defined(__ARM_ARCH_8_1M_MAIN__))       // Cortex-M85
100
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
101
+      #define _CORE_NEEDS_DMB           1
102
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
103
+    #else
104
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
105
+    #endif
106
+  #elif (defined __ARMCC_VERSION)
107
+    //
108
+    // ARM compiler
109
+    // ARM compiler V6.0 and later is clang based.
110
+    // Our ASM part is compatible to clang.
111
+    //
112
+    #if (__ARMCC_VERSION >= 6000000)
113
+      #define _CC_HAS_RTT_ASM_SUPPORT 1
114
+    #else
115
+      #define _CC_HAS_RTT_ASM_SUPPORT 0
116
+    #endif
117
+    #if (defined __ARM_ARCH_6M__)                 // Cortex-M0 / M1
118
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0         // No ASM support for this architecture
119
+    #elif (defined __ARM_ARCH_7M__)               // Cortex-M3
120
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
121
+    #elif (defined __ARM_ARCH_7EM__)              // Cortex-M4/M7
122
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
123
+      #define _CORE_NEEDS_DMB           1
124
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
125
+    #elif (defined __ARM_ARCH_8M_BASE__)          // Cortex-M23
126
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
127
+      #define _CORE_NEEDS_DMB           1
128
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
129
+    #elif (defined __ARM_ARCH_8M_MAIN__)          // Cortex-M33
130
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
131
+      #define _CORE_NEEDS_DMB           1
132
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
133
+    #elif (defined __ARM_ARCH_8_1M_MAIN__)        // Cortex-M85
134
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
135
+      #define _CORE_NEEDS_DMB           1
136
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
137
+    #elif \
138
+    ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) || \   // Cortex-A/R ARMv7-A/R & ARMv8-A/R
139
+    ((defined __ARM_ARCH_8A__) || (defined __ARM_ARCH_8R__))
140
+      //
141
+      // Cortex-A/R ARMv7-A/R & ARMv8-A/R
142
+      //
143
+      #define _CORE_NEEDS_DMB           1
144
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
145
+    #else
146
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
147
+    #endif
148
+  #elif ((defined __GNUC__) || (defined __clang__))
149
+    //
150
+    // GCC / Clang
151
+    //
152
+    #define _CC_HAS_RTT_ASM_SUPPORT 1
153
+    // ARM 7/9: __ARM_ARCH_5__ / __ARM_ARCH_5E__ / __ARM_ARCH_5T__ / __ARM_ARCH_5T__ / __ARM_ARCH_5TE__
154
+    #if (defined __ARM_ARCH_7M__)                 // Cortex-M3
155
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
156
+    #elif (defined __ARM_ARCH_7EM__)              // Cortex-M4/M7
157
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
158
+      #define _CORE_NEEDS_DMB           1         // Only Cortex-M7 needs a DMB but we cannot distinguish M4 and M7 here...
159
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
160
+    #elif (defined __ARM_ARCH_8M_BASE__)          // Cortex-M23
161
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
162
+      #define _CORE_NEEDS_DMB           1
163
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
164
+    #elif (defined __ARM_ARCH_8M_MAIN__)          // Cortex-M33
165
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
166
+      #define _CORE_NEEDS_DMB           1
167
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
168
+    #elif (defined __ARM_ARCH_8_1M_MAIN__)        // Cortex-M85
169
+      #define _CORE_HAS_RTT_ASM_SUPPORT 1
170
+      #define _CORE_NEEDS_DMB           1
171
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
172
+    #elif \
173
+    (defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__) || \
174
+    (defined __ARM_ARCH_8A__) || (defined __ARM_ARCH_8R__)
175
+      //
176
+      // Cortex-A/R ARMv7-A/R & ARMv8-A/R
177
+      //
178
+      #define _CORE_NEEDS_DMB           1
179
+      #define RTT__DMB() __asm volatile ("dmb\n" : : :);
180
+    #else
181
+      #define _CORE_HAS_RTT_ASM_SUPPORT 0
182
+    #endif
183
+  #elif ((defined __IASMARM__) || (defined __ICCARM__))
184
+    //
185
+    // IAR assembler/compiler
186
+    //
187
+    #define _CC_HAS_RTT_ASM_SUPPORT 1
188
+    #if (__VER__ < 6300000)
189
+      #define VOLATILE
190
+    #else
191
+      #define VOLATILE volatile
192
+    #endif
193
+    #if (defined __ARM7M__)                            // Needed for old versions that do not know the define yet
194
+      #if (__CORE__ == __ARM7M__)                      // Cortex-M3
195
+        #define _CORE_HAS_RTT_ASM_SUPPORT 1
196
+      #endif
197
+    #endif
198
+    #if (defined __ARM7EM__)
199
+      #if (__CORE__ == __ARM7EM__)                     // Cortex-M4/M7
200
+        #define _CORE_HAS_RTT_ASM_SUPPORT 1
201
+        #define _CORE_NEEDS_DMB 1
202
+        #define RTT__DMB() asm VOLATILE ("DMB");
203
+      #endif
204
+    #endif
205
+    #if (defined __ARM8M_BASELINE__)
206
+      #if (__CORE__ == __ARM8M_BASELINE__)             // Cortex-M23
207
+        #define _CORE_HAS_RTT_ASM_SUPPORT 0
208
+        #define _CORE_NEEDS_DMB 1
209
+        #define RTT__DMB() asm VOLATILE ("DMB");
210
+      #endif
211
+    #endif
212
+    #if (defined __ARM8M_MAINLINE__)
213
+      #if (__CORE__ == __ARM8M_MAINLINE__)             // Cortex-M33
214
+        #define _CORE_HAS_RTT_ASM_SUPPORT 1
215
+        #define _CORE_NEEDS_DMB 1
216
+        #define RTT__DMB() asm VOLATILE ("DMB");
217
+      #endif
218
+    #endif
219
+    #if (defined __ARM8EM_MAINLINE__)
220
+      #if (__CORE__ == __ARM8EM_MAINLINE__)            // Cortex-???
221
+        #define _CORE_HAS_RTT_ASM_SUPPORT 1
222
+        #define _CORE_NEEDS_DMB 1
223
+        #define RTT__DMB() asm VOLATILE ("DMB");
224
+      #endif
225
+    #endif
226
+    #if\
227
+    ((defined __ARM7A__) && (__CORE__ == __ARM7A__)) || \
228
+    ((defined __ARM7R__) && (__CORE__ == __ARM7R__)) || \
229
+    ((defined __ARM8A__) && (__CORE__ == __ARM8A__)) || \
230
+    ((defined __ARM8R__) && (__CORE__ == __ARM8R__))
231
+      //
232
+      // Cortex-A/R ARMv7-A/R & ARMv8-A/R
233
+      //
234
+       #define _CORE_NEEDS_DMB 1
235
+      #define RTT__DMB() asm VOLATILE ("DMB");
236
+    #endif
237
+  #else
238
+    //
239
+    // Other compilers
240
+    //
241
+    #define _CC_HAS_RTT_ASM_SUPPORT   0
242
+    #define _CORE_HAS_RTT_ASM_SUPPORT 0
243
+  #endif
244
+  //
245
+  // If IDE and core support the ASM version, enable ASM version by default
246
+  //
247
+  #ifndef _CORE_HAS_RTT_ASM_SUPPORT
248
+    #define _CORE_HAS_RTT_ASM_SUPPORT 0              // Default for unknown cores
249
+  #endif
250
+  #if (_CC_HAS_RTT_ASM_SUPPORT && _CORE_HAS_RTT_ASM_SUPPORT)
251
+    #define RTT_USE_ASM                           (1)
252
+  #else
253
+    #define RTT_USE_ASM                           (0)
254
+  #endif
255
+#endif
256
+
257
+#ifndef _CORE_NEEDS_DMB
258
+  #define _CORE_NEEDS_DMB 0
259
+#endif
260
+
261
+#ifndef RTT__DMB
262
+  #if _CORE_NEEDS_DMB
263
+    #error "Don't know how to place inline assembly for DMB"
264
+  #else
265
+    #define RTT__DMB()
266
+  #endif
267
+#endif
268
+
269
+#ifndef SEGGER_RTT_CPU_CACHE_LINE_SIZE
270
+  #define SEGGER_RTT_CPU_CACHE_LINE_SIZE (0)   // On most target systems where RTT is used, we do not have a CPU cache, therefore 0 is a good default here
271
+#endif
272
+
273
+#ifndef SEGGER_RTT_UNCACHED_OFF
274
+  #if SEGGER_RTT_CPU_CACHE_LINE_SIZE
275
+    #error "SEGGER_RTT_UNCACHED_OFF must be defined when setting SEGGER_RTT_CPU_CACHE_LINE_SIZE != 0"
276
+  #else
277
+    #define SEGGER_RTT_UNCACHED_OFF (0)
278
+  #endif
279
+#endif
280
+#if RTT_USE_ASM
281
+  #if SEGGER_RTT_CPU_CACHE_LINE_SIZE
282
+    #error "RTT_USE_ASM is not available if SEGGER_RTT_CPU_CACHE_LINE_SIZE != 0"
283
+  #endif
284
+#endif
285
+
286
+#ifndef SEGGER_RTT_ASM  // defined when SEGGER_RTT.h is included from assembly file
287
+#include <stdlib.h>
288
+#include <stdarg.h>
289
+#include <stdint.h>
290
+
291
+/*********************************************************************
292
+*
293
+*       Defines, fixed
294
+*
295
+**********************************************************************
296
+*/
297
+
298
+//
299
+// Determine how much we must pad the control block to make it a multiple of a cache line in size
300
+// Assuming: U8 = 1B
301
+//           U16 = 2B
302
+//           U32 = 4B
303
+//           U8/U16/U32* = 4B
304
+//
305
+#if SEGGER_RTT_CPU_CACHE_LINE_SIZE    // Avoid division by zero in case we do not have any cache
306
+  #define SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(NumBytes) (((NumBytes + SEGGER_RTT_CPU_CACHE_LINE_SIZE - 1) / SEGGER_RTT_CPU_CACHE_LINE_SIZE) * SEGGER_RTT_CPU_CACHE_LINE_SIZE)
307
+#else
308
+  #define SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(NumBytes) (NumBytes)
309
+#endif
310
+#define SEGGER_RTT__CB_SIZE                              (16 + 4 + 4 + (SEGGER_RTT_MAX_NUM_UP_BUFFERS * 24) + (SEGGER_RTT_MAX_NUM_DOWN_BUFFERS * 24))
311
+#define SEGGER_RTT__CB_PADDING                           (SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(SEGGER_RTT__CB_SIZE) - SEGGER_RTT__CB_SIZE)
312
+
313
+/*********************************************************************
314
+*
315
+*       Types
316
+*
317
+**********************************************************************
318
+*/
319
+
320
+//
321
+// Description for a circular buffer (also called "ring buffer")
322
+// which is used as up-buffer (T->H)
323
+//
324
+typedef struct {
325
+  const     char*    sName;         // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
326
+            char*    pBuffer;       // Pointer to start of buffer
327
+            unsigned SizeOfBuffer;  // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
328
+            unsigned WrOff;         // Position of next item to be written by either target.
329
+  volatile  unsigned RdOff;         // Position of next item to be read by host. Must be volatile since it may be modified by host.
330
+            unsigned Flags;         // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
331
+} SEGGER_RTT_BUFFER_UP;
332
+
333
+//
334
+// Description for a circular buffer (also called "ring buffer")
335
+// which is used as down-buffer (H->T)
336
+//
337
+typedef struct {
338
+  const     char*    sName;         // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
339
+            char*    pBuffer;       // Pointer to start of buffer
340
+            unsigned SizeOfBuffer;  // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
341
+  volatile  unsigned WrOff;         // Position of next item to be written by host. Must be volatile since it may be modified by host.
342
+            unsigned RdOff;         // Position of next item to be read by target (down-buffer).
343
+            unsigned Flags;         // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
344
+} SEGGER_RTT_BUFFER_DOWN;
345
+
346
+//
347
+// RTT control block which describes the number of buffers available
348
+// as well as the configuration for each buffer
349
+//
350
+//
351
+typedef struct {
352
+  char                    acID[16];                                 // Initialized to "SEGGER RTT"
353
+  int                     MaxNumUpBuffers;                          // Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2)
354
+  int                     MaxNumDownBuffers;                        // Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2)
355
+  SEGGER_RTT_BUFFER_UP    aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS];       // Up buffers, transferring information up from target via debug probe to host
356
+  SEGGER_RTT_BUFFER_DOWN  aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS];   // Down buffers, transferring information down from host via debug probe to target
357
+#if SEGGER_RTT__CB_PADDING
358
+  unsigned char           aDummy[SEGGER_RTT__CB_PADDING];
359
+#endif
360
+} SEGGER_RTT_CB;
361
+
362
+/*********************************************************************
363
+*
364
+*       Global data
365
+*
366
+**********************************************************************
367
+*/
368
+extern SEGGER_RTT_CB _SEGGER_RTT;
369
+
370
+/*********************************************************************
371
+*
372
+*       RTT API functions
373
+*
374
+**********************************************************************
375
+*/
376
+#ifdef __cplusplus
377
+  extern "C" {
378
+#endif
379
+int          SEGGER_RTT_AllocDownBuffer         (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
380
+int          SEGGER_RTT_AllocUpBuffer           (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
381
+int          SEGGER_RTT_ConfigUpBuffer          (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
382
+int          SEGGER_RTT_ConfigDownBuffer        (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
383
+int          SEGGER_RTT_GetKey                  (void);
384
+unsigned     SEGGER_RTT_HasData                 (unsigned BufferIndex);
385
+int          SEGGER_RTT_HasKey                  (void);
386
+unsigned     SEGGER_RTT_HasDataUp               (unsigned BufferIndex);
387
+void         SEGGER_RTT_Init                    (void);
388
+unsigned     SEGGER_RTT_Read                    (unsigned BufferIndex,       void* pBuffer, unsigned BufferSize);
389
+unsigned     SEGGER_RTT_ReadNoLock              (unsigned BufferIndex,       void* pData,   unsigned BufferSize);
390
+int          SEGGER_RTT_SetNameDownBuffer       (unsigned BufferIndex, const char* sName);
391
+int          SEGGER_RTT_SetNameUpBuffer         (unsigned BufferIndex, const char* sName);
392
+int          SEGGER_RTT_SetFlagsDownBuffer      (unsigned BufferIndex, unsigned Flags);
393
+int          SEGGER_RTT_SetFlagsUpBuffer        (unsigned BufferIndex, unsigned Flags);
394
+int          SEGGER_RTT_WaitKey                 (void);
395
+unsigned     SEGGER_RTT_Write                   (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
396
+unsigned     SEGGER_RTT_WriteNoLock             (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
397
+unsigned     SEGGER_RTT_WriteSkipNoLock         (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
398
+unsigned     SEGGER_RTT_ASM_WriteSkipNoLock     (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
399
+unsigned     SEGGER_RTT_WriteString             (unsigned BufferIndex, const char* s);
400
+void         SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
401
+unsigned     SEGGER_RTT_PutChar                 (unsigned BufferIndex, char c);
402
+unsigned     SEGGER_RTT_PutCharSkip             (unsigned BufferIndex, char c);
403
+unsigned     SEGGER_RTT_PutCharSkipNoLock       (unsigned BufferIndex, char c);
404
+unsigned     SEGGER_RTT_GetAvailWriteSpace      (unsigned BufferIndex);
405
+unsigned     SEGGER_RTT_GetBytesInBuffer        (unsigned BufferIndex);
406
+//
407
+// Function macro for performance optimization
408
+//
409
+#define      SEGGER_RTT_HASDATA(n)       (((SEGGER_RTT_BUFFER_DOWN*)((uintptr_t)&_SEGGER_RTT.aDown[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_DOWN*)((uintptr_t)&_SEGGER_RTT.aDown[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff)
410
+
411
+#if RTT_USE_ASM
412
+  #define SEGGER_RTT_WriteSkipNoLock  SEGGER_RTT_ASM_WriteSkipNoLock
413
+#endif
414
+
415
+/*********************************************************************
416
+*
417
+*       RTT transfer functions to send RTT data via other channels.
418
+*
419
+**********************************************************************
420
+*/
421
+unsigned     SEGGER_RTT_ReadUpBuffer            (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
422
+unsigned     SEGGER_RTT_ReadUpBufferNoLock      (unsigned BufferIndex, void* pData, unsigned BufferSize);
423
+unsigned     SEGGER_RTT_WriteDownBuffer         (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
424
+unsigned     SEGGER_RTT_WriteDownBufferNoLock   (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
425
+
426
+#define      SEGGER_RTT_HASDATA_UP(n)    (((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff)   // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
427
+
428
+/*********************************************************************
429
+*
430
+*       RTT "Terminal" API functions
431
+*
432
+**********************************************************************
433
+*/
434
+int     SEGGER_RTT_SetTerminal        (unsigned char TerminalId);
435
+int     SEGGER_RTT_TerminalOut        (unsigned char TerminalId, const char* s);
436
+
437
+/*********************************************************************
438
+*
439
+*       RTT printf functions (require SEGGER_RTT_printf.c)
440
+*
441
+**********************************************************************
442
+*/
443
+int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
444
+int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList);
445
+
446
+#ifdef __cplusplus
447
+  }
448
+#endif
449
+
450
+#endif // ifndef(SEGGER_RTT_ASM)
451
+
452
+//
453
+// For some environments, NULL may not be defined until certain headers are included
454
+//
455
+#ifndef NULL
456
+  #define NULL  ((void*)0)
457
+#endif
458
+
459
+/*********************************************************************
460
+*
461
+*       Defines
462
+*
463
+**********************************************************************
464
+*/
465
+
466
+//
467
+// Operating modes. Define behavior if buffer is full (not enough space for entire message)
468
+//
469
+#define SEGGER_RTT_MODE_NO_BLOCK_SKIP         (0)     // Skip. Do not block, output nothing. (Default)
470
+#define SEGGER_RTT_MODE_NO_BLOCK_TRIM         (1)     // Trim: Do not block, output as much as fits.
471
+#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL    (2)     // Block: Wait until there is space in the buffer.
472
+#define SEGGER_RTT_MODE_MASK                  (3)
473
+
474
+//
475
+// Control sequences, based on ANSI.
476
+// Can be used to control color, and clear the screen
477
+//
478
+#define RTT_CTRL_RESET                "\x1B[0m"         // Reset to default colors
479
+#define RTT_CTRL_CLEAR                "\x1B[2J"         // Clear screen, reposition cursor to top left
480
+
481
+#define RTT_CTRL_TEXT_BLACK           "\x1B[2;30m"
482
+#define RTT_CTRL_TEXT_RED             "\x1B[2;31m"
483
+#define RTT_CTRL_TEXT_GREEN           "\x1B[2;32m"
484
+#define RTT_CTRL_TEXT_YELLOW          "\x1B[2;33m"
485
+#define RTT_CTRL_TEXT_BLUE            "\x1B[2;34m"
486
+#define RTT_CTRL_TEXT_MAGENTA         "\x1B[2;35m"
487
+#define RTT_CTRL_TEXT_CYAN            "\x1B[2;36m"
488
+#define RTT_CTRL_TEXT_WHITE           "\x1B[2;37m"
489
+
490
+#define RTT_CTRL_TEXT_BRIGHT_BLACK    "\x1B[1;30m"
491
+#define RTT_CTRL_TEXT_BRIGHT_RED      "\x1B[1;31m"
492
+#define RTT_CTRL_TEXT_BRIGHT_GREEN    "\x1B[1;32m"
493
+#define RTT_CTRL_TEXT_BRIGHT_YELLOW   "\x1B[1;33m"
494
+#define RTT_CTRL_TEXT_BRIGHT_BLUE     "\x1B[1;34m"
495
+#define RTT_CTRL_TEXT_BRIGHT_MAGENTA  "\x1B[1;35m"
496
+#define RTT_CTRL_TEXT_BRIGHT_CYAN     "\x1B[1;36m"
497
+#define RTT_CTRL_TEXT_BRIGHT_WHITE    "\x1B[1;37m"
498
+
499
+#define RTT_CTRL_BG_BLACK             "\x1B[24;40m"
500
+#define RTT_CTRL_BG_RED               "\x1B[24;41m"
501
+#define RTT_CTRL_BG_GREEN             "\x1B[24;42m"
502
+#define RTT_CTRL_BG_YELLOW            "\x1B[24;43m"
503
+#define RTT_CTRL_BG_BLUE              "\x1B[24;44m"
504
+#define RTT_CTRL_BG_MAGENTA           "\x1B[24;45m"
505
+#define RTT_CTRL_BG_CYAN              "\x1B[24;46m"
506
+#define RTT_CTRL_BG_WHITE             "\x1B[24;47m"
507
+
508
+#define RTT_CTRL_BG_BRIGHT_BLACK      "\x1B[4;40m"
509
+#define RTT_CTRL_BG_BRIGHT_RED        "\x1B[4;41m"
510
+#define RTT_CTRL_BG_BRIGHT_GREEN      "\x1B[4;42m"
511
+#define RTT_CTRL_BG_BRIGHT_YELLOW     "\x1B[4;43m"
512
+#define RTT_CTRL_BG_BRIGHT_BLUE       "\x1B[4;44m"
513
+#define RTT_CTRL_BG_BRIGHT_MAGENTA    "\x1B[4;45m"
514
+#define RTT_CTRL_BG_BRIGHT_CYAN       "\x1B[4;46m"
515
+#define RTT_CTRL_BG_BRIGHT_WHITE      "\x1B[4;47m"
516
+
517
+
518
+#endif
519
+
520
+/*************************** End of file ****************************/

+ 24
- 0
Middlewares/trice/cobs.h Переглянути файл

@@ -0,0 +1,24 @@
1
+//! \file cobs.h
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+
4
+#ifndef COBS_H_
5
+#define COBS_H_
6
+
7
+#ifdef __cplusplus
8
+extern "C" {
9
+#endif
10
+
11
+#include <stddef.h> //lint !e537 !e451  Warning 537: Repeated include file,  Warning 451: Header file repeatedly included but does not have a standard
12
+#include <stdint.h> //lint !e537 !e451  Warning 537: Repeated include file,  Warning 451: Header file repeatedly included but does not have a standard
13
+
14
+//! If your compiler uses a pre-C99 C dialect and does not know The "__restrict" keyword, you can define it in the project settings.
15
+size_t COBSEncode(void* __restrict out, const void* __restrict in, size_t length);
16
+
17
+//! If your compiler uses a pre-C99 C dialect and does not know The "__restrict" keyword, you can define it in the project settings.
18
+size_t COBSDecode(void* __restrict out, const void* __restrict in, size_t length);
19
+
20
+#ifdef __cplusplus
21
+}
22
+#endif
23
+
24
+#endif

+ 32
- 0
Middlewares/trice/cobsDecode.c Переглянути файл

@@ -0,0 +1,32 @@
1
+//! \file cobsDecode.c copied from https://github.com/rokath/cobs
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+
4
+#include "cobs.h"
5
+
6
+//! COBSDecode decodes data from in buffer.
7
+//! @param in Pointer to encoded input bytes.
8
+//! @param length Number of bytes to decode.
9
+//! @param out Pointer to decoded output data.
10
+//! @return Number of bytes successfully decoded.
11
+//! @note Stops decoding if delimiter byte is found. Code taken from Wikipedia and slightly modified.
12
+size_t COBSDecode(void* __restrict out, const void* __restrict in, size_t length) {
13
+	uint8_t* data = out;
14
+	const uint8_t* buffer = in;
15
+	const uint8_t* byte = buffer;     // Encoded input byte pointer
16
+	uint8_t* decode = (uint8_t*)data; // Decoded output byte pointer
17
+
18
+	for (uint8_t code = 0xff, block = 0; byte < buffer + length; --block) {
19
+		if (block) { // Decode block byte
20
+			*decode++ = *byte++;
21
+		} else {
22
+			if (code != 0xff) { // Encoded zero, write it
23
+				*decode++ = 0;
24
+			}
25
+			block = code = *byte++; // Next block length
26
+			if (!code) {            // Delimiter code found
27
+				break;
28
+			}
29
+		}
30
+	}
31
+	return (size_t)(decode - data);
32
+}

+ 31
- 0
Middlewares/trice/cobsEncode.c Переглянути файл

@@ -0,0 +1,31 @@
1
+//! \file cobsEncode.c copied from https://github.com/rokath/cobs
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+
4
+#include "cobs.h"
5
+
6
+//! COBSEncode encodes data to output.
7
+//! @param in Pointer to input data to encode.
8
+//! @param length Number of bytes to encode.
9
+//! @param out Pointer to encoded output buffer.
10
+//! @return Encoded buffer length in bytes.
11
+//! @note Does not output delimiter byte. Code taken from Wikipedia and slightly adapted.
12
+size_t COBSEncode(void* __restrict out, const void* __restrict in, size_t length) {
13
+	uint8_t* buffer = out;
14
+	uint8_t* encode = buffer;  // Encoded byte pointer
15
+	uint8_t* codep = encode++; // Output code pointer
16
+	uint8_t code = 1;          // Code value
17
+
18
+	for (const uint8_t* byte = (const uint8_t*)in; length--; ++byte) {
19
+		if (*byte) { // Byte not zero, write it
20
+			*encode++ = *byte, ++code;
21
+		}
22
+		if (!*byte || code == 0xff) { // Input is zero or block completed, restart
23
+			*codep = code, code = 1, codep = encode;
24
+			if (!*byte || length) {
25
+				++encode;
26
+			}
27
+		}
28
+	}
29
+	*codep = code; // Write final code value
30
+	return (size_t)(encode - buffer);
31
+}

+ 3
- 0
Middlewares/trice/example/ReadMe.md Переглянути файл

@@ -0,0 +1,3 @@
1
+# <div id="top">Folder info
2
+
3
+The `*.c` files here are used by some example projects.

+ 53
- 0
Middlewares/trice/example/triceConfig.h Переглянути файл

@@ -0,0 +1,53 @@
1
+/*!
2
+ *  \file triceConfig.h
3
+   \author Thomas.Hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+#ifndef TRICE_CONFIG_H_
8
+#define TRICE_CONFIG_H_
9
+
10
+#ifdef __cplusplus
11
+extern "C"
12
+{
13
+#endif
14
+
15
+//! TRICE_CLEAN, if found inside triceConfig.h, is modified by the Trice tool to silent editor warnings in the cleaned state.
16
+#define TRICE_CLEAN 0 // Do not define this at an other place! But you can delete this here.
17
+
18
+extern uint32_t ms32; //! ms32 is a 32-bit millisecond counter, counting circular in steps of 1 every ms.
19
+#include "stm32f1xx_hal.h"
20
+#define TriceStamp16 (SysTick->VAL) // Counts from 31999 -> 0 in each ms.
21
+#define TriceStamp32 ms32           // 1ms, wraps after 2^32 ms ~= 49,7 days
22
+
23
+#define TRICE_BUFFER TRICE_DOUBLE_BUFFER
24
+#define TRICE_DEFERRED_BUFFER_SIZE 2048
25
+
26
+// Windows: trice log -p jlink -args "-Device STM32F030R8" -pf none -prefix off -hs off -d16 -showID "deb:%5d" -i ../../demoTIL.json -li ../../demoLI.json
27
+// Unix:   ./RTTLogUnix.sh or manually:
28
+//      Terminal 1: rm ./temp/trice.bin && JLinkRTTLogger -Device STM32G0B1RE -If SWD -Speed 4000 -RTTChannel 0 ./temp/trice.bin
29
+//      Terminal 2: touch ./temp/trice.bin && trice log -p FILE -args ./temp/trice.bin -pf none -prefix off -hs off -d16 -ts16 time:tick #%6d -i ../../demoTIL.json -li ../../demoLI.json
30
+#define TRICE_DIRECT_OUTPUT 1
31
+#define TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE 1
32
+
33
+// Windows: trice log -p com4         -ts16 "time:tick #%6d" -i ../../demoTIL.json -li ../../demoLI.json
34
+// Unix:    trice log -p /dev/ttyACM0 -ts16 "time:tick #%6d" -i ../../demoTIL.json -li ../../demoLI.json
35
+#define TRICE_DEFERRED_OUTPUT 1
36
+#define TRICE_DEFERRED_UARTA 1
37
+#define TRICE_UARTA USART1
38
+
39
+#define TRICE_MCU_IS_BIG_ENDIAN 0
40
+
41
+//#include "cmsis_gcc.h"
42
+#define TRICE_ENTER_CRITICAL_SECTION { uint32_t primaskstate = __get_PRIMASK(); __disable_irq(); {
43
+#define TRICE_LEAVE_CRITICAL_SECTION } __set_PRIMASK(primaskstate); }
44
+
45
+void TriceHeadLine(char *name);
46
+void LogTriceConfiguration(void);
47
+void SomeExampleTrices(int burstCount);
48
+
49
+#ifdef __cplusplus
50
+}
51
+#endif
52
+
53
+#endif /* TRICE_CONFIG_H_ */

+ 93
- 0
Middlewares/trice/example/triceExamples.c Переглянути файл

@@ -0,0 +1,93 @@
1
+/*!
2
+ *  \file triceExamples.c
3
+   \author Thomas.Hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+#include "trice.h"
8
+
9
+#if !TRICE_OFF
10
+
11
+//! TriceHeadLine emits a decorated name. The name length should be 18 characters.
12
+void TriceHeadLine(char *name)
13
+{
14
+    //! 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.
15
+    //TriceS("w: Hello! 👋🙂\n\n        ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨        \n        🎈🎈🎈🎈%s🎈🎈🎈🎈\n        🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃🍃        \n\n\n", name);
16
+}
17
+
18
+//! SomeExampleTrices generates a few Trice example logs and a burst of Trices.
19
+void SomeExampleTrices(int burstCount)
20
+{
21
+    // TRICE32_0(ID(0), "att:🐁 Speedy Gonzales A  32-bit time stamp\n");
22
+    // TRICE32_0(ID(0), "att:🐁 Speedy Gonzales B  32-bit time stamp\n");
23
+    // TRICE32_0(ID(0), "att:🐁 Speedy Gonzales C  32-bit time stamp\n");
24
+    // TRICE32_0(ID(0), "att:🐁 Speedy Gonzales D  32-bit time stamp\n");
25
+    // TRICE32_0(Id(0), "att:🐁 Speedy Gonzales E  16-bit time stamp\n");
26
+    // TRICE32_0(Id(0), "att:🐁 Speedy Gonzales F  16-bit time stamp\n");
27
+    // TRICE32_0(Id(0), "att:🐁 Speedy Gonzales G  16-bit time stamp\n");
28
+    // TRICE32_0(Id(0), "att:🐁 Speedy Gonzales H  16-bit time stamp\n");
29
+    // TRICE32_0(id(0), "att:🐁 Speedy Gonzales I without time stamp\n");
30
+    // TRICE32_0(id(0), "att:🐁 Speedy Gonzales J without time stamp\n");
31
+    // TRICE32_0(id(0), "att:🐁 Speedy Gonzales K without time stamp\n");
32
+    // TRICE32_0(id(0), "att:🐁 Speedy Gonzales L without time stamp\n");
33
+  
34
+    TRICE32_0(id(0), "att:🐁 Speedy Gonzales L without time stamp\n");
35
+#if 0
36
+    TRice("att:🐁 Speedy Gonzales a  32-bit time stamp\n");
37
+    TRice("att:🐁 Speedy Gonzales b  32-bit time stamp\n");
38
+    TRice("att:🐁 Speedy Gonzales c  32-bit time stamp\n");
39
+    TRice("att:🐁 Speedy Gonzales d  32-bit time stamp\n");
40
+    Trice("att:🐁 Speedy Gonzales e  16-bit time stamp\n");
41
+    Trice("att:🐁 Speedy Gonzales f  16-bit time stamp\n");
42
+    Trice("att:🐁 Speedy Gonzales g  16-bit time stamp\n");
43
+    Trice("att:🐁 Speedy Gonzales h  16-bit time stamp\n");
44
+    // trice("att:🐁 Speedy Gonzales i without time stamp\n");
45
+    // trice("att:🐁 Speedy Gonzales j without time stamp\n");
46
+    // trice("att:🐁 Speedy Gonzales k without time stamp\n");
47
+    // trice("att:🐁 Speedy Gonzales l without time stamp\n");
48
+    char *aString = "2.71828182845904523536";
49
+    TriceS("rd:%s <- float number as string\n", aString);
50
+    Trice64("msg:%.20f (double with more ciphers than precision)\n", aDouble(2.71828182845904523536));
51
+    Trice("msg:%.20f (float  with more ciphers than precision)\n", aFloat(2.71828182845904523536));
52
+    Trice("msg:%f (default rounded float)\n", aFloat(2.71828182845904523536));
53
+    Trice("info:A Buffer:\n");
54
+    Trice8B("msg:%02x \n", aString, strlen(aString));
55
+    Trice32B("msg:%08x  \n", aString, strlen(aString) >> 2);
56
+    Trice16F("att:ARemoteFunctionName", aString, strlen(aString) >> 1);
57
+    trice("info:%d times a 16 byte long Trice messages, which may not be written all if the buffer is too small:\n", burstCount);
58
+    for (int i = 0; i < burstCount; i++)
59
+    {
60
+        Trice("i=%x %x\n", 0x44444400 + i, 0xaaaaaa00 + i);
61
+    }
62
+#endif
63
+}
64
+
65
+//! LogTriceConfiguration shows a few configuration settings.
66
+void LogTriceConfiguration(void)
67
+{
68
+#ifdef LogConfigInfo
69
+    LogConfigInfo();
70
+#endif
71
+
72
+#if 0
73
+    trice("deb:TRICE_DIRECT_OUTPUT == %d, TRICE_DEFERRED_OUTPUT == %d\n", TRICE_DIRECT_OUTPUT, TRICE_DEFERRED_OUTPUT);
74
+#if TRICE_BUFFER == TRICE_STACK_BUFFER
75
+    trice("deb:TRICE_STACK_BUFFER, ");
76
+#elif TRICE_BUFFER == TRICE_STATIC_BUFFER
77
+    trice("deb:TRICE_STATIC_BUFFER, ");
78
+#elif TRICE_BUFFER == TRICE_DOUBLE_BUFFER
79
+    trice("deb:TRICE_DOUBLE_BUFFER, ");
80
+#elif TRICE_BUFFER == TRICE_RING_BUFFER
81
+    trice("deb:TRICE_RING_BUFFER, ");
82
+#endif
83
+#if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
84
+    trice("deb:TRICE_SINGLE_PACK_MODE\n");
85
+#else
86
+    trice("deb:TRICE_MULTI_PACK_MODE\n");
87
+#endif
88
+    trice("deb:_CYCLE == %d, _PROTECT == %d, _DIAG == %d, XTEA == %d\n", TRICE_CYCLE_COUNTER, TRICE_PROTECT, TRICE_DIAGNOSTICS, TRICE_DEFERRED_XTEA_ENCRYPT);
89
+    trice("d:_SINGLE_MAX_SIZE=%d, _BUFFER_SIZE=%d, _DEFERRED_BUFFER_SIZE=%d\n", TRICE_SINGLE_MAX_SIZE, TRICE_BUFFER_SIZE, TRICE_DEFERRED_BUFFER_SIZE);
90
+#endif
91
+}
92
+
93
+#endif // #if !TRICE_OFF

+ 104
- 0
Middlewares/trice/example/triceLogDiagData.c Переглянути файл

@@ -0,0 +1,104 @@
1
+/*!
2
+ *  \file triceLogDiagData.c
3
+ * \author Thomas.Hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+#include "trice.h"
8
+
9
+#ifdef __cplusplus
10
+extern "C"
11
+{
12
+#endif
13
+
14
+#if !TRICE_OFF && TRICE_DIAGNOSTICS == 1
15
+
16
+//! TriceLogDiagnosticData shows the max used buffer space.
17
+void TriceLogDiagnosticData(void)
18
+{
19
+#ifdef SEGGER_RTT
20
+    int RTT0_wrSpaceMin = BUFFER_SIZE_UP - RTT0_writeDepthMax;
21
+    if ((RTT0_wrSpaceMin < TRICE_BUFFER_SIZE))
22
+    {
23
+        //trice16("WARNING:RTT0_writeDepthMax=%u (BUFFER_SIZE_UP=%u)\n", RTT0_writeDepthMax, BUFFER_SIZE_UP);
24
+    }
25
+    else
26
+    {
27
+        //trice16("diag:RTT0_writeDepthMax=%u (BUFFER_SIZE_UP=%u)\n", RTT0_writeDepthMax, BUFFER_SIZE_UP);
28
+    }
29
+#endif // #ifdef SEGGER_RTT
30
+
31
+    if (TriceErrorCount > 0)
32
+    {
33
+        //trice16("err:TriceErrorCount = %u\n", TriceErrorCount);
34
+    }
35
+
36
+#if TRICE_PROTECT == 1
37
+#if TRICE_DIRECT_OUTPUT == 1
38
+    if (TriceDirectOverflowCount != 0)
39
+    {
40
+        //trice16("err:TriceDirectOverflowCount = %u\n", TriceDirectOverflowCount);
41
+    }
42
+#endif // #if TRICE_DIRECT_OUTPUT == 1
43
+#if TRICE_DEFERRED_OUTPUT == 1
44
+    if (TriceDeferredOverflowCount != 0)
45
+    {
46
+        //trice16("err:TriceDeferredOverflowCount = %u\n", TriceDeferredOverflowCount);
47
+    }
48
+#endif // #if TRICE_DEFERRED_OUTPUT == 1
49
+#endif // #if TRICE_PROTECT == 1
50
+
51
+    unsigned triceSingleDepthMax = TRICE_DATA_OFFSET + (TriceSingleMaxWordCount << 2); // lint !e845 Info 845: The left argument to operator '<<' is certain to be 0
52
+    if (triceSingleDepthMax <= TRICE_BUFFER_SIZE)
53
+    {
54
+        //trice16("diag:triceSingleDepthMax =%4u of %d (TRICE_BUFFER_SIZE)\n", triceSingleDepthMax, TRICE_BUFFER_SIZE);
55
+    }
56
+    else
57
+    {
58
+        //trice16("err:triceSingleDepthMax =%4u of %d (TRICE_BUFFER_SIZE overflow!)\n", triceSingleDepthMax, TRICE_BUFFER_SIZE);
59
+    }
60
+
61
+    if (TriceDataOffsetDepthMax < 0 || TriceDataOffsetDepthMax >= TRICE_DATA_OFFSET)
62
+    {
63
+        //trice16("err:TriceDataOffsetDepthMax = %d of %d (TRICE_DATA_OFFSET)\n", TriceDataOffsetDepthMax, TRICE_DATA_OFFSET);
64
+    }
65
+    else if (TriceDataOffsetDepthMax != 0)
66
+    {
67
+        //trice16("diag:TriceDataOffsetDepthMax = %d of %d (TRICE_DATA_OFFSET)\n", TriceDataOffsetDepthMax, TRICE_DATA_OFFSET);
68
+    }
69
+
70
+    if (TriceDynStringBufTruncateCount != 0)
71
+    {
72
+        //trice16("wrn:TriceDynStringBufTruncateCount = %u\n", TriceDynStringBufTruncateCount);
73
+    }
74
+
75
+#if TRICE_BUFFER == TRICE_STACK_BUFFER
76
+#endif // #if TRICE_BUFFER == TRICE_STACK_BUFFER
77
+
78
+#if TRICE_BUFFER == TRICE_STATIC_BUFFER
79
+#endif // #if TRICE_BUFFER == TRICE_STATIC_BUFFER
80
+
81
+#if TRICE_BUFFER == TRICE_DOUBLE_BUFFER
82
+    if (TriceHalfBufferDepthMax <= TRICE_DEFERRED_BUFFER_SIZE / 2)
83
+    {
84
+        //trice16("diag:TriceHalfBufferDepthMax =%4u of%5d\n", TriceHalfBufferDepthMax, TRICE_DEFERRED_BUFFER_SIZE / 2);
85
+    }
86
+    else
87
+    {
88
+        //trice16("err:TriceHalfBufferDepthMax =%4u of%5d (overflow!)\n", TriceHalfBufferDepthMax, TRICE_DEFERRED_BUFFER_SIZE / 2);
89
+    }
90
+#endif // #if TRICE_BUFFER == TRICE_DOUBLE_BUFFER
91
+
92
+#if TRICE_BUFFER == TRICE_RING_BUFFER
93
+    if (TriceRingBufferDepthMax <= TRICE_DEFERRED_BUFFER_SIZE)
94
+    {
95
+        //trice16("diag:triceRingBufferDepthMax =%4u of%5d\n", TriceRingBufferDepthMax, TRICE_DEFERRED_BUFFER_SIZE);
96
+    }
97
+    else
98
+    {
99
+        //trice16("err:triceRingBufferDepthMax =%4u of%5d (overflow!)\n", TriceRingBufferDepthMax, TRICE_DEFERRED_BUFFER_SIZE);
100
+    }
101
+#endif // #if TRICE_BUFFER == TRICE_RING_BUFFER
102
+}
103
+
104
+#endif // #if !TRICE_OFF && TRICE_DIAGNOSTICS == 1

+ 85
- 0
Middlewares/trice/example/triceUart.h Переглянути файл

@@ -0,0 +1,85 @@
1
+/*! \file triceUart.h
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#ifndef TRICE_UART_H_
6
+#define TRICE_UART_H_
7
+
8
+#ifdef __cplusplus
9
+extern "C" {
10
+#endif
11
+
12
+#include "trice.h"
13
+#include "main.h" // hardware specific definitions
14
+
15
+TRICE_INLINE void ToggleOpticalFeedbackLED( void ){
16
+    //LL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
17
+}
18
+
19
+#if TRICE_DEFERRED_UARTA == 1
20
+
21
+//! Check if a new byte can be written into trice transmit register.
22
+//! \retval 0 == not empty
23
+//! \retval !0 == empty
24
+//! User must provide this function.
25
+TRICE_INLINE uint32_t triceTxDataRegisterEmptyUartA(void) {
26
+    return LL_USART_IsActiveFlag_TXE(TRICE_UARTA);
27
+}
28
+
29
+//! Write value v into trice transmit register.
30
+//! \param v byte to transmit
31
+//! User must provide this function.
32
+TRICE_INLINE void triceTransmitData8UartA(uint8_t v) {
33
+    LL_USART_TransmitData8(TRICE_UARTA, v);
34
+    ToggleOpticalFeedbackLED();
35
+}
36
+
37
+//! Allow interrupt for empty trice data transmit register.
38
+//! User must provide this function.
39
+TRICE_INLINE void triceEnableTxEmptyInterruptUartA(void) {
40
+    //LL_USART_EnableIT_TXE(TRICE_UARTA);
41
+}
42
+
43
+//! Disallow interrupt for empty trice data transmit register.
44
+//! User must provide this function.
45
+TRICE_INLINE void triceDisableTxEmptyInterruptUartA(void) {
46
+    //LL_USART_DisableIT_TXE(TRICE_UARTA);
47
+}
48
+#endif // #if TRICE_DEFERRED_UARTA == 1
49
+
50
+#if TRICE_DEFERRED_UARTB == 1
51
+
52
+//! Check if a new byte can be written into trice transmit register.
53
+//! \retval 0 == not empty
54
+//! \retval !0 == empty
55
+//! User must provide this function.
56
+TRICE_INLINE uint32_t triceTxDataRegisterEmptyUartB(void) {
57
+    return LL_USART_IsActiveFlag_TXE(TRICE_UARTB);
58
+}
59
+
60
+//! Write value v into trice transmit register.
61
+//! \param v byte to transmit
62
+//! User must provide this function.
63
+TRICE_INLINE void triceTransmitData8UartB(uint8_t v) {
64
+    LL_USART_TransmitData8(TRICE_UARTB, v);
65
+    ToggleOpticalFeedbackLED();
66
+}
67
+
68
+//! Allow interrupt for empty trice data transmit register.
69
+//! User must provide this function.
70
+TRICE_INLINE void triceEnableTxEmptyInterruptUartB(void) {
71
+    LL_USART_EnableIT_TXE(TRICE_UARTB);
72
+}
73
+
74
+//! Disallow interrupt for empty trice data transmit register.
75
+//! User must provide this function.
76
+TRICE_INLINE void triceDisableTxEmptyInterruptUartB(void) {
77
+    LL_USART_DisableIT_TXE(TRICE_UARTB);
78
+}
79
+#endif // #if TRICE_DEFERRED_UARTB == 1
80
+
81
+#ifdef __cplusplus
82
+}
83
+#endif
84
+
85
+#endif /* TRICE_UART_H_ */

+ 42
- 0
Middlewares/trice/tcobs.h Переглянути файл

@@ -0,0 +1,42 @@
1
+/*! \file tcobs.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+\details See ./TCOBSv1Specification.md.
4
+*******************************************************************************/
5
+
6
+#ifndef TCOBS_H_
7
+#define TCOBS_H_
8
+
9
+#ifdef __cplusplus
10
+extern "C" {
11
+#endif
12
+
13
+#include <stddef.h>
14
+
15
+//! TCOBSEncode stuffs "length" bytes of data beginning at the location pointed to by "input" and writes the output to the
16
+//! location pointed to by "output". Returns the number of bytes written to "output" or a negative value in error case.
17
+//! A 0-delimiter is NOT added as last byte allowing concatenating TCOBS encoded buffers to one bigger buffer before the
18
+//! 00-byte delimiting. Buffer overlapping is allowed, when input lays inside output with a sufficient offset. The offset
19
+//! should be >= next large whole number of length/31. because in the worst case for each 31 bytes an additional sigil byte
20
+//! is inserted. The provided output buffer size should be >= length + next large whole number of length/31. This is a
21
+//! responsibility of the caller and not checked for efficiency.
22
+//! If your compiler uses a pre-C99 C dialect and does not know The "__restrict" keyword, you can define it in the project settings.
23
+int TCOBSEncode(void* __restrict output, const void* __restrict input, size_t length);
24
+
25
+//! TCOBSDecode decodes data ending at the location pointed to by "input" backwards (starting with the last byte)
26
+//! and writes the output also backwards to the location pointed to by "output" with a maximum size of max.
27
+//! Returns the number of bytes written to "output". Only max bytes are written. If the returned value is
28
+//! > max, this is an error "output buffer too small". In case of an error, a negative value is returned.
29
+//! THIS IS **IMPORTANT**: The decoded data start at output+max-returned, because output is filled from the end.
30
+//! Buffer overlapping is partially possible if output limit is _behind_ input limit with sufficient distance,
31
+//! but data can get much longer.
32
+//! If your compiler uses a pre-C99 C dialect and does not know The "__restrict" keyword, you can define it in the project settings.
33
+int TCOBSDecode(void* __restrict output, size_t max, const void* __restrict input, size_t length);
34
+
35
+#define OUT_BUFFER_TOO_SMALL -1000000 //!< OUT_BUFFER_TOO_SMALL is TCOBSDecode return error code.
36
+#define INPUT_DATA_CORRUPTED -2000000 //!< INPUT_DATA_CORRUPTED is TCOBSDecode return error code.
37
+
38
+#ifdef __cplusplus
39
+}
40
+#endif
41
+
42
+#endif // TCOBS_H_

+ 117
- 0
Middlewares/trice/tcobsv1Decode.c Переглянути файл

@@ -0,0 +1,117 @@
1
+/*! \file tcobsv1Decode.c
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+\details See ./TCOBSv1Specification.md.
4
+*******************************************************************************/
5
+
6
+#include <stdint.h>
7
+#include <stddef.h>
8
+#include <string.h> // memcpy
9
+#include "tcobs.h"
10
+#include "tcobsv1Internal.h"
11
+
12
+static int sigilAndOffset(uint8_t* sigil, uint8_t b);
13
+static uint8_t repeatByte(int offset, uint8_t* in, int len);
14
+
15
+int TCOBSDecode(void* __restrict output, size_t max, const void* __restrict input, size_t length) {
16
+	uint8_t* in = (uint8_t*)input;
17
+	int ilen = (int)length; // remaining input length
18
+	uint8_t* out = (uint8_t*)output;
19
+	int olen = 0; // output length
20
+	while (ilen > 0) {
21
+		uint8_t next = in[ilen - 1]; // get next sigil byte (starting from the end)
22
+		uint8_t sigil;
23
+		uint8_t r;
24
+		int offset = sigilAndOffset(&sigil, next);
25
+		if (offset + 1 > ilen) {
26
+			return INPUT_DATA_CORRUPTED - __LINE__;
27
+		}
28
+		ilen -= 1; // remove sigil byte from buffer
29
+		switch (sigil) {
30
+		case N:
31
+			goto copyBytes;
32
+
33
+		case Z3:
34
+			olen += 1;
35
+			out[max - olen] = 0;
36
+			// fallthrough
37
+		case Z2:
38
+			olen += 1;
39
+			out[max - olen] = 0;
40
+			// fallthrough
41
+		case Z1:
42
+			olen += 1;
43
+			out[max - olen] = 0;
44
+			goto copyBytes;
45
+
46
+		case F4:
47
+			olen += 1;
48
+			out[max - olen] = 0xFF;
49
+			// fallthrough
50
+		case F3:
51
+			olen += 1;
52
+			out[max - olen] = 0xFF;
53
+			// fallthrough
54
+		case F2:
55
+			olen += 1;
56
+			out[max - olen] = 0xFF;
57
+			olen += 1;
58
+			out[max - olen] = 0xFF;
59
+			goto copyBytes;
60
+
61
+		case R4:
62
+			olen += 1;
63
+			out[max - olen] = repeatByte(offset, in, ilen);
64
+			// fallthrough
65
+		case R3:
66
+			olen += 1;
67
+			out[max - olen] = repeatByte(offset, in, ilen);
68
+			// fallthrough
69
+		case R2:
70
+			r = repeatByte(offset, in, ilen);
71
+			olen += 1;
72
+			out[max - olen] = r;
73
+			olen += 1;
74
+			out[max - olen] = r;
75
+			goto copyBytes;
76
+
77
+		default:
78
+			return INPUT_DATA_CORRUPTED - __LINE__;
79
+		}
80
+
81
+	copyBytes: {
82
+		uint8_t* to = out + max - olen - offset; // to := len(d) - n - offset
83
+		uint8_t* from = in + ilen - offset;      // from := len(in) - offset // sigil byte is already removed
84
+		if (to < out) {
85
+			return OUT_BUFFER_TOO_SMALL - __LINE__;
86
+		}
87
+		memcpy(to, from, offset); // n += copy(d[to:], in[from:])
88
+		olen += offset;
89
+		ilen -= offset; // in = in[:len(in)-offset] // remove copied bytes
90
+		continue;
91
+	}
92
+	}
93
+	return olen;
94
+}
95
+
96
+// sigilAndOffset interprets b as sigil byte with offset, fills sigil and returns offset.
97
+// For details see TCOBSv1Specification.md.
98
+static int sigilAndOffset(uint8_t* sigil, uint8_t b) {
99
+	int offset;
100
+	*sigil = b & 0xE0; // 0x11100000
101
+	if (*sigil == 0) {
102
+		*sigil = b & 0xF8; // 0x11111000
103
+		offset = 7 & b;    // 0x00000111
104
+	} else {
105
+		offset = 0x1F & b; // 0x00011111
106
+	}
107
+	return offset;
108
+}
109
+
110
+// repeatByte returns the value to repeat
111
+static uint8_t repeatByte(int offset, uint8_t* in, int len) {
112
+	if (offset == 0) {      // left byte of Ri is a sigil byte (probably N)
113
+		return in[len - 2]; // a buffer cannot start with Ri
114
+	} else {
115
+		return in[len - 1];
116
+	}
117
+}

+ 400
- 0
Middlewares/trice/tcobsv1Encode.c Переглянути файл

@@ -0,0 +1,400 @@
1
+/*! \file tcobsv1Encode.c
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+\details See ./TCOBSv1Specification.md.
4
+*******************************************************************************/
5
+
6
+#include <stdint.h>
7
+#include <stddef.h>
8
+#include "tcobs.h"
9
+#include "tcobsv1Internal.h"
10
+
11
+// lint -e801 Info 801: Use of goto is deprecated
12
+
13
+//! ASSERT checks for a true condition, otherwise stop.
14
+//! This macro was used during development to verify the code.
15
+#define ASSERT(condition) //  do{ if( !(condition) ){ for(;;){} } }while(0);
16
+
17
+//! OUTB writes a non-sigil byte to output and increments offset.
18
+//! If offset reaches 31, a NOP sigil byte is inserted and offset is then set to 0.
19
+#define OUTB(by)              \
20
+	{                         \
21
+		*o++ = by;            \
22
+		offset++;             \
23
+		ASSERT(offset <= 31); \
24
+		if (offset == 31) {   \
25
+			*o++ = N | 31;    \
26
+			offset = 0;       \
27
+		}                     \
28
+	}
29
+
30
+//! OUT_zeroSigil writes one of the sigil bytes Z1, Z3, Z3
31
+//! according to zeroCount and sets zeroCount=0 and offset=0.
32
+#define OUT_zeroSigil                             \
33
+	{                                             \
34
+		ASSERT(b_1 == 0);                         \
35
+		ASSERT((fullCount | reptCount) == 0);     \
36
+		ASSERT(1 <= zeroCount && zeroCount <= 3); \
37
+		ASSERT(offset <= 31);                     \
38
+		*o++ = (zeroCount << 5) | offset;         \
39
+		offset = 0;                               \
40
+		zeroCount = 0;                            \
41
+	}
42
+
43
+//! OUT_fullSigil writes one of the sigil bytes F2, F3, F4
44
+//! according to fullCount and sets fullCount=0 and offset=0.
45
+#define OUT_fullSigil                             \
46
+	{                                             \
47
+		ASSERT(b_1 == 0xFF);                      \
48
+		ASSERT((zeroCount | reptCount) == 0);     \
49
+		ASSERT(2 <= fullCount && fullCount <= 4); \
50
+		ASSERT(offset <= 31);                     \
51
+		*o++ = 0x80 | (fullCount << 5) | offset;  \
52
+		offset = 0;                               \
53
+		fullCount = 0;                            \
54
+	}
55
+
56
+//! OUT_reptSigil writes one of the sigil bytes R2, R3, R4
57
+//! according to reptCount and sets reptCount=0 and offset=0.
58
+//! If offset is bigger than 7 a NOP sigil byte is inserted.
59
+#define OUT_reptSigil                             \
60
+	{                                             \
61
+		ASSERT((zeroCount | fullCount) == 0);     \
62
+		ASSERT(2 <= reptCount && reptCount <= 4); \
63
+		ASSERT(offset <= 31);                     \
64
+		if (offset > 7) {                         \
65
+			*o++ = N | offset;                    \
66
+			offset = 0;                           \
67
+		}                                         \
68
+		*o++ = ((reptCount - 1) << 3) | offset;   \
69
+		offset = 0;                               \
70
+		reptCount = 0;                            \
71
+	}
72
+
73
+int TCOBSEncode(void* __restrict output, const void* __restrict input, size_t length) {
74
+	uint8_t* o = output; // write pointer
75
+	uint8_t* out = output;
76
+	uint8_t const* i = input;                        // read pointer
77
+	uint8_t const* limit = (uint8_t*)input + length; // read limit
78
+	uint8_t zeroCount = 0;                           // counts zero bytes 1-3 for Z1-Z3
79
+	uint8_t fullCount = 0;                           // counts 0xFF bytes 1-4 for FF and F2-F4
80
+	uint8_t reptCount = 0;                           // counts repeat bytes 1-4 for !00 and R2-R4,
81
+	uint8_t b_1 = 0;                                 // previous byte
82
+	uint8_t b = 0;                                   // current byte
83
+	uint8_t offset = 0;                              // link to next sigil or buffer start looking backwards
84
+	// comment syntax:
85
+	//     Sigil bytes chaining is done with offset and not shown explicitly.
86
+	//     All left from comma is already written to o and if, only partially shown.
87
+	//     n is 0...3|4 and m is n+1, representing count number.
88
+	//     zn, fn, rn right from comma is count in variables, if not shown, then 0.
89
+	//     At any moment only one of the 3 counters can be different from 0.
90
+	//     Zn, Fn, Rn, Nn are (written) sigil bytes.
91
+	//     Between comma and dot are the 2 values b_1 and b.
92
+	//     3 dots ... means it is unknown if bytes follow.
93
+	//     !00 is a byte != 00.
94
+	//     !FF is a byte != FF.
95
+	//     aa is not 00 and not FF and all aa in a row are equal.
96
+	//     xx yy and zz are any bytes.
97
+	//     Invalid b_1 and b are displayed as --.
98
+
99
+	if (length >= 2) { // , -- --. xx yy ...
100
+		b = *i++;      // , -- xx. yy ...
101
+		for (;;) {     // , zn|fn|rn -- xx. yy ...
102
+			b_1 = b;   // , xx --. yy ...
103
+			b = *i++;  // , xx yy. ...
104
+
105
+			if (limit - i > 0) { // , xx yy. zz ...
106
+
107
+				// , z0 00 00. -> , z1 -- 00.
108
+				// , z0 00 00. 00 -> , z2 -- 00.
109
+
110
+				if ((b_1 | b) == 0) {         // , zn 00 00. zz ...
111
+					zeroCount++;              // , zm -- 00. zz ...
112
+					if (zeroCount == 2) {     // , z2 -- 00. zz ...
113
+						zeroCount = 3;        // , z3 -- --. zz ...
114
+						OUT_zeroSigil         // Z3, -- --. zz ...
115
+						    b = *i++;         // , -- zz. ...
116
+						if (limit - i == 0) { // , -- zz.
117
+							goto lastByte;
118
+						}
119
+						// , -- xx. yy ...
120
+					}
121
+					continue; // , zn -- xx. yy ...
122
+				}
123
+
124
+				// , f0 FF FF. -> , f1 -- FF.
125
+				// , f0 FF FF. FF -> , f2 -- FF.
126
+				// , f0 FF FF. FF FF -> , f3 -- FF.
127
+
128
+				if ((b_1 & b) == 0xFF) {      // , fn FF FF. zz ...
129
+					fullCount++;              // , fm -- FF. zz ...
130
+					if (fullCount == 3) {     // , f3 -- FF. zz ...
131
+						fullCount = 4;        // , f4 -- --. zz ...
132
+						OUT_fullSigil         // F4, -- --. zz ...
133
+						    b = *i++;         // , -- zz. ...
134
+						if (limit - i == 0) { // , -- zz.
135
+							goto lastByte;
136
+						}
137
+						// , -- xx. yy ...
138
+					}
139
+					continue; // , fn -- xx. yy ...
140
+				}
141
+
142
+				// , r0 aa aa. -> , r1 -- aa.
143
+				// , r0 aa aa. aa -> , r2 -- aa.
144
+				// , r0 aa aa. aa aa -> , r3 -- aa.
145
+				// , r0 aa aa. aa aa aa -> , r4 -- aa.
146
+
147
+				if (b_1 == b) { // , rn aa aa. xx ...
148
+					ASSERT(b_1 != 0);
149
+					ASSERT(b_1 != 0xFF);
150
+					reptCount++;              // , rm -- aa. xx ...
151
+					if (reptCount == 4) {     // , r4 -- aa. xx ...
152
+						OUTB(b)               // aa, r4 -- --. xx ...
153
+						OUT_reptSigil         // aa R4, -- --. xx ...
154
+						    b = *i++;         // , -- xx. ...
155
+						if (limit - i == 0) { // , -- xx.
156
+							goto lastByte;
157
+						}
158
+						// , -- xx. yy ...
159
+					}
160
+					continue; // , r1|r2|r3 -- aa. yy ...
161
+				} // OR // , -- xx. yy ...
162
+
163
+				// , zn|fn|rn xx yy. zz ... (at this point is b_1 != b)
164
+
165
+				// handle counts
166
+				if (zeroCount) { // , z1|z2 00 aa. xx ...
167
+					ASSERT(1 <= zeroCount && zeroCount <= 2)
168
+					ASSERT(b_1 == 0)
169
+					ASSERT(b_1 != b)
170
+					zeroCount++;  // , z2|z3 -- aa. xx ...
171
+					OUT_zeroSigil // Z2|Z3, -- aa. xx ...
172
+					    continue;
173
+				}
174
+				if (fullCount) { // , f1|f2|f3 FF !FF. xx ...
175
+					ASSERT(1 <= fullCount && fullCount <= 3)
176
+					ASSERT(b_1 == 0xFF)
177
+					ASSERT(b_1 != b)
178
+					fullCount++;  // , f2|f3|f4 -- !FF. xx ...
179
+					OUT_fullSigil // Fn, -- !FF. xx ...
180
+					    continue;
181
+				}
182
+				if (reptCount) { // , r1|r2|r3 aa !aa. xx ...
183
+					ASSERT(1 <= reptCount && reptCount <= 3)
184
+					ASSERT(b_1 != 0)
185
+					ASSERT(b_1 != 0xFF)
186
+					ASSERT(b_1 != b)
187
+					if (reptCount == 1) { // , r1 aa !aa. xx ...
188
+						reptCount = 0;    // clear
189
+						OUTB(b_1)         // aa, r0 aa !aa. xx ...
190
+						OUTB(b_1)         // aa aa, -- !aa. xx ...
191
+						continue;
192
+					}
193
+					*o++ = b_1; // aa, r2|r3 -- !aa. xx ...
194
+					offset++;
195
+					OUT_reptSigil // aa R1|R2|R3, -- !aa. xx ...
196
+					    continue;
197
+				}
198
+
199
+				// at this point all counts are 0, b_1 != b and b_1 = xx, b == yy
200
+				ASSERT(zeroCount == 0)
201
+				ASSERT(fullCount == 0)
202
+				ASSERT(reptCount == 0)
203
+				ASSERT(b_1 != b)
204
+
205
+				// , xx yy. zz ...
206
+				if (b_1 == 0) { // , 00 !00. xx ...
207
+					ASSERT(b != 0)
208
+					zeroCount++;            // , z1 -- !00. xx ...
209
+					OUT_zeroSigil continue; // Z1, -- !00. xx ...
210
+				}
211
+				if (b_1 == 0xFF) { // , FF !FF. xx ...
212
+					ASSERT(b != 0xFF)
213
+					OUTB(0xFF); // FF, -- !FF. xx ...
214
+					continue;
215
+				}
216
+
217
+				// , aa xx. yy ...
218
+				ASSERT(1 <= b_1 && b_1 <= 0xFE)
219
+				OUTB(b_1) // aa, -- xx. yy ...
220
+				continue;
221
+
222
+			} else { // last 2 bytes
223
+				// , zn|fn|rn xx yy.
224
+				if ((zeroCount | fullCount | reptCount) == 0) { // , xx yy.
225
+					if (b_1 == 0 && b == 0) {                   // , 00 00.
226
+						*o++ = Z2 | offset;                     // Z2, -- --.
227
+						return o - out;
228
+					}
229
+					if (b_1 == 0xFF && b == 0xFF) { // , FF FF.
230
+						*o++ = F2 | offset;         // F2, -- --.
231
+						return o - out;
232
+					}
233
+					if (b_1 == 0) {    // , 00 xx.
234
+						zeroCount = 1; // , z1 -- xx.
235
+						OUT_zeroSigil  // Z1, -- xx.
236
+						    goto lastByte;
237
+					}
238
+					// , aa xx.
239
+					ASSERT(b_1 != 0)
240
+					OUTB(b_1) // aa, -- xx.
241
+					goto lastByte;
242
+				}
243
+
244
+				// At this point exactly one count was incremented.
245
+				// If a count is >0 it is necessarily related to b_1.
246
+
247
+				if (zeroCount == 1) { // , z1 00 yy
248
+					ASSERT(fullCount == 0)
249
+					ASSERT(reptCount == 0)
250
+					ASSERT(b_1 == 0)
251
+					if (b != 0) {     // , z1 00 !00.
252
+						zeroCount++;  // , z2 -- !00.
253
+						OUT_zeroSigil // Z2, -- !00.
254
+						    goto lastByte;
255
+					}
256
+					if (b == 0) {           // , z1 00 00.
257
+						*o++ = Z3 | offset; // Z3, -- --.
258
+						return o - out;
259
+					}
260
+					ASSERT(0)
261
+				}
262
+
263
+				if (zeroCount == 2) { // , z2 00 !00.
264
+					ASSERT(fullCount == 0)
265
+					ASSERT(reptCount == 0)
266
+					ASSERT(b_1 == 0)
267
+					ASSERT(b != 0)
268
+					zeroCount = 3; // , z3 -- aa.
269
+					OUT_zeroSigil  // Z3, -- aa.
270
+					    goto lastByte;
271
+				}
272
+
273
+				if (fullCount == 1) { // , f1 FF yy.
274
+					ASSERT(zeroCount == 0)
275
+					ASSERT(reptCount == 0)
276
+					ASSERT(b_1 == 0xFF)
277
+					if (b == 0xFF) { // , f1 FF FF.
278
+						ASSERT(offset <= 31);
279
+						*o++ = F3 | offset; // F3, -- --.
280
+						return o - out;
281
+					}
282
+					fullCount = 2; // , f2 -- yy.
283
+					OUT_fullSigil  // F2, -- yy.
284
+					    goto lastByte;
285
+				}
286
+
287
+				if (fullCount == 2) { // , f2 FF yy.
288
+					ASSERT(zeroCount == 0)
289
+					ASSERT(reptCount == 0)
290
+					ASSERT(b_1 == 0xFF)
291
+					if (b == 0xFF) { // , f2 FF FF.
292
+						ASSERT(offset <= 31);
293
+						*o++ = F4 | offset; // F4, -- --.
294
+						return o - out;
295
+					}
296
+					// , f2 FF !FF
297
+					fullCount++;  // , f3 -- !FF.
298
+					OUT_fullSigil // F3, -- !FF.
299
+					    goto lastByte;
300
+				}
301
+
302
+				if (fullCount == 3) { // , f3 FF yy.
303
+					ASSERT(zeroCount == 0)
304
+					ASSERT(reptCount == 0)
305
+					ASSERT(b_1 == 0xFF)
306
+					if (b == 0xFF) {  // , f3 FF FF.
307
+						OUT_fullSigil // F3, FF FF.
308
+						    ASSERT(offset <= 31);
309
+						*o++ = F2 | offset; // F3 F2, -- --.
310
+						return o - out;     // option: F4 FF, -- --. is also right
311
+					}
312
+					// , f3 FF !FF.
313
+					fullCount = 4; // , f4 -- xx.
314
+					OUT_fullSigil  // F4, -- xx.
315
+					    goto lastByte;
316
+				}
317
+
318
+				if (reptCount == 1) { // , r1 aa yy.
319
+					ASSERT(zeroCount == 0)
320
+					ASSERT(fullCount == 0)
321
+					ASSERT(b_1 != 0)
322
+					ASSERT(b_1 != 0xFF)
323
+					if (b_1 == b) { // , r1 aa aa.
324
+						OUTB(b_1)   // aa, r1 -- aa.
325
+						ASSERT(offset <= 31);
326
+						if (offset > 7) {
327
+							*o++ = N | offset;
328
+							offset = 0;
329
+						}
330
+						*o++ = R2 | offset; // aa R2, -- --.
331
+						return o - out;
332
+					}
333
+					OUTB(b_1) // aa, r0 aa -- yy.
334
+					OUTB(b_1) // aa aa, -- yy.
335
+					goto lastByte;
336
+				}
337
+				if (reptCount == 2) { // , r2 aa yy.
338
+					ASSERT(zeroCount == 0)
339
+					ASSERT(fullCount == 0)
340
+					ASSERT(b_1 != 0)
341
+					ASSERT(b_1 != 0xFF)
342
+					if (b_1 == b) { // , r2 aa aa.
343
+						OUTB(b_1)   // aa, r2 -- aa.
344
+						ASSERT(offset <= 31);
345
+						if (offset > 7) {
346
+							*o++ = N | offset;
347
+							offset = 0;
348
+						}
349
+						*o++ = R3 | offset; // aa R3, -- --.
350
+						return o - out;
351
+					}
352
+					OUTB(b_1)     // aa, r2 -- yy.
353
+					OUT_reptSigil // aa R2, -- xx.
354
+					    goto lastByte;
355
+				}
356
+				if (reptCount == 3) { // , r3 aa yy.
357
+					ASSERT(zeroCount == 0)
358
+					ASSERT(fullCount == 0)
359
+					ASSERT(b_1 != 0)
360
+					ASSERT(b_1 != 0xFF)
361
+					OUTB(b_1)       // aa, r3 -- yy.
362
+					if (b_1 == b) { // , r3 aa aa.
363
+						ASSERT(offset <= 31);
364
+						if (offset > 7) {
365
+							*o++ = N | offset;
366
+							offset = 0;
367
+						}
368
+						*o++ = R4 | offset; // aa R4, -- --.
369
+						return o - out;
370
+					}
371
+					// aa, r3 -- yy.
372
+					OUT_reptSigil // aa R3, -- xx.
373
+					    goto lastByte;
374
+				}
375
+
376
+				ASSERT(0) // will not be reached
377
+			}
378
+		}
379
+	}
380
+	if (length == 0) { // , -- --.
381
+		return 0;
382
+	}
383
+	if (length == 1) { // , . xx
384
+		b = *i;        // , -- xx.
385
+		goto lastByte;
386
+	}
387
+
388
+lastByte:         // , -- xx.
389
+	if (b == 0) { // , -- 00.
390
+		ASSERT(offset <= 31);
391
+		*o++ = Z1 | offset; // Z1, -- --.
392
+		return o - out;
393
+	} else {      // , -- aa.
394
+		*o++ = b; // aa|ff, -- --.
395
+		offset++;
396
+		ASSERT(offset <= 31);
397
+		*o++ = N | offset; // aa Nn, -- --.
398
+		return o - out;
399
+	}
400
+}

+ 28
- 0
Middlewares/trice/tcobsv1Internal.h Переглянути файл

@@ -0,0 +1,28 @@
1
+/*! \file tcobsInternal.h
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+\details See ./TCOBSv1Specification.md. Only internal usage.
4
+*******************************************************************************/
5
+
6
+#ifndef TCOBS_INTERNAL_H_
7
+#define TCOBS_INTERNAL_H_
8
+
9
+#ifdef __cplusplus
10
+extern "C" {
11
+#endif
12
+
13
+#define N 0xA0  //!< sigil byte 0x101ooooo, offset 0-31
14
+#define Z1 0x20 //!< sigil byte 0x001ooooo, offset 0-31
15
+#define Z2 0x40 //!< sigil byte 0x010ooooo, offset 0-31
16
+#define Z3 0x60 //!< sigil byte 0x011ooooo, offset 0-31
17
+#define F2 0xC0 //!< sigil byte 0x110ooooo, offset 0-31
18
+#define F3 0xE0 //!< sigil byte 0x111ooooo, offset 0-31
19
+#define F4 0x80 //!< sigil byte 0x100ooooo, offset 0-31
20
+#define R2 0x08 //!< sigil byte 0x00001ooo, offset 0-7
21
+#define R3 0x10 //!< sigil byte 0x00010ooo, offset 0-7
22
+#define R4 0x18 //!< sigil byte 0x00011ooo, offset 0-7
23
+
24
+#ifdef __cplusplus
25
+}
26
+#endif
27
+
28
+#endif // TCOBS_INTERNAL_H_

+ 1127
- 0
Middlewares/trice/trice.c
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 787
- 0
Middlewares/trice/trice.h Переглянути файл

@@ -0,0 +1,787 @@
1
+/*!
2
+ *  \file trice.h
3
+   \author thomas.hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+#ifndef TRICE_H_
8
+#define TRICE_H_
9
+
10
+#ifdef __cplusplus
11
+extern "C"
12
+{
13
+#endif
14
+
15
+#undef ID //!< avoid name clashes in case ID was used by an other library
16
+#undef Id //!< avoid name clashes in case Id was used by an other library
17
+#undef id //!< avoid name clashes in case id was used by an other library
18
+#undef iD //!< avoid name clashes in case iD was used by an other library
19
+
20
+#define TRICE_UNUSED(x) (void)(x); //!< https://stackoverflow.com/questions/3599160/how-can-i-suppress-unused-parameter-warnings-in-c
21
+
22
+// lint -e529  Warning 529: Symbol '_SEGGER_RTT__LockState' not subsequently referenced
23
+// lint -e629  Warning 629: static class for function '' is non standard
24
+// lint -emacro( 701, TRICE* ) Info 701: Shift left of signed quantity (int)
25
+// lint -emacro( 123, TRICE* )
26
+// lint -emacro( 571, TRICE* )
27
+// lint -emacro( 572, TRICE* )
28
+// lint -emacro( 578, TRICE* )
29
+// lint -emacro( 648, TRICE* )
30
+// lint -emacro( 665, TRICE* )
31
+// lint -emacro( 666, TRICE* )
32
+// lint -emacro( 670, TRICE* )
33
+// lint -emacro( 694, TRICE* )
34
+// lint -emacro( 717, TRICE* )
35
+// lint -emacro( 718, TRICE* )
36
+// lint -emacro( 732, TRICE* )
37
+// lint -emacro( 734, TRICE* )
38
+// lint -emacro( 736, TRICE* )
39
+// lint -emacro( 740, TRICE* )
40
+// lint -emacro( 746, TRICE* )
41
+// lint -emacro( 747, TRICE* )
42
+// lint -emacro( 774, TRICE* )
43
+// lint -emacro( 778, TRICE* )
44
+// lint -emacro( 826, TRICE* )
45
+// lint -emacro( 830, TRICE* )
46
+// lint -emacro( 831, TRICE* )
47
+// lint -emacro( 835, TRICE* )
48
+// lint -emacro( 545, SCOPY, DCOPY )
49
+// lint -ecall( 666, aFloat, aDouble )
50
+// lint -efunc( 666, aFloat, aDouble )
51
+// lint -esym( 666, aFloat, aDouble )
52
+// lint -emacro( 732, SCOPY )
53
+// lint -emacro( 717, DCOPY, SCOPY )
54
+// lint -emacro( 732, DCOPY )
55
+
56
+// helper macros (the numbers are 32-bit random values)
57
+
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.
59
+//! Single trices need a bit more transfer data. In case of a data disruption, only a single trice messages can get lost.
60
+#define TRICE_SINGLE_PACK_MODE 787345706U
61
+
62
+//! TRICE_MULTI_PACK_MODE packs all trices of a buffer in a single TCOBS package and a following 0-delimiter byte.
63
+//! Grouped trices need a bit less transfer data. In case of a data disruption, multiple trice messages can get lost.
64
+//! Olny relevant when TRICE_DOUBLE_BUFFER is selected
65
+#define TRICE_MULTI_PACK_MODE 3987862482U
66
+
67
+//! With TRICE_BUFFER == TRICE_STACK_BUFFER  the internal macro TRICE_PUT writes to the stack.
68
+//! This is direct logging. This reduces memory needs if only one stack is used.
69
+#define TRICE_STACK_BUFFER 2645382063U
70
+
71
+//! With TRICE_BUFFER == TRICE_STATIC_BUFFER the internal macro TRICE_PUT writes to a static buffer.
72
+//! This reduces memory needs if many stacks are used.
73
+#define TRICE_STATIC_BUFFER 1763551404U
74
+
75
+//! With TRICE_BUFFER == TRICE_DOUBLE_BUFFER the internal macro TRICE_PUT writes to a double buffer half.
76
+//! This is deferred logging using more space but the TRICE macros are executed faster.
77
+#define TRICE_DOUBLE_BUFFER 1950870368U
78
+
79
+//! With TRICE_BUFFER == TRICE_RING_BUFFER the internal macro TRICE_PUT writes to a ring buffer segment.
80
+//! This is deferred logging using less space but the TRICE macros are executed a bit slower.
81
+#define TRICE_RING_BUFFER 2237719049U
82
+
83
+//! TRICE_FRAMING_TCOBS is recommended for trice transfer over UART.
84
+#define TRICE_FRAMING_TCOBS 3745917584U
85
+
86
+//! TRICE_FRAMING_COBS is recommended for encrypted trices.
87
+#define TRICE_FRAMING_COBS 2953804234U
88
+
89
+//! TRICE_FRAMING_NONE is recommended for RTT in direct mode. One trice costs about 100 clocks and is completely done.
90
+#define TRICE_FRAMING_NONE 1431860787U
91
+
92
+#include <stdint.h>
93
+#include <string.h>
94
+#include "triceConfig.h"        // Project specific settings are overwriting the default settings.
95
+#include "triceDefaultConfig.h" // default settings
96
+
97
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98
+// These converter functions need to be visible in the TRICE_OFF == 1 case to avoid compiler warnings then.
99
+//
100
+
101
+// pre C99
102
+//  // aFloat returns passed float value x as bit pattern in a uint32_t type.
103
+//  TRICE_INLINE uint32_t aFloat( float x ){
104
+//      union {
105
+//          float f;
106
+//          uint32_t u;
107
+//      } t;
108
+//      t.f = x;
109
+//      return t.u;
110
+//  }
111
+
112
+// aFloat returns passed float value x as bit pattern in a uint32_t type.
113
+TRICE_INLINE uint32_t aFloat(float f)
114
+{
115
+    union
116
+    {
117
+        float from;
118
+        uint32_t to;
119
+    } pun = {.from = f};
120
+    return pun.to;
121
+}
122
+
123
+// aDouble returns passed double value x as bit pattern in a uint64_t type.
124
+TRICE_INLINE uint64_t aDouble(double x)
125
+{
126
+    union
127
+    {
128
+        double d;
129
+        uint64_t u;
130
+    } t;
131
+    t.d = x;
132
+    return t.u;
133
+}
134
+
135
+// Just in case you are receiving Trice messages containing uint32_t values to be interpreted as float:
136
+//
137
+//  // asFloat returns passed uint32_t value x bit pattern as float type.
138
+//  TRICE_INLINE float asFloat(uint32_t x) {
139
+//      union {
140
+//          uint32_t from;
141
+//          float to;
142
+//      } pun = {.from = x};
143
+//      return pun.to;
144
+//  }
145
+
146
+//
147
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
148
+
149
+// Do not generate trice code
150
+// - when defining TRICE_CLEAN to 1 inside "triceConfig.h" or
151
+// - when defining TRICE_OFF to 1 before including "trice.h".
152
+// It is possible to `#define TRICE_OFF 1` inside the project settings to disable all Trice code.
153
+#if ((defined(TRICE_OFF) && TRICE_OFF == 1)) || ((defined(TRICE_CLEAN) && TRICE_CLEAN == 1))
154
+
155
+// When the user defines TRICE_CLEAN to 0 or 1 inside triceConfig.h, this value is set to 0 with "trice insert" and to 1 with "trice clean".
156
+// This gives the option to silence editor warnings in the "trice clean" state.
157
+// To avoid a re-build on files including trice.h, the Trice cache will be helpful. See issue #488.
158
+#include "triceOff.h"
159
+
160
+#else // #if ((defined(TRICE_OFF) && TRICE_OFF == 1)) || ((defined(TRICE_CLEAN) && TRICE_CLEAN == 1))
161
+/***************************************************************************************************/
162
+/**/
163
+/**/
164
+
165
+#include "triceOn.h"
166
+
167
+#if (TRICE_DIRECT_SEGGER_RTT_8BIT_WRITE == 1) || (TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE == 1) || (TRICE_DEFERRED_SEGGER_RTT_8BIT_WRITE == 1)
168
+
169
+#define SEGGER_RTT
170
+
171
+#endif
172
+
173
+#if defined(SEGGER_RTT) || (USE_SEGGER_RTT_LOCK_UNLOCK_MACROS == 1)
174
+
175
+#include "SEGGER_RTT.h"
176
+
177
+#endif
178
+
179
+// global defines
180
+
181
+#define TRICE_TYPE_X0 0 //!< TRICE_TYPE_X0 is an unspecified trice (reserved)
182
+#define TRICE_TYPE_S0 1 //!< TRICE_TYPE_S0 is a trice without stamp.
183
+#define TRICE_TYPE_S2 2 //!< TRICE_TYPE_S2 is a trice with 16-bit stamp.
184
+#define TRICE_TYPE_S4 3 //!< TRICE_TYPE_S4 is a trice with 32-bit stamp.
185
+
186
+// global variables:
187
+
188
+extern uint32_t *const triceSingleBufferStartWritePosition;
189
+extern unsigned TricesCountRingBuffer;
190
+extern char triceCommandBuffer[];
191
+extern int triceCommandFlag;
192
+extern uint8_t TriceCycle;
193
+extern unsigned RTT0_writeDepthMax;
194
+extern unsigned TriceErrorCount;
195
+
196
+#if (TRICE_BUFFER == TRICE_RING_BUFFER)
197
+
198
+extern uint32_t *const TriceRingBufferStart;
199
+extern uint32_t *const TriceRingBufferLimit;
200
+
201
+extern uint32_t *const TriceRingBufferProtectLimit;
202
+
203
+#if (TRICE_DIAGNOSTICS == 1)
204
+
205
+extern int TriceRingBufferDepthMax;
206
+
207
+#endif
208
+
209
+#if TRICE_RING_BUFFER_OVERFLOW_WATCH == 1
210
+
211
+void TriceInitRingBufferMargins(void);
212
+void WatchRingBufferMargins(void);
213
+
214
+#endif
215
+
216
+#endif // #if (TRICE_BUFFER == TRICE_RING_BUFFER)
217
+
218
+#if (TRICE_DIAGNOSTICS == 1)
219
+
220
+extern int TriceDataOffsetDepthMax;
221
+extern unsigned TriceSingleMaxWordCount;
222
+extern unsigned TriceDynStringBufTruncateCount;
223
+extern unsigned TriceHalfBufferDepthMax;
224
+
225
+#if TRICE_PROTECT == 1
226
+
227
+extern unsigned TriceDirectOverflowCount;
228
+extern unsigned TriceDeferredOverflowCount;
229
+
230
+#endif // #if TRICE_PROTECT == 1
231
+
232
+#define TRICE_DYN_STRG_BUF_TRUNCATE_COUNT_INCREMENT() \
233
+    do {                                         \
234
+        TriceDynStringBufTruncateCount++;              \
235
+    } while (0)
236
+
237
+#else // #if (TRICE_DIAGNOSTICS == 1)
238
+
239
+#define TRICE_DYN_STRG_BUF_TRUNCATE_COUNT_INCREMENT()
240
+
241
+#endif // #else // #if (TRICE_DIAGNOSTICS == 1)
242
+
243
+#if (TRICE_BUFFER == TRICE_RING_BUFFER) || (TRICE_BUFFER == TRICE_DOUBLE_BUFFER)
244
+
245
+extern uint32_t *TriceBufferWritePosition;
246
+
247
+#endif
248
+
249
+//! TRICE_BUFFER_SIZE is
250
+//! \li the additional needed stack space when TRICE_BUFFER == TRICE_STACK_BUFFER
251
+//! \li the statically allocated buffer size when TRICE_BUFFER == TRICE_STATIC_BUFFER
252
+//! \li the value before Ringbuffer wraps, when TRICE_BUFFER == TRICE_RING_BUFFER
253
+//!
254
+//! The trice buffer needs 4 additional scratch bytes, when the longest possible
255
+//! trice gets formally the padding space cleared.
256
+#define TRICE_BUFFER_SIZE (TRICE_DATA_OFFSET + TRICE_SINGLE_MAX_SIZE + 4)
257
+
258
+#if TRICE_CYCLE_COUNTER == 1
259
+
260
+#define TRICE_CYCLE TriceCycle++ //!< TRICE_CYCLE is the trice cycle counter as 8 bit count 0-255.
261
+
262
+#else // #if TRICE_CYCLE_COUNTER == 1
263
+
264
+#define TRICE_CYCLE 0xC0 //!< TRICE_CYCLE is no trice cycle counter, just a static value.
265
+
266
+#endif // #else // #if TRICE_CYCLE_COUNTER == 1
267
+
268
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
269
+// "Declare" endian dependent macros, needed in trice8.h, trice16.h, trice32.h, trice64.h:
270
+//
271
+#define TRICE_HTOTS(x) TRICE_HTOTS(x)
272
+#define TRICE_HTOTL(x) TRICE_HTOTL(x)
273
+#define TRICE_TTOHS(x) TRICE_TTOHS(x)
274
+#define TRICE_PUT16_1616(x, ts) TRICE_PUT16_1616(x, ts)
275
+#define TRICE_PUT64(x) TRICE_PUT64(x)
276
+#define TRICE_SWAPINT16(x) TRICE_SWAPINT16(x)
277
+#define TRICE_SWAPINT32(x) TRICE_SWAPINT32(x)
278
+#define idLH idLH
279
+#define IdLH IdLH
280
+#define IDLH IDLH
281
+#define tsL tsL
282
+#define tsH tsH
283
+#define tsHH tsHH
284
+#define tsHL tsHL
285
+#define tsLH tsLH
286
+#define tsLL tsLL
287
+//
288
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
289
+
290
+//! TRICE_PUT16 copies 16-bit value x into the Trice buffer.
291
+#define TRICE_PUT16(x)                                     \
292
+    do {                                                   \
293
+        uint16_t* p = (uint16_t*)TriceBufferWritePosition; \
294
+        *p++ = TRICE_HTOTS(x);                             \
295
+        TriceBufferWritePosition = (uint32_t*)p;           \
296
+    } while (0)
297
+
298
+#include "trice8.h"
299
+#include "trice16.h"
300
+#include "trice32.h"
301
+#include "trice64.h"
302
+
303
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
304
+// Endian dependent macros and code:
305
+//
306
+#undef TRICE_HTOTS
307
+#undef TRICE_HTOTL
308
+#undef TRICE_TTOHS
309
+#undef TRICE_PUT16_1616
310
+#undef TRICE_PUT64
311
+#undef TRICE_SWAPINT16
312
+#undef TRICE_SWAPINT32
313
+#undef idLH
314
+#undef IdLH
315
+#undef IDLH
316
+#undef tsL
317
+#undef tsH
318
+#undef tsHH
319
+#undef tsHL
320
+#undef tsLH
321
+#undef tsLL
322
+
323
+#if (__STDC_VERSION__ >= 202000) //! C23 standard specification for endianess detection (Note N3022)
324
+
325
+// https://github.com/rokath/trice/pull/505
326
+
327
+#if __STDC_ENDIAN_NATIVE__ == __STDC_ENDIAN_LITTLE__
328
+#define TRICE_MCU_IS_BIG_ENDIAN 0
329
+#else
330
+#define TRICE_MCU_IS_BIG_ENDIAN 1
331
+#endif // __STDC_ENDIAN_NATIVE__ == __STDC_ENDIAN_LITTLE__
332
+
333
+#else
334
+
335
+//! Try detect endianess by using compilers macros
336
+#if (defined(BYTE_ORDER) && defined(ORDER_LITTLE_ENDIAN) && BYTE_ORDER == ORDER_LITTLE_ENDIAN) ||         \
337
+    (defined(__BYTE_ORDER) && defined(__ORDER_LITTLE_ENDIAN) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN) || \
338
+    (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
339
+#define TRICE_MCU_IS_BIG_ENDIAN 0
340
+
341
+#elif (defined(BYTE_ORDER) && defined(ORDER_BIG_ENDIAN) && BYTE_ORDER == ORDER_BIG_ENDIAN) ||       \
342
+    (defined(__BYTE_ORDER) && defined(__ORDER_BIG_ENDIAN) && __BYTE_ORDER == __ORDER_BIG_ENDIAN) || \
343
+    (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
344
+#define TRICE_MCU_IS_BIG_ENDIAN 1
345
+
346
+#else
347
+
348
+#ifndef TRICE_MCU_IS_BIG_ENDIAN
349
+#error Bytes order not supported or not detected, set TRICE_MCU_IS_BIG_ENDIAN to 0 or 1 in your triceConfig.h file.
350
+#endif // #ifndef TRICE_MCU_IS_BIG_ENDIAN
351
+
352
+#endif // __BYTE_ORDER__
353
+
354
+#endif // __STDC_VERSION__
355
+
356
+#if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == TRICE_MCU_IS_BIG_ENDIAN
357
+
358
+// TRICE_REVERSE == 0 uses no byte swapping inside the Trice macros resulting in less code and faster execution.
359
+#include "triceMcuOrder.h"
360
+#include "trice8McuOrder.h"
361
+#include "trice16McuOrder.h"
362
+#include "trice32McuOrder.h"
363
+#include "trice64McuOrder.h"
364
+
365
+#else // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == TRICE_MCU_IS_BIG_ENDIAN
366
+
367
+// TRICE_REVERSE == 1 causes byte swapping inside the Trice macros resulting in more code and slower execution.
368
+#include "triceMcuReverse.h"
369
+#include "trice8McuReverse.h"
370
+#include "trice16McuReverse.h"
371
+#include "trice32McuReverse.h"
372
+#include "trice64McuReverse.h"
373
+
374
+#endif // #else // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == TRICE_MCU_IS_BIG_ENDIAN
375
+
376
+//
377
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
378
+
379
+#if TRICE_DIAGNOSTICS == 1
380
+
381
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START \
382
+    uint32_t* const triceSingleBufferStartWritePosition = TriceBufferWritePosition;
383
+
384
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER                                                                        \
385
+    do {                                                                                                       \
386
+        unsigned wordCount = TriceBufferWritePosition - triceSingleBufferStartWritePosition;                   \
387
+        TriceSingleMaxWordCount = (wordCount < TriceSingleMaxWordCount) ? TriceSingleMaxWordCount : wordCount; \
388
+    } while (0);
389
+
390
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER_USING_WORD_COUNT                                                       \
391
+    do {                                                                                                       \
392
+        TriceSingleMaxWordCount = (wordCount < TriceSingleMaxWordCount) ? TriceSingleMaxWordCount : wordCount; \
393
+    } while (0);
394
+
395
+#else // #if TRICE_DIAGNOSTICS == 1
396
+
397
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START
398
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER
399
+#define TRICE_DIAGNOSTICS_SINGLE_BUFFER_USING_WORD_COUNT
400
+
401
+#endif // #else // #if TRICE_DIAGNOSTICS == 1
402
+
403
+// clang-format off
404
+
405
+#ifndef TRICE_ENTER
406
+
407
+#if TRICE_BUFFER == TRICE_STACK_BUFFER
408
+
409
+//! TRICE_ENTER is the start of TRICE macro.
410
+#define TRICE_ENTER                                                                                           \
411
+            TRICE_ENTER_CRITICAL_SECTION {                                                                            \
412
+                {                                                                                                     \
413
+                    uint32_t triceSingleBuffer[TRICE_BUFFER_SIZE >> 2]; /* no = {0} here for speed */                 \
414
+                    uint32_t* const triceSingleBufferStartWritePosition = &triceSingleBuffer[TRICE_DATA_OFFSET >> 2]; \
415
+                    uint32_t* TriceBufferWritePosition = triceSingleBufferStartWritePosition;
416
+
417
+#endif // #if TRICE_BUFFER == TRICE_STACK_BUFFER
418
+
419
+#if TRICE_BUFFER == TRICE_STATIC_BUFFER
420
+
421
+//! TRICE_ENTER is the start of TRICE macro.
422
+#define TRICE_ENTER                \
423
+            TRICE_ENTER_CRITICAL_SECTION { \
424
+                {                          \
425
+                    uint32_t* TriceBufferWritePosition = triceSingleBufferStartWritePosition;
426
+
427
+#endif // #if TRICE_BUFFER == TRICE_STATIC_BUFFER
428
+
429
+#if (TRICE_BUFFER == TRICE_DOUBLE_BUFFER) && (TRICE_DIRECT_OUTPUT == 1)
430
+
431
+#if TRICE_PROTECT == 1
432
+
433
+//! TRICE_ENTER is the start of TRICE macro.
434
+#define TRICE_ENTER                \
435
+                TRICE_ENTER_CRITICAL_SECTION { \
436
+                    if (TriceEnoughSpace()) {  \
437
+                        uint32_t* const triceSingleBufferStartWritePosition = TriceBufferWritePosition;
438
+
439
+#else //  #if TRICE_PROTECT == 1
440
+
441
+//! TRICE_ENTER is the start of TRICE macro.
442
+#define TRICE_ENTER                \
443
+                TRICE_ENTER_CRITICAL_SECTION { \
444
+                    {                          \
445
+                        uint32_t* const triceSingleBufferStartWritePosition = TriceBufferWritePosition;
446
+
447
+#endif // #else //  #if TRICE_PROTECT == 1
448
+
449
+#endif // #if (TRICE_BUFFER == TRICE_DOUBLE_BUFFER) && (TRICE_DIRECT_OUTPUT == 1)
450
+
451
+#if (TRICE_BUFFER == TRICE_DOUBLE_BUFFER) && (TRICE_DIRECT_OUTPUT == 0)
452
+
453
+#if TRICE_PROTECT == 1
454
+
455
+//! TRICE_ENTER is the start of TRICE macro.
456
+#define TRICE_ENTER                \
457
+                TRICE_ENTER_CRITICAL_SECTION { \
458
+                    if (TriceEnoughSpace()) {  \
459
+                        TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START
460
+
461
+#else //  #if TRICE_PROTECT == 1
462
+
463
+//! TRICE_ENTER is the start of TRICE macro.
464
+#define TRICE_ENTER                \
465
+                TRICE_ENTER_CRITICAL_SECTION { \
466
+                    {                          \
467
+                        TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START
468
+
469
+#endif // #else //  #if TRICE_PROTECT == 1
470
+
471
+#endif // #if (TRICE_BUFFER == TRICE_DOUBLE_BUFFER) && (TRICE_DIRECT_OUTPUT == 0)
472
+
473
+#if (TRICE_BUFFER == TRICE_RING_BUFFER) && (TRICE_DIRECT_OUTPUT == 1)
474
+
475
+#if TRICE_PROTECT == 1
476
+
477
+//! TRICE_ENTER is the start of TRICE macro.
478
+#define TRICE_ENTER                                                                                                                                                     \
479
+                TRICE_ENTER_CRITICAL_SECTION {                                                                                                                                      \
480
+                /* The TriceBufferWritePosition stays unchanged, when there is enough space for the next trice at the current write position.*/                                 \
481
+                /* Because the the size of the next trice message is unknown here, the biggest value is assumed, that is TRICE_SINGLE_MAX_SIZE bytes. */                        \
482
+                /* If this space is not given anymore, the `TriceBufferWritePosition` is reset to the start address of the ring buffer. */                                      \
483
+                TriceBufferWritePosition = TriceBufferWritePosition <= TriceRingBufferProtectLimit ? TriceBufferWritePosition : TriceRingBufferStart; \
484
+                if (TriceEnoughSpace()) {                                                                                                                                           \
485
+                    uint32_t* const triceSingleBufferStartWritePosition = TriceBufferWritePosition;                                                                             \
486
+                    TricesCountRingBuffer++; // Because TRICE macros are an atomic instruction normally, this can be done here.
487
+
488
+#else //  #if TRICE_PROTECT == 1
489
+
490
+//! TRICE_ENTER is the start of TRICE macro.
491
+#define TRICE_ENTER                                                                                                                                                     \
492
+                TRICE_ENTER_CRITICAL_SECTION {                                                                                                                                      \
493
+                    {                                                                                                                                                               \
494
+                        /* The TriceBufferWritePosition stays unchanged, when there is enough space for the next trice at the current write position.*/                             \
495
+                        /* Because the the size of the next trice message is unknown here, the biggest value is assumed, that is TRICE_BUFFER_SIZE bytes. */                        \
496
+                        /* If this space is not given anymore, the `TriceBufferWritePosition` is reset to the start address of the ring buffer. */                                  \
497
+                        /* This implementation is a bit different than a ring buffer is usually implemented. */                                                                     \
498
+                        TriceBufferWritePosition = TriceBufferWritePosition <= TriceRingBufferProtectLimit ? TriceBufferWritePosition : TriceRingBufferStart; \
499
+                        uint32_t* const triceSingleBufferStartWritePosition = TriceBufferWritePosition;                                                                             \
500
+                        TricesCountRingBuffer++; // Because TRICE macros are an atomic instruction normally, this can be done here.
501
+
502
+#endif // #else //  #if TRICE_PROTECT == 1
503
+
504
+#endif // #if TRICE_BUFFER == TRICE_RING_BUFFER && (TRICE_DIRECT_OUTPUT == 1)
505
+
506
+#if (TRICE_BUFFER == TRICE_RING_BUFFER) && (TRICE_DIRECT_OUTPUT == 0)
507
+
508
+#if TRICE_PROTECT == 1
509
+
510
+//! TRICE_ENTER is the start of TRICE macro.
511
+#define TRICE_ENTER                                                                                                                                                     \
512
+                TRICE_ENTER_CRITICAL_SECTION {                                                                                                                                      \
513
+                    TriceBufferWritePosition = TriceBufferWritePosition <= TriceRingBufferProtectLimit ? TriceBufferWritePosition : TriceRingBufferStart; \
514
+                    if (TriceEnoughSpace()) {                                                                                                                                       \
515
+                        TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START                                                                                                                  \
516
+                        TricesCountRingBuffer++; // Because TRICE macros are an atomic instruction normally, this can be done here.
517
+
518
+#else //  #if TRICE_PROTECT == 1
519
+
520
+//! TRICE_ENTER is the start of TRICE macro.
521
+#define TRICE_ENTER                                                                                                                                                     \
522
+                TRICE_ENTER_CRITICAL_SECTION {                                                                                                                                      \
523
+                    {                                                                                                                                                               \
524
+                        TriceBufferWritePosition = TriceBufferWritePosition <= TriceRingBufferProtectLimit ? TriceBufferWritePosition : TriceRingBufferStart; \
525
+                        TRICE_DIAGNOSTICS_SINGLE_BUFFER_KEEP_START                                                                                                                  \
526
+                        TricesCountRingBuffer++; // Because TRICE macros are an atomic instruction normally, this can be done here.
527
+
528
+#endif // #else //  #if TRICE_PROTECT == 1
529
+
530
+#endif // #if TRICE_BUFFER == TRICE_RING_BUFFER && (TRICE_DIRECT_OUTPUT == 0)
531
+
532
+#endif // #ifndef TRICE_ENTER
533
+
534
+#ifndef TRICE_LEAVE
535
+
536
+#if TRICE_DIRECT_OUTPUT == 1
537
+
538
+//! TRICE_LEAVE is the end of TRICE macro. It is the same for all buffer variants.
539
+#define TRICE_LEAVE                                                                                          \
540
+            /* wordCount is the amount of steps, the TriceBufferWritePosition went forward for the actual trice.  */ \
541
+            /* The last written uint32_t trice value can contain 1 to 3 padding bytes. */                            \
542
+            unsigned wordCount = TriceBufferWritePosition - triceSingleBufferStartWritePosition;                     \
543
+            TRICE_DIAGNOSTICS_SINGLE_BUFFER_USING_WORD_COUNT                                                         \
544
+            TriceNonBlockingDirectWrite(triceSingleBufferStartWritePosition, wordCount);                             \
545
+            }                                                                                                        \
546
+            }                                                                                                        \
547
+            TRICE_LEAVE_CRITICAL_SECTION
548
+
549
+#else // #if TRICE_DIRECT_OUTPUT == 1
550
+
551
+//! TRICE_LEAVE is the end of TRICE macro. It is the same for all buffer variants.
552
+#define TRICE_LEAVE                 \
553
+            TRICE_DIAGNOSTICS_SINGLE_BUFFER \
554
+            }                               \
555
+            }                               \
556
+            TRICE_LEAVE_CRITICAL_SECTION
557
+
558
+#endif // #else  //#if TRICE_DIRECT_OUTPUT == 1
559
+
560
+#endif // #ifndef TRICE_LEAVE
561
+
562
+#ifndef TRICE_PUT
563
+
564
+//! TRICE_PUT writes x as 32-bit value into the Trice buffer without changing the endianness.
565
+//! This macro does not use internally TRICE_HTOTL and therefore it is usable without speed loss, when TRICE_REVERSE == 1.
566
+//! In that case the byte order needs to be provided by the written code.
567
+#define TRICE_PUT(x)              \
568
+    do {                                 \
569
+        *TriceBufferWritePosition++ = x; \
570
+    } while (0);
571
+
572
+#endif
573
+
574
+#ifndef TRICE_PUT_BUFFER
575
+
576
+//! TRICE_PUT_BUFFER copies a buffer into the TRICE buffer.
577
+#define TRICE_PUT_BUFFER(buf, len)                                                               \
578
+        do {                                                                                         \
579
+            memcpy(TriceBufferWritePosition, buf, len);                                              \
580
+            unsigned len4 = ((unsigned)len + 3) & ~3;                                                \
581
+            memset((uint8_t*)TriceBufferWritePosition + len, 0, len4 - len); /*clear padding space*/ \
582
+            TriceBufferWritePosition += len4 >> 2;                                                   \
583
+        } while (0)
584
+
585
+#endif
586
+
587
+// clang-format on
588
+
589
+///////////////////////////////////////////////////////////////////////////////
590
+// TRICE macros
591
+//
592
+
593
+#define TRICE_0 TRICE0 //!< Only the format string without parameter values.
594
+#define TRice_0 TRice0 //!< Only the format string without parameter values.
595
+#define Trice_0 Trice0 //!< Only the format string without parameter values.
596
+#define trice_0 trice0 //!< Only the format string without parameter values.
597
+
598
+#ifndef TRICE_N
599
+
600
+//! TRICE_N writes id and buffer of size len.
601
+//! \param tid trice identifier
602
+//! \param pFmt formatstring for trice (ignored here but used by the trice tool), could contain any add on information. The trice tool "sees" the "TRICE_N" and can handle that.
603
+//! \param dynString 0-terminated runtime generated string
604
+//!     After the 4 byte trice message header are following 4 bytes coding n (only 2 used) and the buffer
605
+//!     transfer format:
606
+//!     idH    idL    len    cycle <- trice header
607
+//!     n0     n1     n2     n3    <- payload count without paddings bytes (transmittable len)
608
+//!     c0     c1     c2     c3    <- buffer
609
+//!     ...                        <- buffer
610
+//!     cLen-3 cLen-2 cLen-1 cLen  <- buffer ending with maybe 1-3 undetermined padding bytes
611
+//!
612
+//! todo: for some reason this macro is not working well wit name len instead of len_, probably when injected len as value.
613
+//!
614
+#define TRICE_N(tid, pFmt, buf, n)                                                                                                   \
615
+    do {                                                                                                                             \
616
+        TRICE_UNUSED(pFmt);                                                                                                          \
617
+        uint32_t limit = TRICE_SINGLE_MAX_SIZE - 12; /* 12 = head(2) + max timestamp size(4) + count(2) + max 3 zeroes, we take 4 */ \
618
+        uint32_t len_ = n;                           /* n could be a constant */                                                     \
619
+        if (len_ > limit) {                                                                                                          \
620
+            TRICE_DYN_STRG_BUF_TRUNCATE_COUNT_INCREMENT();                                                                                \
621
+            len_ = limit;                                                                                                            \
622
+        }                                                                                                                            \
623
+        TRICE_ENTER tid;                                                                                                             \
624
+        if (len_ <= 127) {                                                                                                           \
625
+            TRICE_CNTC(len_);                                                                                                        \
626
+        } else {                                                                                                                     \
627
+            TRICE_LCNT(len_);                                                                                                        \
628
+        }                                                                                                                            \
629
+        TRICE_PUT_BUFFER(buf, len_);                                                                                                 \
630
+        TRICE_LEAVE                                                                                                                  \
631
+    } while (0)
632
+
633
+void triceN(int tid, char* fmt, void* buf, uint32_t n);
634
+void TriceN(int tid, char* fmt, void* buf, uint32_t n);
635
+void TRiceN(int tid, char* fmt, void* buf, uint32_t n);
636
+
637
+void trice8B(int tid, char* fmt, void* buf, uint32_t n);
638
+void Trice8B(int tid, char* fmt, void* buf, uint32_t n);
639
+void TRice8B(int tid, char* fmt, void* buf, uint32_t n);
640
+
641
+void trice16B(int tid, char* fmt, void* buf, uint32_t n);
642
+void Trice16B(int tid, char* fmt, void* buf, uint32_t n);
643
+void TRice16B(int tid, char* fmt, void* buf, uint32_t n);
644
+
645
+void trice32B(int tid, char* fmt, void* buf, uint32_t n);
646
+void Trice32B(int tid, char* fmt, void* buf, uint32_t n);
647
+void TRice32B(int tid, char* fmt, void* buf, uint32_t n);
648
+
649
+void trice64B(int tid, char* fmt, void* buf, uint32_t n);
650
+void Trice64B(int tid, char* fmt, void* buf, uint32_t n);
651
+void TRice64B(int tid, char* fmt, void* buf, uint32_t n);
652
+
653
+void trice8F(int tid, char* fmt, void* buf, uint32_t n);
654
+void Trice8F(int tid, char* fmt, void* buf, uint32_t n);
655
+void TRice8F(int tid, char* fmt, void* buf, uint32_t n);
656
+
657
+void trice16F(int tid, char* fmt, void* buf, uint32_t n);
658
+void Trice16F(int tid, char* fmt, void* buf, uint32_t n);
659
+void TRice16F(int tid, char* fmt, void* buf, uint32_t n);
660
+
661
+void trice32F(int tid, char* fmt, void* buf, uint32_t n);
662
+void Trice32F(int tid, char* fmt, void* buf, uint32_t n);
663
+void TRice32F(int tid, char* fmt, void* buf, uint32_t n);
664
+
665
+void trice64F(int tid, char* fmt, void* buf, uint32_t n);
666
+void Trice64F(int tid, char* fmt, void* buf, uint32_t n);
667
+void TRice64F(int tid, char* fmt, void* buf, uint32_t n);
668
+
669
+#endif // #ifndef TRICE_N
670
+
671
+#ifndef TRICE_S
672
+
673
+//! TRICE_S writes id and runtimeGeneratedString.
674
+//! \param tid trice identifier
675
+//! \param pFmt format string for trice (ignored here but used by the trice tool)
676
+//! \param runtimeGeneratedString 0-terminated runtime generated string
677
+#define TRICE_S(tid, pFmt, runtimeGeneratedString)        \
678
+    do {                                                  \
679
+        uint32_t ssiz = strlen(runtimeGeneratedString);   \
680
+        TRICE_N(tid, pFmt, runtimeGeneratedString, ssiz); \
681
+    } while (0)
682
+
683
+void triceS(int tid, char* fmt, char* runtimeGeneratedString);
684
+void TriceS(int tid, char* fmt, char* runtimeGeneratedString);
685
+void TRiceS(int tid, char* fmt, char* runtimeGeneratedString);
686
+
687
+#endif // #ifndef TRICE_S
688
+
689
+//! ID writes 14-bit id with 11 as 2 most significant bits, followed by a 32-bit stamp.
690
+//! 11iiiiiiI TT | TT (NC) | ...
691
+//! C000 = 1100 0000 0000 0000
692
+#define ID(n)                                 \
693
+    do {                                      \
694
+        uint32_t ts = TriceStamp32;           \
695
+        TRICE_PUT16_1616((0xC000 | (n)), ts); \
696
+    } while (0)
697
+
698
+//! Id writes 14-bit id with 10 as 2 most significant bits two times, followed by a 16-bit stamp.
699
+//! 10iiiiiiI 10iiiiiiI | TT (NC) | ...
700
+//! 8000 = 1000 0000 0000 0000
701
+#define Id(n)                                                   \
702
+    do {                                                        \
703
+        uint16_t ts = TriceStamp16;                             \
704
+        TRICE_PUT(TRICE_HTOTL(0x80008000 | ((n) << 16) | (n))); \
705
+        TRICE_PUT16(ts);                                        \
706
+    } while (0)
707
+
708
+//! id writes 14-bit id with 01 as 2 most significant bits, followed by no stamp.
709
+//! 01iiiiiiI (NC) | ...
710
+//! 4000 = 0100 0000 0000 0000
711
+#define id(n) TRICE_PUT16(0x4000 | (n));
712
+
713
+//! iD is just a code parsing helper.
714
+#define iD(n) (n)
715
+
716
+//! TRICE_CNTC writes 7-bit byte count and 8-bit cycle counter.
717
+#define TRICE_CNTC(count)                          \
718
+    do {                                           \
719
+        uint16_t v = ((count) << 8) | TRICE_CYCLE; \
720
+        TRICE_PUT16(v);                            \
721
+    } while (0)
722
+
723
+#if TRICE_CYCLE_COUNTER == 1
724
+
725
+//! TRICE_LCNT writes 1 as most significant bit and 15-bit byte count. It does not write the cycle counter but increments the cycle counter.
726
+#define TRICE_LCNT(count)            \
727
+    TRICE_PUT16((0x8000 | (count))); \
728
+    TRICE_CYCLE // increment TRICE_CYCLE but do not transmit it
729
+
730
+#else
731
+
732
+//! TRICE_LCNT writes 1 as most significant bit and 15-bit byte count. It does not write the cycle counter but increments the cycle counter.
733
+#define TRICE_LCNT(count) TRICE_PUT16((0x8000 | (count))); // no TRICE_CYCLE
734
+
735
+#endif
736
+
737
+//! TRICE0 writes trice data as fast as possible in a buffer.
738
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
739
+#define TRICE0(tid, pFmt) \
740
+    TRICE_ENTER tid;      \
741
+    TRICE_CNTC(0);        \
742
+    TRICE_LEAVE
743
+
744
+TRICE_INLINE void trice0(uint16_t tid, const char* pFmt)
745
+{
746
+    trice32m_0(tid);
747
+    TRICE_UNUSED(pFmt)
748
+}
749
+
750
+TRICE_INLINE void Trice0(uint16_t tid, const char *pFmt)
751
+{
752
+    Trice32m_0(tid);
753
+    TRICE_UNUSED(pFmt)
754
+}
755
+
756
+TRICE_INLINE void TRice0(uint16_t tid, const char *pFmt)
757
+{
758
+    TRice32m_0(tid);
759
+    TRICE_UNUSED(pFmt)
760
+}
761
+
762
+void triceAssertTrue(int idN, char *msg, int flag);
763
+void TriceAssertTrue(int idN, char *msg, int flag);
764
+void TRiceAssertTrue(int idN, char *msg, int flag);
765
+
766
+void triceAssertFalse(int idN, char *msg, int flag);
767
+void TriceAssertFalse(int idN, char *msg, int flag);
768
+void TRiceAssertFalse(int idN, char *msg, int flag);
769
+
770
+typedef void (*Write8AuxiliaryFn_t)(const uint8_t *enc, size_t encLen);
771
+extern Write8AuxiliaryFn_t UserNonBlockingDirectWrite8AuxiliaryFn;
772
+extern Write8AuxiliaryFn_t UserNonBlockingDeferredWrite8AuxiliaryFn;
773
+
774
+typedef void (*Write32AuxiliaryFn_t)(const uint32_t *enc, unsigned count);
775
+extern Write32AuxiliaryFn_t UserNonBlockingDirectWrite32AuxiliaryFn;
776
+extern Write32AuxiliaryFn_t UserNonBlockingDeferredWrite32AuxiliaryFn;
777
+
778
+/**/
779
+/**/
780
+/***************************************************************************************************/
781
+#endif // #else // #if ((defined(TRICE_OFF) && TRICE_OFF == 1)) || ((defined(TRICE_CLEAN) && TRICE_CLEAN == 1))
782
+
783
+#ifdef __cplusplus
784
+}
785
+#endif
786
+
787
+#endif // TRICE_H_

+ 560
- 0
Middlewares/trice/trice16.c Переглянути файл

@@ -0,0 +1,560 @@
1
+//! \file trice16.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//! ///////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+// lint -e529  Warning 529: Symbol '_SEGGER_RTT__LockState' not subsequently referenced
7
+// lint -e701  Info 701: Shift left of signed quantity (int)
8
+
9
+#if TRICE_16_BIT_SUPPORT == 1 && TRICE_OFF == 0
10
+
11
+// no-stamp 16-bit values functions
12
+#ifndef ENABLE_trice16fn_0
13
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 0 * 2) + 3) & ~3)
14
+#define ENABLE_trice16fn_0 0 //!< Disables no-stamp 16-bit 0 values functions.
15
+#else
16
+#define ENABLE_trice16fn_0 1 //!< Enables  no-stamp 16-bit 0 values functions.
17
+#endif
18
+#endif
19
+
20
+#ifndef ENABLE_trice16fn_1
21
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 1 * 2) + 3) & ~3)
22
+#define ENABLE_trice16fn_1 0 //!< Disables no-stamp 16-bit 1 values functions.
23
+#else
24
+#define ENABLE_trice16fn_1 1 //!< Enables  no-stamp 16-bit 1 values functions.
25
+#endif
26
+#endif
27
+
28
+#ifndef ENABLE_trice16fn_2
29
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 2 * 2) + 3) & ~3)
30
+#define ENABLE_trice16fn_2 0 //!< Disables no-stamp 16-bit 2 values functions.
31
+#else
32
+#define ENABLE_trice16fn_2 1 //!< Enables  no-stamp 16-bit 2 values functions.
33
+#endif
34
+#endif
35
+
36
+#ifndef ENABLE_trice16fn_3
37
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 3 * 2) + 3) & ~3)
38
+#define ENABLE_trice16fn_3 0 //!< Disables no-stamp 16-bit 3 values functions.
39
+#else
40
+#define ENABLE_trice16fn_3 1 //!< Enables  no-stamp 16-bit 3 values functions.
41
+#endif
42
+#endif
43
+
44
+#ifndef ENABLE_trice16fn_4
45
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 4 * 2) + 3) & ~3)
46
+#define ENABLE_trice16fn_4 0 //!< Disables no-stamp 16-bit 4 values functions.
47
+#else
48
+#define ENABLE_trice16fn_4 1 //!< Enables  no-stamp 16-bit 4 values functions.
49
+#endif
50
+#endif
51
+
52
+#ifndef ENABLE_trice16fn_5
53
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 5 * 2) + 3) & ~3)
54
+#define ENABLE_trice16fn_5 0 //!< Disables no-stamp 16-bit 5 values functions.
55
+#else
56
+#define ENABLE_trice16fn_5 1 //!< Enables  no-stamp 16-bit 5 values functions.
57
+#endif
58
+#endif
59
+
60
+#ifndef ENABLE_trice16fn_6
61
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 6 * 2) + 3) & ~3)
62
+#define ENABLE_trice16fn_6 0 //!< Disables no-stamp 16-bit 6 values functions.
63
+#else
64
+#define ENABLE_trice16fn_6 1 //!< Enables  no-stamp 16-bit 6 values functions.
65
+#endif
66
+#endif
67
+
68
+#ifndef ENABLE_trice16fn_7
69
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 7 * 2) + 3) & ~3)
70
+#define ENABLE_trice16fn_7 0 //!< Disables no-stamp 16-bit 7 values functions.
71
+#else
72
+#define ENABLE_trice16fn_7 1 //!< Enables  no-stamp 16-bit 7 values functions.
73
+#endif
74
+#endif
75
+
76
+#ifndef ENABLE_trice16fn_8
77
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 8 * 2) + 3) & ~3)
78
+#define ENABLE_trice16fn_8 0 //!< Disables no-stamp 16-bit 8 values functions.
79
+#else
80
+#define ENABLE_trice16fn_8 1 //!< Enables  no-stamp 16-bit 8 values functions.
81
+#endif
82
+#endif
83
+
84
+#ifndef ENABLE_trice16fn_9
85
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 9 * 2) + 3) & ~3)
86
+#define ENABLE_trice16fn_9 0 //!< Disables no-stamp 16-bit 9 values functions.
87
+#else
88
+#define ENABLE_trice16fn_9 1 //!< Enables  no-stamp 16-bit 9 values functions.
89
+#endif
90
+#endif
91
+
92
+#ifndef ENABLE_trice16fn_10
93
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 10 * 2) + 3) & ~3)
94
+#define ENABLE_trice16fn_10 0 //!< Disables no-stamp 16-bit 10 values functions.
95
+#else
96
+#define ENABLE_trice16fn_10 1 //!< Enables  no-stamp 16-bit 10 values functions.
97
+#endif
98
+#endif
99
+
100
+#ifndef ENABLE_trice16fn_11
101
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 11 * 2) + 3) & ~3)
102
+#define ENABLE_trice16fn_11 0 //!< Disables no-stamp 16-bit 11 values functions.
103
+#else
104
+#define ENABLE_trice16fn_11 1 //!< Enables  no-stamp 16-bit 11 values functions.
105
+#endif
106
+#endif
107
+
108
+#ifndef ENABLE_trice16fn_12
109
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 12 * 2) + 3) & ~3)
110
+#define ENABLE_trice16fn_12 0 //!< Disables no-stamp 16-bit 12 values functions.
111
+#else
112
+#define ENABLE_trice16fn_12 1 //!< Enables  no-stamp 16-bit 12 values functions.
113
+#endif
114
+#endif
115
+
116
+// with 16-bit-stamp 16-bit values functions (16-bit-stamps need 4 bytes for allocation reasons)
117
+#ifndef ENABLE_Trice16fn_0
118
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 2) + 3) & ~3)
119
+#define ENABLE_Trice16fn_0 0 //!< Disables 16-bit-stamp 16-bit 0 values functions.
120
+#else
121
+#define ENABLE_Trice16fn_0 1 //!< Enables  16-bit-stamp 16-bit 0 values functions.
122
+#endif
123
+#endif
124
+
125
+#ifndef ENABLE_Trice16fn_1
126
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 2) + 3) & ~3)
127
+#define ENABLE_Trice16fn_1 0 //!< Disables 16-bit-stamp 16-bit 1 values functions.
128
+#else
129
+#define ENABLE_Trice16fn_1 1 //!< Enables  16-bit-stamp 16-bit 1 values functions.
130
+#endif
131
+#endif
132
+
133
+#ifndef ENABLE_Trice16fn_2
134
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 2) + 3) & ~3)
135
+#define ENABLE_Trice16fn_2 0 //!< Disables 16-bit-stamp 16-bit 2 values functions.
136
+#else
137
+#define ENABLE_Trice16fn_2 1 //!< Enables  16-bit-stamp 16-bit 2 values functions.
138
+#endif
139
+#endif
140
+
141
+#ifndef ENABLE_Trice16fn_3
142
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 2) + 3) & ~3)
143
+#define ENABLE_Trice16fn_3 0 //!< Disables 16-bit-stamp 16-bit 3 values functions.
144
+#else
145
+#define ENABLE_Trice16fn_3 1 //!< Enables  16-bit-stamp 16-bit 3 values functions.
146
+#endif
147
+#endif
148
+
149
+#ifndef ENABLE_Trice16fn_4
150
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 2) + 3) & ~3)
151
+#define ENABLE_Trice16fn_4 0 //!< Disables 16-bit-stamp 16-bit 4 values functions.
152
+#else
153
+#define ENABLE_Trice16fn_4 1 //!< Enables  16-bit-stamp 16-bit 4 values functions.
154
+#endif
155
+#endif
156
+
157
+#ifndef ENABLE_Trice16fn_5
158
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 2) + 3) & ~3)
159
+#define ENABLE_Trice16fn_5 0 //!< Disables 16-bit-stamp 16-bit 5 values functions.
160
+#else
161
+#define ENABLE_Trice16fn_5 1 //!< Enables  16-bit-stamp 16-bit 5 values functions.
162
+#endif
163
+#endif
164
+
165
+#ifndef ENABLE_Trice16fn_6
166
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 2) + 3) & ~3)
167
+#define ENABLE_Trice16fn_6 0 //!< Disables 16-bit-stamp 16-bit 6 values functions.
168
+#else
169
+#define ENABLE_Trice16fn_6 1 //!< Enables  16-bit-stamp 16-bit 6 values functions.
170
+#endif
171
+#endif
172
+
173
+#ifndef ENABLE_Trice16fn_7
174
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 2) + 3) & ~3)
175
+#define ENABLE_Trice16fn_7 0 //!< Disables 16-bit-stamp 16-bit 7 values functions.
176
+#else
177
+#define ENABLE_Trice16fn_7 1 //!< Enables  16-bit-stamp 16-bit 7 values functions.
178
+#endif
179
+#endif
180
+
181
+#ifndef ENABLE_Trice16fn_8
182
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 2) + 3) & ~3)
183
+#define ENABLE_Trice16fn_8 0 //!< Disables 16-bit-stamp 16-bit 8 values functions.
184
+#else
185
+#define ENABLE_Trice16fn_8 1 //!< Enables  16-bit-stamp 16-bit 8 values functions.
186
+#endif
187
+#endif
188
+
189
+#ifndef ENABLE_Trice16fn_9
190
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 2) + 3) & ~3)
191
+#define ENABLE_Trice16fn_9 0 //!< Disables 16-bit-stamp 16-bit 9 values functions.
192
+#else
193
+#define ENABLE_Trice16fn_9 1 //!< Enables  16-bit-stamp 16-bit 9 values functions.
194
+#endif
195
+#endif
196
+
197
+#ifndef ENABLE_Trice16fn_10
198
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 2) + 3) & ~3)
199
+#define ENABLE_Trice16fn_10 0 //!< Disables 16-bit-stamp 16-bit 10 values functions.
200
+#else
201
+#define ENABLE_Trice16fn_10 1 //!< Enables  16-bit-stamp 16-bit 10 values functions.
202
+#endif
203
+#endif
204
+
205
+#ifndef ENABLE_Trice16fn_11
206
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 2) + 3) & ~3)
207
+#define ENABLE_Trice16fn_11 0 //!< Disables 16-bit-stamp 16-bit 11 values functions.
208
+#else
209
+#define ENABLE_Trice16fn_11 1 //!< Enables  16-bit-stamp 16-bit 11 values functions.
210
+#endif
211
+#endif
212
+
213
+#ifndef ENABLE_Trice16fn_12
214
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 2) + 3) & ~3)
215
+#define ENABLE_Trice16fn_12 0 //!< Disables 16-bit-stamp 16-bit 12 values functions.
216
+#else
217
+#define ENABLE_Trice16fn_12 1 //!< Enables  16-bit-stamp 16-bit 12 values functions.
218
+#endif
219
+#endif
220
+
221
+// with 32-bit-stamp 16-bit values functions
222
+#ifndef ENABLE_TRice16fn_0
223
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 2) + 3) & ~3)
224
+#define ENABLE_TRice16fn_0 0 //!< Disables 32-bit-stamp 16-bit 0 values functions.
225
+#else
226
+#define ENABLE_TRice16fn_0 1 //!< Enables  32-bit-stamp 16-bit 0 values functions.
227
+#endif
228
+#endif
229
+
230
+#ifndef ENABLE_TRice16fn_1
231
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 2) + 3) & ~3)
232
+#define ENABLE_TRice16fn_1 0 //!< Disables 32-bit-stamp 16-bit 1 values functions.
233
+#else
234
+#define ENABLE_TRice16fn_1 1 //!< Enables  32-bit-stamp 16-bit 1 values functions.
235
+#endif
236
+#endif
237
+
238
+#ifndef ENABLE_TRice16fn_2
239
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 2) + 3) & ~3)
240
+#define ENABLE_TRice16fn_2 0 //!< Disables 32-bit-stamp 16-bit 2 values functions.
241
+#else
242
+#define ENABLE_TRice16fn_2 1 //!< Enables  32-bit-stamp 16-bit 2 values functions.
243
+#endif
244
+#endif
245
+
246
+#ifndef ENABLE_TRice16fn_3
247
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 2) + 3) & ~3)
248
+#define ENABLE_TRice16fn_3 0 //!< Disables 32-bit-stamp 16-bit 3 values functions.
249
+#else
250
+#define ENABLE_TRice16fn_3 1 //!< Enables  32-bit-stamp 16-bit 3 values functions.
251
+#endif
252
+#endif
253
+
254
+#ifndef ENABLE_TRice16fn_4
255
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 2) + 3) & ~3)
256
+#define ENABLE_TRice16fn_4 0 //!< Disables 32-bit-stamp 16-bit 4 values functions.
257
+#else
258
+#define ENABLE_TRice16fn_4 1 //!< Enables  32-bit-stamp 16-bit 4 values functions.
259
+#endif
260
+#endif
261
+
262
+#ifndef ENABLE_TRice16fn_5
263
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 2) + 3) & ~3)
264
+#define ENABLE_TRice16fn_5 0 //!< Disables 32-bit-stamp 16-bit 5 values functions.
265
+#else
266
+#define ENABLE_TRice16fn_5 1 //!< Enables  32-bit-stamp 16-bit 5 values functions.
267
+#endif
268
+#endif
269
+
270
+#ifndef ENABLE_TRice16fn_6
271
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 2) + 3) & ~3)
272
+#define ENABLE_TRice16fn_6 0 //!< Disables 32-bit-stamp 16-bit 6 values functions.
273
+#else
274
+#define ENABLE_TRice16fn_6 1 //!< Enables  32-bit-stamp 16-bit 6 values functions.
275
+#endif
276
+#endif
277
+
278
+#ifndef ENABLE_TRice16fn_7
279
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 2) + 3) & ~3)
280
+#define ENABLE_TRice16fn_7 0 //!< Disables 32-bit-stamp 16-bit 7 values functions.
281
+#else
282
+#define ENABLE_TRice16fn_7 1 //!< Enables  32-bit-stamp 16-bit 7 values functions.
283
+#endif
284
+#endif
285
+
286
+#ifndef ENABLE_TRice16fn_8
287
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 2) + 3) & ~3)
288
+#define ENABLE_TRice16fn_8 0 //!< Disables 32-bit-stamp 16-bit 8 values functions.
289
+#else
290
+#define ENABLE_TRice16fn_8 1 //!< Enables  32-bit-stamp 16-bit 8 values functions.
291
+#endif
292
+#endif
293
+
294
+#ifndef ENABLE_TRice16fn_9
295
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 2) + 3) & ~3)
296
+#define ENABLE_TRice16fn_9 0 //!< Disables 32-bit-stamp 16-bit 9 values functions.
297
+#else
298
+#define ENABLE_TRice16fn_9 1 //!< Enables  32-bit-stamp 16-bit 9 values functions.
299
+#endif
300
+#endif
301
+
302
+#ifndef ENABLE_TRice16fn_10
303
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 2) + 3) & ~3)
304
+#define ENABLE_TRice16fn_10 0 //!< Disables 32-bit-stamp 16-bit 10 values functions.
305
+#else
306
+#define ENABLE_TRice16fn_10 1 //!< Enables  32-bit-stamp 16-bit 10 values functions.
307
+#endif
308
+#endif
309
+
310
+#ifndef ENABLE_TRice16fn_11
311
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 2) + 3) & ~3)
312
+#define ENABLE_TRice16fn_11 0 //!< Disables 32-bit-stamp 16-bit 11 values functions.
313
+#else
314
+#define ENABLE_TRice16fn_11 1 //!< Enables  32-bit-stamp 16-bit 11 values functions.
315
+#endif
316
+#endif
317
+
318
+#ifndef ENABLE_TRice16fn_12
319
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 2) + 3) & ~3)
320
+#define ENABLE_TRice16fn_12 0 //!< Disables 32-bit-stamp 16-bit 12 values functions.
321
+#else
322
+#define ENABLE_TRice16fn_12 1 //!< Enables  32-bit-stamp 16-bit 12 values functions.
323
+#endif
324
+#endif
325
+
326
+#if ENABLE_trice16fn_0
327
+void trice16fn_0(uint16_t tid) {
328
+	trice16m_0(tid);
329
+}
330
+#endif
331
+
332
+#if ENABLE_trice16fn_1
333
+void trice16fn_1(uint16_t tid, uint16_t v0) {
334
+	trice16m_1(tid, v0);
335
+}
336
+#endif
337
+
338
+#if ENABLE_trice16fn_2
339
+void trice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1) {
340
+	trice16m_2(tid, v0, v1);
341
+}
342
+#endif
343
+
344
+#if ENABLE_trice16fn_3
345
+void trice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2) {
346
+	trice16m_3(tid, v0, v1, v2);
347
+}
348
+#endif
349
+
350
+#if ENABLE_trice16fn_4
351
+void trice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3) {
352
+	trice16m_4(tid, v0, v1, v2, v3);
353
+}
354
+#endif
355
+
356
+#if ENABLE_trice16fn_5
357
+void trice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4) {
358
+	trice16m_5(tid, v0, v1, v2, v3, v4);
359
+}
360
+#endif
361
+
362
+#if ENABLE_trice16fn_6
363
+void trice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5) {
364
+	trice16m_6(tid, v0, v1, v2, v3, v4, v5);
365
+}
366
+#endif
367
+
368
+#if ENABLE_trice16fn_7
369
+void trice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6) {
370
+	trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6);
371
+}
372
+#endif
373
+
374
+#if ENABLE_trice16fn_8
375
+void trice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7) {
376
+	trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
377
+}
378
+#endif
379
+
380
+#if ENABLE_trice16fn_9
381
+void trice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8) {
382
+	trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
383
+}
384
+#endif
385
+
386
+#if ENABLE_trice16fn_10
387
+void trice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9) {
388
+	trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
389
+}
390
+#endif
391
+
392
+#if ENABLE_trice16fn_11
393
+void trice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10) {
394
+	trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
395
+}
396
+#endif
397
+
398
+#if ENABLE_trice16fn_12
399
+void trice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11) {
400
+	trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
401
+}
402
+#endif
403
+
404
+#if ENABLE_Trice16fn_0
405
+void Trice16fn_0(uint16_t tid) {
406
+	Trice16m_0(tid);
407
+}
408
+#endif
409
+
410
+#if ENABLE_Trice16fn_1
411
+void Trice16fn_1(uint16_t tid, uint16_t v0) {
412
+	Trice16m_1(tid, v0);
413
+}
414
+#endif
415
+
416
+#if ENABLE_Trice16fn_2
417
+void Trice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1) {
418
+	Trice16m_2(tid, v0, v1);
419
+}
420
+#endif
421
+
422
+#if ENABLE_Trice16fn_3
423
+void Trice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2) {
424
+	Trice16m_3(tid, v0, v1, v2);
425
+}
426
+#endif
427
+
428
+#if ENABLE_Trice16fn_4
429
+void Trice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3) {
430
+	Trice16m_4(tid, v0, v1, v2, v3);
431
+}
432
+#endif
433
+
434
+#if ENABLE_Trice16fn_5
435
+void Trice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4) {
436
+	Trice16m_5(tid, v0, v1, v2, v3, v4);
437
+}
438
+#endif
439
+
440
+#if ENABLE_Trice16fn_6
441
+void Trice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5) {
442
+	Trice16m_6(tid, v0, v1, v2, v3, v4, v5);
443
+}
444
+#endif
445
+
446
+#if ENABLE_Trice16fn_7
447
+void Trice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6) {
448
+	Trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6);
449
+}
450
+#endif
451
+
452
+#if ENABLE_Trice16fn_8
453
+void Trice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7) {
454
+	Trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
455
+}
456
+#endif
457
+
458
+#if ENABLE_Trice16fn_9
459
+void Trice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8) {
460
+	Trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
461
+}
462
+#endif
463
+
464
+#if ENABLE_Trice16fn_10
465
+void Trice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9) {
466
+	Trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
467
+}
468
+#endif
469
+
470
+#if ENABLE_Trice16fn_11
471
+void Trice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10) {
472
+	Trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
473
+}
474
+#endif
475
+
476
+#if ENABLE_Trice16fn_12
477
+void Trice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11) {
478
+	Trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
479
+}
480
+#endif
481
+
482
+#if ENABLE_TRice16fn_0
483
+void TRice16fn_0(uint16_t tid) {
484
+	TRice16m_0(tid);
485
+}
486
+#endif
487
+
488
+#if ENABLE_TRice16fn_1
489
+void TRice16fn_1(uint16_t tid, uint16_t v0) {
490
+	TRice16m_1(tid, v0);
491
+}
492
+#endif
493
+
494
+#if ENABLE_TRice16fn_2
495
+void TRice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1) {
496
+	TRice16m_2(tid, v0, v1);
497
+}
498
+#endif
499
+
500
+#if ENABLE_TRice16fn_3
501
+void TRice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2) {
502
+	TRice16m_3(tid, v0, v1, v2);
503
+}
504
+#endif
505
+
506
+#if ENABLE_TRice16fn_4
507
+void TRice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3) {
508
+	TRice16m_4(tid, v0, v1, v2, v3);
509
+}
510
+#endif
511
+
512
+#if ENABLE_TRice16fn_5
513
+void TRice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4) {
514
+	TRice16m_5(tid, v0, v1, v2, v3, v4);
515
+}
516
+#endif
517
+
518
+#if ENABLE_TRice16fn_6
519
+void TRice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5) {
520
+	TRice16m_6(tid, v0, v1, v2, v3, v4, v5);
521
+}
522
+#endif
523
+
524
+#if ENABLE_TRice16fn_7
525
+void TRice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6) {
526
+	TRice16m_7(tid, v0, v1, v2, v3, v4, v5, v6);
527
+}
528
+#endif
529
+
530
+#if ENABLE_TRice16fn_8
531
+void TRice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7) {
532
+	TRice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
533
+}
534
+#endif
535
+
536
+#if ENABLE_TRice16fn_9
537
+void TRice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8) {
538
+	TRice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
539
+}
540
+#endif
541
+
542
+#if ENABLE_TRice16fn_10
543
+void TRice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9) {
544
+	TRice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
545
+}
546
+#endif
547
+
548
+#if ENABLE_TRice16fn_11
549
+void TRice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10) {
550
+	TRice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
551
+}
552
+#endif
553
+
554
+#if ENABLE_TRice16fn_12
555
+void TRice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11) {
556
+	TRice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
557
+}
558
+#endif
559
+
560
+#endif // #if TRICE_16_BIT_SUPPORT == 1 && TRICE_OFF == 0

+ 265
- 0
Middlewares/trice/trice16.h Переглянути файл

@@ -0,0 +1,265 @@
1
+/*! \file internalTrice16.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 16
6
+
7
+// #define TRICE_0  TRICE16_0  //!< Default parameter bit width for 0  parameter count TRICE is 16.
8
+#define TRICE_1 TRICE16_1   //!< Default parameter bit width for 1  parameter count TRICE is 16.
9
+#define TRICE_2 TRICE16_2   //!< Default parameter bit width for 2  parameter count TRICE is 16.
10
+#define TRICE_3 TRICE16_3   //!< Default parameter bit width for 3  parameter count TRICE is 16.
11
+#define TRICE_4 TRICE16_4   //!< Default parameter bit width for 4  parameter count TRICE is 16.
12
+#define TRICE_5 TRICE16_5   //!< Default parameter bit width for 5  parameter count TRICE is 16.
13
+#define TRICE_6 TRICE16_6   //!< Default parameter bit width for 6  parameter count TRICE is 16.
14
+#define TRICE_7 TRICE16_7   //!< Default parameter bit width for 7  parameter count TRICE is 16.
15
+#define TRICE_8 TRICE16_8   //!< Default parameter bit width for 8  parameter count TRICE is 16.
16
+#define TRICE_9 TRICE16_9   //!< Default parameter bit width for 9  parameter count TRICE is 16.
17
+#define TRICE_10 TRICE16_10 //!< Default parameter bit width for 10 parameter count TRICE is 16.
18
+#define TRICE_11 TRICE16_11 //!< Default parameter bit width for 11 parameter count TRICE is 16.
19
+#define TRICE_12 TRICE16_12 //!< Default parameter bit width for 12 parameter count TRICE is 16.
20
+
21
+// #define trice_0  trice16_0  //!< Default parameter bit width for 0  parameter count trice is 16.
22
+#define trice_1 trice16_1   //!< Default parameter bit width for 1  parameter count trice is 16.
23
+#define trice_2 trice16_2   //!< Default parameter bit width for 2  parameter count trice is 16.
24
+#define trice_3 trice16_3   //!< Default parameter bit width for 3  parameter count trice is 16.
25
+#define trice_4 trice16_4   //!< Default parameter bit width for 4  parameter count trice is 16.
26
+#define trice_5 trice16_5   //!< Default parameter bit width for 5  parameter count trice is 16.
27
+#define trice_6 trice16_6   //!< Default parameter bit width for 6  parameter count trice is 16.
28
+#define trice_7 trice16_7   //!< Default parameter bit width for 7  parameter count trice is 16.
29
+#define trice_8 trice16_8   //!< Default parameter bit width for 8  parameter count trice is 16.
30
+#define trice_9 trice16_9   //!< Default parameter bit width for 9  parameter count trice is 16.
31
+#define trice_10 trice16_10 //!< Default parameter bit width for 10 parameter count trice is 16.
32
+#define trice_11 trice16_11 //!< Default parameter bit width for 11 parameter count trice is 16.
33
+#define trice_12 trice16_12 //!< Default parameter bit width for 12 parameter count trice is 16.
34
+
35
+// #define Trice_0  Trice16_0  //!< Default parameter bit width for 0  parameter count Trice is 16.
36
+#define Trice_1 Trice16_1   //!< Default parameter bit width for 1  parameter count Trice is 16.
37
+#define Trice_2 Trice16_2   //!< Default parameter bit width for 2  parameter count Trice is 16.
38
+#define Trice_3 Trice16_3   //!< Default parameter bit width for 3  parameter count Trice is 16.
39
+#define Trice_4 Trice16_4   //!< Default parameter bit width for 4  parameter count Trice is 16.
40
+#define Trice_5 Trice16_5   //!< Default parameter bit width for 5  parameter count Trice is 16.
41
+#define Trice_6 Trice16_6   //!< Default parameter bit width for 6  parameter count Trice is 16.
42
+#define Trice_7 Trice16_7   //!< Default parameter bit width for 7  parameter count Trice is 16.
43
+#define Trice_8 Trice16_8   //!< Default parameter bit width for 8  parameter count Trice is 16.
44
+#define Trice_9 Trice16_9   //!< Default parameter bit width for 9  parameter count Trice is 16.
45
+#define Trice_10 Trice16_10 //!< Default parameter bit width for 10 parameter count Trice is 16.
46
+#define Trice_11 Trice16_11 //!< Default parameter bit width for 11 parameter count Trice is 16.
47
+#define Trice_12 Trice16_12 //!< Default parameter bit width for 12 parameter count Trice is 16.
48
+
49
+// #define TRice_0  TRice16_0  //!< Default parameter bit width for 0  parameter count TRice is 16.
50
+#define TRice_1 TRice16_1   //!< Default parameter bit width for 1  parameter count TRice is 16.
51
+#define TRice_2 TRice16_2   //!< Default parameter bit width for 2  parameter count TRice is 16.
52
+#define TRice_3 TRice16_3   //!< Default parameter bit width for 3  parameter count TRice is 16.
53
+#define TRice_4 TRice16_4   //!< Default parameter bit width for 4  parameter count TRice is 16.
54
+#define TRice_5 TRice16_5   //!< Default parameter bit width for 5  parameter count TRice is 16.
55
+#define TRice_6 TRice16_6   //!< Default parameter bit width for 6  parameter count TRice is 16.
56
+#define TRice_7 TRice16_7   //!< Default parameter bit width for 7  parameter count TRice is 16.
57
+#define TRice_8 TRice16_8   //!< Default parameter bit width for 8  parameter count TRice is 16.
58
+#define TRice_9 TRice16_9   //!< Default parameter bit width for 9  parameter count TRice is 16.
59
+#define TRice_10 TRice16_10 //!< Default parameter bit width for 10 parameter count TRice is 16.
60
+#define TRice_11 TRice16_11 //!< Default parameter bit width for 11 parameter count TRice is 16.
61
+#define TRice_12 TRice16_12 //!< Default parameter bit width for 12 parameter count TRice is 16.
62
+
63
+#endif // #if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 16
64
+
65
+#define TRICE_SHORT0(v) TRICE_HTOTS((uint16_t)(v))                   //!< TRICE_SHORT0(v) is the 16-bit value v moved to the LLLL position in a 32-bit value 0xHHHH_LLLL.
66
+#define TRICE_SHORT1(v) ((uint32_t)TRICE_HTOTS((uint16_t)(v)) << 16) //!< TRICE_SHORT1(v) is the 16-bit value v moved to the HHHH position in a 32-bit value 0xHHHH_LLLL.
67
+
68
+#define TRICE16(tid, fmt, ...) TRICE_CONCAT2(TRICE16_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
69
+
70
+//! TRICE16_B expects inside pFmt only one format specifier, which is used n times by using pFmt n times.
71
+//!  It is usable for showing n 16-bit values.
72
+#define TRICE16_B(id, pFmt, buf, n)    \
73
+	do {                               \
74
+		TRICE_N(id, pFmt, buf, 2 * n); \
75
+	} while (0)
76
+
77
+//! TRICE16_F expects inside pFmt just a string which is assumed to be a remote function name.
78
+//!  The trice tool displays the pFmt string followed by n times (16-bit value i).
79
+//!  The idea behind is to generate an id - function pointer referece list from the generated til.json file to
80
+//!  compile it into a remote device and execute the inside pFmt named function remotely.
81
+//!  Look for "TRICE16_F example" inside triceCheck.c.
82
+#define TRICE16_F TRICE16_B
83
+
84
+#define TRICE_PUT16_1(v0) TRICE_PUT(TRICE_SHORT0(v0));
85
+
86
+#define TRICE_PUT16_2(v0, v1) TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));
87
+
88
+#define TRICE_PUT16_3(v0, v1, v2)                   \
89
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1)); \
90
+	TRICE_PUT(TRICE_SHORT0(v2));
91
+
92
+#define TRICE_PUT16_4(v0, v1, v2, v3)               \
93
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1)); \
94
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));
95
+
96
+#define TRICE_PUT16_5(v0, v1, v2, v3, v4)           \
97
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1)); \
98
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3)); \
99
+	TRICE_PUT(TRICE_SHORT0(v4));
100
+
101
+#define TRICE_PUT16_6(v0, v1, v2, v3, v4, v5)       \
102
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1)); \
103
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3)); \
104
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));
105
+
106
+#define TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6)   \
107
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1)); \
108
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3)); \
109
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5)); \
110
+	TRICE_PUT(TRICE_SHORT0(v6));
111
+
112
+#define TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7) \
113
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));   \
114
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));   \
115
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));   \
116
+	TRICE_PUT(TRICE_SHORT0(v6) | TRICE_SHORT1(v7));
117
+
118
+#define TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8) \
119
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));       \
120
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));       \
121
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));       \
122
+	TRICE_PUT(TRICE_SHORT0(v6) | TRICE_SHORT1(v7));       \
123
+	TRICE_PUT(TRICE_SHORT0(v8));
124
+
125
+#define TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
126
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));            \
127
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));            \
128
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));            \
129
+	TRICE_PUT(TRICE_SHORT0(v6) | TRICE_SHORT1(v7));            \
130
+	TRICE_PUT(TRICE_SHORT0(v8) | TRICE_SHORT1(v9));
131
+
132
+#define TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
133
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));                 \
134
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));                 \
135
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));                 \
136
+	TRICE_PUT(TRICE_SHORT0(v6) | TRICE_SHORT1(v7));                 \
137
+	TRICE_PUT(TRICE_SHORT0(v8) | TRICE_SHORT1(v9));                 \
138
+	TRICE_PUT(TRICE_SHORT0(v10));
139
+
140
+#define TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
141
+	TRICE_PUT(TRICE_SHORT0(v0) | TRICE_SHORT1(v1));                      \
142
+	TRICE_PUT(TRICE_SHORT0(v2) | TRICE_SHORT1(v3));                      \
143
+	TRICE_PUT(TRICE_SHORT0(v4) | TRICE_SHORT1(v5));                      \
144
+	TRICE_PUT(TRICE_SHORT0(v6) | TRICE_SHORT1(v7));                      \
145
+	TRICE_PUT(TRICE_SHORT0(v8) | TRICE_SHORT1(v9));                      \
146
+	TRICE_PUT(TRICE_SHORT0(v10) | TRICE_SHORT1(v11));
147
+
148
+// The following `TRICE` macro definitions uses the C preprocess to concatenate the code behind the sub-macros.
149
+// The sequence `tid` in this context is executable code `id(n)`, `Id(n)` or `ID(n)` defined in trice.h.
150
+// This works only with tid=`id(n)`, `Id(n)`, `ID(n)`.
151
+
152
+//! TRICE16_0 writes trice data as fast as possible in a buffer.
153
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
154
+#define TRICE16_0(tid, pFmt) \
155
+	TRICE_ENTER tid;         \
156
+	TRICE_CNTC(0);           \
157
+	TRICE_LEAVE
158
+
159
+//! TRICE16_1 writes trice data as fast as possible in a buffer.
160
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
161
+//! \param v0 a 16 bit value
162
+#define TRICE16_1(tid, pFmt, v0) \
163
+	TRICE_ENTER tid;             \
164
+	TRICE_CNTC(2);               \
165
+	TRICE_PUT16_1(v0)            \
166
+	TRICE_LEAVE
167
+
168
+//! TRICE16_2 writes trice data as fast as possible in a buffer.
169
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
170
+//! \param v0 - v1 are 16 bit values
171
+#define TRICE16_2(id, pFmt, v0, v1) \
172
+	TRICE_ENTER id;                 \
173
+	TRICE_CNTC(4);                  \
174
+	TRICE_PUT16_2(v0, v1);          \
175
+	TRICE_LEAVE
176
+
177
+//! TRICE16_3 writes trice data as fast as possible in a buffer.
178
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
179
+//! \param v0 - v2 are 16 bit values
180
+#define TRICE16_3(id, pFmt, v0, v1, v2) \
181
+	TRICE_ENTER id;                     \
182
+	TRICE_CNTC(6);                      \
183
+	TRICE_PUT16_3(v0, v1, v2);          \
184
+	TRICE_LEAVE
185
+
186
+//! TRICE16_4 writes trice data as fast as possible in a buffer.
187
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
188
+//! \param v0 - v3 are 16 bit values
189
+#define TRICE16_4(id, pFmt, v0, v1, v2, v3) \
190
+	TRICE_ENTER id;                         \
191
+	TRICE_CNTC(8);                          \
192
+	TRICE_PUT16_4(v0, v1, v2, v3);          \
193
+	TRICE_LEAVE
194
+
195
+//! TRICE16_5 writes trice data as fast as possible in a buffer.
196
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
197
+//! \param v0 - v4 are 16 bit values
198
+#define TRICE16_5(id, pFmt, v0, v1, v2, v3, v4) \
199
+	TRICE_ENTER id;                             \
200
+	TRICE_CNTC(10);                             \
201
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);          \
202
+	TRICE_LEAVE
203
+
204
+//! TRICE16_6 writes trice data as fast as possible in a buffer.
205
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
206
+//! \param v0 - v5 are 16 bit values
207
+#define TRICE16_6(id, pFmt, v0, v1, v2, v3, v4, v5) \
208
+	TRICE_ENTER id;                                 \
209
+	TRICE_CNTC(12);                                 \
210
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);          \
211
+	TRICE_LEAVE
212
+
213
+//! TRICE16_8 writes trice data as fast as possible in a buffer.
214
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
215
+//! \param v0 - v6 are 16 bit values
216
+#define TRICE16_7(id, pFmt, v0, v1, v2, v3, v4, v5, v6) \
217
+	TRICE_ENTER id;                                     \
218
+	TRICE_CNTC(14);                                     \
219
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);          \
220
+	TRICE_LEAVE
221
+
222
+//! TRICE16_8 writes trice data as fast as possible in a buffer.
223
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
224
+//! \param v0 - v7 are 16 bit values
225
+#define TRICE16_8(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7) \
226
+	TRICE_ENTER id;                                         \
227
+	TRICE_CNTC(16);                                         \
228
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
229
+	TRICE_LEAVE
230
+
231
+//! TRICE16_8 writes trice data as fast as possible in a buffer.
232
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
233
+//! \param v0 - v7 are 16 bit values
234
+#define TRICE16_9(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
235
+	TRICE_ENTER id;                                             \
236
+	TRICE_CNTC(18);                                             \
237
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);          \
238
+	TRICE_LEAVE
239
+
240
+//! TRICE16_8 writes trice data as fast as possible in a buffer.
241
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
242
+//! \param v0 - v7 are 16 bit values
243
+#define TRICE16_10(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
244
+	TRICE_ENTER id;                                                  \
245
+	TRICE_CNTC(20);                                                  \
246
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);          \
247
+	TRICE_LEAVE
248
+
249
+//! TRICE16_8 writes trice data as fast as possible in a buffer.
250
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
251
+//! \param v0 - v7 are 16 bit values
252
+#define TRICE16_11(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
253
+	TRICE_ENTER id;                                                       \
254
+	TRICE_CNTC(22);                                                       \
255
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);          \
256
+	TRICE_LEAVE
257
+
258
+//! TRICE16_12 writes trice data as fast as possible in a buffer.
259
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
260
+//! \param v0 - v11 are 16 bit values
261
+#define TRICE16_12(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
262
+	TRICE_ENTER id;                                                            \
263
+	TRICE_CNTC(24);                                                            \
264
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)           \
265
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice16McuOrder.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice16McuOrder.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice16m_0(tid)                                              \
6
+	TRICE_ENTER                                                      \
7
+	TRICE_PUT((0 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
8
+	TRICE_LEAVE
9
+
10
+#define trice16m_1(tid, v0)                                          \
11
+	TRICE_ENTER                                                      \
12
+	TRICE_PUT((2 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
13
+	TRICE_PUT16_1(v0)                                                \
14
+	TRICE_LEAVE
15
+
16
+#define trice16m_2(tid, v0, v1)                                      \
17
+	TRICE_ENTER                                                      \
18
+	TRICE_PUT((4 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
19
+	TRICE_PUT16_2(v0, v1);                                           \
20
+	TRICE_LEAVE
21
+
22
+#define trice16m_3(tid, v0, v1, v2)                                  \
23
+	TRICE_ENTER                                                      \
24
+	TRICE_PUT((6 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
25
+	TRICE_PUT16_3(v0, v1, v2);                                       \
26
+	TRICE_LEAVE
27
+
28
+#define trice16m_4(tid, v0, v1, v2, v3)                              \
29
+	TRICE_ENTER                                                      \
30
+	TRICE_PUT((8 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
31
+	TRICE_PUT16_4(v0, v1, v2, v3);                                   \
32
+	TRICE_LEAVE
33
+
34
+#define trice16m_5(tid, v0, v1, v2, v3, v4)                           \
35
+	TRICE_ENTER                                                       \
36
+	TRICE_PUT((10 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
37
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);                                \
38
+	TRICE_LEAVE
39
+
40
+#define trice16m_6(tid, v0, v1, v2, v3, v4, v5)                       \
41
+	TRICE_ENTER                                                       \
42
+	TRICE_PUT((12 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
43
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);                            \
44
+	TRICE_LEAVE
45
+
46
+#define trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6)                   \
47
+	TRICE_ENTER                                                       \
48
+	TRICE_PUT((14 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
49
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);                        \
50
+	TRICE_LEAVE
51
+
52
+#define trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)               \
53
+	TRICE_ENTER                                                       \
54
+	TRICE_PUT((16 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
55
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);                    \
56
+	TRICE_LEAVE
57
+
58
+#define trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)           \
59
+	TRICE_ENTER                                                       \
60
+	TRICE_PUT((18 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
61
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);                \
62
+	TRICE_LEAVE
63
+
64
+#define trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)      \
65
+	TRICE_ENTER                                                       \
66
+	TRICE_PUT((20 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
67
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);           \
68
+	TRICE_LEAVE
69
+
70
+#define trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT((22 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
73
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                            \
78
+	TRICE_PUT((24 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid)));      \
79
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice16m_0(tid)                            \
83
+	TRICE_ENTER                                    \
84
+	uint16_t ts = TriceStamp16;                    \
85
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid)); \
86
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | ts); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice16m_1(tid, v0)                        \
90
+	TRICE_ENTER                                    \
91
+	uint16_t ts = TriceStamp16;                    \
92
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid)); \
93
+	TRICE_PUT(2 << 24 | (TRICE_CYCLE << 16) | ts); \
94
+	TRICE_PUT16_1(v0)                              \
95
+	TRICE_LEAVE
96
+
97
+#define Trice16m_2(tid, v0, v1)                    \
98
+	TRICE_ENTER                                    \
99
+	uint16_t ts = TriceStamp16;                    \
100
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid)); \
101
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | ts); \
102
+	TRICE_PUT16_2(v0, v1);                         \
103
+	TRICE_LEAVE
104
+
105
+#define Trice16m_3(tid, v0, v1, v2)                \
106
+	TRICE_ENTER                                    \
107
+	uint16_t ts = TriceStamp16;                    \
108
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid)); \
109
+	TRICE_PUT(6 << 24 | (TRICE_CYCLE << 16) | ts); \
110
+	TRICE_PUT16_3(v0, v1, v2);                     \
111
+	TRICE_LEAVE
112
+
113
+#define Trice16m_4(tid, v0, v1, v2, v3)            \
114
+	TRICE_ENTER                                    \
115
+	uint16_t ts = TriceStamp16;                    \
116
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid)); \
117
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | ts); \
118
+	TRICE_PUT16_4(v0, v1, v2, v3);                 \
119
+	TRICE_LEAVE
120
+
121
+#define Trice16m_5(tid, v0, v1, v2, v3, v4)         \
122
+	TRICE_ENTER                                     \
123
+	uint16_t ts = TriceStamp16;                     \
124
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));  \
125
+	TRICE_PUT(10 << 24 | (TRICE_CYCLE << 16) | ts); \
126
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);              \
127
+	TRICE_LEAVE
128
+
129
+#define Trice16m_6(tid, v0, v1, v2, v3, v4, v5)     \
130
+	TRICE_ENTER                                     \
131
+	uint16_t ts = TriceStamp16;                     \
132
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));  \
133
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | ts); \
134
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);          \
135
+	TRICE_LEAVE
136
+
137
+#define Trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6) \
138
+	TRICE_ENTER                                     \
139
+	uint16_t ts = TriceStamp16;                     \
140
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));  \
141
+	TRICE_PUT(14 << 24 | (TRICE_CYCLE << 16) | ts); \
142
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);      \
143
+	TRICE_LEAVE
144
+
145
+#define Trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7) \
146
+	TRICE_ENTER                                         \
147
+	uint16_t ts = TriceStamp16;                         \
148
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));      \
149
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | ts);     \
150
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);      \
151
+	TRICE_LEAVE
152
+
153
+#define Trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
154
+	TRICE_ENTER                                             \
155
+	uint16_t ts = TriceStamp16;                             \
156
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));          \
157
+	TRICE_PUT(18 << 24 | (TRICE_CYCLE << 16) | ts);         \
158
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
159
+	TRICE_LEAVE
160
+
161
+#define Trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                  \
163
+	uint16_t ts = TriceStamp16;                                  \
164
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));               \
165
+	TRICE_PUT(20 << 24 | (TRICE_CYCLE << 16) | ts);              \
166
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                       \
171
+	uint16_t ts = TriceStamp16;                                       \
172
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));                    \
173
+	TRICE_PUT(22 << 24 | (TRICE_CYCLE << 16) | ts);                   \
174
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                            \
179
+	uint16_t ts = TriceStamp16;                                            \
180
+	TRICE_PUT(0x80008000 | ((tid) << 16) | (tid));                         \
181
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | ts);                        \
182
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice16m_0(tid)                                    \
186
+	TRICE_ENTER                                            \
187
+	uint32_t ts = TriceStamp32;                            \
188
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
189
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
190
+	TRICE_LEAVE
191
+
192
+#define TRice16m_1(tid, v0)                                \
193
+	TRICE_ENTER                                            \
194
+	uint32_t ts = TriceStamp32;                            \
195
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
196
+	TRICE_PUT(2 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
197
+	TRICE_PUT16_1(v0)                                      \
198
+	TRICE_LEAVE
199
+
200
+#define TRice16m_2(tid, v0, v1)                            \
201
+	TRICE_ENTER                                            \
202
+	uint32_t ts = TriceStamp32;                            \
203
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
204
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
205
+	TRICE_PUT16_2(v0, v1);                                 \
206
+	TRICE_LEAVE
207
+
208
+#define TRice16m_3(tid, v0, v1, v2)                        \
209
+	TRICE_ENTER                                            \
210
+	uint32_t ts = TriceStamp32;                            \
211
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
212
+	TRICE_PUT(6 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
213
+	TRICE_PUT16_3(v0, v1, v2);                             \
214
+	TRICE_LEAVE
215
+
216
+#define TRice16m_4(tid, v0, v1, v2, v3)                    \
217
+	TRICE_ENTER                                            \
218
+	uint32_t ts = TriceStamp32;                            \
219
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
220
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
221
+	TRICE_PUT16_4(v0, v1, v2, v3);                         \
222
+	TRICE_LEAVE
223
+
224
+#define TRice16m_5(tid, v0, v1, v2, v3, v4)                 \
225
+	TRICE_ENTER                                             \
226
+	uint32_t ts = TriceStamp32;                             \
227
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
228
+	TRICE_PUT(10 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
229
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);                      \
230
+	TRICE_LEAVE
231
+
232
+#define TRice16m_6(tid, v0, v1, v2, v3, v4, v5)             \
233
+	TRICE_ENTER                                             \
234
+	uint32_t ts = TriceStamp32;                             \
235
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
236
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
237
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);                  \
238
+	TRICE_LEAVE
239
+
240
+#define TRice16m_7(tid, v0, v1, v2, v3, v4, v5, v6)         \
241
+	TRICE_ENTER                                             \
242
+	uint32_t ts = TriceStamp32;                             \
243
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
244
+	TRICE_PUT(14 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
245
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);              \
246
+	TRICE_LEAVE
247
+
248
+#define TRice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)     \
249
+	TRICE_ENTER                                             \
250
+	uint32_t ts = TriceStamp32;                             \
251
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
252
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
253
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
254
+	TRICE_LEAVE
255
+
256
+#define TRice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
257
+	TRICE_ENTER                                             \
258
+	uint32_t ts = TriceStamp32;                             \
259
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
260
+	TRICE_PUT(18 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
261
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
262
+	TRICE_LEAVE
263
+
264
+#define TRice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                  \
266
+	uint32_t ts = TriceStamp32;                                  \
267
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                      \
268
+	TRICE_PUT(20 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));      \
269
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                       \
274
+	uint32_t ts = TriceStamp32;                                       \
275
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                           \
276
+	TRICE_PUT(22 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));           \
277
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                            \
282
+	uint32_t ts = TriceStamp32;                                            \
283
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                                \
284
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));                \
285
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 298
- 0
Middlewares/trice/trice16McuReverse.h Переглянути файл

@@ -0,0 +1,298 @@
1
+/*! \file trice16McuReverse.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+//! trice16m_0 writes trice data as fast as possible in a buffer.
6
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
7
+#define trice16m_0(tid)                      \
8
+	TRICE_ENTER                              \
9
+	TRICE_PUT(((TRICE_CYCLE) << 24) | idLH); \
10
+	TRICE_LEAVE
11
+
12
+//! trice16m_1 writes trice data as fast as possible in a buffer.
13
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
14
+//! \param v0 a 16 bit value
15
+#define trice16m_1(tid, v0)                                                    \
16
+	TRICE_ENTER                                                                \
17
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (2 << 16) | idLH);                       \
18
+	/*TRICE_PUT((2 << 8) | ((TRICE_CYCLE) << 0) | ((0x4000 | (tid)) << 16));*/ \
19
+	TRICE_PUT16_1(v0)                                                          \
20
+	TRICE_LEAVE
21
+
22
+#define trice16m_2(tid, v0, v1)                          \
23
+	TRICE_ENTER                                          \
24
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (4 << 16) | idLH); \
25
+	TRICE_PUT16_2(v0, v1);                               \
26
+	TRICE_LEAVE
27
+
28
+#define trice16m_3(tid, v0, v1, v2)                      \
29
+	TRICE_ENTER                                          \
30
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (6 << 16) | idLH); \
31
+	TRICE_PUT16_3(v0, v1, v2);                           \
32
+	TRICE_LEAVE
33
+
34
+#define trice16m_4(tid, v0, v1, v2, v3)                  \
35
+	TRICE_ENTER                                          \
36
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (8 << 16) | idLH); \
37
+	TRICE_PUT16_4(v0, v1, v2, v3);                       \
38
+	TRICE_LEAVE
39
+
40
+#define trice16m_5(tid, v0, v1, v2, v3, v4)               \
41
+	TRICE_ENTER                                           \
42
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (10 << 16) | idLH); \
43
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);                    \
44
+	TRICE_LEAVE
45
+
46
+#define trice16m_6(tid, v0, v1, v2, v3, v4, v5)           \
47
+	TRICE_ENTER                                           \
48
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (12 << 16) | idLH); \
49
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);                \
50
+	TRICE_LEAVE
51
+
52
+#define trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6)       \
53
+	TRICE_ENTER                                           \
54
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (14 << 16) | idLH); \
55
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);            \
56
+	TRICE_LEAVE
57
+
58
+#define trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)   \
59
+	TRICE_ENTER                                           \
60
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (16 << 16) | idLH); \
61
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);        \
62
+	TRICE_LEAVE
63
+
64
+#define trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
65
+	TRICE_ENTER                                             \
66
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (18 << 16) | idLH);   \
67
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
68
+	TRICE_LEAVE
69
+
70
+#define trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
71
+	TRICE_ENTER                                                  \
72
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (20 << 16) | idLH);        \
73
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
77
+	TRICE_ENTER                                                       \
78
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (22 << 16) | idLH);             \
79
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
80
+	TRICE_LEAVE
81
+
82
+#define trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
83
+	TRICE_ENTER                                                            \
84
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (24 << 16) | idLH);                  \
85
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
86
+	TRICE_LEAVE
87
+
88
+#define Trice16m_0(tid)                         \
89
+	TRICE_ENTER                                 \
90
+	uint16_t ts = TriceStamp16;                 \
91
+	TRICE_PUT(((IdLH) << 16) | IdLH)            \
92
+	TRICE_PUT((TRICE_CYCLE << 24) | tsL | tsH); \
93
+	TRICE_LEAVE
94
+
95
+//! Trice16m_1 writes trice data as fast as possible in a buffer.
96
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
97
+//! \param v0 a 16 bit value
98
+#define Trice16m_1(tid, v0)                                 \
99
+	TRICE_ENTER                                             \
100
+	uint16_t ts = TriceStamp16;                             \
101
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
102
+	TRICE_PUT((TRICE_CYCLE << 24) | (2 << 16) | tsL | tsH); \
103
+	TRICE_PUT16_1(v0)                                       \
104
+	TRICE_LEAVE
105
+
106
+#define Trice16m_2(tid, v0, v1)                             \
107
+	TRICE_ENTER                                             \
108
+	uint16_t ts = TriceStamp16;                             \
109
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
110
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsL | tsH); \
111
+	TRICE_PUT16_2(v0, v1);                                  \
112
+	TRICE_LEAVE
113
+
114
+#define Trice16m_3(tid, v0, v1, v2)                         \
115
+	TRICE_ENTER                                             \
116
+	uint16_t ts = TriceStamp16;                             \
117
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
118
+	TRICE_PUT((TRICE_CYCLE << 24) | (6 << 16) | tsL | tsH); \
119
+	TRICE_PUT16_3(v0, v1, v2);                              \
120
+	TRICE_LEAVE
121
+
122
+#define Trice16m_4(tid, v0, v1, v2, v3)                     \
123
+	TRICE_ENTER                                             \
124
+	uint16_t ts = TriceStamp16;                             \
125
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
126
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsL | tsH); \
127
+	TRICE_PUT16_4(v0, v1, v2, v3);                          \
128
+	TRICE_LEAVE
129
+
130
+#define Trice16m_5(tid, v0, v1, v2, v3, v4)                  \
131
+	TRICE_ENTER                                              \
132
+	uint16_t ts = TriceStamp16;                              \
133
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
134
+	TRICE_PUT((TRICE_CYCLE << 24) | (10 << 16) | tsL | tsH); \
135
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);                       \
136
+	TRICE_LEAVE
137
+
138
+#define Trice16m_6(tid, v0, v1, v2, v3, v4, v5)              \
139
+	TRICE_ENTER                                              \
140
+	uint16_t ts = TriceStamp16;                              \
141
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
142
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsL | tsH); \
143
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);                   \
144
+	TRICE_LEAVE
145
+
146
+#define Trice16m_7(tid, v0, v1, v2, v3, v4, v5, v6)          \
147
+	TRICE_ENTER                                              \
148
+	uint16_t ts = TriceStamp16;                              \
149
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
150
+	TRICE_PUT((TRICE_CYCLE << 24) | (14 << 16) | tsL | tsH); \
151
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);               \
152
+	TRICE_LEAVE
153
+
154
+#define Trice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)      \
155
+	TRICE_ENTER                                              \
156
+	uint16_t ts = TriceStamp16;                              \
157
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
158
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsL | tsH); \
159
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
160
+	TRICE_LEAVE
161
+
162
+#define Trice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)  \
163
+	TRICE_ENTER                                              \
164
+	uint16_t ts = TriceStamp16;                              \
165
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
166
+	TRICE_PUT((TRICE_CYCLE << 24) | (18 << 16) | tsL | tsH); \
167
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);       \
168
+	TRICE_LEAVE
169
+
170
+#define Trice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
171
+	TRICE_ENTER                                                  \
172
+	uint16_t ts = TriceStamp16;                                  \
173
+	TRICE_PUT(((IdLH) << 16) | IdLH)                             \
174
+	TRICE_PUT((TRICE_CYCLE << 24) | (20 << 16) | tsL | tsH);     \
175
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
176
+	TRICE_LEAVE
177
+
178
+#define Trice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
179
+	TRICE_ENTER                                                       \
180
+	uint16_t ts = TriceStamp16;                                       \
181
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                  \
182
+	TRICE_PUT((TRICE_CYCLE << 24) | (22 << 16) | tsL | tsH);          \
183
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
184
+	TRICE_LEAVE
185
+
186
+#define Trice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
187
+	TRICE_ENTER                                                            \
188
+	uint16_t ts = TriceStamp16;                                            \
189
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                       \
190
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsL | tsH);               \
191
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
192
+	TRICE_LEAVE
193
+
194
+#define TRice16m_0(tid)                          \
195
+	TRICE_ENTER                                  \
196
+	uint32_t ts = TriceStamp32;                  \
197
+	TRICE_PUT(tsHL | tsHH | IDLH)                \
198
+	TRICE_PUT((TRICE_CYCLE << 24) | tsLL | tsLH) \
199
+	TRICE_LEAVE
200
+
201
+//! TRice16m_1 writes trice data as fast as possible in a buffer.
202
+//! \param tid is a 14 bit Trice id in upper 2 bytes of a 32 bit value
203
+//! \param v0 a 16 bit value
204
+#define TRice16m_1(tid, v0)                                  \
205
+	TRICE_ENTER                                              \
206
+	uint32_t ts = TriceStamp32;                              \
207
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
208
+	TRICE_PUT((TRICE_CYCLE << 24) | (2 << 16) | tsLL | tsLH) \
209
+	TRICE_PUT16_1(v0)                                        \
210
+	TRICE_LEAVE
211
+
212
+#define TRice16m_2(tid, v0, v1)                              \
213
+	TRICE_ENTER                                              \
214
+	uint32_t ts = TriceStamp32;                              \
215
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
216
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsLL | tsLH) \
217
+	TRICE_PUT16_2(v0, v1);                                   \
218
+	TRICE_LEAVE
219
+
220
+#define TRice16m_3(tid, v0, v1, v2)                          \
221
+	TRICE_ENTER                                              \
222
+	uint32_t ts = TriceStamp32;                              \
223
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
224
+	TRICE_PUT((TRICE_CYCLE << 24) | (6 << 16) | tsLL | tsLH) \
225
+	TRICE_PUT16_3(v0, v1, v2);                               \
226
+	TRICE_LEAVE
227
+
228
+#define TRice16m_4(tid, v0, v1, v2, v3)                      \
229
+	TRICE_ENTER                                              \
230
+	uint32_t ts = TriceStamp32;                              \
231
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
232
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsLL | tsLH) \
233
+	TRICE_PUT16_4(v0, v1, v2, v3);                           \
234
+	TRICE_LEAVE
235
+
236
+#define TRice16m_5(tid, v0, v1, v2, v3, v4)                   \
237
+	TRICE_ENTER                                               \
238
+	uint32_t ts = TriceStamp32;                               \
239
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
240
+	TRICE_PUT((TRICE_CYCLE << 24) | (10 << 16) | tsLL | tsLH) \
241
+	TRICE_PUT16_5(v0, v1, v2, v3, v4);                        \
242
+	TRICE_LEAVE
243
+
244
+#define TRice16m_6(tid, v0, v1, v2, v3, v4, v5)               \
245
+	TRICE_ENTER                                               \
246
+	uint32_t ts = TriceStamp32;                               \
247
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
248
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsLL | tsLH) \
249
+	TRICE_PUT16_6(v0, v1, v2, v3, v4, v5);                    \
250
+	TRICE_LEAVE
251
+
252
+#define TRice16m_7(tid, v0, v1, v2, v3, v4, v5, v6)           \
253
+	TRICE_ENTER                                               \
254
+	uint32_t ts = TriceStamp32;                               \
255
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
256
+	TRICE_PUT((TRICE_CYCLE << 24) | (14 << 16) | tsLL | tsLH) \
257
+	TRICE_PUT16_7(v0, v1, v2, v3, v4, v5, v6);                \
258
+	TRICE_LEAVE
259
+
260
+#define TRice16m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)       \
261
+	TRICE_ENTER                                               \
262
+	uint32_t ts = TriceStamp32;                               \
263
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
264
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsLL | tsLH) \
265
+	TRICE_PUT16_8(v0, v1, v2, v3, v4, v5, v6, v7);            \
266
+	TRICE_LEAVE
267
+
268
+#define TRice16m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)   \
269
+	TRICE_ENTER                                               \
270
+	uint32_t ts = TriceStamp32;                               \
271
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
272
+	TRICE_PUT((TRICE_CYCLE << 24) | (18 << 16) | tsLL | tsLH) \
273
+	TRICE_PUT16_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);        \
274
+	TRICE_LEAVE
275
+
276
+#define TRice16m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
277
+	TRICE_ENTER                                                  \
278
+	uint32_t ts = TriceStamp32;                                  \
279
+	TRICE_PUT(tsHL | tsHH | IDLH)                                \
280
+	TRICE_PUT((TRICE_CYCLE << 24) | (20 << 16) | tsLL | tsLH)    \
281
+	TRICE_PUT16_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
282
+	TRICE_LEAVE
283
+
284
+#define TRice16m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
285
+	TRICE_ENTER                                                       \
286
+	uint32_t ts = TriceStamp32;                                       \
287
+	TRICE_PUT(tsHL | tsHH | IDLH)                                     \
288
+	TRICE_PUT((TRICE_CYCLE << 24) | (22 << 16) | tsLL | tsLH)         \
289
+	TRICE_PUT16_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
290
+	TRICE_LEAVE
291
+
292
+#define TRice16m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
293
+	TRICE_ENTER                                                            \
294
+	uint32_t ts = TriceStamp32;                                            \
295
+	TRICE_PUT(tsHL | tsHH | IDLH)                                          \
296
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsLL | tsLH)              \
297
+	TRICE_PUT16_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
298
+	TRICE_LEAVE

+ 560
- 0
Middlewares/trice/trice32.c Переглянути файл

@@ -0,0 +1,560 @@
1
+//! \file trice32.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//! ///////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+// lint -e529  Warning 529: Symbol '_SEGGER_RTT__LockState' not subsequently referenced
7
+// lint -e701  Info 701: Shift left of signed quantity (int)
8
+
9
+#if TRICE_32_BIT_SUPPORT == 1 && TRICE_OFF == 0
10
+
11
+// no-stamp 32-bit-values functions
12
+#ifndef ENABLE_trice32fn_0
13
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 0 * 4) + 3) & ~3)
14
+#define ENABLE_trice32fn_0 0 //!< Disables no-stamp 32-bit 0 values functions.
15
+#else
16
+#define ENABLE_trice32fn_0 1 //!< Enables  no-stamp 32-bit 0 values functions.
17
+#endif
18
+#endif
19
+
20
+#ifndef ENABLE_trice32fn_1
21
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 1 * 4) + 3) & ~3)
22
+#define ENABLE_trice32fn_1 0 //!< Disables no-stamp 32-bit 1 values functions.
23
+#else
24
+#define ENABLE_trice32fn_1 1 //!< Enables  no-stamp 32-bit 1 values functions.
25
+#endif
26
+#endif
27
+
28
+#ifndef ENABLE_trice32fn_2
29
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 2 * 4) + 3) & ~3)
30
+#define ENABLE_trice32fn_2 0 //!< Disables no-stamp 32-bit 2 values functions.
31
+#else
32
+#define ENABLE_trice32fn_2 1 //!< Enables  no-stamp 32-bit 2 values functions.
33
+#endif
34
+#endif
35
+
36
+#ifndef ENABLE_trice32fn_3
37
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 3 * 4) + 3) & ~3)
38
+#define ENABLE_trice32fn_3 0 //!< Disables no-stamp 32-bit 3 values functions.
39
+#else
40
+#define ENABLE_trice32fn_3 1 //!< Enables  no-stamp 32-bit 3 values functions.
41
+#endif
42
+#endif
43
+
44
+#ifndef ENABLE_trice32fn_4
45
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 4 * 4) + 3) & ~3)
46
+#define ENABLE_trice32fn_4 0 //!< Disables no-stamp 32-bit 4 values functions.
47
+#else
48
+#define ENABLE_trice32fn_4 1 //!< Enables  no-stamp 32-bit 4 values functions.
49
+#endif
50
+#endif
51
+
52
+#ifndef ENABLE_trice32fn_5
53
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 5 * 4) + 3) & ~3)
54
+#define ENABLE_trice32fn_5 0 //!< Disables no-stamp 32-bit 5 values functions.
55
+#else
56
+#define ENABLE_trice32fn_5 1 //!< Enables  no-stamp 32-bit 5 values functions.
57
+#endif
58
+#endif
59
+
60
+#ifndef ENABLE_trice32fn_6
61
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 6 * 4) + 3) & ~3)
62
+#define ENABLE_trice32fn_6 0 //!< Disables no-stamp 32-bit 6 values functions.
63
+#else
64
+#define ENABLE_trice32fn_6 1 //!< Enables  no-stamp 32-bit 6 values functions.
65
+#endif
66
+#endif
67
+
68
+#ifndef ENABLE_trice32fn_7
69
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 7 * 4) + 3) & ~3)
70
+#define ENABLE_trice32fn_7 0 //!< Disables no-stamp 32-bit 7 values functions.
71
+#else
72
+#define ENABLE_trice32fn_7 1 //!< Enables  no-stamp 32-bit 7 values functions.
73
+#endif
74
+#endif
75
+
76
+#ifndef ENABLE_trice32fn_8
77
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 8 * 4) + 3) & ~3)
78
+#define ENABLE_trice32fn_8 0 //!< Disables no-stamp 32-bit 8 values functions.
79
+#else
80
+#define ENABLE_trice32fn_8 1 //!< Enables  no-stamp 32-bit 8 values functions.
81
+#endif
82
+#endif
83
+
84
+#ifndef ENABLE_trice32fn_9
85
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 9 * 4) + 3) & ~3)
86
+#define ENABLE_trice32fn_9 0 //!< Disables no-stamp 32-bit 9 values functions.
87
+#else
88
+#define ENABLE_trice32fn_9 1 //!< Enables  no-stamp 32-bit 9 values functions.
89
+#endif
90
+#endif
91
+
92
+#ifndef ENABLE_trice32fn_10
93
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 10 * 4) + 3) & ~3)
94
+#define ENABLE_trice32fn_10 0 //!< Disables no-stamp 32-bit 10 values functions.
95
+#else
96
+#define ENABLE_trice32fn_10 1 //!< Enables  no-stamp 32-bit 10 values functions.
97
+#endif
98
+#endif
99
+
100
+#ifndef ENABLE_trice32fn_11
101
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 11 * 4) + 3) & ~3)
102
+#define ENABLE_trice32fn_11 0 //!< Disables no-stamp 32-bit 11 values functions.
103
+#else
104
+#define ENABLE_trice32fn_11 1 //!< Enables  no-stamp 32-bit 11 values functions.
105
+#endif
106
+#endif
107
+
108
+#ifndef ENABLE_trice32fn_12
109
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 12 * 4) + 3) & ~3)
110
+#define ENABLE_trice32fn_12 0 //!< Disables no-stamp 32-bit 12 values functions.
111
+#else
112
+#define ENABLE_trice32fn_12 1 //!< Enables  no-stamp 32-bit 12 values functions.
113
+#endif
114
+#endif
115
+
116
+// 16-bit-stamp 32-bit-values functions (16-bit-stamps need 4 bytes for allocation reasons)
117
+#ifndef ENABLE_Trice32fn_0
118
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 4) + 3) & ~3)
119
+#define ENABLE_Trice32fn_0 0 //!< Disables 16-bit-stamp 32-bit 0 values functions.
120
+#else
121
+#define ENABLE_Trice32fn_0 1 //!< Enables  16-bit-stamp 32-bit 0 values functions.
122
+#endif
123
+#endif
124
+
125
+#ifndef ENABLE_Trice32fn_1
126
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 4) + 3) & ~3)
127
+#define ENABLE_Trice32fn_1 0 //!< Disables 16-bit-stamp 32-bit 1 values functions.
128
+#else
129
+#define ENABLE_Trice32fn_1 1 //!< Enables  16-bit-stamp 32-bit 1 values functions.
130
+#endif
131
+#endif
132
+
133
+#ifndef ENABLE_Trice32fn_2
134
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 4) + 3) & ~3)
135
+#define ENABLE_Trice32fn_2 0 //!< Disables 16-bit-stamp 32-bit 2 values functions.
136
+#else
137
+#define ENABLE_Trice32fn_2 1 //!< Enables  16-bit-stamp 32-bit 2 values functions.
138
+#endif
139
+#endif
140
+
141
+#ifndef ENABLE_Trice32fn_3
142
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 4) + 3) & ~3)
143
+#define ENABLE_Trice32fn_3 0 //!< Disables 16-bit-stamp 32-bit 3 values functions.
144
+#else
145
+#define ENABLE_Trice32fn_3 1 //!< Enables  16-bit-stamp 32-bit 3 values functions.
146
+#endif
147
+#endif
148
+
149
+#ifndef ENABLE_Trice32fn_4
150
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 4) + 3) & ~3)
151
+#define ENABLE_Trice32fn_4 0 //!< Disables 16-bit-stamp 32-bit 4 values functions.
152
+#else
153
+#define ENABLE_Trice32fn_4 1 //!< Enables  16-bit-stamp 32-bit 4 values functions.
154
+#endif
155
+#endif
156
+
157
+#ifndef ENABLE_Trice32fn_5
158
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 4) + 3) & ~3)
159
+#define ENABLE_Trice32fn_5 0 //!< Disables 16-bit-stamp 32-bit 5 values functions.
160
+#else
161
+#define ENABLE_Trice32fn_5 1 //!< Enables  16-bit-stamp 32-bit 5 values functions.
162
+#endif
163
+#endif
164
+
165
+#ifndef ENABLE_Trice32fn_6
166
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 4) + 3) & ~3)
167
+#define ENABLE_Trice32fn_6 0 //!< Disables 16-bit-stamp 32-bit 6 values functions.
168
+#else
169
+#define ENABLE_Trice32fn_6 1 //!< Enables  16-bit-stamp 32-bit 6 values functions.
170
+#endif
171
+#endif
172
+
173
+#ifndef ENABLE_Trice32fn_7
174
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 4) + 3) & ~3)
175
+#define ENABLE_Trice32fn_7 0 //!< Disables 16-bit-stamp 32-bit 7 values functions.
176
+#else
177
+#define ENABLE_Trice32fn_7 1 //!< Enables  16-bit-stamp 32-bit 7 values functions.
178
+#endif
179
+#endif
180
+
181
+#ifndef ENABLE_Trice32fn_8
182
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 4) + 3) & ~3)
183
+#define ENABLE_Trice32fn_8 0 //!< Disables 16-bit-stamp 32-bit 8 values functions.
184
+#else
185
+#define ENABLE_Trice32fn_8 1 //!< Enables  16-bit-stamp 32-bit 8 values functions.
186
+#endif
187
+#endif
188
+
189
+#ifndef ENABLE_Trice32fn_9
190
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 4) + 3) & ~3)
191
+#define ENABLE_Trice32fn_9 0 //!< Disables 16-bit-stamp 32-bit 9 values functions.
192
+#else
193
+#define ENABLE_Trice32fn_9 1 //!< Enables  16-bit-stamp 32-bit 9 values functions.
194
+#endif
195
+#endif
196
+
197
+#ifndef ENABLE_Trice32fn_10
198
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 4) + 3) & ~3)
199
+#define ENABLE_Trice32fn_10 0 //!< Disables 16-bit-stamp 32-bit 10 values functions.
200
+#else
201
+#define ENABLE_Trice32fn_10 1 //!< Enables  16-bit-stamp 32-bit 10 values functions.
202
+#endif
203
+#endif
204
+
205
+#ifndef ENABLE_Trice32fn_11
206
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 4) + 3) & ~3)
207
+#define ENABLE_Trice32fn_11 0 //!< Disables 16-bit-stamp 32-bit 11 values functions.
208
+#else
209
+#define ENABLE_Trice32fn_11 1 //!< Enables  16-bit-stamp 32-bit 11 values functions.
210
+#endif
211
+#endif
212
+
213
+#ifndef ENABLE_Trice32fn_12
214
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 4) + 3) & ~3)
215
+#define ENABLE_Trice32fn_12 0 //!< Disables 16-bit-stamp 32-bit 12 values functions.
216
+#else
217
+#define ENABLE_Trice32fn_12 1 //!< Enables  16-bit-stamp 32-bit 12 values functions.
218
+#endif
219
+#endif
220
+
221
+// with 32-bit-stamp 32-bit-values functions
222
+#ifndef ENABLE_TRice32fn_0
223
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 4) + 3) & ~3)
224
+#define ENABLE_TRice32fn_0 0 //!< Disables 32-bit-stamp 32-bit 0 values functions.
225
+#else
226
+#define ENABLE_TRice32fn_0 1 //!< Enables  32-bit-stamp 32-bit 0 values functions.
227
+#endif
228
+#endif
229
+
230
+#ifndef ENABLE_TRice32fn_1
231
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 4) + 3) & ~3)
232
+#define ENABLE_TRice32fn_1 0 //!< Disables 32-bit-stamp 32-bit 1 values functions.
233
+#else
234
+#define ENABLE_TRice32fn_1 1 //!< Enables  32-bit-stamp 32-bit 1 values functions.
235
+#endif
236
+#endif
237
+
238
+#ifndef ENABLE_TRice32fn_2
239
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 4) + 3) & ~3)
240
+#define ENABLE_TRice32fn_2 0 //!< Disables 32-bit-stamp 32-bit 2 values functions.
241
+#else
242
+#define ENABLE_TRice32fn_2 1 //!< Enables  32-bit-stamp 32-bit 2 values functions.
243
+#endif
244
+#endif
245
+
246
+#ifndef ENABLE_TRice32fn_3
247
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 4) + 3) & ~3)
248
+#define ENABLE_TRice32fn_3 0 //!< Disables 32-bit-stamp 32-bit 3 values functions.
249
+#else
250
+#define ENABLE_TRice32fn_3 1 //!< Enables  32-bit-stamp 32-bit 3 values functions.
251
+#endif
252
+#endif
253
+
254
+#ifndef ENABLE_TRice32fn_4
255
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 4) + 3) & ~3)
256
+#define ENABLE_TRice32fn_4 0 //!< Disables 32-bit-stamp 32-bit 4 values functions.
257
+#else
258
+#define ENABLE_TRice32fn_4 1 //!< Enables  32-bit-stamp 32-bit 4 values functions.
259
+#endif
260
+#endif
261
+
262
+#ifndef ENABLE_TRice32fn_5
263
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 4) + 3) & ~3)
264
+#define ENABLE_TRice32fn_5 0 //!< Disables 32-bit-stamp 32-bit 5 values functions.
265
+#else
266
+#define ENABLE_TRice32fn_5 1 //!< Enables  32-bit-stamp 32-bit 5 values functions.
267
+#endif
268
+#endif
269
+
270
+#ifndef ENABLE_TRice32fn_6
271
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 4) + 3) & ~3)
272
+#define ENABLE_TRice32fn_6 0 //!< Disables 32-bit-stamp 32-bit 6 values functions.
273
+#else
274
+#define ENABLE_TRice32fn_6 1 //!< Enables  32-bit-stamp 32-bit 6 values functions.
275
+#endif
276
+#endif
277
+
278
+#ifndef ENABLE_TRice32fn_7
279
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 4) + 3) & ~3)
280
+#define ENABLE_TRice32fn_7 0 //!< Disables 32-bit-stamp 32-bit 7 values functions.
281
+#else
282
+#define ENABLE_TRice32fn_7 1 //!< Enables  32-bit-stamp 32-bit 7 values functions.
283
+#endif
284
+#endif
285
+
286
+#ifndef ENABLE_TRice32fn_8
287
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 4) + 3) & ~3)
288
+#define ENABLE_TRice32fn_8 0 //!< Disables 32-bit-stamp 32-bit 8 values functions.
289
+#else
290
+#define ENABLE_TRice32fn_8 1 //!< Enables  32-bit-stamp 32-bit 8 values functions.
291
+#endif
292
+#endif
293
+
294
+#ifndef ENABLE_TRice32fn_9
295
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 4) + 3) & ~3)
296
+#define ENABLE_TRice32fn_9 0 //!< Disables 32-bit-stamp 32-bit 9 values functions.
297
+#else
298
+#define ENABLE_TRice32fn_9 1 //!< Enables  32-bit-stamp 32-bit 9 values functions.
299
+#endif
300
+#endif
301
+
302
+#ifndef ENABLE_TRice32fn_10
303
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 4) + 3) & ~3)
304
+#define ENABLE_TRice32fn_10 0 //!< Disables 32-bit-stamp 32-bit 10 values functions.
305
+#else
306
+#define ENABLE_TRice32fn_10 1 //!< Enables  32-bit-stamp 32-bit 10 values functions.
307
+#endif
308
+#endif
309
+
310
+#ifndef ENABLE_TRice32fn_11
311
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 4) + 3) & ~3)
312
+#define ENABLE_TRice32fn_11 0 //!< Disables 32-bit-stamp 32-bit 11 values functions.
313
+#else
314
+#define ENABLE_TRice32fn_11 1 //!< Enables  32-bit-stamp 32-bit 11 values functions.
315
+#endif
316
+#endif
317
+
318
+#ifndef ENABLE_TRice32fn_12
319
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 4) + 3) & ~3)
320
+#define ENABLE_TRice32fn_12 0 //!< Disables 32-bit-stamp 32-bit 12 values functions.
321
+#else
322
+#define ENABLE_TRice32fn_12 1 //!< Enables  32-bit-stamp 32-bit 12 values functions.
323
+#endif
324
+#endif
325
+
326
+#if ENABLE_trice32fn_0
327
+void trice32fn_0(uint16_t tid) {
328
+	trice32m_0(tid);
329
+}
330
+#endif
331
+
332
+#if ENABLE_trice32fn_1
333
+void trice32fn_1(uint16_t tid, uint32_t v0) {
334
+	trice32m_1(tid, v0);
335
+}
336
+#endif
337
+
338
+#if ENABLE_trice32fn_2
339
+void trice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1) {
340
+	trice32m_2(tid, v0, v1);
341
+}
342
+#endif
343
+
344
+#if ENABLE_trice32fn_3
345
+void trice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2) {
346
+	trice32m_3(tid, v0, v1, v2);
347
+}
348
+#endif
349
+
350
+#if ENABLE_trice32fn_4
351
+void trice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) {
352
+	trice32m_4(tid, v0, v1, v2, v3);
353
+}
354
+#endif
355
+
356
+#if ENABLE_trice32fn_5
357
+void trice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4) {
358
+	trice32m_5(tid, v0, v1, v2, v3, v4);
359
+}
360
+#endif
361
+
362
+#if ENABLE_trice32fn_6
363
+void trice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5) {
364
+	trice32m_6(tid, v0, v1, v2, v3, v4, v5);
365
+}
366
+#endif
367
+
368
+#if ENABLE_trice32fn_7
369
+void trice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6) {
370
+	trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6);
371
+}
372
+#endif
373
+
374
+#if ENABLE_trice32fn_8
375
+void trice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7) {
376
+	trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
377
+}
378
+#endif
379
+
380
+#if ENABLE_trice32fn_9
381
+void trice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8) {
382
+	trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
383
+}
384
+#endif
385
+
386
+#if ENABLE_trice32fn_10
387
+void trice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9) {
388
+	trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
389
+}
390
+#endif
391
+
392
+#if ENABLE_trice32fn_11
393
+void trice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10) {
394
+	trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
395
+}
396
+#endif
397
+
398
+#if ENABLE_trice32fn_12
399
+void trice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11) {
400
+	trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
401
+}
402
+#endif
403
+
404
+#if ENABLE_Trice32fn_0
405
+void Trice32fn_0(uint16_t tid) {
406
+	Trice32m_0(tid);
407
+}
408
+#endif
409
+
410
+#if ENABLE_Trice32fn_1
411
+void Trice32fn_1(uint16_t tid, uint32_t v0) {
412
+	Trice32m_1(tid, v0);
413
+}
414
+#endif
415
+
416
+#if ENABLE_Trice32fn_2
417
+void Trice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1) {
418
+	Trice32m_2(tid, v0, v1);
419
+}
420
+#endif
421
+
422
+#if ENABLE_Trice32fn_3
423
+void Trice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2) {
424
+	Trice32m_3(tid, v0, v1, v2);
425
+}
426
+#endif
427
+
428
+#if ENABLE_Trice32fn_4
429
+void Trice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) {
430
+	Trice32m_4(tid, v0, v1, v2, v3);
431
+}
432
+#endif
433
+
434
+#if ENABLE_Trice32fn_5
435
+void Trice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4) {
436
+	Trice32m_5(tid, v0, v1, v2, v3, v4);
437
+}
438
+#endif
439
+
440
+#if ENABLE_Trice32fn_6
441
+void Trice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5) {
442
+	Trice32m_6(tid, v0, v1, v2, v3, v4, v5);
443
+}
444
+#endif
445
+
446
+#if ENABLE_Trice32fn_7
447
+void Trice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6) {
448
+	Trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6);
449
+}
450
+#endif
451
+
452
+#if ENABLE_Trice32fn_8
453
+void Trice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7) {
454
+	Trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
455
+}
456
+#endif
457
+
458
+#if ENABLE_Trice32fn_9
459
+void Trice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8) {
460
+	Trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
461
+}
462
+#endif
463
+
464
+#if ENABLE_Trice32fn_10
465
+void Trice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9) {
466
+	Trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
467
+}
468
+#endif
469
+
470
+#if ENABLE_Trice32fn_11
471
+void Trice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10) {
472
+	Trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
473
+}
474
+#endif
475
+
476
+#if ENABLE_Trice32fn_12
477
+void Trice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11) {
478
+	Trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
479
+}
480
+#endif
481
+
482
+#if ENABLE_TRice32fn_0
483
+void TRice32fn_0(uint16_t tid) {
484
+	TRice32m_0(tid);
485
+}
486
+#endif
487
+
488
+#if ENABLE_TRice32fn_1
489
+void TRice32fn_1(uint16_t tid, uint32_t v0) {
490
+	TRice32m_1(tid, v0);
491
+}
492
+#endif
493
+
494
+#if ENABLE_TRice32fn_2
495
+void TRice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1) {
496
+	TRice32m_2(tid, v0, v1);
497
+}
498
+#endif
499
+
500
+#if ENABLE_TRice32fn_3
501
+void TRice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2) {
502
+	TRice32m_3(tid, v0, v1, v2);
503
+}
504
+#endif
505
+
506
+#if ENABLE_TRice32fn_4
507
+void TRice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) {
508
+	TRice32m_4(tid, v0, v1, v2, v3);
509
+}
510
+#endif
511
+
512
+#if ENABLE_TRice32fn_5
513
+void TRice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4) {
514
+	TRice32m_5(tid, v0, v1, v2, v3, v4);
515
+}
516
+#endif
517
+
518
+#if ENABLE_TRice32fn_6
519
+void TRice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5) {
520
+	TRice32m_6(tid, v0, v1, v2, v3, v4, v5);
521
+}
522
+#endif
523
+
524
+#if ENABLE_TRice32fn_7
525
+void TRice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6) {
526
+	TRice32m_7(tid, v0, v1, v2, v3, v4, v5, v6);
527
+}
528
+#endif
529
+
530
+#if ENABLE_TRice32fn_8
531
+void TRice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7) {
532
+	TRice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
533
+}
534
+#endif
535
+
536
+#if ENABLE_TRice32fn_9
537
+void TRice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8) {
538
+	TRice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
539
+}
540
+#endif
541
+
542
+#if ENABLE_TRice32fn_10
543
+void TRice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9) {
544
+	TRice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
545
+}
546
+#endif
547
+
548
+#if ENABLE_TRice32fn_11
549
+void TRice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10) {
550
+	TRice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
551
+}
552
+#endif
553
+
554
+#if ENABLE_TRice32fn_12
555
+void TRice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11) {
556
+	TRice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
557
+}
558
+#endif
559
+
560
+#endif // #if TRICE_32_BIT_SUPPORT == 1 && TRICE_OFF == 0

+ 299
- 0
Middlewares/trice/trice32.h Переглянути файл

@@ -0,0 +1,299 @@
1
+/*! \file internalTrice32.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 32
6
+
7
+// #define TRICE_0  TRICE32_0  //!< Default parameter bit width for 0  parameter count TRICE is 32.
8
+#define TRICE_1 TRICE32_1   //!< Default parameter bit width for 1  parameter count TRICE is 32.
9
+#define TRICE_2 TRICE32_2   //!< Default parameter bit width for 2  parameter count TRICE is 32.
10
+#define TRICE_3 TRICE32_3   //!< Default parameter bit width for 3  parameter count TRICE is 32.
11
+#define TRICE_4 TRICE32_4   //!< Default parameter bit width for 4  parameter count TRICE is 32.
12
+#define TRICE_5 TRICE32_5   //!< Default parameter bit width for 5  parameter count TRICE is 32.
13
+#define TRICE_6 TRICE32_6   //!< Default parameter bit width for 6  parameter count TRICE is 32.
14
+#define TRICE_7 TRICE32_7   //!< Default parameter bit width for 7  parameter count TRICE is 32.
15
+#define TRICE_8 TRICE32_8   //!< Default parameter bit width for 8  parameter count TRICE is 32.
16
+#define TRICE_9 TRICE32_9   //!< Default parameter bit width for 9  parameter count TRICE is 32.
17
+#define TRICE_10 TRICE32_10 //!< Default parameter bit width for 10 parameter count TRICE is 32.
18
+#define TRICE_11 TRICE32_11 //!< Default parameter bit width for 11 parameter count TRICE is 32.
19
+#define TRICE_12 TRICE32_12 //!< Default parameter bit width for 12 parameter count TRICE is 32.
20
+
21
+// #define trice_0  trice32_0  //!< Default parameter bit width for 0  parameter count trice is 32.
22
+#define trice_1 trice32_1   //!< Default parameter bit width for 1  parameter count trice is 32.
23
+#define trice_2 trice32_2   //!< Default parameter bit width for 2  parameter count trice is 32.
24
+#define trice_3 trice32_3   //!< Default parameter bit width for 3  parameter count trice is 32.
25
+#define trice_4 trice32_4   //!< Default parameter bit width for 4  parameter count trice is 32.
26
+#define trice_5 trice32_5   //!< Default parameter bit width for 5  parameter count trice is 32.
27
+#define trice_6 trice32_6   //!< Default parameter bit width for 6  parameter count trice is 32.
28
+#define trice_7 trice32_7   //!< Default parameter bit width for 7  parameter count trice is 32.
29
+#define trice_8 trice32_8   //!< Default parameter bit width for 8  parameter count trice is 32.
30
+#define trice_9 trice32_9   //!< Default parameter bit width for 9  parameter count trice is 32.
31
+#define trice_10 trice32_10 //!< Default parameter bit width for 10 parameter count trice is 32.
32
+#define trice_11 trice32_11 //!< Default parameter bit width for 11 parameter count trice is 32.
33
+#define trice_12 trice32_12 //!< Default parameter bit width for 12 parameter count trice is 32.
34
+
35
+// #define Trice_0  Trice32_0  //!< Default parameter bit width for 0  parameter count Trice is 32.
36
+#define Trice_1 Trice32_1   //!< Default parameter bit width for 1  parameter count Trice is 32.
37
+#define Trice_2 Trice32_2   //!< Default parameter bit width for 2  parameter count Trice is 32.
38
+#define Trice_3 Trice32_3   //!< Default parameter bit width for 3  parameter count Trice is 32.
39
+#define Trice_4 Trice32_4   //!< Default parameter bit width for 4  parameter count Trice is 32.
40
+#define Trice_5 Trice32_5   //!< Default parameter bit width for 5  parameter count Trice is 32.
41
+#define Trice_6 Trice32_6   //!< Default parameter bit width for 6  parameter count Trice is 32.
42
+#define Trice_7 Trice32_7   //!< Default parameter bit width for 7  parameter count Trice is 32.
43
+#define Trice_8 Trice32_8   //!< Default parameter bit width for 8  parameter count Trice is 32.
44
+#define Trice_9 Trice32_9   //!< Default parameter bit width for 9  parameter count Trice is 32.
45
+#define Trice_10 Trice32_10 //!< Default parameter bit width for 10 parameter count Trice is 32.
46
+#define Trice_11 Trice32_11 //!< Default parameter bit width for 11 parameter count Trice is 32.
47
+#define Trice_12 Trice32_12 //!< Default parameter bit width for 12 parameter count Trice is 32.
48
+
49
+// #define TRice_0  TRice32_0  //!< Default parameter bit width for 0  parameter count TRice is 32.
50
+#define TRice_1 TRice32_1   //!< Default parameter bit width for 1  parameter count TRice is 32.
51
+#define TRice_2 TRice32_2   //!< Default parameter bit width for 2  parameter count TRice is 32.
52
+#define TRice_3 TRice32_3   //!< Default parameter bit width for 3  parameter count TRice is 32.
53
+#define TRice_4 TRice32_4   //!< Default parameter bit width for 4  parameter count TRice is 32.
54
+#define TRice_5 TRice32_5   //!< Default parameter bit width for 5  parameter count TRice is 32.
55
+#define TRice_6 TRice32_6   //!< Default parameter bit width for 6  parameter count TRice is 32.
56
+#define TRice_7 TRice32_7   //!< Default parameter bit width for 7  parameter count TRice is 32.
57
+#define TRice_8 TRice32_8   //!< Default parameter bit width for 8  parameter count TRice is 32.
58
+#define TRice_9 TRice32_9   //!< Default parameter bit width for 9  parameter count TRice is 32.
59
+#define TRice_10 TRice32_10 //!< Default parameter bit width for 10 parameter count TRice is 32.
60
+#define TRice_11 TRice32_11 //!< Default parameter bit width for 11 parameter count TRice is 32.
61
+#define TRice_12 TRice32_12 //!< Default parameter bit width for 12 parameter count TRice is 32.
62
+
63
+#endif // #if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 32
64
+
65
+#define TRICE32(tid, fmt, ...) TRICE_CONCAT2(TRICE32_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
66
+
67
+//! TRICE32_B expects inside pFmt only one format specifier, which is used n times by using pFmt n times.
68
+//!  It is usable for showing n 32-bit values.
69
+#define TRICE32_B(id, pFmt, buf, n)    \
70
+	do {                               \
71
+		TRICE_N(id, pFmt, buf, 4 * n); \
72
+	} while (0)
73
+
74
+//! TRICE32_F expects inside pFmt just a string which is assumed to be a remote function name.
75
+//!  The trice tool displays the pFmt string followed by n times (32-bit value i).
76
+//!  The idea behind is to generate an id - function pointer referece list from the generated til.json file to
77
+//!  compile it into a remote device and execute the inside pFmt named function remotely.
78
+//!  Look for "TRICE32_F example" inside triceCheck.c.
79
+#define TRICE32_F TRICE32_B
80
+
81
+#define TRICE_PUT32_1(v0) TRICE_PUT(TRICE_HTOTL(v0));
82
+
83
+#define TRICE_PUT32_2(v0, v1)   \
84
+	TRICE_PUT(TRICE_HTOTL(v0)); \
85
+	TRICE_PUT(TRICE_HTOTL(v1));
86
+
87
+#define TRICE_PUT32_3(v0, v1, v2) \
88
+	TRICE_PUT(TRICE_HTOTL(v0));   \
89
+	TRICE_PUT(TRICE_HTOTL(v1));   \
90
+	TRICE_PUT(TRICE_HTOTL(v2));
91
+
92
+#define TRICE_PUT32_4(v0, v1, v2, v3) \
93
+	TRICE_PUT(TRICE_HTOTL(v0));       \
94
+	TRICE_PUT(TRICE_HTOTL(v1));       \
95
+	TRICE_PUT(TRICE_HTOTL(v2));       \
96
+	TRICE_PUT(TRICE_HTOTL(v3));
97
+
98
+#define TRICE_PUT32_5(v0, v1, v2, v3, v4) \
99
+	TRICE_PUT(TRICE_HTOTL(v0));           \
100
+	TRICE_PUT(TRICE_HTOTL(v1));           \
101
+	TRICE_PUT(TRICE_HTOTL(v2));           \
102
+	TRICE_PUT(TRICE_HTOTL(v3));           \
103
+	TRICE_PUT(TRICE_HTOTL(v4));
104
+
105
+#define TRICE_PUT32_6(v0, v1, v2, v3, v4, v5) \
106
+	TRICE_PUT(TRICE_HTOTL(v0));               \
107
+	TRICE_PUT(TRICE_HTOTL(v1));               \
108
+	TRICE_PUT(TRICE_HTOTL(v2));               \
109
+	TRICE_PUT(TRICE_HTOTL(v3));               \
110
+	TRICE_PUT(TRICE_HTOTL(v4));               \
111
+	TRICE_PUT(TRICE_HTOTL(v5));
112
+
113
+#define TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6) \
114
+	TRICE_PUT(TRICE_HTOTL(v0));                   \
115
+	TRICE_PUT(TRICE_HTOTL(v1));                   \
116
+	TRICE_PUT(TRICE_HTOTL(v2));                   \
117
+	TRICE_PUT(TRICE_HTOTL(v3));                   \
118
+	TRICE_PUT(TRICE_HTOTL(v4));                   \
119
+	TRICE_PUT(TRICE_HTOTL(v5));                   \
120
+	TRICE_PUT(TRICE_HTOTL(v6));
121
+
122
+#define TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7) \
123
+	TRICE_PUT(TRICE_HTOTL(v0));                       \
124
+	TRICE_PUT(TRICE_HTOTL(v1));                       \
125
+	TRICE_PUT(TRICE_HTOTL(v2));                       \
126
+	TRICE_PUT(TRICE_HTOTL(v3));                       \
127
+	TRICE_PUT(TRICE_HTOTL(v4));                       \
128
+	TRICE_PUT(TRICE_HTOTL(v5));                       \
129
+	TRICE_PUT(TRICE_HTOTL(v6));                       \
130
+	TRICE_PUT(TRICE_HTOTL(v7));
131
+
132
+#define TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8) \
133
+	TRICE_PUT(TRICE_HTOTL(v0));                           \
134
+	TRICE_PUT(TRICE_HTOTL(v1));                           \
135
+	TRICE_PUT(TRICE_HTOTL(v2));                           \
136
+	TRICE_PUT(TRICE_HTOTL(v3));                           \
137
+	TRICE_PUT(TRICE_HTOTL(v4));                           \
138
+	TRICE_PUT(TRICE_HTOTL(v5));                           \
139
+	TRICE_PUT(TRICE_HTOTL(v6));                           \
140
+	TRICE_PUT(TRICE_HTOTL(v7));                           \
141
+	TRICE_PUT(TRICE_HTOTL(v8));
142
+
143
+#define TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
144
+	TRICE_PUT(TRICE_HTOTL(v0));                                \
145
+	TRICE_PUT(TRICE_HTOTL(v1));                                \
146
+	TRICE_PUT(TRICE_HTOTL(v2));                                \
147
+	TRICE_PUT(TRICE_HTOTL(v3));                                \
148
+	TRICE_PUT(TRICE_HTOTL(v4));                                \
149
+	TRICE_PUT(TRICE_HTOTL(v5));                                \
150
+	TRICE_PUT(TRICE_HTOTL(v6));                                \
151
+	TRICE_PUT(TRICE_HTOTL(v7));                                \
152
+	TRICE_PUT(TRICE_HTOTL(v8));                                \
153
+	TRICE_PUT(TRICE_HTOTL(v9));
154
+
155
+#define TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
156
+	TRICE_PUT(TRICE_HTOTL(v0));                                     \
157
+	TRICE_PUT(TRICE_HTOTL(v1));                                     \
158
+	TRICE_PUT(TRICE_HTOTL(v2));                                     \
159
+	TRICE_PUT(TRICE_HTOTL(v3));                                     \
160
+	TRICE_PUT(TRICE_HTOTL(v4));                                     \
161
+	TRICE_PUT(TRICE_HTOTL(v5));                                     \
162
+	TRICE_PUT(TRICE_HTOTL(v6));                                     \
163
+	TRICE_PUT(TRICE_HTOTL(v7));                                     \
164
+	TRICE_PUT(TRICE_HTOTL(v8));                                     \
165
+	TRICE_PUT(TRICE_HTOTL(v9));                                     \
166
+	TRICE_PUT(TRICE_HTOTL(v10));
167
+
168
+#define TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
169
+	TRICE_PUT(TRICE_HTOTL(v0));                                          \
170
+	TRICE_PUT(TRICE_HTOTL(v1));                                          \
171
+	TRICE_PUT(TRICE_HTOTL(v2));                                          \
172
+	TRICE_PUT(TRICE_HTOTL(v3));                                          \
173
+	TRICE_PUT(TRICE_HTOTL(v4));                                          \
174
+	TRICE_PUT(TRICE_HTOTL(v5));                                          \
175
+	TRICE_PUT(TRICE_HTOTL(v6));                                          \
176
+	TRICE_PUT(TRICE_HTOTL(v7));                                          \
177
+	TRICE_PUT(TRICE_HTOTL(v8));                                          \
178
+	TRICE_PUT(TRICE_HTOTL(v9));                                          \
179
+	TRICE_PUT(TRICE_HTOTL(v10));                                         \
180
+	TRICE_PUT(TRICE_HTOTL(v11));
181
+
182
+// The following `TRICE` macro definitions uses the C preprocess to concatenate the code behind the sub-macros.
183
+// The sequence `tid` in this context is executable code `id(n)`, `Id(n)` or `ID(n)` defined in trice.h.
184
+// This works only with tid=`id(n)`, `Id(n)`, `ID(n)`.
185
+
186
+//! TRICE32_0 writes trice data as fast as possible in a buffer.
187
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
188
+#define TRICE32_0(tid, pFmt) \
189
+	TRICE_ENTER tid;         \
190
+	TRICE_CNTC(0);           \
191
+	TRICE_LEAVE
192
+
193
+//! TRICE32_1 writes trice data as fast as possible in a buffer.
194
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
195
+//! \param v0 a 32 bit bit value
196
+#define TRICE32_1(tid, pFmt, v0) \
197
+	TRICE_ENTER tid;             \
198
+	TRICE_CNTC(4);               \
199
+	TRICE_PUT32_1(v0)            \
200
+	TRICE_LEAVE
201
+
202
+//! TRICE32_2 writes trice data as fast as possible in a buffer.
203
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
204
+//! \param v0 - v1 are 32 bit values
205
+#define TRICE32_2(tid, pFmt, v0, v1) \
206
+	TRICE_ENTER tid;                 \
207
+	TRICE_CNTC(8);                   \
208
+	TRICE_PUT32_2(v0, v1);           \
209
+	TRICE_LEAVE
210
+
211
+//! TRICE32_3 writes trice data as fast as possible in a buffer.
212
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
213
+//! \param v0 - v2 are 32 bit bit values
214
+#define TRICE32_3(tid, pFmt, v0, v1, v2) \
215
+	TRICE_ENTER tid;                     \
216
+	TRICE_CNTC(12);                      \
217
+	TRICE_PUT32_3(v0, v1, v2);           \
218
+	TRICE_LEAVE
219
+
220
+//! TRICE32_4 writes trice data as fast as possible in a buffer.
221
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
222
+//! \param v0 - v3 are 32 bit bit values
223
+#define TRICE32_4(tid, pFmt, v0, v1, v2, v3) \
224
+	TRICE_ENTER tid;                         \
225
+	TRICE_CNTC(16);                          \
226
+	TRICE_PUT32_4(v0, v1, v2, v3);           \
227
+	TRICE_LEAVE
228
+
229
+//! TRICE32_5 writes trice data as fast as possible in a buffer.
230
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
231
+//! \param v0 - v4 are 32 bit bit values
232
+#define TRICE32_5(tid, pFmt, v0, v1, v2, v3, v4) \
233
+	TRICE_ENTER tid;                             \
234
+	TRICE_CNTC(20);                              \
235
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);           \
236
+	TRICE_LEAVE
237
+
238
+//! TRICE32_6 writes trice data as fast as possible in a buffer.
239
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
240
+//! \param v0 - v5 are 32 bit bit values
241
+#define TRICE32_6(tid, pFmt, v0, v1, v2, v3, v4, v5) \
242
+	TRICE_ENTER tid;                                 \
243
+	TRICE_CNTC(24);                                  \
244
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);           \
245
+	TRICE_LEAVE
246
+
247
+//! TRICE32_8 writes trice data as fast as possible in a buffer.
248
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
249
+//! \param v0 - v6 are 32 bit bit values
250
+#define TRICE32_7(tid, pFmt, v0, v1, v2, v3, v4, v5, v6) \
251
+	TRICE_ENTER tid;                                     \
252
+	TRICE_CNTC(28);                                      \
253
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);           \
254
+	TRICE_LEAVE
255
+
256
+//! TRICE32_8 writes trice data as fast as possible in a buffer.
257
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
258
+//! \param v0 - v7 are 32 bit bit values
259
+#define TRICE32_8(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7) \
260
+	TRICE_ENTER tid;                                         \
261
+	TRICE_CNTC(32);                                          \
262
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
263
+	TRICE_LEAVE
264
+
265
+//! TRICE32_8 writes trice data as fast as possible in a buffer.
266
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
267
+//! \param v0 - v7 are 32 bit bit values
268
+#define TRICE32_9(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
269
+	TRICE_ENTER tid;                                             \
270
+	TRICE_CNTC(36);                                              \
271
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);           \
272
+	TRICE_LEAVE
273
+
274
+//! TRICE32_8 writes trice data as fast as possible in a buffer.
275
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
276
+//! \param v0 - v7 are 32 bit bit values
277
+#define TRICE32_10(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
278
+	TRICE_ENTER tid;                                                  \
279
+	TRICE_CNTC(40);                                                   \
280
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);           \
281
+	TRICE_LEAVE
282
+
283
+//! TRICE32_8 writes trice data as fast as possible in a buffer.
284
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
285
+//! \param v0 - v7 are 32 bit bit values
286
+#define TRICE32_11(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
287
+	TRICE_ENTER tid;                                                       \
288
+	TRICE_CNTC(44);                                                        \
289
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);           \
290
+	TRICE_LEAVE
291
+
292
+//! TRICE32_12 writes trice data as fast as possible in a buffer.
293
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
294
+//! \param v0 - v11 are 32 bit bit values
295
+#define TRICE32_12(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
296
+	TRICE_ENTER tid;                                                            \
297
+	TRICE_CNTC(48);                                                             \
298
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)            \
299
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice32McuOrder.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice32McuOrder.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice32m_0(tid)                                              \
6
+	TRICE_ENTER                                                      \
7
+	TRICE_PUT((0 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
8
+	TRICE_LEAVE
9
+
10
+#define trice32m_1(tid, v0)                                          \
11
+	TRICE_ENTER                                                      \
12
+	TRICE_PUT((4 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
13
+	TRICE_PUT32_1(v0)                                                \
14
+	TRICE_LEAVE
15
+
16
+#define trice32m_2(tid, v0, v1)                                      \
17
+	TRICE_ENTER                                                      \
18
+	TRICE_PUT((8 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
19
+	TRICE_PUT32_2(v0, v1);                                           \
20
+	TRICE_LEAVE
21
+
22
+#define trice32m_3(tid, v0, v1, v2)                                   \
23
+	TRICE_ENTER                                                       \
24
+	TRICE_PUT((12 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
25
+	TRICE_PUT32_3(v0, v1, v2);                                        \
26
+	TRICE_LEAVE
27
+
28
+#define trice32m_4(tid, v0, v1, v2, v3)                               \
29
+	TRICE_ENTER                                                       \
30
+	TRICE_PUT((16 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
31
+	TRICE_PUT32_4(v0, v1, v2, v3);                                    \
32
+	TRICE_LEAVE
33
+
34
+#define trice32m_5(tid, v0, v1, v2, v3, v4)                           \
35
+	TRICE_ENTER                                                       \
36
+	TRICE_PUT((20 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
37
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);                                \
38
+	TRICE_LEAVE
39
+
40
+#define trice32m_6(tid, v0, v1, v2, v3, v4, v5)                       \
41
+	TRICE_ENTER                                                       \
42
+	TRICE_PUT((24 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
43
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);                            \
44
+	TRICE_LEAVE
45
+
46
+#define trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6)                   \
47
+	TRICE_ENTER                                                       \
48
+	TRICE_PUT((28 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
49
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);                        \
50
+	TRICE_LEAVE
51
+
52
+#define trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)               \
53
+	TRICE_ENTER                                                       \
54
+	TRICE_PUT((32 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
55
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);                    \
56
+	TRICE_LEAVE
57
+
58
+#define trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)           \
59
+	TRICE_ENTER                                                       \
60
+	TRICE_PUT((36 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
61
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);                \
62
+	TRICE_LEAVE
63
+
64
+#define trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)      \
65
+	TRICE_ENTER                                                       \
66
+	TRICE_PUT((40 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
67
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);           \
68
+	TRICE_LEAVE
69
+
70
+#define trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT((44 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
73
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                            \
78
+	TRICE_PUT((48 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid)));      \
79
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice32m_0(tid)                            \
83
+	TRICE_ENTER                                    \
84
+	uint16_t ts = TriceStamp16;                    \
85
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
86
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | ts); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice32m_1(tid, v0)                        \
90
+	TRICE_ENTER                                    \
91
+	uint16_t ts = TriceStamp16;                    \
92
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
93
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | ts); \
94
+	TRICE_PUT32_1(v0)                              \
95
+	TRICE_LEAVE
96
+
97
+#define Trice32m_2(tid, v0, v1)                    \
98
+	TRICE_ENTER                                    \
99
+	uint16_t ts = TriceStamp16;                    \
100
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
101
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | ts); \
102
+	TRICE_PUT32_2(v0, v1);                         \
103
+	TRICE_LEAVE
104
+
105
+#define Trice32m_3(tid, v0, v1, v2)                 \
106
+	TRICE_ENTER                                     \
107
+	uint16_t ts = TriceStamp16;                     \
108
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
109
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | ts); \
110
+	TRICE_PUT32_3(v0, v1, v2);                      \
111
+	TRICE_LEAVE
112
+
113
+#define Trice32m_4(tid, v0, v1, v2, v3)             \
114
+	TRICE_ENTER                                     \
115
+	uint16_t ts = TriceStamp16;                     \
116
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
117
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | ts); \
118
+	TRICE_PUT32_4(v0, v1, v2, v3);                  \
119
+	TRICE_LEAVE
120
+
121
+#define Trice32m_5(tid, v0, v1, v2, v3, v4)         \
122
+	TRICE_ENTER                                     \
123
+	uint16_t ts = TriceStamp16;                     \
124
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
125
+	TRICE_PUT(20 << 24 | (TRICE_CYCLE << 16) | ts); \
126
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);              \
127
+	TRICE_LEAVE
128
+
129
+#define Trice32m_6(tid, v0, v1, v2, v3, v4, v5)     \
130
+	TRICE_ENTER                                     \
131
+	uint16_t ts = TriceStamp16;                     \
132
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
133
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | ts); \
134
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);          \
135
+	TRICE_LEAVE
136
+
137
+#define Trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6) \
138
+	TRICE_ENTER                                     \
139
+	uint16_t ts = TriceStamp16;                     \
140
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
141
+	TRICE_PUT(28 << 24 | (TRICE_CYCLE << 16) | ts); \
142
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);      \
143
+	TRICE_LEAVE
144
+
145
+#define Trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7) \
146
+	TRICE_ENTER                                         \
147
+	uint16_t ts = TriceStamp16;                         \
148
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));        \
149
+	TRICE_PUT(32 << 24 | (TRICE_CYCLE << 16) | ts);     \
150
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);      \
151
+	TRICE_LEAVE
152
+
153
+#define Trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
154
+	TRICE_ENTER                                             \
155
+	uint16_t ts = TriceStamp16;                             \
156
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));            \
157
+	TRICE_PUT(36 << 24 | (TRICE_CYCLE << 16) | ts);         \
158
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
159
+	TRICE_LEAVE
160
+
161
+#define Trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                  \
163
+	uint16_t ts = TriceStamp16;                                  \
164
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                 \
165
+	TRICE_PUT(40 << 24 | (TRICE_CYCLE << 16) | ts);              \
166
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                       \
171
+	uint16_t ts = TriceStamp16;                                       \
172
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                      \
173
+	TRICE_PUT(44 << 24 | (TRICE_CYCLE << 16) | ts);                   \
174
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                            \
179
+	uint16_t ts = TriceStamp16;                                            \
180
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                           \
181
+	TRICE_PUT(48 << 24 | (TRICE_CYCLE << 16) | ts);                        \
182
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice32m_0(tid)                                    \
186
+	TRICE_ENTER                                            \
187
+	uint32_t ts = TriceStamp32;                            \
188
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
189
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
190
+	TRICE_LEAVE
191
+
192
+#define TRice32m_1(tid, v0)                                \
193
+	TRICE_ENTER                                            \
194
+	uint32_t ts = TriceStamp32;                            \
195
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
196
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
197
+	TRICE_PUT32_1(v0)                                      \
198
+	TRICE_LEAVE
199
+
200
+#define TRice32m_2(tid, v0, v1)                            \
201
+	TRICE_ENTER                                            \
202
+	uint32_t ts = TriceStamp32;                            \
203
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
204
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
205
+	TRICE_PUT32_2(v0, v1);                                 \
206
+	TRICE_LEAVE
207
+
208
+#define TRice32m_3(tid, v0, v1, v2)                         \
209
+	TRICE_ENTER                                             \
210
+	uint32_t ts = TriceStamp32;                             \
211
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
212
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
213
+	TRICE_PUT32_3(v0, v1, v2);                              \
214
+	TRICE_LEAVE
215
+
216
+#define TRice32m_4(tid, v0, v1, v2, v3)                     \
217
+	TRICE_ENTER                                             \
218
+	uint32_t ts = TriceStamp32;                             \
219
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
220
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
221
+	TRICE_PUT32_4(v0, v1, v2, v3);                          \
222
+	TRICE_LEAVE
223
+
224
+#define TRice32m_5(tid, v0, v1, v2, v3, v4)                 \
225
+	TRICE_ENTER                                             \
226
+	uint32_t ts = TriceStamp32;                             \
227
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
228
+	TRICE_PUT(20 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
229
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);                      \
230
+	TRICE_LEAVE
231
+
232
+#define TRice32m_6(tid, v0, v1, v2, v3, v4, v5)             \
233
+	TRICE_ENTER                                             \
234
+	uint32_t ts = TriceStamp32;                             \
235
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
236
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
237
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);                  \
238
+	TRICE_LEAVE
239
+
240
+#define TRice32m_7(tid, v0, v1, v2, v3, v4, v5, v6)         \
241
+	TRICE_ENTER                                             \
242
+	uint32_t ts = TriceStamp32;                             \
243
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
244
+	TRICE_PUT(28 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
245
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);              \
246
+	TRICE_LEAVE
247
+
248
+#define TRice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)     \
249
+	TRICE_ENTER                                             \
250
+	uint32_t ts = TriceStamp32;                             \
251
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
252
+	TRICE_PUT(32 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
253
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
254
+	TRICE_LEAVE
255
+
256
+#define TRice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
257
+	TRICE_ENTER                                             \
258
+	uint32_t ts = TriceStamp32;                             \
259
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
260
+	TRICE_PUT(36 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
261
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
262
+	TRICE_LEAVE
263
+
264
+#define TRice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                  \
266
+	uint32_t ts = TriceStamp32;                                  \
267
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                      \
268
+	TRICE_PUT(40 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));      \
269
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                       \
274
+	uint32_t ts = TriceStamp32;                                       \
275
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                           \
276
+	TRICE_PUT(44 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));           \
277
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                            \
282
+	uint32_t ts = TriceStamp32;                                            \
283
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                                \
284
+	TRICE_PUT(48 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));                \
285
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice32McuReverse.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice32McuReverse.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice32m_0(tid)                      \
6
+	TRICE_ENTER                              \
7
+	TRICE_PUT(((TRICE_CYCLE) << 24) | idLH); \
8
+	TRICE_LEAVE
9
+
10
+#define trice32m_1(tid, v0)                              \
11
+	TRICE_ENTER                                          \
12
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (4 << 16) | idLH); \
13
+	TRICE_PUT32_1(v0)                                    \
14
+	TRICE_LEAVE
15
+
16
+#define trice32m_2(tid, v0, v1)                          \
17
+	TRICE_ENTER                                          \
18
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (8 << 16) | idLH); \
19
+	TRICE_PUT32_2(v0, v1);                               \
20
+	TRICE_LEAVE
21
+
22
+#define trice32m_3(tid, v0, v1, v2)                       \
23
+	TRICE_ENTER                                           \
24
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (12 << 16) | idLH); \
25
+	TRICE_PUT32_3(v0, v1, v2);                            \
26
+	TRICE_LEAVE
27
+
28
+#define trice32m_4(tid, v0, v1, v2, v3)                   \
29
+	TRICE_ENTER                                           \
30
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (16 << 16) | idLH); \
31
+	TRICE_PUT32_4(v0, v1, v2, v3);                        \
32
+	TRICE_LEAVE
33
+
34
+#define trice32m_5(tid, v0, v1, v2, v3, v4)               \
35
+	TRICE_ENTER                                           \
36
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (20 << 16) | idLH); \
37
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);                    \
38
+	TRICE_LEAVE
39
+
40
+#define trice32m_6(tid, v0, v1, v2, v3, v4, v5)           \
41
+	TRICE_ENTER                                           \
42
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (24 << 16) | idLH); \
43
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);                \
44
+	TRICE_LEAVE
45
+
46
+#define trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6)       \
47
+	TRICE_ENTER                                           \
48
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (28 << 16) | idLH); \
49
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);            \
50
+	TRICE_LEAVE
51
+
52
+#define trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)   \
53
+	TRICE_ENTER                                           \
54
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (32 << 16) | idLH); \
55
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);        \
56
+	TRICE_LEAVE
57
+
58
+#define trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
59
+	TRICE_ENTER                                             \
60
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (36 << 16) | idLH);   \
61
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
62
+	TRICE_LEAVE
63
+
64
+#define trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
65
+	TRICE_ENTER                                                  \
66
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (40 << 16) | idLH);        \
67
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
68
+	TRICE_LEAVE
69
+
70
+#define trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (44 << 16) | idLH);             \
73
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                            \
78
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (48 << 16) | idLH);                  \
79
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice32m_0(tid)                         \
83
+	TRICE_ENTER                                 \
84
+	uint16_t ts = TriceStamp16;                 \
85
+	TRICE_PUT(((IdLH) << 16) | IdLH)            \
86
+	TRICE_PUT((TRICE_CYCLE << 24) | tsL | tsH); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice32m_1(tid, v0)                                 \
90
+	TRICE_ENTER                                             \
91
+	uint16_t ts = TriceStamp16;                             \
92
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
93
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsL | tsH); \
94
+	TRICE_PUT32_1(v0)                                       \
95
+	TRICE_LEAVE
96
+
97
+#define Trice32m_2(tid, v0, v1)                             \
98
+	TRICE_ENTER                                             \
99
+	uint16_t ts = TriceStamp16;                             \
100
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
101
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsL | tsH); \
102
+	TRICE_PUT32_2(v0, v1);                                  \
103
+	TRICE_LEAVE
104
+
105
+#define Trice32m_3(tid, v0, v1, v2)                          \
106
+	TRICE_ENTER                                              \
107
+	uint16_t ts = TriceStamp16;                              \
108
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
109
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsL | tsH); \
110
+	TRICE_PUT32_3(v0, v1, v2);                               \
111
+	TRICE_LEAVE
112
+
113
+#define Trice32m_4(tid, v0, v1, v2, v3)                      \
114
+	TRICE_ENTER                                              \
115
+	uint16_t ts = TriceStamp16;                              \
116
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
117
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsL | tsH); \
118
+	TRICE_PUT32_4(v0, v1, v2, v3);                           \
119
+	TRICE_LEAVE
120
+
121
+#define Trice32m_5(tid, v0, v1, v2, v3, v4)                  \
122
+	TRICE_ENTER                                              \
123
+	uint16_t ts = TriceStamp16;                              \
124
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
125
+	TRICE_PUT((TRICE_CYCLE << 24) | (20 << 16) | tsL | tsH); \
126
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);                       \
127
+	TRICE_LEAVE
128
+
129
+#define Trice32m_6(tid, v0, v1, v2, v3, v4, v5)              \
130
+	TRICE_ENTER                                              \
131
+	uint16_t ts = TriceStamp16;                              \
132
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
133
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsL | tsH); \
134
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);                   \
135
+	TRICE_LEAVE
136
+
137
+#define Trice32m_7(tid, v0, v1, v2, v3, v4, v5, v6)          \
138
+	TRICE_ENTER                                              \
139
+	uint16_t ts = TriceStamp16;                              \
140
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
141
+	TRICE_PUT((TRICE_CYCLE << 24) | (28 << 16) | tsL | tsH); \
142
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);               \
143
+	TRICE_LEAVE
144
+
145
+#define Trice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)      \
146
+	TRICE_ENTER                                              \
147
+	uint16_t ts = TriceStamp16;                              \
148
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
149
+	TRICE_PUT((TRICE_CYCLE << 24) | (32 << 16) | tsL | tsH); \
150
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
151
+	TRICE_LEAVE
152
+
153
+#define Trice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)  \
154
+	TRICE_ENTER                                              \
155
+	uint16_t ts = TriceStamp16;                              \
156
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
157
+	TRICE_PUT((TRICE_CYCLE << 24) | (36 << 16) | tsL | tsH); \
158
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);       \
159
+	TRICE_LEAVE
160
+
161
+#define Trice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                  \
163
+	uint16_t ts = TriceStamp16;                                  \
164
+	TRICE_PUT(((IdLH) << 16) | IdLH)                             \
165
+	TRICE_PUT((TRICE_CYCLE << 24) | (40 << 16) | tsL | tsH);     \
166
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                       \
171
+	uint16_t ts = TriceStamp16;                                       \
172
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                  \
173
+	TRICE_PUT((TRICE_CYCLE << 24) | (44 << 16) | tsL | tsH);          \
174
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                            \
179
+	uint16_t ts = TriceStamp16;                                            \
180
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                       \
181
+	TRICE_PUT((TRICE_CYCLE << 24) | (48 << 16) | tsL | tsH);               \
182
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice32m_0(tid)                          \
186
+	TRICE_ENTER                                  \
187
+	uint32_t ts = TriceStamp32;                  \
188
+	TRICE_PUT(tsHL | tsHH | IDLH)                \
189
+	TRICE_PUT((TRICE_CYCLE << 24) | tsLL | tsLH) \
190
+	TRICE_LEAVE
191
+
192
+#define TRice32m_1(tid, v0)                                  \
193
+	TRICE_ENTER                                              \
194
+	uint32_t ts = TriceStamp32;                              \
195
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
196
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsLL | tsLH) \
197
+	TRICE_PUT32_1(v0)                                        \
198
+	TRICE_LEAVE
199
+
200
+#define TRice32m_2(tid, v0, v1)                              \
201
+	TRICE_ENTER                                              \
202
+	uint32_t ts = TriceStamp32;                              \
203
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
204
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsLL | tsLH) \
205
+	TRICE_PUT32_2(v0, v1);                                   \
206
+	TRICE_LEAVE
207
+
208
+#define TRice32m_3(tid, v0, v1, v2)                           \
209
+	TRICE_ENTER                                               \
210
+	uint32_t ts = TriceStamp32;                               \
211
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
212
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsLL | tsLH) \
213
+	TRICE_PUT32_3(v0, v1, v2);                                \
214
+	TRICE_LEAVE
215
+
216
+#define TRice32m_4(tid, v0, v1, v2, v3)                       \
217
+	TRICE_ENTER                                               \
218
+	uint32_t ts = TriceStamp32;                               \
219
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
220
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsLL | tsLH) \
221
+	TRICE_PUT32_4(v0, v1, v2, v3);                            \
222
+	TRICE_LEAVE
223
+
224
+#define TRice32m_5(tid, v0, v1, v2, v3, v4)                   \
225
+	TRICE_ENTER                                               \
226
+	uint32_t ts = TriceStamp32;                               \
227
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
228
+	TRICE_PUT((TRICE_CYCLE << 24) | (20 << 16) | tsLL | tsLH) \
229
+	TRICE_PUT32_5(v0, v1, v2, v3, v4);                        \
230
+	TRICE_LEAVE
231
+
232
+#define TRice32m_6(tid, v0, v1, v2, v3, v4, v5)               \
233
+	TRICE_ENTER                                               \
234
+	uint32_t ts = TriceStamp32;                               \
235
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
236
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsLL | tsLH) \
237
+	TRICE_PUT32_6(v0, v1, v2, v3, v4, v5);                    \
238
+	TRICE_LEAVE
239
+
240
+#define TRice32m_7(tid, v0, v1, v2, v3, v4, v5, v6)           \
241
+	TRICE_ENTER                                               \
242
+	uint32_t ts = TriceStamp32;                               \
243
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
244
+	TRICE_PUT((TRICE_CYCLE << 24) | (28 << 16) | tsLL | tsLH) \
245
+	TRICE_PUT32_7(v0, v1, v2, v3, v4, v5, v6);                \
246
+	TRICE_LEAVE
247
+
248
+#define TRice32m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)       \
249
+	TRICE_ENTER                                               \
250
+	uint32_t ts = TriceStamp32;                               \
251
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
252
+	TRICE_PUT((TRICE_CYCLE << 24) | (32 << 16) | tsLL | tsLH) \
253
+	TRICE_PUT32_8(v0, v1, v2, v3, v4, v5, v6, v7);            \
254
+	TRICE_LEAVE
255
+
256
+#define TRice32m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)   \
257
+	TRICE_ENTER                                               \
258
+	uint32_t ts = TriceStamp32;                               \
259
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
260
+	TRICE_PUT((TRICE_CYCLE << 24) | (36 << 16) | tsLL | tsLH) \
261
+	TRICE_PUT32_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);        \
262
+	TRICE_LEAVE
263
+
264
+#define TRice32m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                  \
266
+	uint32_t ts = TriceStamp32;                                  \
267
+	TRICE_PUT(tsHL | tsHH | IDLH)                                \
268
+	TRICE_PUT((TRICE_CYCLE << 24) | (40 << 16) | tsLL | tsLH)    \
269
+	TRICE_PUT32_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice32m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                       \
274
+	uint32_t ts = TriceStamp32;                                       \
275
+	TRICE_PUT(tsHL | tsHH | IDLH)                                     \
276
+	TRICE_PUT((TRICE_CYCLE << 24) | (44 << 16) | tsLL | tsLH)         \
277
+	TRICE_PUT32_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice32m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                            \
282
+	uint32_t ts = TriceStamp32;                                            \
283
+	TRICE_PUT(tsHL | tsHH | IDLH)                                          \
284
+	TRICE_PUT((TRICE_CYCLE << 24) | (48 << 16) | tsLL | tsLH)              \
285
+	TRICE_PUT32_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 561
- 0
Middlewares/trice/trice64.c Переглянути файл

@@ -0,0 +1,561 @@
1
+//! \file trice64.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//! ///////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+// lint -e529  Warning 529: Symbol '_SEGGER_RTT__LockState' not subsequently referenced
7
+// lint -e701  Info 701: Shift left of signed quantity (int)
8
+// lint -e712  Info 712: Loss of precision (assignment) (unsigned long long to unsigned int)
9
+
10
+#if TRICE_64_BIT_SUPPORT == 1 && TRICE_OFF == 0
11
+
12
+// no-stamp 64-bit-values functions
13
+#ifndef ENABLE_trice64fn_0
14
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 0 * 8) + 3) & ~3)
15
+#define ENABLE_trice64fn_0 0 //!< Disables no-stamp 64-bit 0 values functions.
16
+#else
17
+#define ENABLE_trice64fn_0 1 //!< Enables  no-stamp 64-bit 0 values functions.
18
+#endif
19
+#endif
20
+
21
+#ifndef ENABLE_trice64fn_1
22
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 1 * 8) + 3) & ~3)
23
+#define ENABLE_trice64fn_1 0 //!< Disables no-stamp 64-bit 1 values functions.
24
+#else
25
+#define ENABLE_trice64fn_1 1 //!< Enables  no-stamp 64-bit 1 values functions.
26
+#endif
27
+#endif
28
+
29
+#ifndef ENABLE_trice64fn_2
30
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 2 * 8) + 3) & ~3)
31
+#define ENABLE_trice64fn_2 0 //!< Disables no-stamp 64-bit 2 values functions.
32
+#else
33
+#define ENABLE_trice64fn_2 1 //!< Enables  no-stamp 64-bit 2 values functions.
34
+#endif
35
+#endif
36
+
37
+#ifndef ENABLE_trice64fn_3
38
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 3 * 8) + 3) & ~3)
39
+#define ENABLE_trice64fn_3 0 //!< Disables no-stamp 64-bit 3 values functions.
40
+#else
41
+#define ENABLE_trice64fn_3 1 //!< Enables  no-stamp 64-bit 3 values functions.
42
+#endif
43
+#endif
44
+
45
+#ifndef ENABLE_trice64fn_4
46
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 4 * 8) + 3) & ~3)
47
+#define ENABLE_trice64fn_4 0 //!< Disables no-stamp 64-bit 4 values functions.
48
+#else
49
+#define ENABLE_trice64fn_4 1 //!< Enables  no-stamp 64-bit 4 values functions.
50
+#endif
51
+#endif
52
+
53
+#ifndef ENABLE_trice64fn_5
54
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 5 * 8) + 3) & ~3)
55
+#define ENABLE_trice64fn_5 0 //!< Disables no-stamp 64-bit 5 values functions.
56
+#else
57
+#define ENABLE_trice64fn_5 1 //!< Enables  no-stamp 64-bit 5 values functions.
58
+#endif
59
+#endif
60
+
61
+#ifndef ENABLE_trice64fn_6
62
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 6 * 8) + 3) & ~3)
63
+#define ENABLE_trice64fn_6 0 //!< Disables no-stamp 64-bit 6 values functions.
64
+#else
65
+#define ENABLE_trice64fn_6 1 //!< Enables  no-stamp 64-bit 6 values functions.
66
+#endif
67
+#endif
68
+
69
+#ifndef ENABLE_trice64fn_7
70
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 7 * 8) + 3) & ~3)
71
+#define ENABLE_trice64fn_7 0 //!< Disables no-stamp 64-bit 7 values functions.
72
+#else
73
+#define ENABLE_trice64fn_7 1 //!< Enables  no-stamp 64-bit 7 values functions.
74
+#endif
75
+#endif
76
+
77
+#ifndef ENABLE_trice64fn_8
78
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 8 * 8) + 3) & ~3)
79
+#define ENABLE_trice64fn_8 0 //!< Disables no-stamp 64-bit 8 values functions.
80
+#else
81
+#define ENABLE_trice64fn_8 1 //!< Enables  no-stamp 64-bit 8 values functions.
82
+#endif
83
+#endif
84
+
85
+#ifndef ENABLE_trice64fn_9
86
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 9 * 8) + 3) & ~3)
87
+#define ENABLE_trice64fn_9 0 //!< Disables no-stamp 64-bit 9 values functions.
88
+#else
89
+#define ENABLE_trice64fn_9 1 //!< Enables  no-stamp 64-bit 9 values functions.
90
+#endif
91
+#endif
92
+
93
+#ifndef ENABLE_trice64fn_10
94
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 10 * 8) + 3) & ~3)
95
+#define ENABLE_trice64fn_10 0 //!< Disables no-stamp 64-bit 10 values functions.
96
+#else
97
+#define ENABLE_trice64fn_10 1 //!< Enables  no-stamp 64-bit 10 values functions.
98
+#endif
99
+#endif
100
+
101
+#ifndef ENABLE_trice64fn_11
102
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 11 * 8) + 3) & ~3)
103
+#define ENABLE_trice64fn_11 0 //!< Disables no-stamp 64-bit 11 values functions.
104
+#else
105
+#define ENABLE_trice64fn_11 1 //!< Enables  no-stamp 64-bit 11 values functions.
106
+#endif
107
+#endif
108
+
109
+#ifndef ENABLE_trice64fn_12
110
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 12 * 8) + 3) & ~3)
111
+#define ENABLE_trice64fn_12 0 //!< Disables no-stamp 64-bit 12 values functions.
112
+#else
113
+#define ENABLE_trice64fn_12 1 //!< Enables  no-stamp 64-bit 12 values functions.
114
+#endif
115
+#endif
116
+
117
+// with 16-bit-stamp 64-bit-values functions (16-bit-stamps need 4 bytes for allocation reasons)
118
+#ifndef ENABLE_Trice64fn_0
119
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 8) + 3) & ~3)
120
+#define ENABLE_Trice64fn_0 0 //!< Disables 16-bit stamp 64-bit 0 values functions.
121
+#else
122
+#define ENABLE_Trice64fn_0 1 //!< Enables  16-bit stamp 64-bit 0 values functions.
123
+#endif
124
+#endif
125
+
126
+#ifndef ENABLE_Trice64fn_1
127
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 8) + 3) & ~3)
128
+#define ENABLE_Trice64fn_1 0 //!< Disables 16-bit stamp 64-bit 1 values functions.
129
+#else
130
+#define ENABLE_Trice64fn_1 1 //!< Enables  16-bit stamp 64-bit 1 values functions.
131
+#endif
132
+#endif
133
+
134
+#ifndef ENABLE_Trice64fn_2
135
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 8) + 3) & ~3)
136
+#define ENABLE_Trice64fn_2 0 //!< Disables 16-bit stamp 64-bit 2 values functions.
137
+#else
138
+#define ENABLE_Trice64fn_2 1 //!< Enables  16-bit stamp 64-bit 2 values functions.
139
+#endif
140
+#endif
141
+
142
+#ifndef ENABLE_Trice64fn_3
143
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 8) + 3) & ~3)
144
+#define ENABLE_Trice64fn_3 0 //!< Disables 16-bit stamp 64-bit 3 values functions.
145
+#else
146
+#define ENABLE_Trice64fn_3 1 //!< Enables  16-bit stamp 64-bit 3 values functions.
147
+#endif
148
+#endif
149
+
150
+#ifndef ENABLE_Trice64fn_4
151
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 8) + 3) & ~3)
152
+#define ENABLE_Trice64fn_4 0 //!< Disables 16-bit stamp 64-bit 4 values functions.
153
+#else
154
+#define ENABLE_Trice64fn_4 1 //!< Enables  16-bit stamp 64-bit 4 values functions.
155
+#endif
156
+#endif
157
+
158
+#ifndef ENABLE_Trice64fn_5
159
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 8) + 3) & ~3)
160
+#define ENABLE_Trice64fn_5 0 //!< Disables 16-bit stamp 64-bit 5 values functions.
161
+#else
162
+#define ENABLE_Trice64fn_5 1 //!< Enables  16-bit stamp 64-bit 5 values functions.
163
+#endif
164
+#endif
165
+
166
+#ifndef ENABLE_Trice64fn_6
167
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 8) + 3) & ~3)
168
+#define ENABLE_Trice64fn_6 0 //!< Disables 16-bit stamp 64-bit 6 values functions.
169
+#else
170
+#define ENABLE_Trice64fn_6 1 //!< Enables  16-bit stamp 64-bit 6 values functions.
171
+#endif
172
+#endif
173
+
174
+#ifndef ENABLE_Trice64fn_7
175
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 8) + 3) & ~3)
176
+#define ENABLE_Trice64fn_7 0 //!< Disables 16-bit stamp 64-bit 7 values functions.
177
+#else
178
+#define ENABLE_Trice64fn_7 1 //!< Enables  16-bit stamp 64-bit 7 values functions.
179
+#endif
180
+#endif
181
+
182
+#ifndef ENABLE_Trice64fn_8
183
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 8) + 3) & ~3)
184
+#define ENABLE_Trice64fn_8 0 //!< Disables 16-bit stamp 64-bit 8 values functions.
185
+#else
186
+#define ENABLE_Trice64fn_8 1 //!< Enables  16-bit stamp 64-bit 8 values functions.
187
+#endif
188
+#endif
189
+
190
+#ifndef ENABLE_Trice64fn_9
191
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 8) + 3) & ~3)
192
+#define ENABLE_Trice64fn_9 0 //!< Disables 16-bit stamp 64-bit 9 values functions.
193
+#else
194
+#define ENABLE_Trice64fn_9 1 //!< Enables  16-bit stamp 64-bit 9 values functions.
195
+#endif
196
+#endif
197
+
198
+#ifndef ENABLE_Trice64fn_10
199
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 8) + 3) & ~3)
200
+#define ENABLE_Trice64fn_10 0 //!< Disables 16-bit stamp 64-bit 10 values functions.
201
+#else
202
+#define ENABLE_Trice64fn_10 1 //!< Enables  16-bit stamp 64-bit 10 values functions.
203
+#endif
204
+#endif
205
+
206
+#ifndef ENABLE_Trice64fn_11
207
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 8) + 3) & ~3)
208
+#define ENABLE_Trice64fn_11 0 //!< Disables 16-bit stamp 64-bit 11 values functions.
209
+#else
210
+#define ENABLE_Trice64fn_11 1 //!< Enables  16-bit stamp 64-bit 11 values functions.
211
+#endif
212
+#endif
213
+
214
+#ifndef ENABLE_Trice64fn_12
215
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 8) + 3) & ~3)
216
+#define ENABLE_Trice64fn_12 0 //!< Disables 16-bit stamp 64-bit 12 values functions.
217
+#else
218
+#define ENABLE_Trice64fn_12 1 //!< Enables  16-bit stamp 64-bit 12 values functions.
219
+#endif
220
+#endif
221
+
222
+// with 32-bit-stamp 64-bit-values functions
223
+#ifndef ENABLE_TRice64fn_0
224
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 8) + 3) & ~3)
225
+#define ENABLE_TRice64fn_0 0 //!< Disables 32-bit-stamp 64-bit 0 values functions.
226
+#else
227
+#define ENABLE_TRice64fn_0 1 //!< Enables  32-bit-stamp 64-bit 0 values functions.
228
+#endif
229
+#endif
230
+
231
+#ifndef ENABLE_TRice64fn_1
232
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 8) + 3) & ~3)
233
+#define ENABLE_TRice64fn_1 0 //!< Disables 32-bit-stamp 64-bit 1 values functions.
234
+#else
235
+#define ENABLE_TRice64fn_1 1 //!< Enables  32-bit-stamp 64-bit 1 values functions.
236
+#endif
237
+#endif
238
+
239
+#ifndef ENABLE_TRice64fn_2
240
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 8) + 3) & ~3)
241
+#define ENABLE_TRice64fn_2 0 //!< Disables 32-bit-stamp 64-bit 2 values functions.
242
+#else
243
+#define ENABLE_TRice64fn_2 1 //!< Enables  32-bit-stamp 64-bit 2 values functions.
244
+#endif
245
+#endif
246
+
247
+#ifndef ENABLE_TRice64fn_3
248
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 8) + 3) & ~3)
249
+#define ENABLE_TRice64fn_3 0 //!< Disables 32-bit-stamp 64-bit 3 values functions.
250
+#else
251
+#define ENABLE_TRice64fn_3 1 //!< Enables  32-bit-stamp 64-bit 3 values functions.
252
+#endif
253
+#endif
254
+
255
+#ifndef ENABLE_TRice64fn_4
256
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 8) + 3) & ~3)
257
+#define ENABLE_TRice64fn_4 0 //!< Disables 32-bit-stamp 64-bit 4 values functions.
258
+#else
259
+#define ENABLE_TRice64fn_4 1 //!< Enables  32-bit-stamp 64-bit 4 values functions.
260
+#endif
261
+#endif
262
+
263
+#ifndef ENABLE_TRice64fn_5
264
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 8) + 3) & ~3)
265
+#define ENABLE_TRice64fn_5 0 //!< Disables 32-bit-stamp 64-bit 5 values functions.
266
+#else
267
+#define ENABLE_TRice64fn_5 1 //!< Enables  32-bit-stamp 64-bit 5 values functions.
268
+#endif
269
+#endif
270
+
271
+#ifndef ENABLE_TRice64fn_6
272
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 8) + 3) & ~3)
273
+#define ENABLE_TRice64fn_6 0 //!< Disables 32-bit-stamp 64-bit 6 values functions.
274
+#else
275
+#define ENABLE_TRice64fn_6 1 //!< Enables  32-bit-stamp 64-bit 6 values functions.
276
+#endif
277
+#endif
278
+
279
+#ifndef ENABLE_TRice64fn_7
280
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 8) + 3) & ~3)
281
+#define ENABLE_TRice64fn_7 0 //!< Disables 32-bit-stamp 64-bit 7 values functions.
282
+#else
283
+#define ENABLE_TRice64fn_7 1 //!< Enables  32-bit-stamp 64-bit 7 values functions.
284
+#endif
285
+#endif
286
+
287
+#ifndef ENABLE_TRice64fn_8
288
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 8) + 3) & ~3)
289
+#define ENABLE_TRice64fn_8 0 //!< Disables 32-bit-stamp 64-bit 8 values functions.
290
+#else
291
+#define ENABLE_TRice64fn_8 1 //!< Enables  32-bit-stamp 64-bit 8 values functions.
292
+#endif
293
+#endif
294
+
295
+#ifndef ENABLE_TRice64fn_9
296
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 8) + 3) & ~3)
297
+#define ENABLE_TRice64fn_9 0 //!< Disables 32-bit-stamp 64-bit 9 values functions.
298
+#else
299
+#define ENABLE_TRice64fn_9 1 //!< Enables  32-bit-stamp 64-bit 9 values functions.
300
+#endif
301
+#endif
302
+
303
+#ifndef ENABLE_TRice64fn_10
304
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 8) + 3) & ~3)
305
+#define ENABLE_TRice64fn_10 0 //!< Disables 32-bit-stamp 64-bit 10 values functions.
306
+#else
307
+#define ENABLE_TRice64fn_10 1 //!< Enables  32-bit-stamp 64-bit 10 values functions.
308
+#endif
309
+#endif
310
+
311
+#ifndef ENABLE_TRice64fn_11
312
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 8) + 3) & ~3)
313
+#define ENABLE_TRice64fn_11 0 //!< Disables 32-bit-stamp 64-bit 11 values functions.
314
+#else
315
+#define ENABLE_TRice64fn_11 1 //!< Enables  32-bit-stamp 64-bit 11 values functions.
316
+#endif
317
+#endif
318
+
319
+#ifndef ENABLE_TRice64fn_12
320
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 8) + 3) & ~3)
321
+#define ENABLE_TRice64fn_12 0 //!< Disables 32-bit-stamp 64-bit 12 values functions.
322
+#else
323
+#define ENABLE_TRice64fn_12 1 //!< Enables  32-bit-stamp 64-bit 12 values functions.
324
+#endif
325
+#endif
326
+
327
+#if ENABLE_trice64fn_0
328
+void trice64fn_0(uint16_t tid) {
329
+	trice64m_0(tid);
330
+}
331
+#endif
332
+
333
+#if ENABLE_trice64fn_1
334
+void trice64fn_1(uint16_t tid, uint64_t v0) {
335
+	trice64m_1(tid, v0);
336
+}
337
+#endif
338
+
339
+#if ENABLE_trice64fn_2
340
+void trice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1) {
341
+	trice64m_2(tid, v0, v1);
342
+}
343
+#endif
344
+
345
+#if ENABLE_trice64fn_3
346
+void trice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2) {
347
+	trice64m_3(tid, v0, v1, v2);
348
+}
349
+#endif
350
+
351
+#if ENABLE_trice64fn_4
352
+void trice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3) {
353
+	trice64m_4(tid, v0, v1, v2, v3);
354
+}
355
+#endif
356
+
357
+#if ENABLE_trice64fn_5
358
+void trice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4) {
359
+	trice64m_5(tid, v0, v1, v2, v3, v4);
360
+}
361
+#endif
362
+
363
+#if ENABLE_trice64fn_6
364
+void trice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5) {
365
+	trice64m_6(tid, v0, v1, v2, v3, v4, v5);
366
+}
367
+#endif
368
+
369
+#if ENABLE_trice64fn_7
370
+void trice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6) {
371
+	trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6);
372
+}
373
+#endif
374
+
375
+#if ENABLE_trice64fn_8
376
+void trice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7) {
377
+	trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
378
+}
379
+#endif
380
+
381
+#if ENABLE_trice64fn_9
382
+void trice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8) {
383
+	trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
384
+}
385
+#endif
386
+
387
+#if ENABLE_trice64fn_10
388
+void trice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9) {
389
+	trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
390
+}
391
+#endif
392
+
393
+#if ENABLE_trice64fn_11
394
+void trice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10) {
395
+	trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
396
+}
397
+#endif
398
+
399
+#if ENABLE_trice64fn_12
400
+void trice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11) {
401
+	trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
402
+}
403
+#endif
404
+
405
+#if ENABLE_Trice64fn_0
406
+void Trice64fn_0(uint16_t tid) {
407
+	Trice64m_0(tid);
408
+}
409
+#endif
410
+
411
+#if ENABLE_Trice64fn_1
412
+void Trice64fn_1(uint16_t tid, uint64_t v0) {
413
+	Trice64m_1(tid, v0);
414
+}
415
+#endif
416
+
417
+#if ENABLE_Trice64fn_2
418
+void Trice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1) {
419
+	Trice64m_2(tid, v0, v1);
420
+}
421
+#endif
422
+
423
+#if ENABLE_Trice64fn_3
424
+void Trice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2) {
425
+	Trice64m_3(tid, v0, v1, v2);
426
+}
427
+#endif
428
+
429
+#if ENABLE_Trice64fn_4
430
+void Trice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3) {
431
+	Trice64m_4(tid, v0, v1, v2, v3);
432
+}
433
+#endif
434
+
435
+#if ENABLE_Trice64fn_5
436
+void Trice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4) {
437
+	Trice64m_5(tid, v0, v1, v2, v3, v4);
438
+}
439
+#endif
440
+
441
+#if ENABLE_Trice64fn_6
442
+void Trice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5) {
443
+	Trice64m_6(tid, v0, v1, v2, v3, v4, v5);
444
+}
445
+#endif
446
+
447
+#if ENABLE_Trice64fn_7
448
+void Trice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6) {
449
+	Trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6);
450
+}
451
+#endif
452
+
453
+#if ENABLE_Trice64fn_8
454
+void Trice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7) {
455
+	Trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
456
+}
457
+#endif
458
+
459
+#if ENABLE_Trice64fn_9
460
+void Trice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8) {
461
+	Trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
462
+}
463
+#endif
464
+
465
+#if ENABLE_Trice64fn_10
466
+void Trice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9) {
467
+	Trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
468
+}
469
+#endif
470
+
471
+#if ENABLE_Trice64fn_11
472
+void Trice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10) {
473
+	Trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
474
+}
475
+#endif
476
+
477
+#if ENABLE_Trice64fn_12
478
+void Trice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11) {
479
+	Trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
480
+}
481
+#endif
482
+
483
+#if ENABLE_TRice64fn_0
484
+void TRice64fn_0(uint16_t tid) {
485
+	TRice64m_0(tid);
486
+}
487
+#endif
488
+
489
+#if ENABLE_TRice64fn_1
490
+void TRice64fn_1(uint16_t tid, uint64_t v0) {
491
+	TRice64m_1(tid, v0);
492
+}
493
+#endif
494
+
495
+#if ENABLE_TRice64fn_2
496
+void TRice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1) {
497
+	TRice64m_2(tid, v0, v1);
498
+}
499
+#endif
500
+
501
+#if ENABLE_TRice64fn_3
502
+void TRice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2) {
503
+	TRice64m_3(tid, v0, v1, v2);
504
+}
505
+#endif
506
+
507
+#if ENABLE_TRice64fn_4
508
+void TRice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3) {
509
+	TRice64m_4(tid, v0, v1, v2, v3);
510
+}
511
+#endif
512
+
513
+#if ENABLE_TRice64fn_5
514
+void TRice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4) {
515
+	TRice64m_5(tid, v0, v1, v2, v3, v4);
516
+}
517
+#endif
518
+
519
+#if ENABLE_TRice64fn_6
520
+void TRice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5) {
521
+	TRice64m_6(tid, v0, v1, v2, v3, v4, v5);
522
+}
523
+#endif
524
+
525
+#if ENABLE_TRice64fn_7
526
+void TRice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6) {
527
+	TRice64m_7(tid, v0, v1, v2, v3, v4, v5, v6);
528
+}
529
+#endif
530
+
531
+#if ENABLE_TRice64fn_8
532
+void TRice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7) {
533
+	TRice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
534
+}
535
+#endif
536
+
537
+#if ENABLE_TRice64fn_9
538
+void TRice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8) {
539
+	TRice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
540
+}
541
+#endif
542
+
543
+#if ENABLE_TRice64fn_10
544
+void TRice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9) {
545
+	TRice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
546
+}
547
+#endif
548
+
549
+#if ENABLE_TRice64fn_11
550
+void TRice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10) {
551
+	TRice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
552
+}
553
+#endif
554
+
555
+#if ENABLE_TRice64fn_12
556
+void TRice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11) {
557
+	TRice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
558
+}
559
+#endif
560
+
561
+#endif // #if TRICE_64_BIT_SUPPORT == 1 && TRICE_OFF == 0

+ 299
- 0
Middlewares/trice/trice64.h Переглянути файл

@@ -0,0 +1,299 @@
1
+/*! \file internalTrice64.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 64
6
+
7
+// #define TRICE_0  TRICE64_0  //!< Default parameter bit width for 0  parameter count TRICE is 64.
8
+#define TRICE_1 TRICE64_1   //!< Default parameter bit width for 1  parameter count TRICE is 64.
9
+#define TRICE_2 TRICE64_2   //!< Default parameter bit width for 2  parameter count TRICE is 64.
10
+#define TRICE_3 TRICE64_3   //!< Default parameter bit width for 3  parameter count TRICE is 64.
11
+#define TRICE_4 TRICE64_4   //!< Default parameter bit width for 4  parameter count TRICE is 64.
12
+#define TRICE_5 TRICE64_5   //!< Default parameter bit width for 5  parameter count TRICE is 64.
13
+#define TRICE_6 TRICE64_6   //!< Default parameter bit width for 6  parameter count TRICE is 64.
14
+#define TRICE_7 TRICE64_7   //!< Default parameter bit width for 7  parameter count TRICE is 64.
15
+#define TRICE_8 TRICE64_8   //!< Default parameter bit width for 8  parameter count TRICE is 64.
16
+#define TRICE_9 TRICE64_9   //!< Default parameter bit width for 9  parameter count TRICE is 64.
17
+#define TRICE_10 TRICE64_10 //!< Default parameter bit width for 10 parameter count TRICE is 64.
18
+#define TRICE_11 TRICE64_11 //!< Default parameter bit width for 11 parameter count TRICE is 64.
19
+#define TRICE_12 TRICE64_12 //!< Default parameter bit width for 12 parameter count TRICE is 64.
20
+
21
+// #define trice_0  trice64_0  //!< Default parameter bit width for 1  parameter count trice is 64.
22
+#define trice_1 trice64_1   //!< Default parameter bit width for 1  parameter count trice is 64.
23
+#define trice_2 trice64_2   //!< Default parameter bit width for 2  parameter count trice is 64.
24
+#define trice_3 trice64_3   //!< Default parameter bit width for 3  parameter count trice is 64.
25
+#define trice_4 trice64_4   //!< Default parameter bit width for 4  parameter count trice is 64.
26
+#define trice_5 trice64_5   //!< Default parameter bit width for 5  parameter count trice is 64.
27
+#define trice_6 trice64_6   //!< Default parameter bit width for 6  parameter count trice is 64.
28
+#define trice_7 trice64_7   //!< Default parameter bit width for 7  parameter count trice is 64.
29
+#define trice_8 trice64_8   //!< Default parameter bit width for 8  parameter count trice is 64.
30
+#define trice_9 trice64_9   //!< Default parameter bit width for 9  parameter count trice is 64.
31
+#define trice_10 trice64_10 //!< Default parameter bit width for 10 parameter count trice is 64.
32
+#define trice_11 trice64_11 //!< Default parameter bit width for 11 parameter count trice is 64.
33
+#define trice_12 trice64_12 //!< Default parameter bit width for 12 parameter count trice is 64.
34
+
35
+// #define Trice_0  Trice64_0  //!< Default parameter bit width for 0  parameter count Trice is 64.
36
+#define Trice_1 Trice64_1   //!< Default parameter bit width for 1  parameter count Trice is 64.
37
+#define Trice_2 Trice64_2   //!< Default parameter bit width for 2  parameter count Trice is 64.
38
+#define Trice_3 Trice64_3   //!< Default parameter bit width for 3  parameter count Trice is 64.
39
+#define Trice_4 Trice64_4   //!< Default parameter bit width for 4  parameter count Trice is 64.
40
+#define Trice_5 Trice64_5   //!< Default parameter bit width for 5  parameter count Trice is 64.
41
+#define Trice_6 Trice64_6   //!< Default parameter bit width for 6  parameter count Trice is 64.
42
+#define Trice_7 Trice64_7   //!< Default parameter bit width for 7  parameter count Trice is 64.
43
+#define Trice_8 Trice64_8   //!< Default parameter bit width for 8  parameter count Trice is 64.
44
+#define Trice_9 Trice64_9   //!< Default parameter bit width for 9  parameter count Trice is 64.
45
+#define Trice_10 Trice64_10 //!< Default parameter bit width for 10 parameter count Trice is 64.
46
+#define Trice_11 Trice64_11 //!< Default parameter bit width for 11 parameter count Trice is 64.
47
+#define Trice_12 Trice64_12 //!< Default parameter bit width for 12 parameter count Trice is 64.
48
+
49
+// #define TRice_0  TRice64_0  //!< Default parameter bit width for 0  parameter count TRice is 64.
50
+#define TRice_1 TRice64_1   //!< Default parameter bit width for 1  parameter count TRice is 64.
51
+#define TRice_2 TRice64_2   //!< Default parameter bit width for 2  parameter count TRice is 64.
52
+#define TRice_3 TRice64_3   //!< Default parameter bit width for 3  parameter count TRice is 64.
53
+#define TRice_4 TRice64_4   //!< Default parameter bit width for 4  parameter count TRice is 64.
54
+#define TRice_5 TRice64_5   //!< Default parameter bit width for 5  parameter count TRice is 64.
55
+#define TRice_6 TRice64_6   //!< Default parameter bit width for 6  parameter count TRice is 64.
56
+#define TRice_7 TRice64_7   //!< Default parameter bit width for 7  parameter count TRice is 64.
57
+#define TRice_8 TRice64_8   //!< Default parameter bit width for 8  parameter count TRice is 64.
58
+#define TRice_9 TRice64_9   //!< Default parameter bit width for 9  parameter count TRice is 64.
59
+#define TRice_10 TRice64_10 //!< Default parameter bit width for 10 parameter count TRice is 64.
60
+#define TRice_11 TRice64_11 //!< Default parameter bit width for 11 parameter count TRice is 64.
61
+#define TRice_12 TRice64_12 //!< Default parameter bit width for 12 parameter count TRice is 64.
62
+
63
+#endif // #if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 64
64
+
65
+#define TRICE64(tid, fmt, ...) TRICE_CONCAT2(TRICE64_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
66
+
67
+//! TRICE64_B expects inside pFmt only one format specifier, which is used n times by using pFmt n times.
68
+//!  It is usable for showing n 64-bit values.
69
+#define TRICE64_B(id, pFmt, buf, n)    \
70
+	do {                               \
71
+		TRICE_N(id, pFmt, buf, 8 * n); \
72
+	} while (0)
73
+
74
+//! TRICE64_F expects inside pFmt just a string which is assumed to be a remote function name.
75
+//!  The trice tool displays the pFmt string followed by n times (64-bit value i).
76
+//!  The idea behind is to generate an id - function pointer referece list from the generated til.json file to
77
+//!  compile it into a remote device and execute the inside pFmt named function remotely.
78
+//!  Look for "TRICE64_F example" inside triceCheck.c.
79
+#define TRICE64_F TRICE64_B
80
+
81
+#define TRICE_PUT64_1(v0) TRICE_PUT64(v0);
82
+
83
+#define TRICE_PUT64_2(v0, v1) \
84
+	TRICE_PUT64(v0);          \
85
+	TRICE_PUT64(v1);
86
+
87
+#define TRICE_PUT64_3(v0, v1, v2) \
88
+	TRICE_PUT64(v0);              \
89
+	TRICE_PUT64(v1);              \
90
+	TRICE_PUT64(v2);
91
+
92
+#define TRICE_PUT64_4(v0, v1, v2, v3) \
93
+	TRICE_PUT64(v0);                  \
94
+	TRICE_PUT64(v1);                  \
95
+	TRICE_PUT64(v2);                  \
96
+	TRICE_PUT64(v3);
97
+
98
+#define TRICE_PUT64_5(v0, v1, v2, v3, v4) \
99
+	TRICE_PUT64(v0);                      \
100
+	TRICE_PUT64(v1);                      \
101
+	TRICE_PUT64(v2);                      \
102
+	TRICE_PUT64(v3);                      \
103
+	TRICE_PUT64(v4);
104
+
105
+#define TRICE_PUT64_6(v0, v1, v2, v3, v4, v5) \
106
+	TRICE_PUT64(v0);                          \
107
+	TRICE_PUT64(v1);                          \
108
+	TRICE_PUT64(v2);                          \
109
+	TRICE_PUT64(v3);                          \
110
+	TRICE_PUT64(v4);                          \
111
+	TRICE_PUT64(v5);
112
+
113
+#define TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6) \
114
+	TRICE_PUT64(v0);                              \
115
+	TRICE_PUT64(v1);                              \
116
+	TRICE_PUT64(v2);                              \
117
+	TRICE_PUT64(v3);                              \
118
+	TRICE_PUT64(v4);                              \
119
+	TRICE_PUT64(v5);                              \
120
+	TRICE_PUT64(v6);
121
+
122
+#define TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7) \
123
+	TRICE_PUT64(v0);                                  \
124
+	TRICE_PUT64(v1);                                  \
125
+	TRICE_PUT64(v2);                                  \
126
+	TRICE_PUT64(v3);                                  \
127
+	TRICE_PUT64(v4);                                  \
128
+	TRICE_PUT64(v5);                                  \
129
+	TRICE_PUT64(v6);                                  \
130
+	TRICE_PUT64(v7);
131
+
132
+#define TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8) \
133
+	TRICE_PUT64(v0);                                      \
134
+	TRICE_PUT64(v1);                                      \
135
+	TRICE_PUT64(v2);                                      \
136
+	TRICE_PUT64(v3);                                      \
137
+	TRICE_PUT64(v4);                                      \
138
+	TRICE_PUT64(v5);                                      \
139
+	TRICE_PUT64(v6);                                      \
140
+	TRICE_PUT64(v7);                                      \
141
+	TRICE_PUT64(v8);
142
+
143
+#define TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
144
+	TRICE_PUT64(v0);                                           \
145
+	TRICE_PUT64(v1);                                           \
146
+	TRICE_PUT64(v2);                                           \
147
+	TRICE_PUT64(v3);                                           \
148
+	TRICE_PUT64(v4);                                           \
149
+	TRICE_PUT64(v5);                                           \
150
+	TRICE_PUT64(v6);                                           \
151
+	TRICE_PUT64(v7);                                           \
152
+	TRICE_PUT64(v8);                                           \
153
+	TRICE_PUT64(v9);
154
+
155
+#define TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
156
+	TRICE_PUT64(v0);                                                \
157
+	TRICE_PUT64(v1);                                                \
158
+	TRICE_PUT64(v2);                                                \
159
+	TRICE_PUT64(v3);                                                \
160
+	TRICE_PUT64(v4);                                                \
161
+	TRICE_PUT64(v5);                                                \
162
+	TRICE_PUT64(v6);                                                \
163
+	TRICE_PUT64(v7);                                                \
164
+	TRICE_PUT64(v8);                                                \
165
+	TRICE_PUT64(v9);                                                \
166
+	TRICE_PUT64(v10);
167
+
168
+#define TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
169
+	TRICE_PUT64(v0);                                                     \
170
+	TRICE_PUT64(v1);                                                     \
171
+	TRICE_PUT64(v2);                                                     \
172
+	TRICE_PUT64(v3);                                                     \
173
+	TRICE_PUT64(v4);                                                     \
174
+	TRICE_PUT64(v5);                                                     \
175
+	TRICE_PUT64(v6);                                                     \
176
+	TRICE_PUT64(v7);                                                     \
177
+	TRICE_PUT64(v8);                                                     \
178
+	TRICE_PUT64(v9);                                                     \
179
+	TRICE_PUT64(v10);                                                    \
180
+	TRICE_PUT64(v11);
181
+
182
+// The following `TRICE` macro definitions uses the C preprocess to concatenate the code behind the sub-macros.
183
+// The sequence `tid` in this context is executable code `id(n)`, `Id(n)` or `ID(n)` defined in trice.h.
184
+// This works only with tid=`id(n)`, `Id(n)`, `ID(n)`.
185
+
186
+//! TRICE64_0 writes trice data as fast as possible in a buffer.
187
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
188
+#define TRICE64_0(tid, pFmt) \
189
+	TRICE_ENTER tid;         \
190
+	TRICE_CNTC(0);           \
191
+	TRICE_LEAVE
192
+
193
+//! TRICE64_1 writes trice data as fast as possible in a buffer.
194
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
195
+//! \param v0 a 64 bit value
196
+#define TRICE64_1(tid, pFmt, v0) \
197
+	TRICE_ENTER tid;             \
198
+	TRICE_CNTC(8);               \
199
+	TRICE_PUT64_1(v0)            \
200
+	TRICE_LEAVE
201
+
202
+//! TRICE64_2 writes trice data as fast as possible in a buffer.
203
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
204
+//! \param v0 - v1 are 64 bit values
205
+#define TRICE64_2(id, pFmt, v0, v1) \
206
+	TRICE_ENTER id;                 \
207
+	TRICE_CNTC(16);                 \
208
+	TRICE_PUT64_2(v0, v1);          \
209
+	TRICE_LEAVE
210
+
211
+//! TRICE64_3 writes trice data as fast as possible in a buffer.
212
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
213
+//! \param v0 - v2 are 64 bit values
214
+#define TRICE64_3(id, pFmt, v0, v1, v2) \
215
+	TRICE_ENTER id;                     \
216
+	TRICE_CNTC(24);                     \
217
+	TRICE_PUT64_3(v0, v1, v2);          \
218
+	TRICE_LEAVE
219
+
220
+//! TRICE64_4 writes trice data as fast as possible in a buffer.
221
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
222
+//! \param v0 - v3 are 64 bit values
223
+#define TRICE64_4(id, pFmt, v0, v1, v2, v3) \
224
+	TRICE_ENTER id;                         \
225
+	TRICE_CNTC(32);                         \
226
+	TRICE_PUT64_4(v0, v1, v2, v3);          \
227
+	TRICE_LEAVE
228
+
229
+//! TRICE64_5 writes trice data as fast as possible in a buffer.
230
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
231
+//! \param v0 - v4 are 64 bit values
232
+#define TRICE64_5(id, pFmt, v0, v1, v2, v3, v4) \
233
+	TRICE_ENTER id;                             \
234
+	TRICE_CNTC(40);                             \
235
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);          \
236
+	TRICE_LEAVE
237
+
238
+//! TRICE64_6 writes trice data as fast as possible in a buffer.
239
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
240
+//! \param v0 - v5 are 64 bit values
241
+#define TRICE64_6(id, pFmt, v0, v1, v2, v3, v4, v5) \
242
+	TRICE_ENTER id;                                 \
243
+	TRICE_CNTC(48);                                 \
244
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);          \
245
+	TRICE_LEAVE
246
+
247
+//! TRICE64_8 writes trice data as fast as possible in a buffer.
248
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
249
+//! \param v0 - v6 are 64 bit values
250
+#define TRICE64_7(id, pFmt, v0, v1, v2, v3, v4, v5, v6) \
251
+	TRICE_ENTER id;                                     \
252
+	TRICE_CNTC(56);                                     \
253
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);          \
254
+	TRICE_LEAVE
255
+
256
+//! TRICE64_8 writes trice data as fast as possible in a buffer.
257
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
258
+//! \param v0 - v7 are 64 bit values
259
+#define TRICE64_8(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7) \
260
+	TRICE_ENTER id;                                         \
261
+	TRICE_CNTC(64);                                         \
262
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
263
+	TRICE_LEAVE
264
+
265
+//! TRICE64_8 writes trice data as fast as possible in a buffer.
266
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
267
+//! \param v0 - v7 are 64 bit values
268
+#define TRICE64_9(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
269
+	TRICE_ENTER id;                                             \
270
+	TRICE_CNTC(72);                                             \
271
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);          \
272
+	TRICE_LEAVE
273
+
274
+//! TRICE64_8 writes trice data as fast as possible in a buffer.
275
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
276
+//! \param v0 - v7 are 64 bit values
277
+#define TRICE64_10(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
278
+	TRICE_ENTER id;                                                  \
279
+	TRICE_CNTC(80);                                                  \
280
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);          \
281
+	TRICE_LEAVE
282
+
283
+//! TRICE64_8 writes trice data as fast as possible in a buffer.
284
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
285
+//! \param v0 - v7 are 64 bit values
286
+#define TRICE64_11(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
287
+	TRICE_ENTER id;                                                       \
288
+	TRICE_CNTC(88);                                                       \
289
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);          \
290
+	TRICE_LEAVE
291
+
292
+//! TRICE64_12 writes trice data as fast as possible in a buffer.
293
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
294
+//! \param v0 - v11 are 64 bit values
295
+#define TRICE64_12(id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
296
+	TRICE_ENTER id;                                                            \
297
+	TRICE_CNTC(96);                                                            \
298
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)           \
299
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice64McuOrder.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice64McuOrder.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice64m_0(tid)                                              \
6
+	TRICE_ENTER                                                      \
7
+	TRICE_PUT((0 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
8
+	TRICE_LEAVE
9
+
10
+#define trice64m_1(tid, v0)                                          \
11
+	TRICE_ENTER                                                      \
12
+	TRICE_PUT((8 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
13
+	TRICE_PUT64_1(v0)                                                \
14
+	TRICE_LEAVE
15
+
16
+#define trice64m_2(tid, v0, v1)                                       \
17
+	TRICE_ENTER                                                       \
18
+	TRICE_PUT((16 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
19
+	TRICE_PUT64_2(v0, v1);                                            \
20
+	TRICE_LEAVE
21
+
22
+#define trice64m_3(tid, v0, v1, v2)                                   \
23
+	TRICE_ENTER                                                       \
24
+	TRICE_PUT((24 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
25
+	TRICE_PUT64_3(v0, v1, v2);                                        \
26
+	TRICE_LEAVE
27
+
28
+#define trice64m_4(tid, v0, v1, v2, v3)                               \
29
+	TRICE_ENTER                                                       \
30
+	TRICE_PUT((32 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
31
+	TRICE_PUT64_4(v0, v1, v2, v3);                                    \
32
+	TRICE_LEAVE
33
+
34
+#define trice64m_5(tid, v0, v1, v2, v3, v4)                           \
35
+	TRICE_ENTER                                                       \
36
+	TRICE_PUT((40 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
37
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);                                \
38
+	TRICE_LEAVE
39
+
40
+#define trice64m_6(tid, v0, v1, v2, v3, v4, v5)                       \
41
+	TRICE_ENTER                                                       \
42
+	TRICE_PUT((48 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
43
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);                            \
44
+	TRICE_LEAVE
45
+
46
+#define trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6)                   \
47
+	TRICE_ENTER                                                       \
48
+	TRICE_PUT((56 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
49
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);                        \
50
+	TRICE_LEAVE
51
+
52
+#define trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)               \
53
+	TRICE_ENTER                                                       \
54
+	TRICE_PUT((64 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
55
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);                    \
56
+	TRICE_LEAVE
57
+
58
+#define trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)           \
59
+	TRICE_ENTER                                                       \
60
+	TRICE_PUT((72 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
61
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);                \
62
+	TRICE_LEAVE
63
+
64
+#define trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)      \
65
+	TRICE_ENTER                                                       \
66
+	TRICE_PUT((80 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
67
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);           \
68
+	TRICE_LEAVE
69
+
70
+#define trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT((88 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
73
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                            \
78
+	TRICE_PUT((96 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid)));      \
79
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice64m_0(tid)                          \
83
+	TRICE_ENTER                                  \
84
+	uint16_t ts = TriceStamp16;                  \
85
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid)); \
86
+	TRICE_PUT((TRICE_CYCLE << 16) | ts);         \
87
+	TRICE_LEAVE
88
+
89
+#define Trice64m_1(tid, v0)                        \
90
+	TRICE_ENTER                                    \
91
+	uint16_t ts = TriceStamp16;                    \
92
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
93
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | ts); \
94
+	TRICE_PUT64_1(v0)                              \
95
+	TRICE_LEAVE
96
+
97
+#define Trice64m_2(tid, v0, v1)                     \
98
+	TRICE_ENTER                                     \
99
+	uint16_t ts = TriceStamp16;                     \
100
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
101
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | ts); \
102
+	TRICE_PUT64_2(v0, v1);                          \
103
+	TRICE_LEAVE
104
+
105
+#define Trice64m_3(tid, v0, v1, v2)                 \
106
+	TRICE_ENTER                                     \
107
+	uint16_t ts = TriceStamp16;                     \
108
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
109
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | ts); \
110
+	TRICE_PUT64_3(v0, v1, v2);                      \
111
+	TRICE_LEAVE
112
+
113
+#define Trice64m_4(tid, v0, v1, v2, v3)             \
114
+	TRICE_ENTER                                     \
115
+	uint16_t ts = TriceStamp16;                     \
116
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
117
+	TRICE_PUT(32 << 24 | (TRICE_CYCLE << 16) | ts); \
118
+	TRICE_PUT64_4(v0, v1, v2, v3);                  \
119
+	TRICE_LEAVE
120
+
121
+#define Trice64m_5(tid, v0, v1, v2, v3, v4)         \
122
+	TRICE_ENTER                                     \
123
+	uint16_t ts = TriceStamp16;                     \
124
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
125
+	TRICE_PUT(40 << 24 | (TRICE_CYCLE << 16) | ts); \
126
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);              \
127
+	TRICE_LEAVE
128
+
129
+#define Trice64m_6(tid, v0, v1, v2, v3, v4, v5)     \
130
+	TRICE_ENTER                                     \
131
+	uint16_t ts = TriceStamp16;                     \
132
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
133
+	TRICE_PUT(48 << 24 | (TRICE_CYCLE << 16) | ts); \
134
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);          \
135
+	TRICE_LEAVE
136
+
137
+#define Trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6) \
138
+	TRICE_ENTER                                     \
139
+	uint16_t ts = TriceStamp16;                     \
140
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));    \
141
+	TRICE_PUT(56 << 24 | (TRICE_CYCLE << 16) | ts); \
142
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);      \
143
+	TRICE_LEAVE
144
+
145
+#define Trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7) \
146
+	TRICE_ENTER                                         \
147
+	uint16_t ts = TriceStamp16;                         \
148
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));        \
149
+	TRICE_PUT(64 << 24 | (TRICE_CYCLE << 16) | ts);     \
150
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);      \
151
+	TRICE_LEAVE
152
+
153
+#define Trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
154
+	TRICE_ENTER                                             \
155
+	uint16_t ts = TriceStamp16;                             \
156
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));            \
157
+	TRICE_PUT(72 << 24 | (TRICE_CYCLE << 16) | ts);         \
158
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
159
+	TRICE_LEAVE
160
+
161
+#define Trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                  \
163
+	uint16_t ts = TriceStamp16;                                  \
164
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                 \
165
+	TRICE_PUT(80 << 24 | (TRICE_CYCLE << 16) | ts);              \
166
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                       \
171
+	uint16_t ts = TriceStamp16;                                       \
172
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                      \
173
+	TRICE_PUT(88 << 24 | (TRICE_CYCLE << 16) | ts);                   \
174
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                            \
179
+	uint16_t ts = TriceStamp16;                                            \
180
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                           \
181
+	TRICE_PUT(96 << 24 | (TRICE_CYCLE << 16) | ts);                        \
182
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice64m_0(tid)                                    \
186
+	TRICE_ENTER                                            \
187
+	uint32_t ts = TriceStamp32;                            \
188
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
189
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
190
+	TRICE_LEAVE
191
+
192
+#define TRice64m_1(tid, v0)                                \
193
+	TRICE_ENTER                                            \
194
+	uint32_t ts = TriceStamp32;                            \
195
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
196
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
197
+	TRICE_PUT64_1(v0)                                      \
198
+	TRICE_LEAVE
199
+
200
+#define TRice64m_2(tid, v0, v1)                             \
201
+	TRICE_ENTER                                             \
202
+	uint32_t ts = TriceStamp32;                             \
203
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
204
+	TRICE_PUT(16 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
205
+	TRICE_PUT64_2(v0, v1);                                  \
206
+	TRICE_LEAVE
207
+
208
+#define TRice64m_3(tid, v0, v1, v2)                         \
209
+	TRICE_ENTER                                             \
210
+	uint32_t ts = TriceStamp32;                             \
211
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
212
+	TRICE_PUT(24 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
213
+	TRICE_PUT64_3(v0, v1, v2);                              \
214
+	TRICE_LEAVE
215
+
216
+#define TRice64m_4(tid, v0, v1, v2, v3)                     \
217
+	TRICE_ENTER                                             \
218
+	uint32_t ts = TriceStamp32;                             \
219
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
220
+	TRICE_PUT(32 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
221
+	TRICE_PUT64_4(v0, v1, v2, v3);                          \
222
+	TRICE_LEAVE
223
+
224
+#define TRice64m_5(tid, v0, v1, v2, v3, v4)                 \
225
+	TRICE_ENTER                                             \
226
+	uint32_t ts = TriceStamp32;                             \
227
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
228
+	TRICE_PUT(40 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
229
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);                      \
230
+	TRICE_LEAVE
231
+
232
+#define TRice64m_6(tid, v0, v1, v2, v3, v4, v5)             \
233
+	TRICE_ENTER                                             \
234
+	uint32_t ts = TriceStamp32;                             \
235
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
236
+	TRICE_PUT(48 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
237
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);                  \
238
+	TRICE_LEAVE
239
+
240
+#define TRice64m_7(tid, v0, v1, v2, v3, v4, v5, v6)         \
241
+	TRICE_ENTER                                             \
242
+	uint32_t ts = TriceStamp32;                             \
243
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
244
+	TRICE_PUT(56 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
245
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);              \
246
+	TRICE_LEAVE
247
+
248
+#define TRice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)     \
249
+	TRICE_ENTER                                             \
250
+	uint32_t ts = TriceStamp32;                             \
251
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
252
+	TRICE_PUT(64 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
253
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
254
+	TRICE_LEAVE
255
+
256
+#define TRice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
257
+	TRICE_ENTER                                             \
258
+	uint32_t ts = TriceStamp32;                             \
259
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                 \
260
+	TRICE_PUT(72 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
261
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
262
+	TRICE_LEAVE
263
+
264
+#define TRice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                  \
266
+	uint32_t ts = TriceStamp32;                                  \
267
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                      \
268
+	TRICE_PUT(80 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));      \
269
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                       \
274
+	uint32_t ts = TriceStamp32;                                       \
275
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                           \
276
+	TRICE_PUT(88 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));           \
277
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                            \
282
+	uint32_t ts = TriceStamp32;                                            \
283
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                                \
284
+	TRICE_PUT(96 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));                \
285
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice64McuReverse.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice64McuReverse.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice64m_0(tid)                      \
6
+	TRICE_ENTER                              \
7
+	TRICE_PUT(((TRICE_CYCLE) << 24) | idLH); \
8
+	TRICE_LEAVE
9
+
10
+#define trice64m_1(tid, v0)                              \
11
+	TRICE_ENTER                                          \
12
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (8 << 16) | idLH); \
13
+	TRICE_PUT64_1(v0)                                    \
14
+	TRICE_LEAVE
15
+
16
+#define trice64m_2(tid, v0, v1)                           \
17
+	TRICE_ENTER                                           \
18
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (16 << 16) | idLH); \
19
+	TRICE_PUT64_2(v0, v1);                                \
20
+	TRICE_LEAVE
21
+
22
+#define trice64m_3(tid, v0, v1, v2)                       \
23
+	TRICE_ENTER                                           \
24
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (24 << 16) | idLH); \
25
+	TRICE_PUT64_3(v0, v1, v2);                            \
26
+	TRICE_LEAVE
27
+
28
+#define trice64m_4(tid, v0, v1, v2, v3)                   \
29
+	TRICE_ENTER                                           \
30
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (32 << 16) | idLH); \
31
+	TRICE_PUT64_4(v0, v1, v2, v3);                        \
32
+	TRICE_LEAVE
33
+
34
+#define trice64m_5(tid, v0, v1, v2, v3, v4)               \
35
+	TRICE_ENTER                                           \
36
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (40 << 16) | idLH); \
37
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);                    \
38
+	TRICE_LEAVE
39
+
40
+#define trice64m_6(tid, v0, v1, v2, v3, v4, v5)           \
41
+	TRICE_ENTER                                           \
42
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (48 << 16) | idLH); \
43
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);                \
44
+	TRICE_LEAVE
45
+
46
+#define trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6)       \
47
+	TRICE_ENTER                                           \
48
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (56 << 16) | idLH); \
49
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);            \
50
+	TRICE_LEAVE
51
+
52
+#define trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)   \
53
+	TRICE_ENTER                                           \
54
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (64 << 16) | idLH); \
55
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);        \
56
+	TRICE_LEAVE
57
+
58
+#define trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
59
+	TRICE_ENTER                                             \
60
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (72 << 16) | idLH);   \
61
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
62
+	TRICE_LEAVE
63
+
64
+#define trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
65
+	TRICE_ENTER                                                  \
66
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (80 << 16) | idLH);        \
67
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
68
+	TRICE_LEAVE
69
+
70
+#define trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (88 << 16) | idLH);             \
73
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                            \
78
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (96 << 16) | idLH);                  \
79
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice64m_0(tid)                         \
83
+	TRICE_ENTER                                 \
84
+	uint16_t ts = TriceStamp16;                 \
85
+	TRICE_PUT(((IdLH) << 16) | IdLH)            \
86
+	TRICE_PUT((TRICE_CYCLE << 24) | tsL | tsH); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice64m_1(tid, v0)                                 \
90
+	TRICE_ENTER                                             \
91
+	uint16_t ts = TriceStamp16;                             \
92
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
93
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsL | tsH); \
94
+	TRICE_PUT64_1(v0)                                       \
95
+	TRICE_LEAVE
96
+
97
+#define Trice64m_2(tid, v0, v1)                              \
98
+	TRICE_ENTER                                              \
99
+	uint16_t ts = TriceStamp16;                              \
100
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
101
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsL | tsH); \
102
+	TRICE_PUT64_2(v0, v1);                                   \
103
+	TRICE_LEAVE
104
+
105
+#define Trice64m_3(tid, v0, v1, v2)                          \
106
+	TRICE_ENTER                                              \
107
+	uint16_t ts = TriceStamp16;                              \
108
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
109
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsL | tsH); \
110
+	TRICE_PUT64_3(v0, v1, v2);                               \
111
+	TRICE_LEAVE
112
+
113
+#define Trice64m_4(tid, v0, v1, v2, v3)                      \
114
+	TRICE_ENTER                                              \
115
+	uint16_t ts = TriceStamp16;                              \
116
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
117
+	TRICE_PUT((TRICE_CYCLE << 24) | (32 << 16) | tsL | tsH); \
118
+	TRICE_PUT64_4(v0, v1, v2, v3);                           \
119
+	TRICE_LEAVE
120
+
121
+#define Trice64m_5(tid, v0, v1, v2, v3, v4)                  \
122
+	TRICE_ENTER                                              \
123
+	uint16_t ts = TriceStamp16;                              \
124
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
125
+	TRICE_PUT((TRICE_CYCLE << 24) | (40 << 16) | tsL | tsH); \
126
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);                       \
127
+	TRICE_LEAVE
128
+
129
+#define Trice64m_6(tid, v0, v1, v2, v3, v4, v5)              \
130
+	TRICE_ENTER                                              \
131
+	uint16_t ts = TriceStamp16;                              \
132
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
133
+	TRICE_PUT((TRICE_CYCLE << 24) | (48 << 16) | tsL | tsH); \
134
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);                   \
135
+	TRICE_LEAVE
136
+
137
+#define Trice64m_7(tid, v0, v1, v2, v3, v4, v5, v6)          \
138
+	TRICE_ENTER                                              \
139
+	uint16_t ts = TriceStamp16;                              \
140
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
141
+	TRICE_PUT((TRICE_CYCLE << 24) | (56 << 16) | tsL | tsH); \
142
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);               \
143
+	TRICE_LEAVE
144
+
145
+#define Trice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)      \
146
+	TRICE_ENTER                                              \
147
+	uint16_t ts = TriceStamp16;                              \
148
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
149
+	TRICE_PUT((TRICE_CYCLE << 24) | (64 << 16) | tsL | tsH); \
150
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
151
+	TRICE_LEAVE
152
+
153
+#define Trice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)  \
154
+	TRICE_ENTER                                              \
155
+	uint16_t ts = TriceStamp16;                              \
156
+	TRICE_PUT(((IdLH) << 16) | IdLH)                         \
157
+	TRICE_PUT((TRICE_CYCLE << 24) | (72 << 16) | tsL | tsH); \
158
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);       \
159
+	TRICE_LEAVE
160
+
161
+#define Trice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                  \
163
+	uint16_t ts = TriceStamp16;                                  \
164
+	TRICE_PUT(((IdLH) << 16) | IdLH)                             \
165
+	TRICE_PUT((TRICE_CYCLE << 24) | (80 << 16) | tsL | tsH);     \
166
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                       \
171
+	uint16_t ts = TriceStamp16;                                       \
172
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                  \
173
+	TRICE_PUT((TRICE_CYCLE << 24) | (88 << 16) | tsL | tsH);          \
174
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                            \
179
+	uint16_t ts = TriceStamp16;                                            \
180
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                       \
181
+	TRICE_PUT((TRICE_CYCLE << 24) | (96 << 16) | tsL | tsH);               \
182
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice64m_0(tid)                                      \
186
+	TRICE_ENTER                                              \
187
+	uint32_t ts = TriceStamp32;                              \
188
+	TRICE_PUT(tsHL | tsHH | IDLH);                           \
189
+	TRICE_PUT((TRICE_CYCLE << 24) | (0 << 16) | tsLL | tsLH) \
190
+	TRICE_LEAVE
191
+
192
+#define TRice64m_1(tid, v0)                                  \
193
+	TRICE_ENTER                                              \
194
+	uint32_t ts = TriceStamp32;                              \
195
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
196
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsLL | tsLH) \
197
+	TRICE_PUT64_1(v0)                                        \
198
+	TRICE_LEAVE
199
+
200
+#define TRice64m_2(tid, v0, v1)                               \
201
+	TRICE_ENTER                                               \
202
+	uint32_t ts = TriceStamp32;                               \
203
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
204
+	TRICE_PUT((TRICE_CYCLE << 24) | (16 << 16) | tsLL | tsLH) \
205
+	TRICE_PUT64_2(v0, v1);                                    \
206
+	TRICE_LEAVE
207
+
208
+#define TRice64m_3(tid, v0, v1, v2)                           \
209
+	TRICE_ENTER                                               \
210
+	uint32_t ts = TriceStamp32;                               \
211
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
212
+	TRICE_PUT((TRICE_CYCLE << 24) | (24 << 16) | tsLL | tsLH) \
213
+	TRICE_PUT64_3(v0, v1, v2);                                \
214
+	TRICE_LEAVE
215
+
216
+#define TRice64m_4(tid, v0, v1, v2, v3)                       \
217
+	TRICE_ENTER                                               \
218
+	uint32_t ts = TriceStamp32;                               \
219
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
220
+	TRICE_PUT((TRICE_CYCLE << 24) | (32 << 16) | tsLL | tsLH) \
221
+	TRICE_PUT64_4(v0, v1, v2, v3);                            \
222
+	TRICE_LEAVE
223
+
224
+#define TRice64m_5(tid, v0, v1, v2, v3, v4)                   \
225
+	TRICE_ENTER                                               \
226
+	uint32_t ts = TriceStamp32;                               \
227
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
228
+	TRICE_PUT((TRICE_CYCLE << 24) | (40 << 16) | tsLL | tsLH) \
229
+	TRICE_PUT64_5(v0, v1, v2, v3, v4);                        \
230
+	TRICE_LEAVE
231
+
232
+#define TRice64m_6(tid, v0, v1, v2, v3, v4, v5)               \
233
+	TRICE_ENTER                                               \
234
+	uint32_t ts = TriceStamp32;                               \
235
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
236
+	TRICE_PUT((TRICE_CYCLE << 24) | (48 << 16) | tsLL | tsLH) \
237
+	TRICE_PUT64_6(v0, v1, v2, v3, v4, v5);                    \
238
+	TRICE_LEAVE
239
+
240
+#define TRice64m_7(tid, v0, v1, v2, v3, v4, v5, v6)           \
241
+	TRICE_ENTER                                               \
242
+	uint32_t ts = TriceStamp32;                               \
243
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
244
+	TRICE_PUT((TRICE_CYCLE << 24) | (56 << 16) | tsLL | tsLH) \
245
+	TRICE_PUT64_7(v0, v1, v2, v3, v4, v5, v6);                \
246
+	TRICE_LEAVE
247
+
248
+#define TRice64m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)       \
249
+	TRICE_ENTER                                               \
250
+	uint32_t ts = TriceStamp32;                               \
251
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
252
+	TRICE_PUT((TRICE_CYCLE << 24) | (64 << 16) | tsLL | tsLH) \
253
+	TRICE_PUT64_8(v0, v1, v2, v3, v4, v5, v6, v7);            \
254
+	TRICE_LEAVE
255
+
256
+#define TRice64m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)   \
257
+	TRICE_ENTER                                               \
258
+	uint32_t ts = TriceStamp32;                               \
259
+	TRICE_PUT(tsHL | tsHH | IDLH)                             \
260
+	TRICE_PUT((TRICE_CYCLE << 24) | (72 << 16) | tsLL | tsLH) \
261
+	TRICE_PUT64_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);        \
262
+	TRICE_LEAVE
263
+
264
+#define TRice64m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                  \
266
+	uint32_t ts = TriceStamp32;                                  \
267
+	TRICE_PUT(tsHL | tsHH | IDLH)                                \
268
+	TRICE_PUT((TRICE_CYCLE << 24) | (80 << 16) | tsLL | tsLH)    \
269
+	TRICE_PUT64_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice64m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                       \
274
+	uint32_t ts = TriceStamp32;                                       \
275
+	TRICE_PUT(tsHL | tsHH | IDLH)                                     \
276
+	TRICE_PUT((TRICE_CYCLE << 24) | (88 << 16) | tsLL | tsLH)         \
277
+	TRICE_PUT64_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice64m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                            \
282
+	uint32_t ts = TriceStamp32;                                            \
283
+	TRICE_PUT(tsHL | tsHH | IDLH)                                          \
284
+	TRICE_PUT((TRICE_CYCLE << 24) | (96 << 16) | tsLL | tsLH)              \
285
+	TRICE_PUT64_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 560
- 0
Middlewares/trice/trice8.c Переглянути файл

@@ -0,0 +1,560 @@
1
+//! \file trice8.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//! ///////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+// lint -e529  Warning 529: Symbol '_SEGGER_RTT__LockState' not subsequently referenced
7
+// lint -e701  Info 701: Shift left of signed quantity (int)
8
+
9
+#if TRICE_8_BIT_SUPPORT == 1 && TRICE_OFF == 0
10
+
11
+// without stamp 8-bit values functions
12
+#ifndef ENABLE_trice8fn_0
13
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 0 * 1) + 3) & ~3)
14
+#define ENABLE_trice8fn_0 0 //!< Disables no-stamp 8-bit 0 values functions.
15
+#else
16
+#define ENABLE_trice8fn_0 1 //!< Enables  no-stamp 8-bit 0 values functions.
17
+#endif
18
+#endif
19
+
20
+#ifndef ENABLE_trice8fn_1
21
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 1 * 1) + 3) & ~3)
22
+#define ENABLE_trice8fn_1 0 //!< Disables no-stamp 8-bit 1 values functions.
23
+#else
24
+#define ENABLE_trice8fn_1 1 //!< Enables  no-stamp 8-bit 1 values functions.
25
+#endif
26
+#endif
27
+
28
+#ifndef ENABLE_trice8fn_2
29
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 2 * 1) + 3) & ~3)
30
+#define ENABLE_trice8fn_2 0 //!< Disables no-stamp 8-bit 2 values functions.
31
+#else
32
+#define ENABLE_trice8fn_2 1 //!< Enables  no-stamp 8-bit 2 values functions.
33
+#endif
34
+#endif
35
+
36
+#ifndef ENABLE_trice8fn_3
37
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 3 * 1) + 3) & ~3)
38
+#define ENABLE_trice8fn_3 0 //!< Disables no-stamp 8-bit 3 values functions.
39
+#else
40
+#define ENABLE_trice8fn_3 1 //!< Enables  no-stamp 8-bit 3 values functions.
41
+#endif
42
+#endif
43
+
44
+#ifndef ENABLE_trice8fn_4
45
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 4 * 1) + 3) & ~3)
46
+#define ENABLE_trice8fn_4 0 //!< Disables no-stamp 8-bit 4 values functions.
47
+#else
48
+#define ENABLE_trice8fn_4 1 //!< Enables  no-stamp 8-bit 4 values functions.
49
+#endif
50
+#endif
51
+
52
+#ifndef ENABLE_trice8fn_5
53
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 5 * 1) + 3) & ~3)
54
+#define ENABLE_trice8fn_5 0 //!< Disables no-stamp 8-bit 5 values functions.
55
+#else
56
+#define ENABLE_trice8fn_5 1 //!< Enables  no-stamp 8-bit 5 values functions.
57
+#endif
58
+#endif
59
+
60
+#ifndef ENABLE_trice8fn_6
61
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 6 * 1) + 3) & ~3)
62
+#define ENABLE_trice8fn_6 0 //!< Disables no-stamp 8-bit 6 values functions.
63
+#else
64
+#define ENABLE_trice8fn_6 1 //!< Enables  no-stamp 8-bit 6 values functions.
65
+#endif
66
+#endif
67
+
68
+#ifndef ENABLE_trice8fn_7
69
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 7 * 1) + 3) & ~3)
70
+#define ENABLE_trice8fn_7 0 //!< Disables no-stamp 8-bit 7 values functions.
71
+#else
72
+#define ENABLE_trice8fn_7 1 //!< Enables  no-stamp 8-bit 7 values functions.
73
+#endif
74
+#endif
75
+
76
+#ifndef ENABLE_trice8fn_8
77
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 8 * 1) + 3) & ~3)
78
+#define ENABLE_trice8fn_8 0 //!< Disables no-stamp 8-bit 8 values functions.
79
+#else
80
+#define ENABLE_trice8fn_8 1 //!< Enables  no-stamp 8-bit 8 values functions.
81
+#endif
82
+#endif
83
+
84
+#ifndef ENABLE_trice8fn_9
85
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 9 * 1) + 3) & ~3)
86
+#define ENABLE_trice8fn_9 0 //!< Disables no-stamp 8-bit 9 values functions.
87
+#else
88
+#define ENABLE_trice8fn_9 1 //!< Enables  no-stamp 8-bit 9 values functions.
89
+#endif
90
+#endif
91
+
92
+#ifndef ENABLE_trice8fn_10
93
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 10 * 1) + 3) & ~3)
94
+#define ENABLE_trice8fn_10 0 //!< Disables no-stamp 8-bit 10 values functions.
95
+#else
96
+#define ENABLE_trice8fn_10 1 //!< Enables  no-stamp 8-bit 10 values functions.
97
+#endif
98
+#endif
99
+
100
+#ifndef ENABLE_trice8fn_11
101
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 11 * 1) + 3) & ~3)
102
+#define ENABLE_trice8fn_11 0 //!< Disables no-stamp 8-bit 11 values functions.
103
+#else
104
+#define ENABLE_trice8fn_11 1 //!< Enables  no-stamp 8-bit 11 values functions.
105
+#endif
106
+#endif
107
+
108
+#ifndef ENABLE_trice8fn_12
109
+#if TRICE_SINGLE_MAX_SIZE < (((0 + 4 + 12 * 1) + 3) & ~3)
110
+#define ENABLE_trice8fn_12 0 //!< Disables no-stamp 8-bit 12 values functions.
111
+#else
112
+#define ENABLE_trice8fn_12 1 //!< Enables  no-stamp 8-bit 12 values functions.
113
+#endif
114
+#endif
115
+
116
+// with 16-bit-stamp 8-bit values functions (16-bit timestamps need 4 bytes for allocation reasons)
117
+#ifndef ENABLE_Trice8fn_0
118
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 1) + 3) & ~3)
119
+#define ENABLE_Trice8fn_0 0 //!< Disables 16-bit-stamp 8-bit 0 values functions.
120
+#else
121
+#define ENABLE_Trice8fn_0 1 //!< Enables  16-bit-stamp 8-bit 0 values functions.
122
+#endif
123
+#endif
124
+
125
+#ifndef ENABLE_Trice8fn_1
126
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 1) + 3) & ~3)
127
+#define ENABLE_Trice8fn_1 0 //!< Disables 16-bit-stamp 8-bit 1 values functions.
128
+#else
129
+#define ENABLE_Trice8fn_1 1 //!< Enables  16-bit-stamp 8-bit 1 values functions.
130
+#endif
131
+#endif
132
+
133
+#ifndef ENABLE_Trice8fn_2
134
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 1) + 3) & ~3)
135
+#define ENABLE_Trice8fn_2 0 //!< Disables 16-bit-stamp 8-bit 2 values functions.
136
+#else
137
+#define ENABLE_Trice8fn_2 1 //!< Enables  16-bit-stamp 8-bit 2 values functions.
138
+#endif
139
+#endif
140
+
141
+#ifndef ENABLE_Trice8fn_3
142
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 1) + 3) & ~3)
143
+#define ENABLE_Trice8fn_3 0 //!< Disables 16-bit-stamp 8-bit 3 values functions.
144
+#else
145
+#define ENABLE_Trice8fn_3 1 //!< Enables  16-bit-stamp 8-bit 3 values functions.
146
+#endif
147
+#endif
148
+
149
+#ifndef ENABLE_Trice8fn_4
150
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 1) + 3) & ~3)
151
+#define ENABLE_Trice8fn_4 0 //!< Disables 16-bit-stamp 8-bit 4 values functions.
152
+#else
153
+#define ENABLE_Trice8fn_4 1 //!< Enables  16-bit-stamp 8-bit 4 values functions.
154
+#endif
155
+#endif
156
+
157
+#ifndef ENABLE_Trice8fn_5
158
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 1) + 3) & ~3)
159
+#define ENABLE_Trice8fn_5 0 //!< Disables 16-bit-stamp 8-bit 5 values functions.
160
+#else
161
+#define ENABLE_Trice8fn_5 1 //!< Enables  16-bit-stamp 8-bit 5 values functions.
162
+#endif
163
+#endif
164
+
165
+#ifndef ENABLE_Trice8fn_6
166
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 1) + 3) & ~3)
167
+#define ENABLE_Trice8fn_6 0 //!< Disables 16-bit-stamp 8-bit 6 values functions.
168
+#else
169
+#define ENABLE_Trice8fn_6 1 //!< Enables  16-bit-stamp 8-bit 6 values functions.
170
+#endif
171
+#endif
172
+
173
+#ifndef ENABLE_Trice8fn_7
174
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 1) + 3) & ~3)
175
+#define ENABLE_Trice8fn_7 0 //!< Disables 16-bit-stamp 8-bit 7 values functions.
176
+#else
177
+#define ENABLE_Trice8fn_7 1 //!< Enables  16-bit-stamp 8-bit 7 values functions.
178
+#endif
179
+#endif
180
+
181
+#ifndef ENABLE_Trice8fn_8
182
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 1) + 3) & ~3)
183
+#define ENABLE_Trice8fn_8 0 //!< Disables 16-bit-stamp 8-bit 8 values functions.
184
+#else
185
+#define ENABLE_Trice8fn_8 1 //!< Enables  16-bit-stamp 8-bit 8 values functions.
186
+#endif
187
+#endif
188
+
189
+#ifndef ENABLE_Trice8fn_9
190
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 1) + 3) & ~3)
191
+#define ENABLE_Trice8fn_9 0 //!< Disables 16-bit-stamp 8-bit 9 values functions.
192
+#else
193
+#define ENABLE_Trice8fn_9 1 //!< Enables  16-bit-stamp 8-bit 9 values functions.
194
+#endif
195
+#endif
196
+
197
+#ifndef ENABLE_Trice8fn_10
198
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 1) + 3) & ~3)
199
+#define ENABLE_Trice8fn_10 0 //!< Disables 16-bit-stamp 8-bit 10 values functions.
200
+#else
201
+#define ENABLE_Trice8fn_10 1 //!< Enables  16-bit-stamp 8-bit 10 values functions.
202
+#endif
203
+#endif
204
+
205
+#ifndef ENABLE_Trice8fn_11
206
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 1) + 3) & ~3)
207
+#define ENABLE_Trice8fn_11 0 //!< Disables 16-bit-stamp 8-bit 11 values functions.
208
+#else
209
+#define ENABLE_Trice8fn_11 1 //!< Enables  16-bit-stamp 8-bit 11 values functions.
210
+#endif
211
+#endif
212
+
213
+#ifndef ENABLE_Trice8fn_12
214
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 1) + 3) & ~3)
215
+#define ENABLE_Trice8fn_12 0 //!< Disables 16-bit-stamp 8-bit 12 values functions.
216
+#else
217
+#define ENABLE_Trice8fn_12 1 //!< Enables  16-bit-stamp 8-bit 12 values functions.
218
+#endif
219
+#endif
220
+
221
+// with 32-bit-stamp 8-bit values functions
222
+#ifndef ENABLE_TRice8fn_0
223
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 0 * 1) + 3) & ~3)
224
+#define ENABLE_TRice8fn_0 0 //!< Disables 32-bit-stamp 8-bit 0 values functions.
225
+#else
226
+#define ENABLE_TRice8fn_0 1 //!< Enables  32-bit-stamp 8-bit 0 values functions.
227
+#endif
228
+#endif
229
+
230
+#ifndef ENABLE_TRice8fn_1
231
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 1 * 1) + 3) & ~3)
232
+#define ENABLE_TRice8fn_1 0 //!< Disables 32-bit-stamp 8-bit 1 values functions.
233
+#else
234
+#define ENABLE_TRice8fn_1 1 //!< Enables  32-bit-stamp 8-bit 1 values functions.
235
+#endif
236
+#endif
237
+
238
+#ifndef ENABLE_TRice8fn_2
239
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 2 * 1) + 3) & ~3)
240
+#define ENABLE_TRice8fn_2 0 //!< Disables 32-bit-stamp 8-bit 2 values functions.
241
+#else
242
+#define ENABLE_TRice8fn_2 1 //!< Enables  32-bit-stamp 8-bit 2 values functions.
243
+#endif
244
+#endif
245
+
246
+#ifndef ENABLE_TRice8fn_3
247
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 3 * 1) + 3) & ~3)
248
+#define ENABLE_TRice8fn_3 0 //!< Disables 32-bit-stamp 8-bit 3 values functions.
249
+#else
250
+#define ENABLE_TRice8fn_3 1 //!< Enables  32-bit-stamp 8-bit 3 values functions.
251
+#endif
252
+#endif
253
+
254
+#ifndef ENABLE_TRice8fn_4
255
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 4 * 1) + 3) & ~3)
256
+#define ENABLE_TRice8fn_4 0 //!< Disables 32-bit-stamp 8-bit 4 values functions.
257
+#else
258
+#define ENABLE_TRice8fn_4 1 //!< Enables  32-bit-stamp 8-bit 4 values functions.
259
+#endif
260
+#endif
261
+
262
+#ifndef ENABLE_TRice8fn_5
263
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 5 * 1) + 3) & ~3)
264
+#define ENABLE_TRice8fn_5 0 //!< Disables 32-bit-stamp 8-bit 5 values functions.
265
+#else
266
+#define ENABLE_TRice8fn_5 1 //!< Enables  32-bit-stamp 8-bit 5 values functions.
267
+#endif
268
+#endif
269
+
270
+#ifndef ENABLE_TRice8fn_6
271
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 6 * 1) + 3) & ~3)
272
+#define ENABLE_TRice8fn_6 0 //!< Disables 32-bit-stamp 8-bit 6 values functions.
273
+#else
274
+#define ENABLE_TRice8fn_6 1 //!< Enables  32-bit-stamp 8-bit 6 values functions.
275
+#endif
276
+#endif
277
+
278
+#ifndef ENABLE_TRice8fn_7
279
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 7 * 1) + 3) & ~3)
280
+#define ENABLE_TRice8fn_7 0 //!< Disables 32-bit-stamp 8-bit 7 values functions.
281
+#else
282
+#define ENABLE_TRice8fn_7 1 //!< Enables  32-bit-stamp 8-bit 7 values functions.
283
+#endif
284
+#endif
285
+
286
+#ifndef ENABLE_TRice8fn_8
287
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 8 * 1) + 3) & ~3)
288
+#define ENABLE_TRice8fn_8 0 //!< Disables 32-bit-stamp 8-bit 8 values functions.
289
+#else
290
+#define ENABLE_TRice8fn_8 1 //!< Enables  32-bit-stamp 8-bit 8 values functions.
291
+#endif
292
+#endif
293
+
294
+#ifndef ENABLE_TRice8fn_9
295
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 9 * 1) + 3) & ~3)
296
+#define ENABLE_TRice8fn_9 0 //!< Disables 32-bit-stamp 8-bit 9 values functions.
297
+#else
298
+#define ENABLE_TRice8fn_9 1 //!< Enables  32-bit-stamp 8-bit 9 values functions.
299
+#endif
300
+#endif
301
+
302
+#ifndef ENABLE_TRice8fn_10
303
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 10 * 1) + 3) & ~3)
304
+#define ENABLE_TRice8fn_10 0 //!< Disables 32-bit-stamp 8-bit 10 values functions.
305
+#else
306
+#define ENABLE_TRice8fn_10 1 //!< Enables  32-bit-stamp 8-bit 10 values functions.
307
+#endif
308
+#endif
309
+
310
+#ifndef ENABLE_TRice8fn_11
311
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 11 * 1) + 3) & ~3)
312
+#define ENABLE_TRice8fn_11 0 //!< Disables 32-bit-stamp 8-bit 11 values functions.
313
+#else
314
+#define ENABLE_TRice8fn_11 1 //!< Enables  32-bit-stamp 8-bit 11 values functions.
315
+#endif
316
+#endif
317
+
318
+#ifndef ENABLE_TRice8fn_12
319
+#if TRICE_SINGLE_MAX_SIZE < (((4 + 4 + 12 * 1) + 3) & ~3)
320
+#define ENABLE_TRice8fn_12 0 //!< Disables 32-bit-stamp 8-bit 12 values functions.
321
+#else
322
+#define ENABLE_TRice8fn_12 1 //!< Enables  32-bit-stamp 8-bit 12 values functions.
323
+#endif
324
+#endif
325
+
326
+#if ENABLE_trice8fn_0
327
+void trice8fn_0(uint16_t tid) {
328
+	trice8m_0(tid);
329
+}
330
+#endif
331
+
332
+#if ENABLE_trice8fn_1
333
+void trice8fn_1(uint16_t tid, uint8_t v0) {
334
+	trice8m_1(tid, v0);
335
+}
336
+#endif
337
+
338
+#if ENABLE_trice8fn_2
339
+void trice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1) {
340
+	trice8m_2(tid, v0, v1);
341
+}
342
+#endif
343
+
344
+#if ENABLE_trice8fn_3
345
+void trice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2) {
346
+	trice8m_3(tid, v0, v1, v2);
347
+}
348
+#endif
349
+
350
+#if ENABLE_trice8fn_4
351
+void trice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3) {
352
+	trice8m_4(tid, v0, v1, v2, v3);
353
+}
354
+#endif
355
+
356
+#if ENABLE_trice8fn_5
357
+void trice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4) {
358
+	trice8m_5(tid, v0, v1, v2, v3, v4);
359
+}
360
+#endif
361
+
362
+#if ENABLE_trice8fn_6
363
+void trice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5) {
364
+	trice8m_6(tid, v0, v1, v2, v3, v4, v5);
365
+}
366
+#endif
367
+
368
+#if ENABLE_trice8fn_7
369
+void trice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6) {
370
+	trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6);
371
+}
372
+#endif
373
+
374
+#if ENABLE_trice8fn_8
375
+void trice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7) {
376
+	trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
377
+}
378
+#endif
379
+
380
+#if ENABLE_trice8fn_9
381
+void trice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8) {
382
+	trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
383
+}
384
+#endif
385
+
386
+#if ENABLE_trice8fn_10
387
+void trice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9) {
388
+	trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
389
+}
390
+#endif
391
+
392
+#if ENABLE_trice8fn_11
393
+void trice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10) {
394
+	trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
395
+}
396
+#endif
397
+
398
+#if ENABLE_trice8fn_12
399
+void trice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11) {
400
+	trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
401
+}
402
+#endif
403
+
404
+#if ENABLE_Trice8fn_0
405
+void Trice8fn_0(uint16_t tid) {
406
+	Trice8m_0(tid);
407
+}
408
+#endif
409
+
410
+#if ENABLE_Trice8fn_1
411
+void Trice8fn_1(uint16_t tid, uint8_t v0) {
412
+	Trice8m_1(tid, v0);
413
+}
414
+#endif
415
+
416
+#if ENABLE_Trice8fn_2
417
+void Trice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1) {
418
+	Trice8m_2(tid, v0, v1);
419
+}
420
+#endif
421
+
422
+#if ENABLE_Trice8fn_3
423
+void Trice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2) {
424
+	Trice8m_3(tid, v0, v1, v2);
425
+}
426
+#endif
427
+
428
+#if ENABLE_Trice8fn_4
429
+void Trice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3) {
430
+	Trice8m_4(tid, v0, v1, v2, v3);
431
+}
432
+#endif
433
+
434
+#if ENABLE_Trice8fn_5
435
+void Trice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4) {
436
+	Trice8m_5(tid, v0, v1, v2, v3, v4);
437
+}
438
+#endif
439
+
440
+#if ENABLE_Trice8fn_6
441
+void Trice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5) {
442
+	Trice8m_6(tid, v0, v1, v2, v3, v4, v5);
443
+}
444
+#endif
445
+
446
+#if ENABLE_Trice8fn_7
447
+void Trice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6) {
448
+	Trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6);
449
+}
450
+#endif
451
+
452
+#if ENABLE_Trice8fn_8
453
+void Trice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7) {
454
+	Trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
455
+}
456
+#endif
457
+
458
+#if ENABLE_Trice8fn_9
459
+void Trice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8) {
460
+	Trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
461
+}
462
+#endif
463
+
464
+#if ENABLE_Trice8fn_10
465
+void Trice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9) {
466
+	Trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
467
+}
468
+#endif
469
+
470
+#if ENABLE_Trice8fn_11
471
+void Trice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10) {
472
+	Trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
473
+}
474
+#endif
475
+
476
+#if ENABLE_Trice8fn_12
477
+void Trice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11) {
478
+	Trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
479
+}
480
+#endif
481
+
482
+#if ENABLE_TRice8fn_0
483
+void TRice8fn_0(uint16_t tid) {
484
+	TRice8m_0(tid);
485
+}
486
+#endif
487
+
488
+#if ENABLE_TRice8fn_1
489
+void TRice8fn_1(uint16_t tid, uint8_t v0) {
490
+	TRice8m_1(tid, v0);
491
+}
492
+#endif
493
+
494
+#if ENABLE_TRice8fn_2
495
+void TRice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1) {
496
+	TRice8m_2(tid, v0, v1);
497
+}
498
+#endif
499
+
500
+#if ENABLE_TRice8fn_3
501
+void TRice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2) {
502
+	TRice8m_3(tid, v0, v1, v2);
503
+}
504
+#endif
505
+
506
+#if ENABLE_TRice8fn_4
507
+void TRice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3) {
508
+	TRice8m_4(tid, v0, v1, v2, v3);
509
+}
510
+#endif
511
+
512
+#if ENABLE_TRice8fn_5
513
+void TRice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4) {
514
+	TRice8m_5(tid, v0, v1, v2, v3, v4);
515
+}
516
+#endif
517
+
518
+#if ENABLE_TRice8fn_6
519
+void TRice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5) {
520
+	TRice8m_6(tid, v0, v1, v2, v3, v4, v5);
521
+}
522
+#endif
523
+
524
+#if ENABLE_TRice8fn_7
525
+void TRice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6) {
526
+	TRice8m_7(tid, v0, v1, v2, v3, v4, v5, v6);
527
+}
528
+#endif
529
+
530
+#if ENABLE_TRice8fn_8
531
+void TRice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7) {
532
+	TRice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7);
533
+}
534
+#endif
535
+
536
+#if ENABLE_TRice8fn_9
537
+void TRice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8) {
538
+	TRice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8);
539
+}
540
+#endif
541
+
542
+#if ENABLE_TRice8fn_10
543
+void TRice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9) {
544
+	TRice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
545
+}
546
+#endif
547
+
548
+#if ENABLE_TRice8fn_11
549
+void TRice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10) {
550
+	TRice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
551
+}
552
+#endif
553
+
554
+#if ENABLE_TRice8fn_12
555
+void TRice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11) {
556
+	TRice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
557
+}
558
+#endif
559
+
560
+#endif // #if TRICE_8_BIT_SUPPORT == 1 && TRICE_OFF == 0

+ 246
- 0
Middlewares/trice/trice8.h Переглянути файл

@@ -0,0 +1,246 @@
1
+/*! \file Trice8.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 8
6
+
7
+// #define TRICE_0  TRICE8_0  //!< Default parameter bit width for 0  parameter count TRICE is 8.
8
+#define TRICE_1 TRICE8_1   //!< Default parameter bit width for 1  parameter count TRICE is 8.
9
+#define TRICE_2 TRICE8_2   //!< Default parameter bit width for 2  parameter count TRICE is 8.
10
+#define TRICE_3 TRICE8_3   //!< Default parameter bit width for 3  parameter count TRICE is 8.
11
+#define TRICE_4 TRICE8_4   //!< Default parameter bit width for 4  parameter count TRICE is 8.
12
+#define TRICE_5 TRICE8_5   //!< Default parameter bit width for 5  parameter count TRICE is 8.
13
+#define TRICE_6 TRICE8_6   //!< Default parameter bit width for 6  parameter count TRICE is 8.
14
+#define TRICE_7 TRICE8_7   //!< Default parameter bit width for 7  parameter count TRICE is 8.
15
+#define TRICE_8 TRICE8_8   //!< Default parameter bit width for 8  parameter count TRICE is 8.
16
+#define TRICE_9 TRICE8_9   //!< Default parameter bit width for 9  parameter count TRICE is 8.
17
+#define TRICE_10 TRICE8_10 //!< Default parameter bit width for 10 parameter count TRICE is 8.
18
+#define TRICE_11 TRICE8_11 //!< Default parameter bit width for 11 parameter count TRICE is 8.
19
+#define TRICE_12 TRICE8_12 //!< Default parameter bit width for 12 parameter count TRICE is 8.
20
+
21
+// #define trice_0  trice8_0  //!< Default parameter bit width for 0  parameter count trice is 8.
22
+#define trice_1 trice8_1   //!< Default parameter bit width for 1  parameter count trice is 8.
23
+#define trice_2 trice8_2   //!< Default parameter bit width for 2  parameter count trice is 8.
24
+#define trice_3 trice8_3   //!< Default parameter bit width for 3  parameter count trice is 8.
25
+#define trice_4 trice8_4   //!< Default parameter bit width for 4  parameter count trice is 8.
26
+#define trice_5 trice8_5   //!< Default parameter bit width for 5  parameter count trice is 8.
27
+#define trice_6 trice8_6   //!< Default parameter bit width for 6  parameter count trice is 8.
28
+#define trice_7 trice8_7   //!< Default parameter bit width for 7  parameter count trice is 8.
29
+#define trice_8 trice8_8   //!< Default parameter bit width for 8  parameter count trice is 8.
30
+#define trice_9 trice8_9   //!< Default parameter bit width for 9  parameter count trice is 8.
31
+#define trice_10 trice8_10 //!< Default parameter bit width for 10 parameter count trice is 8.
32
+#define trice_11 trice8_11 //!< Default parameter bit width for 11 parameter count trice is 8.
33
+#define trice_12 trice8_12 //!< Default parameter bit width for 12 parameter count trice is 8.
34
+
35
+// #define Trice_0  Trice8_0  //!< Default parameter bit width for 1  parameter count Trice is 8.
36
+#define Trice_1 Trice8_1   //!< Default parameter bit width for 1  parameter count Trice is 8.
37
+#define Trice_2 Trice8_2   //!< Default parameter bit width for 2  parameter count Trice is 8.
38
+#define Trice_3 Trice8_3   //!< Default parameter bit width for 3  parameter count Trice is 8.
39
+#define Trice_4 Trice8_4   //!< Default parameter bit width for 4  parameter count Trice is 8.
40
+#define Trice_5 Trice8_5   //!< Default parameter bit width for 5  parameter count Trice is 8.
41
+#define Trice_6 Trice8_6   //!< Default parameter bit width for 6  parameter count Trice is 8.
42
+#define Trice_7 Trice8_7   //!< Default parameter bit width for 7  parameter count Trice is 8.
43
+#define Trice_8 Trice8_8   //!< Default parameter bit width for 8  parameter count Trice is 8.
44
+#define Trice_9 Trice8_9   //!< Default parameter bit width for 9  parameter count Trice is 8.
45
+#define Trice_10 Trice8_10 //!< Default parameter bit width for 10 parameter count Trice is 8.
46
+#define Trice_11 Trice8_11 //!< Default parameter bit width for 11 parameter count Trice is 8.
47
+#define Trice_12 Trice8_12 //!< Default parameter bit width for 12 parameter count Trice is 8.
48
+
49
+// #define TRice_0  TRice8_0  //!< Default parameter bit width for 1  parameter count TRice is 8.
50
+#define TRice_1 TRice8_1   //!< Default parameter bit width for 1  parameter count TRice is 8.
51
+#define TRice_2 TRice8_2   //!< Default parameter bit width for 2  parameter count TRice is 8.
52
+#define TRice_3 TRice8_3   //!< Default parameter bit width for 3  parameter count TRice is 8.
53
+#define TRice_4 TRice8_4   //!< Default parameter bit width for 4  parameter count TRice is 8.
54
+#define TRice_5 TRice8_5   //!< Default parameter bit width for 5  parameter count TRice is 8.
55
+#define TRice_6 TRice8_6   //!< Default parameter bit width for 6  parameter count TRice is 8.
56
+#define TRice_7 TRice8_7   //!< Default parameter bit width for 7  parameter count TRice is 8.
57
+#define TRice_8 TRice8_8   //!< Default parameter bit width for 8  parameter count TRice is 8.
58
+#define TRice_9 TRice8_9   //!< Default parameter bit width for 9  parameter count TRice is 8.
59
+#define TRice_10 TRice8_10 //!< Default parameter bit width for 10 parameter count TRice is 8.
60
+#define TRice_11 TRice8_11 //!< Default parameter bit width for 11 parameter count TRice is 8.
61
+#define TRice_12 TRice8_12 //!< Default parameter bit width for 12 parameter count TRice is 8.
62
+
63
+#endif // #if TRICE_DEFAULT_PARAMETER_BIT_WIDTH == 8
64
+
65
+//! TRICE8 inlining code for up to 12 8-bit parameters.
66
+#define TRICE8(tid, fmt, ...) TRICE_CONCAT2(TRICE8_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
67
+
68
+//! TRICE8_B expects inside pFmt only one format specifier, which is used n times by using pFmt n times.
69
+//!  It is usable for showing n 8-bit values.
70
+#define TRICE8_B TRICE_N
71
+
72
+//! TRICE8_F expects inside pFmt just a string which is assumed to be a remote function name.
73
+//! \li The trice tool displays the pFmt string followed by n times (value i).
74
+//! \li The idea behind is to generate an id - function pointer referece list from the generated til.json file to compile it into a remote device and execute the inside pFmt named function remotely.
75
+//! \li Look for "TRICE8_F example" inside triceCheck.c.
76
+//!  Look for "TRICE8_F example" inside triceCheck.c.
77
+#define TRICE8_F TRICE8_B
78
+
79
+#define TRICE_BYTE0(v) ((uint8_t)(v))                       //!< TRICE_BYTE0(v) is the 8-bit value v moved to the LL position in a 32-bit value 0xHH_HL_LH_LL.
80
+#define TRICE_BYTE1(v) (0x0000FF00 & ((uint32_t)(v) << 8))  //!< TRICE_BYTE1(v) is the 8-bit value v moved to the LH position in a 32-bit value 0xHH_HL_LH_LL.
81
+#define TRICE_BYTE2(v) (0x00FF0000 & ((uint32_t)(v) << 16)) //!< TRICE_BYTE2(v) is the 8-bit value v moved to the HL position in a 32-bit value 0xHH_HL_LH_LL.
82
+#define TRICE_BYTE3(v) ((uint32_t)(v) << 24)                //!< TRICE_BYTE3(v) is the 8-bit value v moved to the HH position in a 32-bit value 0xHH_HL_LH_LL.
83
+
84
+//! TRICE_PUT8_1 transfers a single 8-bit parameter value to the Trice buffer.
85
+#define TRICE_PUT8_1(v0) TRICE_PUT(TRICE_BYTE0(v0));
86
+
87
+#define TRICE_PUT8_2(v0, v1) TRICE_PUT(TRICE_BYTE1(v1) | TRICE_BYTE0(v0));
88
+
89
+#define TRICE_PUT8_3(v0, v1, v2) TRICE_PUT(TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0));
90
+
91
+#define TRICE_PUT8_4(v0, v1, v2, v3) TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0));
92
+
93
+#define TRICE_PUT8_5(v0, v1, v2, v3, v4)                                              \
94
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
95
+	TRICE_PUT(TRICE_BYTE0(v4));
96
+
97
+#define TRICE_PUT8_6(v0, v1, v2, v3, v4, v5)                                          \
98
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
99
+	TRICE_PUT(TRICE_BYTE1(v5) | TRICE_BYTE0(v4));
100
+
101
+#define TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6)                                      \
102
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
103
+	TRICE_PUT(TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4));
104
+
105
+#define TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7)                                  \
106
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
107
+	TRICE_PUT(TRICE_BYTE3(v7) | TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4));
108
+
109
+#define TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8)                              \
110
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
111
+	TRICE_PUT(TRICE_BYTE3(v7) | TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4)); \
112
+	TRICE_PUT(TRICE_BYTE0(v8));
113
+
114
+#define TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)                         \
115
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
116
+	TRICE_PUT(TRICE_BYTE3(v7) | TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4)); \
117
+	TRICE_PUT(TRICE_BYTE1(v9) | TRICE_BYTE0(v8));
118
+
119
+#define TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)                    \
120
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
121
+	TRICE_PUT(TRICE_BYTE3(v7) | TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4)); \
122
+	TRICE_PUT(TRICE_BYTE2(v10) | TRICE_BYTE1(v9) | TRICE_BYTE0(v8));
123
+
124
+#define TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)               \
125
+	TRICE_PUT(TRICE_BYTE3(v3) | TRICE_BYTE2(v2) | TRICE_BYTE1(v1) | TRICE_BYTE0(v0)); \
126
+	TRICE_PUT(TRICE_BYTE3(v7) | TRICE_BYTE2(v6) | TRICE_BYTE1(v5) | TRICE_BYTE0(v4)); \
127
+	TRICE_PUT(TRICE_BYTE3(v11) | TRICE_BYTE2(v10) | TRICE_BYTE1(v9) | TRICE_BYTE0(v8));
128
+
129
+// The following `TRICE` macro definitions are using the C preprocess to concatenate the code behind the sub-macros.
130
+// The sequence `tid` in this context is executable code `id(n)`, `Id(n)` or `ID(n)` defined in trice.h.
131
+// This works only with tid=`id(n)`, `Id(n)`, `ID(n)`.
132
+
133
+//! TRICE8_0 writes trice data as fast as possible in a buffer.
134
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
135
+#define TRICE8_0(tid, pFmt) \
136
+	TRICE_ENTER tid;        \
137
+	TRICE_CNTC(0);          \
138
+	TRICE_LEAVE
139
+
140
+//! TRICE8_1 writes trice data as fast as possible in a buffer.
141
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
142
+//! \param v0 a 8 bit bit value
143
+#define TRICE8_1(tid, pFmt, v0) \
144
+	TRICE_ENTER tid;            \
145
+	TRICE_CNTC(1);              \
146
+	TRICE_PUT8_1(v0)            \
147
+	TRICE_LEAVE
148
+
149
+//! TRICE8_2 writes trice data as fast as possible in a buffer.
150
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
151
+//! \param v0 - v1 are 8 bit bit values
152
+#define TRICE8_2(tid, pFmt, v0, v1) \
153
+	TRICE_ENTER tid;                \
154
+	TRICE_CNTC(2);                  \
155
+	TRICE_PUT8_2(v0, v1);           \
156
+	TRICE_LEAVE
157
+
158
+//! TRICE8_3 writes trice data as fast as possible in a buffer.
159
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
160
+//! \param v0 - v2 are 8 bit bit values
161
+#define TRICE8_3(tid, pFmt, v0, v1, v2) \
162
+	TRICE_ENTER tid;                    \
163
+	TRICE_CNTC(3);                      \
164
+	TRICE_PUT8_3(v0, v1, v2);           \
165
+	TRICE_LEAVE
166
+
167
+//! TRICE8_4 writes trice data as fast as possible in a buffer.
168
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
169
+//! \param v0 - v3 are 8 bit bit values
170
+#define TRICE8_4(tid, pFmt, v0, v1, v2, v3) \
171
+	TRICE_ENTER tid;                        \
172
+	TRICE_CNTC(4);                          \
173
+	TRICE_PUT8_4(v0, v1, v2, v3);           \
174
+	TRICE_LEAVE
175
+
176
+//! TRICE8_5 writes trice data as fast as possible in a buffer.
177
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
178
+//! \param v0 - v4 are 8 bit bit values
179
+#define TRICE8_5(tid, pFmt, v0, v1, v2, v3, v4) \
180
+	TRICE_ENTER tid;                            \
181
+	TRICE_CNTC(5);                              \
182
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);           \
183
+	TRICE_LEAVE
184
+
185
+//! TRICE8_6 writes trice data as fast as possible in a buffer.
186
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
187
+//! \param v0 - v5 are 8 bit bit values
188
+#define TRICE8_6(tid, pFmt, v0, v1, v2, v3, v4, v5) \
189
+	TRICE_ENTER tid;                                \
190
+	TRICE_CNTC(6);                                  \
191
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);           \
192
+	TRICE_LEAVE
193
+
194
+//! TRICE8_8 writes trice data as fast as possible in a buffer.
195
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
196
+//! \param v0 - v6 are 8 bit bit values
197
+#define TRICE8_7(tid, pFmt, v0, v1, v2, v3, v4, v5, v6) \
198
+	TRICE_ENTER tid;                                    \
199
+	TRICE_CNTC(7);                                      \
200
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);           \
201
+	TRICE_LEAVE
202
+
203
+//! TRICE8_8 writes trice data as fast as possible in a buffer.
204
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
205
+//! \param v0 - v7 are 8 bit bit values
206
+#define TRICE8_8(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7) \
207
+	TRICE_ENTER tid;                                        \
208
+	TRICE_CNTC(8);                                          \
209
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
210
+	TRICE_LEAVE
211
+
212
+//! TRICE8_8 writes trice data as fast as possible in a buffer.
213
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
214
+//! \param v0 - v7 are 8 bit bit values
215
+#define TRICE8_9(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
216
+	TRICE_ENTER tid;                                            \
217
+	TRICE_CNTC(9);                                              \
218
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);           \
219
+	TRICE_LEAVE
220
+
221
+//! TRICE8_8 writes trice data as fast as possible in a buffer.
222
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
223
+//! \param v0 - v7 are 8 bit bit values
224
+#define TRICE8_10(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
225
+	TRICE_ENTER tid;                                                 \
226
+	TRICE_CNTC(10);                                                  \
227
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);           \
228
+	TRICE_LEAVE
229
+
230
+//! TRICE8_8 writes trice data as fast as possible in a buffer.
231
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
232
+//! \param v0 - v7 are 8 bit bit values
233
+#define TRICE8_11(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
234
+	TRICE_ENTER tid;                                                      \
235
+	TRICE_CNTC(11);                                                       \
236
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);           \
237
+	TRICE_LEAVE
238
+
239
+//! TRICE8_12 writes trice data as fast as possible in a buffer.
240
+//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
241
+//! \param v0 - v11 are 8 bit bit values
242
+#define TRICE8_12(tid, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
243
+	TRICE_ENTER tid;                                                           \
244
+	TRICE_CNTC(12);                                                            \
245
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)            \
246
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice8McuOrder.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice8McuOrder.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice8m_0(tid)                                               \
6
+	TRICE_ENTER                                                      \
7
+	TRICE_PUT((0 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
8
+	TRICE_LEAVE
9
+
10
+#define trice8m_1(tid, v0)                                           \
11
+	TRICE_ENTER                                                      \
12
+	TRICE_PUT((1 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
13
+	TRICE_PUT8_1(v0)                                                 \
14
+	TRICE_LEAVE
15
+
16
+#define trice8m_2(tid, v0, v1)                                       \
17
+	TRICE_ENTER                                                      \
18
+	TRICE_PUT((2 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
19
+	TRICE_PUT8_2(v0, v1);                                            \
20
+	TRICE_LEAVE
21
+
22
+#define trice8m_3(tid, v0, v1, v2)                                   \
23
+	TRICE_ENTER                                                      \
24
+	TRICE_PUT((3 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
25
+	TRICE_PUT8_3(v0, v1, v2);                                        \
26
+	TRICE_LEAVE
27
+
28
+#define trice8m_4(tid, v0, v1, v2, v3)                               \
29
+	TRICE_ENTER                                                      \
30
+	TRICE_PUT((4 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
31
+	TRICE_PUT8_4(v0, v1, v2, v3);                                    \
32
+	TRICE_LEAVE
33
+
34
+#define trice8m_5(tid, v0, v1, v2, v3, v4)                           \
35
+	TRICE_ENTER                                                      \
36
+	TRICE_PUT((5 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
37
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);                                \
38
+	TRICE_LEAVE
39
+
40
+#define trice8m_6(tid, v0, v1, v2, v3, v4, v5)                       \
41
+	TRICE_ENTER                                                      \
42
+	TRICE_PUT((6 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
43
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);                            \
44
+	TRICE_LEAVE
45
+
46
+#define trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6)                   \
47
+	TRICE_ENTER                                                      \
48
+	TRICE_PUT((7 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
49
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);                        \
50
+	TRICE_LEAVE
51
+
52
+#define trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)               \
53
+	TRICE_ENTER                                                      \
54
+	TRICE_PUT((8 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
55
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);                    \
56
+	TRICE_LEAVE
57
+
58
+#define trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)           \
59
+	TRICE_ENTER                                                      \
60
+	TRICE_PUT((9 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
61
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);                \
62
+	TRICE_LEAVE
63
+
64
+#define trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)       \
65
+	TRICE_ENTER                                                       \
66
+	TRICE_PUT((10 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
67
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);            \
68
+	TRICE_LEAVE
69
+
70
+#define trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)  \
71
+	TRICE_ENTER                                                       \
72
+	TRICE_PUT((11 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid))); \
73
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);       \
74
+	TRICE_LEAVE
75
+
76
+#define trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                           \
78
+	TRICE_PUT((12 << 24) | ((TRICE_CYCLE) << 16) | (0x4000 | (tid)));     \
79
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice8m_0(tid)                             \
83
+	TRICE_ENTER                                    \
84
+	uint16_t ts = TriceStamp16;                    \
85
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
86
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | ts); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice8m_1(tid, v0)                         \
90
+	TRICE_ENTER                                    \
91
+	uint16_t ts = TriceStamp16;                    \
92
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
93
+	TRICE_PUT(1 << 24 | (TRICE_CYCLE << 16) | ts); \
94
+	TRICE_PUT8_1(v0)                               \
95
+	TRICE_LEAVE
96
+
97
+#define Trice8m_2(tid, v0, v1)                     \
98
+	TRICE_ENTER                                    \
99
+	uint16_t ts = TriceStamp16;                    \
100
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
101
+	TRICE_PUT(2 << 24 | (TRICE_CYCLE << 16) | ts); \
102
+	TRICE_PUT8_2(v0, v1);                          \
103
+	TRICE_LEAVE
104
+
105
+#define Trice8m_3(tid, v0, v1, v2)                 \
106
+	TRICE_ENTER                                    \
107
+	uint16_t ts = TriceStamp16;                    \
108
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
109
+	TRICE_PUT(3 << 24 | (TRICE_CYCLE << 16) | ts); \
110
+	TRICE_PUT8_3(v0, v1, v2);                      \
111
+	TRICE_LEAVE
112
+
113
+#define Trice8m_4(tid, v0, v1, v2, v3)             \
114
+	TRICE_ENTER                                    \
115
+	uint16_t ts = TriceStamp16;                    \
116
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
117
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | ts); \
118
+	TRICE_PUT8_4(v0, v1, v2, v3);                  \
119
+	TRICE_LEAVE
120
+
121
+#define Trice8m_5(tid, v0, v1, v2, v3, v4)         \
122
+	TRICE_ENTER                                    \
123
+	uint16_t ts = TriceStamp16;                    \
124
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
125
+	TRICE_PUT(5 << 24 | (TRICE_CYCLE << 16) | ts); \
126
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);              \
127
+	TRICE_LEAVE
128
+
129
+#define Trice8m_6(tid, v0, v1, v2, v3, v4, v5)     \
130
+	TRICE_ENTER                                    \
131
+	uint16_t ts = TriceStamp16;                    \
132
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
133
+	TRICE_PUT(6 << 24 | (TRICE_CYCLE << 16) | ts); \
134
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);          \
135
+	TRICE_LEAVE
136
+
137
+#define Trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6) \
138
+	TRICE_ENTER                                    \
139
+	uint16_t ts = TriceStamp16;                    \
140
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));   \
141
+	TRICE_PUT(7 << 24 | (TRICE_CYCLE << 16) | ts); \
142
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);      \
143
+	TRICE_LEAVE
144
+
145
+#define Trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7) \
146
+	TRICE_ENTER                                        \
147
+	uint16_t ts = TriceStamp16;                        \
148
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));       \
149
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | ts);     \
150
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);      \
151
+	TRICE_LEAVE
152
+
153
+#define Trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
154
+	TRICE_ENTER                                            \
155
+	uint16_t ts = TriceStamp16;                            \
156
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));           \
157
+	TRICE_PUT(9 << 24 | (TRICE_CYCLE << 16) | ts);         \
158
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
159
+	TRICE_LEAVE
160
+
161
+#define Trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                 \
163
+	uint16_t ts = TriceStamp16;                                 \
164
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                \
165
+	TRICE_PUT(10 << 24 | (TRICE_CYCLE << 16) | ts);             \
166
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                      \
171
+	uint16_t ts = TriceStamp16;                                      \
172
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                     \
173
+	TRICE_PUT(11 << 24 | (TRICE_CYCLE << 16) | ts);                  \
174
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                           \
179
+	uint16_t ts = TriceStamp16;                                           \
180
+	TRICE_PUT(0x80008000 | (tid << 16) | (tid));                          \
181
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | ts);                       \
182
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice8m_0(tid)                                     \
186
+	TRICE_ENTER                                            \
187
+	uint32_t ts = TriceStamp32;                            \
188
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
189
+	TRICE_PUT(0 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
190
+	TRICE_LEAVE
191
+
192
+#define TRice8m_1(tid, v0)                                 \
193
+	TRICE_ENTER                                            \
194
+	uint32_t ts = TriceStamp32;                            \
195
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
196
+	TRICE_PUT(1 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
197
+	TRICE_PUT8_1(v0)                                       \
198
+	TRICE_LEAVE
199
+
200
+#define TRice8m_2(tid, v0, v1)                             \
201
+	TRICE_ENTER                                            \
202
+	uint32_t ts = TriceStamp32;                            \
203
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
204
+	TRICE_PUT(2 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
205
+	TRICE_PUT8_2(v0, v1);                                  \
206
+	TRICE_LEAVE
207
+
208
+#define TRice8m_3(tid, v0, v1, v2)                         \
209
+	TRICE_ENTER                                            \
210
+	uint32_t ts = TriceStamp32;                            \
211
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
212
+	TRICE_PUT(3 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
213
+	TRICE_PUT8_3(v0, v1, v2);                              \
214
+	TRICE_LEAVE
215
+
216
+#define TRice8m_4(tid, v0, v1, v2, v3)                     \
217
+	TRICE_ENTER                                            \
218
+	uint32_t ts = TriceStamp32;                            \
219
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
220
+	TRICE_PUT(4 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
221
+	TRICE_PUT8_4(v0, v1, v2, v3);                          \
222
+	TRICE_LEAVE
223
+
224
+#define TRice8m_5(tid, v0, v1, v2, v3, v4)                 \
225
+	TRICE_ENTER                                            \
226
+	uint32_t ts = TriceStamp32;                            \
227
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
228
+	TRICE_PUT(5 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
229
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);                      \
230
+	TRICE_LEAVE
231
+
232
+#define TRice8m_6(tid, v0, v1, v2, v3, v4, v5)             \
233
+	TRICE_ENTER                                            \
234
+	uint32_t ts = TriceStamp32;                            \
235
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
236
+	TRICE_PUT(6 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
237
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);                  \
238
+	TRICE_LEAVE
239
+
240
+#define TRice8m_7(tid, v0, v1, v2, v3, v4, v5, v6)         \
241
+	TRICE_ENTER                                            \
242
+	uint32_t ts = TriceStamp32;                            \
243
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
244
+	TRICE_PUT(7 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
245
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);              \
246
+	TRICE_LEAVE
247
+
248
+#define TRice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)     \
249
+	TRICE_ENTER                                            \
250
+	uint32_t ts = TriceStamp32;                            \
251
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
252
+	TRICE_PUT(8 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
253
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);          \
254
+	TRICE_LEAVE
255
+
256
+#define TRice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
257
+	TRICE_ENTER                                            \
258
+	uint32_t ts = TriceStamp32;                            \
259
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                \
260
+	TRICE_PUT(9 << 24 | (TRICE_CYCLE << 16) | (ts >> 16)); \
261
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
262
+	TRICE_LEAVE
263
+
264
+#define TRice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                 \
266
+	uint32_t ts = TriceStamp32;                                 \
267
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                     \
268
+	TRICE_PUT(10 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));     \
269
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                      \
274
+	uint32_t ts = TriceStamp32;                                      \
275
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                          \
276
+	TRICE_PUT(11 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));          \
277
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                           \
282
+	uint32_t ts = TriceStamp32;                                           \
283
+	TRICE_PUT((ts << 16) | 0xc000 | (tid));                               \
284
+	TRICE_PUT(12 << 24 | (TRICE_CYCLE << 16) | (ts >> 16));               \
285
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 286
- 0
Middlewares/trice/trice8McuReverse.h Переглянути файл

@@ -0,0 +1,286 @@
1
+/*! \file trice8McuReverse.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#define trice8m_0(tid)                       \
6
+	TRICE_ENTER                              \
7
+	TRICE_PUT(((TRICE_CYCLE) << 24) | idLH); \
8
+	TRICE_LEAVE
9
+
10
+#define trice8m_1(tid, v0)                               \
11
+	TRICE_ENTER                                          \
12
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (1 << 16) | idLH); \
13
+	TRICE_PUT8_1(v0)                                     \
14
+	TRICE_LEAVE
15
+
16
+#define trice8m_2(tid, v0, v1)                           \
17
+	TRICE_ENTER                                          \
18
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (2 << 16) | idLH); \
19
+	TRICE_PUT8_2(v0, v1);                                \
20
+	TRICE_LEAVE
21
+
22
+#define trice8m_3(tid, v0, v1, v2)                       \
23
+	TRICE_ENTER                                          \
24
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (3 << 16) | idLH); \
25
+	TRICE_PUT8_3(v0, v1, v2);                            \
26
+	TRICE_LEAVE
27
+
28
+#define trice8m_4(tid, v0, v1, v2, v3)                   \
29
+	TRICE_ENTER                                          \
30
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (4 << 16) | idLH); \
31
+	TRICE_PUT8_4(v0, v1, v2, v3);                        \
32
+	TRICE_LEAVE
33
+
34
+#define trice8m_5(tid, v0, v1, v2, v3, v4)               \
35
+	TRICE_ENTER                                          \
36
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (5 << 16) | idLH); \
37
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);                    \
38
+	TRICE_LEAVE
39
+
40
+#define trice8m_6(tid, v0, v1, v2, v3, v4, v5)           \
41
+	TRICE_ENTER                                          \
42
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (6 << 16) | idLH); \
43
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);                \
44
+	TRICE_LEAVE
45
+
46
+#define trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6)       \
47
+	TRICE_ENTER                                          \
48
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (7 << 16) | idLH); \
49
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);            \
50
+	TRICE_LEAVE
51
+
52
+#define trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)   \
53
+	TRICE_ENTER                                          \
54
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (8 << 16) | idLH); \
55
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);        \
56
+	TRICE_LEAVE
57
+
58
+#define trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
59
+	TRICE_ENTER                                            \
60
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (9 << 16) | idLH);   \
61
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);      \
62
+	TRICE_LEAVE
63
+
64
+#define trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
65
+	TRICE_ENTER                                                 \
66
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (10 << 16) | idLH);       \
67
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
68
+	TRICE_LEAVE
69
+
70
+#define trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
71
+	TRICE_ENTER                                                      \
72
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (11 << 16) | idLH);            \
73
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
74
+	TRICE_LEAVE
75
+
76
+#define trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
77
+	TRICE_ENTER                                                           \
78
+	TRICE_PUT(((TRICE_CYCLE) << 24) | (12 << 16) | idLH);                 \
79
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
80
+	TRICE_LEAVE
81
+
82
+#define Trice8m_0(tid)                          \
83
+	TRICE_ENTER                                 \
84
+	uint16_t ts = TriceStamp16;                 \
85
+	TRICE_PUT(((IdLH) << 16) | IdLH)            \
86
+	TRICE_PUT((TRICE_CYCLE << 24) | tsL | tsH); \
87
+	TRICE_LEAVE
88
+
89
+#define Trice8m_1(tid, v0)                                  \
90
+	TRICE_ENTER                                             \
91
+	uint16_t ts = TriceStamp16;                             \
92
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
93
+	TRICE_PUT((TRICE_CYCLE << 24) | (1 << 16) | tsL | tsH); \
94
+	TRICE_PUT8_1(v0)                                        \
95
+	TRICE_LEAVE
96
+
97
+#define Trice8m_2(tid, v0, v1)                              \
98
+	TRICE_ENTER                                             \
99
+	uint16_t ts = TriceStamp16;                             \
100
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
101
+	TRICE_PUT((TRICE_CYCLE << 24) | (2 << 16) | tsL | tsH); \
102
+	TRICE_PUT8_2(v0, v1);                                   \
103
+	TRICE_LEAVE
104
+
105
+#define Trice8m_3(tid, v0, v1, v2)                          \
106
+	TRICE_ENTER                                             \
107
+	uint16_t ts = TriceStamp16;                             \
108
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
109
+	TRICE_PUT((TRICE_CYCLE << 24) | (3 << 16) | tsL | tsH); \
110
+	TRICE_PUT8_3(v0, v1, v2);                               \
111
+	TRICE_LEAVE
112
+
113
+#define Trice8m_4(tid, v0, v1, v2, v3)                      \
114
+	TRICE_ENTER                                             \
115
+	uint16_t ts = TriceStamp16;                             \
116
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
117
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsL | tsH); \
118
+	TRICE_PUT8_4(v0, v1, v2, v3);                           \
119
+	TRICE_LEAVE
120
+
121
+#define Trice8m_5(tid, v0, v1, v2, v3, v4)                  \
122
+	TRICE_ENTER                                             \
123
+	uint16_t ts = TriceStamp16;                             \
124
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
125
+	TRICE_PUT((TRICE_CYCLE << 24) | (5 << 16) | tsL | tsH); \
126
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);                       \
127
+	TRICE_LEAVE
128
+
129
+#define Trice8m_6(tid, v0, v1, v2, v3, v4, v5)              \
130
+	TRICE_ENTER                                             \
131
+	uint16_t ts = TriceStamp16;                             \
132
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
133
+	TRICE_PUT((TRICE_CYCLE << 24) | (6 << 16) | tsL | tsH); \
134
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);                   \
135
+	TRICE_LEAVE
136
+
137
+#define Trice8m_7(tid, v0, v1, v2, v3, v4, v5, v6)          \
138
+	TRICE_ENTER                                             \
139
+	uint16_t ts = TriceStamp16;                             \
140
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
141
+	TRICE_PUT((TRICE_CYCLE << 24) | (7 << 16) | tsL | tsH); \
142
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);               \
143
+	TRICE_LEAVE
144
+
145
+#define Trice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)      \
146
+	TRICE_ENTER                                             \
147
+	uint16_t ts = TriceStamp16;                             \
148
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
149
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsL | tsH); \
150
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);           \
151
+	TRICE_LEAVE
152
+
153
+#define Trice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)  \
154
+	TRICE_ENTER                                             \
155
+	uint16_t ts = TriceStamp16;                             \
156
+	TRICE_PUT(((IdLH) << 16) | IdLH)                        \
157
+	TRICE_PUT((TRICE_CYCLE << 24) | (9 << 16) | tsL | tsH); \
158
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);       \
159
+	TRICE_LEAVE
160
+
161
+#define Trice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
162
+	TRICE_ENTER                                                 \
163
+	uint16_t ts = TriceStamp16;                                 \
164
+	TRICE_PUT(((IdLH) << 16) | IdLH)                            \
165
+	TRICE_PUT((TRICE_CYCLE << 24) | (10 << 16) | tsL | tsH);    \
166
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
167
+	TRICE_LEAVE
168
+
169
+#define Trice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
170
+	TRICE_ENTER                                                      \
171
+	uint16_t ts = TriceStamp16;                                      \
172
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                 \
173
+	TRICE_PUT((TRICE_CYCLE << 24) | (11 << 16) | tsL | tsH);         \
174
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
175
+	TRICE_LEAVE
176
+
177
+#define Trice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
178
+	TRICE_ENTER                                                           \
179
+	uint16_t ts = TriceStamp16;                                           \
180
+	TRICE_PUT(((IdLH) << 16) | IdLH)                                      \
181
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsL | tsH);              \
182
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
183
+	TRICE_LEAVE
184
+
185
+#define TRice8m_0(tid)                           \
186
+	TRICE_ENTER                                  \
187
+	uint32_t ts = TriceStamp32;                  \
188
+	TRICE_PUT(tsHL | tsHH | IDLH)                \
189
+	TRICE_PUT((TRICE_CYCLE << 24) | tsLL | tsLH) \
190
+	TRICE_LEAVE
191
+
192
+#define TRice8m_1(tid, v0)                                   \
193
+	TRICE_ENTER                                              \
194
+	uint32_t ts = TriceStamp32;                              \
195
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
196
+	TRICE_PUT((TRICE_CYCLE << 24) | (1 << 16) | tsLL | tsLH) \
197
+	TRICE_PUT8_1(v0)                                         \
198
+	TRICE_LEAVE
199
+
200
+#define TRice8m_2(tid, v0, v1)                               \
201
+	TRICE_ENTER                                              \
202
+	uint32_t ts = TriceStamp32;                              \
203
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
204
+	TRICE_PUT((TRICE_CYCLE << 24) | (2 << 16) | tsLL | tsLH) \
205
+	TRICE_PUT8_2(v0, v1);                                    \
206
+	TRICE_LEAVE
207
+
208
+#define TRice8m_3(tid, v0, v1, v2)                           \
209
+	TRICE_ENTER                                              \
210
+	uint32_t ts = TriceStamp32;                              \
211
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
212
+	TRICE_PUT((TRICE_CYCLE << 24) | (3 << 16) | tsLL | tsLH) \
213
+	TRICE_PUT8_3(v0, v1, v2);                                \
214
+	TRICE_LEAVE
215
+
216
+#define TRice8m_4(tid, v0, v1, v2, v3)                       \
217
+	TRICE_ENTER                                              \
218
+	uint32_t ts = TriceStamp32;                              \
219
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
220
+	TRICE_PUT((TRICE_CYCLE << 24) | (4 << 16) | tsLL | tsLH) \
221
+	TRICE_PUT8_4(v0, v1, v2, v3);                            \
222
+	TRICE_LEAVE
223
+
224
+#define TRice8m_5(tid, v0, v1, v2, v3, v4)                   \
225
+	TRICE_ENTER                                              \
226
+	uint32_t ts = TriceStamp32;                              \
227
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
228
+	TRICE_PUT((TRICE_CYCLE << 24) | (5 << 16) | tsLL | tsLH) \
229
+	TRICE_PUT8_5(v0, v1, v2, v3, v4);                        \
230
+	TRICE_LEAVE
231
+
232
+#define TRice8m_6(tid, v0, v1, v2, v3, v4, v5)               \
233
+	TRICE_ENTER                                              \
234
+	uint32_t ts = TriceStamp32;                              \
235
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
236
+	TRICE_PUT((TRICE_CYCLE << 24) | (6 << 16) | tsLL | tsLH) \
237
+	TRICE_PUT8_6(v0, v1, v2, v3, v4, v5);                    \
238
+	TRICE_LEAVE
239
+
240
+#define TRice8m_7(tid, v0, v1, v2, v3, v4, v5, v6)           \
241
+	TRICE_ENTER                                              \
242
+	uint32_t ts = TriceStamp32;                              \
243
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
244
+	TRICE_PUT((TRICE_CYCLE << 24) | (7 << 16) | tsLL | tsLH) \
245
+	TRICE_PUT8_7(v0, v1, v2, v3, v4, v5, v6);                \
246
+	TRICE_LEAVE
247
+
248
+#define TRice8m_8(tid, v0, v1, v2, v3, v4, v5, v6, v7)       \
249
+	TRICE_ENTER                                              \
250
+	uint32_t ts = TriceStamp32;                              \
251
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
252
+	TRICE_PUT((TRICE_CYCLE << 24) | (8 << 16) | tsLL | tsLH) \
253
+	TRICE_PUT8_8(v0, v1, v2, v3, v4, v5, v6, v7);            \
254
+	TRICE_LEAVE
255
+
256
+#define TRice8m_9(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8)   \
257
+	TRICE_ENTER                                              \
258
+	uint32_t ts = TriceStamp32;                              \
259
+	TRICE_PUT(tsHL | tsHH | IDLH)                            \
260
+	TRICE_PUT((TRICE_CYCLE << 24) | (9 << 16) | tsLL | tsLH) \
261
+	TRICE_PUT8_9(v0, v1, v2, v3, v4, v5, v6, v7, v8);        \
262
+	TRICE_LEAVE
263
+
264
+#define TRice8m_10(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
265
+	TRICE_ENTER                                                 \
266
+	uint32_t ts = TriceStamp32;                                 \
267
+	TRICE_PUT(tsHL | tsHH | IDLH)                               \
268
+	TRICE_PUT((TRICE_CYCLE << 24) | (10 << 16) | tsLL | tsLH)   \
269
+	TRICE_PUT8_10(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);      \
270
+	TRICE_LEAVE
271
+
272
+#define TRice8m_11(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
273
+	TRICE_ENTER                                                      \
274
+	uint32_t ts = TriceStamp32;                                      \
275
+	TRICE_PUT(tsHL | tsHH | IDLH)                                    \
276
+	TRICE_PUT((TRICE_CYCLE << 24) | (11 << 16) | tsLL | tsLH)        \
277
+	TRICE_PUT8_11(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);      \
278
+	TRICE_LEAVE
279
+
280
+#define TRice8m_12(tid, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
281
+	TRICE_ENTER                                                           \
282
+	uint32_t ts = TriceStamp32;                                           \
283
+	TRICE_PUT(tsHL | tsHH | IDLH)                                         \
284
+	TRICE_PUT((TRICE_CYCLE << 24) | (12 << 16) | tsLL | tsLH)             \
285
+	TRICE_PUT8_12(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)       \
286
+	TRICE_LEAVE

+ 90
- 0
Middlewares/trice/triceAuxiliary.c Переглянути файл

@@ -0,0 +1,90 @@
1
+//! \file triceAuxiliary.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//!     //////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+#include <stdint.h>
6
+#include <stdlib.h>
7
+
8
+#if !TRICE_OFF
9
+
10
+    #if TRICE_DIRECT_AUXILIARY8 == 1
11
+
12
+//! UserNonBlockingDirectWrite8AuxiliaryFn can get a user function address for writing to an auxiliary interface.
13
+Write8AuxiliaryFn_t UserNonBlockingDirectWrite8AuxiliaryFn = (void *)0;
14
+
15
+//! TriceNonBlockingDirectWrite8Auxiliary writes to a user defined interface.
16
+void TriceNonBlockingDirectWrite8Auxiliary(const uint8_t *enc, size_t encLen)
17
+{
18
+#if TRICE_CGO == 1 // automated tests
19
+    TriceWriteDeviceCgo(enc, encLen);
20
+#else
21
+    if (UserNonBlockingDirectWrite8AuxiliaryFn != (void *)0)
22
+    {
23
+        UserNonBlockingDirectWrite8AuxiliaryFn(enc, encLen);
24
+    }
25
+#endif
26
+}
27
+
28
+    #endif // #if TRICE_DIRECT_AUXILIARY8 == 1
29
+
30
+    #if TRICE_DEFERRED_AUXILIARY8 == 1
31
+
32
+//! UserNonBlockingDeferredWrite8AuxiliaryFn can get a user function address for writing to an auxiliary interface.
33
+Write8AuxiliaryFn_t UserNonBlockingDeferredWrite8AuxiliaryFn = (void *)0;
34
+
35
+//! TriceNonBlockingDeferredWrite8Auxiliary writes to a user defined interface.
36
+void TriceNonBlockingDeferredWrite8Auxiliary(const uint8_t *enc, size_t encLen)
37
+{
38
+#if TRICE_CGO == 1 // automated tests
39
+    TriceWriteDeviceCgo(enc, encLen);
40
+#else
41
+    if (UserNonBlockingDeferredWrite8AuxiliaryFn != (void *)0)
42
+    {
43
+        UserNonBlockingDeferredWrite8AuxiliaryFn(enc, encLen);
44
+    }
45
+#endif
46
+}
47
+
48
+    #endif // #if TRICE_DEFERRED_AUXILIARY8 == 1
49
+
50
+    #if TRICE_DIRECT_AUXILIARY32 == 1
51
+
52
+//! UserNonBlockingDirectWrite32AuxiliaryFn can get a user function address for writing to an auxiliary interface.
53
+Write32AuxiliaryFn_t UserNonBlockingDirectWrite32AuxiliaryFn = (void *)0;
54
+
55
+//! TriceNonBlockingDirectWrite32Auxiliary writes to a user defined interface.
56
+void TriceNonBlockingDirectWrite32Auxiliary(const uint32_t *enc, unsigned count)
57
+{
58
+#if TRICE_CGO == 1 // automated tests
59
+    TriceWriteDeviceCgo(enc, count << 2);
60
+#else
61
+    if (UserNonBlockingDirectWrite32AuxiliaryFn != (void *)0)
62
+    {
63
+        UserNonBlockingDirectWrite32AuxiliaryFn(enc, count);
64
+    }
65
+#endif
66
+}
67
+
68
+    #endif // #if TRICE_DIRECT_AUXILIARY32 == 1
69
+
70
+    #if TRICE_DEFERRED_AUXILIARY32 == 1
71
+
72
+//! UserNonBlockingDeferredWrite32AuxiliaryFn can get a user function address for writing to an auxiliary interface.
73
+Write32AuxiliaryFn_t UserNonBlockingDeferredWrite32AuxiliaryFn = (void *)0;
74
+
75
+//! TriceNonBlockingDeferredWrite32Auxiliary writes to a user defined interface.
76
+void TriceNonBlockingDeferredWrite32Auxiliary(const uint32_t *enc, unsigned count)
77
+{
78
+#if TRICE_CGO == 1 // automated tests
79
+    TriceWriteDeviceCgo(enc, count << 2);
80
+#else
81
+    if (UserNonBlockingDeferredWrite32AuxiliaryFn != (void *)0)
82
+    {
83
+        UserNonBlockingDeferredWrite32AuxiliaryFn(enc, count);
84
+    }
85
+#endif
86
+}
87
+
88
+    #endif // #if TRICE_DEFERRED_AUXILIARY32 == 1
89
+
90
+#endif // #if !TRICE_OFF

+ 484
- 0
Middlewares/trice/triceDefaultConfig.h Переглянути файл

@@ -0,0 +1,484 @@
1
+/*!
2
+ *  \file triceDefaultConfig.h
3
+   \author Thomas.Hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+#ifndef TRICE_DEFAULT_CONFIG_H_
8
+#define TRICE_DEFAULT_CONFIG_H_
9
+
10
+#ifdef __cplusplus
11
+extern "C"
12
+{
13
+#endif
14
+
15
+#ifndef TRICE_CLEAN
16
+// TRICE_CLEAN, when found in triceConfig.h is set to 0 with command "trice insert".
17
+// and set to 1 with command "trice clean" to get rid of
18
+// potential editor warnings in the trice clean state.
19
+#define TRICE_CLEAN 0
20
+#endif
21
+
22
+#ifndef TRICE_OFF
23
+// TRICE_OFF, when defined to 1 earlier than including trice.h disables trice code for the file.
24
+// When defined in the project settings, it influences the whole trice code generation.
25
+#define TRICE_OFF 0
26
+#endif
27
+
28
+#ifndef TRICE_UARTA_MIN_ID
29
+#define TRICE_UARTA_MIN_ID 0 //!< TRICE_UARTA_MIN_ID, if > 0, is the smalles ID routed to UARTA.
30
+#endif
31
+
32
+#ifndef TRICE_UARTA_MAX_ID
33
+#define TRICE_UARTA_MAX_ID 0 //!< TRICE_UARTA_MAX_ID, if > 0, is the largest ID routed to UARTA.
34
+#endif
35
+
36
+#ifndef TRICE_UARTB_MIN_ID
37
+#define TRICE_UARTB_MIN_ID 0 //!< TRICE_UARTB_MIN_ID, if > 0, is the smalles ID routed to UARTB.
38
+#endif
39
+
40
+#ifndef TRICE_UARTB_MAX_ID
41
+#define TRICE_UARTB_MAX_ID 0 //!< TRICE_UARTB_MAX_ID, if > 0, is the largest ID routed to UARTA.
42
+#endif
43
+
44
+#ifndef TRICE_DEFERRED_UARTA
45
+#define TRICE_DEFERRED_UARTA 0 //!< TRICE_DEFERRED_UARTA enables a user defined deferred trice write over TRICE_UARTA.
46
+#endif
47
+
48
+#ifndef TRICE_DEFERRED_UARTB
49
+#define TRICE_DEFERRED_UARTB 0 //!< TRICE_DEFERRED_UARTB enables a user defined deferred trice write over TRICE_UARTB.
50
+#endif
51
+
52
+#ifndef TRICE_DIRECT_AUXILIARY8
53
+#define TRICE_DIRECT_AUXILIARY8 0 //!< TRICE_DIRECT_AUXILIARY8 enables a user defined direct trice write.
54
+#endif
55
+
56
+#ifndef TRICE_DEFERRED_AUXILIARY8
57
+#define TRICE_DEFERRED_AUXILIARY8 0 //!< TRICE_DEFERRED_AUXILIARY8 enables a user defined deferred trice write.
58
+#endif
59
+
60
+#ifndef TRICE_DIRECT_AUXILIARY32
61
+#define TRICE_DIRECT_AUXILIARY32 0 //!< TRICE_DIRECT_AUXILIARY32 enables a user defineddirect trice write.
62
+#endif
63
+
64
+#ifndef TRICE_DEFERRED_AUXILIARY32
65
+#define TRICE_DEFERRED_AUXILIARY32 0 //!< TRICE_DEFERRED_AUXILIARY32 enables a user defined deferred trice write.
66
+#endif
67
+
68
+#ifndef TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING
69
+//! TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING allows to send an ID range of trices directly to an output.
70
+//! The called output function usually is executed inside an interrupt and should therefore be non-blocking and fast.
71
+#define TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING 0
72
+#endif
73
+
74
+#ifndef TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING
75
+//! TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING allows to send an ID range of trices directly to an output.
76
+//! The called output function should be non-blocking.
77
+#define TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING 0
78
+#endif
79
+
80
+#ifndef TRICE_B
81
+//! TRICE_B is a shortcut for TRICE8_B, TRICE16_B, TRICE32_B or TRICE64_B usable in your project.
82
+#define TRICE_B TRICE8_B
83
+#endif
84
+
85
+#ifndef TRICE_F
86
+//! TRICE_F is a shortcut for TRICE8_F, TRICE16_F, TRICE32_F or TRICE64_F usable in your project.
87
+#define TRICE_F TRICE8_F
88
+#endif
89
+
90
+#ifndef TRICE_COMMAND_SIZE_MAX
91
+//! TRICE_COMMAND_SIZE_MAX is the length limit for command strings to target.
92
+#define TRICE_COMMAND_SIZE_MAX 8
93
+#endif
94
+
95
+#ifndef TRICE_DEFAULT_PARAMETER_BIT_WIDTH
96
+//! TRICE_DEFAULT_PARAMETER_BIT_WIDTH is the default parameter bit width for Trice macros not specifying the parameter bit width: 8, 16, 32 or 64.
97
+//! If for example the majority of your values is 16 bit, it makes sense to set this value to 16 to use Trice for them and to use Trice32 explicitely for 32-bit values.
98
+//! The trice tool CLI switch "-defaultTRICEBitwidth" needs to be set to the same bit width, default is 32.
99
+#define TRICE_DEFAULT_PARAMETER_BIT_WIDTH 32
100
+#endif
101
+
102
+#ifndef TRICE_CONFIG_WARNINGS
103
+#define TRICE_CONFIG_WARNINGS 1 //!< TRICE_CONFIG_WARNINGS == 0 can suppress some unwanted configuration warnings. Set to 0 only if you know what you are doing.
104
+#endif
105
+
106
+#ifndef TriceStamp16
107
+//! TriceStamp16 returns a 16-bit value to stamp `Id` TRICE and `Trice` macros. Usually it is a timestamp, but could also be a destination address or a counter for example.
108
+//! The user has to provide this value. Defining a macro here, instead of providing a function has significant speed impact.
109
+#define TriceStamp16 0xbe16
110
+#endif
111
+
112
+#ifndef TriceStamp32
113
+//! TriceStamp32 returns a 32-bit value to stamp `ID` TRICE and `TRice` macros. Usually it is a timestamp, but could also be a destination address or a counter for example.
114
+//! The user has to provide this value. Defining a macro here, instead of providing a function has significant speed impact.
115
+#define TriceStamp32 0xfeed3322
116
+#endif
117
+
118
+#ifndef TRICE_PROTECT
119
+//! The TRICE_PROTECT switch is only relevant for the deferred trice modes TRICE_DOUBLE_BUFFER and TRICE_RING_BUFFER.
120
+//! The trice library works well, when less data are produced in the average than transmittable and when in the double buffer case the TriceTransfer
121
+//! function is called, before too much data in a half buffer according to a good configuration. If that is guarantied you do not need to enable TRICE_PROTECT.
122
+//! If because of an potential error this is not guarantied, you should enable TRICE_PROTECT. This slows down the Trice macros a bit, but makes buffer overflows impossible.
123
+//! A ring buffer cannot overflow in a first assumption, because old, not yet transmitted, trices are overwritten by newer ones.
124
+//! But that can happen only to parts of trices. The ring buffer read out function relies on consistent data. If it gets data garbage, wrong values
125
+//! for the trice lengths are possible and buffer overruns not avoidable. When enabling TRICE_PROTECT, new trices are only written into the deferred buffer,
126
+//! if there is enough space. That guaranties data consistency. Because a suppressed trice cannot cause a cycle error, there is TriceOverflowCount as diagnostic value.
127
+//! Long story short: If you sure, not to produce too much data, than set TRICE_PROTECT to 0 and get a bit more speed.
128
+#define TRICE_PROTECT 1
129
+#endif
130
+
131
+#if !defined(TRICE_BUFFER) && !TRICE_OFF
132
+//!  TRICE_BUFFER selects, where the Trice macros accumulate the trice data during a single Trice execution. Selectable options:
133
+//! - TRICE_STACK_BUFFER: No additional buffer is needed, what makes sense for single task systems with direct output only.
134
+//! - TRICE_STATIC_BUFFER: A single trice is stored in a separate static buffer, what makes sense for multi-tasking systems with direct output only.
135
+//! - TRICE_DOUBLE_BUFFER: Trice macros write direct into a double buffer without any additional management action.
136
+//!   This is the fastest execution option for Trice macros but needs more RAM. Used for deferred output and optional additional direct output.
137
+//! - TRICE_RING_BUFFER: Trice macros write direct into a ring buffer without any additional management action.
138
+//!   This is a fast but not the fastest execution option for Trice macros and needs less RAM. Used for deferred output and optional additional direct output.
139
+#error TRICE_BUFFER type not specified in triceConfig.h, please add "#define TRICE_BUFFER TRICE_RING_BUFFER" for example.
140
+#endif
141
+
142
+#ifndef TRICE_DEFERRED_TRANSFER_MODE
143
+//! TRICE_DEFERRED_TRANSFER_MODE is the selected deferred trice transfer method. Options:
144
+//! - TRICE_SINGLE_PACK_MODE packs each Trice message separately and adds a 0-delimiter byte. This increases the transmit byte count slightly. In case of a lost package only one Trice can get lost.
145
+//! - TRICE_MULTI_PACK_MODE packs several trice messages before adding a 0-delimiter byte. This reduces the transmit byte count. In case of a lost package several Trices can get lost.
146
+//! - When using encryption, the TRICE_MULTI_PACK_MODE can significantly reduce the transmit byte count, because in TRICE_SINGLE_PACK_MODE each Trice message gets extended
147
+//! with 1 to 7 padding bytes before encryption. TRICE_MULTI_PACK_MODE is not possible for TRICE_STACK_BUFFER and TRICE_STATIC_BUFFER (direct mode).
148
+#define TRICE_DEFERRED_TRANSFER_MODE TRICE_MULTI_PACK_MODE
149
+#endif
150
+
151
+#ifndef TRICE_RING_BUFFER_OVERFLOW_WATCH
152
+//! TRICE_RING_BUFFER_OVERFLOW_WATCH is used to investigate, if the ring buffer margins are really not touched.
153
+//! This value usually can stay 0.
154
+#define TRICE_RING_BUFFER_OVERFLOW_WATCH 0
155
+#endif
156
+
157
+#ifndef TRICE_DIRECT_OUTPUT
158
+//! TRICE_DIRECT_OUTPUT == 0: only deferred output, usually UART output only
159
+//! TRICE_DIRECT_OUTPUT == 1: with direct output, SEGGER_RTT output and/or TRICE_DIRECT_AUXILIARY8 output
160
+//! Setting TRICE_BUFFER to TRICE_STACK_BUFFER or TRICE_STATIC_BUFFER demands TRICE_DIRECT_OUTPUT == 1, no deferred output at all.
161
+//! When TRICE_BUFFER == TRICE_RING_BUFFER or TRICE_BUFFER == TRICE_DOUBLE_BUFFER for deferred output, additional direct output can be switched on here.
162
+//! For example it is possible to have direct 32-bit wise RTT TRICE_FRAMING_NONE output and deferred UART TRICE_FRAMING_TCOBS output.
163
+#define TRICE_DIRECT_OUTPUT 0
164
+#endif
165
+
166
+#ifndef TRICE_DEFERRED_OUTPUT
167
+//! TRICE_DEFERRED_OUTPUT == 0: no deferred output
168
+//! TRICE_DEFERRED_OUTPUT == 1: with deferred output, usually UART output and/or auxiliary output
169
+//! Setting TRICE_BUFFER to TRICE_RING_BUFFER or TRICE_DOUBLE_BUFFER demands TRICE_DEFERRED_OUTPUT == 1.
170
+//! TRICE_BUFFER == TRICE_STACK_BUFFER or TRICE_BUFFER == TRICE_STATIC_BUFFER needs TRICE_DEFERRED_OUTPUT == 0.
171
+//! When TRICE_BUFFER == TRICE_RING_BUFFER or TRICE_BUFFER == TRICE_DOUBLE_BUFFER for deferred output, additional direct output can be on.
172
+#define TRICE_DEFERRED_OUTPUT 0
173
+#endif
174
+
175
+#ifndef TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING
176
+//! TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING == 1 makes only sense, when TRICE_DIRECT_OUTPUT is 1.
177
+//! Enable this only, if you want only a specific ID range for direct Trice output.
178
+//! If you use different direct output channels, you can change this only for all together.
179
+#define TRICE_DIRECT_OUTPUT_IS_WITH_ROUTING 0 // (experimental)
180
+#endif
181
+
182
+#ifndef TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING
183
+//! TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING == 1 makes only sense, when TRICE_DEFERRED_OUTPUT is 1.
184
+//! Enable this only, if you want only a specific ID range for direct Trice output.
185
+//! If you use different direct output channels, you can change this only for all together.
186
+#define TRICE_DEFERRED_OUTPUT_IS_WITH_ROUTING 0 // (experimental)
187
+#endif
188
+
189
+#ifndef TRICE_DATA_OFFSET
190
+//! TRICE_DATA_OFFSET is the space in front of single trice data for in-buffer (T)COBS encoding.
191
+//! - When using real big buffers, 16 may be not enough.
192
+//! - When having only short trices but lots of trice bursts, it may make sense to reduce this value to 4.
193
+//! - Without encoding/framing this value can be 0.
194
+//! - When using XTEA, this value should incorporate additional 4 bytes, because of the 64-bit encryption units.
195
+//! With TRICE_BUFFER == TRICE_RING_BUFFER, this amount of space is allocated in front of the ring buffer.
196
+//! With TRICE_BUFFER == TRICE_DOUBLE_BUFFER, this amount of space is allocated once in front of each half buffer.
197
+//! Must be a multiple of 4. 64 is a _very_ safe value. In most cases you can reduce this to 16 or less.
198
+#define TRICE_DATA_OFFSET 64
199
+#endif
200
+
201
+#ifndef TRICE_SINGLE_MAX_SIZE
202
+//! TRICE_SINGLE_MAX_SIZE is used to truncate long runtime generated strings, to detect the need of a ring buffer wrap or to protect against overflow.
203
+//! It must be a multiple of 4 and ist max valid value is 32764.
204
+//! \li Be careful with this value: When using 12 64-bit values with a 32-bit stamp the trice size is 2(id) + 4(stamp) + 2(count) + 12*8(values) = 104 bytes.
205
+//! \li In direct mode, and also when you enabled TRICE_DEFERRED_SEGGER_RTT_8BIT_WRITE, this plus TRICE_DATA_OFFSET plus 4 is the max allocation size on the target
206
+//! stack with TRICE_BUFFER == TRICE_STACK_BUFFER.
207
+//! \li When short of memory and, for example, max 2 32-bit values with a 32-bit stamp are used, the max trice size is 2 + 4 + 2 + 2*4 = 16 bytes.
208
+//! \li When not using target timestamps and not more than one 32-bit or two 16-bit or four 8-bit values or using target timestamp without carried values, the TRICE_SINGLE_MAX_SIZE should be 8 bytes only.
209
+//! \li With a value < 104 automatically all then forbidden trices are disabled to avoid mistakes. This also reduces the needed flash size and compile time depending on the used compiler.
210
+//! \li Example: TRrice( "%d %d %d", 1, 2, 3)` would cause a compiler error with `#define TRICE_SINGLE_MAX_SIZE 16` then.
211
+//! \li When NOT using dynamic string or buffer transfer, bigger values than 104 make no sense here and just spoiling RAM.
212
+//! \li When USING dynamic string (or buffer) transfer, this value limits the max length of a trice. 2^15-4=32764 is the max possible value if you have enough RAM.
213
+//! According to TRICE_SINGLE_MAX_SIZE the Trice functions are enabled/disabled automatically.
214
+//! To force that manually, the user can for example `#define ENABLE_trice32fn_12 0` or `#define ENABLE_trice32fn_12 1` for all variations. See trice8.c trice16.c, ... .
215
+#define TRICE_SINGLE_MAX_SIZE 104
216
+#endif
217
+
218
+#if TRICE_SINGLE_MAX_SIZE & 3
219
+#error "TRICE_SINGLE_MAX_SIZE is not a multiple of 4"
220
+#endif
221
+
222
+#if TRICE_SINGLE_MAX_SIZE > 32764
223
+#error "TRICE_SINGLE_MAX_SIZE is too big"
224
+#endif
225
+
226
+#ifndef TRICE_DEFERRED_BUFFER_SIZE
227
+//! TRICE_DEFERRED_BUFFER_SIZE needs to be capable to hold trice bursts until they are transmitted and must be a multiple of 4.
228
+//! \li When TRICE_BUFFER == TRICE_STACK_BUFFER this value is not used.
229
+//! \li When TRICE_BUFFER == TRICE_STATIC_BUFFER this value is not used.
230
+//! \li When TRICE_BUFFER == TRICE_DOUBLE_BUFFER, this is the sum of both half buffers.
231
+//! \li When TRICE_BUFFER == TRICE_RING_BUFFER, this is the whole buffer.
232
+#define TRICE_DEFERRED_BUFFER_SIZE 1024
233
+#endif
234
+
235
+#ifndef TRICE_RING_BUFFER_SIZE
236
+//! TRICE_RING_BUFFER_SIZE is the ring buffer net size. Together with TRICE_DATA_OFFSET it is the TRICE_DEFERRED_BUFFER_SIZE.
237
+#define TRICE_RING_BUFFER_SIZE (TRICE_DEFERRED_BUFFER_SIZE - TRICE_DATA_OFFSET)
238
+#endif
239
+
240
+#ifndef TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN
241
+//! Long story short: Whith big endian target MCUs simply apply the `-triceEndianness bigEndian` CLI switch when using the `trice log` command.
242
+//! Long story long:
243
+//! TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN should have the same value as TRICE_MCU_IS_BIG_ENDIAN to avoid additional byte swapping code.
244
+//! It can be defined to 1 on little endian MCUs if the trice data are needed in network order for some reason.
245
+//! But that adds byte swapping code. This switch is mainly intended to be used for automated tests.
246
+//! The default transfer order is little endian as most targets are little endian machines.
247
+//! On big endian MCUs this value should be set to 1 to avoid additional byte swapping code, which increases the trice storage time and the needed code amount.
248
+//! For TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 1, you need to apply the `-triceEndianness bigEndian` CLI switch when using the `trice log` command then.
249
+//! Please consider also the TRICE_MCU_IS_BIG_ENDIAN compiler switch in this context.
250
+#define TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN TRICE_MCU_IS_BIG_ENDIAN
251
+#endif
252
+
253
+#ifndef TRICE_DIRECT_OUT_FRAMING
254
+//! TRICE_DIRECT_OUT_FRAMING defines the framing method of the binary trice data stream for direct output. Options:
255
+//! - TRICE_FRAMING_TCOBS: Recommended for internal transfer and trice tool visualization.
256
+//! - TRICE_FRAMING_COBS: The trice tool needs switch `-pf COBS`. Useful with XTEA or to decode the binary trice data with a user tool.
257
+//! - TRICE_FRAMING_NONE: The trice tool needs switch `-pf none`. TRICE_FRAMING_NONE is recommended for fast RTT (32-bit access).
258
+#define TRICE_DIRECT_OUT_FRAMING TRICE_FRAMING_NONE
259
+#endif
260
+
261
+#ifndef TRICE_DEFERRED_OUT_FRAMING
262
+//! TRICE_DEFERRED_OUT_FRAMING defines the framing method of the binary trice data stream for deferred output. Options:
263
+//! - TRICE_FRAMING_TCOBS: Recommended for UART transfer and trice tool visualization.
264
+//! - TRICE_FRAMING_COBS: The trice tool needs switch `-pf COBS`. Useful with XTEA or to decode the binary trice date with Python or an other language.
265
+//! - TRICE_FRAMING_NONE: The trice tool needs switch `-pf none`. This mode may be helpful if you write your own trice viewer without a decoder.
266
+#define TRICE_DEFERRED_OUT_FRAMING TRICE_FRAMING_TCOBS
267
+#endif
268
+
269
+#ifndef XTEA_ENCRYPT_KEY
270
+//! XTEA_ENCRYPT_KEY allows XTEA TriceEncryption with the key.
271
+//! To get your private XTEA_KEY, call just once "trice log -port ... -password YourSecret -showKey".
272
+//! The byte sequence you see then, copy and use it in your trice.Config.h file.
273
+//! YOu can user `-password MySecret` as Trice tool CLI switch with the default key.
274
+#define XTEA_ENCRYPT_KEY XTEA_KEY(ea, bb, ec, 6f, 31, 80, 4e, b9, 68, e2, fa, ea, ae, f1, 50, 54);
275
+#endif
276
+
277
+#ifndef XTEA_DECRYPT
278
+//! XTEA_DECRYPT, when defined, enables device local decryption. Usable for checks or if you use a trice reception capable node to read XTEA encrypted messages.
279
+//! One possible application is, receiving trices, decoding them, finding an ID match in a (from triceF generated) function pointer list and executing the dedicated function.
280
+//! This allows kind of RPC (without immediate return) also with encryption.
281
+#define XTEA_DECRYPT 0
282
+#endif
283
+
284
+#ifndef TRICE_DIRECT_XTEA_ENCRYPT
285
+//! TRICE_DIRECT_XTEA_ENCRYPT enables encryption for direct output. Encrypting direct output costs significant computing time in the time critical path!
286
+#define TRICE_DIRECT_XTEA_ENCRYPT 0
287
+#endif
288
+
289
+#ifndef TRICE_DEFERRED_XTEA_ENCRYPT
290
+//! TRICE_DEFERRED_XTEA_ENCRYPT enables encryption for deferred output.
291
+#define TRICE_DEFERRED_XTEA_ENCRYPT 0
292
+#endif
293
+
294
+#ifndef TRICE_DIAGNOSTICS
295
+//! With TRICE_DIAGNOSTICS == 0, additional trice diagnostics code is removed.
296
+//! During development TRICE_DIAGNOSTICS == 1 helps to optimize the trice buffer sizes.
297
+#define TRICE_DIAGNOSTICS 1
298
+#endif
299
+
300
+#ifndef TRICE_DIRECT_SEGGER_RTT_8BIT_WRITE
301
+//! TRICE_DIRECT_SEGGER_RTT_8BIT_WRITE==1 uses standard RTT transfer by using function SEGGER_RTT_WriteNoLock and needs ((TRICE_DIRECT_OUTPUT == 1).
302
+//! - This setting results in unframed RTT trice packages and requires the `-packageFraming none` switch for the appropriate trice tool instance.
303
+//! - Not that fast as with TRICE_SEGGER_RTT_32BIT_WRITE == 1 but still fast and uses pure SEGGER functionality only.
304
+#define TRICE_DIRECT_SEGGER_RTT_8BIT_WRITE 0
305
+#endif
306
+
307
+#ifndef TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE
308
+//! TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE == 1 speeds up RTT transfer by using function SEGGER_Write_RTT0_NoCheck32.
309
+//! - This setting results in unframed RTT trice packages and requires the `-packageFraming none` switch for the appropriate trice tool instance.
310
+//!   This squeezes the whole Trice macro into about 100 processor clocks leaving the data already inside the SEGGER _acUpBuffer.
311
+//! - If you do not wish RTT, or wish RTT with framing, simply set this value to 0.
312
+//! - The trice tool CLI switch -d16 is needed too, because for alignment reasons the 16bit ID field is doubled for 16bit timestamp trice messages.
313
+#define TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE 0
314
+#endif
315
+
316
+#ifndef TRICE_DEFERRED_SEGGER_RTT_8BIT_WRITE
317
+//! TRICE_DEFERRED_SEGGER_RTT_8BIT_WRITE == 1 enables channel number 0 for SeggerRTT usage. Only channel 0 works right now for some reason.
318
+//! Than the RTT trice packages can be framed according to the set TRICE_DIRECT_OUT_FRAMING.
319
+//! Not useable together with TRICE_DIRECT_SEGGER_RTT_32BIT_WRITE or TRICE_DIRECT_SEGGER_RTT_8BIT_WRITE
320
+//! Switch this on, if you wish deferred Segger RTT output. Usually RTT is used for direct mode only.
321
+#define TRICE_DEFERRED_SEGGER_RTT_8BIT_WRITE 0
322
+#endif
323
+
324
+#ifndef TRICE_DIRECT_AUXILIARY8
325
+//! TRICE_DIRECT_AUXILIARY8 enables a user defined direct trice 8bit char write.
326
+#define TRICE_DIRECT_AUXILIARY8 0
327
+#endif
328
+
329
+#ifndef TRICE_DIRECT_AUXILIARY32
330
+//! TRICE_DIRECT_AUXILIARY32 enables a user defined direct trice 32bit word write.
331
+#define TRICE_DIRECT_AUXILIARY32 0
332
+#endif
333
+
334
+#ifndef TRICE_DEFERRED_AUXILIARY8
335
+//! TRICE_DEFERRED_AUXILIARY8 enables a user defined deferred trice 8bit char write.
336
+#define TRICE_DEFERRED_AUXILIARY8 0
337
+#endif
338
+
339
+#ifndef TRICE_DEFERRED_AUXILIARY32
340
+//! TRICE_DEFERRED_AUXILIARY32 enables a user defined deferred trice 32bit word write.
341
+#define TRICE_DEFERRED_AUXILIARY32 0
342
+#endif
343
+
344
+#ifndef TRICE_CGO
345
+//! CGO interface for testing the target code with Go only, do not enable normally. Usage examples can be found in the trice/_test folder.
346
+#define TRICE_CGO 0
347
+#endif
348
+
349
+#ifndef TRICE_CYCLE_COUNTER
350
+//! TRICE_CYCLE_COUNTER adds a cycle counter to each trice message.
351
+//! If 0, do not add cycle counter. The Trice macros are a bit faster. Lost TRICEs are not detectable by the trice tool. The cycle counter byte ist statically 0xC0.
352
+//! If 1, add an 8-bit cycle counter. The Trice macros are a bit slower. Lost TRICEs are detectable by the trice tool. The cycle counter byte changes (recommended).
353
+#define TRICE_CYCLE_COUNTER 1
354
+#endif
355
+
356
+// Compiler Adaption:
357
+
358
+#ifndef USE_SEGGER_RTT_LOCK_UNLOCK_MACROS
359
+//! USE_SEGGER_RTT_LOCK_UNLOCK_MACROS == 1 includes SEGGER_RTT header files even SEGGER_RTT is not used. THis allows SEGGER code for critical sections.
360
+#define USE_SEGGER_RTT_LOCK_UNLOCK_MACROS 0
361
+#endif
362
+
363
+#ifndef TRICE_ENTER_CRITICAL_SECTION
364
+//! TRICE_ENTER_CRITICAL_SECTION saves interrupt state and disables Interrupts.
365
+//! If trices are used only outside critical sections or interrupts, you can leave this macro empty for more speed. Use only '{' in that case.
366
+//! Examples:
367
+//! \li #define TRICE_ENTER_CRITICAL_SECTION { SEGGER_RTT_LOCK() { - does the job for many compilers.
368
+//! \li #define TRICE_ENTER_CRITICAL_SECTION {
369
+//! \li #define TRICE_ENTER_CRITICAL_SECTION { uint32_t old_mask = cm_mask_interrupts(1); { // copied from test/OpenCM3_STM32F411_Nucleo/triceConfig.h
370
+//! \li #define TRICE_ENTER_CRITICAL_SECTION { uint32_t primaskstate = __get_PRIMASK(); __disable_irq(); {
371
+#define TRICE_ENTER_CRITICAL_SECTION {
372
+#endif
373
+
374
+#ifndef TRICE_LEAVE_CRITICAL_SECTION
375
+//! TRICE_LEAVE_CRITICAL_SECTION restores interrupt state.
376
+//! If trices are used only outside critical sections or interrupts, you can leave this macro empty for more speed. Use only '}' in that case.
377
+//! Examples:
378
+//! \li #define TRICE_LEAVE_CRITICAL_SECTION } SEGGER_RTT_UNLOCK() } - does the job for many compilers.
379
+//! \li #define TRICE_LEAVE_CRITICAL_SECTION }
380
+//! \li #define TRICE_LEAVE_CRITICAL_SECTION } cm_mask_interrupts(old_mask); } // copied from test/OpenCM3_STM32F411_Nucleo/triceConfig.h
381
+//! \li #define TRICE_LEAVE_CRITICAL_SECTION } __set_PRIMASK(primaskstate); }
382
+#define TRICE_LEAVE_CRITICAL_SECTION }
383
+#endif
384
+
385
+#ifndef TRICE_INLINE
386
+//! TRICE_INLINE is used for inlining trice code to be usable with any compiler. Define this value according to your compiler syntax.
387
+#define TRICE_INLINE static inline
388
+#endif
389
+
390
+// code space optimization
391
+
392
+#ifndef TRICE_8_BIT_SUPPORT
393
+//! TRICE_8_BIT_SUPPORT enables/disables all 8-bit Trice macros.
394
+#define TRICE_8_BIT_SUPPORT 1
395
+#endif
396
+
397
+#ifndef TRICE_16_BIT_SUPPORT
398
+//! TRICE_16_BIT_SUPPORT enables/disables all 16-bit Trice macros.
399
+#define TRICE_16_BIT_SUPPORT 1
400
+#endif
401
+
402
+#ifndef TRICE_32_BIT_SUPPORT
403
+//! TRICE_32_BIT_SUPPORT enables/disables all 32-bit Trice macros.
404
+#define TRICE_32_BIT_SUPPORT 1
405
+#endif
406
+
407
+#ifndef TRICE_64_BIT_SUPPORT
408
+//! TRICE_32_BIT_SUPPORT enables/disables all 64-bit Trice macros.
409
+#define TRICE_64_BIT_SUPPORT 1
410
+#endif
411
+
412
+///////////////////////////////////////////////////////////////////////////////
413
+// Trice time measurement
414
+// The SYSTICKVAL is not needed by the Trice code. It is only used inside triceCheck.c as example value.
415
+// If your MCU is a not ARM Cortex-M one, simply define this value according your MCU, if you wish to use SYSTICKVAL.
416
+
417
+#ifndef SYSTICKVAL
418
+
419
+#if defined(__arm__)       /* Defined by GNU C and RealView */               \
420
+    || defined(__thumb__)  /* Defined by GNU C and RealView in Thumb mode */ \
421
+    || defined(_ARM)       /* Defined by ImageCraft C */                     \
422
+    || defined(_M_ARM)     /* Defined by Visual Studio */                    \
423
+    || defined(_M_ARMT)    /* Defined by Visual Studio in Thumb mode */      \
424
+    || defined(__arm)      /* Defined by Diab */                             \
425
+    || defined(__ICCARM__) /* IAR */                                         \
426
+    || defined(__CC_ARM)   /* ARM's (RealView) compiler */                   \
427
+    || defined(__ARM__)    /* TASKING VX ARM toolset C compiler */           \
428
+    || defined(__CARM__)   /* TASKING VX ARM toolset C compiler */           \
429
+    || defined(__CPARM__)  /* TASKING VX ARM toolset C++ compiler */
430
+
431
+//! ARM Cortex-M MCUs have this register.
432
+//! \li See https://developer.arm.com/documentation/dui0552/a/cortex-m3-peripherals/system-timer--systick
433
+//! This is only 16- or 24-bit wide and usually resetted each ms. Consider using DWT_CYCCNT if your MCU supports this.
434
+//! When using a 24-bit SYSTICKVAL as 16-bit target timestamp, be aware, that, for example, with a 100 MHz system clock, the
435
+//! SYSTICKVAL runs from 99 999 999 to 0 and you see just the lower 16 bit as time stamp, what may be confusing. With a
436
+//! 64 MHz clock, everything is fine, because 63999 is still a 16-bit value. When using DWT_CYCCNT on MCU clocks > 65 MHz,
437
+//! displaying only the lower 2 bytes is ok, because this 32-bit counter runs circular without being resetted.
438
+#define SYSTICKVAL (*(volatile uint32_t*)0xE000E018UL)
439
+
440
+#else
441
+
442
+#define SYSTICKVAL 0
443
+
444
+#endif
445
+
446
+#endif // #ifndef SYSTICKVAL
447
+
448
+//
449
+///////////////////////////////////////////////////////////////////////////////
450
+
451
+///////////////////////////////////////////////////////////////////////////////
452
+// These settings are overwriting the Trice relevant defaults in SEGGER_RTT_Conf.h.
453
+// To change, you should define them in your project specific triceConfig.h.
454
+// No separate copy of SEGGER_RTT_Conf.h is needed this way.
455
+// The BUFFER_SIZE_UP value is de-facto a TRICE_DIRECT_BUFFER_SIZE, if no direct auxilary output is used.
456
+
457
+#ifndef   SEGGER_RTT_MAX_NUM_UP_BUFFERS
458
+#define SEGGER_RTT_MAX_NUM_UP_BUFFERS   (1)     // Max. number of up-buffers (T->H) available on this target
459
+#endif
460
+
461
+#ifndef   SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
462
+#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (0)     // Max. number of down-buffers (H->T) available on this target
463
+#endif
464
+
465
+#ifndef   BUFFER_SIZE_UP
466
+#define BUFFER_SIZE_UP                  (1024)  // "TRICE_DIRECT_BUFFER_SIZE"
467
+#endif
468
+
469
+#ifndef   BUFFER_SIZE_DOWN
470
+#define BUFFER_SIZE_DOWN                (0)     // Size of the buffer for terminal input to target from host
471
+#endif
472
+
473
+#ifndef   SEGGER_RTT_PRINTF_BUFFER_SIZE
474
+#define SEGGER_RTT_PRINTF_BUFFER_SIZE   (0u)    // Size of buffer for RTT printf to bulk-send chars via RTT
475
+#endif
476
+
477
+//
478
+///////////////////////////////////////////////////////////////////////////////
479
+
480
+#ifdef __cplusplus
481
+}
482
+#endif
483
+
484
+#endif /* TRICE_DEFAULT_CONFIG_H_ */

+ 350
- 0
Middlewares/trice/triceDoubleBuffer.c Переглянути файл

@@ -0,0 +1,350 @@
1
+//! \file triceDoubleBuffer.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//!     //////////////////////////////////////////////////////////////////////////
4
+#include "cobs.h"
5
+#include "tcobs.h"
6
+#include "trice.h"
7
+
8
+#if TRICE_BUFFER == TRICE_DOUBLE_BUFFER && TRICE_OFF == 0
9
+
10
+static void TriceOut(uint32_t *tb, size_t tLen);
11
+
12
+//! triceBuffer is a double buffer for better write speed.
13
+//! halfBufferStart     writePosition
14
+//! ^-TRICE_DATA_OFFSET-^-restOf_TRICE_DEFERRED_BUFFER_SIZE-^-2ndBuf...
15
+//! ^-TRICE_DATA_OFFSET-^-restOf_TRICE_DEFERRED_BUFFER_SIZE-Limit
16
+static uint32_t triceBuffer[2][TRICE_DEFERRED_BUFFER_SIZE >> 3] = {0};
17
+
18
+    #define TRICE_WRITE_START_HALF_BUFFER_0 (&triceBuffer[0][TRICE_DATA_OFFSET >> 2])
19
+    #define TRICE_WRITE_LIMIT_HALF_BUFFER_0 (&triceBuffer[0][TRICE_DEFERRED_BUFFER_SIZE >> 3])
20
+    #define TRICE_WRITE_START_HALF_BUFFER_1 (&triceBuffer[1][TRICE_DATA_OFFSET >> 2])
21
+    #define TRICE_WRITE_LIMIT_HALF_BUFFER_1 (&triceBuffer[1][TRICE_DEFERRED_BUFFER_SIZE >> 3])
22
+
23
+static uint32_t *const triceWriteStartHalfBuffer0 = TRICE_WRITE_START_HALF_BUFFER_0;
24
+static uint32_t *const triceWriteStartHalfBuffer1 = TRICE_WRITE_START_HALF_BUFFER_1;
25
+    #if TRICE_PROTECT == 1
26
+static uint32_t *const triceWriteLimitHalfBuffer0 = TRICE_WRITE_LIMIT_HALF_BUFFER_0;
27
+static uint32_t *const triceWriteLimitHalfBuffer1 = TRICE_WRITE_LIMIT_HALF_BUFFER_1;
28
+    #endif
29
+
30
+//! triceActiveHalfBuffer is the index of the active write buffer. !triceActiveHalfBuffer is the active read buffer index.
31
+static int triceActiveHalfBuffer = 0;
32
+
33
+//! TriceBufferWritePosition is the active write position and is used by TRICE_PUT macros.
34
+uint32_t *TriceBufferWritePosition = TRICE_WRITE_START_HALF_BUFFER_0; // triceWriteStartHalfBuffer0;
35
+
36
+//! TriceBufferWritePositionStart is the begin of the active write buffer.
37
+uint32_t *TriceBufferWritePositionStart = TRICE_WRITE_START_HALF_BUFFER_0; // triceWriteStartHalfBuffer0;
38
+
39
+    #if TRICE_PROTECT == 1
40
+//! TriceBufferWritePositionLimit is the first not usable address of the current written half buffer.
41
+static uint32_t *TriceBufferWritePositionLimit = TRICE_WRITE_LIMIT_HALF_BUFFER_0; // triceWriteLimitHalfBuffer0;
42
+
43
+//! TriceEnoughSpace checks, if at least TRICE_SINGLE_MAX_SIZE bytes available for the next trice.
44
+//! \retval 0, when not enough space
45
+//! \retval 1, when enough space
46
+int TriceEnoughSpace(void)
47
+{
48
+    // space32 is the writable 32-bit value count in the current write buffer.
49
+    int space32 = TriceBufferWritePositionLimit - TriceBufferWritePosition;
50
+    // there need to be at least TRICE_SINGLE_MAX_SIZE bytes space in the current write buffer.
51
+    if (space32 >= (TRICE_SINGLE_MAX_SIZE >> 2))
52
+    {
53
+        return 1;
54
+    }
55
+    else
56
+    {
57
+#if TRICE_DIAGNOSTICS == 1
58
+        TriceDeferredOverflowCount++;
59
+#endif
60
+        return 0;
61
+    }
62
+}
63
+
64
+    #endif // #if TRICE_PROTECT == 1
65
+
66
+//! triceBufferSwap swaps the trice double buffer and returns the read buffer address.
67
+static uint32_t *triceBufferSwap(void)
68
+{
69
+    if (triceActiveHalfBuffer == 0)
70
+    {
71
+        triceActiveHalfBuffer = 1;
72
+        TriceBufferWritePositionStart = triceWriteStartHalfBuffer1;
73
+        TriceBufferWritePosition = TriceBufferWritePositionStart;
74
+#if TRICE_PROTECT == 1
75
+        TriceBufferWritePositionLimit = triceWriteLimitHalfBuffer1;
76
+#endif
77
+        return triceWriteStartHalfBuffer0;
78
+    }
79
+    else
80
+    {
81
+        triceActiveHalfBuffer = 0;
82
+        TriceBufferWritePositionStart = triceWriteStartHalfBuffer0;
83
+        TriceBufferWritePosition = TriceBufferWritePositionStart;
84
+#if TRICE_PROTECT == 1
85
+        TriceBufferWritePositionLimit = triceWriteLimitHalfBuffer0;
86
+#endif
87
+        return triceWriteStartHalfBuffer1;
88
+    }
89
+}
90
+
91
+    #if TRICE_DIAGNOSTICS == 1
92
+//! TriceHalfBufferDepthMax is a diagnostics value usable to optimize buffer size.
93
+unsigned TriceHalfBufferDepthMax = 0;
94
+    #endif
95
+
96
+//! TriceTransfer, if possible, swaps the double buffer and initiates a write.
97
+//! It is the responsibility of the app to call this function once every 10-100 milliseconds.
98
+void TriceTransfer(void)
99
+{
100
+    if (0 == TriceOutDepth())   // transmission done for slowest output channel, so a swap is possible.
101
+    {
102
+        uint32_t *readBuf;
103
+        size_t tLen32;
104
+        TRICE_ENTER_CRITICAL_SECTION
105
+            tLen32 = TriceBufferWritePosition - TriceBufferWritePositionStart;
106
+        if (tLen32)   // Some Trice data are available.
107
+        {
108
+            readBuf = triceBufferSwap();
109
+            readBuf -= (TRICE_DATA_OFFSET >> 2);
110
+        }
111
+        TRICE_LEAVE_CRITICAL_SECTION
112
+        if (tLen32)
113
+        {
114
+            TriceOut(readBuf, tLen32 << 2);
115
+        }
116
+    }
117
+}
118
+
119
+//! TriceNext expects at *buf 32-bit aligned trice messages and returns the next one in pStart and pLen.
120
+//! \todo: use this function only when MULTI
121
+//! \param buf points to 32-bit aligned trice messages and is filled with the advanced buf.
122
+//! \param pSize contains the total size of all following trices including padding bytes to 32-bit alignments and gets the by next trice reduced value.
123
+//! \param pStart points to the net start of the next trice.
124
+//! \param pLen contains the net length of the first trice.
125
+//! \retval is the trice ID on success or negative on error.
126
+//! The trices inside the double buffer start 32-bit aligned with maybe 1-3 padding bytes in-between.
127
+//! \li |    ... |    trice   | trice | ... |  trice |
128
+//! \li before:  ^- buf
129
+//! \li before:  <-------------- pSize -------------->
130
+//! \li after:                 ^- buf
131
+//! \li after:                 <-------- pSize ------>
132
+//! \li after:     ^- pStart    (is input buf or input buf + 2)
133
+//! \li after:     <- pLen ->   (maybe 1-3 bytes shorter)
134
+static int TriceNext(uint8_t **buf, size_t *pSize, const uint8_t **pStart, size_t *pLen)
135
+{
136
+    uint16_t *pTID = (uint16_t *)*buf; // lint !e826, get TID address
137
+    unsigned TID = TRICE_TTOHS(*pTID); // type and id
138
+    int triceID = 0x3FFF & TID;
139
+    int triceType = TID >> 14;
140
+    unsigned offset;
141
+    size_t size = *pSize;
142
+    size_t triceSize;
143
+    size_t len;
144
+    switch (triceType)
145
+    {
146
+    case TRICE_TYPE_S0: // S0 = no stamp
147
+        *pStart = *buf;
148
+        offset = 0;
149
+        len = 4 + triceDataLen(*pStart + 2); // tyId
150
+        break;
151
+    case TRICE_TYPE_S2: // S2 = 16-bit stamp
152
+        *pStart = *buf; // see Id(n) macro definition
153
+        *pStart += 2;   // see Id(n) macro definition
154
+        offset = 2;
155
+        len = 6 + triceDataLen(*pStart + 4); // tyId ts16
156
+        break;
157
+    case TRICE_TYPE_S4: // S4 = 32-bit stamp
158
+        *pStart = *buf;
159
+        offset = 0;
160
+        len = 8 + triceDataLen(*pStart + 6); // tyId ts32
161
+        break;
162
+    default: // impossible
163
+             // fallthrugh
164
+    case TRICE_TYPE_X0:
165
+        TriceErrorCount++;
166
+        *pStart = 0;
167
+        *pLen = 0;
168
+        return -__LINE__; // extended trices not supported (yet)
169
+    }
170
+    triceSize = (len + offset + 3) & ~3;
171
+    // S16 case example:            triceSize  len   t-0-3   t-o
172
+    // 80id 80id 1616 00cc                8     6      3      6
173
+    // 80id 80id 1616 01cc dd            12     7      7     10
174
+    // 80id 80id 1616 02cc dd dd         12     8      7     10
175
+    // 80id 80id 1616 03cc dd dd dd      12     9      7     10
176
+    // 80id 80id 1616 04cc dd dd dd dd   12    10      7     10
177
+    if (!(triceSize - (offset + 3) <= len && len <= triceSize - offset))   // corrupt data
178
+    {
179
+        TriceErrorCount++;
180
+        return -__LINE__;
181
+    }
182
+    size -= triceSize;
183
+    *buf += triceSize;
184
+    *pSize = size;
185
+    *pLen = len;
186
+    return triceID;
187
+}
188
+
189
+uint8_t *firstNotModifiedAddress;
190
+int distance;
191
+int triceDataOffsetDepth;
192
+
193
+//! TriceOut encodes trices and writes them in one step to the output.
194
+//! This function is called only, when the slowest deferred output device has finished its last buffer.
195
+//! At the half buffer start tb are TRICE_DATA_OFFSET bytes space followed by a number of trice messages which all contain
196
+//! 0-3 padding bytes and therefore have a length of a multiple of 4. There is no additional space between these trice messages.
197
+//! When XTEA enabled, only (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE) is allowed, because the 4 bytes behind a trice messages
198
+//! are changed, when the trice length is not a multiple of 8, but only of 4. (XTEA can encrypt only multiple of 8 length packages.)
199
+//! \param tb is start of uint32_t* trice buffer. The space TRICE_DATA_OFFSET at the tb start is for in-buffer encoding of the trice data.
200
+//! \param tLen is total length of several trice data. It is always a multiple of 4 because of 32-bit alignment and padding bytes.
201
+static void TriceOut(uint32_t *tb, size_t tLen)
202
+{
203
+    uint8_t *enc = (uint8_t *)tb;           // This is the later encoded data starting address.
204
+    uint8_t *dat = enc + TRICE_DATA_OFFSET; // This is the start of      32-bit aligned trices.
205
+    uint8_t *nxt = dat;                     // This is the start of next 32-bit aligned trices.
206
+    size_t encLen = 0;
207
+#if (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE) && ((TRICE_PROTECT == 1) || (TRICE_DIAGNOSTICS == 1))
208
+    uint8_t *dst = enc; // This value dst must not get > nxt to avoid overwrites.
209
+#endif
210
+    int triceID = 0; // This assignment is only needed to silence compiler complains about being uninitialized.
211
+#if TRICE_DIAGNOSTICS == 1
212
+    unsigned depth = tLen + TRICE_DATA_OFFSET;
213
+    TriceHalfBufferDepthMax = depth < TriceHalfBufferDepthMax ? TriceHalfBufferDepthMax : depth;
214
+#endif
215
+    // do it
216
+    while (tLen)
217
+    {
218
+#if TRICE_DIAGNOSTICS == 1
219
+        firstNotModifiedAddress = enc + encLen;
220
+        distance = nxt - firstNotModifiedAddress;
221
+        triceDataOffsetDepth = TRICE_DATA_OFFSET - distance; // distance can get > TRICE_DATA_OFFSET, but that is no problem.
222
+        TriceDataOffsetDepthMax = triceDataOffsetDepth < TriceDataOffsetDepthMax ? TriceDataOffsetDepthMax : triceDataOffsetDepth;
223
+#endif // #if TRICE_DIAGNOSTICS == 1
224
+        const uint8_t *triceNettoStart;
225
+        size_t triceNettoLen; // This is the trice netto length (without padding bytes).
226
+#if (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING != TRICE_FRAMING_NONE) && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE)
227
+        uint8_t *crypt = nxt - 4; // only 8-byte groups are encryptable
228
+#endif
229
+        triceID = TriceNext(&nxt, &tLen, &triceNettoStart, &triceNettoLen);
230
+        if (triceID <= 0)   // on data error
231
+        {
232
+            TriceErrorCount++;
233
+            break; // ignore following data
234
+        }
235
+#if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
236
+        uint8_t *dst = enc + encLen;
237
+#if (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS)
238
+        memmove(crypt, triceNettoStart, triceNettoLen);
239
+        size_t len8 = (triceNettoLen + 7) & ~7;                   // Only multiple of 8 encryptable, so we adjust len.
240
+        memset((crypt)+triceNettoLen, 0, len8 - triceNettoLen);   // Clear padding space.
241
+        XTEAEncrypt((uint32_t *)crypt, len8 >> 2);
242
+        encLen += (size_t)TCOBSEncode(dst, crypt, len8); // encLen is re-used here
243
+        dst[encLen++] = 0;                               // Add zero as package delimiter.
244
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)
245
+        memmove(crypt, triceNettoStart, triceNettoLen);
246
+        size_t len8 = (triceNettoLen + 7) & ~7;                   // Only multiple of 8 encryptable, so we adjust len.
247
+        memset((crypt)+triceNettoLen, 0, len8 - triceNettoLen);   // Clear padding space.
248
+        XTEAEncrypt((uint32_t *)crypt, len8 >> 2);
249
+        encLen += (size_t)COBSEncode(dst, crypt, len8); // encLen is re-used here
250
+        dst[encLen++] = 0;                              // Add zero as package delimiter.
251
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
252
+#if TRICE_CONFIG_WARNINGS == 1
253
+#error configuration: The Trice tool does not support encryted data without COBS or TCOBS framing.
254
+#endif
255
+        // memmove(dst, triceNettoStart, triceNettoLen );
256
+        // size_t len8 = (triceNettoLen + 7) & ~7; // Only multiple of 8 encryptable, so we adjust len.
257
+        // memset((enc)+triceNettoLen, 0, len8 - triceNettoLen); // Clear padding space.
258
+        // XTEAEncrypt( (uint32_t *)enc, len8>>2 );
259
+        // encLen += len8; // encLen is re-used here
260
+        // nextPosForEncoding = dst+encLen;
261
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS)
262
+        size_t len = (size_t)TCOBSEncode(dst, triceNettoStart, triceNettoLen);
263
+        dst[len++] = 0; // Add zero as package delimiter.
264
+        encLen += len;
265
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)
266
+        size_t len = (size_t)COBSEncode(dst, triceNettoStart, triceNettoLen);
267
+        dst[len++] = 0; // Add zero as package delimiter.
268
+        encLen += len;
269
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
270
+        memmove(dst, triceNettoStart, triceNettoLen);
271
+        encLen += triceNettoLen;
272
+#else
273
+#error configuration: unexpected
274
+#endif
275
+#elif TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
276
+        // pack data
277
+        uint8_t *packed = dat + encLen;                  // After the loop, the packed data start at dat.
278
+        memmove(packed, triceNettoStart, triceNettoLen); // This action removes all padding bytes of the trices, compacting their sequence this way
279
+        encLen += triceNettoLen;
280
+#endif // #elif  TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
281
+#if (TRICE_PROTECT == 1) || (TRICE_DIAGNOSTICS == 1)
282
+        dst = enc + encLen;                           // When several Trices in the double buffer, with each encoding the new dst could drift a bit closer towards triceNettoStart.
283
+        int triceDataOffsetSpaceRemained = nxt - dst; // THe begin of unprocessed data MINUS next dst must not be negative.
284
+#endif
285
+#if (TRICE_PROTECT == 1)
286
+        if (triceDataOffsetSpaceRemained < 0)
287
+        {
288
+            TriceErrorCount++;
289
+            return; // discard broken data to avoid buffer overflow
290
+        }
291
+#endif
292
+#if TRICE_DIAGNOSTICS == 1
293
+        int triceDataOffsetDepth = TRICE_DATA_OFFSET - triceDataOffsetSpaceRemained;
294
+        TriceDataOffsetDepthMax = triceDataOffsetDepth < TriceDataOffsetDepthMax ? TriceDataOffsetDepthMax : triceDataOffsetDepth;
295
+#endif
296
+    }
297
+#if TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
298
+    // At this point the compacted trice messages start TRICE_DATA_OFFSET bytes after tb (now dat) and the encLen is their total netto length.
299
+    // Behind this up to 7 bytes can be used as scratch pad when XTEA is active. That is ok, because the half buffer should not get totally filled.
300
+    // encLen = TriceEncode( TRICE_DEFERRED_XTEA_ENCRYPT, TRICE_DEFERRED_OUT_FRAMING, enc, dat, encLen );
301
+#if (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS) // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
302
+    // special case: The data are at dat and can be big, are compacted and behind them is space. So we can encrypt them in space
303
+    size_t len8 = (encLen + 7) & ~7;                    // Only multiple of 8 encryptable, so we adjust len.
304
+    memset(((uint8_t *)dat) + encLen, 0, len8 - encLen); // clear padding space: ATTENTION! OK only for this compiler switch setting.
305
+    XTEAEncrypt((uint32_t *)dat, len8 >> 2);
306
+    size_t eLen = (size_t)TCOBSEncode(enc, dat, len8);                                          // encLen is re-used here
307
+    enc[eLen++] = 0;                                                                            // Add zero as package delimiter.
308
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)  // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
309
+    // special case: The data are at dat and can be big, are compacted and behind them is space. So we can encrypt them in space
310
+    size_t len8 = (encLen + 7) & ~7;                    // Only multiple of 8 encryptable, so we adjust len.
311
+    memset(((uint8_t *)dat) + encLen, 0, len8 - encLen); // clear padding space: ATTENTION! OK only for this compiler switch setting.
312
+    XTEAEncrypt((uint32_t *)dat, len8 >> 2);
313
+    size_t eLen = (size_t)COBSEncode(enc, dat, len8); // encLen is re-used here
314
+    enc[eLen++] = 0;                                  // Add zero as package delimiter.
315
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)  // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
316
+    size_t eLen = TriceEncode(TRICE_DEFERRED_XTEA_ENCRYPT, TRICE_DEFERRED_OUT_FRAMING, enc, dat, encLen);
317
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS) // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
318
+    size_t eLen = TCOBSEncode(enc, dat, encLen);
319
+    enc[eLen++] = 0; // Add zero as package delimiter.
320
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)  // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
321
+    size_t eLen = (size_t)COBSEncode(enc, dat, encLen);
322
+    enc[eLen++] = 0; // Add zero as package delimiter.
323
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)  // && (TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE)
324
+    enc = dat;
325
+    size_t eLen = encLen;
326
+#else
327
+#error configuration:
328
+#endif
329
+#if TRICE_DIAGNOSTICS
330
+    // before: space = enc[TRICE_DATA_OFFSET], data = dat[encLen]
331
+    // after:  date  = enc[eLen], (dat [encLen])
332
+    // Mostly eLen < encLen, but it could be eLen = encLen + 1 + (encLen>>5) in TCOBS worst case.
333
+    // dat - enc = TRICE_DATA_OFFSET
334
+    // if eLen > encLen, then TriceDataOffsetDepth = eLen - encLen
335
+    int triceDataOffsetDepth = eLen - encLen; // usually negative
336
+    TriceDataOffsetDepthMax = triceDataOffsetDepth < TriceDataOffsetDepthMax ? TriceDataOffsetDepthMax : triceDataOffsetDepth;
337
+#endif
338
+    encLen = eLen;
339
+#endif
340
+
341
+    // Reaching here means all trice data in the current half buffer are encoded
342
+    // into a single continuous buffer having 0-delimiters between them or not but at the ent is a 0-delimiter.
343
+    //
344
+    // output
345
+    TRICE_ENTER_CRITICAL_SECTION
346
+        TriceNonBlockingDeferredWrite8(triceID, enc, encLen); // lint !e771 Info 771: Symbol 'triceID' conceivably not initialized. Comment: tLen is always > 0.
347
+    TRICE_LEAVE_CRITICAL_SECTION
348
+}
349
+
350
+#endif // #if TRICE_BUFFER == TRICE_DOUBLE_BUFFER && TRICE_OFF == 0

+ 45
- 0
Middlewares/trice/triceMcuOrder.h Переглянути файл

@@ -0,0 +1,45 @@
1
+/*! \file triceMcuOrder.h
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#if !defined(TRICE_HTOTS) && !defined(TRICE_HTOTL) && !defined(TRICE_TTOHS)
6
+
7
+#define TRICE_HTOTS(x) ((uint16_t)(x)) //! TRICE_HTOTS reorders short values from host order into trice transfer order.
8
+#define TRICE_HTOTL(x) ((uint32_t)(x)) //! TRICE_HTOTL reorders long values from host order x into trice transfer order.
9
+#define TRICE_TTOHS(x) ((uint16_t)(x)) //! TRICE_TTOHS reorders short values from trice transfer order into host order.
10
+
11
+#endif //! defined(TRICE_HTOTS) && !defined(TRICE_HTOTL) && !defined(TRICE_TTOHS)
12
+
13
+#if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0
14
+
15
+//! TRICE_PUT16_1616 writes a 16-bit value followed by a 32-bit value in 2 16-bit steps to avoid memory alignment hard fault.
16
+#define TRICE_PUT16_1616(x, ts) /* little endian */        \
17
+	do {                                                   \
18
+		uint16_t* p = (uint16_t*)TriceBufferWritePosition; \
19
+		*p++ = x;                                          \
20
+		*p++ = ts;         /* lo */                        \
21
+		*p++ = (ts) >> 16; /* hi */                        \
22
+		TriceBufferWritePosition = (uint32_t*)p;           \
23
+	} while (0)
24
+
25
+#define TRICE_PUT64(x)        \
26
+	TRICE_PUT((uint32_t)(x)); \
27
+	TRICE_PUT((uint32_t)((uint64_t)(x) >> 32)); // little endian
28
+
29
+#else                           // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0
30
+
31
+//! TRICE_PUT16_1616 writes a 16-bit value followed by a 32-bit value in 2 16-bit steps to avoid memory alignment hard fault.
32
+#define TRICE_PUT16_1616(x, ts) /* big endian */           \
33
+	do {                                                   \
34
+		uint16_t* p = (uint16_t*)TriceBufferWritePosition; \
35
+		*p++ = x;                                          \
36
+		*p++ = (ts) >> 16; /* hi */                        \
37
+		*p++ = ts;         /* lo */                        \
38
+		TriceBufferWritePosition = (uint32_t*)p;           \
39
+	} while (0)
40
+
41
+#define TRICE_PUT64(x)              \
42
+	TRICE_PUT((uint64_t)(x) >> 32); \
43
+	TRICE_PUT((uint32_t)(x)); // big endian
44
+
45
+#endif // #else // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0

+ 88
- 0
Middlewares/trice/triceMcuReverse.h Переглянути файл

@@ -0,0 +1,88 @@
1
+/*! \file triceMcuReverse.h
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+//! Note:  https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html
6
+#if defined __has_include //! __has_include is a macro defined in several compilers including GCC and integrated into the C23 standard (Note N2799)
7
+#if __has_include(<byteswap.h>)
8
+#include <byteswap.h> // https://codereview.stackexchange.com/questions/151049/endianness-conversion-in-c
9
+#define TRICE_LIBC_BYTESWAP 1
10
+#endif
11
+#endif
12
+
13
+// Swap a 16-bit integer (https://www.oryx-embedded.com/doc/cpu__endian_8h_source.html)
14
+TRICE_INLINE uint16_t TriceReverse16(uint16_t value) {
15
+#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) || (defined(__clang__) && __has_builtin(__builtin_bswap16))
16
+	return __builtin_bswap16(value);
17
+#elif (defined(TRICE_LIBC_BYTESWAP) && TRICE_LIBC_BYTESWAP == 1)
18
+	return __bswap_16(value);
19
+#else
20
+	return (((value & 0x00FF) << 8) |
21
+	        ((value & 0xFF00) >> 8));
22
+#endif
23
+}
24
+// Swap a 32-bit integer (https://www.oryx-embedded.com/doc/cpu__endian_8h_source.html)
25
+TRICE_INLINE uint32_t TriceReverse32(uint32_t value) {
26
+#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) || (defined(__clang__) && __has_builtin(__builtin_bswap32))
27
+	return __builtin_bswap32(value);
28
+#elif (defined(TRICE_LIBC_BYTESWAP) && TRICE_LIBC_BYTESWAP == 1)
29
+	return __bswap_32(value);
30
+#else
31
+	return (((value & 0x000000FF) << 24) |
32
+	        ((value & 0x0000FF00) << 8) |
33
+	        ((value & 0x00FF0000) >> 8) |
34
+	        ((value & 0xFF000000) >> 24));
35
+#endif
36
+}
37
+
38
+#if !defined(TRICE_HTOTS) && !defined(TRICE_HTOTL) && !defined(TRICE_TTOHS)
39
+#define TRICE_HTOTS(x) TriceReverse16(x) //!< TRICE_HTOTS reorders short values from host order into trice transfer order.
40
+#define TRICE_HTOTL(x) TriceReverse32(x) //!< TRICE_HTOTL reorders long values from host order x into trice transfer order.
41
+#define TRICE_TTOHS(x) TriceReverse16(x) //!< TRICE_TTOHS reorders short values from trice transfer order into host order.
42
+#endif
43
+
44
+#if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0
45
+
46
+//! TRICE_PUT16_1616 writes a 16-bit value followed by a 32-bit value in 2 16-bit steps to avoid memory alignment hard fault.
47
+#define TRICE_PUT16_1616(x, ts) /* little endian */        \
48
+	do {                                                   \
49
+		uint16_t* p = (uint16_t*)TriceBufferWritePosition; \
50
+		*p++ = TRICE_HTOTS(x);                             \
51
+		*p++ = TRICE_HTOTS(ts);         /* lo */           \
52
+		*p++ = TRICE_HTOTS((ts) >> 16); /* hi */           \
53
+		TriceBufferWritePosition = (uint32_t*)p;           \
54
+	} while (0)
55
+
56
+#define TRICE_PUT64(x)                     \
57
+	TRICE_PUT(TRICE_HTOTL((uint32_t)(x))); \
58
+	TRICE_PUT(TRICE_HTOTL((uint32_t)((uint64_t)(x) >> 32))); // little endian
59
+
60
+#else                           // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0
61
+
62
+//! TRICE_PUT16_1616 writes a 16-bit value followed by a 32-bit value in 2 16-bit steps to avoid memory alignment hard fault.
63
+#define TRICE_PUT16_1616(x, ts) /* big endian */           \
64
+	do {                                                   \
65
+		uint16_t* p = (uint16_t*)TriceBufferWritePosition; \
66
+		*p++ = TRICE_HTOTS(x);                             \
67
+		*p++ = TRICE_HTOTS((ts) >> 16); /* hi */           \
68
+		*p++ = TRICE_HTOTS(ts);         /* lo */           \
69
+		TriceBufferWritePosition = (uint32_t*)p;           \
70
+	} while (0)
71
+
72
+#define TRICE_PUT64(x)                           \
73
+	TRICE_PUT(TRICE_HTOTL((uint64_t)(x) >> 32)); \
74
+	TRICE_PUT(TRICE_HTOTL((uint32_t)(x))); // big endian
75
+
76
+#endif // #else // #if TRICE_TRANSFER_ORDER_IS_BIG_ENDIAN == 0
77
+
78
+#define idLH TRICE_HTOTS(0x4000 | (tid)) //!< idLH is the no-stamp tid, byte swapped to be used in TRICE_PUT, when TRICE_REVERSE == 1.
79
+#define IdLH TRICE_HTOTS(0x8000 | (tid)) //!< IdLH is the 16-bit-stamp tid, byte swapped to be used in TRICE_PUT, when TRICE_REVERSE == 1.
80
+#define IDLH TRICE_HTOTS(0xc000 | (tid)) //!< IDLH is the 32-bit-stamp tid, byte swapped to be used in TRICE_PUT, when TRICE_REVERSE == 1.
81
+
82
+#define tsL ((0x00ff & ts) << 8)
83
+#define tsH ((0xff00 & ts) >> 8)
84
+
85
+#define tsHH ((0xFF000000 & ts) >> 8)
86
+#define tsHL ((0x00FF0000 & ts) << 8)
87
+#define tsLH ((0x0000FF00 & ts) >> 8)
88
+#define tsLL ((0x000000FF & ts) << 8)

+ 444
- 0
Middlewares/trice/triceOff.h Переглянути файл

@@ -0,0 +1,444 @@
1
+/*!
2
+ *  \file triceOff.h
3
+   \author thomas.hoehenleitner [at] seerose.net
4
+ *     *****************************************************************************
5
+ */
6
+
7
+// global function prototypes: (not all always used)
8
+
9
+#define TriceInitRingBufferMargins()
10
+#define WatchRingBufferMargins()
11
+#define TriceDiagnostics(index) TRICE_UNUSED(index)
12
+#define TriceNonBlockingWriteUartA(buf, nByte) TRICE_UNUSED(buf) TRICE_UNUSED(nByte)
13
+#define TriceNonBlockingWriteUartB(buf, nByte) TRICE_UNUSED(buf) TRICE_UNUSED(nByte)
14
+#define TriceNonBlockingDirectWrite(triceStart, wordCount) TRICE_UNUSED(triceStart) TRICE_UNUSED(wordCount)
15
+#define TriceNonBlockingDirectWrite8Auxiliary(enc, encLen) TRICE_UNUSED(enc) TRICE_UNUSED(encLen)
16
+#define TriceNonBlockingDeferredWrite8Auxiliary(enc, encLen) TRICE_UNUSED(enc) TRICE_UNUSED(encLen)
17
+#define TriceNonBlockingDirectWrite32Auxiliary(enc, count) TRICE_UNUSED(enc) TRICE_UNUSED(encLen)
18
+#define TriceNonBlockingDeferredWrite32Auxiliary(enc, count) TRICE_UNUSED(enc) TRICE_UNUSED(encLen)
19
+#define TriceInit()
20
+#define TriceLogDiagnosticData()
21
+#define TriceLogSeggerDiagnostics()
22
+#define TriceNonBlockingDeferredWrite8(ticeID, enc, encLen) TRICE_UNUSED(ticeID) TRICE_UNUSED(enc) TRICE_UNUSED(encLen)
23
+#define TriceTransfer()
24
+#define triceDataLen(p)
25
+#define TriceEnoughSpace()
26
+#define TriceOutDepth()
27
+#define TriceDepth()
28
+#define TriceDepthMax()
29
+#define TriceEncode(encrypt, framing, dst, buf, len) TRICE_UNUSED(encrypt) TRICE_UNUSED(framing) TRICE_UNUSED(dst) TRICE_UNUSED(len)
30
+#define TriceWriteDeviceCgo(buf, len) TRICE_UNUSED(buf) TRICE_UNUSED(len) //!< TriceWriteDeviceCgo is only needed for testing C-sources from Go.
31
+
32
+#define TriceBlockingWriteUartA(buf, len) TRICE_UNUSED(buf) TRICE_UNUSED(len)
33
+#define triceServeTransmitUartA()
34
+#define triceTriggerTransmitUartA()
35
+#define TriceOutDepthUartA()
36
+
37
+#define TriceBlockingWriteUartB(buf, len) TRICE_UNUSED(buf) TRICE_UNUSED(len)
38
+#define triceServeTransmitUartB()
39
+#define triceTriggerTransmitUartB()
40
+#define TriceOutDepthUartB()
41
+
42
+#define XTEAEncrypt(p, n) TRICE_UNUSED(p) TRICE_UNUSED(n)
43
+#define XTEADecrypt(p, n) TRICE_UNUSED(p) TRICE_UNUSED(n)
44
+#define XTEAInitTable()
45
+
46
+#define TRICE_XTEA_H_ // do not include xtea.h
47
+#define COBS_H_       // do not include cobs.h
48
+#define TCOBS_H_      // do not include tcobs.h
49
+#define SEGGER_RTT_H  // do not include SEGGER_RTT.h
50
+
51
+// Trice functions and macros
52
+
53
+#define id(n) (n)
54
+#define Id(n) (n)
55
+#define ID(n) (n)
56
+#define iD(n) (n)
57
+
58
+#define TRICE_ENTER
59
+#define TRICE_LEAVE
60
+#define TRICE_PUT(n) TRICE_UNUSED(n)
61
+#define TRICE_PUT16(n) TRICE_UNUSED(n)
62
+#define TRICE_PUT16_1616(x, n)
63
+#define PUT_BUFFER(p, n) TRICE_UNUSED(p) TRICE_UNUSED(n)
64
+
65
+#define TRICE0(pFmt, ...)
66
+#define trice0(pFmt, ...)
67
+#define Trice0(pFmt, ...)
68
+#define TRice0(pFmt, ...)
69
+
70
+// clang-format off
71
+//  TRICE_INLINE void trice0( const char * pFmt ){TRICE_UNUSED(pFmt)}
72
+//  TRICE_INLINE void Trice0( const char * pFmt ){TRICE_UNUSED(pFmt)}
73
+//  TRICE_INLINE void TRice0( const char * pFmt ){TRICE_UNUSED(pFmt)}
74
+
75
+TRICE_INLINE void triceAssertTrue(int idN, char *msg, int flag)
76
+{
77
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
78
+}
79
+TRICE_INLINE void TriceAssertTrue(int idN, char *msg, int flag)
80
+{
81
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
82
+}
83
+TRICE_INLINE void TRiceAssertTrue(int idN, char *msg, int flag)
84
+{
85
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
86
+}
87
+
88
+TRICE_INLINE void triceAssertFalse(int idN, char *msg, int flag)
89
+{
90
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
91
+}
92
+TRICE_INLINE void TriceAssertFalse(int idN, char *msg, int flag)
93
+{
94
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
95
+}
96
+TRICE_INLINE void TRiceAssertFalse(int idN, char *msg, int flag)
97
+{
98
+    TRICE_UNUSED(idN) TRICE_UNUSED(msg) TRICE_UNUSED(flag)
99
+}
100
+
101
+// All following macros are defined without ID and as variadic, to avoid editor warnings for TRICE_CLEAN == 1 or TRICE_OFF == 1
102
+
103
+#define TRICE_S(p, s, ...) TRICE_UNUSED(p) TRICE_UNUSED(s)
104
+#define triceS( p, s, ...) TRICE_UNUSED(p) TRICE_UNUSED(s)
105
+#define TriceS( p, s, ...) TRICE_UNUSED(p) TRICE_UNUSED(s)
106
+#define TRiceS( p, s, ...) TRICE_UNUSED(p) TRICE_UNUSED(s)
107
+
108
+#define TRICE_N(p, s, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(s) TRICE_UNUSED(n)
109
+#define triceN( p, s, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(s) TRICE_UNUSED(n)
110
+#define TriceN( p, s, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(s) TRICE_UNUSED(n)
111
+#define TRiceN( p, s, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(s) TRICE_UNUSED(n)
112
+
113
+// #define TRICE_B(iD, ...)
114
+#define triceB(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
115
+#define TriceB(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
116
+#define TRiceB(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
117
+
118
+// #define TRICE_F(iD, ...)
119
+#define triceF(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
120
+#define TriceF(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
121
+#define TRiceF(p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
122
+
123
+#define TRICE(  fmt, ...)
124
+#define trice(  fmt, ...)
125
+#define Trice(  fmt, ...)
126
+#define TRice(  fmt, ...)
127
+#define TRICE8( fmt, ...)
128
+#define trice8( fmt, ...)
129
+#define Trice8( fmt, ...)
130
+#define TRice8( fmt, ...)
131
+#define TRICE16(fmt, ...)
132
+#define trice16(fmt, ...)
133
+#define Trice16(fmt, ...)
134
+#define TRice16(fmt, ...)
135
+#define TRICE32(fmt, ...)
136
+#define trice32(fmt, ...)
137
+#define Trice32(fmt, ...)
138
+#define TRice32(fmt, ...)
139
+#define TRICE64(fmt, ...)
140
+#define trice64(fmt, ...)
141
+#define Trice64(fmt, ...)
142
+#define TRice64(fmt, ...)
143
+
144
+#define TRICE_0( fmt, ...)
145
+#define TRICE_1( fmt, v0, ...) TRICE_UNUSED(v0)
146
+#define TRICE_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
147
+#define TRICE_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
148
+#define TRICE_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
149
+#define TRICE_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
150
+#define TRICE_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
151
+#define TRICE_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
152
+#define TRICE_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
153
+#define TRICE_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
154
+#define TRICE_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
155
+#define TRICE_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
156
+#define TRICE_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
157
+#define trice_0( fmt, ...)
158
+#define trice_1( fmt, v0, ...) TRICE_UNUSED(v0)
159
+#define trice_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
160
+#define trice_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
161
+#define trice_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
162
+#define trice_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
163
+#define trice_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
164
+#define trice_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
165
+#define trice_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
166
+#define trice_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
167
+#define trice_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
168
+#define trice_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
169
+#define trice_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
170
+#define Trice_0( fmt, ...)
171
+#define Trice_1( fmt, v0, ...) TRICE_UNUSED(v0)
172
+#define Trice_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
173
+#define Trice_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
174
+#define Trice_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
175
+#define Trice_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
176
+#define Trice_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
177
+#define Trice_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
178
+#define Trice_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
179
+#define Trice_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
180
+#define Trice_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
181
+#define Trice_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
182
+#define Trice_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
183
+#define TRice_0( fmt, ...)
184
+#define TRice_1( fmt, v0, ...) TRICE_UNUSED(v0)
185
+#define TRice_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
186
+#define TRice_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
187
+#define TRice_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
188
+#define TRice_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
189
+#define TRice_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
190
+#define TRice_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
191
+#define TRice_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
192
+#define TRice_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
193
+#define TRice_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
194
+#define TRice_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
195
+#define TRice_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
196
+
197
+#define TRICE8_B(id, fmt, p, n ) TRICE_UNUSED(p) TRICE_UNUSED(n)
198
+#define trice8B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
199
+#define Trice8B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
200
+#define TRice8B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
201
+#define TRICE8_F(id, fmt, p, n ) TRICE_UNUSED(p) TRICE_UNUSED(n)
202
+#define trice8F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
203
+#define Trice8F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
204
+#define TRice8F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
205
+
206
+#define TRICE8_0( fmt, ...)
207
+#define TRICE8_1( fmt, v0, ...) TRICE_UNUSED(v0)
208
+#define TRICE8_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
209
+#define TRICE8_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
210
+#define TRICE8_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
211
+#define TRICE8_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
212
+#define TRICE8_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
213
+#define TRICE8_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
214
+#define TRICE8_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
215
+#define TRICE8_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
216
+#define TRICE8_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
217
+#define TRICE8_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
218
+#define TRICE8_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
219
+#define trice8_0( fmt, ...)
220
+#define trice8_1( fmt, v0, ...) TRICE_UNUSED(v0)
221
+#define trice8_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
222
+#define trice8_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
223
+#define trice8_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
224
+#define trice8_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
225
+#define trice8_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
226
+#define trice8_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
227
+#define trice8_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
228
+#define trice8_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
229
+#define trice8_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
230
+#define trice8_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
231
+#define trice8_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
232
+#define Trice8_0( fmt, ...)
233
+#define Trice8_1( fmt, v0, ...) TRICE_UNUSED(v0)
234
+#define Trice8_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
235
+#define Trice8_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
236
+#define Trice8_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
237
+#define Trice8_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
238
+#define Trice8_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
239
+#define Trice8_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
240
+#define Trice8_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
241
+#define Trice8_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
242
+#define Trice8_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
243
+#define Trice8_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
244
+#define Trice8_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
245
+#define TRice8_0( fmt, ...)
246
+#define TRice8_1( fmt, v0, ...) TRICE_UNUSED(v0)
247
+#define TRice8_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
248
+#define TRice8_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
249
+#define TRice8_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
250
+#define TRice8_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
251
+#define TRice8_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
252
+#define TRice8_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
253
+#define TRice8_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
254
+#define TRice8_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
255
+#define TRice8_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
256
+#define TRice8_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
257
+#define TRice8_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
258
+
259
+#define TRICE16_B(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
260
+#define trice16B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
261
+#define Trice16B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
262
+#define TRice16B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
263
+#define TRICE16_F(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
264
+#define trice16F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
265
+#define Trice16F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
266
+#define TRice16F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
267
+
268
+#define TRICE16_0( fmt, ...)
269
+#define TRICE16_1( fmt, v0, ...) TRICE_UNUSED(v0)
270
+#define TRICE16_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
271
+#define TRICE16_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
272
+#define TRICE16_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
273
+#define TRICE16_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
274
+#define TRICE16_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
275
+#define TRICE16_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
276
+#define TRICE16_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
277
+#define TRICE16_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
278
+#define TRICE16_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
279
+#define TRICE16_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
280
+#define TRICE16_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
281
+#define trice16_0( fmt, ...)
282
+#define trice16_1( fmt, v0, ...) TRICE_UNUSED(v0)
283
+#define trice16_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
284
+#define trice16_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
285
+#define trice16_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
286
+#define trice16_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
287
+#define trice16_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
288
+#define trice16_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
289
+#define trice16_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
290
+#define trice16_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
291
+#define trice16_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
292
+#define trice16_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
293
+#define trice16_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
294
+#define Trice16_0( fmt, ...)
295
+#define Trice16_1( fmt, v0, ...) TRICE_UNUSED(v0)
296
+#define Trice16_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
297
+#define Trice16_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
298
+#define Trice16_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
299
+#define Trice16_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
300
+#define Trice16_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
301
+#define Trice16_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
302
+#define Trice16_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
303
+#define Trice16_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
304
+#define Trice16_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
305
+#define Trice16_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
306
+#define Trice16_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
307
+#define TRice16_0( fmt, ...)
308
+#define TRice16_1( fmt, v0, ...) TRICE_UNUSED(v0)
309
+#define TRice16_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
310
+#define TRice16_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
311
+#define TRice16_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
312
+#define TRice16_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
313
+#define TRice16_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
314
+#define TRice16_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
315
+#define TRice16_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
316
+#define TRice16_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
317
+#define TRice16_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
318
+#define TRice16_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
319
+#define TRice16_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
320
+
321
+#define TRICE32_B(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
322
+#define trice32B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
323
+#define Trice32B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
324
+#define TRice32B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
325
+#define TRICE32_F(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
326
+#define trice32F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
327
+#define Trice32F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
328
+#define TRice32F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
329
+
330
+#define TRICE32_0( fmt, ...)
331
+#define TRICE32_1( fmt, v0, ...) TRICE_UNUSED(v0)
332
+#define TRICE32_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
333
+#define TRICE32_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
334
+#define TRICE32_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
335
+#define TRICE32_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
336
+#define TRICE32_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
337
+#define TRICE32_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
338
+#define TRICE32_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
339
+#define TRICE32_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
340
+#define TRICE32_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
341
+#define TRICE32_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
342
+#define TRICE32_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
343
+#define trice32_0( fmt, ...)
344
+#define trice32_1( fmt, v0, ...) TRICE_UNUSED(v0)
345
+#define trice32_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
346
+#define trice32_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
347
+#define trice32_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
348
+#define trice32_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
349
+#define trice32_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
350
+#define trice32_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
351
+#define trice32_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
352
+#define trice32_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
353
+#define trice32_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
354
+#define trice32_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
355
+#define trice32_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
356
+#define Trice32_0( fmt, ...)
357
+#define Trice32_1( fmt, v0, ...) TRICE_UNUSED(v0)
358
+#define Trice32_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
359
+#define Trice32_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
360
+#define Trice32_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
361
+#define Trice32_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
362
+#define Trice32_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
363
+#define Trice32_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
364
+#define Trice32_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
365
+#define Trice32_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
366
+#define Trice32_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
367
+#define Trice32_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
368
+#define Trice32_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
369
+#define TRice32_0( fmt, ...)
370
+#define TRice32_1( fmt, v0, ...) TRICE_UNUSED(v0)
371
+#define TRice32_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
372
+#define TRice32_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
373
+#define TRice32_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
374
+#define TRice32_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
375
+#define TRice32_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
376
+#define TRice32_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
377
+#define TRice32_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
378
+#define TRice32_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
379
+#define TRice32_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
380
+#define TRice32_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
381
+#define TRice32_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
382
+
383
+#define TRICE64_B(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
384
+#define trice64B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
385
+#define Trice64B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
386
+#define TRice64B( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
387
+#define TRICE64_F(fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
388
+#define trice64F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
389
+#define Trice64F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
390
+#define TRice64F( fmt, p, n, ...) TRICE_UNUSED(p) TRICE_UNUSED(n)
391
+
392
+#define TRICE64_0( fmt, ...)
393
+#define TRICE64_1( fmt, v0, ...) TRICE_UNUSED(v0)
394
+#define TRICE64_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
395
+#define TRICE64_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
396
+#define TRICE64_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
397
+#define TRICE64_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
398
+#define TRICE64_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
399
+#define TRICE64_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
400
+#define TRICE64_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
401
+#define TRICE64_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
402
+#define TRICE64_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
403
+#define TRICE64_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
404
+#define TRICE64_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
405
+#define trice64_0( fmt, ...)
406
+#define trice64_1( fmt, v0, ...) TRICE_UNUSED(v0)
407
+#define trice64_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
408
+#define trice64_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
409
+#define trice64_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
410
+#define trice64_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
411
+#define trice64_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
412
+#define trice64_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
413
+#define trice64_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
414
+#define trice64_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
415
+#define trice64_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
416
+#define trice64_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
417
+#define trice64_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
418
+#define Trice64_0( fmt, ...)
419
+#define Trice64_1( fmt, v0, ...) TRICE_UNUSED(v0)
420
+#define Trice64_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
421
+#define Trice64_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
422
+#define Trice64_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
423
+#define Trice64_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
424
+#define Trice64_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
425
+#define Trice64_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
426
+#define Trice64_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
427
+#define Trice64_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
428
+#define Trice64_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
429
+#define Trice64_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
430
+#define Trice64_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
431
+#define TRice64_0( fmt, ...)
432
+#define TRice64_1( fmt, v0, ...) TRICE_UNUSED(v0)
433
+#define TRice64_2( fmt, v0, v1, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1)
434
+#define TRice64_3( fmt, v0, v1, v2, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2)
435
+#define TRice64_4( fmt, v0, v1, v2, v3, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3)
436
+#define TRice64_5( fmt, v0, v1, v2, v3, v4, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4)
437
+#define TRice64_6( fmt, v0, v1, v2, v3, v4, v5, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5)
438
+#define TRice64_7( fmt, v0, v1, v2, v3, v4, v5, v6, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6)
439
+#define TRice64_8( fmt, v0, v1, v2, v3, v4, v5, v6, v7, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7)
440
+#define TRice64_9( fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8)
441
+#define TRice64_10(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9)
442
+#define TRice64_11(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10)
443
+#define TRice64_12(fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, ...) TRICE_UNUSED(v0) TRICE_UNUSED(v1) TRICE_UNUSED(v2) TRICE_UNUSED(v3) TRICE_UNUSED(v4) TRICE_UNUSED(v5) TRICE_UNUSED(v6) TRICE_UNUSED(v7) TRICE_UNUSED(v8) TRICE_UNUSED(v9) TRICE_UNUSED(v10) TRICE_UNUSED(v11)
444
+// clang-format on

+ 434
- 0
Middlewares/trice/triceOn.h Переглянути файл

@@ -0,0 +1,434 @@
1
+/*! \file triceOn.h
2
+\author thomas.hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6
+// The variadic macros need to be defined before `#include "triceOff.h"`.
7
+// When TRICE OFF == 1, the  variadic macros cannot simply be defined as empty macros, because then unused parameter warnings pop up.
8
+//
9
+
10
+//! TRICE_NTH_ARGUMENT just evaluates to the 15th argument. It is extendable until a 32764 bytes payload.
11
+//! Variadic macros (https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms)
12
+//! See for more explanation https://renenyffenegger.ch/notes/development/languages/C-C-plus-plus/preprocessor/macros/__VA_ARGS__/count-arguments
13
+#define TRICE_NTH_ARGUMENT(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, ...) a14
14
+
15
+//! TRICE_COUNT_ARGUMENTS builds upon TRICE_NTH_ARGUMENT. The more arguments that are passed to TRICE_COUNT_ARGUMENTS,
16
+//! the more the »counting arguments« (12, 11, 10, 9, 8, 7…) are pushed to the right.
17
+//! Thus the macro evaluates to the number of arguments that are passed to the macro.
18
+//! If you set the C language to strict C (C90, C99, C11 or C17) the `##` operator doesn't remove the comma before it when `__VA_ARGS__` expands to nothing.
19
+//! In this case, the TRICE macro doesn't work with no parameters. You must then explicitly use TRICE0 instead of TRICE for a no parameter value TRICE.
20
+//! For more details see closed Issue #279. Special thanks to [@escherstair](https://github.com/escherstair).
21
+//! If for example using CLANG 6.18 set C-language to gnu11, gnu99 or std to avoid the comma issue when no parameters are in a TRICE  macro.
22
+//! In case you have to set the C-Language to c11 or c99 you can use the TRICE0 macro directly instead of TRICE when no value parameters.
23
+#define TRICE_COUNT_ARGUMENTS(...) TRICE_NTH_ARGUMENT(dummy, ##__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
24
+
25
+//! TRICE_CONCAT concatenates the 2 arguments a and b (helper macro).
26
+#define TRICE_CONCAT(a, b) a##b
27
+
28
+//! TRICE_CONCAT2 concatenates the 2 arguments a and b (helper macro).
29
+#define TRICE_CONCAT2(a, b) TRICE_CONCAT(a, b)
30
+
31
+// clang-format off
32
+#define TRICE(  tid, fmt, ...) TRICE_CONCAT2(TRICE_,   TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
33
+#define trice(  tid, fmt, ...) TRICE_CONCAT2(trice_,   TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
34
+#define Trice(  tid, fmt, ...) TRICE_CONCAT2(Trice_,   TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
35
+#define TRice(  tid, fmt, ...) TRICE_CONCAT2(TRice_,   TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
36
+#define TRICE8( tid, fmt, ...) TRICE_CONCAT2(TRICE8_,  TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
37
+#define trice8( tid, fmt, ...) TRICE_CONCAT2(trice8_,  TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
38
+#define Trice8( tid, fmt, ...) TRICE_CONCAT2(Trice8_,  TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
39
+#define TRice8( tid, fmt, ...) TRICE_CONCAT2(TRice8_,  TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
40
+#define TRICE16(tid, fmt, ...) TRICE_CONCAT2(TRICE16_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
41
+#define trice16(tid, fmt, ...) TRICE_CONCAT2(trice16_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
42
+#define Trice16(tid, fmt, ...) TRICE_CONCAT2(Trice16_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
43
+#define TRice16(tid, fmt, ...) TRICE_CONCAT2(TRice16_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
44
+#define TRICE32(tid, fmt, ...) TRICE_CONCAT2(TRICE32_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
45
+#define trice32(tid, fmt, ...) TRICE_CONCAT2(trice32_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
46
+#define Trice32(tid, fmt, ...) TRICE_CONCAT2(Trice32_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
47
+#define TRice32(tid, fmt, ...) TRICE_CONCAT2(TRice32_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
48
+#define TRICE64(tid, fmt, ...) TRICE_CONCAT2(TRICE64_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
49
+#define trice64(tid, fmt, ...) TRICE_CONCAT2(trice64_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
50
+#define Trice64(tid, fmt, ...) TRICE_CONCAT2(Trice64_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
51
+#define TRice64(tid, fmt, ...) TRICE_CONCAT2(TRice64_, TRICE_COUNT_ARGUMENTS(__VA_ARGS__))(tid, fmt, ##__VA_ARGS__)
52
+// clang-format on
53
+
54
+//
55
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
56
+
57
+// global function prototypes: (not all always used)
58
+
59
+void TriceInitRingBufferMargins(void);
60
+void WatchRingBufferMargins(void);
61
+void TriceCheck(int index); //!< tests and examples
62
+void TriceDiagnostics(int index);
63
+void TriceNonBlockingWriteUartA(const void* buf, size_t nByte);
64
+void TriceNonBlockingWriteUartB(const void* buf, size_t nByte);
65
+void TriceNonBlockingDirectWrite(uint32_t* triceStart, unsigned wordCount);
66
+void TriceNonBlockingDirectWrite8Auxiliary(const uint8_t* enc, size_t encLen);
67
+void TriceNonBlockingDeferredWrite8Auxiliary(const uint8_t* enc, size_t encLen);
68
+void TriceNonBlockingDirectWrite32Auxiliary(const uint32_t* enc, unsigned count);
69
+void TriceNonBlockingDeferredWrite32Auxiliary(const uint32_t* enc, unsigned count);
70
+void TriceInit(void);
71
+void TriceLogDiagnosticData(void);
72
+void TriceLogSeggerDiagnostics(void);
73
+void TriceNonBlockingDeferredWrite8(int ticeID, const uint8_t* enc, size_t encLen);
74
+void TriceTransfer(void);
75
+size_t triceDataLen(const uint8_t* p);
76
+int TriceEnoughSpace(void);
77
+unsigned TriceOutDepth(void);
78
+size_t TriceDepth(void);
79
+size_t TriceDepthMax(void);
80
+size_t TriceEncode(unsigned encrypt, unsigned framing, uint8_t* dst, const uint8_t* buf, size_t len);
81
+void TriceWriteDeviceCgo(const void* buf, unsigned len); //!< TriceWriteDeviceCgo is only needed for testing C-sources from Go.
82
+unsigned TriceOutDepthCGO(void);                         //!< TriceOutDepthCGO is only needed for testing C-sources from Go.
83
+
84
+void TriceBlockingWriteUartA(const uint8_t* buf, unsigned len);
85
+void triceServeTransmitUartA(void);
86
+void triceTriggerTransmitUartA(void);
87
+unsigned TriceOutDepthUartA(void);
88
+
89
+void TriceBlockingWriteUartB(const uint8_t* buf, unsigned len);
90
+void triceServeTransmitUartB(void);
91
+void triceTriggerTransmitUartB(void);
92
+unsigned TriceOutDepthUartB(void);
93
+
94
+void XTEAEncrypt(uint32_t* p, unsigned count);
95
+void XTEADecrypt(uint32_t* p, unsigned count);
96
+void XTEAInitTable(void);
97
+
98
+// Trice functions and macros
99
+
100
+void trice8fn_0(uint16_t tid);
101
+void trice8fn_1(uint16_t tid, uint8_t v0);
102
+void trice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1);
103
+void trice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2);
104
+void trice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3);
105
+void trice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4);
106
+void trice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5);
107
+void trice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6);
108
+void trice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7);
109
+void trice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8);
110
+void trice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9);
111
+void trice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10);
112
+void trice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11);
113
+
114
+void Trice8fn_0(uint16_t tid);
115
+void Trice8fn_1(uint16_t tid, uint8_t v0);
116
+void Trice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1);
117
+void Trice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2);
118
+void Trice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3);
119
+void Trice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4);
120
+void Trice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5);
121
+void Trice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6);
122
+void Trice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7);
123
+void Trice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8);
124
+void Trice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9);
125
+void Trice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10);
126
+void Trice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11);
127
+
128
+void TRice8fn_0(uint16_t tid);
129
+void TRice8fn_1(uint16_t tid, uint8_t v0);
130
+void TRice8fn_2(uint16_t tid, uint8_t v0, uint8_t v1);
131
+void TRice8fn_3(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2);
132
+void TRice8fn_4(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3);
133
+void TRice8fn_5(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4);
134
+void TRice8fn_6(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5);
135
+void TRice8fn_7(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6);
136
+void TRice8fn_8(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7);
137
+void TRice8fn_9(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8);
138
+void TRice8fn_10(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9);
139
+void TRice8fn_11(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10);
140
+void TRice8fn_12(uint16_t tid, uint8_t v0, uint8_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint8_t v5, uint8_t v6, uint8_t v7, uint8_t v8, uint8_t v9, uint8_t v10, uint8_t v11);
141
+
142
+void trice16fn_0(uint16_t tid);
143
+void trice16fn_1(uint16_t tid, uint16_t v0);
144
+void trice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1);
145
+void trice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2);
146
+void trice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3);
147
+void trice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4);
148
+void trice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5);
149
+void trice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6);
150
+void trice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7);
151
+void trice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8);
152
+void trice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9);
153
+void trice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10);
154
+void trice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11);
155
+
156
+void Trice16fn_0(uint16_t tid);
157
+void Trice16fn_1(uint16_t tid, uint16_t v0);
158
+void Trice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1);
159
+void Trice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2);
160
+void Trice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3);
161
+void Trice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4);
162
+void Trice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5);
163
+void Trice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6);
164
+void Trice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7);
165
+void Trice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8);
166
+void Trice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9);
167
+void Trice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10);
168
+void Trice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11);
169
+
170
+void TRice16fn_0(uint16_t tid);
171
+void TRice16fn_1(uint16_t tid, uint16_t v0);
172
+void TRice16fn_2(uint16_t tid, uint16_t v0, uint16_t v1);
173
+void TRice16fn_3(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2);
174
+void TRice16fn_4(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3);
175
+void TRice16fn_5(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4);
176
+void TRice16fn_6(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5);
177
+void TRice16fn_7(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6);
178
+void TRice16fn_8(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7);
179
+void TRice16fn_9(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8);
180
+void TRice16fn_10(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9);
181
+void TRice16fn_11(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10);
182
+void TRice16fn_12(uint16_t tid, uint16_t v0, uint16_t v1, uint16_t v2, uint16_t v3, uint16_t v4, uint16_t v5, uint16_t v6, uint16_t v7, uint16_t v8, uint16_t v9, uint16_t v10, uint16_t v11);
183
+
184
+void trice32fn_0(uint16_t tid);
185
+void trice32fn_1(uint16_t tid, uint32_t v0);
186
+void trice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1);
187
+void trice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2);
188
+void trice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3);
189
+void trice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4);
190
+void trice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5);
191
+void trice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6);
192
+void trice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7);
193
+void trice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8);
194
+void trice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9);
195
+void trice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10);
196
+void trice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11);
197
+
198
+void Trice32fn_0(uint16_t tid);
199
+void Trice32fn_1(uint16_t tid, uint32_t v0);
200
+void Trice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1);
201
+void Trice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2);
202
+void Trice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3);
203
+void Trice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4);
204
+void Trice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5);
205
+void Trice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6);
206
+void Trice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7);
207
+void Trice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8);
208
+void Trice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9);
209
+void Trice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10);
210
+void Trice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11);
211
+
212
+void TRice32fn_0(uint16_t tid);
213
+void TRice32fn_1(uint16_t tid, uint32_t v0);
214
+void TRice32fn_2(uint16_t tid, uint32_t v0, uint32_t v1);
215
+void TRice32fn_3(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2);
216
+void TRice32fn_4(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3);
217
+void TRice32fn_5(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4);
218
+void TRice32fn_6(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5);
219
+void TRice32fn_7(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6);
220
+void TRice32fn_8(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7);
221
+void TRice32fn_9(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8);
222
+void TRice32fn_10(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9);
223
+void TRice32fn_11(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10);
224
+void TRice32fn_12(uint16_t tid, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, uint32_t v8, uint32_t v9, uint32_t v10, uint32_t v11);
225
+
226
+void trice64fn_0(uint16_t tid);
227
+void trice64fn_1(uint16_t tid, uint64_t v0);
228
+void trice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1);
229
+void trice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2);
230
+void trice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3);
231
+void trice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4);
232
+void trice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5);
233
+void trice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6);
234
+void trice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7);
235
+void trice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8);
236
+void trice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9);
237
+void trice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10);
238
+void trice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11);
239
+
240
+void Trice64fn_0(uint16_t tid);
241
+void Trice64fn_1(uint16_t tid, uint64_t v0);
242
+void Trice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1);
243
+void Trice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2);
244
+void Trice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3);
245
+void Trice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4);
246
+void Trice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5);
247
+void Trice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6);
248
+void Trice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7);
249
+void Trice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8);
250
+void Trice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9);
251
+void Trice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10);
252
+void Trice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11);
253
+
254
+void TRice64fn_0(uint16_t tid);
255
+void TRice64fn_1(uint16_t tid, uint64_t v0);
256
+void TRice64fn_2(uint16_t tid, uint64_t v0, uint64_t v1);
257
+void TRice64fn_3(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2);
258
+void TRice64fn_4(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3);
259
+void TRice64fn_5(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4);
260
+void TRice64fn_6(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5);
261
+void TRice64fn_7(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6);
262
+void TRice64fn_8(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7);
263
+void TRice64fn_9(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8);
264
+void TRice64fn_10(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9);
265
+void TRice64fn_11(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10);
266
+void TRice64fn_12(uint16_t tid, uint64_t v0, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4, uint64_t v5, uint64_t v6, uint64_t v7, uint64_t v8, uint64_t v9, uint64_t v10, uint64_t v11);
267
+
268
+#define trice8_0(tid, fmt) trice8fn_0(tid)                                                                                                                                                                                                                                           //!< trice8_0 is a macro calling a function to reduce code size, this way avoiding code inlining.
269
+#define trice8_1(tid, fmt, v0) trice8fn_1(tid, (uint8_t)(v0))                                                                                                                                                                                                                        //!< trice8_1 is a macro calling a function to reduce code size, this way avoiding code inlining.
270
+#define trice8_2(tid, fmt, v0, v1) trice8fn_2(tid, (uint8_t)(v0), (uint8_t)(v1))                                                                                                                                                                                                     //!< trice8_2 ia macro calling a function to reduce code size, this way avoiding code inlining.
271
+#define trice8_3(tid, fmt, v0, v1, v2) trice8fn_3(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2))                                                                                                                                                                                  //!< trice8_3 ia macro calling a function to reduce code size, this way avoiding code inlining.
272
+#define trice8_4(tid, fmt, v0, v1, v2, v3) trice8fn_4(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3))                                                                                                                                                               //!< trice8_4 ia macro calling a function to reduce code size, this way avoiding code inlining.
273
+#define trice8_5(tid, fmt, v0, v1, v2, v3, v4) trice8fn_5(tid, (uint8_t)v0, (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4))                                                                                                                                              //!< trice8_5 ia macro calling a function to reduce code size, this way avoiding code inlining.
274
+#define trice8_6(tid, fmt, v0, v1, v2, v3, v4, v5) trice8fn_6(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5))                                                                                                                         //!< trice8_6 ia macro calling a function to reduce code size, this way avoiding code inlining.
275
+#define trice8_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) trice8fn_7(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6))                                                                                                      //!< trice8_7 ia macro calling a function to reduce code size, this way avoiding code inlining.
276
+#define trice8_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) trice8fn_8(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7))                                                                                   //!< trice8_8 ia macro calling a function to reduce code size, this way avoiding code inlining.
277
+#define trice8_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) trice8fn_9(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8))                                                                //!< trice8_9 ia macro calling a function to reduce code size, this way avoiding code inlining.
278
+#define trice8_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) trice8fn_10(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9))                                           //!< trice8_10 ia macro calling a function to reduce code size, this way avoiding code inlining.
279
+#define trice8_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) trice8fn_11(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10))                      //!< trice8_1M ia macro calling a function to reduce code size, this way avoiding code inlining.
280
+#define trice8_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) trice8fn_12(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10), (uint8_t)(v11)) //!< trice8_12 ia macro calling a function to reduce code size, this way avoiding code inlining.
281
+
282
+#define Trice8_0(tid, fmt) Trice8fn_0(tid)                                                                                                                                                                                                                                           //!< Trice8_1 ia macro calling a function to reduce code size, this way avoiding code inlining.
283
+#define Trice8_1(tid, fmt, v0) Trice8fn_1(tid, (uint8_t)(v0))                                                                                                                                                                                                                        //!< Trice8_1 ia macro calling a function to reduce code size, this way avoiding code inlining.
284
+#define Trice8_2(tid, fmt, v0, v1) Trice8fn_2(tid, (uint8_t)(v0), (uint8_t)(v1))                                                                                                                                                                                                     //!< Trice8_2 ia macro calling a function to reduce code size, this way avoiding code inlining.
285
+#define Trice8_3(tid, fmt, v0, v1, v2) Trice8fn_3(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2))                                                                                                                                                                                  //!< Trice8_3 ia macro calling a function to reduce code size, this way avoiding code inlining.
286
+#define Trice8_4(tid, fmt, v0, v1, v2, v3) Trice8fn_4(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3))                                                                                                                                                               //!< Trice8_4 ia macro calling a function to reduce code size, this way avoiding code inlining.
287
+#define Trice8_5(tid, fmt, v0, v1, v2, v3, v4) Trice8fn_5(tid, (uint8_t)v0, (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4))                                                                                                                                              //!< Trice8_5 ia macro calling a function to reduce code size, this way avoiding code inlining.
288
+#define Trice8_6(tid, fmt, v0, v1, v2, v3, v4, v5) Trice8fn_6(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5))                                                                                                                         //!< Trice8_6 ia macro calling a function to reduce code size, this way avoiding code inlining.
289
+#define Trice8_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) Trice8fn_7(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6))                                                                                                      //!< Trice8_7 ia macro calling a function to reduce code size, this way avoiding code inlining.
290
+#define Trice8_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) Trice8fn_8(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7))                                                                                   //!< Trice8_8 ia macro calling a function to reduce code size, this way avoiding code inlining.
291
+#define Trice8_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) Trice8fn_9(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8))                                                                //!< Trice8_9 ia macro calling a function to reduce code size, this way avoiding code inlining.
292
+#define Trice8_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) Trice8fn_10(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9))                                           //!< Trice8_10 ia macro calling a function to reduce code size, this way avoiding code inlining.
293
+#define Trice8_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) Trice8fn_11(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10))                      //!< Trice8_11 ia macro calling a function to reduce code size, this way avoiding code inlining.
294
+#define Trice8_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) Trice8fn_12(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10), (uint8_t)(v11)) //!< Trice8_12 ia macro calling a function to reduce code size, this way avoiding code inlining.
295
+
296
+#define TRice8_0(tid, fmt) TRice8fn_0(tid)                                                                                                                                                                                                                                           //!< TRice8_0 ia macro calling a function to reduce code size, this way avoiding code inlining.
297
+#define TRice8_1(tid, fmt, v0) TRice8fn_1(tid, (uint8_t)(v0))                                                                                                                                                                                                                        //!< TRice8_1 ia macro calling a function to reduce code size, this way avoiding code inlining.
298
+#define TRice8_2(tid, fmt, v0, v1) TRice8fn_2(tid, (uint8_t)(v0), (uint8_t)(v1))                                                                                                                                                                                                     //!< TRice8_2 ia macro calling a function to reduce code size, this way avoiding code inlining.
299
+#define TRice8_3(tid, fmt, v0, v1, v2) TRice8fn_3(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2))                                                                                                                                                                                  //!< TRice8_3 ia macro calling a function to reduce code size, this way avoiding code inlining.
300
+#define TRice8_4(tid, fmt, v0, v1, v2, v3) TRice8fn_4(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3))                                                                                                                                                               //!< TRice8_4 ia macro calling a function to reduce code size, this way avoiding code inlining.
301
+#define TRice8_5(tid, fmt, v0, v1, v2, v3, v4) TRice8fn_5(tid, (uint8_t)v0, (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4))                                                                                                                                              //!< TRice8_5 ia macro calling a function to reduce code size, this way avoiding code inlining.
302
+#define TRice8_6(tid, fmt, v0, v1, v2, v3, v4, v5) TRice8fn_6(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5))                                                                                                                         //!< TRice8_6 ia macro calling a function to reduce code size, this way avoiding code inlining.
303
+#define TRice8_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) TRice8fn_7(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6))                                                                                                      //!< TRice8_7 ia macro calling a function to reduce code size, this way avoiding code inlining.
304
+#define TRice8_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) TRice8fn_8(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7))                                                                                   //!< TRice8_8 ia macro calling a function to reduce code size, this way avoiding code inlining.
305
+#define TRice8_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) TRice8fn_9(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8))                                                                //!< TRice8_9 ia macro calling a function to reduce code size, this way avoiding code inlining.
306
+#define TRice8_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) TRice8fn_10(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9))                                           //!< TRice8_10 ia macro calling a function to reduce code size, this way avoiding code inlining.
307
+#define TRice8_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) TRice8fn_11(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10))                      //!< TRice8_11 ia macro calling a function to reduce code size, this way avoiding code inlining.
308
+#define TRice8_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) TRice8fn_12(tid, (uint8_t)(v0), (uint8_t)(v1), (uint8_t)(v2), (uint8_t)(v3), (uint8_t)(v4), (uint8_t)(v5), (uint8_t)(v6), (uint8_t)(v7), (uint8_t)(v8), (uint8_t)(v9), (uint8_t)(v10), (uint8_t)(v11)) //!< TRice8_12 ia macro calling a function to reduce code size, this way avoiding code inlining.
309
+
310
+#define trice16_0(tid, fmt) trice16fn_0(tid)                                                                                                                                                                                                                                                       //!< trice16_0 is a macro calling a function to reduce code size.
311
+#define trice16_1(tid, fmt, v0) trice16fn_1(tid, (uint16_t)(v0))                                                                                                                                                                                                                                   //!< trice16_1 is a macro calling a function to reduce code size.
312
+#define trice16_2(tid, fmt, v0, v1) trice16fn_2(tid, (uint16_t)(v0), (uint16_t)(v1))                                                                                                                                                                                                               //!< trice16_2 is a macro calling a function to reduce code size.
313
+#define trice16_3(tid, fmt, v0, v1, v2) trice16fn_3(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2))                                                                                                                                                                                           //!< trice16_3 is a macro calling a function to reduce code size.
314
+#define trice16_4(tid, fmt, v0, v1, v2, v3) trice16fn_4(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3))                                                                                                                                                                       //!< trice16_4 is a macro calling a function to reduce code size.
315
+#define trice16_5(tid, fmt, v0, v1, v2, v3, v4) trice16fn_5(tid, (uint16_t)v0, (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4))                                                                                                                                                     //!< trice16_5 is a macro calling a function to reduce code size.
316
+#define trice16_6(tid, fmt, v0, v1, v2, v3, v4, v5) trice16fn_6(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5))                                                                                                                               //!< trice16_6 is a macro calling a function to reduce code size.
317
+#define trice16_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) trice16fn_7(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6))                                                                                                           //!< trice16_7 is a macro calling a function to reduce code size.
318
+#define trice16_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) trice16fn_8(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7))                                                                                       //!< trice16_8 is a macro calling a function to reduce code size.
319
+#define trice16_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) trice16fn_9(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8))                                                                   //!< trice16_9 is a macro calling a function to reduce code size.
320
+#define trice16_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) trice16fn_10(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9))                                             //!< trice16_10 is a macro calling a function to reduce code size.
321
+#define trice16_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) trice16fn_11(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10))                       //!< trice16_11 is a macro calling a function to reduce code size.
322
+#define trice16_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) trice16fn_12(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10), (uint16_t)(v11)) //!< trice16_12 is a macro calling a function to reduce code size.
323
+
324
+#define Trice16_0(tid, fmt) Trice16fn_0(tid)                                                                                                                                                                                                                                                       //!< Trice16_0 is a macro calling a function to reduce code size.
325
+#define Trice16_1(tid, fmt, v0) Trice16fn_1(tid, (uint16_t)(v0))                                                                                                                                                                                                                                   //!< Trice16_1 is a macro calling a function to reduce code size.
326
+#define Trice16_2(tid, fmt, v0, v1) Trice16fn_2(tid, (uint16_t)(v0), (uint16_t)(v1))                                                                                                                                                                                                               //!< Trice16_2 is a macro calling a function to reduce code size.
327
+#define Trice16_3(tid, fmt, v0, v1, v2) Trice16fn_3(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2))                                                                                                                                                                                           //!< Trice16_3 is a macro calling a function to reduce code size.
328
+#define Trice16_4(tid, fmt, v0, v1, v2, v3) Trice16fn_4(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3))                                                                                                                                                                       //!< Trice16_4 is a macro calling a function to reduce code size.
329
+#define Trice16_5(tid, fmt, v0, v1, v2, v3, v4) Trice16fn_5(tid, (uint16_t)v0, (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4))                                                                                                                                                     //!< Trice16_5 is a macro calling a function to reduce code size.
330
+#define Trice16_6(tid, fmt, v0, v1, v2, v3, v4, v5) Trice16fn_6(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5))                                                                                                                               //!< Trice16_6 is a macro calling a function to reduce code size.
331
+#define Trice16_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) Trice16fn_7(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6))                                                                                                           //!< Trice16_7 is a macro calling a function to reduce code size.
332
+#define Trice16_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) Trice16fn_8(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7))                                                                                       //!< Trice16_8 is a macro calling a function to reduce code size.
333
+#define Trice16_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) Trice16fn_9(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8))                                                                   //!< Trice16_9 is a macro calling a function to reduce code size.
334
+#define Trice16_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) Trice16fn_10(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9))                                             //!< Trice16_10 is a macro calling a function to reduce code size.
335
+#define Trice16_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) Trice16fn_11(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10))                       //!< Trice16_11 is a macro calling a function to reduce code size.
336
+#define Trice16_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) Trice16fn_12(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10), (uint16_t)(v11)) //!< Trice16_12 is a macro calling a function to reduce code size.
337
+
338
+#define TRice16_0(tid, fmt) TRice16fn_0(tid)                                                                                                                                                                                                                                                       //!< TRice16_0 is a macro calling a function to reduce code size.
339
+#define TRice16_1(tid, fmt, v0) TRice16fn_1(tid, (uint16_t)(v0))                                                                                                                                                                                                                                   //!< TRice16_1 is a macro calling a function to reduce code size.
340
+#define TRice16_2(tid, fmt, v0, v1) TRice16fn_2(tid, (uint16_t)(v0), (uint16_t)(v1))                                                                                                                                                                                                               //!< TRice16_2 is a macro calling a function to reduce code size.
341
+#define TRice16_3(tid, fmt, v0, v1, v2) TRice16fn_3(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2))                                                                                                                                                                                           //!< TRice16_3 is a macro calling a function to reduce code size.
342
+#define TRice16_4(tid, fmt, v0, v1, v2, v3) TRice16fn_4(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3))                                                                                                                                                                       //!< TRice16_4 is a macro calling a function to reduce code size.
343
+#define TRice16_5(tid, fmt, v0, v1, v2, v3, v4) TRice16fn_5(tid, (uint16_t)v0, (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4))                                                                                                                                                     //!< TRice16_5 is a macro calling a function to reduce code size.
344
+#define TRice16_6(tid, fmt, v0, v1, v2, v3, v4, v5) TRice16fn_6(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5))                                                                                                                               //!< TRice16_6 is a macro calling a function to reduce code size.
345
+#define TRice16_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) TRice16fn_7(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6))                                                                                                           //!< TRice16_7 is a macro calling a function to reduce code size.
346
+#define TRice16_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) TRice16fn_8(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7))                                                                                       //!< TRice16_16_M is a macro calling a function to reduce code size.
347
+#define TRice16_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) TRice16fn_9(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8))                                                                   //!< TRice16_9 is a macro calling a function to reduce code size.
348
+#define TRice16_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) TRice16fn_10(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9))                                             //!< TRice16_10 is a macro calling a function to reduce code size.
349
+#define TRice16_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) TRice16fn_11(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10))                       //!< TRice16_11 is a macro calling a function to reduce code size.
350
+#define TRice16_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) TRice16fn_12(tid, (uint16_t)(v0), (uint16_t)(v1), (uint16_t)(v2), (uint16_t)(v3), (uint16_t)(v4), (uint16_t)(v5), (uint16_t)(v6), (uint16_t)(v7), (uint16_t)(v8), (uint16_t)(v9), (uint16_t)(v10), (uint16_t)(v11)) //!< TRice16_12 is a macro calling a function to reduce code size.
351
+
352
+#define trice32_0(tid, fmt) trice32fn_0(tid)                                                                                                                                                                                                                                                       //!< trice32_0 is a macro calling a function to reduce code size.
353
+#define trice32_1(tid, fmt, v0) trice32fn_1(tid, (uint32_t)(v0))                                                                                                                                                                                                                                   //!< trice32_1 is a macro calling a function to reduce code size.
354
+#define trice32_2(tid, fmt, v0, v1) trice32fn_2(tid, (uint32_t)(v0), (uint32_t)(v1))                                                                                                                                                                                                               //!< trice32_2 is a macro calling a function to reduce code size.
355
+#define trice32_3(tid, fmt, v0, v1, v2) trice32fn_3(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2))                                                                                                                                                                                           //!< trice32_3 is a macro calling a function to reduce code size.
356
+#define trice32_4(tid, fmt, v0, v1, v2, v3) trice32fn_4(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3))                                                                                                                                                                       //!< trice32_4 is a macro calling a function to r  educe code size.
357
+#define trice32_5(tid, fmt, v0, v1, v2, v3, v4) trice32fn_5(tid, (uint32_t)v0, (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4))                                                                                                                                                     //!< trice32_5 is a macro calling a function to reduce code size.
358
+#define trice32_6(tid, fmt, v0, v1, v2, v3, v4, v5) trice32fn_6(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5))                                                                                                                               //!< trice32_6 is a macro calling a function to reduce code size.
359
+#define trice32_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) trice32fn_7(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6))                                                                                                           //!< trice32_7 is a macro calling a function to reduce code size.
360
+#define trice32_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) trice32fn_8(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7))                                                                                       //!< trice32_8 is a macro calling a function to reduce code size.
361
+#define trice32_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) trice32fn_9(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8))                                                                   //!< trice32_9 is a macro calling a function to reduce code size.
362
+#define trice32_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) trice32fn_10(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9))                                             //!< trice32_10 is a macro calling a function to reduce code size.
363
+#define trice32_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) trice32fn_11(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10))                       //!< trice32_11 is a macro calling a function to reduce code size.
364
+#define trice32_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) trice32fn_12(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10), (uint32_t)(v11)) //!< trice32_12 is a macro calling a function to reduce code size.
365
+
366
+#define Trice32_0(tid, fmt) Trice32fn_0(tid)                                                                                                                                                                                                                                                       //!< Trice32_0 is a macro calling a function to reduce code size.
367
+#define Trice32_1(tid, fmt, v0) Trice32fn_1(tid, (uint32_t)(v0))                                                                                                                                                                                                                                   //!< Trice32_1 is a macro calling a function to reduce code size.
368
+#define Trice32_2(tid, fmt, v0, v1) Trice32fn_2(tid, (uint32_t)(v0), (uint32_t)(v1))                                                                                                                                                                                                               //!< Trice32_2 is a macro calling a function to reduce code size.
369
+#define Trice32_3(tid, fmt, v0, v1, v2) Trice32fn_3(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2))                                                                                                                                                                                           //!< Trice32_3 is a macro calling a function to reduce code size.
370
+#define Trice32_4(tid, fmt, v0, v1, v2, v3) Trice32fn_4(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3))                                                                                                                                                                       //!< Trice32_4 is a macro calling a function to reduce code size.
371
+#define Trice32_5(tid, fmt, v0, v1, v2, v3, v4) Trice32fn_5(tid, (uint32_t)v0, (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4))                                                                                                                                                     //!< Trice32_5 is a macro calling a function to reduce code size.
372
+#define Trice32_6(tid, fmt, v0, v1, v2, v3, v4, v5) Trice32fn_6(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5))                                                                                                                               //!< Trice32_6 is a macro calling a function to reduce code size.
373
+#define Trice32_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) Trice32fn_7(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6))                                                                                                           //!< Trice32_7 is a macro calling a function to reduce code size.
374
+#define Trice32_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) Trice32fn_8(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7))                                                                                       //!< Trice32_8 is a macro calling a function to reduce code size.
375
+#define Trice32_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) Trice32fn_9(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8))                                                                   //!< Trice32_9 is a macro calling a function to reduce code size.
376
+#define Trice32_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) Trice32fn_10(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9))                                             //!< Trice32_10 is a macro calling a function to reduce code size.
377
+#define Trice32_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) Trice32fn_11(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10))                       //!< Trice32_11 is a macro calling a function to reduce code size.
378
+#define Trice32_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) Trice32fn_12(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10), (uint32_t)(v11)) //!< Trice32_12 is a macro calling a function to reduce code size.
379
+
380
+#define TRice32_0(tid, fmt) TRice32fn_0(tid)                                                                                                                                                                                                                                                       //!< TRice32_1 is a macro calling a function to reduce code size.
381
+#define TRice32_1(tid, fmt, v0) TRice32fn_1(tid, (uint32_t)(v0))                                                                                                                                                                                                                                   //!< TRice32_1 is a macro calling a function to reduce code size.
382
+#define TRice32_2(tid, fmt, v0, v1) TRice32fn_2(tid, (uint32_t)(v0), (uint32_t)(v1))                                                                                                                                                                                                               //!< TRice32_2 is a macro calling a function to reduce code size.
383
+#define TRice32_3(tid, fmt, v0, v1, v2) TRice32fn_3(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2))                                                                                                                                                                                           //!< TRice32_3 is a macro calling a function to reduce code size.
384
+#define TRice32_4(tid, fmt, v0, v1, v2, v3) TRice32fn_4(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3))                                                                                                                                                                       //!< TRice32_4 is a macro calling a function to reduce code size.
385
+#define TRice32_5(tid, fmt, v0, v1, v2, v3, v4) TRice32fn_5(tid, (uint32_t)v0, (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4))                                                                                                                                                     //!< TRice32_5 is a macro calling a function to reduce code size.
386
+#define TRice32_6(tid, fmt, v0, v1, v2, v3, v4, v5) TRice32fn_6(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5))                                                                                                                               //!< TRice32_6 is a macro calling a function to reduce code size.
387
+#define TRice32_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) TRice32fn_7(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6))                                                                                                           //!< TRice32_7 is a macro calling a function to reduce code size.
388
+#define TRice32_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) TRice32fn_8(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7))                                                                                       //!< TRice32_32_M is a macro calling a function to reduce code size.
389
+#define TRice32_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) TRice32fn_9(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8))                                                                   //!< TRice32_9 is a macro calling a function to reduce code size.
390
+#define TRice32_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) TRice32fn_10(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9))                                             //!< TRice32_10 is a macro calling a function to reduce code size.
391
+#define TRice32_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) TRice32fn_11(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10))                       //!< TRice32_11 is a macro calling a function to reduce code size.
392
+#define TRice32_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) TRice32fn_12(tid, (uint32_t)(v0), (uint32_t)(v1), (uint32_t)(v2), (uint32_t)(v3), (uint32_t)(v4), (uint32_t)(v5), (uint32_t)(v6), (uint32_t)(v7), (uint32_t)(v8), (uint32_t)(v9), (uint32_t)(v10), (uint32_t)(v11)) //!< TRice32_12 is a macro calling a function to reduce code size.
393
+
394
+#define trice64_0(tid, fmt) trice64fn_0(tid)                                                                                                                                                                                                                                                       //!< trice64_1 is a macro calling a function to reduce code size.
395
+#define trice64_1(tid, fmt, v0) trice64fn_1(tid, (uint64_t)(v0))                                                                                                                                                                                                                                   //!< trice64_1 is a macro calling a function to reduce code size.
396
+#define trice64_2(tid, fmt, v0, v1) trice64fn_2(tid, (uint64_t)(v0), (uint64_t)(v1))                                                                                                                                                                                                               //!< trice64_2 is a macro calling a function to reduce code size.
397
+#define trice64_3(tid, fmt, v0, v1, v2) trice64fn_3(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2))                                                                                                                                                                                           //!< trice64_3 is a macro calling a function to reduce code size.
398
+#define trice64_4(tid, fmt, v0, v1, v2, v3) trice64fn_4(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3))                                                                                                                                                                       //!< trice64_4 is a macro calling a function to reduce code size.
399
+#define trice64_5(tid, fmt, v0, v1, v2, v3, v4) trice64fn_5(tid, (uint64_t)v0, (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4))                                                                                                                                                     //!< trice64_5 is a macro calling a function to reduce code size.
400
+#define trice64_6(tid, fmt, v0, v1, v2, v3, v4, v5) trice64fn_6(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5))                                                                                                                               //!< trice64_6 is a macro calling a function to reduce code size.
401
+#define trice64_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) trice64fn_7(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6))                                                                                                           //!< trice64_7 is a macro calling a function to reduce code size.
402
+#define trice64_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) trice64fn_8(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7))                                                                                       //!< trice64_8 is a macro calling a function to reduce code size.
403
+#define trice64_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) trice64fn_9(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8))                                                                   //!< trice64_9 is a macro calling a function to reduce code size.
404
+#define trice64_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) trice64fn_10(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9))                                             //!< trice64_10 is a macro calling a function to reduce code size.
405
+#define trice64_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) trice64fn_11(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10))                       //!< trice64_11 is a macro calling a function to reduce code size.
406
+#define trice64_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) trice64fn_12(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10), (uint64_t)(v11)) //!< trice64_12 is a macro calling a function to reduce code size.
407
+
408
+#define Trice64_0(tid, fmt) Trice64fn_0(tid)                                                                                                                                                                                                                                                       //!< Trice64_0 is a macro calling a function to reduce code size.
409
+#define Trice64_1(tid, fmt, v0) Trice64fn_1(tid, (uint64_t)(v0))                                                                                                                                                                                                                                   //!< Trice64_1 is a macro calling a function to reduce code size.
410
+#define Trice64_2(tid, fmt, v0, v1) Trice64fn_2(tid, (uint64_t)(v0), (uint64_t)(v1))                                                                                                                                                                                                               //!< Trice64_2 is a macro calling a function to reduce code size.
411
+#define Trice64_3(tid, fmt, v0, v1, v2) Trice64fn_3(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2))                                                                                                                                                                                           //!< Trice64_3 is a macro calling a function to reduce code size.
412
+#define Trice64_4(tid, fmt, v0, v1, v2, v3) Trice64fn_4(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3))                                                                                                                                                                       //!< Trice64_4 is a macro calling a function to reduce code size.
413
+#define Trice64_5(tid, fmt, v0, v1, v2, v3, v4) Trice64fn_5(tid, (uint64_t)v0, (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4))                                                                                                                                                     //!< Trice64_5 is a macro calling a function to reduce code size.
414
+#define Trice64_6(tid, fmt, v0, v1, v2, v3, v4, v5) Trice64fn_6(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5))                                                                                                                               //!< Trice64_6 is a macro calling a function to reduce code size.
415
+#define Trice64_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) Trice64fn_7(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6))                                                                                                           //!< Trice64_7 is a macro calling a function to reduce code size.
416
+#define Trice64_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) Trice64fn_8(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7))                                                                                       //!< Trice64_8 is a macro calling a function to reduce code size.
417
+#define Trice64_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) Trice64fn_9(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8))                                                                   //!< Trice64_9 is a macro calling a function to reduce code size.
418
+#define Trice64_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) Trice64fn_10(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9))                                             //!< Trice64_10 is a macro calling a function to reduce code size.
419
+#define Trice64_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) Trice64fn_11(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10))                       //!< Trice64_11 is a macro calling a function to reduce code size.
420
+#define Trice64_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) Trice64fn_12(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10), (uint64_t)(v11)) //!< Trice64_12 is a macro calling a function to reduce code size.
421
+
422
+#define TRice64_0(tid, fmt) TRice64fn_0(tid)                                                                                                                                                                                                                                                       //!< TRice64_0 is a macro calling a function to reduce code size.
423
+#define TRice64_1(tid, fmt, v0) TRice64fn_1(tid, (uint64_t)(v0))                                                                                                                                                                                                                                   //!< TRice64_1 is a macro calling a function to reduce code size.
424
+#define TRice64_2(tid, fmt, v0, v1) TRice64fn_2(tid, (uint64_t)(v0), (uint64_t)(v1))                                                                                                                                                                                                               //!< TRice64_2 is a macro calling a function to reduce code size.
425
+#define TRice64_3(tid, fmt, v0, v1, v2) TRice64fn_3(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2))                                                                                                                                                                                           //!< TRice64_3 is a macro calling a function to reduce code size.
426
+#define TRice64_4(tid, fmt, v0, v1, v2, v3) TRice64fn_4(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3))                                                                                                                                                                       //!< TRice64_4 is a macro calling a function to reduce code size.
427
+#define TRice64_5(tid, fmt, v0, v1, v2, v3, v4) TRice64fn_5(tid, (uint64_t)v0, (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4))                                                                                                                                                     //!< TRice64_5 is a macro calling a function to reduce code size.
428
+#define TRice64_6(tid, fmt, v0, v1, v2, v3, v4, v5) TRice64fn_6(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5))                                                                                                                               //!< TRice64_6 is a macro calling a function to reduce code size.
429
+#define TRice64_7(tid, fmt, v0, v1, v2, v3, v4, v5, v6) TRice64fn_7(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6))                                                                                                           //!< TRice64_7 is a macro calling a function to reduce code size.
430
+#define TRice64_8(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7) TRice64fn_8(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7))                                                                                       //!< TRice64_64_M is a macro calling a function to reduce code size.
431
+#define TRice64_9(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8) TRice64fn_9(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8))                                                                   //!< TRice64_9 is a macro calling a function to reduce code size.
432
+#define TRice64_10(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) TRice64fn_10(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9))                                             //!< TRice64_10 is a macro calling a function to reduce code size.
433
+#define TRice64_11(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) TRice64fn_11(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10))                       //!< TRice64_11 is a macro calling a function to reduce code size.
434
+#define TRice64_12(tid, fmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) TRice64fn_12(tid, (uint64_t)(v0), (uint64_t)(v1), (uint64_t)(v2), (uint64_t)(v3), (uint64_t)(v4), (uint64_t)(v5), (uint64_t)(v6), (uint64_t)(v7), (uint64_t)(v8), (uint64_t)(v9), (uint64_t)(v10), (uint64_t)(v11)) //!< TRice64_12 is a macro calling a function to reduce code size.

+ 503
- 0
Middlewares/trice/triceRingBuffer.c Переглянути файл

@@ -0,0 +1,503 @@
1
+//! \file triceRingBuffer.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//!     //////////////////////////////////////////////////////////////////////////
4
+#include "cobs.h"
5
+#include "tcobs.h"
6
+#include "trice.h"
7
+
8
+#if TRICE_BUFFER == TRICE_RING_BUFFER && TRICE_OFF == 0
9
+
10
+    #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
11
+static void triceSingleDeferredOut(int *wordCount);
12
+    #else
13
+static void triceMultiDeferredOut(int *triceCount, int *wordCount);
14
+    #endif
15
+
16
+    #if TRICE_RING_BUFFER_OVERFLOW_WATCH == 1
17
+
18
+        #define TRICE_RING_BUFFER_LOWER_MARGIN 8 //!< 32-bit units just for debugging > 0
19
+        #define TRICE_RING_BUFFER_UPPER_MARGIN 8 //!< 32-bit units just for debugging > 0
20
+        #define TRICE_RING_BUFFER_MARGIN_FILL_VALUE 0xfee4deb
21
+
22
+    #else
23
+
24
+        #define TRICE_RING_BUFFER_LOWER_MARGIN 0 //!< 32-bit units just for debugging > 0
25
+        #define TRICE_RING_BUFFER_UPPER_MARGIN 0 //!< 32-bit units just for debugging > 0
26
+        #define TRICE_RING_BUFFER_FILL_VALUE 0
27
+
28
+    #endif
29
+
30
+//! triceRingBuffer is a kind of heap for trice messages. It needs to be initialized with 0.
31
+//! Initial:
32
+//! |<-LM->|<----------------  triceRingBuffer  ------------------------------------------------------->|<-UM->|
33
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<---------------- TRICE_RING_BUFFER_SIZE -------------------------->|<-UM->|
34
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<--        writable        -->|<-- TRICE_RING_BUFFER_MIN_SPACE32 -->|<-UM->|
35
+//!                                |                              |                                     ^--------- TriceRingBufferLimit
36
+//!                                |                              ^----------------------------------------------- TriceRingBufferProtectLimit
37
+//!                                ^------------------------------------------------------------------------------ TriceBufferWritePosition
38
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferReadPosition
39
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferStart
40
+//!
41
+//! After some writes:
42
+//! |<-LM->|<----------------  triceRingBuffer  ------------------------------------------------------->|<-UM->|
43
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<---------------- TRICE_RING_BUFFER_SIZE -------------------------->|<-UM->|
44
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<-T->|<-T->|<--  writable  -->|<-- TRICE_RING_BUFFER_MIN_SPACE32 -->|<-UM->|
45
+//!                                |           |                  |                                     ^--------- TriceRingBufferLimit
46
+//!                                |           |                  ^----------------------------------------------- TriceRingBufferProtectLimit
47
+//!                                |           ^------------------------------------------------------------------ TriceBufferWritePosition
48
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferReadPosition
49
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferStart
50
+//!
51
+//! After some reads:
52
+//! |<-LM->|<----------------  triceRingBuffer  ------------------------------------------------------->|<-UM->|
53
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<---------------- TRICE_RING_BUFFER_SIZE -------------------------->|<-UM->|
54
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<writable->|<--  writable  -->|<-- TRICE_RING_BUFFER_MIN_SPACE32 -->|<-UM->|
55
+//!                                |           |                  |                                     ^--------- TriceRingBufferLimit
56
+//!                                |           |                  ^----------------------------------------------- TriceRingBufferProtectLimit
57
+//!                                |           ^------------------------------------------------------------------ TriceBufferWritePosition
58
+//!                                |           ^-------------------------------------------------------------------TriceRingBufferReadPosition
59
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferStart
60
+//!
61
+//! After some time:
62
+//! |<-LM->|<----------------  triceRingBuffer  ------------------------------------------------------->|<-UM->|
63
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<---------------- TRICE_RING_BUFFER_SIZE -------------------------->|<-UM->|
64
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|                              |<-- TRICE_RING_BUFFER_MIN_SPACE32 -->|<-UM->|
65
+//!                                |                              |                                     ^--------- TriceRingBufferLimit
66
+//!                                |                              ^----------------------------------------------- TriceRingBufferProtectLimit
67
+//!                                |<-- writable -->|<-T->|<-T->|<-T->|<-------- not writable --------->|<-UM->|
68
+//!                                |                |                 ^------------------------------------------- TriceBufferWritePosition, no more TRICE_RING_BUFFER_MIN_SPACE32!
69
+//!                                |                ^------------------------------------------------------------- TriceRingBufferReadPosition
70
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferStart
71
+//! With next Trice, TriceBufferWritePosition has to wrap firstly:
72
+//! |<-LM->|<----------------  triceRingBuffer  ------------------------------------------------------->|<-UM->|
73
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|<---------------- TRICE_RING_BUFFER_SIZE -------------------------->|<-UM->|
74
+//! |<-LM->|<--TRICE_DATA_OFFSET-->|                              |<-- TRICE_RING_BUFFER_MIN_SPACE32 -->|<-UM->|
75
+//!                                |                              |                                     ^--------- TriceRingBufferLimit
76
+//!                                |                              ^----------------------------------------------- TriceRingBufferProtectLimit
77
+//!                                |<-- writable -->|<-T->|<-T->|<-T->|<-------- not writable --------->|<-UM->|   When depth32(==writable) < TRICE_RING_BUFFER_MIN_SPACE32, no write is possible.
78
+//!                                |                ^------------------------------------------------------------- TriceRingBufferReadPosition
79
+//!                                ^------------------------------------------------------------------------------ TriceBufferWritePosition (wrapped)
80
+//!                                ^------------------------------------------------------------------------------ TriceRingBufferStart
81
+uint32_t triceRingBuffer[TRICE_RING_BUFFER_LOWER_MARGIN +(TRICE_DATA_OFFSET >> 2)+(TRICE_RING_BUFFER_SIZE >> 2)+ TRICE_RING_BUFFER_UPPER_MARGIN] = {0};
82
+
83
+//! TRICE_RING_BUFFER_MIN_SPACE32 is the needed space before a new Trice is allowed to be written.
84
+//! The TRICE_DATA_OFFSET guaranties, that in front of TriceRingBufferReadPosition is always a scratch pad.
85
+    #define TRICE_RING_BUFFER_MIN_SPACE32 ((TRICE_SINGLE_MAX_SIZE + TRICE_DATA_OFFSET) >> 2)
86
+
87
+//! TRICE_RING_BUFFER_START is a helper definition to avoid warning "expression must have a constant value".
88
+    #define TRICE_RING_BUFFER_START (triceRingBuffer + TRICE_RING_BUFFER_LOWER_MARGIN + (TRICE_DATA_OFFSET >> 2))
89
+
90
+//! TriceRingBufferStart is an immutable pointer to the begin of the triceRingBuffer area.
91
+uint32_t *const TriceRingBufferStart = TRICE_RING_BUFFER_START;
92
+
93
+//! triceBufferWriteLimit is the first address behind triceRingBuffer area and immutable.
94
+//! With encryption it can happen that 4 bytes following TriceRingBufferLimit are used as scratch pad.
95
+//! We use the value of TRICE_DEFERRED_XTEA_ENCRYPT (0 or 1) here to respect that
96
+//! See also comment inside triceSingleDeferredOut.
97
+uint32_t *const TriceRingBufferLimit = TRICE_RING_BUFFER_START + (TRICE_RING_BUFFER_SIZE >> 2);
98
+
99
+//! TricesCountRingBuffer holds the readable trices count inside triceRingBuffer.
100
+unsigned TricesCountRingBuffer = 0;
101
+
102
+//! TriceBufferWritePosition is used by the TRICE_PUT macros.
103
+uint32_t *TriceBufferWritePosition = TRICE_RING_BUFFER_START;
104
+
105
+//! TriceRingBufferProtectLimit is the first address not allowed to be written to in any circumstances.
106
+//! If TriceBufferWritePosition >= TriceRingBufferProtectLimit, TriceBufferWritePosition needs to wrap.
107
+uint32_t *const TriceRingBufferProtectLimit = TRICE_RING_BUFFER_START + (TRICE_RING_BUFFER_SIZE >> 2) - TRICE_RING_BUFFER_MIN_SPACE32;
108
+
109
+//! TriceRingBufferReadPosition points to a valid trice message when singleTricesRingCount > 0.
110
+//! This is first the TRICE_DATA_OFFSET byte space followed by the trice data.
111
+//! Initially this value is set to TriceRingBufferStart minus TRICE_DATA_OFFSET byte space
112
+//! to get a correct value for the very first call of triceNextRingBufferRead
113
+//! uint32_t* TriceRingBufferReadPosition = TriceRingBufferStart - (TRICE_DATA_OFFSET>>2); //lint !e428 Warning 428: negative subscript (-4) in operator 'ptr-int'
114
+uint32_t *TriceRingBufferReadPosition = TRICE_RING_BUFFER_START;
115
+
116
+    #if TRICE_DIAGNOSTICS == 1
117
+
118
+//! TricesCountRingBufferMax holds the max count of trices occurred inside the ring buffer.
119
+//! This value is only informal, because the length of the trice messages is not known.
120
+//! unsigned TricesCountRingBufferMax = 0;
121
+
122
+//! TriceRingBufferDepthMax holds the max occurred ring buffer depth.
123
+int TriceRingBufferDepthMax = 0;
124
+
125
+    #endif // #if TRICE_DIAGNOSTICS == 1
126
+
127
+    #if TRICE_PROTECT == 1
128
+
129
+//! TriceEnoughSpace checks, if enough bytes available for the next trice.
130
+//! \retval 0, when not enough space
131
+//! \retval 1, when enough space
132
+int TriceEnoughSpace(void)
133
+{
134
+    // depth32 is the used buffer space in 32-bit words. After reset TriceBufferWritePosition and TriceRingBufferReadPosition are equal and depth32 is 0.
135
+    // After some trice data writing, TriceBufferWritePosition is > TriceRingBufferReadPosition and depth32 has a positive value.
136
+    // When trice data read out takes place, the TriceRingBufferReadPosition is incremented. That makes the depth32 value smaller again and gives write space.
137
+    // Before a new trice write operation, TriceBufferWritePosition is reset to TriceRingBufferStart if less than TRICE_SINGLE_MAX_SIZE bytes left to the TriceRingBufferLimit.
138
+    // So, even there is a only 4 bytes Trice, it cannot be written, when no full TRICE_SINGLE_MAX_SIZE space is left, because we do not know its size in advance.
139
+    // The TriceRingBufferReadPosition jumps in the same way as the TriceBufferWritePosition. It wraps according the same rules.
140
+
141
+    int depth32 = TriceBufferWritePosition - TriceRingBufferReadPosition;
142
+    if (depth32 == 0 && TricesCountRingBuffer > 0)
143
+    {
144
+        goto noSpace;
145
+    }
146
+    if (depth32 < 0)   // After a TriceBufferWritePosition reset the difference is negative and needs correction to get the correct value.
147
+    {
148
+        depth32 += (TRICE_RING_BUFFER_SIZE >> 2);
149
+    }
150
+    // This fn is called before an intended trice data write ande therefore additional at least TRICE_SINGLE_MAX_SIZE>>2 32-bit words need to fit in the buffer.
151
+    // There must be left TRICE_DATA_OFFSET space behind the last Trice to be usable as scratch pad in front of TriceRingBufferReadPosition.
152
+    if (depth32 <= (TRICE_RING_BUFFER_SIZE >> 2) - TRICE_RING_BUFFER_MIN_SPACE32)
153
+    {
154
+        return 1;
155
+    }
156
+    else
157
+    {
158
+    noSpace:
159
+#if TRICE_DIAGNOSTICS == 1
160
+        TriceDeferredOverflowCount++;
161
+#endif
162
+        return 0;
163
+    }
164
+}
165
+
166
+    #endif // #if TRICE_PROTECT == 1
167
+
168
+// triceIncrementRingBufferReadPosition sets TriceRingBufferReadPosition forward by wordCount.
169
+//! \param lastWordCount is the u32 count of the last read trice including padding bytes.
170
+TRICE_INLINE void triceIncrementRingBufferReadPosition(int wordCount)
171
+{
172
+    TriceRingBufferReadPosition += wordCount;
173
+    if (TriceRingBufferReadPosition > TriceRingBufferProtectLimit)
174
+    {
175
+        TriceRingBufferReadPosition = TriceRingBufferStart;
176
+    }
177
+}
178
+
179
+// triceRingBufferDiagnostics computes and tracks TriceRingBufferDepthMax
180
+TRICE_INLINE void triceRingBufferDiagnostics(void)
181
+{
182
+#if TRICE_DIAGNOSTICS == 1
183
+    int depth = (TriceBufferWritePosition - TriceRingBufferReadPosition) << 2; // lint !e845 Info 845: The left argument to operator '<<' is certain to be 0
184
+    if (depth < 0)
185
+    {
186
+        depth += TRICE_DEFERRED_BUFFER_SIZE;
187
+    }
188
+    TriceRingBufferDepthMax = (depth > TriceRingBufferDepthMax) ? depth : TriceRingBufferDepthMax;
189
+#endif // #if TRICE_DIAGNOSTICS == 1
190
+}
191
+
192
+    #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
193
+
194
+//! triceTransferSingleFraming transfers a single Trice from the Ring Buffer.
195
+//! Implicit assumed is, that the pre-condition "TricesCountRingBuffer > 0" is fulfilled.
196
+void triceTransferSingleFraming(void)
197
+{
198
+    triceRingBufferDiagnostics(); // We need to measure before the RingBufferReadPosition increment.
199
+
200
+    static int lastWordCount = 0; // lastWordCount is needed to increment TriceRingBufferReadPosition accordingly after transfer is done.
201
+    triceIncrementRingBufferReadPosition(lastWordCount);
202
+    lastWordCount = 0;
203
+
204
+    if (TricesCountRingBuffer == 0)   // no data
205
+    {
206
+        return;
207
+    }
208
+    TRICE_ENTER_CRITICAL_SECTION
209
+        TricesCountRingBuffer--; // We decrement, even the Trice is not out yet.
210
+    TRICE_LEAVE_CRITICAL_SECTION
211
+
212
+        // The trice data are starting at byte offset TRICE_DATA_OFFSET from TriceRingBufferReadPosition.
213
+        triceSingleDeferredOut(&lastWordCount);
214
+}
215
+
216
+    #endif // #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
217
+
218
+    #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
219
+
220
+//! triceTransferMultiFraming transfers several, but not necessarily all, Trices from the Ring Buffer.
221
+void triceTransferMultiFraming(void)
222
+{
223
+    triceRingBufferDiagnostics(); // We need to measure before the RingBufferReadPosition increment.
224
+
225
+    // The Ring Buffer can contain a fair amount of trices and we do not want them copy in a separate buffer for less RAM usage.
226
+    // Therefore we pack all Trices until the Ring Buffer end (where it wraps) together.
227
+    // We know here, that at least one Trice is inside the Ring Buffer.
228
+    static int triceCount = 0; // triceCount it the count of Trices from the last call.
229
+    TRICE_ENTER_CRITICAL_SECTION
230
+        // It is known here, that the previous transmission is finished and we can advance.
231
+        TricesCountRingBuffer -= triceCount;
232
+    TRICE_LEAVE_CRITICAL_SECTION
233
+        triceCount = 0;
234
+
235
+    static int multiWordCount = 0;                        // wordCount is the Ring Buffer space which is now free after the last transfer is finished.
236
+    triceIncrementRingBufferReadPosition(multiWordCount); // We can safely increment here, because we know, that the last transmission is done.
237
+    multiWordCount = 0;
238
+
239
+    triceMultiDeferredOut(&triceCount, &multiWordCount);
240
+    return;
241
+}
242
+
243
+    #endif // #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
244
+
245
+//! TriceTransfer needs to be called cyclically to read out the Ring Buffer.
246
+void TriceTransfer(void)
247
+{
248
+#if TRICE_CGO == 0             // In automated tests we assume last transmission is finished, so we do not test depth to be able to test multiple Trices in deferred mode.
249
+    if (TriceOutDepth() > 0)   // Last transmission not finished. todo: Write TriceOutDepth() as dummy for TRICE_CGO.
250
+    {
251
+        return;
252
+    }
253
+#endif
254
+#if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
255
+    triceTransferSingleFraming();
256
+#else
257
+    triceTransferMultiFraming();
258
+#endif
259
+}
260
+
261
+//! TriceIDAndBuffer evaluates a trice message and returns the ID for routing.
262
+//! \param pData is where the trice message starts.
263
+//! \param pWordCount is filled with the word count the trice data occupy from pData.
264
+//! \param ppTriceNetStart is filled with the trice net data start. That is maybe a 2 bytes offset from pData.
265
+//! \param pTriceNetLength is filled with the net trice length (without padding bytes), 0 on error.
266
+//! \retval is the triceID, a positive value on success or error information.
267
+static int TriceIDAndBuffer(const uint32_t *const pData, int *pWordCount, uint8_t **ppTriceNetStart, size_t *pTriceNetLength)
268
+{
269
+    uint16_t TID = TRICE_TTOHS(*(uint16_t *)pData); // type and id
270
+    int triceID = 0x3FFF & TID;
271
+    int triceType = TID >> 14; // 2 bits
272
+    unsigned offset;
273
+    size_t len;
274
+    uint8_t *pStart = (uint8_t *)pData;
275
+    switch (triceType)
276
+    {
277
+    case TRICE_TYPE_S0: // S0 = no stamp
278
+        offset = 0;
279
+        len = 4 + triceDataLen(pStart + 2); // tyId
280
+        break;
281
+    case TRICE_TYPE_S2:                     // S2 = 16-bit stamp
282
+        len = 6 + triceDataLen(pStart + 6); // tyId ts16
283
+        offset = 2;
284
+#if TRICE_DEFERRED_XTEA_ENCRYPT
285
+        // move trice to start at a uint32_t alignment border
286
+        memmove(pStart, pStart + 2, len); // https://stackoverflow.com/questions/1201319/what-is-the-difference-between-memmove-and-memcpy
287
+#else                                     // #if TRICE_DEFERRED_XTEA_ENCRYPT
288
+        // Like for UART transfer no uint32_t alignment is needed.
289
+        pStart += 2; // see Id(n) macro definition
290
+#endif                                    // #else // #if TRICE_DEFERRED_XTEA_ENCRYPT
291
+        break;
292
+    case TRICE_TYPE_S4: // S4 = 32-bit stamp
293
+        offset = 0;
294
+        len = 8 + triceDataLen(pStart + 6); // tyId ts32
295
+        break;
296
+    default: // impossible case (triceType has only 2 bits)
297
+             // fall thru
298
+    case TRICE_TYPE_X0:
299
+        TriceErrorCount++;
300
+        *ppTriceNetStart = pStart;
301
+        *pTriceNetLength = 0;
302
+        return -__LINE__; // extended trices not supported (yet)
303
+    }
304
+    // S16 case example:            triceSize  len   t-0-3   t-o
305
+    // 80id 80id 1616 00cc                8     6      3      6
306
+    // 80id 80id 1616 01cc dd            12     7      7     10
307
+    // 80id 80id 1616 02cc dd dd         12     8      7     10
308
+    // 80id 80id 1616 03cc dd dd dd      12     9      7     10
309
+    // 80id 80id 1616 04cc dd dd dd dd   12    10      7     10
310
+    *pWordCount = (len + offset + 3) >> 2;
311
+    *ppTriceNetStart = pStart;
312
+    *pTriceNetLength = len;
313
+    return triceID;
314
+}
315
+
316
+    #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
317
+
318
+//! triceSingleDeferredOut expects a single trice at TriceRingBufferReadPosition and returns the wordCount of this trice which includes 1-3 padding bytes.
319
+//! The space from TriceRingBufferReadPosition-TRICE_DATA_OFFSET to TriceRingBufferReadPosition is assumed to be usable as scratch pad.
320
+//! This function is specific to the ring buffer, because the wordCount value needs to be reconstructed.
321
+//! \retval The returned value tells how many words where used by the transmitted trice and is usable for the memory management. See RingBuffer for example.
322
+//! The returned value is typically (TRICE_DATA_OFFSET/4) plus 1 (4 bytes) to 3 (9-12 bytes) but could go up to ((TRICE_DATA_OFFSET/4)+(TRICE_BUFFER_SIZE/4)).
323
+//! Return values <= 0 signal an error.
324
+//! TriceRingBufferReadPosition points to the begin of a single trice.
325
+//! The data at TriceRingBufferReadPosition are getting destroyed, because buffer is used as scratch pad.
326
+static void triceSingleDeferredOut(int *wordCount)
327
+{
328
+    uint8_t *enc = ((uint8_t *)TriceRingBufferReadPosition) - TRICE_DATA_OFFSET; // TRICE_DATA_OFFSET bytes are usable in front of TriceRingBufferReadPosition.
329
+    uint8_t *pTriceNetStart;                                                    // Trice starts here. That is maybe a 2 bytes offset from TriceRingBufferReadPosition.
330
+    size_t triceNetLength;                                                      // Trice length without padding bytes.
331
+    int triceID = TriceIDAndBuffer(TriceRingBufferReadPosition, wordCount, &pTriceNetStart, &triceNetLength);
332
+    // We can let TRICE_DATA_OFFSET only in front of the ring buffer and pack the Trices without offset space.
333
+    // And if we allow as max depth only ring buffer size minus TRICE_DATA_OFFSET, we can use space in front of each Trice.
334
+
335
+#if (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
336
+#if TRICE_CONFIG_WARNINGS == 1
337
+#warning configuration: The Trice tool does not support encryption without COBS (or TCOBS) framing.
338
+#endif
339
+    size_t encLen = TriceEncode(TRICE_DEFERRED_XTEA_ENCRYPT, TRICE_DEFERRED_OUT_FRAMING, enc, pTriceNetStart, triceNetLength);
340
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1)
341
+    // comment: The following 2 steps could be done in an incremental way within one singe loop.
342
+    // Behind the trice brutto length (with padding bytes), 4 bytes needed as scratch pad when XTEA is active.
343
+    // After TriceIDAndBuffer pTriceNetStart could have a 2 bytes offset.
344
+    uint8_t *tmp = ((uint8_t *)TriceRingBufferReadPosition) - 4;
345
+    memmove(tmp, pTriceNetStart, triceNetLength);           // Make 4 bytes space for scratch pad beind Trice message.
346
+    size_t len8 = (triceNetLength + 7) & ~7;                // Only multiple of 8 are possible to encrypt, so we adjust len.
347
+    memset(tmp + triceNetLength, 0, len8 - triceNetLength); // clear padding space
348
+    XTEAEncrypt((uint32_t *)tmp, len8 >> 2);
349
+#if TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS
350
+    size_t encLen = (size_t)TCOBSEncode(enc, tmp, len8);
351
+#elif TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS
352
+    size_t encLen = COBSEncode(enc, tmp, len8);
353
+#else
354
+#error configuration
355
+#endif
356
+    enc[encLen++] = 0; // Add zero as package delimiter.
357
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS)
358
+    size_t len = (size_t)TCOBSEncode(enc, pTriceNetStart, triceNetLength);
359
+    enc[len++] = 0; // Add zero as package delimiter.
360
+    size_t encLen = len;
361
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)
362
+    size_t len = (size_t)COBSEncode(enc, pTriceNetStart, triceNetLength);
363
+    enc[len++] = 0; // Add zero as package delimiter.
364
+    size_t encLen = len;
365
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
366
+    enc = pTriceNetStart;
367
+    size_t encLen = triceNetLength;
368
+#else
369
+#error configuration: TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE for ring buffer not implemented yet
370
+#endif
371
+#if TRICE_DIAGNOSTICS == 1
372
+    // enc                 addr  pTriceNetStart           nextData
373
+    // ^-TRICE_DATA_OFFSET-^-0|2-^-triceNetLength+(0...3)-^
374
+    // ^-encLen->firstNotModifiedAddress
375
+    uint8_t *nextData = (uint8_t *)(((uintptr_t)(pTriceNetStart + triceNetLength + 3)) & ~3);
376
+    uint8_t *firstNotModifiedAddress = enc + encLen;
377
+    int distance = nextData - firstNotModifiedAddress;
378
+    int triceDataOffsetDepth = TRICE_DATA_OFFSET - distance; // distance could get > TRICE_DATA_OFFSET, so TriceDataOffsetDepthMax stays unchanged then.
379
+    TriceDataOffsetDepthMax = triceDataOffsetDepth < TriceDataOffsetDepthMax ? TriceDataOffsetDepthMax : triceDataOffsetDepth;
380
+#endif // #if TRICE_DIAGNOSTICS == 1
381
+    TriceNonBlockingDeferredWrite8(triceID, enc, encLen);
382
+}
383
+
384
+    #endif // #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_SINGLE_PACK_MODE
385
+
386
+    #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
387
+
388
+// triceMultiDeferredOut packs Trices until the Ring Buffer end and returns their count and total length in words.
389
+// These 2 values are used later, after the transmission is finished, for advancing.
390
+// The value TricesCountRingBuffer is evaluated internally but not modified.
391
+static void triceMultiDeferredOut(int *triceCount, int *multiWordCount)
392
+{
393
+    *triceCount = 0;
394
+    *multiWordCount = 0;
395
+    if (TricesCountRingBuffer == 0)
396
+    {
397
+        return; // Nothing to do.
398
+    }
399
+    // At least one Trice message is ready for transfer.
400
+    if (TriceRingBufferReadPosition > TriceRingBufferLimit - TRICE_RING_BUFFER_MIN_SPACE32)
401
+    {
402
+        for (;;)
403
+        ;     // unexpected
404
+    }
405
+
406
+    // We can start at TriceRingBufferReadPosition and go to the TriceRingBufferLimit OR go to the TriceBufferWritePosition using TricesCountRingBuffer.
407
+    uint8_t *enc = ((uint8_t *)TriceRingBufferReadPosition) - TRICE_DATA_OFFSET; // TRICE_DATA_OFFSET bytes are usable in front of TriceRingBufferReadPosition.
408
+    uint8_t *tmp = enc + TRICE_DATA_OFFSET / 2;                                 // todo
409
+    uint8_t *nextEnc = tmp;
410
+    int multiLen = 0;
411
+    uint32_t *nextTriceRingBufferReadPosition = TriceRingBufferReadPosition;
412
+    do
413
+    {
414
+        int wordCount = 0;
415
+        uint8_t *pTriceNetStart; // Trice starts here.
416
+        size_t triceNetLength;   // Trice length without padding bytes.
417
+        TriceIDAndBuffer(nextTriceRingBufferReadPosition, &wordCount, &pTriceNetStart, &triceNetLength);
418
+        memmove(nextEnc, pTriceNetStart, triceNetLength);
419
+        nextEnc += triceNetLength;
420
+        multiLen += triceNetLength;
421
+        *multiWordCount += wordCount;
422
+        (*triceCount)++;
423
+        nextTriceRingBufferReadPosition += wordCount;
424
+
425
+    } while (*triceCount < TricesCountRingBuffer && nextTriceRingBufferReadPosition <= TriceRingBufferLimit - TRICE_RING_BUFFER_MIN_SPACE32);
426
+
427
+#if (TRICE_DEFERRED_XTEA_ENCRYPT == 1) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
428
+#if TRICE_CONFIG_WARNINGS == 1
429
+#warning configuration: The Trice tool does not support encryption without COBS (or TCOBS) framing.
430
+#endif
431
+    size_t encLen = TriceEncode(TRICE_DEFERRED_XTEA_ENCRYPT, TRICE_DEFERRED_OUT_FRAMING, enc, enc, multiLen);
432
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 1)
433
+    size_t len8 = (multiLen + 7) & ~7;          // Only multiple of 8 are possible to encrypt, so we adjust len.
434
+    memset(tmp + multiLen, 0, len8 - multiLen); // clear padding space
435
+    XTEAEncrypt((uint32_t *)tmp, len8 >> 2);
436
+#if TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS
437
+    size_t encLen = (size_t)TCOBSEncode(enc, tmp, len8);
438
+    enc[encLen++] = 0;
439
+#elif TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS
440
+    size_t encLen = (size_t)COBSEncode(enc, tmp, len8);
441
+    enc[encLen++] = 0;
442
+#else
443
+#error configuration
444
+#endif
445
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_TCOBS)
446
+    size_t len = (size_t)TCOBSEncode(enc, tmp, multiLen);
447
+    enc[len++] = 0; // Add zero as package delimiter.
448
+    size_t encLen = len;
449
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_COBS)
450
+    size_t len = (size_t)COBSEncode(enc, tmp, multiLen);
451
+    enc[len++] = 0; // Add zero as package delimiter.
452
+    size_t encLen = len;
453
+#elif (TRICE_DEFERRED_XTEA_ENCRYPT == 0) && (TRICE_DEFERRED_OUT_FRAMING == TRICE_FRAMING_NONE)
454
+    size_t encLen = multiLen;
455
+#else
456
+#error configuration: TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE for ring buffer not implemented yet
457
+#endif
458
+#if TRICE_DIAGNOSTICS == 1
459
+    // todo ...
460
+#endif // #if TRICE_DIAGNOSTICS == 1
461
+    TriceNonBlockingDeferredWrite8(0, enc, encLen);
462
+}
463
+
464
+    #endif // #if TRICE_DEFERRED_TRANSFER_MODE == TRICE_MULTI_PACK_MODE
465
+
466
+    #if TRICE_RING_BUFFER_OVERFLOW_WATCH == 1
467
+
468
+void TriceInitRingBufferMargins(void)
469
+{
470
+    for (int i = 0; i < TRICE_RING_BUFFER_LOWER_MARGIN; i++)
471
+    {
472
+        triceRingBuffer[i] = TRICE_RING_BUFFER_MARGIN_FILL_VALUE;
473
+    }
474
+    for (int i = 0; i < TRICE_RING_BUFFER_UPPER_MARGIN; i++)
475
+    {
476
+        *(TriceRingBufferLimit + i) = TRICE_RING_BUFFER_MARGIN_FILL_VALUE;
477
+    }
478
+}
479
+
480
+void WatchRingBufferMargins(void)
481
+{
482
+    for (int i = 0; i < TRICE_RING_BUFFER_LOWER_MARGIN; i++)
483
+    {
484
+        if (triceRingBuffer[i] != TRICE_RING_BUFFER_MARGIN_FILL_VALUE)
485
+        {
486
+            for (;;)
487
+            ;
488
+        }
489
+    }
490
+
491
+    for (int i = 0; i < TRICE_RING_BUFFER_UPPER_MARGIN; i++)
492
+    {
493
+        if (*(TriceRingBufferLimit + i) != TRICE_RING_BUFFER_MARGIN_FILL_VALUE)
494
+        {
495
+            for (;;)
496
+            ;
497
+        }
498
+    }
499
+}
500
+
501
+    #endif // #if TRICE_RING_BUFFER_OVERFLOW_WATCH == 1
502
+
503
+#endif // #if TRICE_BUFFER == TRICE_RING_BUFFER && TRICE_OFF == 0

+ 12
- 0
Middlewares/trice/triceStackBuffer.c Переглянути файл

@@ -0,0 +1,12 @@
1
+//! \file triceStackBuffer.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//!     //////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+#if TRICE_BUFFER == TRICE_STACK_BUFFER && TRICE_OFF == 0
7
+
8
+void TriceTransfer(void)
9
+{
10
+}
11
+
12
+#endif // #if TRICE_BUFFER == TRICE_STACK_BUFFER && TRICE_OFF == 0

+ 16
- 0
Middlewares/trice/triceStaticBuffer.c Переглянути файл

@@ -0,0 +1,16 @@
1
+//! \file triceStaticBuffer.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//! //////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+
6
+#if TRICE_BUFFER == TRICE_STATIC_BUFFER && TRICE_OFF == 0
7
+
8
+//! triceSingleBuffer holds a single trice during direct trice macro execution.
9
+uint32_t triceSingleBuffer[TRICE_BUFFER_SIZE >> 2];
10
+
11
+//! triceSingleBufferStartWritePosition points to trice data start.
12
+uint32_t* const triceSingleBufferStartWritePosition = &triceSingleBuffer[TRICE_DATA_OFFSET >> 2];
13
+
14
+void TriceTransfer(void) {}
15
+
16
+#endif // #if TRICE_BUFFER == TRICE_STATIC_BUFFER && TRICE_OFF == 0

+ 148
- 0
Middlewares/trice/triceUart.c Переглянути файл

@@ -0,0 +1,148 @@
1
+//! \file triceUart.c
2
+//! \author Thomas.Hoehenleitner [at] seerose.net
3
+//!     //////////////////////////////////////////////////////////////////////////
4
+#include "trice.h"
5
+#include <stdint.h>
6
+#include <stdlib.h>
7
+
8
+#if TRICE_DEFERRED_UARTA == 1 && TRICE_OFF == 0
9
+
10
+    #include "triceUart.h" // User has to provide this hardeware specific file, see examples folders.
11
+
12
+//! triceOutBufferUartA points into the double or ring buffer to the next (encoded) trice package.
13
+static const uint8_t *triceOutBufferUartA;
14
+
15
+//! triceOutCountUartA is the not yet transmitted byte count after a TriceNonBlockingWriteUartA() call.
16
+static size_t triceOutCountUartA = 0;
17
+
18
+//! triceOutIndexUartA is the triceOutBufferUartA offset to the next to transmit byte.
19
+static unsigned triceOutIndexUartA = 0;
20
+
21
+//! TriceNonBlockingWriteUartA registers a buffer for TRICE_UARTA transmission.
22
+//! \param buf is byte buffer start.
23
+//! \param nByte is the number of bytes to transfer
24
+void TriceNonBlockingWriteUartA(const void *buf, size_t nByte)
25
+{
26
+#if TRICE_CGO == 1 // automated tests
27
+    TriceWriteDeviceCgo(buf, nByte);
28
+#else // #if TRICE_CGO == 1// automated tests
29
+    TRICE_ENTER_CRITICAL_SECTION
30
+#if 1
31
+        triceOutBufferUartA = buf;
32
+#else
33
+    static uint8_t t[TRICE_DEFERRED_BUFFER_SIZE / 2]; // todo: find a better solution to avoid RAM wasting
34
+    memcpy(t, buf, nByte);
35
+    triceOutBufferUartA = t;
36
+#endif
37
+    triceOutIndexUartA = 0;
38
+    triceOutCountUartA = nByte;
39
+    triceEnableTxEmptyInterruptUartA(); // triceTriggerTransmitUartA();
40
+    TRICE_LEAVE_CRITICAL_SECTION
41
+#endif // #else // #if TRICE_CGO == 1// automated tests
42
+}
43
+
44
+//! TriceOutDepthUartA returns the amount of bytes not written yet to UARTB.
45
+unsigned TriceOutDepthUartA(void)
46
+{
47
+    unsigned depth;
48
+    TRICE_ENTER_CRITICAL_SECTION
49
+        depth = triceOutCountUartA - triceOutIndexUartA;
50
+    TRICE_LEAVE_CRITICAL_SECTION
51
+    return depth;
52
+}
53
+
54
+//! triceNextUint8UartA returns the next trice byte for transmission to TRICE_UARTA.
55
+TRICE_INLINE uint8_t triceNextUint8UartA(void)
56
+{
57
+    uint8_t c;
58
+    TRICE_ENTER_CRITICAL_SECTION
59
+        c = triceOutBufferUartA[triceOutIndexUartA++];
60
+    TRICE_LEAVE_CRITICAL_SECTION
61
+    return c;
62
+}
63
+
64
+//! triceServeTransmitUartA must be called cyclically to proceed ongoing write out.
65
+//! A good place is UARTA ISR.
66
+void triceServeTransmitUartA(void)
67
+{
68
+    TRICE_ENTER_CRITICAL_SECTION
69
+        triceTransmitData8UartA(triceNextUint8UartA());
70
+    if (0 == TriceOutDepthUartA())   // no more bytes
71
+    {
72
+        triceDisableTxEmptyInterruptUartA();
73
+    }
74
+    TRICE_LEAVE_CRITICAL_SECTION
75
+}
76
+
77
+//  // triceTriggerTransmitUartA must be called cyclically to initialize write out.
78
+//  void triceTriggerTransmitUartA(void){
79
+//      if( TriceOutDepthUartA() && triceTxDataRegisterEmptyUartA() ){
80
+//          triceEnableTxEmptyInterruptUartA(); // next bytes
81
+//      }
82
+//  }
83
+
84
+#endif // #if TRICE_DEFERRED_UARTA == 1
85
+
86
+#if TRICE_DEFERRED_UARTB == 1
87
+
88
+    #include "triceUart.h" // User has to provide this hardeware specific file, see examples folders.
89
+
90
+//! triceOutBufferUartB holds the uart out buffer address.
91
+static const uint8_t *triceOutBufferUartB;
92
+
93
+//! triceOutCountUartB holds th uarts out buffer size.
94
+static size_t triceOutCountUartB = 0;
95
+
96
+//! triceOutIndexUartB is the next to transmit byte index.
97
+static unsigned triceOutIndexUartB = 0;
98
+
99
+//! TriceNonBlockingWriteUartB registers a buffer for TRICE_UARTB transmission.
100
+//! \param buf is byte buffer start.
101
+//! \param nByte is the number of bytes to transfer
102
+void TriceNonBlockingWriteUartB(const void *buf, size_t nByte)
103
+{
104
+#if TRICE_CGO == 1 // automated tests
105
+    TriceWriteDeviceCgo(buf, nByte);
106
+#else  // #if TRICE_CGO == 1// automated tests
107
+    triceOutBufferUartB = buf;
108
+    triceOutIndexUartB = 0;
109
+    triceOutCountUartB = nByte;
110
+    triceTriggerTransmitUartB();
111
+#endif // #else // #if TRICE_CGO == 1// automated tests
112
+}
113
+
114
+//! TriceOutDepthUartB returns the amount of bytes not written yet to UARTB.
115
+unsigned TriceOutDepthUartB(void)
116
+{
117
+    // unsigned depthRtt0 = 0; -> assuming RTT is fast enough
118
+    unsigned depth = triceOutCountUartB - triceOutIndexUartB;
119
+    return depth;
120
+}
121
+
122
+//! triceNextUint8UartB returns the next trice byte for transmission to TRICE_UARTA.
123
+TRICE_INLINE uint8_t triceNextUint8UartB(void)
124
+{
125
+    return triceOutBufferUartB[triceOutIndexUartB++];
126
+}
127
+
128
+//! triceServeTransmitUartB must be called cyclically to proceed ongoing write out.
129
+//! A good place is UARTA ISR.
130
+void triceServeTransmitUartB(void)
131
+{
132
+    triceTransmitData8UartB(triceNextUint8UartB());
133
+    if (0 == TriceOutDepthUartB())   // no more bytes
134
+    {
135
+        triceDisableTxEmptyInterruptUartB();
136
+    }
137
+}
138
+
139
+// triceTriggerTransmitUartB must be called cyclically to initialize write out.
140
+void triceTriggerTransmitUartB(void)
141
+{
142
+    if (TriceOutDepthUartB() && triceTxDataRegisterEmptyUartB())
143
+    {
144
+        triceEnableTxEmptyInterruptUartB(); // next bytes
145
+    }
146
+}
147
+
148
+#endif // #if TRICE_DEFERRED_UARTB == 1 && TRICE_OFF == 0

+ 89
- 0
Middlewares/trice/xtea.c Переглянути файл

@@ -0,0 +1,89 @@
1
+/*! \file xtea.c
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#include "xtea.h"
6
+#include "trice.h"
7
+
8
+#if ((TRICE_DIRECT_XTEA_ENCRYPT == 1) || (TRICE_DEFERRED_XTEA_ENCRYPT == 1)) && TRICE_OFF == 0
9
+
10
+//! golang XTEA works with 64 rounds
11
+static const unsigned int numRounds = 64;
12
+
13
+//! 128 bit static key
14
+static const uint32_t k[4] = XTEA_ENCRYPT_KEY;
15
+
16
+//! internal constant
17
+static const uint32_t delta = 0x9E3779B9;
18
+
19
+//! precomputed values for faster execution
20
+static uint32_t table[64];
21
+
22
+//! XTEAInitTable precalculates the table.
23
+//! It is possible to put this table completely into FLASH by precomputing it during compile time.
24
+void XTEAInitTable(void) {
25
+	uint32_t sum = 0;
26
+	unsigned i;
27
+	// Two rounds of XTEA applied per loop
28
+	for (i = 0; i < numRounds;) {
29
+		table[i] = sum + k[sum & 3];
30
+		i++;
31
+		sum += delta;
32
+		table[i] = sum + k[(sum >> 11) & 3]; // lint !e661 Warning 661: Possible access of out-of-bounds pointer (1 beyond end of data) by operator '['
33
+		i++;
34
+	}
35
+}
36
+
37
+// encipher converts 64 bits.
38
+//! Code taken and adapted from xtea\block.go
39
+//!\param v 64 bits of data in v[0] and v[1] are encoded in place
40
+static void encipher(uint32_t v[2]) {
41
+	uint32_t v0 = v[0], v1 = v[1];
42
+	unsigned i;
43
+	for (i = 0; i < numRounds;) {
44
+		v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ table[i];
45
+		i++;
46
+		v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ table[i]; // lint !e661 Warning 661: Possible access of out-of-bounds pointer (1 beyond end of data) by operator '['
47
+		i++;
48
+	}
49
+	v[0] = v0;
50
+	v[1] = v1;
51
+}
52
+
53
+#if XTEA_DECRYPT == 1
54
+//! decipher reverses encipher action.
55
+//! Code taken and adapted from xtea\block.go
56
+//!\param v 64 bits of data in v[0] and v[1] are decoded in place
57
+static void decipher(uint32_t v[2]) {
58
+	uint32_t v0 = v[0], v1 = v[1];
59
+	for (int i = numRounds; i > 0;) {
60
+		i--;
61
+		v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ table[i];
62
+		i--;
63
+		v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ table[i];
64
+	}
65
+	v[0] = v0;
66
+	v[1] = v1;
67
+}
68
+
69
+//! XTEADecrypt re-converts from xtea cipher.
70
+//! \param p pointer to 8 byte buffer
71
+//! count is expected to be an even number.
72
+void XTEADecrypt(uint32_t* p, unsigned count) {
73
+	for (int i = 0; i < count; i += 2) {
74
+		decipher(&p[i]); // byte swapping is done inside receiver according to endianness.
75
+	}
76
+}
77
+#endif // #if XTEA_DECRYPT == 1
78
+
79
+//! XTEAEncrypt converts to xtea cipher.
80
+//! \param p pointer to 8 byte buffer.
81
+//! count is expected to be an even number.
82
+void XTEAEncrypt(uint32_t* p, unsigned count) {
83
+	unsigned i;
84
+	for (i = 0; i < count; i += 2) {
85
+		encipher(&p[i]); // byte swap is done inside receiver
86
+	}
87
+}
88
+
89
+#endif // #if ((TRICE_DIRECT_XTEA_ENCRYPT == 1) || (TRICE_DEFERRED_XTEA_ENCRYPT == 1)) && TRICE_OFF == 0

+ 33
- 0
Middlewares/trice/xtea.h Переглянути файл

@@ -0,0 +1,33 @@
1
+/*! \file xtea.h
2
+\author Thomas.Hoehenleitner [at] seerose.net
3
+*******************************************************************************/
4
+
5
+#ifndef TRICE_XTEA_H_
6
+#define TRICE_XTEA_H_
7
+
8
+#ifdef __cplusplus
9
+extern "C" {
10
+#endif
11
+
12
+#include <stdint.h> //lint !e537 !e451  Warning 537: Repeated include file,  Warning 451: Header file repeatedly included but does not have a standard
13
+
14
+void XTEAInitTable(void);
15
+void XTEADecrypt(uint32_t* p, unsigned count);
16
+void XTEAEncrypt(uint32_t* p, unsigned count);
17
+
18
+//! little endian! change byte order for big endian machines
19
+#define XTEA_KEY(b00, b01, b02, b03, \
20
+                 b10, b11, b12, b13, \
21
+                 b20, b21, b22, b23, \
22
+                 b30, b31, b32, b33) \
23
+	{                                \
24
+	    0x##b00##b01##b02##b03,      \
25
+	    0x##b10##b11##b12##b13,      \
26
+	    0x##b20##b21##b22##b23,      \
27
+	    0x##b30##b31##b32##b33}
28
+
29
+#ifdef __cplusplus
30
+}
31
+#endif
32
+
33
+#endif // TRICE_XTEA_H_

Завантаження…
Відмінити
Зберегти