fixed workaround for memcpy/set to be memory efficient but slower

This commit is contained in:
joxe 2010-03-19 14:39:45 +00:00
parent 29335f2f7d
commit 7e6919cc8c
2 changed files with 32 additions and 3 deletions

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)$Id: msp430def.h,v 1.3 2009/04/06 13:07:37 nifi Exp $
* @(#)$Id: msp430def.h,v 1.4 2010/03/19 14:39:45 joxe Exp $
*/
#ifndef MSP430DEF_H
@ -76,6 +76,9 @@ spl_t splhigh_(void);
#ifndef memcpy
#include <string.h>
/* void *w_memcpy(void *out, const void *in, size_t n); */
/* #define memcpy(dest, src, count) w_memcpy(dest, src, count) */
#define memcpy(dest, src, count) do { \
if(count == 2) { \
*((uint8_t *)dest) = *((uint8_t *)src); \
@ -85,6 +88,9 @@ spl_t splhigh_(void);
} \
} while(0)
/* void *w_memset(void *out, int value, size_t n); */
/* #define memset(dest, value, count) w_memset(dest, value, count) */
#define memset(dest, value, count) do { \
if(count == 2) { \
*((uint8_t *)dest) = (uint8_t)value; \