Skip to content

Commit 49e43f9

Browse files
Merge pull request #573 from intel/lukevalenty/fix_shared_sub_irq_enables
fix shared_sub_irq issue where top level enable is not set
2 parents 90ba326 + a718e12 commit 49e43f9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

include/interrupt/impl.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ struct shared_sub_irq_impl : Config {
8686
using Config::status_field;
8787

8888
[[nodiscard]] static auto get_interrupt_enables() {
89-
return stdx::tuple_cat(Subs::get_interrupt_enables()...);
89+
if constexpr (active) {
90+
return stdx::tuple_cat(stdx::make_tuple(enable_field),
91+
Subs::get_interrupt_enables()...);
92+
} else {
93+
return stdx::tuple{};
94+
}
9095
}
9196

9297
static auto run() -> void {

test/interrupt/shared_sub_irq_impl.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ TEST_CASE(
9898
using impl_t =
9999
interrupt::shared_sub_irq_impl<flow_config_t<std::true_type>,
100100
active_sub_impl_t, inactive_sub_impl_t>;
101-
CHECK(impl_t::get_interrupt_enables() ==
102-
stdx::tuple{enable_field_t<17>{}, enable_field_t<0>{}});
101+
102+
auto expected = stdx::tuple{enable_field_t<0>{}, enable_field_t<17>{}};
103+
auto actual = impl_t::get_interrupt_enables();
104+
105+
CHECK(std::size(expected) == std::size(actual));
106+
CHECK(expected == actual);
103107
}

0 commit comments

Comments
 (0)