A few cosmetic changes
This commit is contained in:
parent
642aed99cc
commit
399f306744
@ -42,7 +42,6 @@
|
|||||||
* Todo:
|
* Todo:
|
||||||
* - Add support for payloads in ACK packets (?)
|
* - Add support for payloads in ACK packets (?)
|
||||||
* - Add compatibility with nRF24L01 (not +) hardware (?)
|
* - Add compatibility with nRF24L01 (not +) hardware (?)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -116,11 +115,15 @@
|
|||||||
#define FIFO_PIPENO_MASK 0xE0 /* 3 ms bits used to store pipe # */
|
#define FIFO_PIPENO_MASK 0xE0 /* 3 ms bits used to store pipe # */
|
||||||
#define FIFO_PIPENO_SHIFT 4
|
#define FIFO_PIPENO_SHIFT 4
|
||||||
|
|
||||||
#define FIFO_PKTLEN(dev) (((dev->rx_fifo[dev->nxt_read] & FIFO_PKTLEN_MASK) >> FIFO_PKTLEN_SHIFT) + 1)
|
#define FIFO_PKTLEN(dev) \
|
||||||
#define FIFO_PIPENO(dev) (((dev->rx_fifo[dev->nxt_read] & FIFO_PIPENO_MASK) >> FIFO_PIPENO_SHIFT))
|
(((dev->rx_fifo[dev->nxt_read] & FIFO_PKTLEN_MASK) >> FIFO_PKTLEN_SHIFT) + 1)
|
||||||
#define FIFO_HEADER(pktlen,pipeno) ((pktlen - 1) | (pipeno << FIFO_PIPENO_SHIFT))
|
#define FIFO_PIPENO(dev) \
|
||||||
|
(((dev->rx_fifo[dev->nxt_read] & FIFO_PIPENO_MASK) >> FIFO_PIPENO_SHIFT))
|
||||||
|
#define FIFO_HEADER(pktlen,pipeno) \
|
||||||
|
((pktlen - 1) | (pipeno << FIFO_PIPENO_SHIFT))
|
||||||
|
|
||||||
#define DEV_NAME "/dev/nrf24l01"
|
#define DEV_NAME "/dev/nrf24l01"
|
||||||
|
#define FL_AA_ENABLED (1 << 0)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data Types
|
* Private Data Types
|
||||||
@ -132,8 +135,6 @@ typedef enum
|
|||||||
MODE_WRITE
|
MODE_WRITE
|
||||||
} nrf24l01_access_mode_t;
|
} nrf24l01_access_mode_t;
|
||||||
|
|
||||||
#define FL_AA_ENABLED (1 << 0)
|
|
||||||
|
|
||||||
struct nrf24l01_dev_s
|
struct nrf24l01_dev_s
|
||||||
{
|
{
|
||||||
FAR struct spi_dev_s *spi; /* Reference to SPI bus device */
|
FAR struct spi_dev_s *spi; /* Reference to SPI bus device */
|
||||||
@ -800,6 +801,7 @@ static void nrf24l01_tostate(struct nrf24l01_dev_s *dev,
|
|||||||
{
|
{
|
||||||
case ST_UNKNOWN:
|
case ST_UNKNOWN:
|
||||||
/* Power down the module here... */
|
/* Power down the module here... */
|
||||||
|
|
||||||
case ST_POWER_DOWN:
|
case ST_POWER_DOWN:
|
||||||
nrf24l01_chipenable(dev, false);
|
nrf24l01_chipenable(dev, false);
|
||||||
nrf24l01_setregbit(dev, NRF24L01_CONFIG, NRF24L01_PWR_UP, false);
|
nrf24l01_setregbit(dev, NRF24L01_CONFIG, NRF24L01_PWR_UP, false);
|
||||||
@ -1928,7 +1930,8 @@ uint32_t nrf24l01_getradiofreq(FAR struct nrf24l01_dev_s *dev)
|
|||||||
|
|
||||||
int nrf24l01_setaddrwidth(FAR struct nrf24l01_dev_s *dev, uint32_t width)
|
int nrf24l01_setaddrwidth(FAR struct nrf24l01_dev_s *dev, uint32_t width)
|
||||||
{
|
{
|
||||||
CHECK_ARGS(dev && width <= NRF24L01_MAX_ADDR_LEN && width >= NRF24L01_MIN_ADDR_LEN);
|
CHECK_ARGS(dev && width <= NRF24L01_MAX_ADDR_LEN &&
|
||||||
|
width >= NRF24L01_MIN_ADDR_LEN);
|
||||||
|
|
||||||
nrf24l01_lock(dev->spi);
|
nrf24l01_lock(dev->spi);
|
||||||
nrf24l01_writeregbyte(dev, NRF24L01_SETUP_AW, width-2);
|
nrf24l01_writeregbyte(dev, NRF24L01_SETUP_AW, width-2);
|
||||||
|
@ -322,7 +322,6 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_SEM_NNESTPRIO > 0
|
#if CONFIG_SEM_NNESTPRIO > 0
|
||||||
|
|
||||||
/* If the priority of the thread that is waiting for a count is greater
|
/* If the priority of the thread that is waiting for a count is greater
|
||||||
* than the base priority of the thread holding a count, then we may need
|
* than the base priority of the thread holding a count, then we may need
|
||||||
* to adjust the holder's priority now or later to that priority.
|
* to adjust the holder's priority now or later to that priority.
|
||||||
|
Loading…
Reference in New Issue
Block a user