/* Write an integer as hex digits (ASCII) into string. 
Note that this function does not add the '0x'-prefix, which. */
void dbg_sprint_hexint(char *out_str, uint32_t out_int)
/* Write an integer as hex digits (ASCII) into string. 
Note that this function does not add the '0x'-prefix, which. */
void dbg_sprint_hexint(char *out_str, uint32_t out_int)
{
	uint8_t bytes_left = sizeof(out_int);
	do {
		char hi_nibble, lo_nibble;
		lo_nibble = out_int >> 24;
		hi_nibble = lo_nibble >> 4;
		lo_nibble &= 0x0f;
		TRANSLATE_NIBBLE_TO_ASCII(hi_nibble);
		TRANSLATE_NIBBLE_TO_ASCII(lo_nibble);
		*(out_str++) = hi_nibble;
		*(out_str++) = lo_nibble;
		out_int <<= 8;
	} while (--bytes_left);
}