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.
Utils.h
00001 00002 typedef unsigned char u8; 00003 typedef unsigned short u16; 00004 typedef unsigned long u32; 00005 00006 void DelayMS(int ms); 00007 00008 void printfBytes(const char* label,const u8* data, int len); 00009 void printHex(const u8* d, int len); 00010 00011 #ifndef min 00012 #define min(_a,_b) ((_a) < (_b) ? (_a) : (_b)) 00013 #endif 00014 00015 inline int LE16(const u8* d) 00016 { 00017 return d[0] | (d[1] << 8); 00018 } 00019 00020 inline u32 BE32(const u8* d) 00021 { 00022 return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3]; 00023 } 00024 00025 inline void BE32(u32 n, u8* d) 00026 { 00027 d[0] = (u8)(n >> 24); 00028 d[1] = (u8)(n >> 16); 00029 d[2] = (u8)(n >> 8); 00030 d[3] = (u8)n; 00031 } 00032 00033 inline void BE16(u32 n, u8* d) 00034 { 00035 d[0] = (u8)(n >> 8); 00036 d[1] = (u8)n; 00037 }
Generated on Thu Jul 14 2022 02:50:59 by
1.7.2