UberLambda/weegfx

Add a version of `write()` for duplicated data

UberLambda opened this issue · 0 comments

wgfxFillRect() fills the screen with pixel data that is all the same; that means that it has to fill the scratch buffer first, then copy the scratch buffer multiple times until all data is transferred.

This could be improved by adding a writeMultiple(const WGFX_U8 *buf, unsigned size, unsigned count, void *userPtr) function pointer to WGFXscreen, that would write count copies of buf
to it in sequence.
STM32s (and surely others) support transferring the same byte/half/word an arbitrary number of times via DMA (by simply not incrementing the source pointer after transfers). If size <= 4, the STM32 SPI/DMA backend could just transfer buf repeatedly with a single DMA transfer - potentially being much faster at wgfxFillRect()!