summaryrefslogtreecommitdiff
path: root/DSP/DSP_Lib_TestSuite/Common/JTest/src
diff options
context:
space:
mode:
authorAli Labbene <ali.labbene@st.com>2019-12-11 08:59:21 +0100
committerAli Labbene <ali.labbene@st.com>2019-12-16 16:35:24 +0100
commit9f95ff5b6ba01db09552b84a0ab79607060a2666 (patch)
tree8a6e0dda832555c692307869aed49d07ee7facfe /DSP/DSP_Lib_TestSuite/Common/JTest/src
parent76177aa280494bb36d7a0bcbda1078d4db717020 (diff)
downloadst-cmsis-core-lowfat-9f95ff5b6ba01db09552b84a0ab79607060a2666.tar.gz
st-cmsis-core-lowfat-9f95ff5b6ba01db09552b84a0ab79607060a2666.tar.bz2
st-cmsis-core-lowfat-9f95ff5b6ba01db09552b84a0ab79607060a2666.zip
Official ARM version: v5.4.0
Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3
Diffstat (limited to 'DSP/DSP_Lib_TestSuite/Common/JTest/src')
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_cycle.c9
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c36
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_fw.c9
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_trigger_action.c37
4 files changed, 91 insertions, 0 deletions
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_cycle.c b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_cycle.c
new file mode 100644
index 0000000..d58518b
--- /dev/null
+++ b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_cycle.c
@@ -0,0 +1,9 @@
+#include "../inc/jtest_cycle.h"
+#include <inttypes.h>
+
+/*--------------------------------------------------------------------------------*/
+/* Define Module Variables */
+/*--------------------------------------------------------------------------------*/
+
+/* const char * JTEST_CYCLE_STRF = "Running: %s\nCycles: %" PRIu32 "\n"; */
+const char * JTEST_CYCLE_STRF = "Cycles: %" PRIu32 "\n"; /* function name + parameter string skipped */
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_dump_str_segments.c
new file mode 100644
index 0000000..b546746
--- /dev/null
+++ b/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;
+}
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_fw.c b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_fw.c
new file mode 100644
index 0000000..9d4a583
--- /dev/null
+++ b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_fw.c
@@ -0,0 +1,9 @@
+#include "../inc/jtest.h"
+
+/*--------------------------------------------------------------------------------*/
+/* Define Global Variables */
+/*--------------------------------------------------------------------------------*/
+
+char JTEST_FW_STR_BUFFER[JTEST_BUF_SIZE] = {0};
+
+volatile JTEST_FW_t JTEST_FW = {0};
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_trigger_action.c b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_trigger_action.c
new file mode 100644
index 0000000..ca9e43c
--- /dev/null
+++ b/DSP/DSP_Lib_TestSuite/Common/JTest/src/jtest_trigger_action.c
@@ -0,0 +1,37 @@
+
+#include "jtest_fw.h"
+
+void test_start (void) {
+// ;
+ JTEST_FW.test_start++;
+}
+
+void test_end (void) {
+// ;
+ JTEST_FW.test_end++;
+}
+
+void group_start (void) {
+// ;
+ JTEST_FW.group_start++;
+}
+
+void group_end (void) {
+// ;
+ JTEST_FW.group_end++;
+}
+
+void dump_str (void) {
+// ;
+ JTEST_FW.dump_str++;
+}
+
+void dump_data (void) {
+// ;
+ JTEST_FW.dump_data++;
+}
+
+void exit_fw (void) {
+// ;
+ JTEST_FW.exit_fw++;
+}