fsfw/events/Event.cpp

17 lines
349 B
C++
Raw Normal View History

2020-08-28 17:44:10 +02:00
#include "Event.h"
2020-09-25 19:01:59 +02:00
2020-08-28 17:44:10 +02:00
namespace EVENT {
EventId_t getEventId(Event event) {
return (event & 0xFFFF);
}
EventSeverity_t getSeverity(Event event) {
return ((event >> 16) & 0xFF);
}
2020-09-25 19:01:59 +02:00
Event makeEvent(uint8_t subsystemId, uint8_t uniqueEventId,
EventSeverity_t eventSeverity) {
return (eventSeverity << 16) + (subsystemId * 100) + uniqueEventId;
2020-08-28 17:44:10 +02:00
}
}