Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: m-labs/flickernoise
base: c27f06d
...
head fork: m-labs/flickernoise
compare: 41e4380
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 40 additions and 16 deletions.
  1. +40 −16 src/shellext.c
56 src/shellext.c
View
@@ -42,6 +42,10 @@
#define PFPU_SPREG_COUNT 2
#endif
+
+/* ----- viread/viwrite ---------------------------------------------------- */
+
+
static int main_viwrite(int argc, char **argv)
{
unsigned int reg, val;
@@ -97,6 +101,10 @@ static int main_viread(int argc, char **argv)
return 0;
}
+
+/* ----- erase ------------------------------------------------------------- */
+
+
static int main_erase(int argc, char **argv)
{
int fd;
@@ -148,6 +156,10 @@ static int main_erase(int argc, char **argv)
return 0;
}
+
+/* ----- fbgrab ------------------------------------------------------------ */
+
+
static int main_fbgrab(int argc, char **argv)
{
int ret = 0;
@@ -160,6 +172,10 @@ static int main_fbgrab(int argc, char **argv)
return ret;
}
+
+/* ----- pfpu -------------------------------------------------------------- */
+
+
static int main_pfpu(int argc, char **argv)
{
static unsigned int dummy[2]
@@ -222,6 +238,10 @@ static int main_pfpu(int argc, char **argv)
return 0;
}
+
+/* ----- usb --------------------------------------------------------------- */
+
+
#define SOFTUSB_DMEM_BASE (0xa0020000)
#define COMLOC(x) (*(unsigned char *)(x))
#define COMLOCV(x) (*(volatile unsigned char *)(x))
@@ -231,7 +251,7 @@ static int main_pfpu(int argc, char **argv)
static uint8_t debug_consume = 0;
-static void navre_debug_flush(void)
+static void usb_debug_flush(void)
{
int nl = 1;
char c;
@@ -246,7 +266,7 @@ static void navre_debug_flush(void)
putchar('\n');
}
-static int navre_debug(int argc, char **argv)
+static int usb_debug(int argc, char **argv)
{
unsigned long n = 0;
char *end;
@@ -262,13 +282,13 @@ static int navre_debug(int argc, char **argv)
time(&t);
t += n;
- do navre_debug_flush();
+ do usb_debug_flush();
while (time(NULL) < t);
return 0;
}
-static int navre_load(int argc, char **argv)
+static int usb_load(int argc, char **argv)
{
if(!load_usb_firmware_file(argv[1])) {
fprintf(stderr, "load failed\n");
@@ -278,27 +298,31 @@ static int navre_load(int argc, char **argv)
return 0;
}
-static void navre_usage(void)
+static void usb_usage(void)
{
- printf(" navre [help]\n");
- printf(" navre load file\n");
- printf(" navre debug [seconds]\n");
+ printf(" usb [help]\n");
+ printf(" usb load file\n");
+ printf(" usb debug [seconds]\n");
}
-static int main_navre(int argc, char **argv)
+static int main_usb(int argc, char **argv)
{
if(argc < 2 || !strcmp(argv[1], "help")) {
- navre_usage();
+ usb_usage();
return 0;
}
if(!strcmp(argv[1], "load") && argc == 3)
- return navre_load(argc-1, argv+1);
+ return usb_load(argc-1, argv+1);
if(!strcmp(argv[1], "debug") && (argc == 2 || argc == 3))
- return navre_debug(argc-1, argv+1);
- navre_usage();
+ return usb_debug(argc-1, argv+1);
+ usb_usage();
return 1;
}
+
+/* ----- Command definitions ----------------------------------------------- */
+
+
static rtems_shell_cmd_t shellext_viwrite = {
"viwrite", /* name */
"viwrite register value", /* usage */
@@ -345,10 +369,10 @@ rtems_shell_cmd_t shellext_pfpu = {
};
rtems_shell_cmd_t shellext = {
- "navre", /* name */
- "navre command ...", /* usage */
+ "usb", /* name */
+ "usb command ...", /* usage */
"flickernoise", /* topic */
- main_navre, /* command */
+ main_usb, /* command */
NULL, /* alias */
&shellext_pfpu /* next */
};

No commit comments for this range

Something went wrong with that request. Please try again.