diff options
author | jaseg <git@jaseg.net> | 2020-10-14 12:49:08 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2020-10-14 12:49:08 +0200 |
commit | 3559d845d29272050d4d44e18e0bb84e676e48ff (patch) | |
tree | d8d6ce99e40b1a3745d76f0c9aac2f10e7286481 /fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h | |
parent | 491b2acaaa9db1798445f3e174e68ada7424fc33 (diff) | |
parent | 6ab94e0b318884bbcb95e2ea3835f951502e1d99 (diff) | |
download | minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.gz minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.bz2 minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.zip |
Merge firmware and pcb repos
Diffstat (limited to 'fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h')
-rw-r--r-- | fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h b/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h new file mode 100644 index 0000000..2b005b6 --- /dev/null +++ b/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_pf.h @@ -0,0 +1,85 @@ +#ifndef _JTEST_PF_H_
+#define _JTEST_PF_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Purpose */
+/*--------------------------------------------------------------------------------*/
+/* jtest_pf.h Contains macros useful for capturing pass/fail data. */
+
+
+/*--------------------------------------------------------------------------------*/
+/* Macros and Defines */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * Members that can be added to other structs to extend them pass/fail data and
+ * corresponding functionality.
+ */
+#define JTEST_PF_MEMBERS \
+ uint32_t passed; \
+ uint32_t failed /* Note the lacking semicolon*/ \
+
+/**
+ * Used for initializing JTEST_PF_MEMBERS in a struct declaration.
+ */
+#define JTEST_PF_MEMBER_INIT \
+ 0, \
+ 0
+
+/* Member-Incrementing Macros */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * Dispatch macro for incrementing #JTEST_PF_MEMBERS.
+ *
+ * @param xxx Values: 'passed', 'failed'
+ */
+#define JTEST_PF_INC_XXX(xxx, struct_pf_ptr, amount) \
+ do \
+ { \
+ ((struct_pf_ptr)->xxx) += (amount); \
+ } while (0)
+
+/**
+ * Specialization of the #JTEST_PF_INC_XXX macro to increment the passed
+ * member.
+ */
+#define JTEST_PF_INC_PASSED(struct_pf_ptr, amount) \
+ JTEST_PF_INC_XXX(passed, struct_pf_ptr, amount)
+
+
+/**
+ * Specialization of the #JTEST_PF_INC_XXX macro to increment the failed
+ * member.
+ */
+#define JTEST_PF_INC_FAILED(struct_pf_ptr, amount) \
+ JTEST_PF_INC_XXX(failed, struct_pf_ptr, amount)
+
+
+/* Member-Resetting Macros */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * Dispatch macro for setting #JTEST_PF_MEMBERS to zero.
+ *
+ * @param xxx Values: 'passed', 'failed'
+ */
+#define JTEST_PF_RESET_XXX(xxx, struct_pf_ptr) \
+ do \
+ { \
+ ((struct_pf_ptr)->xxx) = UINT32_C(0); \
+ } while (0)
+
+/**
+ * Specialization of #JTEST_PF_RESET_XXX for the 'passed' member.
+ */
+#define JTEST_PF_RESET_PASSED(struct_pf_ptr) \
+ JTEST_PF_RESET_XXX(passed, struct_pf_ptr)
+
+/**
+ * Specialization of #JTEST_PF_RESET_XXX for the 'failed' member.
+ */
+#define JTEST_PF_RESET_FAILED(struct_pf_ptr) \
+ JTEST_PF_RESET_XXX(failed, struct_pf_ptr)
+
+#endif /* _JTEST_PF_H_ */
|