[riot-notifications] [RIOT-OS/RIOT] drivers/tmp00x : Expose Configurations to Kconfig (#13989)

Leandro Lanzieri notifications at github.com
Mon May 18 15:06:47 CEST 2020


@leandrolanzieri commented on this pull request.



> @@ -69,12 +70,12 @@ void auto_init_tmp00x(void)
             LOG_ERROR("[auto_init_saul] error set active tmp00x #%u\n", i);
             continue;
         }
-#if TMP00X_USE_LOW_POWER
-        if (tmp00x_set_standby(&tmp00x_devs[i]) != TMP00X_OK) {
-            LOG_ERROR("[auto_init_saul] error set standby tmp00x #%u\n", i);
-            continue;
-        }
-#endif
+    if (IS_ACTIVE(CONFIG_TMP00X_USE_LOW_POWER)) {

Indentation is off

> +
+    if (IS_ACTIVE(CONFIG_TMP00X_USE_LOW_POWER)) {
+        if (tmp00x_set_active(dev)) {
+            return TMP00X_ERROR;
+        }
+        xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
+    }
+
+    if (IS_ACTIVE(CONFIG_TMP00X_USE_RAW_VALUES)) {
+        if ((ret = tmp00x_read(dev, to, ta, &drdy)) < 0) {
+            return ret;
+        }
+
+        if (!drdy) {
+            if (IS_ACTIVE(CONFIG_TMP00X_USE_LOW_POWER)) {
+            tmp00x_set_standby(dev);

Indentation

> +        if (!drdy) {
+            if (IS_ACTIVE(CONFIG_TMP00X_USE_LOW_POWER)) {
+            tmp00x_set_standby(dev);
+            }
+            return -TMP00X_ERROR;
+        }
+    }
+    else {
+        if ((ret = tmp00x_read(dev, &rawvolt, &rawtemp, &drdy)) < 0) {
+            return ret;
+        }
+
+        if (!drdy) {
+            if (IS_ACTIVE(CONFIG_TMP00X_USE_LOW_POWER)) {
+                tmp00x_set_standby(dev);
+            }
         return -TMP00X_ERROR;

Same here

>          return -TMP00X_ERROR;
-    }
-#else
-    if ((ret = tmp00x_read(dev, &rawvolt, &rawtemp, &drdy)) < 0) {
-        return ret;
-    }
-
-    if (!drdy) {
-#if TMP00X_USE_LOW_POWER
-        tmp00x_set_standby(dev);
-#endif
-        return -TMP00X_ERROR;
-    }
-
+        }
     tmp00x_convert(rawvolt, rawtemp,  &tamb, &tobj);
     *ta = (int16_t)(tamb*100);
     *to = (int16_t)(tobj*100);

Same here

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13989#pullrequestreview-413567476
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200518/4d29d826/attachment.htm>


More information about the notifications mailing list