loop status callback working

This commit is contained in:
2020-10-27 22:28:03 +01:00
parent 2e4b0de78f
commit 73239f4436
3 changed files with 33 additions and 2 deletions

View File

@ -1,7 +1,12 @@
#include <main.h>
#include <loopCtrl.h>
#include <led.h>
bool loopActive = false;
void loopEnable() {
loopActive = true;
HAL_GPIO_WritePin(Loop_Enable_GPIO_Port, Loop_Enable_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(Loop_Enable_GPIO_Port, Loop_Enable_Pin, GPIO_PIN_RESET);
}
@ -9,4 +14,13 @@ void loopEnable() {
void loopDisable() {
HAL_GPIO_WritePin(Loop_Disable_GPIO_Port, Loop_Disable_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(Loop_Disable_GPIO_Port, Loop_Disable_Pin, GPIO_PIN_RESET);
loopActive = false;
}
void loopStatusCallback() {
GPIO_PinState status = HAL_GPIO_ReadPin(Loop_Status_GPIO_Port, Loop_Status_Pin);
if (status == GPIO_PIN_SET) {
ledRed(true);
loopActive = false;
}
}