Skip to content

Commit 8354773

Browse files
committed
Merge branch 'bugfix/touch_pr_on_github' into 'master'
fix(touch): fix unexpected touch start on RTC peripheral init Closes IDFGH-6021 and IDFGH-9371 See merge request espressif/esp-idf!36507
2 parents 47cc1b7 + e6fb661 commit 8354773

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

components/driver/touch_sensor/esp32/touch_sensor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,9 @@ esp_err_t touch_pad_filter_delete(void)
512512
esp_err_t ret = ESP_OK;
513513
xSemaphoreTake(rtc_touch_mux, portMAX_DELAY);
514514
if (s_touch_pad_filter->timer) {
515-
ESP_GOTO_ON_ERROR(esp_timer_stop(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to stop the timer");
515+
if (esp_timer_is_active(s_touch_pad_filter->timer)) {
516+
ESP_GOTO_ON_ERROR(esp_timer_stop(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to stop the timer");
517+
}
516518
ESP_GOTO_ON_ERROR(esp_timer_delete(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to delete the timer");
517519
s_touch_pad_filter->timer = NULL;
518520
}

components/hal/esp32/include/hal/touch_sensor_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,8 @@ static inline void touch_ll_stop_fsm(void)
681681
*/
682682
static inline void touch_ll_start_sw_meas(void)
683683
{
684-
SENS.sar_touch_ctrl2.touch_start_en = 0;
685684
SENS.sar_touch_ctrl2.touch_start_en = 1;
685+
SENS.sar_touch_ctrl2.touch_start_en = 0;
686686
}
687687

688688
/**

components/hal/esp32s2/include/hal/touch_sensor_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,8 @@ static inline bool touch_ll_get_fsm_state(void)
10611061
*/
10621062
static inline void touch_ll_start_sw_meas(void)
10631063
{
1064-
RTCCNTL.touch_ctrl2.touch_start_en = 0;
10651064
RTCCNTL.touch_ctrl2.touch_start_en = 1;
1065+
RTCCNTL.touch_ctrl2.touch_start_en = 0;
10661066
}
10671067

10681068
/**

components/hal/esp32s3/include/hal/touch_sensor_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,8 @@ static inline bool touch_ll_get_fsm_state(void)
10861086
*/
10871087
static inline void touch_ll_start_sw_meas(void)
10881088
{
1089-
RTCCNTL.touch_ctrl2.touch_start_en = 0;
10901089
RTCCNTL.touch_ctrl2.touch_start_en = 1;
1090+
RTCCNTL.touch_ctrl2.touch_start_en = 0;
10911091
}
10921092

10931093
/**

0 commit comments

Comments
 (0)