Sensinode putdec() debugging
This commit is contained in:
parent
95b9d4ee29
commit
b292e02012
|
@ -44,3 +44,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