mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Update temp_sensor.rst documentation to match example (GitHub PR)
This commit is contained in:
parent
64d37664b4
commit
c07862cee8
@ -104,7 +104,11 @@ esp_err_t temperature_sensor_install(const temperature_sensor_config_t *tsens_co
|
||||
temperature_sensor_handle_t tsens = NULL;
|
||||
tsens = (temperature_sensor_obj_t *) heap_caps_calloc(1, sizeof(temperature_sensor_obj_t), MALLOC_CAP_DEFAULT);
|
||||
ESP_RETURN_ON_FALSE((tsens != NULL), ESP_ERR_NO_MEM, TAG, "no mem for temp sensor");
|
||||
tsens->clk_src = tsens_config->clk_src;
|
||||
if (tsens->clk_src == 0) {
|
||||
tsens->clk_src = TEMPERATURE_SENSOR_CLK_SRC_DEFAULT;
|
||||
} else {
|
||||
tsens->clk_src = tsens_config->clk_src;
|
||||
}
|
||||
|
||||
temperature_sensor_power_acquire();
|
||||
temperature_sensor_ll_clk_sel(tsens->clk_src);
|
||||
|
@ -75,11 +75,8 @@ Creating a Temperature Sensor Handle
|
||||
.. code:: c
|
||||
|
||||
temperature_sensor_handle_t temp_handle = NULL;
|
||||
temperature_sensor_config_t temp_sensor = {
|
||||
.range_min = 20,
|
||||
.range_max = 50,
|
||||
};
|
||||
ESP_ERROR_CHECK(temperature_sensor_install(&temp_sensor, &temp_handle));
|
||||
temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(20, 50);
|
||||
ESP_ERROR_CHECK(temperature_sensor_install(&temp_sensor_config, &temp_handle));
|
||||
|
||||
.. _temp-enable-and-disable-temperature-sensor:
|
||||
|
||||
|
@ -74,11 +74,8 @@
|
||||
.. code:: c
|
||||
|
||||
temperature_sensor_handle_t temp_handle = NULL;
|
||||
temperature_sensor_config_t temp_sensor = {
|
||||
.range_min = 20,
|
||||
.range_max = 50,
|
||||
};
|
||||
ESP_ERROR_CHECK(temperature_sensor_install(&temp_sensor, &temp_handle));
|
||||
temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(20, 50);
|
||||
ESP_ERROR_CHECK(temperature_sensor_install(&temp_sensor_config, &temp_handle));
|
||||
|
||||
.. _temp-enable-and-disable-temperature-sensor:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user