Skip to content

Commit

Permalink
Fixed BHI260 error
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Oct 7, 2023
1 parent 047e3dc commit 874bf08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/SensorBHI260AP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SensorBHI260AP
if (__handler.rst != SENSOR_PIN_NONE) {
digitalWrite(__handler.rst, HIGH);
delay(5);
digitalWrite(__handler.rst, HIGH);
digitalWrite(__handler.rst, LOW);
delay(10);
digitalWrite(__handler.rst, HIGH);
delay(5);
Expand Down Expand Up @@ -173,6 +173,7 @@ class SensorBHI260AP

void printSensors(Stream &port)
{
uint8_t cnt = 0;
bool presentBuff[256];

for (uint16_t i = 0; i < sizeof(bhy2->present_buff); i++) {
Expand All @@ -184,12 +185,14 @@ class SensorBHI260AP
port.println("Present sensors: ");
for (int i = 0; i < (int)sizeof(presentBuff); i++) {
if (presentBuff[i]) {
cnt++;
port.print(i);
port.print(" - ");
port.print(get_sensor_name(i));
port.println();
}
}
port.printf("Total %u Sensor online .\n", cnt);
}


Expand Down Expand Up @@ -375,6 +378,14 @@ class SensorBHI260AP
return true;
}

struct bhy2_virt_sensor_conf getConfigure(uint8_t sensor_id)
{
bhy2_virt_sensor_conf conf;
bhy2_get_virt_sensor_cfg(sensor_id, &conf, bhy2);
log_i("range:%u sample_rate:%f latency:%u sensitivity:%u\n", conf.range, conf.sample_rate, conf.latency, conf.sensitivity);
return conf;
}

float getScaling(uint8_t sensor_id)
{
return get_sensor_default_scaling(sensor_id);
Expand Down
1 change: 0 additions & 1 deletion src/bosch/BoschParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void BoschParse::parseData(const struct bhy2_fifo_parse_data_info *fifo, void *u
{
int8_t size = fifo->data_size - 1;

if(fifo->sensor_id == 1 || fifo->sensor_id ==10)return;
#ifdef LOG_PORT
LOG_PORT.print("Sensor: ");
LOG_PORT.print(fifo->sensor_id);
Expand Down

0 comments on commit 874bf08

Please sign in to comment.