From 1f8212679cfef610a0601c547eb94420c02fb258 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 15 Apr 2016 07:07:22 -0600 Subject: [PATCH] NRF24L01: Fix backward calculation of relative frequency. Noted by Henry Zhang --- ChangeLog | 2 ++ drivers/wireless/nrf24l01.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7ed20c82d2..eafb935383 100755 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/drivers/wireless/nrf24l01.c b/drivers/wireless/nrf24l01.c index ab7402d773..eb6c3f68c8 100644 --- a/drivers/wireless/nrf24l01.c +++ b/drivers/wireless/nrf24l01.c @@ -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);