Added VT_STORM_CFG_MIN_DELAY configuration option.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14407 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2021-05-21 10:20:05 +00:00
parent 35621dd185
commit bd133fec8a
2 changed files with 18 additions and 6 deletions

View File

@ -190,11 +190,12 @@ void vt_storm_execute(const vt_storm_config_t *cfg) {
chprintf(cfg->out, "*** Test Board: %s\r\n", BOARD_NAME); chprintf(cfg->out, "*** Test Board: %s\r\n", BOARD_NAME);
#endif #endif
chprintf(cfg->out, "***\r\n"); chprintf(cfg->out, "***\r\n");
chprintf(cfg->out, "*** Randomize: %d\r\n", VT_STORM_CFG_RANDOMIZE); chprintf(cfg->out, "*** Randomize: %d\r\n", VT_STORM_CFG_RANDOMIZE);
chprintf(cfg->out, "*** System Time: %d\r\n", CH_CFG_ST_RESOLUTION); chprintf(cfg->out, "*** Minimum Delay: %d\r\n", VT_STORM_CFG_MIN_DELAY);
chprintf(cfg->out, "*** Intervals: %d\r\n", CH_CFG_INTERVALS_SIZE); chprintf(cfg->out, "*** System Time: %d\r\n", CH_CFG_ST_RESOLUTION);
chprintf(cfg->out, "*** SysTick: %d\r\n", CH_CFG_ST_FREQUENCY); chprintf(cfg->out, "*** Intervals: %d\r\n", CH_CFG_INTERVALS_SIZE);
chprintf(cfg->out, "*** Delta: %d\r\n", CH_CFG_ST_TIMEDELTA); chprintf(cfg->out, "*** SysTick: %d\r\n", CH_CFG_ST_FREQUENCY);
chprintf(cfg->out, "*** Delta: %d\r\n", CH_CFG_ST_TIMEDELTA);
chprintf(cfg->out, "\r\n"); chprintf(cfg->out, "\r\n");
for (i = 1; i <= VT_STORM_CFG_ITERATIONS; i++) { for (i = 1; i <= VT_STORM_CFG_ITERATIONS; i++) {
@ -241,7 +242,7 @@ void vt_storm_execute(const vt_storm_config_t *cfg) {
palToggleLine(config->line); palToggleLine(config->line);
chprintf(cfg->out, "."); chprintf(cfg->out, ".");
delay--; delay--;
} while (delay >= 5); } while (delay >= VT_STORM_CFG_MIN_DELAY);
if (saturated) { if (saturated) {
chprintf(cfg->out, "\r\nSaturated at %u uS", TIME_I2US(delay)); chprintf(cfg->out, "\r\nSaturated at %u uS", TIME_I2US(delay));

View File

@ -50,12 +50,23 @@
#if !defined(VT_STORM_CFG_ITERATIONS) || defined(__DOXYGEN__) #if !defined(VT_STORM_CFG_ITERATIONS) || defined(__DOXYGEN__)
#define VT_STORM_CFG_ITERATIONS 100 #define VT_STORM_CFG_ITERATIONS 100
#endif #endif
/**
* @brief Minimum delay for each iteration.
*/
#if !defined(VT_STORM_CFG_MIN_DELAY) || defined(__DOXYGEN__)
#define VT_STORM_CFG_MIN_DELAY 10
#endif
/** @} */ /** @} */
/*===========================================================================*/ /*===========================================================================*/
/* Derived constants and error checks. */ /* Derived constants and error checks. */
/*===========================================================================*/ /*===========================================================================*/
#if (VT_STORM_CFG_MIN_DELAY < 5) || (VT_STORM_CFG_MIN_DELAY > 100)
#error "invalid VT_STORM_CFG_MIN_DELAY value"
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Module data structures and types. */ /* Module data structures and types. */
/*===========================================================================*/ /*===========================================================================*/