added boostc files
This commit is contained in:
parent
19025584c9
commit
42b5801a03
11 changed files with 647 additions and 14 deletions
39
boostc/util.c
Normal file
39
boostc/util.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include <system.h>
|
||||
#include "util.h"
|
||||
/*******************************************************************/
|
||||
|
||||
//Returns ASCII Decimal and Hex values
|
||||
unsigned char bin2Hex(unsigned char x){
|
||||
//skip(x);
|
||||
//#pragma return[16] = "0123456789ABCDEF"
|
||||
|
||||
switch(x){
|
||||
case 0: return '0';
|
||||
case 1: return '1';
|
||||
case 2: return '2';
|
||||
case 3: return '3';
|
||||
case 4: return '4';
|
||||
case 5: return '5';
|
||||
case 6: return '6';
|
||||
case 7: return '7';
|
||||
case 8: return '8';
|
||||
case 9: return '9';
|
||||
case 10: return 'A';
|
||||
case 11: return 'B';
|
||||
case 12: return 'C';
|
||||
case 13: return 'D';
|
||||
case 14: return 'E';
|
||||
case 15: return 'F';
|
||||
}
|
||||
|
||||
return '?';
|
||||
}
|
||||
/*******************************************************************/
|
||||
|
||||
unsigned char swap ( unsigned char cX ){
|
||||
unsigned char tmp = (cX >> 4) & 0x0f;
|
||||
cX = (cX << 4) & 0xf0;
|
||||
cX = cX | tmp;
|
||||
return cX;
|
||||
}
|
||||
/*******************************************************************/
|
||||
Loading…
Add table
Add a link
Reference in a new issue