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:
Vadim Kaushan
2020-10-02 09:44:05 +03:00
committed by GitHub
parent ed76f702b1
commit 8c36d65e63
13 changed files with 285 additions and 8 deletions
+5 -2
View File
@@ -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 */