Skip to content

Commit 0866cd3

Browse files
committed
now compatible with idf v5.1.2
1 parent 19f8b79 commit 0866cd3

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
mkdir -p ~/esp
3030
cd ~/esp
31-
git clone -b v4.4 --recursive https://github.com/espressif/esp-idf.git
31+
git clone -b v5.1.2 --recursive https://github.com/espressif/esp-idf.git
3232
cd esp-idf
3333
./install.sh esp32
3434

BNO055ESP32.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void BNO055::uart_readLen(bno055_reg_t reg, uint8_t *buffer, uint8_t len, uint32
170170
data = (uint8_t *)malloc(len + 2);
171171
if (data == NULL) throw std::bad_alloc(); // malloc failed
172172
}
173-
rxBytes = uart_read_bytes(_uartPort, data, (len + 2), timeoutMS / portTICK_RATE_MS);
173+
rxBytes = uart_read_bytes(_uartPort, data, (len + 2), timeoutMS / portTICK_PERIOD_MS);
174174
if (rxBytes > 0) {
175175
#ifndef BNO055_DEBUG_OFF
176176
ESP_LOGD(BNO055_LOG_TAG, "(RL) Read %d bytes", rxBytes);
@@ -231,7 +231,7 @@ void BNO055::uart_writeLen(bno055_reg_t reg, uint8_t *data2write, uint8_t len, u
231231
#endif
232232

233233
if (timeoutMS > 0) { // check response (if expected)
234-
rxBytes = uart_read_bytes(_uartPort, data, 2, timeoutMS / portTICK_RATE_MS);
234+
rxBytes = uart_read_bytes(_uartPort, data, 2, timeoutMS / portTICK_PERIOD_MS);
235235
if (rxBytes > 0) {
236236
#ifndef BNO055_DEBUG_OFF
237237
ESP_LOGD(BNO055_LOG_TAG, "(WL) Read %d bytes", rxBytes); // DEBUG
@@ -406,7 +406,7 @@ void BNO055::reset() {
406406
#ifndef BNO055_DEBUG_OFF
407407
ESP_LOGD(BNO055_LOG_TAG, "RST -> using hardware pin"); // DEBUG
408408
#endif
409-
gpio_pad_select_gpio(_rstPin);
409+
gpio_reset_pin(_rstPin);
410410
gpio_set_direction(_rstPin, GPIO_MODE_OUTPUT);
411411
gpio_set_level(_rstPin, 0); // turn OFF
412412
vTaskDelay(1 / portTICK_PERIOD_MS);
@@ -790,7 +790,7 @@ void BNO055::begin() {
790790
}
791791

792792
if (_intPin != GPIO_NUM_MAX) {
793-
gpio_pad_select_gpio(_intPin);
793+
gpio_reset_pin(_intPin);
794794
gpio_set_direction(_intPin, GPIO_MODE_INPUT);
795795
gpio_set_intr_type(_intPin, GPIO_INTR_POSEDGE);
796796
gpio_set_pull_mode(_intPin, GPIO_PULLDOWN_ONLY);

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
idf_component_register(SRCS "BNO055ESP32.cpp" INCLUDE_DIRS "include")
1+
idf_component_register(SRCS "BNO055ESP32.cpp" INCLUDE_DIRS "include" REQUIRES driver)

Dockerfile.test_build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG IDF_VER=v4.4
1+
ARG IDF_VER=v5.1.2
22
FROM espressif/idf:${IDF_VER}
33

44
SHELL ["/bin/bash", "-c"]

idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
version: "1.2.1"
1+
version: "1.3.0"
22
description: A C++ Interface for Bosch-Sensortec's BNO055 IMU
33
url: https://github.com/ShellAddicted/BNO055ESP32.git
44
dependencies:
5-
idf: ">=4.1"
5+
idf: ">=5.1"

include/BNO055ESP32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ class BNO055 {
663663
.stop_bits = UART_STOP_BITS_1,
664664
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
665665
.rx_flow_ctrl_thresh = 0,
666-
.use_ref_tick = false};
666+
.source_clk = UART_SCLK_DEFAULT};
667667

668668
typedef enum {
669669
BNO055_VECTOR_ACCELEROMETER = 0x08, // Default: m/s²

0 commit comments

Comments
 (0)