From 6cc8228e80ed010650078c34ba8711897dc75e57 Mon Sep 17 00:00:00 2001 From: henryk Date: Mon, 19 Nov 2007 04:30:43 +0000 Subject: Add ssc rx start and reboot commands Print version and compile date on help and config commands git-svn-id: https://svn.openpcd.org:2342/trunk@332 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/Makefile | 3 ++- openpicc/application/cmd.c | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/openpicc/Makefile b/openpicc/Makefile index 9070422..f88f052 100644 --- a/openpicc/Makefile +++ b/openpicc/Makefile @@ -118,7 +118,7 @@ $(DEMO_APP_THMUB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h $(FREERTOS_THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@ -$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h config/board.h config/compile.h +$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h config/board.h $(CC) -c $(CFLAGS) $< -o $@ clean : @@ -129,3 +129,4 @@ clean : .PHONY: config/compile.h config/compile.h: scripts/mkcompile_h > config/compile.h +application/cmd.o: config/compile.h diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index 7390775..4ba149f 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "env.h" @@ -15,6 +16,7 @@ #include "tc_cdiv.h" #include "tc_cdiv_sync.h" #include "pio_irq.h" +#include "ssc_picc.h" #include "usb_print.h" xQueueHandle xCmdQueue; @@ -31,7 +33,7 @@ static const portBASE_TYPE USE_COLON_FOR_LONG_COMMANDS = 0; /* When not USE_COLON_FOR_LONG_COMMANDS then short commands will be recognized by including * their character in the string SHORT_COMMANDS * */ -static const char *SHORT_COMMANDS = "!pc+-l?h"; +static const char *SHORT_COMMANDS = "!pc+-l?hq9"; /* Note that the long/short command distinction only applies to the USB serial console * */ @@ -199,6 +201,8 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " *****************************************************\n\r" " * Current configuration: *\n\r" " *****************************************************\n\r" + " * Version " COMPILE_SVNREV "\n\r" + " * compiled " COMPILE_DATE " by " COMPILE_BY "\n\r" " *\n\r"); DumpStringToUSB(" * Uptime is "); s=xTaskGetTickCount()/1000; @@ -263,6 +267,13 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { case '!': tc_cdiv_sync_reset(); break; + case 'Q': + ssc_rx_start(); + while(0) { + DumpUIntToUSB(AT91C_BASE_SSC->SSC_SR); + DumpStringToUSB("\n\r"); + } + break; case 'H': case '?': DumpStringToUSB( @@ -271,6 +282,8 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " * (C) 2007 Milosch Meriac *\n\r" " * (C) 2007 Henryk Plötz *\n\r" " *****************************************************\n\r" + " * Version " COMPILE_SVNREV "\n\r" + " * compiled " COMPILE_DATE " by " COMPILE_BY "\n\r" " *\n\r" " * s - store transmitter settings\n\r" " * test - test critical sections\n\r" @@ -282,11 +295,17 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " * p - print PIO pins\n\r" " * z 0/1- enable or disable tc_cdiv_sync\n\r" " * ! - reset tc_cdiv_sync\n\r" + " * q - start rx\n\r" + " * 9 - reset CPU\n\r" " * ?,h - display this help screen\n\r" " *\n\r" " *****************************************************\n\r" ); break; + case '9': + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; } } @@ -386,5 +405,8 @@ portBASE_TYPE vCmdInit(void) { return 0; } + ssc_rx_mode_set(SSC_MODE_CONTINUOUS); + DumpStringToUSB("SSC mode set to continuous\n\r"); + return 1; } -- cgit v1.2.3