mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-02 09:21:54 +00:00
Add type size assertions
This commit is contained in:
parent
981dbc68c9
commit
1ccc15cc40
@ -28,6 +28,8 @@ namespace sta
|
|||||||
|
|
||||||
void HalSpiInterface::transfer16(uint16_t value)
|
void HalSpiInterface::transfer16(uint16_t value)
|
||||||
{
|
{
|
||||||
|
static_assert(sizeof(uint16_t) == 2);
|
||||||
|
|
||||||
HAL_SPI_Transmit(handle_, reinterpret_cast<uint8_t *>(&value), 2, HAL_MAX_DELAY);
|
HAL_SPI_Transmit(handle_, reinterpret_cast<uint8_t *>(&value), 2, HAL_MAX_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +44,8 @@ namespace sta
|
|||||||
|
|
||||||
void HalSpiInterface::fill32(uint32_t value, size_t count)
|
void HalSpiInterface::fill32(uint32_t value, size_t count)
|
||||||
{
|
{
|
||||||
|
static_assert(sizeof(uint32_t) == 4);
|
||||||
|
|
||||||
for (size_t i = 0; i < count; ++i)
|
for (size_t i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
HAL_SPI_Transmit(handle_, reinterpret_cast<uint8_t *>(&value), 4, HAL_MAX_DELAY);
|
HAL_SPI_Transmit(handle_, reinterpret_cast<uint8_t *>(&value), 4, HAL_MAX_DELAY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user