Skip to content

Commit

Permalink
Update example to allow for other inputs. Also, include warning about…
Browse files Browse the repository at this point in the history
… practical use.
  • Loading branch information
cnlohr committed Aug 17, 2023
1 parent 9694830 commit 4dcb792
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/cap_touch_exti/cap_touch_exti.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
PORT C, pin 5 - high res pad, with pull-up to 3.3v with 560k resistor.
PORT D, pin 5 - regular touch pad, no extra components.
Note: You may want to consider including a 1k series resistor for better
ESD performance.
Note: Typical count deltas for a 1 cm^2 pad are typically only 100 lsb's.
So, this method is really limited to boolean "down" functions.
*/

#include "ch32v003fun.h"
Expand Down Expand Up @@ -95,7 +95,8 @@ int main()
SystemInit();

// Enable GPIOs and pin-change interrupt.
RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO;
RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOA |
RCC_APB2Periph_AFIO;

// enable pin-change-interrupt.
NVIC_EnableIRQ( EXTI7_0_IRQn );
Expand Down

0 comments on commit 4dcb792

Please sign in to comment.