Skip to content

Instantly share code, notes, and snippets.

View rixth's full-sized avatar

Thomas Rix rixth

View GitHub Profile
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 = [],
// 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;
@rixth
rixth / mco1.cpp
Last active August 29, 2015 14:25
// Start the MCO outputing the main system clock
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);