aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-26 16:47:16 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-10-03 08:36:11 +1300
commitf7734a8370ecb3d38aa5b4b8f6968eaf6f6f2b42 (patch)
tree8e1fe347dcf41bb8b0d8f542d2ac50f3f244e9d5 /meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch
parent2184b0a74f70b5b5e4fc628ed4e48e9282b555a6 (diff)
downloadmeta-openembedded-contrib-paule/mraa.tar.gz
upm: add recipe from meta-refkit-corepaule/mraa
Make this recipe a little more widely visible (has previously appeared in meta-refkit-core and meta-intel-iot-middleware). Also make couple of minor tweaks: * Fix BINDINGS example to use the correct recipe name (copy-paste error) * Set HOMEPAGE * Drop AUTHOR as this is field is only really intended for older software where there is no real point of contact for upstream other than an author's email address. * Set same COMPATIBLE_HOST as mraa since upm depends upon it Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch')
-rw-r--r--meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch b/meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch
new file mode 100644
index 0000000000..c617d14a1b
--- /dev/null
+++ b/meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch
@@ -0,0 +1,54 @@
+From c64d04d084f47b4cb3e1cdee6e96348fcc6a756e Mon Sep 17 00:00:00 2001
+From: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
+Date: Tue, 30 May 2017 15:14:09 -0700
+Subject: [PATCH 1/1] ads1x15: fixed case logic in getThresh() function
+
+Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
+
+Upstream-Status: Backported [c64d04d084f47b4cb3e1cdee6e96348fcc6a756e]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+---
+ src/ads1x15/ads1x15.cxx | 4 ++--
+ src/ads1x15/ads1x15.hpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/ads1x15/ads1x15.cxx b/src/ads1x15/ads1x15.cxx
+index 35782709..47701b2a 100644
+--- a/src/ads1x15/ads1x15.cxx
++++ b/src/ads1x15/ads1x15.cxx
+@@ -116,7 +116,7 @@ ADS1X15::setContinuous(bool mode){
+
+ float
+ ADS1X15::getThresh(ADSTHRESH reg){
+- if( THRESH_HIGH && THRESH_LOW) return getLastSample(reg);
++ if(reg == THRESH_HIGH || reg == THRESH_LOW) return getLastSample(reg);
+ else return 0.0;
+ }
+
+@@ -137,7 +137,7 @@ ADS1X15::setThresh(ADSTHRESH reg, float value){
+ case 2:
+ case 3:
+ set_value = value / getMultiplier();
+- set_value = set_value << m_bitShift;
++ set_value = set_value << m_bitShift;
+ if(i2c->writeWordReg(reg, swapWord(set_value)) != mraa::SUCCESS){
+ throw std::runtime_error(std::string(__FUNCTION__) + ": I2c.write() failed");
+ return;
+diff --git a/src/ads1x15/ads1x15.hpp b/src/ads1x15/ads1x15.hpp
+index 7524572d..efd8c8ec 100644
+--- a/src/ads1x15/ads1x15.hpp
++++ b/src/ads1x15/ads1x15.hpp
+@@ -390,7 +390,7 @@ namespace upm {
+ * @param reg ADSTHRES enum value.
+ * Returns 0.0 unless THRESH_HIGH or THRESH_LOW requested.
+ */
+- float getThresh(ADSTHRESH reg = THRESH_LOW);
++ float getThresh(ADSTHRESH reg = THRESH_DEFAULT);
+
+ /**
+ * Sets threshold levels or configures for conversion ready
+--
+2.11.0
+