Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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