From 94df5a81a8251f387923514466e82801f7758424 Mon Sep 17 00:00:00 2001 From: PeterKietzmann Date: Tue, 27 Sep 2016 14:28:54 +0200 Subject: [PATCH 1/2] boards/z1:increase SPI speed for on-board radio --- boards/z1/include/board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/z1/include/board.h b/boards/z1/include/board.h index 3d27b6560..b5e22f159 100644 --- a/boards/z1/include/board.h +++ b/boards/z1/include/board.h @@ -111,7 +111,7 @@ extern "C" { * @brief Definition of the interface to the CC2420 radio */ #define CC2420_PARAMS_BOARD {.spi = SPI_0, \ - .spi_clk = SPI_SPEED_1MHZ, \ + .spi_clk = SPI_SPEED_5MHZ, \ .pin_cs = GPIO_PIN(P3, 0), \ .pin_fifo = GPIO_PIN(P1, 3), \ .pin_fifop = GPIO_PIN(P1, 2), \ From 6d4011a3259fa707a7bcc18df2e1da826f44e7d0 Mon Sep 17 00:00:00 2001 From: PeterKietzmann Date: Tue, 27 Sep 2016 17:16:57 +0200 Subject: [PATCH 2/2] drivers/cc2420:improve send performance --- drivers/cc2420/cc2420.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/cc2420/cc2420.c b/drivers/cc2420/cc2420.c index eea441036..b75ceafcd 100644 --- a/drivers/cc2420/cc2420.c +++ b/drivers/cc2420/cc2420.c @@ -160,6 +160,7 @@ size_t cc2420_tx_prepare(cc2420_t *dev, const struct iovec *data, unsigned count size_t pkt_len = 2; /* include the FCS (frame check sequence) */ /* wait for any ongoing transmissions to be finished */ + DEBUG("cc2420: tx_exec: waiting for any ongoing transmission\n"); while (cc2420_get_state(dev) & NETOPT_STATE_TX) {} /* get and check the length of the packet */ @@ -186,9 +187,6 @@ size_t cc2420_tx_prepare(cc2420_t *dev, const struct iovec *data, unsigned count void cc2420_tx_exec(cc2420_t *dev) { - /* make sure, any ongoing transmission is finished */ - DEBUG("cc2420: tx_exec: waiting for any ongoing transmission\n"); - while (cc2420_get_state(dev) & NETOPT_STATE_TX) {} /* trigger the transmission */ if (dev->options & CC2420_OPT_TELL_TX_START) { dev->netdev.netdev.event_callback(&dev->netdev.netdev, @@ -203,15 +201,6 @@ void cc2420_tx_exec(cc2420_t *dev) DEBUG("cc2420: tx_exec: triggering TX without CCA\n"); cc2420_strobe(dev, CC2420_STROBE_TXON); } - - while (gpio_read(dev->params.pin_sfd)) { - puts("\t...ongoing}"); - } - if (dev->options & CC2420_OPT_TELL_TX_END) { - dev->netdev.netdev.event_callback(&dev->netdev.netdev, - NETDEV2_EVENT_TX_COMPLETE); - } - DEBUG("cc2420: tx_exec: TX_DONE\n"); } int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info)