libupm: add fixes for 2 sensors
authorJohn Crispin <blogic@openwrt.org>
Tue, 20 Oct 2015 13:58:30 +0000 (15:58 +0200)
committerJohn Crispin <blogic@openwrt.org>
Tue, 20 Oct 2015 13:59:25 +0000 (15:59 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
libs/libupm/patches/002-at42qt1070-id.patch [new file with mode: 0644]
libs/libupm/patches/003-lsm303-args.patch [new file with mode: 0644]

diff --git a/libs/libupm/patches/002-at42qt1070-id.patch b/libs/libupm/patches/002-at42qt1070-id.patch
new file mode 100644 (file)
index 0000000..85544c9
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/at42qt1070/at42qt1070.cxx
++++ b/src/at42qt1070/at42qt1070.cxx
+@@ -53,7 +53,7 @@
+         return;
+     }
+-    if (readChipID() != 0x2E) {
++    if (readChipID() != 0x1b && readChipID() != 0x2E) {
+         throw std::runtime_error("Chip ID does not match the expected value (2Eh)");
+     }
diff --git a/libs/libupm/patches/003-lsm303-args.patch b/libs/libupm/patches/003-lsm303-args.patch
new file mode 100644 (file)
index 0000000..d2b2d0e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lsm303/lsm303.h
++++ b/src/lsm303/lsm303.h
+@@ -34,7 +34,7 @@
+ /* LSM303 Address definitions */
+ #define LSM303_MAG 0x1E // assuming SA0 grounded
+-#define LSM303_ACC 0x18 // assuming SA0 grounded
++#define LSM303_ACC 0x1E // assuming SA0 grounded
+ /* LSM303 Register definitions */
+ #define CTRL_REG1_A 0x20