From a72e0c20bb28d382fc7377f270b4d9944baeaf97 Mon Sep 17 00:00:00 2001 From: henryk Date: Mon, 11 Feb 2008 12:25:41 +0000 Subject: Framework to support run-time hardware selection. Future hardware releases should be changed to be boot-time detectable (e.g. using the yet unused AD inputs) so that one image can be used for all releases git-svn-id: https://svn.openpcd.org:2342/trunk@411 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/cmd.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'openpicc/application/cmd.c') diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index 7995947..a96a68d 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -138,8 +138,9 @@ static const struct {ssc_metric metric; char *description;} SSC_METRICS[] = { {FREE_BUFFERS, "free rx buffers"}, {LATE_FRAMES, "late frames"}, }; -static const struct { int pin; char * description; } PIO_PINS[] = { - {OPENPICC_PIO_PLL_LOCK, "pll lock "}, +#define DYNAMIC_PIN_PLL_LOCK -1 +static struct { int pin; char * description; } PIO_PINS[] = { + {DYNAMIC_PIN_PLL_LOCK, "pll lock "}, {OPENPICC_PIO_FRAME, "frame start"}, }; void print_pio(void) @@ -152,6 +153,7 @@ void print_pio(void) " *****************************************************\n\r" " *\n\r"); for(i=0; ifeatures.data_gating) { + DumpStringToUSB("This hardware does not have data gating capability\n\r"); + break; + } i=atoiEx(args, &args); ssc_set_data_gate(i); if(i==0) { - DumpStringToUSB("SSC_DATA disabled \n\r"); + DumpStringToUSB("SSC_DATA disabled \n\r"); } else { - DumpStringToUSB("SSC_DATA enabled \n\r"); + DumpStringToUSB("SSC_DATA enabled \n\r"); } break; -#endif case 'D': i=atoiEx(args, &args); tc_cdiv_set_divider(i); @@ -241,7 +245,9 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " *****************************************************\n\r" " * Version " COMPILE_SVNREV "\n\r" " * compiled " COMPILE_DATE " by " COMPILE_BY "\n\r" - " *\n\r"); + " * running on "); + DumpStringToUSB(OPENPICC->release_name); + DumpStringToUSB("\n\r *\n\r"); DumpStringToUSB(" * Uptime is "); ms=xTaskGetTickCount(); DumpTimeToUSB(ms); @@ -392,7 +398,9 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " *****************************************************\n\r" " * Version " COMPILE_SVNREV "\n\r" " * compiled " COMPILE_DATE " by " COMPILE_BY "\n\r" - " *\n\r" + " * running on "); + DumpStringToUSB(OPENPICC->release_name); + DumpStringToUSB("\n\r *\n\r" " * test - test critical sections\n\r" #if ( configUSE_TRACE_FACILITY == 1 ) " * t - print task list and stack usage\n\r" @@ -409,9 +417,7 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " * d div- set tc_cdiv divider value 16, 32, 64, ...\n\r" " * j,k - increase, decrease fdt_offset\n\r" " * a - change load modulation level\n\r" -#ifdef OPENPICC_MODIFIED_BOARD " * g 0/1- disable or enable SSC_DATA through gate\n\r" -#endif " * 9 - reset CPU\n\r" " * ?,h - display this help screen\n\r" " *\n\r" @@ -542,7 +548,14 @@ void startstop_field_meter(void) { } } -portBASE_TYPE vCmdInit(void) { +portBASE_TYPE vCmdInit() { + unsigned int i; + for(i=0; iPLL_LOCK; + } + } + /* FIXME Maybe modify to use pointers? */ xCmdQueue = xQueueCreate( 10, sizeof(cmd_type) ); if(xCmdQueue == 0) { -- cgit v1.2.3