aboutsummaryrefslogtreecommitdiff
path: root/pw_thread_freertos
diff options
context:
space:
mode:
authorYvonne Yip <yky@google.com>2022-10-14 22:20:48 +0000
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-14 22:20:48 +0000
commit8ff95d19c7718ce359a1f5f615cf1f961fca2d2e (patch)
treeb1e749d63a41be8b187680b7250a43fc5002a6f4 /pw_thread_freertos
parent043d70a6e61129fb673c63476b9241a29e502826 (diff)
downloadpigweed-8ff95d19c7718ce359a1f5f615cf1f961fca2d2e.tar.gz
pw_thread: Fix support for multiple facades in the same module
Change-Id: I754ecb9a8f0c6ad6ba23c7fe362e33a17882798d Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/114770 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Yvonne Yip <ykyyip@google.com>
Diffstat (limited to 'pw_thread_freertos')
-rw-r--r--pw_thread_freertos/BUILD.bazel20
-rw-r--r--pw_thread_freertos/BUILD.gn47
-rw-r--r--pw_thread_freertos/CMakeLists.txt20
-rw-r--r--pw_thread_freertos/id_public_overrides/pw_thread_backend/id_inline.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/id_inline.h)0
-rw-r--r--pw_thread_freertos/id_public_overrides/pw_thread_backend/id_native.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/id_native.h)0
-rw-r--r--pw_thread_freertos/sleep_public_overrides/pw_thread_backend/sleep_inline.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/sleep_inline.h)0
-rw-r--r--pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_inline.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/thread_inline.h)0
-rw-r--r--pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_native.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/thread_native.h)0
-rw-r--r--pw_thread_freertos/yield_public_overrides/pw_thread_backend/yield_inline.h (renamed from pw_thread_freertos/public_overrides/pw_thread_backend/yield_inline.h)0
9 files changed, 51 insertions, 36 deletions
diff --git a/pw_thread_freertos/BUILD.bazel b/pw_thread_freertos/BUILD.bazel
index a81037ce6..a980f1f23 100644
--- a/pw_thread_freertos/BUILD.bazel
+++ b/pw_thread_freertos/BUILD.bazel
@@ -26,14 +26,14 @@ licenses(["notice"])
pw_cc_library(
name = "id_headers",
hdrs = [
+ "id_public_overrides/pw_thread_backend/id_inline.h",
+ "id_public_overrides/pw_thread_backend/id_native.h",
"public/pw_thread_freertos/id_inline.h",
"public/pw_thread_freertos/id_native.h",
- "public_overrides/pw_thread_backend/id_inline.h",
- "public_overrides/pw_thread_backend/id_native.h",
],
includes = [
+ "id_public_overrides",
"public",
- "public_overrides",
],
)
@@ -51,11 +51,11 @@ pw_cc_library(
name = "sleep_headers",
hdrs = [
"public/pw_thread_freertos/sleep_inline.h",
- "public_overrides/pw_thread_backend/sleep_inline.h",
+ "sleep_public_overrides/pw_thread_backend/sleep_inline.h",
],
includes = [
"public",
- "public_overrides",
+ "sleep_public_overrides",
],
deps = [
"//pw_chrono:system_clock",
@@ -87,12 +87,12 @@ pw_cc_library(
"public/pw_thread_freertos/options.h",
"public/pw_thread_freertos/thread_inline.h",
"public/pw_thread_freertos/thread_native.h",
- "public_overrides/pw_thread_backend/thread_inline.h",
- "public_overrides/pw_thread_backend/thread_native.h",
+ "thread_public_overrides/pw_thread_backend/thread_inline.h",
+ "thread_public_overrides/pw_thread_backend/thread_native.h",
],
includes = [
"public",
- "public_overrides",
+ "thread_public_overrides",
],
deps = [
":id",
@@ -165,11 +165,11 @@ pw_cc_library(
name = "yield_headers",
hdrs = [
"public/pw_thread_freertos/yield_inline.h",
- "public_overrides/pw_thread_backend/yield_inline.h",
+ "yield_public_overrides/pw_thread_backend/yield_inline.h",
],
includes = [
"public",
- "public_overrides",
+ "yield_public_overrides",
],
# TODO(b/234876414): This should depend on FreeRTOS but our third parties
# currently do not have Bazel support.
diff --git a/pw_thread_freertos/BUILD.gn b/pw_thread_freertos/BUILD.gn
index 8568d51d4..532a79dba 100644
--- a/pw_thread_freertos/BUILD.gn
+++ b/pw_thread_freertos/BUILD.gn
@@ -37,11 +37,6 @@ config("public_include_path") {
visibility = [ ":*" ]
}
-config("backend_config") {
- include_dirs = [ "public_overrides" ]
- visibility = [ ":*" ]
-}
-
pw_source_set("config") {
public = [ "public/pw_thread_freertos/config.h" ]
public_configs = [ ":public_include_path" ]
@@ -51,11 +46,16 @@ pw_source_set("config") {
]
}
+config("id_public_overrides") {
+ include_dirs = [ "id_public_overrides" ]
+ visibility = [ ":*" ]
+}
+
# This target provides the backend for pw::thread::Id & pw::this_thread::get_id.
pw_source_set("id") {
public_configs = [
":public_include_path",
- ":backend_config",
+ ":id_public_overrides",
]
public_deps = [
"$dir_pw_assert",
@@ -63,10 +63,10 @@ pw_source_set("id") {
"$dir_pw_third_party/freertos",
]
public = [
+ "id_public_overrides/pw_thread_backend/id_inline.h",
+ "id_public_overrides/pw_thread_backend/id_native.h",
"public/pw_thread_freertos/id_inline.h",
"public/pw_thread_freertos/id_native.h",
- "public_overrides/pw_thread_backend/id_inline.h",
- "public_overrides/pw_thread_backend/id_native.h",
]
deps = [ "$dir_pw_thread:id.facade" ]
}
@@ -82,15 +82,20 @@ pw_build_assert("check_system_clock_backend") {
visibility = [ ":*" ]
}
+config("sleep_public_overrides") {
+ include_dirs = [ "sleep_public_overrides" ]
+ visibility = [ ":*" ]
+}
+
# This target provides the backend for pw::this_thread::sleep_{for,until}.
pw_source_set("sleep") {
public_configs = [
":public_include_path",
- ":backend_config",
+ ":sleep_public_overrides",
]
public = [
"public/pw_thread_freertos/sleep_inline.h",
- "public_overrides/pw_thread_backend/sleep_inline.h",
+ "sleep_public_overrides/pw_thread_backend/sleep_inline.h",
]
public_deps = [ "$dir_pw_chrono:system_clock" ]
sources = [ "sleep.cc" ]
@@ -104,12 +109,17 @@ pw_source_set("sleep") {
]
}
+config("thread_public_overrides") {
+ include_dirs = [ "thread_public_overrides" ]
+ visibility = [ ":*" ]
+}
+
# This target provides the backend for pw::thread::Thread and the headers needed
# for thread creation.
pw_source_set("thread") {
public_configs = [
":public_include_path",
- ":backend_config",
+ ":thread_public_overrides",
]
public_deps = [
":config",
@@ -125,8 +135,8 @@ pw_source_set("thread") {
"public/pw_thread_freertos/options.h",
"public/pw_thread_freertos/thread_inline.h",
"public/pw_thread_freertos/thread_native.h",
- "public_overrides/pw_thread_backend/thread_inline.h",
- "public_overrides/pw_thread_backend/thread_native.h",
+ "thread_public_overrides/pw_thread_backend/thread_inline.h",
+ "thread_public_overrides/pw_thread_backend/thread_native.h",
]
allow_circular_includes_from = [ "$dir_pw_thread:thread.facade" ]
sources = [ "thread.cc" ]
@@ -135,7 +145,7 @@ pw_source_set("thread") {
# This target provides the backend for pw::thread::thread_iteration.
if (pw_thread_freertos_FREERTOS_TSKTCB_BACKEND != "") {
pw_source_set("thread_iteration") {
- public_configs = [ ":backend_config" ]
+ public_configs = [ ":thread_public_overrides" ]
deps = [
":freertos_tsktcb",
"$dir_pw_third_party/freertos",
@@ -153,15 +163,20 @@ if (pw_thread_freertos_FREERTOS_TSKTCB_BACKEND != "") {
}
}
+config("yield_public_overrides") {
+ include_dirs = [ "yield_public_overrides" ]
+ visibility = [ ":*" ]
+}
+
# This target provides the backend for pw::this_thread::yield.
pw_source_set("yield") {
public_configs = [
":public_include_path",
- ":backend_config",
+ ":yield_public_overrides",
]
public = [
"public/pw_thread_freertos/yield_inline.h",
- "public_overrides/pw_thread_backend/yield_inline.h",
+ "yield_public_overrides/pw_thread_backend/yield_inline.h",
]
public_deps = [
"$dir_pw_assert",
diff --git a/pw_thread_freertos/CMakeLists.txt b/pw_thread_freertos/CMakeLists.txt
index 882527a16..8c537a59b 100644
--- a/pw_thread_freertos/CMakeLists.txt
+++ b/pw_thread_freertos/CMakeLists.txt
@@ -33,11 +33,11 @@ pw_add_module_library(pw_thread_freertos.id
HEADERS
public/pw_thread_freertos/id_inline.h
public/pw_thread_freertos/id_native.h
- public_overrides/pw_thread_backend/id_inline.h
- public_overrides/pw_thread_backend/id_native.h
+ id_public_overrides/pw_thread_backend/id_inline.h
+ id_public_overrides/pw_thread_backend/id_native.h
PUBLIC_INCLUDES
public
- public_overrides
+ id_public_overrides
PUBLIC_DEPS
pw_assert
pw_interrupt.context
@@ -50,10 +50,10 @@ pw_add_module_library(pw_thread_freertos.sleep
pw_thread.sleep
HEADERS
public/pw_thread_freertos/sleep_inline.h
- public_overrides/pw_thread_backend/sleep_inline.h
+ sleep_public_overrides/pw_thread_backend/sleep_inline.h
PUBLIC_INCLUDES
public
- public_overrides
+ sleep_public_overrides
PUBLIC_DEPS
pw_chrono.system_clock
SOURCES
@@ -75,11 +75,11 @@ pw_add_module_library(pw_thread_freertos.thread
public/pw_thread_freertos/options.h
public/pw_thread_freertos/thread_inline.h
public/pw_thread_freertos/thread_native.h
- public_overrides/pw_thread_backend/thread_inline.h
- public_overrides/pw_thread_backend/thread_native.h
+ thread_public_overrides/pw_thread_backend/thread_inline.h
+ thread_public_overrides/pw_thread_backend/thread_native.h
PUBLIC_INCLUDES
public
- public_overrides
+ thread_public_overrides
PUBLIC_DEPS
pw_assert
pw_span
@@ -97,10 +97,10 @@ pw_add_module_library(pw_thread_freertos.yield
pw_thread.yield
HEADERS
public/pw_thread_freertos/yield_inline.h
- public_overrides/pw_thread_backend/yield_inline.h
+ yield_public_overrides/pw_thread_backend/yield_inline.h
PUBLIC_INCLUDES
public
- public_overrides
+ yield_public_overrides
PUBLIC_DEPS
pw_assert
pw_third_party.freertos
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/id_inline.h b/pw_thread_freertos/id_public_overrides/pw_thread_backend/id_inline.h
index dcaf69997..dcaf69997 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/id_inline.h
+++ b/pw_thread_freertos/id_public_overrides/pw_thread_backend/id_inline.h
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/id_native.h b/pw_thread_freertos/id_public_overrides/pw_thread_backend/id_native.h
index 245d29b88..245d29b88 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/id_native.h
+++ b/pw_thread_freertos/id_public_overrides/pw_thread_backend/id_native.h
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/sleep_inline.h b/pw_thread_freertos/sleep_public_overrides/pw_thread_backend/sleep_inline.h
index 4ccbe1de2..4ccbe1de2 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/sleep_inline.h
+++ b/pw_thread_freertos/sleep_public_overrides/pw_thread_backend/sleep_inline.h
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/thread_inline.h b/pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_inline.h
index 7305e9162..7305e9162 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/thread_inline.h
+++ b/pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_inline.h
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/thread_native.h b/pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_native.h
index 478f79120..478f79120 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/thread_native.h
+++ b/pw_thread_freertos/thread_public_overrides/pw_thread_backend/thread_native.h
diff --git a/pw_thread_freertos/public_overrides/pw_thread_backend/yield_inline.h b/pw_thread_freertos/yield_public_overrides/pw_thread_backend/yield_inline.h
index 4ad04ab5c..4ad04ab5c 100644
--- a/pw_thread_freertos/public_overrides/pw_thread_backend/yield_inline.h
+++ b/pw_thread_freertos/yield_public_overrides/pw_thread_backend/yield_inline.h