cc253x: add putdec debug function
This commit is contained in:
parent
48d99f15c8
commit
780e62d7e8
|
@ -40,3 +40,18 @@ putbin(uint8_t c)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
putdec(uint8_t c)
|
||||
{
|
||||
uint8_t div;
|
||||
uint8_t hassent = 0;
|
||||
for(div = 100; div > 0; div /= 10) {
|
||||
uint8_t disp = c / div;
|
||||
c %= div;
|
||||
if((disp != 0) || (hassent) || (div == 1)) {
|
||||
hassent = 1;
|
||||
putchar('0'+disp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,5 +50,6 @@ void putchar(char c);
|
|||
void putstring(char *s);
|
||||
void puthex(uint8_t c);
|
||||
void putbin(uint8_t c);
|
||||
void putdec(uint8_t c);
|
||||
|
||||
#endif /* __DEBUG_H__ */
|
||||
|
|
Loading…
Reference in a new issue