app dir changed and src dir removed
This commit is contained in:
39
bs/cmds/scan.c
Normal file
39
bs/cmds/scan.c
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "scan.h"
|
||||
#include "common.h"
|
||||
|
||||
const char cmd_scan_help[] = "Bla bla.";
|
||||
|
||||
int scan(jtag_core *jc, int probe_id, int *ndevs, unsigned long ids[], int show) {
|
||||
int err = JTAG_CORE_NO_ERROR;
|
||||
int n = 0;
|
||||
int i = 0;
|
||||
|
||||
if (0 != show) printf("Devices scan in progress...\n");
|
||||
|
||||
err = jtagcore_scan_and_init_chain(jc);
|
||||
if (err < 0) {
|
||||
if (0 != show) printf("Impossible to scan the JTAG chain");
|
||||
return err;
|
||||
}
|
||||
|
||||
n = jtagcore_get_number_of_devices(jc);
|
||||
if (n < 0) {
|
||||
if (0 != show) printf("Error while getting the number of devices on the chain.\n");
|
||||
return err;
|
||||
}
|
||||
*ndevs = n;
|
||||
for (i=0;i < MIN(n, DEVICES_SCAN_MAX);i++) {
|
||||
ids[i] = jtagcore_get_dev_id(jc, i);
|
||||
if (0 != show) printf(" device %d : 0x%08x\n", i, ids[i]);
|
||||
}
|
||||
|
||||
if (0 != show) printf("Done.\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
int cmd_scan(jtag_core *jc, int argc, char *argv[]) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user