add bzero for embedded targets

This commit is contained in:
matthias.ringwald 2010-08-03 19:57:39 +00:00
parent 65793526c2
commit 866d626ba4
3 changed files with 14 additions and 0 deletions

View File

@ -100,3 +100,7 @@ uint8_t crc8_calc(uint8_t *data, uint16_t len);
#define BD_ADDR_CMP(a,b) memcmp(a,b, BD_ADDR_LEN)
#define BD_ADDR_COPY(dest,src) memcpy(dest,src,BD_ADDR_LEN)
#ifdef EMBEDDED
void bzero(void *s, uint32_t n);
#endif

View File

@ -41,6 +41,7 @@
#include <btstack/sdp_util.h>
#include "../config.h"
#include <btstack/utils.h> // for bzero on embedded
#include "hci.h"
// calculate combined ogf/ocf value

View File

@ -176,3 +176,12 @@ uint8_t crc8_calc(uint8_t *data, uint16_t len)
/* Ones complement */
return 0xFF - crc8(data, len);
}
/*-----------------------------------------------------------------------------------*/
// ad-hoc implemenation for embedded targets
void bzero(void *s, uint32_t n){
uint8_t * data = (uint8_t *) s;
while (n--){
*data++ = 0;
}
}