Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 40 additions and 16 deletions. Show diff stats Hide diff stats

  1. 56  src/shellext.c
56  src/shellext.c
@@ -42,6 +42,10 @@
42 42
 #define	PFPU_SPREG_COUNT 2
43 43
 #endif
44 44
 
  45
+
  46
+/* ----- viread/viwrite ---------------------------------------------------- */
  47
+
  48
+
45 49
 static int main_viwrite(int argc, char **argv)
46 50
 {
47 51
 	unsigned int reg, val;
@@ -97,6 +101,10 @@ static int main_viread(int argc, char **argv)
97 101
 	return 0;
98 102
 }
99 103
 
  104
+
  105
+/* ----- erase ------------------------------------------------------------- */
  106
+
  107
+
100 108
 static int main_erase(int argc, char **argv)
101 109
 {
102 110
 	int fd;
@@ -148,6 +156,10 @@ static int main_erase(int argc, char **argv)
148 156
 	return 0;
149 157
 }
150 158
 
  159
+
  160
+/* ----- fbgrab ------------------------------------------------------------ */
  161
+
  162
+
151 163
 static int main_fbgrab(int argc, char **argv)
152 164
 {
153 165
 	int ret = 0;
@@ -160,6 +172,10 @@ static int main_fbgrab(int argc, char **argv)
160 172
 	return ret;
161 173
 }
162 174
 
  175
+
  176
+/* ----- pfpu -------------------------------------------------------------- */
  177
+
  178
+
163 179
 static int main_pfpu(int argc, char **argv)
164 180
 {
165 181
 	static unsigned int dummy[2]
@@ -222,6 +238,10 @@ static int main_pfpu(int argc, char **argv)
222 238
 	return 0;
223 239
 }
224 240
 
  241
+
  242
+/* ----- usb --------------------------------------------------------------- */
  243
+
  244
+
225 245
 #define	SOFTUSB_DMEM_BASE	(0xa0020000)
226 246
 #define	COMLOC(x)		(*(unsigned char *)(x))
227 247
 #define	COMLOCV(x)		(*(volatile unsigned char *)(x))
@@ -231,7 +251,7 @@ static int main_pfpu(int argc, char **argv)
231 251
 
232 252
 static uint8_t debug_consume = 0;
233 253
 
234  
-static void navre_debug_flush(void)
  254
+static void usb_debug_flush(void)
235 255
 {
236 256
 	int nl = 1;
237 257
 	char c;
@@ -246,7 +266,7 @@ static void navre_debug_flush(void)
246 266
 		putchar('\n');
247 267
 }
248 268
 
249  
-static int navre_debug(int argc, char **argv)
  269
+static int usb_debug(int argc, char **argv)
250 270
 {
251 271
 	unsigned long n = 0;
252 272
 	char *end;
@@ -262,13 +282,13 @@ static int navre_debug(int argc, char **argv)
262 282
 
263 283
 	time(&t);
264 284
 	t += n;
265  
-	do navre_debug_flush();
  285
+	do usb_debug_flush();
266 286
 	while (time(NULL) < t);
267 287
 
268 288
 	return 0;
269 289
 }
270 290
 
271  
-static int navre_load(int argc, char **argv)
  291
+static int usb_load(int argc, char **argv)
272 292
 {
273 293
 	if(!load_usb_firmware_file(argv[1])) {
274 294
 		fprintf(stderr, "load failed\n");
@@ -278,27 +298,31 @@ static int navre_load(int argc, char **argv)
278 298
 	return 0;
279 299
 }
280 300
 
281  
-static void navre_usage(void)
  301
+static void usb_usage(void)
282 302
 {
283  
-	printf("  navre [help]\n");
284  
-	printf("  navre load file\n");
285  
-	printf("  navre debug [seconds]\n");
  303
+	printf("  usb [help]\n");
  304
+	printf("  usb load file\n");
  305
+	printf("  usb debug [seconds]\n");
286 306
 }
287 307
 
288  
-static int main_navre(int argc, char **argv)
  308
+static int main_usb(int argc, char **argv)
289 309
 {
290 310
 	if(argc < 2 || !strcmp(argv[1], "help")) {
291  
-		navre_usage();
  311
+		usb_usage();
292 312
 		return 0;
293 313
 	}
294 314
 	if(!strcmp(argv[1], "load") && argc == 3)
295  
-		return navre_load(argc-1, argv+1);
  315
+		return usb_load(argc-1, argv+1);
296 316
 	if(!strcmp(argv[1], "debug") && (argc == 2 || argc == 3))
297  
-		return navre_debug(argc-1, argv+1);
298  
-	navre_usage();
  317
+		return usb_debug(argc-1, argv+1);
  318
+	usb_usage();
299 319
 	return 1;
300 320
 }
301 321
 
  322
+
  323
+/* ----- Command definitions ----------------------------------------------- */
  324
+
  325
+
302 326
 static rtems_shell_cmd_t shellext_viwrite = {
303 327
 	"viwrite",			/* name */
304 328
 	"viwrite register value",	/* usage */
@@ -345,10 +369,10 @@ rtems_shell_cmd_t shellext_pfpu = {
345 369
 };
346 370
 
347 371
 rtems_shell_cmd_t shellext = {
348  
-	"navre",			/* name */
349  
-	"navre command ...",		/* usage */
  372
+	"usb",				/* name */
  373
+	"usb command ...",		/* usage */
350 374
 	"flickernoise",			/* topic */
351  
-	main_navre,			/* command */
  375
+	main_usb,			/* command */
352 376
 	NULL,				/* alias */
353 377
 	&shellext_pfpu			/* next */
354 378
 };

No commit comments for this range

Something went wrong with that request. Please try again.