diff --git a/src/hal/circular_buffer.h b/src/hal/circular_buffer.h index 89b16d8..4201a87 100644 --- a/src/hal/circular_buffer.h +++ b/src/hal/circular_buffer.h @@ -2,6 +2,9 @@ #include #include +#ifndef __AVR__ + #include +#endif /// A generic circular index class which can be used to build circular buffers /// Can hold up to size elements @@ -12,6 +15,11 @@ template class CircularIndex { public: +#ifndef __AVR__ + static_assert(size <= std::numeric_limits::max(), + "index_t is too small for the requested size"); +#endif + constexpr inline CircularIndex() : tail(0) , head(0) {}