[riot-notifications] [RIOT-OS/RIOT] drivers/ph_oem: support for Atlas Scientific pH OEM sensor (#10983)

Leandro Lanzieri notifications at github.com
Tue Feb 26 19:45:32 CET 2019


leandrolanzieri commented on this pull request.



> +
+/* off by default, so it won't reset your previous calibration */
+#define CALIBRATION_TEST_ENABLED    (false)
+
+static ph_oem_t dev;
+
+static void interrupt_pin_cb(void *arg)
+{
+    puts("\n[IRQ - Reading done]");
+
+    /* stop pH sensor from taking further readings*/
+    ph_oem_set_device_state(&dev, PH_OEM_STOP_READINGS);
+
+    /* reset interrupt pin in case of falling or rising flank */
+    if (dev.params.irq_option != PH_OEM_IRQ_BOTH) {
+        ph_oem_reset_interrupt_pin(&dev);

Sorry, just realized that this callback is being called in [interrupt context](http://doc.riot-os.org/group__drivers__periph__gpio.html#ga48ba4c318486db320a4bf6237b49d61c), and that none of this functions (which access the I2C bus) should be called here. Instead use some mechanism such as [events](http://doc.riot-os.org/group__sys__event.html)

-- 
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/10983#discussion_r260431337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190226/131e891b/attachment.html>


More information about the notifications mailing list