From 5b87cca98bc18a0af11387c5e65c2643d57cc229 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Sat, 20 Feb 2021 19:04:57 +0100 Subject: [PATCH] samples: shields: lmp90100_evb: rtd: use newlib sqrt when available Avoid using local sqrt() approximation when newlib is enabled. Signed-off-by: Henrik Brix Andersen --- samples/shields/lmp90100_evb/rtd/src/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/shields/lmp90100_evb/rtd/src/main.c b/samples/shields/lmp90100_evb/rtd/src/main.c index 65a10cb34f00..3239fdae97eb 100644 --- a/samples/shields/lmp90100_evb/rtd/src/main.c +++ b/samples/shields/lmp90100_evb/rtd/src/main.c @@ -8,6 +8,7 @@ #include #include #include +#include #define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL #include @@ -25,6 +26,7 @@ LOG_MODULE_REGISTER(main); /* Bottom resistor value in ohms */ #define BOTTOM_RESISTANCE 2000 +#ifndef CONFIG_NEWLIB_LIBC static double sqrt(double value) { double sqrt = value / 3; @@ -40,6 +42,7 @@ static double sqrt(double value) return sqrt; } +#endif /* CONFIG_NEWLIB_LIBC */ static double rtd_temperature(int nom, double resistance) {