diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-10-03 08:40:10 +1300 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-10-04 14:53:31 +0000 |
| commit | a43751b149e1517ee59b0d7ea7484510f6ab420e (patch) | |
| tree | f2b05577a3b7e88c22f624025da5030efb144e19 | |
| parent | c2a7348684763fffa7558b67cbc4fc8c88d0b137 (diff) | |
| download | meta-openembedded-a43751b149e1517ee59b0d7ea7484510f6ab420e.tar.gz | |
upm: add recipe from meta-refkit-core
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>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | meta-oe/recipes-extended/upm/files/ads1x15-fixed-case-logic-in-getThresh-function.patch | 54 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/upm/upm_git.bb | 45 |
2 files changed, 99 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 @@ | |||
| 1 | From c64d04d084f47b4cb3e1cdee6e96348fcc6a756e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mihai Tudor Panu <mihai.tudor.panu@intel.com> | ||
| 3 | Date: Tue, 30 May 2017 15:14:09 -0700 | ||
| 4 | Subject: [PATCH 1/1] ads1x15: fixed case logic in getThresh() function | ||
| 5 | |||
| 6 | Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com> | ||
| 7 | |||
| 8 | Upstream-Status: Backported [c64d04d084f47b4cb3e1cdee6e96348fcc6a756e] | ||
| 9 | |||
| 10 | Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> | ||
| 11 | |||
| 12 | --- | ||
| 13 | src/ads1x15/ads1x15.cxx | 4 ++-- | ||
| 14 | src/ads1x15/ads1x15.hpp | 2 +- | ||
| 15 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/src/ads1x15/ads1x15.cxx b/src/ads1x15/ads1x15.cxx | ||
| 18 | index 35782709..47701b2a 100644 | ||
| 19 | --- a/src/ads1x15/ads1x15.cxx | ||
| 20 | +++ b/src/ads1x15/ads1x15.cxx | ||
| 21 | @@ -116,7 +116,7 @@ ADS1X15::setContinuous(bool mode){ | ||
| 22 | |||
| 23 | float | ||
| 24 | ADS1X15::getThresh(ADSTHRESH reg){ | ||
| 25 | - if( THRESH_HIGH && THRESH_LOW) return getLastSample(reg); | ||
| 26 | + if(reg == THRESH_HIGH || reg == THRESH_LOW) return getLastSample(reg); | ||
| 27 | else return 0.0; | ||
| 28 | } | ||
| 29 | |||
| 30 | @@ -137,7 +137,7 @@ ADS1X15::setThresh(ADSTHRESH reg, float value){ | ||
| 31 | case 2: | ||
| 32 | case 3: | ||
| 33 | set_value = value / getMultiplier(); | ||
| 34 | - set_value = set_value << m_bitShift; | ||
| 35 | + set_value = set_value << m_bitShift; | ||
| 36 | if(i2c->writeWordReg(reg, swapWord(set_value)) != mraa::SUCCESS){ | ||
| 37 | throw std::runtime_error(std::string(__FUNCTION__) + ": I2c.write() failed"); | ||
| 38 | return; | ||
| 39 | diff --git a/src/ads1x15/ads1x15.hpp b/src/ads1x15/ads1x15.hpp | ||
| 40 | index 7524572d..efd8c8ec 100644 | ||
| 41 | --- a/src/ads1x15/ads1x15.hpp | ||
| 42 | +++ b/src/ads1x15/ads1x15.hpp | ||
| 43 | @@ -390,7 +390,7 @@ namespace upm { | ||
| 44 | * @param reg ADSTHRES enum value. | ||
| 45 | * Returns 0.0 unless THRESH_HIGH or THRESH_LOW requested. | ||
| 46 | */ | ||
| 47 | - float getThresh(ADSTHRESH reg = THRESH_LOW); | ||
| 48 | + float getThresh(ADSTHRESH reg = THRESH_DEFAULT); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Sets threshold levels or configures for conversion ready | ||
| 52 | -- | ||
| 53 | 2.11.0 | ||
| 54 | |||
diff --git a/meta-oe/recipes-extended/upm/upm_git.bb b/meta-oe/recipes-extended/upm/upm_git.bb new file mode 100644 index 0000000000..38065ce534 --- /dev/null +++ b/meta-oe/recipes-extended/upm/upm_git.bb | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | SUMMARY = "Sensor/Actuator repository for Mraa" | ||
| 2 | HOMEPAGE = "https://github.com/intel-iot-devkit/upm" | ||
| 3 | SECTION = "libs" | ||
| 4 | |||
| 5 | LICENSE = "MIT" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=66493d54e65bfc12c7983ff2e884f37f" | ||
| 7 | |||
| 8 | DEPENDS = "libjpeg-turbo mraa" | ||
| 9 | |||
| 10 | SRCREV = "106b6c706268522ab0168a4ddb19e89ce832e084" | ||
| 11 | PV = "1.3.0-git${SRCPV}" | ||
| 12 | |||
| 13 | SRC_URI = " \ | ||
| 14 | git://github.com/intel-iot-devkit/${BPN}.git;protocol=http \ | ||
| 15 | file://ads1x15-fixed-case-logic-in-getThresh-function.patch \ | ||
| 16 | " | ||
| 17 | |||
| 18 | S = "${WORKDIR}/git" | ||
| 19 | |||
| 20 | # Depends on mraa which only supports x86 and ARM for now | ||
| 21 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux" | ||
| 22 | |||
| 23 | inherit distutils3-base cmake | ||
| 24 | |||
| 25 | |||
| 26 | # override this in local.conf to get needed bindings. | ||
| 27 | # BINDINGS_pn-upm="python" | ||
| 28 | # will result in only the python bindings being built/packaged. | ||
| 29 | BINDINGS ??= "python ${@ 'nodejs' if oe.types.boolean(d.getVar('HAVE_NODEJS') or '0') else '' }" | ||
| 30 | |||
| 31 | PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \ | ||
| 32 | ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}" | ||
| 33 | |||
| 34 | PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN}," | ||
| 35 | PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native," | ||
| 36 | |||
| 37 | FILES_${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}" | ||
| 38 | RDEPENDS_${PYTHON_PN}-${PN} += "${PYTHON_PN}" | ||
| 39 | |||
| 40 | FILES_node-${PN} = "${prefix}/lib/node_modules/" | ||
| 41 | RDEPENDS_node-${PN} += "nodejs" | ||
| 42 | |||
| 43 | ### Include desired language bindings ### | ||
| 44 | PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}" | ||
| 45 | PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}" | ||
