Make disable return an int32_t for runOnce usage

This commit is contained in:
Ben Meadors 2022-12-29 16:54:39 -06:00
parent 38a1315599
commit 110c80d045
4 changed files with 6 additions and 6 deletions

View File

@ -93,10 +93,12 @@ void OSThread::run()
currentThread = NULL;
}
void OSThread::disable()
int32_t OSThread::disable()
{
enabled = false;
setInterval(INT32_MAX);
return INT32_MAX;
}
/**

View File

@ -53,7 +53,7 @@ class OSThread : public Thread
static void setup();
void disable();
int32_t disable();
/**
* Wait a specified number msecs starting from the current time (rather than the last time we were run)

View File

@ -260,8 +260,7 @@ int32_t AudioModule::runOnce()
return 100;
} else {
DEBUG_MSG("Audio Module Disabled\n");
enabled = false;
return INT32_MAX;
return disable();
}
}

View File

@ -244,8 +244,7 @@ bool MQTT::wantsLink() const
int32_t MQTT::runOnce()
{
if(!moduleConfig.mqtt.enabled) {
enabled = false;
return INT32_MAX;
return disable();
}
bool wantConnection = wantsLink();