diff --git a/hardware.hpp b/hardware.hpp index 4defd34..913569e 100644 --- a/hardware.hpp +++ b/hardware.hpp @@ -4,6 +4,8 @@ namespace spi { +#if defined(__AVR_ATmega328P__) + template class Hardware { public: @@ -101,7 +103,7 @@ class Hardware { static void setBitOrder() { - if (Cfg::BIT_ORDER == BitOrder::LSB_FIRST) { + if constexpr (Cfg::BIT_ORDER == BitOrder::LSB_FIRST) { SPCR |= (1 << DORD); } else { SPCR &= ~(1 << DORD); @@ -126,4 +128,8 @@ class Hardware { } }; +#else +#error "This chip is not supported" +#endif + } // namespace spi