add button test at the board startup, part 2

This commit is contained in:
2025-03-08 14:43:54 +02:00
parent 82a3907d8a
commit 0b8a55a9e2
4 changed files with 20 additions and 6 deletions
+3 -4
View File
@@ -53,7 +53,7 @@ void ((*executors[])(void)) = {
external_temp_show_fahrenheit
};
int current_executor_id = 0;
size_t current_executor_id = 0;
/* USER CODE END PV */
@@ -174,14 +174,13 @@ int main(void)
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
// switch mode for SW5 (alternative advancing method)
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_NVIC_SetPriority(EXTI8_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI8_IRQn);
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);