From 21562e8960e03eb0615c92ade94ff8c1e1296367 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Mon, 14 Jun 2021 11:18:11 +0200 Subject: [PATCH] examples/dhtxx: added configuration option for dhtxx sensor devpath Signed-off-by: Michal Lenc --- examples/dhtxx/Kconfig | 6 ++++++ examples/dhtxx/dhtxx_main.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/dhtxx/Kconfig b/examples/dhtxx/Kconfig index 7ba8c504a..7489520a2 100644 --- a/examples/dhtxx/Kconfig +++ b/examples/dhtxx/Kconfig @@ -18,6 +18,12 @@ config EXAMPLES_DHTXX_PROGNAME This is the name of the program that will be used when the NSH ELF program is installed. +config EXAMPLES_DHTXX_DEVPATH + string "Device path" + default "/dev/hum0" + ---help--- + The device path + config EXAMPLES_DHTXX_PRIORITY int "Dhtxx task priority" default 100 diff --git a/examples/dhtxx/dhtxx_main.c b/examples/dhtxx/dhtxx_main.c index ac1ca8a1a..5b992edaa 100644 --- a/examples/dhtxx/dhtxx_main.c +++ b/examples/dhtxx/dhtxx_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/dhtxx/dhtxx_main.c + * apps/examples/dhtxx/dhtxx_main.c * * Copyright (C) 2018 Abdelatif GUETTOUCHE. All rights reserved. * Author: Abdelatif GUETTOUCHE @@ -61,7 +61,7 @@ int main(int argc, FAR char *argv[]) printf("Dhtxx app is running.\n"); - fd = open("/dev/dht0", O_RDWR); + fd = open(CONFIG_EXAMPLES_DHTXX_DEVPATH, O_RDWR); for (i = 0; i < 20; i++) {