examples/nrf24l01: Replace the hardcode value with enum const

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-05-10 22:54:27 +08:00 committed by Petro Karashchenko
parent 24c16780e2
commit 02da51ddf5
2 changed files with 3 additions and 9 deletions

View File

@ -218,17 +218,11 @@ int nrf24_cfg(int fd)
uint32_t rf = NRF24L01_MIN_FREQ + frequency[current]; uint32_t rf = NRF24L01_MIN_FREQ + frequency[current];
int32_t txpow = DEFAULT_TXPOWER; int32_t txpow = DEFAULT_TXPOWER;
/************************************************************************** nrf24l01_datarate_t datarate = RATE_1Mbps;
* if using RATE_1Mbps from include/nuttx/wireless/nrf24l01.h,
* tools/checkpatch.sh report error: Mixed case identifier found.
*
**************************************************************************/
nrf24l01_datarate_t datarate = 0; /* RATE_1Mbps */
nrf24l01_retrcfg_t retrcfg = nrf24l01_retrcfg_t retrcfg =
{ {
.count = 0, .count = 0,
.delay = 3 /* DELAY_1000us */ .delay = DELAY_1000us
}; };
uint32_t addrwidth = 4; uint32_t addrwidth = 4;

View File

@ -192,7 +192,7 @@ int send_pkt(int wl_fd)
len = strlen(buff); len = strlen(buff);
if (len > 0 && buff[len - 1] == '\n') if (len > 0 && buff[len - 1] == '\n')
{ {
len --; len--;
buff[len] = '\0'; buff[len] = '\0';
} }