diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2016-12-20 16:39:32 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2016-12-20 16:39:32 -0800 |
| commit | f48d2df63465e1c3f2acb6413bb4772e89069c4f (patch) | |
| tree | d2aa494a1ce49424152805f64bedf467d7e345c5 /atmel-samd/main.c | |
| parent | e8db23d241946c8dac2538f46f5a81b77f37d335 (diff) | |
atmel-samd: Improve TouchIn to allow for multiple simultaneous touch pads.
Diffstat (limited to 'atmel-samd/main.c')
| -rw-r--r-- | atmel-samd/main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/atmel-samd/main.c b/atmel-samd/main.c index 422e4e360..092af2bc9 100644 --- a/atmel-samd/main.c +++ b/atmel-samd/main.c @@ -22,7 +22,8 @@ #include "asf/sam0/drivers/system/system.h" #include <board.h> -#ifdef SPI_FLASH_SECTOR_SIZE +#ifdef EXPRESS_BOARD +#include "common-hal/nativeio/types.h" #include "QTouch/touch_api_ptc.h" #endif @@ -128,7 +129,10 @@ void reset_mp(void) { MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt); } -extern bool ptc_initialized; +#ifdef EXPRESS_BOARD +extern nativeio_touchin_obj_t *active_touchin_obj[DEF_SELFCAP_NUM_CHANNELS]; +extern touch_selfcap_config_t selfcap_config; +#endif void reset_samd21(void) { // Reset all SERCOMs except the one being used by the SPI flash. Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; @@ -146,9 +150,13 @@ void reset_samd21(void) { sercom_instances[i]->SPI.CTRLA.bit.SWRST = 1; } -#ifdef SPI_FLASH_SECTOR_SIZE +#ifdef EXPRESS_BOARD touch_selfcap_sensors_deinit(); - ptc_initialized = false; + for (int i = 0; i < selfcap_config.num_channels; i++) { + active_touchin_obj[i] = NULL; + } + selfcap_config.num_channels = 0; + selfcap_config.num_sensors = 0; #endif struct system_pinmux_config config; |
