From 101e6854c072a4519c03d9e4b17f9ac1c164e83b Mon Sep 17 00:00:00 2001 From: wgz-code <820906721@qq.com> Date: Thu, 17 Mar 2022 14:35:28 +0800 Subject: [PATCH] set SX127X_DEV_NAME=CONFIG_ADAPTER_SX1278_DRIVER ifdef CONFIG_ADAPTER_SX1278_DRIVER --- .../apps/examples/sx127x_demo/sx127x_demo.c | 7 ++++++- .../nuttx/drivers/wireless/lpwan/sx127x/sx127x.c | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Ubiquitous/Nuttx/app_match_nuttx/apps/examples/sx127x_demo/sx127x_demo.c b/Ubiquitous/Nuttx/app_match_nuttx/apps/examples/sx127x_demo/sx127x_demo.c index 3e2b59cf5..66b972417 100644 --- a/Ubiquitous/Nuttx/app_match_nuttx/apps/examples/sx127x_demo/sx127x_demo.c +++ b/Ubiquitous/Nuttx/app_match_nuttx/apps/examples/sx127x_demo/sx127x_demo.c @@ -47,7 +47,12 @@ * Pre-processor Definitions ****************************************************************************/ -#define DEV_NAME "/dev/sx127x" +#ifdef CONFIG_ADAPTER_SX1278_DRIVER +# define DEV_NAME CONFIG_ADAPTER_SX1278_DRIVER +#else +# define DEV_NAME "/dev/sx127x" +#endif + #define TX_BUFFER_MAX 255 /**************************************************************************** diff --git a/Ubiquitous/Nuttx/app_match_nuttx/nuttx/drivers/wireless/lpwan/sx127x/sx127x.c b/Ubiquitous/Nuttx/app_match_nuttx/nuttx/drivers/wireless/lpwan/sx127x/sx127x.c index f20eafc77..d36d29aa5 100644 --- a/Ubiquitous/Nuttx/app_match_nuttx/nuttx/drivers/wireless/lpwan/sx127x/sx127x.c +++ b/Ubiquitous/Nuttx/app_match_nuttx/nuttx/drivers/wireless/lpwan/sx127x/sx127x.c @@ -63,8 +63,11 @@ /* Configuration ************************************************************/ /* Device name */ - -#define SX127X_DEV_NAME "/dev/sx127x" +#ifdef CONFIG_ADAPTER_SX1278_DRIVER +# define SX127X_DEV_NAME CONFIG_ADAPTER_SX1278_DRIVER +#else +# define SX127X_DEV_NAME "/dev/sx127x" +#endif /* Payload fixlen default */