From d2e4354f7842d7adbdb11367cd8e98af6e463c14 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 24 Jan 2012 08:27:48 -0800 Subject: usrp2: firmware should reset dsp on icmp pkt 1) This should kill any streaming, the previous calls would just stop continuous streaming 2) The breaks were changed to returns to avoid reprogramming the framer. --- firmware/zpu/apps/txrx_uhd.c | 18 +++++++----------- firmware/zpu/lib/memory_map.h | 1 + 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'firmware/zpu') diff --git a/firmware/zpu/apps/txrx_uhd.c b/firmware/zpu/apps/txrx_uhd.c index f9eedfc7d..8cc108f9d 100644 --- a/firmware/zpu/apps/txrx_uhd.c +++ b/firmware/zpu/apps/txrx_uhd.c @@ -54,23 +54,19 @@ static void handle_udp_data_packet( //handle ICMP destination unreachable if (payload == NULL) switch(src.port){ case USRP2_UDP_RX_DSP0_PORT: - //the end continuous streaming command - sr_rx_ctrl0->cmd = 1 << 31 | 1 << 28; //no samples now - sr_rx_ctrl0->time_secs = 0; - sr_rx_ctrl0->time_ticks = 0; //latch the command - break; + //reset dsp to stop streaming + sr_rx_ctrl0->clear = 1; + return; case USRP2_UDP_RX_DSP1_PORT: - //the end continuous streaming command - sr_rx_ctrl1->cmd = 1 << 31 | 1 << 28; //no samples now - sr_rx_ctrl1->time_secs = 0; - sr_rx_ctrl1->time_ticks = 0; //latch the command - break; + //reset dsp to stop streaming + sr_rx_ctrl1->clear = 1; + return; case USRP2_UDP_TX_DSP0_PORT: //end async update packets per second sr_tx_ctrl->cyc_per_up = 0; - break; + return; default: return; } diff --git a/firmware/zpu/lib/memory_map.h b/firmware/zpu/lib/memory_map.h index 75727bb23..84298d3c1 100644 --- a/firmware/zpu/lib/memory_map.h +++ b/firmware/zpu/lib/memory_map.h @@ -302,6 +302,7 @@ typedef struct { volatile uint32_t cmd; // {now, chain, num_samples(30) volatile uint32_t time_secs; volatile uint32_t time_ticks; + volatile uint32_t clear; } sr_rx_ctrl_t; #define sr_rx_ctrl0 ((sr_rx_ctrl_t *) _SR_ADDR(SR_RX_CTRL0)) -- cgit v1.2.3