• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 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
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_binary",
18    "pw_cc_library",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])
24
25# WARNING: Many of the dependencies in this file are missing and need to be
26# added/updated. This is provided as a starting point, but currently does not
27# work.
28
29pw_cc_library(
30    name = "config",
31    hdrs = [
32        "public/pw_system/config.h",
33    ],
34)
35
36pw_cc_library(
37    name = "log",
38    srcs = [
39        "log.cc",
40    ],
41    hdrs = [
42        "pw_system_private/log.h",
43    ],
44    deps = [
45        ":config",
46        ":rpc_server",
47        "//pw_log_rpc:log_service",
48        "//pw_log_rpc:rpc_log_drain",
49        "//pw_log_rpc:rpc_log_drain_thread",
50        "//pw_multisink",
51        "//pw_sync:lock_annotations",
52        "//pw_sync:mutex",
53    ],
54)
55
56pw_cc_library(
57    name = "log_backend",
58    srcs = [
59        "log_backend.cc",
60    ],
61    deps = [
62        ":config",
63        ":log",
64        "//pw_bytes",
65        "//pw_chrono:system_clock",
66        "//pw_log:facade",
67        "//pw_log:proto_utils",
68        "//pw_log_string:handler_facade",
69        "//pw_log_tokenized:metadata",
70        "//pw_multisink",
71        "//pw_result",
72        "//pw_string",
73        "//pw_sync:interrupt_spin_lock",
74        "//pw_sync:lock_annotations",
75        "//pw_tokenizer",
76    ],
77)
78
79pw_cc_library(
80    name = "rpc_server",
81    hdrs = [
82        "public/pw_system/rpc_server.h",
83    ],
84    includes = ["public"],
85    deps = [
86        ":config",
87        ":hdlc_rpc_server",
88    ],
89)
90
91pw_cc_library(
92    name = "hdlc_rpc_server",
93    srcs = [
94        "hdlc_rpc_server.cc",
95    ],
96    includes = ["public"],
97    deps = [
98        ":io",
99        ":rpc_server",
100        ":target_io",
101        "//pw_assert",
102        "//pw_hdlc:pw_rpc",
103        "//pw_hdlc:rpc_channel_output",
104        "//pw_sync:mutex",
105        "//pw_thread:thread_core",
106    ],
107)
108
109pw_cc_library(
110    name = "io",
111    hdrs = [
112        "public/pw_system/io.h",
113    ],
114    deps = [
115        "//pw_stream",
116    ],
117)
118
119pw_cc_library(
120    name = "init",
121    srcs = [
122        "init.cc",
123    ],
124    hdrs = [
125        "public/pw_system/init.h",
126    ],
127    includes = ["public"],
128    deps = [
129        ":log",
130        ":rpc_server",
131        "//pw_rpc/nanopb:echo_service",
132        "//pw_thread:thread",
133    ],
134)
135
136pw_cc_library(
137    name = "work_queue",
138    srcs = [
139        "work_queue.cc",
140    ],
141    hdrs = [
142        "public/pw_system/work_queue.h",
143    ],
144    includes = ["public"],
145    deps = [
146        "//pw_work_queue",
147    ],
148)
149
150pw_cc_library(
151    name = "target_io",
152    srcs = [
153        "target_io.cc",
154    ],
155    includes = ["public"],
156    deps = [
157        ":io",
158        "//pw_stream",
159        "//pw_stream:sys_io_stream",
160    ],
161)
162
163pw_cc_library(
164    name = "socket_target_io",
165    srcs = [
166        "socket_target_io.cc",
167    ],
168    includes = ["public"],
169    deps = [
170        ":config",
171        ":io",
172        "//pw_assert",
173        "//pw_stream",
174        "//pw_stream:socket_stream",
175    ],
176)
177
178pw_cc_library(
179    name = "target_hooks",
180    hdrs = [
181        "public/pw_system/target_hooks.h",
182    ],
183    includes = ["public"],
184    deps = [
185        "//pw_thread:thread",
186    ],
187)
188
189pw_cc_library(
190    name = "stl_target_hooks",
191    srcs = [
192        "stl_target_hooks.cc",
193    ],
194    deps = [
195        "//pw_thread:sleep",
196        "//pw_thread:thread",
197        "//pw_thread_stl:thread",
198    ],
199)
200
201pw_cc_library(
202    name = "freertos_target_hooks",
203    srcs = [
204        "freertos_target_hooks.cc",
205    ],
206
207    # TODO(pwbug/317): This should depend on FreeRTOS but our third parties
208    # currently do not have Bazel support.
209    deps = [
210        "//pw_thread:thread",
211        "//pw_thread_freertos:thread",
212    ],
213)
214
215pw_cc_binary(
216    name = "system_example",
217    srcs = ["example_user_app_init.cc"],
218    deps = [
219        ":init",
220        ":io",
221        ":target_hooks",
222        "//pw_stream",
223        "//pw_stream:sys_io_stream",
224    ],
225)
226