diff options
author | JanHenrik <janhenrik@janhenrik.org> | 2020-04-01 00:40:03 +0200 |
---|---|---|
committer | JanHenrik <janhenrik@janhenrik.org> | 2020-04-01 00:40:03 +0200 |
commit | f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126 (patch) | |
tree | 78465e38a01011dc9f17eb73416011310532017f /midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c | |
parent | 3ec13d81e70e52246545c720abe756ccf09fb231 (diff) | |
download | minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.tar.gz minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.tar.bz2 minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.zip |
added files
Diffstat (limited to 'midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c')
-rw-r--r-- | midi-dials/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/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c b/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c new file mode 100644 index 0000000..c3a9bf8 --- /dev/null +++ b/midi-dials/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;
+}
|