Fix SDIO buffer alignment (#21396)

This commit is contained in:
ldursw 2021-03-24 11:30:19 -03:00 committed by GitHub
parent fd8207dd9a
commit d172c71376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,8 +39,13 @@ inline int bs_read_serial(const serial_index_t index) {
#if ENABLED(BINARY_STREAM_COMPRESSION)
static heatshrink_decoder hsd;
#ifdef BOTH(ARDUINO_ARCH_STM32F1, SDIO_SUPPORT)
// STM32 requires a word-aligned buffer for SD card transfers via DMA
static __attribute__((aligned(sizeof(size_t)))) uint8_t decode_buffer[512] = {};
#else
static uint8_t decode_buffer[512] = {};
#endif
#endif
class SDFileTransferProtocol {
private: