Input handling and debouncing (#148)
* Add input driver and definitions for target_f2 * Add input_dump example * Invert charge input * Fix back and left button configuration * remove input debug * input testing case * move header * lint code Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
@@ -598,7 +598,7 @@ static void MX_GPIO_Init(void) {
|
||||
|
||||
/*Configure GPIO pin : BUTTON_BACK_Pin */
|
||||
GPIO_InitStruct.Pin = BUTTON_BACK_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
@@ -681,7 +681,7 @@ static void MX_GPIO_Init(void) {
|
||||
|
||||
/*Configure GPIO pin : BUTTON_LEFT_Pin */
|
||||
GPIO_InitStruct.Pin = BUTTON_LEFT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
@@ -706,6 +706,9 @@ static void MX_GPIO_Init(void) {
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
@@ -237,6 +237,19 @@ void EXTI9_5_IRQHandler(void) {
|
||||
/* USER CODE END EXTI9_5_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line[15:10] interrupts.
|
||||
*/
|
||||
void EXTI15_10_IRQHandler(void) {
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||
}
|
||||
|
||||
void (*tim8_callback_ch2)(uint16_t ccr, TimerEvent tim_event);
|
||||
|
||||
void register_tim8_callback_ch2(void (*callback)(uint16_t ccr, TimerEvent tim_event)) {
|
||||
|
Reference in New Issue
Block a user