diff --git a/src/hal/spi.cpp b/src/hal/spi.cpp index 0fcf150..9411bef 100644 --- a/src/hal/spi.cpp +++ b/src/hal/spi.cpp @@ -28,6 +28,8 @@ namespace sta void HalSpiInterface::transfer16(uint16_t value) { + static_assert(sizeof(uint16_t) == 2); + HAL_SPI_Transmit(handle_, reinterpret_cast(&value), 2, HAL_MAX_DELAY); } @@ -42,6 +44,8 @@ namespace sta void HalSpiInterface::fill32(uint32_t value, size_t count) { + static_assert(sizeof(uint32_t) == 4); + for (size_t i = 0; i < count; ++i) { HAL_SPI_Transmit(handle_, reinterpret_cast(&value), 4, HAL_MAX_DELAY);