Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed myUSBHost AvailableMemory
Dependents: mbed_TANK_Kinect myBlueUSB_ros ftusbClass
Utils.h
- Committer:
- networker
- Date:
- 2011-06-19
- Revision:
- 7:99068afea04d
- Parent:
- 2:0118da9e5169
File content as of revision 7:99068afea04d:
#ifndef UTILS_H
#define UTILS_H
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
void DelayMS(int ms);
void printfBytes(const char* label,const u8* data, int len);
void printHex(const u8* d, int len);
//void printf(const BD_ADDR* addr);
#ifndef min
#define min(_a,_b) ((_a) < (_b) ? (_a) : (_b))
#endif
inline int LE16(const u8* d)
{
return d[0] | (d[1] << 8);
}
inline u32 BE32(const u8* d)
{
return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
}
inline void BE32(u32 n, u8* d)
{
d[0] = (u8)(n >> 24);
d[1] = (u8)(n >> 16);
d[2] = (u8)(n >> 8);
d[3] = (u8)n;
}
inline void BE16(u32 n, u8* d)
{
d[0] = (u8)(n >> 8);
d[1] = (u8)n;
}
#endif