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

@ -191,6 +191,7 @@ void vt_storm_execute(const vt_storm_config_t *cfg) {
#endif
chprintf(cfg->out, "***\r\n");
chprintf(cfg->out, "*** Randomize: %d\r\n", VT_STORM_CFG_RANDOMIZE);
chprintf(cfg->out, "*** Minimum Delay: %d\r\n", VT_STORM_CFG_MIN_DELAY);
chprintf(cfg->out, "*** System Time: %d\r\n", CH_CFG_ST_RESOLUTION);
chprintf(cfg->out, "*** Intervals: %d\r\n", CH_CFG_INTERVALS_SIZE);
chprintf(cfg->out, "*** SysTick: %d\r\n", CH_CFG_ST_FREQUENCY);
@ -241,7 +242,7 @@ void vt_storm_execute(const vt_storm_config_t *cfg) {
palToggleLine(config->line);
chprintf(cfg->out, ".");
delay--;
} while (delay >= 5);
} while (delay >= VT_STORM_CFG_MIN_DELAY);
if (saturated) {
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__)
#define VT_STORM_CFG_ITERATIONS 100
#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. */
/*===========================================================================*/
#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. */
/*===========================================================================*/