app dir changed and src dir removed
This commit is contained in:
11
bs/cmds/exit.c
Normal file
11
bs/cmds/exit.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "exit.h"
|
||||
|
||||
const char cmd_exit_help[] = "Bla bla.";
|
||||
|
||||
int cmd_exit(jtag_core *jc, int argc, char **argv) {
|
||||
jtagcore_deinit(jc);
|
||||
exit(0);
|
||||
}
|
||||
10
bs/cmds/exit.h
Normal file
10
bs/cmds/exit.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _CMD_EXIT_H
|
||||
#define _CMD_EXIT_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
|
||||
extern const char cmd_exit_help[];
|
||||
|
||||
int cmd_exit(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
#endif /* _CMD_EXIT_H */
|
||||
8
bs/cmds/help.c
Normal file
8
bs/cmds/help.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "help.h"
|
||||
|
||||
int cmd_help(jtag_core *jc, int argc, char **argv) {
|
||||
|
||||
}
|
||||
8
bs/cmds/help.h
Normal file
8
bs/cmds/help.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _CMD_HELP_H
|
||||
#define _CMD_HELP_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
|
||||
int cmd_help(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
#endif /* _CMD_help_H */
|
||||
69
bs/cmds/list_probes.c
Normal file
69
bs/cmds/list_probes.c
Normal file
@@ -0,0 +1,69 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "list_probes.h"
|
||||
#include "common.h"
|
||||
|
||||
const char cmd_list_probes_help[] = "Bla bla.";
|
||||
|
||||
struct probe {
|
||||
int drv;
|
||||
int probe;
|
||||
int probe_id;
|
||||
char name[PROBE_NAME_SIZE];
|
||||
};
|
||||
|
||||
int list_probes(jtag_core *jc, struct probe probes[], int show) {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int n = 0;
|
||||
|
||||
char probe_name[PROBE_NAME_SIZE] = {0};
|
||||
int n_probe_drv = 0;
|
||||
int n_probes = 0;
|
||||
|
||||
/* Drivers and probes */
|
||||
n_probe_drv = jtagcore_get_number_of_probes_drv(jc);
|
||||
if (n_probe_drv > 0) {
|
||||
if (0 != show) printf("Found a debug probe driver:\n");
|
||||
} else {
|
||||
if (0 != show) printf("No probes driver found\n");
|
||||
return n;
|
||||
}
|
||||
|
||||
for (i=0;i<n_probe_drv;i++) {
|
||||
if (0 != show) printf(" JTAG probe driver %d\n", i);
|
||||
|
||||
n_probes = jtagcore_get_number_of_probes(jc, i);
|
||||
|
||||
if (n_probes > 0) {
|
||||
|
||||
if (0 != show) printf("Found a debug probe:\n");
|
||||
|
||||
} else {
|
||||
|
||||
if (0 != show) printf("No probe found.\n");
|
||||
continue;
|
||||
}
|
||||
for (j=0;j<n_probes;j++) {
|
||||
jtagcore_get_probe_name(jc, PROBE_ID(i,j), probe_name);
|
||||
|
||||
if (n < PROBES_MAX_NUM) {
|
||||
probes[n].drv = i;
|
||||
probes[n].probe = j;
|
||||
probes[n].probe_id = PROBE_ID(i,j);
|
||||
strncpy(probes[n].name, probe_name, PROBE_NAME_SIZE);
|
||||
}
|
||||
if (0 != show) {
|
||||
printf(" JTAG probe %d: ", n+1);
|
||||
printf("%s.\n", probe_name);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
int cmd_list_probes(jtag_core *jc, int argc, char *argv[]) {
|
||||
|
||||
}
|
||||
10
bs/cmds/list_probes.h
Normal file
10
bs/cmds/list_probes.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _LIST_PROBES_H
|
||||
#define _LIST_PROBES_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
|
||||
extern const char cmd_list_probes_help[];
|
||||
|
||||
int cmd_list_probes(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
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[]) {
|
||||
|
||||
}
|
||||
11
bs/cmds/scan.h
Normal file
11
bs/cmds/scan.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _CMDS_SCAN_H
|
||||
#define _CMDS_SCAN_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
|
||||
extern const char cmd_scan_help[];
|
||||
|
||||
int cmd_scan(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
|
||||
#endif
|
||||
16
bs/cmds/select_probe.c
Normal file
16
bs/cmds/select_probe.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "select_probe.h"
|
||||
|
||||
const char cmd_select_probe_help[] = "Bla bla.";
|
||||
|
||||
int cmd_select_probe(jtag_core *jc, int argc, char *argv[]) {
|
||||
int error = 0;
|
||||
|
||||
// error = jtagcore_select_and_open_probe(jc, probe_id);
|
||||
if (error < 0) {
|
||||
printf("Impossible to open the selected probe.\n");
|
||||
return error;
|
||||
}
|
||||
|
||||
}
|
||||
10
bs/cmds/select_probe.h
Normal file
10
bs/cmds/select_probe.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _SELECT_PROBE_H
|
||||
#define _SELECT_PROBE_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
|
||||
extern const char cmd_select_probe_help[];
|
||||
|
||||
int cmd_select_probe(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user