Skip to content

rootlocal/stm32-ring_buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIFO Ring Buffer

#define BUFFER_SIZE 200

buffer_t buffer;

// init buffer
char buf[BUFFER_SIZE] = {0};
BufferInit(&buffer, buf, BUFFER_SIZE);

// put
BufferPut(char symbol, buffer_t *buf);

// pop
BufferPop(buffer_t *buf);

Example IRQ:

void USART2_IRQHandler(void)
{
    USART_ClearITPendingBit(USART2, USART_IT_RXNE);
    BufferPut(USART_ReceiveData(USART2), &buffer);
    data.flag_off = false;
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published