Refactor OSThread consumers to use disable()

This commit is contained in:
Ben Meadors
2022-12-29 16:26:25 -06:00
parent a8f93d5f47
commit 38a1315599
9 changed files with 14 additions and 25 deletions

View File

@@ -55,16 +55,14 @@ CannedMessageModule::CannedMessageModule()
if ((this->splitConfiguredMessages() <= 0) && (cardkb_found != CARDKB_ADDR)) {
DEBUG_MSG("CannedMessageModule: No messages are configured. Module is disabled\n");
this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED;
setInterval(INT32_MAX);
enabled = false;
disable();
} else {
DEBUG_MSG("CannedMessageModule is enabled\n");
this->inputObserver.observe(inputBroker);
}
} else {
this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED;
setInterval(INT32_MAX);
enabled = false;
disable();
}
}

View File

@@ -199,8 +199,7 @@ ExternalNotificationModule::ExternalNotificationModule()
}
} else {
DEBUG_MSG("External Notification Module Disabled\n");
setInterval(INT32_MAX);
enabled = false;
disable();
}
}

View File

@@ -139,8 +139,7 @@ AudioModule::AudioModule() : SinglePortModule("AudioModule", PortNum_AUDIO_APP),
DEBUG_MSG(" using %d frames of %d bytes for a total payload length of %d bytes\n", encode_frame_num, encode_codec_size, encode_frame_size);
xTaskCreate(&run_codec2, "codec2_task", 30000, NULL, 5, &codec2HandlerTask);
} else {
setInterval(INT32_MAX);
enabled = false;
disable();
DEBUG_MSG("Codec2 disabled (AudioModule %d, Region %s, permitted %d)\n", moduleConfig.audio.codec2_enabled, myRegion->name, myRegion->audioPermitted);
}
}

View File

@@ -460,8 +460,7 @@ StoreForwardModule::StoreForwardModule()
DEBUG_MSG("*** Initializing Store & Forward Module in Client mode\n");
}
} else {
setInterval(INT32_MAX);
enabled = false;
disable();
}
#endif
}