Constants renamed (so that Taranis hal is now nice)
This commit is contained in:
@@ -52,16 +52,16 @@ void hapticOn(uint32_t pwmPercent)
|
||||
|
||||
void hapticInit(void)
|
||||
{
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOHAPTIC, ENABLE);
|
||||
RCC_AHB1PeriphClockCmd(HAPTIC_RCC_AHB1Periph_GPIO, ENABLE);
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_HAPTIC;
|
||||
GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIO_HAPTIC, &GPIO_InitStructure);
|
||||
GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure);
|
||||
|
||||
GPIO_PinAFConfig(GPIO_HAPTIC, GPIO_PinSource_HAPTIC, GPIO_AF_TIM10);
|
||||
GPIO_PinAFConfig(HAPTIC_GPIO, HAPTIC_GPIO_PinSource, GPIO_AF_TIM10);
|
||||
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM10EN ; // Enable clock
|
||||
TIM10->ARR = 100 ;
|
||||
@@ -80,25 +80,25 @@ void hapticInit(void)
|
||||
void hapticInit(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOHAPTIC, ENABLE);
|
||||
RCC_AHB1PeriphClockCmd(HAPTIC_RCC_AHB1Periph_GPIO, ENABLE);
|
||||
|
||||
/* GPIO Configuration*/
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_HAPTIC;
|
||||
GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIO_HAPTIC, &GPIO_InitStructure);
|
||||
GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
void hapticOff(void)
|
||||
{
|
||||
GPIO_ResetBits(GPIO_HAPTIC, PIN_HAPTIC);
|
||||
GPIO_ResetBits(HAPTIC_GPIO, HAPTIC_GPIO_PIN);
|
||||
}
|
||||
|
||||
void hapticOn()
|
||||
{
|
||||
GPIO_SetBits(GPIO_HAPTIC, PIN_HAPTIC);
|
||||
GPIO_SetBits(HAPTIC_GPIO, HAPTIC_GPIO_PIN);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user