mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-10 18:06:29 +00:00
update touch with review advice
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| Version | Supported Targets |
|
||||
| ------- | ----------------- |
|
||||
| V1 | ESP32 |
|
||||
| V2 | ESP32S2, ESP32S3 |
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "soc/rtc_periph.h"
|
||||
#include "soc/sens_periph.h"
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
static const char *TAG = "Touch pad";
|
||||
|
||||
#define TOUCH_THRESH_NO_USE (0)
|
||||
@@ -171,5 +169,3 @@ void app_main(void)
|
||||
// Start a task to show what pads have been touched
|
||||
xTaskCreate(&tp_example_read_task, "touch_pad_read_task", 2048, NULL, 5, NULL);
|
||||
}
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "driver/touch_pad.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
|
||||
#define TOUCH_PAD_NO_CHANGE (-1)
|
||||
#define TOUCH_THRESH_NO_USE (0)
|
||||
#define TOUCH_FILTER_MODE_EN (1)
|
||||
@@ -72,5 +70,3 @@ void app_main(void)
|
||||
// Start task to read values sensed by pads
|
||||
xTaskCreate(&tp_example_read_task, "touch_pad_read_task", 2048, NULL, 5, NULL);
|
||||
}
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32
|
||||
@@ -64,7 +64,7 @@ void app_main(void)
|
||||
}
|
||||
#if TOUCH_CHANGE_CONFIG
|
||||
/* If you want change the touch sensor default setting, please write here(after initialize). There are examples: */
|
||||
touch_pad_set_meas_time(TOUCH_PAD_SLEEP_CYCLE_DEFAULT, TOUCH_PAD_SLEEP_CYCLE_DEFAULT);
|
||||
touch_pad_set_meas_time(TOUCH_PAD_SLEEP_CYCLE_DEFAULT, TOUCH_PAD_MEASURE_CYCLE_DEFAULT);
|
||||
touch_pad_set_voltage(TOUCH_PAD_HIGH_VOLTAGE_THRESHOLD, TOUCH_PAD_LOW_VOLTAGE_THRESHOLD, TOUCH_PAD_ATTEN_VOLTAGE_THRESHOLD);
|
||||
touch_pad_set_idle_channel_connect(TOUCH_PAD_IDLE_CH_CONNECT_DEFAULT);
|
||||
for (int i = 0; i < TOUCH_BUTTON_NUM; i++) {
|
||||
Reference in New Issue
Block a user