Question
PingPong Example, failing to run GPIO ISR
Hi
I have been trying to activate the callback function for the pushbutton in the SubGHz PingPong example, but with no luck.
I am using the BSP_PB_Init() to configure the pushbutton:
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* Enable the BUTTON Clock */
BUTTONx_GPIO_CLK_ENABLE(Button);
__HAL_RCC_SYSCFG_CLK_ENABLE();
if (ButtonMode == BUTTON_MODE_GPIO)
{
/* Configure Button pin as input */
GPIO_InitStruct.Pin = BUTTON_PIN[Button];
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStruct);
}
if (ButtonMode == BUTTON_MODE_EXTI)
{
/* Configure Button pin as input with External interrupt */
GPIO_InitStruct.Pin = PushButton_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(PushButton_GPIO_Port, &GPIO_InitStruct);
/* Enable and set Button EXTI Interrupt to the lowest priority */
NVIC_SetPriority(EXTI2_3_IRQn, 0);
HAL_NVIC_EnableIRQ(EXTI2_3_IRQn);
}
}
Then I implemented the callback function:
{
HAL_UART_Transmit(&huart2, "TEST: ", 7, 100);
}
HAL_UART_Transmit(&huart2, "TEST: ", 7, 100);
}
But there is no response.
I am missing something to configure ?
thanks
