mirror of
https://github.com/utkumaden/esp-idf-bmx280
synced 2026-04-20 01:39:36 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 820c044634 | |||
| 93e47861b3 | |||
| 1e18e7a815 | |||
| 91c142fd5d |
+17
-2
@@ -1,7 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
if ("${CONFIG_USE_I2C_LEGACY_DRIVER}")
|
||||
if ("$ENV{IDF_VERSION}" VERSION_GREATER_EQUAL "7.0.0")
|
||||
message(SEND_ERROR "[ BMX280 ] The legacy I2C driver has been removed since version 7.0.0. Unless you intended to compile for older IDF versions, change your build configuration to use the I2C master driver.")
|
||||
else()
|
||||
message(WARNING "[ BMX280 ] The legacy I2C driver has been deprecated since version 6.0.0. The driver will not compile with the legacy I2C driver enabled in version 7.0.0 or later.")
|
||||
endif()
|
||||
|
||||
message(STATUS "[ BMX280 ] Using the legacy I2C driver.")
|
||||
set(BMX280_I2C_DRIVER_REQUIRE "driver")
|
||||
else()
|
||||
message(STATUS "[ BMX280 ] Using the new I2C master driver.")
|
||||
set(BMX280_I2C_DRIVER_REQUIRE "esp_driver_i2c")
|
||||
endif()
|
||||
|
||||
idf_component_register(
|
||||
SRCS bmx280.c
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES driver
|
||||
REQUIRES "${BMX280_I2C_DRIVER_REQUIRE}"
|
||||
)
|
||||
|
||||
@@ -634,7 +634,7 @@ esp_err_t bmx280_readout(bmx280_t *bmx280, int32_t *temperature, uint32_t *press
|
||||
return error;
|
||||
|
||||
*temperature = BME280_compensate_T_int32(bmx280,
|
||||
(buffer[0] << 12) | (buffer[1] << 4) | (buffer[0] >> 4)
|
||||
(buffer[0] << 12) | (buffer[1] << 4) | (buffer[2] >> 4)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ esp_err_t bmx280_readout(bmx280_t *bmx280, int32_t *temperature, uint32_t *press
|
||||
return error;
|
||||
|
||||
*pressure = BME280_compensate_P_int64(bmx280,
|
||||
(buffer[0] << 12) | (buffer[1] << 4) | (buffer[0] >> 4)
|
||||
(buffer[0] << 12) | (buffer[1] << 4) | (buffer[2] >> 4)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ typedef enum bmx280_tstby_t {
|
||||
|
||||
typedef enum bmx280_iirf_t {
|
||||
BMX280_IIR_NONE = 0x0,
|
||||
BMX280_IIR_X1,
|
||||
BMX280_IIR_X2,
|
||||
BMX280_IIR_X4,
|
||||
BMX280_IIR_X8,
|
||||
|
||||
Reference in New Issue
Block a user