- Debugged UART - Firmware support for SPI, UART - Work on SD/MMC support in firmware - Debugged mblite core/WB interface
18 lines
339 B
C
18 lines
339 B
C
// Copyright (c) 2013 Matthias Blankertz <matthias@blankertz.org>
|
|
|
|
static char _str_buf[9];
|
|
|
|
const char *utox(unsigned int num) {
|
|
int i = 7;
|
|
_str_buf[8] = '\0';
|
|
|
|
while(num || (i == 7)) {
|
|
_str_buf[i] = (num&0xf)+'0';
|
|
if(_str_buf[i] > '9')
|
|
_str_buf[i] += 'A'-'9'-1;
|
|
--i;
|
|
num>>=4;
|
|
}
|
|
return _str_buf+(i+1);
|
|
}
|