Skip to content

Commit 09336ac

Browse files
committed
fix(touch): Use correct type
1 parent 0a36580 commit 09336ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp32/esp32-hal-touch-ng.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static touch_volt_lim_h_t _volt_high = TOUCH_VOLT_LIM_H_1V7;
4343
static touch_intr_trig_mode_t _intr_trig_mode = TOUCH_INTR_TRIG_ON_BELOW_THRESH;
4444
#elif SOC_TOUCH_SENSOR_VERSION == 2 // ESP32S2, ESP32S3
4545
static uint8_t _sample_num = 1; // only one sample configuration supported
46-
static float _duration_ms = 500.0f;
46+
static uint32_t _chg_times = 500;
4747
static touch_volt_lim_l_t _volt_low = TOUCH_VOLT_LIM_L_0V5;
4848
static touch_volt_lim_h_t _volt_high = TOUCH_VOLT_LIM_H_2V2;
4949
#elif SOC_TOUCH_SENSOR_VERSION == 3 // ESP32P4
@@ -225,7 +225,7 @@ static void __touchInit() {
225225
#if SOC_TOUCH_SENSOR_VERSION == 1 // ESP32
226226
touch_sensor_sample_config_t single_sample_cfg = TOUCH_SENSOR_V1_DEFAULT_SAMPLE_CONFIG(_duration_ms, _volt_low, _volt_high);
227227
#elif SOC_TOUCH_SENSOR_VERSION == 2 // ESP32S2, ESP32S3
228-
touch_sensor_sample_config_t single_sample_cfg = TOUCH_SENSOR_V2_DEFAULT_SAMPLE_CONFIG(_duration_ms, _volt_low, _volt_high);
228+
touch_sensor_sample_config_t single_sample_cfg = TOUCH_SENSOR_V2_DEFAULT_SAMPLE_CONFIG(_chg_times, _volt_low, _volt_high);
229229
#elif SOC_TOUCH_SENSOR_VERSION == 3 // ESP32P4
230230
touch_sensor_sample_config_t single_sample_cfg = TOUCH_SENSOR_V3_DEFAULT_SAMPLE_CONFIG(_div_num, _coarse_freq_tune, _fine_freq_tune);
231231
#endif

0 commit comments

Comments
 (0)