1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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 <joakim.gebart@eistec.se>
This commit is contained in:
Joakim Gebart 2015-01-16 13:22:46 +01:00
parent af1ddef1fb
commit a991d7c58e

View File

@ -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);