fxlibc/src/libc/string/memset.c

16 lines
295 B
C
Raw Normal View History

#include <fxlibc/string.h>
2020-09-17 19:27:01 +02:00
/*
** The memset() function fills the first n bytes of the memory area pointed to
** by s with the constant byte c.
**
** TODO: use DMA !
** TODO: use DSP ?
*/
2020-09-17 19:27:01 +02:00
void *memset(void *s, int c, size_t n)
{
while ((int)--n >= 0)
((uint8_t *) s)[n] = c;
2020-09-17 19:27:01 +02:00
return (s);
}