@@ -132,10 +132,12 @@ static mp_obj_t mtp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
132132 touch_pad_init ();
133133 touch_pad_set_fsm_mode (TOUCH_FSM_MODE_TIMER );
134134 #elif SOC_TOUCH_SENSOR_VERSION == 3
135- touch_sensor_sample_config_t sample_cfg [1 ] = {
135+ touch_sensor_sample_config_t sample_cfg [3 ] = {
136136 TOUCH_SENSOR_V3_DEFAULT_SAMPLE_CONFIG (1 , 1 , 1 ),
137+ TOUCH_SENSOR_V3_DEFAULT_SAMPLE_CONFIG (2 , 1 , 1 ),
138+ TOUCH_SENSOR_V3_DEFAULT_SAMPLE_CONFIG (4 , 1 , 1 ),
137139 };
138- touch_sensor_config_t sens_cfg = TOUCH_SENSOR_DEFAULT_BASIC_CONFIG (1 , sample_cfg );
140+ touch_sensor_config_t sens_cfg = TOUCH_SENSOR_DEFAULT_BASIC_CONFIG (3 , sample_cfg );
139141 esp_err_t err = touch_sensor_new_controller (& sens_cfg , & s_sens_handle );
140142 if (err != ESP_OK ) {
141143 mp_raise_ValueError (MP_ERROR_TEXT ("Touch pad error 1" ));
@@ -147,9 +149,7 @@ static mp_obj_t mtp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
147149 mp_raise_ValueError (MP_ERROR_TEXT ("Touch pad error 2" ));
148150 }
149151 touch_channel_config_t chan_cfg = {
150- .active_thresh = {
151- 1000 , // estimated active threshold of sample configuration 0
152- },
152+ .active_thresh = {1000 , 2500 , 5000 },
153153 };
154154
155155 for (i = 0 ; i < 14 ; i ++ ) {
0 commit comments