src/avr/avr_gdb.c
/*
 * Convert a hex digit string to a register value.
 * The supplied 8 digit hex string is converted to a 32-bit value according
 * the target endianness.
 *
 * buf		The buffer with the hex string
 * dign		Number of digits in buffer to convert
 * return	The value to convert
 */
Convert a hex digit string to a register value.
The supplied 8 digit hex string is converted to a 32-bit value according
the target endianness.

buf          The buffer with the hex string
dign         Number of digits in buffer to convert
return       The value to convert
Convert a hex digit string to a register value . The supplied 8 digit hex string is converted to a 32 - bit value according the target endianness . buf The buffer with the hex string dign Number of digits in buffer to convert return The value to convert
static unsigned long hex2reg(char *buf, const unsigned long dign)
{
	unsigned int n;			
	unsigned long val;		
	int nyb_shift;
	val = 0;
	for (n = 0; n < dign; n++) {
		nyb_shift = (int)(((dign-1)*4)-(n*4));
		val |= (unsigned long)(hex(buf[n]) << nyb_shift);
	}
	return val;
}
static unsigned long hex2reg ( char * buf , const unsigned long dign ) { unsigned int n ; unsigned long val ; int nyb_shift ; val = 0 ; for ( n = 0 ; n < dign ; n ++ ) { nyb_shift = ( int ) ( ( ( dign - 1 ) * 4 ) - ( n * 4 ) ) ; val |= ( unsigned long ) ( hex ( buf [ n ] ) << nyb_shift ) ; } return val ; }
Convert a hex digit string to a register value.
Convert a hex digit string to a register value .
/* Counter for digits */ /* The result */