Skip to content

Commit 06db45d

Browse files
update code
1 parent ae02cf8 commit 06db45d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

ports/esp32/boards/FireBeetle_2_ESP32_P4/mpconfigboard.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#endif
1111

1212

13-
// not fixed in mpy 1.26.0
14-
#define MICROPY_PY_MACHINE_DAC (0)
15-
1613
#define MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE (0)
1714
#define MICROPY_HW_ENABLE_USBDEV (0)
1815

ports/esp32/boards/sdkconfig.base

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,7 @@ CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=n
140140
# Further limit total sockets in TIME-WAIT when there are many short-lived
141141
# connections.
142142
CONFIG_LWIP_MAX_ACTIVE_TCP=12
143+
144+
# Enable new I2C slave API, and disable conflict check.
145+
CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y
146+
CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2=y

ports/esp32/machine_touchpad.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)