File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -60,21 +60,23 @@ int BoschSensorClass::begin() {
6060 mag_dev_info._wire = _wire;
6161 mag_dev_info.dev_addr = bmm1.chip_id ;
6262
63- int8_t rslt = bmi270_init (&bmi2);
64- print_rslt (rslt );
63+ int8_t bmi270InitResult = bmi270_init (&bmi2);
64+ print_rslt (bmi270InitResult );
6565
66- rslt = configure_sensor (&bmi2);
67- print_rslt (rslt );
66+ int8_t bmi270ConfigResult = configure_sensor (&bmi2);
67+ print_rslt (bmi270ConfigResult );
6868
69- rslt = bmm150_init (&bmm1);
70- print_rslt (rslt );
69+ int8_t bmm150InitResult = bmm150_init (&bmm1);
70+ print_rslt (bmm150InitResult );
7171
72- rslt = configure_sensor (&bmm1);
73- print_rslt (rslt );
72+ int8_t bmm150ConfigResult = configure_sensor (&bmm1);
73+ print_rslt (bmm150ConfigResult );
7474
75- _initialized = true ;
75+ bool success = bmi270InitResult == BMI2_OK && bmi270ConfigResult == BMI2_OK &&
76+ bmm150InitResult == BMM150_OK && bmm150ConfigResult == BMM150_OK;
77+ _initialized = success;
7678
77- return 1 ;
79+ return success ;
7880}
7981
8082
You can’t perform that action at this time.
0 commit comments