29 lines
369 B
C
29 lines
369 B
C
/* (c) Daniele Lacamera 2019
|
|
* GPL
|
|
*/
|
|
#include <stdint.h>
|
|
#include "system.h"
|
|
#include <string.h>
|
|
|
|
extern uint32_t cpu_freq;
|
|
|
|
void *memset(void *s, int c, size_t n)
|
|
{
|
|
unsigned char *d = (unsigned char *)s;
|
|
|
|
while (n--) {
|
|
*d++ = (unsigned char)c;
|
|
}
|
|
|
|
return s;
|
|
}
|
|
|
|
size_t strlen(const char *s)
|
|
{
|
|
int i = 0;
|
|
|
|
while (s[i] != 0)
|
|
i++;
|
|
|
|
return i;
|
|
}
|