got it to work, at least on my system
This commit is contained in:
1 parent
3f05e58b37
commit
87ec3d9fb2
90 files changed
+8412
-4
No files matched your search
+17
-4
@@ -31,7 +31,7 @@
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
//#define LED3 LED3 //missed this part of the lecture, this program can probably still be made without it though
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
@@ -201,11 +201,24 @@ static void MX_GPIO_Init(void)
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
void doInterruptThingy()
|
||||
int on = 0;
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||
{
|
||||
|
||||
if (GPIO_Pin == B1_Pin)
|
||||
{
|
||||
//do stuff
|
||||
if (on == 1)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOG, G1_Pin, 0);
|
||||
on = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOG, G1_Pin, 1);
|
||||
on = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user