File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 31
31
32
32
bool touch_inited = false;
33
33
34
+ void touchin_reset (void ) {
35
+ if (touch_inited ) {
36
+ touch_pad_deinit ();
37
+ touch_inited = false;
38
+ }
39
+ }
40
+
34
41
static uint16_t get_raw_reading (touchio_touchin_obj_t * self ) {
35
42
uint32_t touch_value ;
36
43
touch_pad_read_raw_data ((touch_pad_t )self -> pin -> touch_channel , & touch_value );
@@ -78,7 +85,6 @@ void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) {
78
85
if (common_hal_touchio_touchin_deinited (self )) {
79
86
return ;
80
87
}
81
- touch_pad_deinit ();
82
88
reset_pin_number (self -> pin -> touch_channel );
83
89
self -> pin = NULL ;
84
90
}
Original file line number Diff line number Diff line change 43
43
#include "common-hal/busio/UART.h"
44
44
#include "common-hal/pulseio/PulseIn.h"
45
45
#include "common-hal/pwmio/PWMOut.h"
46
+ #include "common-hal/touchio/TouchIn.h"
46
47
#include "common-hal/watchdog/WatchDogTimer.h"
47
48
#include "common-hal/wifi/__init__.h"
48
49
#include "supervisor/memory.h"
@@ -127,6 +128,10 @@ void reset_port(void) {
127
128
rtc_reset ();
128
129
#endif
129
130
131
+ #if CIRCUITPY_TOUCHIO_USE_NATIVE
132
+ touchin_reset ();
133
+ #endif
134
+
130
135
#if CIRCUITPY_WATCHDOG
131
136
watchdog_reset ();
132
137
#endif
You can’t perform that action at this time.
0 commit comments