char *i16toa(int16_t n, char *s, u8 b, u8 ra) {

	if(n<0){
		s[0]='-';
		u16toa((u16)(-n),&s[1],b,ra);
	}
	else{
		s[0]=' ';
		u16toa((u16)(n),&s[1],b,ra);
	}
	return s;
}
Example #2
0
File: util.c Project: ericzhc/pdale
////////////////////////////////////////////////////////////////////////////////
// print_words
// PURPOSE: Prints the values of size words.
// PARAMS:  (IN) u8 *start - starting address.
//          (IN) int size  - number of words to print.
// RETURNS: Nothing.
////////////////////////////////////////////////////////////////////////////////
void
print_words(u16 const *start,
            int size)
{
   int x = 1;

   while(size > 0)
   {
      char buf[5];

      u16toa(*start++, buf);
      itc_printf(buf);
      size--;
      if(!(x++ % 16))
      {
         if(size > 0)
         {
            itc_printf("\r\n");
            x = 1;
         }
      }
      else
      {
         itc_printf(" ");
      }
   }
   itc_printf("\r\n");
}