Skip to content

Commit

Permalink
pw_system: Move config variables to config.h
Browse files Browse the repository at this point in the history
Change-Id: Ibdccdb0bd347799cbaf179104ce9c3effe90e906
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/213811
Lint: Lint 🤖 <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Reviewed-by: Armando Montanez <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Jun 5, 2024
1 parent 508e145 commit ea3f572
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
1 change: 0 additions & 1 deletion pw_system/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 18 additions & 0 deletions pw_system/public/pw_system/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// the License.
#pragma once

#include <cstdint>

// PW_SYSTEM_LOG_BUFFER_SIZE is the log buffer size which determines how many
// log entries can be buffered prior to streaming them.
//
Expand Down Expand Up @@ -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
12 changes: 0 additions & 12 deletions pw_system/public/pw_system/rpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ea3f572

Please sign in to comment.