diff options
| author | hathach <[email protected]> | 2026-01-01 12:51:05 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-01-01 12:51:05 +0700 |
| commit | 9ab605ef0b7402e72f9540d4b54af607d60cfd7a (patch) | |
| tree | 63c60876da6833d6339c7c361e246e2bf807cd63 /src/common/tusb_fifo.c | |
| parent | 009750c747ff1d5a25d976de9161b974eb5f18e7 (diff) | |
change signature of tu_hwfifo_* to have hwfifo as first parameter
Diffstat (limited to 'src/common/tusb_fifo.c')
| -rw-r--r-- | src/common/tusb_fifo.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c index 38b00d9d6..828240b6c 100644 --- a/src/common/tusb_fifo.c +++ b/src/common/tusb_fifo.c @@ -167,9 +167,17 @@ void tu_hwfifo_write(volatile void *hwfifo, const uint8_t *src, uint16_t len) { // Write the remaining 1 byte (16bit) or 1-3 bytes (32bit) if (len > 0) { + #ifdef CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE_ODD_BYTE + // odd byte access, write byte per byte e.g for rusb2. No address stride needed + volatile uint8_t *dest8 = (volatile uint8_t *)dest; + for (uint16_t i = 0; i < len; ++i) { + *dest8 = src[i]; + } + #else hwfifo_item_t tmp = 0u; memcpy(&tmp, src, len); *dest = tmp; + #endif } } #endif |
