This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LONG_PRESS_MS = 400, | |
LONG_PRESS_TOLERANCE = 20, | |
NUDGE_MS = 400, | |
NUDGE_THRESHOLD = 20, | |
SWIPE_THRESHOLD = 70; | |
function Touchable() { | |
this.after('initialize', function () { | |
let touches = [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable GPIOB & TIM3 clocks | |
__HAL_RCC_GPIOB_CLK_ENABLE(); | |
__HAL_RCC_TIM3_CLK_ENABLE(); | |
// Set up GPIOB1 (timer 3, channel 4) in alternate function (AF) mode | |
GPIO_InitTypeDef GPIO_InitStruct; | |
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
GPIO_InitStruct.Pull = GPIO_PULLUP; | |
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; | |
GPIO_InitStruct.Pin = GPIO_PIN_1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start the MCO outputing the main system clock | |
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1); |
OlderNewer