doc: updated comments

This commit is contained in:
aZholtikov committed 2026-11-03 12:13:48 +03:00
1 parent 15b498fd6b
commit 7f92fb6cd4
2 files changed
+6 -3

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
* @file zh_inclinometer.h
*
* @brief Header file for the zh_inclinometer library providing encoder-based
* angle measurement and position tracking functionality.
* angle measurement and position tracking functionality.
*
* This library implements an inclinometer interface based on a quadrature
* encoder connected to two GPIO pins. It uses the ESP-IDF pulse counter
@@ -99,7 +99,7 @@ extern "C"
* PCNT unit, frees the inclinometer handle memory, and sets the handle to
* NULL.
*
* @param[in,out] handle Pointer to the unique inclinometer handle (must not be NULL)
* @param[in,out] handle Pointer to the inclinometer handle pointer (will be set to NULL)
*
* @note After deinitialization, the handle is invalidated and must not be
* used. Call zh_inclinometer_init() again to reinitialize.
+4 -1
View File
@@ -101,7 +101,10 @@ esp_err_t zh_inclinometer_get(zh_inclinometer_handle_t **handle, float *angle)
ZH_ERROR_CHECK(pcnt_unit_get_count((*handle)->pcnt_unit_handle, &pcnt_count) == ESP_OK, ESP_FAIL, NULL, "Inclinometer get position failed. PCNT unit get count fail.");
float angle_temp = pcnt_count * (*handle)->degrees_per_pulse;
*angle = (*handle)->rotation == true ? angle_temp : -angle_temp;
*angle += 0.0f;
if (*angle == 0.0)
{
*angle = 0.0;
}
ZH_LOGI("Inclinometer get position completed successfully.");
return ESP_OK;
}