Skip to content

Commit

Permalink
pw_system: Refresh to pwpb
Browse files Browse the repository at this point in the history
Change-Id: I80d4717fdb53cd59171fb9299bbcbd3f1a473d86
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/101174
Commit-Queue: Medha Kini <[email protected]>
Reviewed-by: Armando Montanez <[email protected]>
  • Loading branch information
Medha Kini authored and CQ Bot Account committed Jul 14, 2022
1 parent eb4313e commit 1c7a18d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 66 deletions.
6 changes: 5 additions & 1 deletion pw_system/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ pw_cc_library(
deps = [
":log",
":rpc_server",
"//pw_rpc/nanopb:echo_service",
":target_hooks.facade",
":work_queue",
"//pw_metric:global",
"//pw_metric:metric_service_pwpb",
"//pw_rpc/pwpb:echo_service",
"//pw_thread:thread",
],
)
Expand Down
110 changes: 47 additions & 63 deletions pw_system/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,20 @@ pw_facade("io") {
public_deps = [ "$dir_pw_stream" ]
}

# TODO(b/235145328, b/235146933): Remove this check after pw_metric and
# echo services don't depend on nanopb
if (dir_pw_third_party_nanopb != "") {
pw_source_set("init") {
public_configs = [ ":public_include_path" ]
public = [ "public/pw_system/init.h" ]
sources = [ "init.cc" ]
deps = [
":log",
":rpc_server",
":target_hooks.facade",
":work_queue",
"$dir_pw_metric:global",
"$dir_pw_metric:metric_service_nanopb",
"$dir_pw_rpc/nanopb:echo_service",
"$dir_pw_thread:thread",
]
}
pw_source_set("init") {
public_configs = [ ":public_include_path" ]
public = [ "public/pw_system/init.h" ]
sources = [ "init.cc" ]
deps = [
":log",
":rpc_server",
":target_hooks.facade",
":work_queue",
"$dir_pw_metric:global",
"$dir_pw_metric:metric_service_pwpb",
"$dir_pw_rpc/pwpb:echo_service",
"$dir_pw_thread:thread",
]
}

pw_source_set("hdlc_rpc_server") {
Expand Down Expand Up @@ -208,55 +204,43 @@ if (pw_system_TARGET_HOOKS_BACKEND == "") {
}
}

# TODO(b/235145328, b/235146933): Remove this check after pw_metric and
# echo services don't depend on nanopb
if (dir_pw_third_party_nanopb != "") {
group("pw_system") {
public_deps = [
":init",
":io",
":log",
":rpc_server",
":work_queue",
]
deps = [ ":target_hooks" ]
}
group("pw_system") {
public_deps = [
":init",
":io",
":log",
":rpc_server",
":work_queue",
]
deps = [ ":target_hooks" ]
}

pw_executable("system_example") {
sources = [ "example_user_app_init.cc" ]
deps = [
":pw_system",
"$dir_pw_log",
"$dir_pw_thread:sleep",
"$dir_pw_unit_test:rpc_service",
pw_executable("system_example") {
sources = [ "example_user_app_init.cc" ]
deps = [
":pw_system",
"$dir_pw_log",
"$dir_pw_thread:sleep",
"$dir_pw_unit_test:rpc_service",

# Adds a test that the test server can run.
"$dir_pw_status:status_test.lib",
"$dir_pw_string:string_builder_test.lib",
]
}
# Adds a test that the test server can run.
"$dir_pw_status:status_test.lib",
"$dir_pw_string:string_builder_test.lib",
]
}

group("system_examples") {
deps = [ ":system_example($dir_pigweed/targets/host_device_simulator:host_device_simulator.speed_optimized)" ]
if (dir_pw_third_party_stm32cube_f4 != "" &&
dir_pw_third_party_freertos != "") {
deps += [ ":system_example($dir_pigweed/targets/stm32f429i_disc1_stm32cube:stm32f429i_disc1_stm32cube.size_optimized)" ]
}
if (dir_pw_third_party_smartfusion_mss != "" &&
dir_pw_third_party_freertos != "") {
deps += [
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som.size_optimized)",
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som.speed_optimized)",
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som_debug.debug)",
]
}
group("system_examples") {
deps = [ ":system_example($dir_pigweed/targets/host_device_simulator:host_device_simulator.speed_optimized)" ]
if (dir_pw_third_party_stm32cube_f4 != "" &&
dir_pw_third_party_freertos != "") {
deps += [ ":system_example($dir_pigweed/targets/stm32f429i_disc1_stm32cube:stm32f429i_disc1_stm32cube.size_optimized)" ]
}
} else {
pw_error("system_examples") {
message_lines = [
"Building the pw_system examples requires Nanopb.",
"Nanopb can be installed by running the command below and then following the prompted setup steps:",
" pw package install nanopb",
if (dir_pw_third_party_smartfusion_mss != "" &&
dir_pw_third_party_freertos != "") {
deps += [
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som.size_optimized)",
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som.speed_optimized)",
":system_example($dir_pigweed/targets/emcraft_sf2_som:emcraft_sf2_som_debug.debug)",
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions pw_system/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include "pw_log/log.h"
#include "pw_metric/global.h"
#include "pw_metric/metric_service_nanopb.h"
#include "pw_rpc/echo_service_nanopb.h"
#include "pw_metric/metric_service_pwpb.h"
#include "pw_rpc/echo_service_pwpb.h"
#include "pw_system/rpc_server.h"
#include "pw_system/target_hooks.h"
#include "pw_system/work_queue.h"
Expand Down

0 comments on commit 1c7a18d

Please sign in to comment.