-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pthread): Fix cxx pthread example build for linux platform
Closes #14339
- Loading branch information
1 parent
5d285c1
commit d3ab90b
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
/* | ||
* pthread port for Linux build | ||
*/ | ||
|
||
#include "esp_pthread.h" | ||
#include <string.h> | ||
|
||
/** | ||
* @brief Creates a default pthread configuration based | ||
* on the values set via menuconfig. | ||
* | ||
* @return | ||
* A default configuration structure. | ||
*/ | ||
esp_pthread_cfg_t esp_pthread_get_default_config(void) | ||
{ | ||
esp_pthread_cfg_t cfg = { | ||
.stack_size = CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT, | ||
.prio = CONFIG_PTHREAD_TASK_PRIO_DEFAULT, | ||
.inherit_cfg = false, | ||
.thread_name = NULL, | ||
.pin_to_core = 0, | ||
.stack_alloc_caps = 0, | ||
}; | ||
|
||
return cfg; | ||
} | ||
|
||
esp_err_t esp_pthread_set_cfg(const esp_pthread_cfg_t *cfg) | ||
{ | ||
return ESP_OK; | ||
} | ||
|
||
esp_err_t esp_pthread_get_cfg(esp_pthread_cfg_t *p) | ||
{ | ||
memset(p, 0, sizeof(*p)); | ||
return ESP_ERR_NOT_FOUND; | ||
} |
3 changes: 2 additions & 1 deletion
3
tools/test_apps/linux_compatible/generic_build_test/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
idf_component_register(SRCS "generic_build_test.c" | ||
INCLUDE_DIRS ".") | ||
INCLUDE_DIRS "." | ||
PRIV_REQUIRES pthread) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters