Revert SPI memcpy()

This commit is contained in:
UncleRus 2017-03-22 10:50:54 +05:00
parent a91ec6eb61
commit 31ef50c9a9

View file

@ -189,9 +189,9 @@ static void _spi_buf_transfer(uint8_t bus, const void *out_data, void *in_data,
_wait(bus); _wait(bus);
size_t bytes = len * (uint8_t)word_size; size_t bytes = len * (uint8_t)word_size;
_set_size(bus, bytes); _set_size(bus, bytes);
// memcpy((void *)SPI(bus).W, out_data, bytes); // <- It's buggy memcpy((void *)SPI(bus).W, out_data, bytes); // FIXME: It's buggy when bytes = 2 or 3
for (uint8_t i = 0; i < bytes; i ++) // for (uint8_t i = 0; i < bytes; i ++)
((uint8_t *)SPI(bus).W)[i] = ((uint8_t *)out_data)[i]; // ((uint8_t *)SPI(bus).W)[i] = ((uint8_t *)out_data)[i];
_spi_buf_prepare(bus, len, e, word_size); _spi_buf_prepare(bus, len, e, word_size);
_start(bus); _start(bus);
_wait(bus); _wait(bus);