mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
fix(touch): fixed touch interval freq unit convert issue
This commit is contained in:
@@ -154,11 +154,10 @@ static esp_err_t s_touch_convert_to_hal_config(touch_sensor_handle_t sens_handle
|
|||||||
|
|
||||||
uint32_t src_freq_hz = sens_handle->src_freq_hz;
|
uint32_t src_freq_hz = sens_handle->src_freq_hz;
|
||||||
uint32_t src_freq_mhz = src_freq_hz / 1000000;
|
uint32_t src_freq_mhz = src_freq_hz / 1000000;
|
||||||
uint32_t interval_freq_mhz = sens_handle->interval_freq_hz / 1000000;
|
|
||||||
hal_cfg->power_on_wait_ticks = (uint32_t)sens_cfg->power_on_wait_us * src_freq_mhz;
|
hal_cfg->power_on_wait_ticks = (uint32_t)sens_cfg->power_on_wait_us * src_freq_mhz;
|
||||||
hal_cfg->power_on_wait_ticks = hal_cfg->power_on_wait_ticks > TOUCH_LL_PAD_MEASURE_WAIT_MAX ?
|
hal_cfg->power_on_wait_ticks = hal_cfg->power_on_wait_ticks > TOUCH_LL_PAD_MEASURE_WAIT_MAX ?
|
||||||
TOUCH_LL_PAD_MEASURE_WAIT_MAX : hal_cfg->power_on_wait_ticks;
|
TOUCH_LL_PAD_MEASURE_WAIT_MAX : hal_cfg->power_on_wait_ticks;
|
||||||
hal_cfg->meas_interval_ticks = (uint32_t)(sens_cfg->meas_interval_us * interval_freq_mhz);
|
hal_cfg->meas_interval_ticks = (uint32_t)(sens_cfg->meas_interval_us * sens_handle->interval_freq_hz / 1000000);
|
||||||
hal_cfg->timeout_ticks = (uint32_t)sens_cfg->max_meas_time_us * src_freq_mhz;
|
hal_cfg->timeout_ticks = (uint32_t)sens_cfg->max_meas_time_us * src_freq_mhz;
|
||||||
ESP_RETURN_ON_FALSE(hal_cfg->timeout_ticks <= TOUCH_LL_TIMEOUT_MAX, ESP_ERR_INVALID_ARG, TAG,
|
ESP_RETURN_ON_FALSE(hal_cfg->timeout_ticks <= TOUCH_LL_TIMEOUT_MAX, ESP_ERR_INVALID_ARG, TAG,
|
||||||
"max_meas_time_ms should within %"PRIu32, TOUCH_LL_TIMEOUT_MAX / src_freq_mhz);
|
"max_meas_time_ms should within %"PRIu32, TOUCH_LL_TIMEOUT_MAX / src_freq_mhz);
|
||||||
|
@@ -520,7 +520,6 @@ components/soc/esp32/include/soc/reset_reasons.h
|
|||||||
components/soc/esp32/include/soc/sdmmc_pins.h
|
components/soc/esp32/include/soc/sdmmc_pins.h
|
||||||
components/soc/esp32/include/soc/soc_pins.h
|
components/soc/esp32/include/soc/soc_pins.h
|
||||||
components/soc/esp32/include/soc/soc_ulp.h
|
components/soc/esp32/include/soc/soc_ulp.h
|
||||||
components/soc/esp32/include/soc/touch_sensor_channel.h
|
|
||||||
components/soc/esp32/include/soc/uart_pins.h
|
components/soc/esp32/include/soc/uart_pins.h
|
||||||
components/soc/esp32/include/soc/wdev_reg.h
|
components/soc/esp32/include/soc/wdev_reg.h
|
||||||
components/soc/esp32/ledc_periph.c
|
components/soc/esp32/ledc_periph.c
|
||||||
|
Reference in New Issue
Block a user