aboutsummaryrefslogtreecommitdiff
path: root/pw_interrupt_cortex_m
diff options
context:
space:
mode:
authorEwout van Bekkum <ewout@google.com>2020-12-17 09:52:06 -0800
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2020-12-17 19:07:19 +0000
commitc423748ae6e5c5f6cbde55714c370b367b9bd0b0 (patch)
tree7a41d274de05c3e9a77f62a76d91eb26109d05f7 /pw_interrupt_cortex_m
parentf39d0aed92a1257d6e12e244187db97959c0d8c4 (diff)
downloadpigweed-c423748ae6e5c5f6cbde55714c370b367b9bd0b0.tar.gz
pw_interrupt: fix context facade header includes
The pw_interrupt context facade header was including the backend header before the prototype definitions making it impossible to be used for the intended inlining without tripping a redundant declaration warning. This changes the facade header to optionally include a backend inlining header and fixes up the CortexM backend accordingly. Change-Id: I7d03c4b843ffa8ccece438b641206d5f14628114 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/28000 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Ewout van Bekkum <ewout@google.com>
Diffstat (limited to 'pw_interrupt_cortex_m')
-rw-r--r--pw_interrupt_cortex_m/BUILD4
-rw-r--r--pw_interrupt_cortex_m/BUILD.gn4
-rw-r--r--pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h (renamed from pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context.h)4
-rw-r--r--pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_inline.h (renamed from pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_backend.h)2
4 files changed, 7 insertions, 7 deletions
diff --git a/pw_interrupt_cortex_m/BUILD b/pw_interrupt_cortex_m/BUILD
index afae51330..02bd1f07c 100644
--- a/pw_interrupt_cortex_m/BUILD
+++ b/pw_interrupt_cortex_m/BUILD
@@ -24,8 +24,8 @@ licenses(["notice"]) # Apache License 2.0
pw_cc_library(
name = "context_armv7m_headers",
hdrs = [
- "public/pw_interrupt_cortex_m/context.h",
- "public_overrides/pw_interrupt_backend/context_backend.h",
+ "public/pw_interrupt_cortex_m/context_inline.h",
+ "public_overrides/pw_interrupt_backend/context_inline.h",
],
copts = [ "-DPW_INTERRUPT_CORTEX_M_ARMV7M=1" ],
includes = [
diff --git a/pw_interrupt_cortex_m/BUILD.gn b/pw_interrupt_cortex_m/BUILD.gn
index 65c9ea8b7..a7fd9548d 100644
--- a/pw_interrupt_cortex_m/BUILD.gn
+++ b/pw_interrupt_cortex_m/BUILD.gn
@@ -42,8 +42,8 @@ _context_common = {
":backend_config",
]
public = [
- "public/pw_interrupt_cortex_m/context.h",
- "public_overrides/pw_interrupt_backend/context_backend.h",
+ "public/pw_interrupt_cortex_m/context_inline.h",
+ "public_overrides/pw_interrupt_backend/context_inline.h",
]
}
diff --git a/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context.h b/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h
index bde6834cd..aeec59f17 100644
--- a/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context.h
+++ b/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h
@@ -13,10 +13,10 @@
// the License.
#pragma once
-namespace pw::interrupt {
-
#include <cstdint>
+namespace pw::interrupt {
+
#if defined(PW_INTERRUPT_CORTEX_M_ARMV7M) || \
defined(PW_INTERRUPT_CORTEX_M_ARMV8M)
inline bool InInterruptContext() {
diff --git a/pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_backend.h b/pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_inline.h
index 2fda174ee..2f2f0f630 100644
--- a/pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_backend.h
+++ b/pw_interrupt_cortex_m/public_overrides/pw_interrupt_backend/context_inline.h
@@ -16,4 +16,4 @@
// the PW_LOG macro as the tokenized logging macro.
#pragma once
-#include "pw_interrupt_cortex_m/context.h"
+#include "pw_interrupt_cortex_m/context_inline.h"