[ 986415 ] Allow interactive loading of DR

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@686 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 17 years ago
parent 6097369485
commit 8815d81bfb

@ -54,15 +54,6 @@ cmd_dr_run( char *params[] )
return 1;
}
if (params[1]) {
if (strcasecmp( params[1], "in" ) == 0)
dir = 0;
else if (strcasecmp( params[1], "out" ) == 0)
dir = 1;
else
return -1;
}
if (chain->parts->parts[chain->active_part]->active_instruction == NULL) {
printf( _("%s: part without active instruction\n"), "dr" );
return 1;
@ -72,6 +63,30 @@ cmd_dr_run( char *params[] )
return 1;
}
if (params[1]) {
if (strcmp( params[1], "in" ) == 0)
dir = 0;
else if (strcmp( params[1], "out" ) == 0)
dir = 1;
else {
unsigned int bit;
if (strspn(params[1], "01") != strlen(params[1])) {
return -1;
}
r = chain->parts->parts[chain->active_part]->active_instruction->data_register->in;
if (r->len != strlen(params[1])) {
printf( _("%s: register length mismatch\n"), "dr" );
return 1;
}
for (bit = 0; params[1][bit]; bit++) {
r->data[r->len - 1 - bit] = (params[1][bit] == '1');
}
dir = 0;
}
}
if (dir)
r = chain->parts->parts[chain->active_part]->active_instruction->data_register->out;
else

Loading…
Cancel
Save