added byteorder utils

This commit is contained in:
schneider 2011-07-17 20:01:29 +02:00
parent 462d9f3a32
commit e2039ec2f4
3 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,7 @@ OBJS += crc.o
OBJS += menu.o
OBJS += xxtea.o
OBJS += ecc.o
OBJS += byteorder.o
LIBNAME=basic

View File

@ -0,0 +1,9 @@
#include <stdint.h>
void uint32touint8p(uint32_t v, uint8_t *p)
{
*p++ = (v>>24)&0xFF;
*p++ = (v>>16)&0xFF;
*p++ = (v>> 8)&0xFF;
*p++ = (v>> 0)&0xFF;
}

View File

@ -0,0 +1,5 @@
#ifndef _BYTEORDER_H_
#define _BYTEORDER_H_
void uint32touint8p(uint32_t v, uint8_t *p);
#endif