NRF24L01: Fix backward calculation of relative frequency. Noted by Henry Zhang

This commit is contained in:
Gregory Nutt 2016-04-15 07:07:22 -06:00
parent 84cd720479
commit 1f8212679c
2 changed files with 3 additions and 1 deletions

View File

@ -11649,4 +11649,6 @@
configurations (2015-04-14).
* Framebuffer driver: Add a display number to each interface in order
to support multiple display devices (2015-04-14).
* drivers/wireless/nrf24l01.c: Fix backward calculation of relative
frequency. Noted by Henry Zhang (2015-04-15).

View File

@ -1590,7 +1590,7 @@ int nrf24l01_setradiofreq(FAR struct nrf24l01_dev_s *dev, uint32_t freq)
CHECK_ARGS(dev && freq >= NRF24L01_MIN_FREQ && freq <= NRF24L01_MAX_FREQ);
value = NRF24L01_MIN_FREQ - freq;
value = freq - NRF24L01_MIN_FREQ;
nrf24l01_lock(dev->spi);
nrf24l01_writeregbyte(dev, NRF24L01_RF_CH, value);
nrf24l01_unlock(dev->spi);