release-1.0.0 #39
@@ -22,6 +22,26 @@
|
|||||||
|
|
||||||
#include "relay_chn_core.h"
|
#include "relay_chn_core.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Determine the event loop's queue and task stack sizes depending on
|
||||||
|
the configuration and memory requirements
|
||||||
|
*/
|
||||||
|
#if RELAY_CHN_ENABLE_TILTING == 1
|
||||||
|
#define EVENT_QUEUE_BASE_SIZE 32
|
||||||
|
#define EVENT_QUEUE_SIZE_BY_CHN 24
|
||||||
|
#define TASK_STACK_BASE_SIZE 4096
|
||||||
|
#else
|
||||||
|
#define EVENT_QUEUE_BASE_SIZE 16
|
||||||
|
#define EVENT_QUEUE_SIZE_BY_CHN 12
|
||||||
|
#define TASK_STACK_BASE_SIZE 2048
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define RELAY_CHN_EVENT_LOOP_QUEUE_SIZE \
|
||||||
|
(EVENT_QUEUE_BASE_SIZE + (EVENT_QUEUE_SIZE_BY_CHN * RELAY_CHN_COUNT))
|
||||||
|
|
||||||
|
#define RELAY_CHN_EVENT_LOOP_TASK_STACK_SIZE \
|
||||||
|
(TASK_STACK_BASE_SIZE + (RELAY_CHN_EVENT_LOOP_QUEUE_SIZE * RELAY_CHN_COUNT))
|
||||||
|
|
||||||
|
|
||||||
static const char *TAG = "RELAY_CHN_CORE";
|
static const char *TAG = "RELAY_CHN_CORE";
|
||||||
|
|
||||||
@@ -99,10 +119,10 @@ esp_err_t relay_chn_init_timer(relay_chn_ctl_t *chn_ctl)
|
|||||||
static esp_err_t relay_chn_create_event_loop()
|
static esp_err_t relay_chn_create_event_loop()
|
||||||
{
|
{
|
||||||
esp_event_loop_args_t loop_args = {
|
esp_event_loop_args_t loop_args = {
|
||||||
.queue_size = RELAY_CHN_COUNT * 8,
|
.queue_size = RELAY_CHN_EVENT_LOOP_QUEUE_SIZE,
|
||||||
.task_name = "relay_chn_event_loop",
|
.task_name = "relay_chn_event_loop",
|
||||||
.task_priority = ESP_TASKD_EVENT_PRIO - 1,
|
.task_priority = ESP_TASKD_EVENT_PRIO - 1,
|
||||||
.task_stack_size = 2048,
|
.task_stack_size = RELAY_CHN_EVENT_LOOP_TASK_STACK_SIZE,
|
||||||
.task_core_id = tskNO_AFFINITY
|
.task_core_id = tskNO_AFFINITY
|
||||||
};
|
};
|
||||||
esp_err_t ret = esp_event_loop_create(&loop_args, &relay_chn_event_loop);
|
esp_err_t ret = esp_event_loop_create(&loop_args, &relay_chn_event_loop);
|
||||||
|
|||||||
Reference in New Issue
Block a user