You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/05/15 13:19:51 UTC
[incubator-nuttx-apps] branch master updated: examples/nrf24l01: Replace the hardcode value with enum const
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 02da51ddf examples/nrf24l01: Replace the hardcode value with enum const
02da51ddf is described below
commit 02da51ddf5ac6fa74a2848fdd7892ee018c17a18
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue May 10 22:54:27 2022 +0800
examples/nrf24l01: Replace the hardcode value with enum const
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
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';
}