Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Fix SDIO buffer alignment (MarlinFirmware#21396)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldursw authored and Tymek committed Apr 26, 2021
1 parent bff4bd4 commit 4e57d26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/src/feature/binary_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ inline int bs_read_serial(const uint8_t index) {

#if ENABLED(BINARY_STREAM_COMPRESSION)
static heatshrink_decoder hsd;
static uint8_t decode_buffer[512] = {};
#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 {
Expand Down

0 comments on commit 4e57d26

Please sign in to comment.