High resolution barometer and altimeter using i2c mode. Adapted to FreeIMU interface
Dependents: FreeIMU FreeIMU_external_magnetometer FreeIMU
Fork of ms5611 by
Revision 9:9f1d38b8d7c3, committed 2018-03-07
- Comitter:
- tyftyftyf
- Date:
- Wed Mar 07 04:13:14 2018 +0000
- Parent:
- 8:f3660f819e54
- Child:
- 10:7802dc3ef0a0
- Commit message:
- test
Changed in this revision
| MS561101BA.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MS561101BA.cpp Sat Nov 09 08:51:15 2013 +0000
+++ b/MS561101BA.cpp Wed Mar 07 04:13:14 2018 +0000
@@ -33,21 +33,22 @@
#define I2C_SCL p27
#endif
-MS561101BA::MS561101BA():i2c(I2C_SDA,I2C_SCL),_thread(&MS561101BA::samplingthread_stub, this),sem(0){
+MS561101BA::MS561101BA() : i2c(I2C_SDA,I2C_SCL), _thread(), sem(0){
zero = 0;
MS561101BA_RESET = 0x1E;
_OSR = NULL;
+ _thread.start(callback(&MS561101BA::samplingthread_stub, (void *) this));
}
void MS561101BA::init(uint8_t address) {
lastPresConv=0;
lastTempConv=0;
- t.start();
- _addr = address << 1;
+ t.start();
+ _addr = address << 1;
- reset(); // reset the device to populate its internal PROM registers
- Thread::wait(500); // some safety time
- readPROM(); // reads the PROM into object variables for later use
+ reset(); // reset the device to populate its internal PROM registers
+ Thread::wait(500); // some safety time
+ readPROM(); // reads the PROM into object variables for later use
}
void MS561101BA::samplingthread_stub(void const *p) {
