• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
17pw_add_module_config(pw_thread_freertos_CONFIG)
18
19pw_add_module_library(pw_thread_freertos.config
20  HEADERS
21    public/pw_thread_freertos/config.h
22  PUBLIC_INCLUDES
23    public
24  PUBLIC_DEPS
25    pw_third_party.freertos
26    ${pw_thread_freertos_CONFIG}
27)
28
29# This target provides the backend for pw::thread::Id & pw::this_thread::get_id.
30pw_add_module_library(pw_thread_freertos.id
31  IMPLEMENTS_FACADES
32    pw_thread.id
33  HEADERS
34    public/pw_thread_freertos/id_inline.h
35    public/pw_thread_freertos/id_native.h
36    public_overrides/pw_thread_backend/id_inline.h
37    public_overrides/pw_thread_backend/id_native.h
38  PUBLIC_INCLUDES
39    public
40    public_overrides
41  PUBLIC_DEPS
42    pw_assert
43    pw_interrupt.context
44    pw_third_party.freertos
45)
46
47# This target provides the backend for pw::this_thread::sleep_{for,until}.
48pw_add_module_library(pw_thread_freertos.sleep
49  IMPLEMENTS_FACADES
50    pw_thread.sleep
51  HEADERS
52    public/pw_thread_freertos/sleep_inline.h
53    public_overrides/pw_thread_backend/sleep_inline.h
54  PUBLIC_INCLUDES
55    public
56    public_overrides
57  PUBLIC_DEPS
58    pw_chrono.system_clock
59  SOURCES
60    sleep.cc
61  PRIVATE_DEPS
62    pw_assert
63    pw_chrono_freertos.system_clock
64    pw_third_party.freertos
65    pw_thread.id
66)
67
68# This target provides the backend for pw::thread::Thread and the headers needed
69# for thread creation.
70pw_add_module_library(pw_thread_freertos.thread
71  IMPLEMENTS_FACADES
72    pw_thread.thread
73  HEADERS
74    public/pw_thread_freertos/context.h
75    public/pw_thread_freertos/options.h
76    public/pw_thread_freertos/thread_inline.h
77    public/pw_thread_freertos/thread_native.h
78    public_overrides/pw_thread_backend/thread_inline.h
79    public_overrides/pw_thread_backend/thread_native.h
80  PUBLIC_INCLUDES
81    public
82    public_overrides
83  PUBLIC_DEPS
84    pw_assert
85    pw_polyfill.span
86    pw_string
87    pw_third_party.freertos
88    pw_thread.id
89    pw_thread_freertos.config
90  SOURCES
91    thread.cc
92)
93
94# This target provides the backend for pw::this_thread::yield.
95pw_add_module_library(pw_thread_freertos.yield
96  IMPLEMENTS_FACADES
97    pw_thread.yield
98  HEADERS
99    public/pw_thread_freertos/yield_inline.h
100    public_overrides/pw_thread_backend/yield_inline.h
101  PUBLIC_INCLUDES
102    public
103    public_overrides
104  PUBLIC_DEPS
105    pw_assert
106    pw_third_party.freertos
107    pw_thread.id
108)
109
110pw_add_module_library(pw_thread_freertos.util
111  HEADERS
112    public/pw_thread_freertos/util.h
113  PUBLIC_INCLUDES
114    public
115  PUBLIC_DEPS
116    pw_third_party.freertos
117    pw_function
118    pw_polyfill.span
119    pw_status
120  SOURCES
121    util.cc
122  PRIVATE_DEPS
123    pw_log
124)
125
126pw_add_module_library(pw_thread_freertos.snapshot
127  HEADERS
128    public/pw_thread_freertos/snapshot.h
129  PUBLIC_INCLUDES
130    public
131  PUBLIC_DEPS
132    pw_function
133    pw_polyfill.span
134    pw_protobuf
135    pw_status
136    pw_third_party.freertos
137    pw_thread.protos.pwpb
138    pw_thread.snapshot
139    pw_thread_freertos.config
140  SOURCES
141    snapshot.cc
142  PRIVATE_DEPS
143    pw_thread_freertos.freertos_tsktcb
144    pw_thread_freertos.util
145    pw_log
146)
147
148pw_add_facade(pw_thread_freertos.freertos_tsktcb
149  HEADERS
150    public/pw_thread_freertos/freertos_tsktcb.h
151  PUBLIC_INCLUDES
152    public
153  PUBLIC_DEPS
154    pw_third_party.freertos
155)
156