require frequency setting from cable for RUNTEST MIN SEC command, fixes

[ 2090432 ] SVF programming problem with "x SEC" arg to runtest
also restore previous frequency setting at end of SVF execution


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1351 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent b54b2f0c8e
commit 794cc6bbd0

@ -1,3 +1,10 @@
2008-09-06 Arnim Laeuger <arniml@users.sourceforge.net>
* src/svf/svf.c: require frequency setting from cable for
RUNTEST MIN SEC command, fixes
[ 2090432 ] SVF programming problem with "x SEC" arg to runtest
also restore previous frequency setting at end of SVF execution
2008-09-04 Arnim Laeuger <arniml@users.sourceforge.net>
* configure.ac, src/tap/usbconn/libftd2xx.c,

@ -647,14 +647,19 @@ svf_runtest(chain_t *chain, parser_priv_t *priv, struct runtest *params)
/* compute run_count */
run_count = params->run_count;
frequency = cable_get_frequency(chain->cable);
if (frequency > 0) {
uint32_t min_time_run_count = ceil(params->min_time * frequency);
if (min_time_run_count > run_count) {
run_count = min_time_run_count;
if (params->min_time > 0.0) {
frequency = cable_get_frequency(chain->cable);
if (frequency > 0) {
uint32_t min_time_run_count = ceil(params->min_time * frequency);
if (min_time_run_count > run_count) {
run_count = min_time_run_count;
}
} else {
printf( _("Error %s: Maximum cable clock frequency required for RUNTEST.\n"), "svf" );
printf( _(" Set the cable frequency with 'FREQUENCY <Hz>'.\n") );
return 0;
}
}
assert(run_count > 0);
svf_goto_state(chain, priv->runtest_run_state);
@ -1023,6 +1028,7 @@ svf_run(chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, int print_progress
parser_priv_t priv;
int c = ~EOF;
int num_lines;
uint32_t old_frequency = cable_get_frequency( chain->cable );
/* get number of lines in svf file so we can give user some feedback on long
files or slow cables */
@ -1139,4 +1145,8 @@ svf_run(chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, int print_progress
free(priv.sdr_params.params.mask);
if (priv.sdr_params.params.smask)
free(priv.sdr_params.params.smask);
/* restore previous frequency setting, required by SVF spec */
if (old_frequency != cable_get_frequency( chain->cable ))
cable_set_frequency( chain->cable, old_frequency );
}

Loading…
Cancel
Save