From ea3f5729c910f5dddeafe4cb54dbde1d778449a7 Mon Sep 17 00:00:00 2001 From: Wyatt Hepler Date: Wed, 5 Jun 2024 22:10:35 +0000 Subject: [PATCH] pw_system: Move config variables to config.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibdccdb0bd347799cbaf179104ce9c3effe90e906 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/213811 Lint: Lint 🤖 Pigweed-Auto-Submit: Wyatt Hepler Commit-Queue: Auto-Submit Reviewed-by: Armando Montanez Presubmit-Verified: CQ Bot Account --- pw_system/log.cc | 1 - pw_system/public/pw_system/config.h | 18 ++++++++++++++++++ pw_system/public/pw_system/rpc_server.h | 12 ------------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pw_system/log.cc b/pw_system/log.cc index 34163b2753..20a2bc971e 100644 --- a/pw_system/log.cc +++ b/pw_system/log.cc @@ -23,7 +23,6 @@ #include "pw_sync/lock_annotations.h" #include "pw_sync/mutex.h" #include "pw_system/config.h" -#include "pw_system/rpc_server.h" namespace pw::system { namespace { diff --git a/pw_system/public/pw_system/config.h b/pw_system/public/pw_system/config.h index 2dadc0bf41..cfa7098319 100644 --- a/pw_system/public/pw_system/config.h +++ b/pw_system/public/pw_system/config.h @@ -13,6 +13,8 @@ // the License. #pragma once +#include + // PW_SYSTEM_LOG_BUFFER_SIZE is the log buffer size which determines how many // log entries can be buffered prior to streaming them. // @@ -116,3 +118,19 @@ #ifndef PW_SYSTEM_SOCKET_IO_PORT #define PW_SYSTEM_SOCKET_IO_PORT 33000 #endif // PW_SYSTEM_SOCKET_IO_PORT + +namespace pw::system { + +// This is the default channel used by the pw_system RPC server. Some other +// parts of pw_system use this channel ID as the default destination for +// unrequested data streams. +inline constexpr uint32_t kDefaultRpcChannelId = PW_SYSTEM_DEFAULT_CHANNEL_ID; + +// This is the channel ID used for logging. +inline constexpr uint32_t kLoggingRpcChannelId = PW_SYSTEM_LOGGING_CHANNEL_ID; +#if PW_SYSTEM_EXTRA_LOGGING_CHANNEL_ID != PW_SYSTEM_LOGGING_CHANNEL_ID +inline constexpr uint32_t kExtraLoggingRpcChannelId = + PW_SYSTEM_EXTRA_LOGGING_CHANNEL_ID; +#endif // PW_SYSTEM_EXTRA_LOGGING_CHANNEL_ID != PW_SYSTEM_LOGGING_CHANNEL_ID + +} // namespace pw::system diff --git a/pw_system/public/pw_system/rpc_server.h b/pw_system/public/pw_system/rpc_server.h index 477f6438c0..6bcbf2202d 100644 --- a/pw_system/public/pw_system/rpc_server.h +++ b/pw_system/public/pw_system/rpc_server.h @@ -22,18 +22,6 @@ namespace pw::system { -// This is the default channel used by the pw_system RPC server. Some other -// parts of pw_system use this channel ID as the default destination for -// unrequested data streams. -inline constexpr uint32_t kDefaultRpcChannelId = PW_SYSTEM_DEFAULT_CHANNEL_ID; - -// This is the channel ID used for logging. -inline constexpr uint32_t kLoggingRpcChannelId = PW_SYSTEM_LOGGING_CHANNEL_ID; -#if PW_SYSTEM_EXTRA_LOGGING_CHANNEL_ID != PW_SYSTEM_LOGGING_CHANNEL_ID -inline constexpr uint32_t kExtraLoggingRpcChannelId = - PW_SYSTEM_EXTRA_LOGGING_CHANNEL_ID; -#endif - rpc::Server& GetRpcServer(); thread::ThreadCore& GetRpcDispatchThread();