diff options
Diffstat (limited to 'DSP/DSP_Lib_TestSuite/Common/JTest/inc')
-rw-r--r-- | DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h | 16 | ||||
-rw-r--r-- | DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h | 29 | ||||
-rw-r--r-- | DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h | 25 |
3 files changed, 57 insertions, 13 deletions
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h index d1b4db5..ed09f95 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h @@ -43,6 +43,8 @@ extern const char * JTEST_CYCLE_STRF; __jtest_cycle_end_count)); \ } while (0) */ +#ifndef ARMv7A + #define JTEST_COUNT_CYCLES(fn_call) \ do \ { \ @@ -56,10 +58,22 @@ extern const char * JTEST_CYCLE_STRF; __jtest_cycle_end_count = \ JTEST_SYSTICK_VALUE(SysTick); \ \ - JTEST_SYSTICK_RESET(SysTick); \ + JTEST_SYSTICK_RESET(SysTick); \ JTEST_DUMP_STRF(JTEST_CYCLE_STRF, \ (JTEST_SYSTICK_INITIAL_VALUE - \ __jtest_cycle_end_count)); \ } while (0) +#else +/* TODO */ +#define JTEST_COUNT_CYCLES(fn_call) \ + do \ + { \ + fn_call; \ + } while (0) + +#endif + #endif /* _JTEST_CYCLE_H_ */ + + diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h index c655cfd..e48c0c5 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h @@ -141,6 +141,19 @@ typedef struct JTEST_FW_struct * Fill the buffer named buf_name with value and dump it to the Keil debugger * using action. */ +#if defined(ARMv7A) || defined(FILEIO) + +#define JTEST_ACT_DUMP(action, buf_name, value) \ + do \ + { \ + JTEST_CLEAR_BUFFER(buf_name); \ + printf("%s",value); \ + strcpy(JTEST_FW.buf_name, (value)); \ + JTEST_TRIGGER_ACTION(action); \ + } while (0) + +#else + #define JTEST_ACT_DUMP(action, buf_name, value) \ do \ { \ @@ -149,6 +162,7 @@ typedef struct JTEST_FW_struct JTEST_TRIGGER_ACTION(action); \ } while (0) +#endif /** * Trigger the "Exit Framework" action in the Keil Debugger. */ @@ -192,14 +206,29 @@ typedef struct JTEST_FW_struct /** * Dump a formatted string to the Keil Debugger. */ +#if defined(ARMv7A) || defined(FILEIO) + #define JTEST_DUMP_STRF(format_str, ... ) \ do \ { \ JTEST_CLEAR_STR_BUFFER(); \ sprintf(JTEST_FW.str_buffer,format_str, __VA_ARGS__); \ + printf("%s",JTEST_FW.str_buffer); \ jtest_dump_str_segments(); \ } while (0) +#else + +#define JTEST_DUMP_STRF(format_str, ... ) \ + do \ + { \ + JTEST_CLEAR_STR_BUFFER(); \ + sprintf(JTEST_FW.str_buffer,format_str, __VA_ARGS__); \ + jtest_dump_str_segments(); \ + } while (0) + +#endif + /* Pass/Fail Macros */ /*--------------------------------------------------------------------------------*/ diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h index ec3e317..afb6e05 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h @@ -2,7 +2,7 @@ #define _JTEST_SYSTICK_H_ /*--------------------------------------------------------------------------------*/ -/* Includes */ +/* Includes */ /*--------------------------------------------------------------------------------*/ /* Get access to the SysTick structure. */ @@ -10,6 +10,8 @@ #include "ARMCM0.h" #elif defined ARMCM0P #include "ARMCM0plus.h" +#elif defined ARMCM0P_MPU + #include "ARMCM0plus_MPU.h" #elif defined ARMCM3 #include "ARMCM3.h" #elif defined ARMCM4 @@ -40,22 +42,22 @@ #include "ARMv8MML_DP.h" #elif defined ARMv8MML_DSP_DP #include "ARMv8MML_DSP_DP.h" - +#elif defined ARMv7A + /* TODO */ #else #warning "no appropriate header file found!" #endif /*--------------------------------------------------------------------------------*/ -/* Macros and Defines */ +/* Macros and Defines */ /*--------------------------------------------------------------------------------*/ /** * Initial value for the SysTick module. * - * @note This is also the maximum value, important as SysTick is a decrementing - * counter. + * This is also the maximum value, important as SysTick is a decrementing counter. */ -#define JTEST_SYSTICK_INITIAL_VALUE 0xFFFFFF +#define JTEST_SYSTICK_INITIAL_VALUE 0xFFFFFF /** * Reset the SysTick, decrementing timer to it's maximum value and disable it. @@ -66,11 +68,10 @@ #define JTEST_SYSTICK_RESET(systick_ptr) \ do \ { \ - (systick_ptr)->LOAD = JTEST_SYSTICK_INITIAL_VALUE; \ - (systick_ptr)->VAL = 1; \ + (systick_ptr)->CTRL = SysTick_CTRL_CLKSOURCE_Msk; \ \ - /* Disable the SysTick module. */ \ - (systick_ptr)->CTRL = UINT32_C(0x000000); \ + (systick_ptr)->LOAD = JTEST_SYSTICK_INITIAL_VALUE; \ + (systick_ptr)->VAL = JTEST_SYSTICK_INITIAL_VALUE; \ } while (0) /** @@ -81,13 +82,13 @@ { \ (systick_ptr)->CTRL = \ SysTick_CTRL_ENABLE_Msk | \ - SysTick_CTRL_CLKSOURCE_Msk; /* Internal clk*/ \ + SysTick_CTRL_CLKSOURCE_Msk; \ } while (0) /** * Evaluate to the current value of the SysTick timer. */ -#define JTEST_SYSTICK_VALUE(systick_ptr) \ +#define JTEST_SYSTICK_VALUE(systick_ptr) \ ((systick_ptr)->VAL) #endif /* _JTEST_SYSTICK_H_ */ |