diff options
Diffstat (limited to 'common/host_event_commands.c')
-rw-r--r-- | common/host_event_commands.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index 0364474de0..1dc9ac5c0c 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -40,9 +40,14 @@ uint32_t host_get_events(void) void host_set_events(uint32_t mask) { - /* Only print if something's about to change */ - if ((events & mask) != mask || (events_copy_b & mask) != mask) - CPRINTS("event set 0x%08x", mask); + /* ignore host events the rest of board doesn't care about */ + mask &= CONFIG_HOST_EVENT_REPORT_MASK; + + /* exit now if nothing has changed */ + if (!((events & mask) != mask || (events_copy_b & mask) != mask)) + return; + + CPRINTS("event set 0x%08x", mask); atomic_or(&events, mask); atomic_or(&events_copy_b, mask); @@ -62,9 +67,14 @@ void host_set_events(uint32_t mask) void host_clear_events(uint32_t mask) { - /* Only print if something's about to change */ - if (events & mask) - CPRINTS("event clear 0x%08x", mask); + /* ignore host events the rest of board doesn't care about */ + mask &= CONFIG_HOST_EVENT_REPORT_MASK; + + /* return early if nothing changed */ + if (!(events & mask)) + return; + + CPRINTS("event clear 0x%08x", mask); atomic_clear(&events, mask); |