Skip to content
Snippets Groups Projects
Commit ad01bfc9 authored by Aapo Torkkeli's avatar Aapo Torkkeli
Browse files

Fix Ex5 init order. Now it works.

parent 90bb9069
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,9 @@ int8_t sensor_config() {
sensor.write = bmi160_spi_bus_write;
sensor.delay_ms = nrf_delay_ms;
// Initialize the sensor and check if everything went ok
rslt = bmi160_init(&sensor);
// Configure the accelerometer's sampling freq, range and modes
sensor.accel_cfg.odr = BMI160_ACCEL_ODR_25HZ;
sensor.accel_cfg.range = BMI160_ACCEL_RANGE_8G;
......@@ -201,9 +204,6 @@ int8_t sensor_config() {
fifo_frame.length = 200;
sensor.fifo = &fifo_frame;
// Initialize the sensor and check if everything went ok
rslt = bmi160_init(&sensor);
// Configure the sensor's FIFO settings
rslt = bmi160_set_fifo_config(BMI160_FIFO_ACCEL, BMI160_ENABLE, &sensor);
// Create an instance for interrupt settings
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment