forked from adafruit/Adafruit_BMP085_Unified
removed more arduino bullshit functions
This commit is contained in:
@ -50,9 +50,12 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <espchrono.h>
|
#include <espchrono.h>
|
||||||
|
#include <tickchrono.h>
|
||||||
|
|
||||||
#include "Adafruit_BMP085_U.h"
|
#include "Adafruit_BMP085_U.h"
|
||||||
|
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
static bmp085_calib_data
|
static bmp085_calib_data
|
||||||
_bmp085_coeffs; // Last read accelerometer data will be available here
|
_bmp085_coeffs; // Last read accelerometer data will be available here
|
||||||
static uint8_t _bmp085Mode;
|
static uint8_t _bmp085Mode;
|
||||||
@ -197,7 +200,7 @@ static std::optional<int32_t> readRawTemperature() {
|
|||||||
#else
|
#else
|
||||||
bool succ{true};
|
bool succ{true};
|
||||||
if (!writeCommand(BMP085_REGISTER_CONTROL, BMP085_REGISTER_READTEMPCMD)) { DBGPRNT("fail"); succ = false; }
|
if (!writeCommand(BMP085_REGISTER_CONTROL, BMP085_REGISTER_READTEMPCMD)) { DBGPRNT("fail"); succ = false; }
|
||||||
delay(5);
|
espcpputils::delay(5ms);
|
||||||
uint16_t t;
|
uint16_t t;
|
||||||
if (!read16(BMP085_REGISTER_TEMPDATA, &t)) { DBGPRNT("fail"); succ = false; }
|
if (!read16(BMP085_REGISTER_TEMPDATA, &t)) { DBGPRNT("fail"); succ = false; }
|
||||||
if (succ)
|
if (succ)
|
||||||
@ -222,17 +225,17 @@ static std::optional<int32_t> readRawPressure() {
|
|||||||
BMP085_REGISTER_READPRESSURECMD + (_bmp085Mode << 6))) { DBGPRNT("fail"); succ = false; }
|
BMP085_REGISTER_READPRESSURECMD + (_bmp085Mode << 6))) { DBGPRNT("fail"); succ = false; }
|
||||||
switch (_bmp085Mode) {
|
switch (_bmp085Mode) {
|
||||||
case BMP085_MODE_ULTRALOWPOWER:
|
case BMP085_MODE_ULTRALOWPOWER:
|
||||||
delay(5);
|
espcpputils::delay(5ms);
|
||||||
break;
|
break;
|
||||||
case BMP085_MODE_STANDARD:
|
case BMP085_MODE_STANDARD:
|
||||||
delay(8);
|
espcpputils::delay(8ms);
|
||||||
break;
|
break;
|
||||||
case BMP085_MODE_HIGHRES:
|
case BMP085_MODE_HIGHRES:
|
||||||
delay(14);
|
espcpputils::delay(14ms);
|
||||||
break;
|
break;
|
||||||
case BMP085_MODE_ULTRAHIGHRES:
|
case BMP085_MODE_ULTRAHIGHRES:
|
||||||
default:
|
default:
|
||||||
delay(26);
|
espcpputils::delay(26ms);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ set(sources
|
|||||||
set(dependencies
|
set(dependencies
|
||||||
arduino-esp32
|
arduino-esp32
|
||||||
Adafruit_Sensor
|
Adafruit_Sensor
|
||||||
|
espcpputils
|
||||||
|
espchrono
|
||||||
)
|
)
|
||||||
|
|
||||||
idf_component_register(
|
idf_component_register(
|
||||||
|
Reference in New Issue
Block a user