From 3d0a9bd40be2d014e0877eb623042c899d8cbe66 Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 13 Nov 2007 00:47:14 +0000 Subject: Add PIO IRQ counter (and print it in 'c' command) Make tc_cdiv_sync interrupt working Add 'p' command to print some PIO inputs Add 'z' command to enable/disable tc_cdiv_sync git-svn-id: https://svn.openpcd.org:2342/trunk@324 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/cmd.c | 46 +++++++++++++++++++++++++++++++++++- openpicc/application/main.c | 3 +++ openpicc/application/pio_irq.c | 8 +++++++ openpicc/application/pio_irq.h | 1 + openpicc/application/tc_cdiv_sync.c | 47 +++++++------------------------------ openpicc/application/tc_cdiv_sync.h | 1 + 6 files changed, 66 insertions(+), 40 deletions(-) (limited to 'openpicc/application') diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index 7ff7f53..d7ce784 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -11,6 +11,8 @@ #include "openpicc.h" #include "led.h" #include "da.h" +#include "tc_cdiv_sync.h" +#include "pio_irq.h" xQueueHandle xCmdQueue; xTaskHandle xCmdTask; @@ -26,7 +28,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 = "c+-l?h"; +static const char *SHORT_COMMANDS = "pc+-l?h"; /* Note that the long/short command distinction only applies to the USB serial console * */ @@ -92,6 +94,29 @@ int atoiEx(const char * nptr, char * * eptr) return sign * curval; } +static const struct { int pin; char * description; } PIO_PINS[] = { + {OPENPICC_PIO_PLL_LOCK, "pll lock "}, + {OPENPICC_PIO_FRAME, "frame start"}, +}; +void print_pio(void) +{ + int data = *AT91C_PIOA_PDSR; + unsigned int i; + DumpStringToUSB( + " *****************************************************\n\r" + " * Current PIO readings: *\n\r" + " *****************************************************\n\r" + " *\n\r"); + for(i=0; i