14 const char *thread_name,
15 int pin_to_core = tskNO_AFFINITY) {
16 memset(&previousConfig, 0,
sizeof(previousConfig));
17 hadPreviousConfig = esp_pthread_get_cfg(&previousConfig) == ESP_OK;
18 esp_pthread_cfg_t cfg = previousConfig;
19 cfg.stack_size = stack_size;
21 cfg.inherit_cfg = inherit_cfg;
22 cfg.thread_name = thread_name;
23 cfg.pin_to_core = pin_to_core;
24 esp_pthread_set_cfg(&cfg);
28 if (hadPreviousConfig)
29 esp_pthread_set_cfg(&previousConfig);
33 bool hadPreviousConfig;
34 esp_pthread_cfg_t previousConfig;
37 const char *thread_name,
int pin_to_core = -1) {