diff options
author | JanHenrik <janhenrik@janhenrik.org> | 2020-01-19 00:56:37 +0100 |
---|---|---|
committer | JanHenrik <janhenrik@janhenrik.org> | 2020-01-19 00:56:37 +0100 |
commit | a81fc41c3eb99e8fc52aa734ee63e13c937aab81 (patch) | |
tree | 19974c4676ed64d6e4260b79fc3f1eaeda58a289 /Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c | |
parent | a96ec5d9995e7e4b7315a192e543b88f0aff4930 (diff) | |
download | minikbd-a81fc41c3eb99e8fc52aa734ee63e13c937aab81.tar.gz minikbd-a81fc41c3eb99e8fc52aa734ee63e13c937aab81.tar.bz2 minikbd-a81fc41c3eb99e8fc52aa734ee63e13c937aab81.zip |
added blink example
Diffstat (limited to 'Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c')
-rw-r--r-- | Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c new file mode 100644 index 0000000..c3a9bf8 --- /dev/null +++ b/Blink/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c @@ -0,0 +1,36 @@ +#include "jtest_fw.h"
+
+/**
+ * Dump the JTEST_FW.str_buffer the Keil framework in pieces.
+ *
+ * The JTEST_FW.str_buffer contains more characters than the Keil framework can
+ * dump at once. This function dumps them in blocks.
+ */
+void jtest_dump_str_segments(void)
+{
+ uint32_t seg_idx = 0;
+ uint32_t memmove_idx = 0;
+ uint32_t seg_cnt =
+ (strlen(JTEST_FW.str_buffer) / JTEST_STR_MAX_OUTPUT_SIZE) + 1;
+
+ for( seg_idx = 0; seg_idx < seg_cnt; ++seg_idx)
+ {
+ JTEST_TRIGGER_ACTION(dump_str);
+
+ if (seg_idx < JTEST_STR_MAX_OUTPUT_SEGMENTS)
+ {
+ memmove_idx = 0;
+ while (memmove_idx < (seg_cnt - seg_idx -1) )
+ {
+ memmove(
+ JTEST_FW.str_buffer+
+ (memmove_idx* JTEST_STR_MAX_OUTPUT_SIZE),
+ JTEST_FW.str_buffer+
+ ((memmove_idx+1)*JTEST_STR_MAX_OUTPUT_SIZE),
+ JTEST_BUF_SIZE);
+ ++memmove_idx;
+ }
+ }
+ }
+ return;
+}
|