Skip to content

Commit

Permalink
Merge branch 'contrib/github_pr_13090' into 'master'
Browse files Browse the repository at this point in the history
Update temp_sensor.rst documentation to match example (GitHub PR)

Closes IDFGH-12025

See merge request espressif/esp-idf!28846
  • Loading branch information
mythbuster5 committed Mar 6, 2024
2 parents 32db5e4 + c07862c commit 831c354
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 5 additions & 1 deletion components/esp_driver_tsens/src/temperature_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 2 additions & 5 deletions docs/en/api-reference/peripherals/temp_sensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
7 changes: 2 additions & 5 deletions docs/zh_CN/api-reference/peripherals/temp_sensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 831c354

Please sign in to comment.