From a991d7c58e7c95f97f3cbad85f14ee1ac8288e62 Mon Sep 17 00:00:00 2001 From: Joakim Gebart Date: Fri, 16 Jan 2015 13:22:46 +0100 Subject: [PATCH] nrf24l01p: Remove redundant gpio_clear/gpio_set. This change removes extra gpio_clear(dev->cs) before calling nrf24l01p_read_reg(), nrf24l01p_write_reg(). The GPIO handling is not necessary since nrf24l01p_{read,write}_reg() handle the CS pin internally. Signed-off-by: Joakim Gebart --- drivers/nrf24l01p/nrf24l01p.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c index 7ffe844309..df48c40257 100644 --- a/drivers/nrf24l01p/nrf24l01p.c +++ b/drivers/nrf24l01p/nrf24l01p.c @@ -189,12 +189,10 @@ int nrf24l01p_on(nrf24l01p_t *dev) char read; int status; - gpio_clear(dev->cs); nrf24l01p_read_reg(dev, REG_CONFIG, &read); hwtimer_spin(DELAY_CS_TOGGLE_TICKS); status = nrf24l01p_write_reg(dev, REG_CONFIG, (read | PWR_UP)); hwtimer_spin(DELAY_CS_TOGGLE_TICKS); - gpio_set(dev->cs); hwtimer_wait(DELAY_CHANGE_PWR_MODE_US); @@ -206,12 +204,10 @@ int nrf24l01p_off(nrf24l01p_t *dev) char read; int status; - gpio_clear(dev->cs); nrf24l01p_read_reg(dev, REG_CONFIG, &read); hwtimer_spin(DELAY_CS_TOGGLE_TICKS); status = nrf24l01p_write_reg(dev, REG_CONFIG, (read & ~PWR_UP)); hwtimer_spin(DELAY_CS_TOGGLE_TICKS); - gpio_set(dev->cs); hwtimer_wait(DELAY_CHANGE_PWR_MODE_US);