Improve mbuf fix
Byte index is now stored on 2 bytes. Macros have been made cleaner
This commit is contained in:
parent
0628c4c07c
commit
cc54ca7ca8
@ -18,8 +18,11 @@
|
|||||||
|
|
||||||
static void mbuf_callback(enum DmaIRQSource src, volatile void* param);
|
static void mbuf_callback(enum DmaIRQSource src, volatile void* param);
|
||||||
|
|
||||||
#define byte_index (((uint8_t**)buffer->buffers)[buffer->buffer_index][buffer->buffer_size + 1])
|
//take last 2 bytes of a buffer and assemble them store the current byte index
|
||||||
#define dma_byte_index (((uint8_t**)buffer->buffers)[buffer->dma_buffer_index][buffer->buffer_size + 1])
|
#define byte_index (((uint16_t**)buffer->buffers) \
|
||||||
|
[buffer->buffer_index][buffer->buffer_size/2])
|
||||||
|
#define dma_byte_index (((uint16_t**)buffer->buffers) \
|
||||||
|
[buffer->dma_buffer_index][buffer->buffer_size/2])
|
||||||
|
|
||||||
|
|
||||||
//--local variables-------------------------------------------------------------
|
//--local variables-------------------------------------------------------------
|
||||||
|
|||||||
@ -43,7 +43,8 @@ struct DmaMultiBuffer {
|
|||||||
* Configure a DMA multibuffer for a single DMA channel. A list of buffers is
|
* Configure a DMA multibuffer for a single DMA channel. A list of buffers is
|
||||||
* used to allow concurent write and DMA tranfers to the specified destination
|
* used to allow concurent write and DMA tranfers to the specified destination
|
||||||
* wich must be a peripheral. The DMA's priority is also given as parameters.
|
* wich must be a peripheral. The DMA's priority is also given as parameters.
|
||||||
* The peripheral's specific configuration must be handled separately.
|
* The peripheral's specific configuration must be handled separately. 2 bytes
|
||||||
|
* are reserved in each buffer for index storage.
|
||||||
*
|
*
|
||||||
* This system needs to be started manually: dma_mbuf_refresh() should be called
|
* This system needs to be started manually: dma_mbuf_refresh() should be called
|
||||||
* whenever a DMA transfer can be started. This can be done manually after
|
* whenever a DMA transfer can be started. This can be done manually after
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user