ota task stack size configurable
This commit is contained in:
@ -30,8 +30,9 @@ constexpr int END_TASK_BIT = BIT5;
|
||||
constexpr int TASK_ENDED = BIT6;
|
||||
} // namespace
|
||||
|
||||
EspAsyncOta::EspAsyncOta(const char *taskName, espcpputils::CoreAffinity coreAffinity) :
|
||||
EspAsyncOta::EspAsyncOta(const char *taskName, uint32_t stackSize, espcpputils::CoreAffinity coreAffinity) :
|
||||
m_taskName{taskName},
|
||||
m_stackSize{stackSize},
|
||||
m_coreAffinity{coreAffinity}
|
||||
{
|
||||
assert(m_eventGroup.handle);
|
||||
@ -54,7 +55,7 @@ tl::expected<void, std::string> EspAsyncOta::startTask()
|
||||
|
||||
m_eventGroup.clearBits(TASK_RUNNING | START_REQUEST_BIT | REQUEST_RUNNING_BIT | REQUEST_FINISHED_BIT | REQUEST_SUCCEEDED_BIT | END_TASK_BIT | TASK_ENDED);
|
||||
|
||||
const auto result = espcpputils::createTask(otaTask, m_taskName, 8192, this, 10, &m_taskHandle, m_coreAffinity);
|
||||
const auto result = espcpputils::createTask(otaTask, m_taskName, m_stackSize, this, 10, &m_taskHandle, m_coreAffinity);
|
||||
if (result != pdPASS)
|
||||
{
|
||||
auto msg = fmt::format("failed creating http task {}", result);
|
||||
|
@ -27,7 +27,7 @@ enum OtaCloudUpdateStatus
|
||||
class EspAsyncOta
|
||||
{
|
||||
public:
|
||||
EspAsyncOta(const char *taskName="asyncOtaTask", espcpputils::CoreAffinity coreAffinity=espcpputils::CoreAffinity::Core1);
|
||||
EspAsyncOta(const char *taskName="asyncOtaTask", uint32_t stackSize=2048, espcpputils::CoreAffinity coreAffinity=espcpputils::CoreAffinity::Core1);
|
||||
~EspAsyncOta();
|
||||
|
||||
tl::expected<void, std::string> startTask();
|
||||
@ -48,6 +48,7 @@ private:
|
||||
void otaTask();
|
||||
|
||||
const char * const m_taskName;
|
||||
const uint32_t m_stackSize;
|
||||
const espcpputils::CoreAffinity m_coreAffinity;
|
||||
|
||||
int m_progress{};
|
||||
|
Reference in New Issue
Block a user