From 02da51ddf5ac6fa74a2848fdd7892ee018c17a18 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 10 May 2022 22:54:27 +0800 Subject: [PATCH] examples/nrf24l01: Replace the hardcode value with enum const Signed-off-by: Xiang Xiao --- examples/nrf24l01_btle/nrf24l01_btle.c | 10 ++-------- examples/nrf24l01_term/nrf24l01_term.c | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/nrf24l01_btle/nrf24l01_btle.c b/examples/nrf24l01_btle/nrf24l01_btle.c index bc976e421..49142cac1 100644 --- a/examples/nrf24l01_btle/nrf24l01_btle.c +++ b/examples/nrf24l01_btle/nrf24l01_btle.c @@ -218,17 +218,11 @@ int nrf24_cfg(int fd) uint32_t rf = NRF24L01_MIN_FREQ + frequency[current]; int32_t txpow = DEFAULT_TXPOWER; - /************************************************************************** - * 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_datarate_t datarate = RATE_1Mbps; nrf24l01_retrcfg_t retrcfg = { .count = 0, - .delay = 3 /* DELAY_1000us */ + .delay = DELAY_1000us }; uint32_t addrwidth = 4; diff --git a/examples/nrf24l01_term/nrf24l01_term.c b/examples/nrf24l01_term/nrf24l01_term.c index 80cec95cf..badbaef93 100644 --- a/examples/nrf24l01_term/nrf24l01_term.c +++ b/examples/nrf24l01_term/nrf24l01_term.c @@ -192,7 +192,7 @@ int send_pkt(int wl_fd) len = strlen(buff); if (len > 0 && buff[len - 1] == '\n') { - len --; + len--; buff[len] = '\0'; }