From 12bb2a05d2b9a940f4bcdd7478d3c9d45cc8f50a Mon Sep 17 00:00:00 2001 From: travisutk Date: Thu, 20 May 2010 14:09:24 +0000 Subject: [PATCH] Monitor echo function, for better synchronization. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@540 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/apps/monitor/monitor.c | 4 ++++ firmware/apps/radios/nrf.c | 2 +- firmware/include/monitor.h | 18 ++++++++++++++++++ firmware/include/nrf.h | 5 ++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/firmware/apps/monitor/monitor.c b/firmware/apps/monitor/monitor.c index 3a94b44..218afca 100644 --- a/firmware/apps/monitor/monitor.c +++ b/firmware/apps/monitor/monitor.c @@ -22,6 +22,10 @@ void monitorhandle(unsigned char app, default: debugstr("ERROR: Command unsupported by debug monitor."); break; + case MONITOR_ECHO: + //Echo back the same buffer. + txdata(app,verb,len); + break; case PEEK: cmddata[0]=memorybyte[cmddataword[0]]; txdata(app,verb,1); diff --git a/firmware/apps/radios/nrf.c b/firmware/apps/radios/nrf.c index 043675e..6f65e0b 100644 --- a/firmware/apps/radios/nrf.c +++ b/firmware/apps/radios/nrf.c @@ -96,7 +96,7 @@ void nrfhandle(unsigned char app, //Raise !SS to end transaction, just in case we forgot. P5OUT|=SS; nrfsetup(); - + switch(verb){ //PEEK and POKE might come later. case READ: diff --git a/firmware/include/monitor.h b/firmware/include/monitor.h index b36ceab..a4a3156 100644 --- a/firmware/include/monitor.h +++ b/firmware/include/monitor.h @@ -16,3 +16,21 @@ void monitor_ram_pattern(); //! Return the number of contiguous bytes 0xBEEF, to measure RAM usage. unsigned int monitor_ram_depth(); +// Monitor Commands +#define MONITOR_CHANGE_BAUD 0x80 +#define MONITOR_ECHO 0x81 +#define MONITOR_RAM_PATTERN 0x90 +#define MONITOR_RAM_DEPTH 0x91 + +#define MONITOR_DIR 0xA0 +#define MONITOR_OUT 0xA1 +#define MONITOR_IN 0xA2 + +#define MONITOR_SILENT 0xB0 +#define MONITOR_CONNECTED 0xB1 + +#define MONITOR_READBUF 0xC0 +#define MONITOR_WRITEBUF 0xC1 +#define MONITOR_SIZEBUF 0xC2 + + diff --git a/firmware/include/nrf.h b/firmware/include/nrf.h index 7abdf36..06805ae 100644 --- a/firmware/include/nrf.h +++ b/firmware/include/nrf.h @@ -9,8 +9,11 @@ #define NRF_RX 0x80 //Send a packet. #define NRF_TX 0x81 -//Flsuh RX +//Flush RX #define NRF_RX_FLUSH 0x82 +//Flush TX +#define NRF_TX_FLUSH 0x83 + //Nordic RF SPI Instructions #define NRF_R_REGISTER 0x00 -- 2.20.1