Compare commits
No commits in common. "9cbfb5865633223a8c373ccabcb7d2543302b663" and "05fb2f211fcb44464d7872946648173381e36dfd" have entirely different histories.
9cbfb58656
...
05fb2f211f
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
build/
|
|
||||||
managed_components/
|
|
||||||
@ -86,38 +86,30 @@ void bma4_delay_us(uint32_t period, void *intf_ptr) {
|
|||||||
* @brief Prints the execution status of the APIs.
|
* @brief Prints the execution status of the APIs.
|
||||||
*/
|
*/
|
||||||
void bma4_error_codes_print_result(const char api_name[], int8_t rslt) {
|
void bma4_error_codes_print_result(const char api_name[], int8_t rslt) {
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt != BMA4_OK) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ESP_LOGI("BMA4_I2C", "%s\t", api_name);
|
ESP_LOGI("BMA4_I2C", "%s\t", api_name);
|
||||||
|
if (rslt == BMA4_E_NULL_PTR) {
|
||||||
switch (rslt) {
|
|
||||||
case BMA4_E_NULL_PTR:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Null pointer\r\n", rslt);
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Null pointer\r\n", rslt);
|
||||||
break;
|
} else if (rslt == BMA4_E_COM_FAIL) {
|
||||||
case BMA4_E_COM_FAIL:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Communication failure\r\n", rslt);
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Communication failure\r\n", rslt);
|
||||||
break;
|
} else if (rslt == BMA4_E_CONFIG_STREAM_ERROR) {
|
||||||
case BMA4_E_CONFIG_STREAM_ERROR:
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Invalid configuration stream\r\n",
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Invalid configuration stream\r\n", rslt);
|
|
||||||
break;
|
|
||||||
case BMA4_E_SELF_TEST_FAIL:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Self test failed\r\n", rslt);
|
|
||||||
break;
|
|
||||||
case BMA4_E_INVALID_SENSOR:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Device not found\r\n", rslt);
|
|
||||||
break;
|
|
||||||
case BMA4_E_OUT_OF_RANGE:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Out of Range\r\n", rslt);
|
|
||||||
break;
|
|
||||||
case BMA4_E_AVG_MODE_INVALID_CONF:
|
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Invalid bandwidth/ODR combination\r\n",
|
|
||||||
rslt);
|
rslt);
|
||||||
break;
|
} else if (rslt == BMA4_E_SELF_TEST_FAIL) {
|
||||||
default:
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Self test failed\r\n", rslt);
|
||||||
|
} else if (rslt == BMA4_E_INVALID_SENSOR) {
|
||||||
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Device not found\r\n", rslt);
|
||||||
|
} else if (rslt == BMA4_E_OUT_OF_RANGE) {
|
||||||
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Out of Range\r\n", rslt);
|
||||||
|
} else if (rslt == BMA4_E_AVG_MODE_INVALID_CONF) {
|
||||||
|
ESP_LOGI("BMA4_I2C",
|
||||||
|
"Error [%d] : Invalid bandwidth and ODR combination in Accel "
|
||||||
|
"Averaging mode\r\n",
|
||||||
|
rslt);
|
||||||
|
} else {
|
||||||
|
/* For more error codes refer "*_defs.h" */
|
||||||
ESP_LOGI("BMA4_I2C", "Error [%d] : Unknown error code\r\n", rslt);
|
ESP_LOGI("BMA4_I2C", "Error [%d] : Unknown error code\r\n", rslt);
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user