Update to use skullc for enums

This commit is contained in:
Erki 2022-07-15 14:23:19 +03:00
parent c67c41f166
commit e25b54add4
2 changed files with 2 additions and 12 deletions

View File

@ -3,7 +3,6 @@
#include <utility_logging.hpp>
#include <utility_assert.hpp>
#include <utility_staticpointer.hpp>
#include <cassert>
#include <utility_function.hpp>
#include "radio_hw_instance.hpp"

View File

@ -6,6 +6,7 @@
#define SKL_TUNNEL_RADIO_INTERRUPTS_HPP
#include <cstdint>
#include <utility_enum_helpers.hpp>
namespace radio
{
@ -22,17 +23,7 @@ enum class Interrupts : std::uint8_t
BAT_LOW = (1 << 7)
};
inline Interrupts operator|(const Interrupts& lhs, const Interrupts& rhs)
{
using T = std::underlying_type_t<Interrupts>;
return static_cast<Interrupts>(static_cast<T>(lhs) | static_cast<T>(rhs));
}
inline Interrupts operator&(const Interrupts& lhs, const Interrupts& rhs)
{
using T = std::underlying_type_t<Interrupts>;
return static_cast<Interrupts>(static_cast<T>(lhs) & static_cast<T>(rhs));
}
SKULLC_ENUM_DECLARE_BITFLAG_OPERATORS(Interrupts)
}