This commit is contained in:
Wolfgang Hottgenroth 2020-11-17 15:42:41 +01:00
parent e3c16ef712
commit d613d278ec
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#include <main.h> #include <main.h>
#include <loopCtrl.h> #include <loopCtrl.h>
#include <show.h> #include <show.h>
#include <logger.h>
bool loopActive = false; bool loopActive = false;
@ -9,12 +9,14 @@ void loopEnable() {
loopActive = true; 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_SET);
HAL_GPIO_WritePin(Loop_Enable_GPIO_Port, Loop_Enable_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(Loop_Enable_GPIO_Port, Loop_Enable_Pin, GPIO_PIN_RESET);
coloredMsg(LOG_HIGH, true, "lc le loop is enabled");
} }
void loopDisable() { 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_SET);
HAL_GPIO_WritePin(Loop_Disable_GPIO_Port, Loop_Disable_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(Loop_Disable_GPIO_Port, Loop_Disable_Pin, GPIO_PIN_RESET);
loopActive = false; loopActive = false;
coloredMsg(LOG_HIGH, true, "lc ld loop is disabled");
} }
void loopStatusCallback() { void loopStatusCallback() {

View File

@ -618,11 +618,13 @@ static void mbusCommScheduler(void *handle) {
if (! isNetworkAvailable()) { if (! isNetworkAvailable()) {
coloredMsg(LOG_GREEN, true, "mbc mcs deactivate scheduler by network"); coloredMsg(LOG_GREEN, true, "mbc mcs deactivate scheduler by network");
schDel(triggerMBusRequest, NULL); schDel(triggerMBusRequest, NULL);
loopDisable();
state = 0; state = 0;
} }
if (! mbusCommEnabled) { if (! mbusCommEnabled) {
coloredMsg(LOG_GREEN, true, "mbc mcs deactivate scheduler by request"); coloredMsg(LOG_GREEN, true, "mbc mcs deactivate scheduler by request");
schDel(triggerMBusRequest, NULL); schDel(triggerMBusRequest, NULL);
loopDisable();
state = 2; state = 2;
} }
for (uint8_t i = 0; i < numOfDevices; i++) { for (uint8_t i = 0; i < numOfDevices; i++) {