File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232bool touch_inited = false;
3333
34+ void touchin_reset (void ) {
35+ if (touch_inited ) {
36+ touch_pad_deinit ();
37+ touch_inited = false;
38+ }
39+ }
40+
3441static uint16_t get_raw_reading (touchio_touchin_obj_t * self ) {
3542 uint32_t touch_value ;
3643 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) {
7885 if (common_hal_touchio_touchin_deinited (self )) {
7986 return ;
8087 }
81- touch_pad_deinit ();
8288 reset_pin_number (self -> pin -> touch_channel );
8389 self -> pin = NULL ;
8490}
Original file line number Diff line number Diff line change 4343#include "common-hal/busio/UART.h"
4444#include "common-hal/pulseio/PulseIn.h"
4545#include "common-hal/pwmio/PWMOut.h"
46+ #include "common-hal/touchio/TouchIn.h"
4647#include "common-hal/watchdog/WatchDogTimer.h"
4748#include "common-hal/wifi/__init__.h"
4849#include "supervisor/memory.h"
@@ -127,6 +128,10 @@ void reset_port(void) {
127128 rtc_reset ();
128129#endif
129130
131+ #if CIRCUITPY_TOUCHIO_USE_NATIVE
132+ touchin_reset ();
133+ #endif
134+
130135#if CIRCUITPY_WATCHDOG
131136 watchdog_reset ();
132137#endif
You can’t perform that action at this time.
0 commit comments