Hi,
I’m trying to understand the sensor.c module code and I have a question about the DCMI_DMAConvCpltUser() function…I hope you can help me to get on the right track.
As the comment says:
// This function is called back after each line transfer is complete,
// with a pointer to the line buffer that was used. At this point the
// DMA transfers the next line to the other half of the line buffer.
void DCMI_DMAConvCpltUser(uint32_t addr)
{
...
So, if “addr” (and consequently “src” below) contains the pointer to the line buffer, why when the memory copy is performed, the “src” is offset by MAIN_FB()->x?
uint8_t *src = (uint8_t*) addr;
...
...
...
case PIXFORMAT_GRAYSCALE:
dst += (offset - MAIN_FB()->y) * MAIN_FB()->w;
if (sensor.gs_bpp == 1) {
// 1BPP GRAYSCALE.
src += MAIN_FB()->x;
unaligned_memcpy(dst, src, MAIN_FB()->w);
Thanks in advance,
Luca