mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
make task cores configurable in platformio.ini
This commit is contained in:
@@ -40,7 +40,12 @@ void WebSchedulerService::begin() {
|
||||
Mqtt::subscribe(EMSdevice::DeviceType::SCHEDULER, topic, nullptr); // use empty function callback
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (EMSESP::system_.PSram()) {
|
||||
xTaskCreate((TaskFunction_t)scheduler_task, "scheduler_task", 5120, NULL, 1, NULL);
|
||||
#if defined(CONFIG_FREERTOS_UNICORE) || (EMSESP_SCHEDULER_RUNNING_CORE < 0)
|
||||
xTaskCreate((TaskFunction_t)scheduler_task, "scheduler_task", EMSESP_SCHEDULER_STACKSIZE, NULL, EMSESP_SCHEDULER_PRIORITY, NULL);
|
||||
#else
|
||||
xTaskCreatePinnedToCore(
|
||||
(TaskFunction_t)scheduler_task, "scheduler_task", EMSESP_SCHEDULER_STACKSIZE, NULL, EMSESP_SCHEDULER_PRIORITY, NULL, EMSESP_SCHEDULER_RUNNING_CORE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -22,6 +22,18 @@
|
||||
#define EMSESP_SCHEDULER_FILE "/config/emsespScheduler.json"
|
||||
#define EMSESP_SCHEDULER_SERVICE_PATH "/rest/schedule" // GET and POST
|
||||
|
||||
#ifndef EMSESP_SCHEDULER_RUNNING_CORE
|
||||
#define EMSESP_SCHEDULER_RUNNING_CORE 1
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_SCHEDULER_STACKSIZE
|
||||
#define EMSESP_SCHEDULER_STACKSIZE 5120
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_SCHEDULER_PRIORITY
|
||||
#define EMSESP_SCHEDULER_PRIORITY 1
|
||||
#endif
|
||||
|
||||
// bit flags for the schedule items. Matches those in interface/src/app/main/SchedulerDialog.tsx
|
||||
// 0-127 (0->0x7F) is day schedule
|
||||
// 128/0x80 is timer
|
||||
|
||||
Reference in New Issue
Block a user