进入touch_audio工程目录
cd esp-dev-kits/esp32-s2-kaluga-1/examples/touch_audio
配置工程
idf.py set-target esp32s2 menuconfig
Example Configuration—>touch pad type (ESP32-S2-KALUGA_V1.2)
Example Configuration—>audio pad type (ESP32-S2-KALUGA_V1.2)
这里只有V1.2寻找,所以选择V1.2
编译,同样,这里有用到touch,有同样的编译问题,修改如下
diff --git a/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c b/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
old mode 100644
new mode 100755
index 0b631bb..da1eeab
--- a/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
+++ b/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
@@ -83,7 +83,7 @@ static void touchsensor_interrupt_cb(void *arg)
evt.pad_num = touch_pad_get_current_meas_channel();
if (evt.intr_mask & TOUCH_PAD_INTR_MASK_DONE) {
- touch_pad_filter_read_baseline(evt.pad_num, &evt.pad_val);
+ touch_pad_read_benchmark(evt.pad_num, &evt.pad_val);
}
xQueueSendFromISR(que_touch, &evt, &task_awoken);
@@ -99,7 +99,7 @@ static void tp_example_set_thresholds(void)
for (int i = 0; i < TOUCH_BUTTON_NUM; i++) {
/*!< read baseline value */
- touch_pad_filter_read_baseline(button[i], &touch_value);
+ touch_pad_read_benchmark(button[i], &touch_value);
/*!< set interrupt threshold. */
touch_pad_set_thresh(button[i], touch_value * button_threshold[i]);
ESP_LOGI(TAG, "test init: touch pad [%d] base %d, thresh %d", \
@@ -113,10 +113,10 @@ static void touchsensor_filter_set(touch_filter_mode_t mode)
touch_filter_config_t filter_info = {
.mode = mode, /*!< Test jitter and filter 1/4. */
.debounce_cnt = 1, /*!< 1 time count. */
- .hysteresis_thr = 3, /*!< 3% */
+ //.hysteresis_thr = 3, /*!< 3% */
.noise_thr = 0, /*!< 50% */
- .noise_neg_thr = 0, /*!< 50% */
- .neg_noise_limit = 10, /*!< 10 time count. */
+ //.noise_neg_thr = 0, /*!< 50% */
+ //.neg_noise_limit = 10, /*!< 10 time count. */
.jitter_step = 4, /*!< use for jitter mode. */
};
touch_pad_filter_set_config(&filter_info);
烧录