#define	BLANK	10


const char disp[14]={0x11,0x7b,0x25,0x29,0x4b,0x89,0xc1,0x3b,0x01,0x0b,0xff,0xBF,0xEF,0xFD};
//                   0    1    2    3    4    5    6    7    8    9    blak top  mid  bot   

void print_ee_string(byte address, bit crlf ) {
	byte c;
#if 0
	do {
		c = read_int_eeprom(address);
		putchar(c);
		address++;
	} while ( c != '\0' );
	if ( crlf )
		puts("");
#else 
/* we don't want to print the '\0' characters */

	
	while ( 1 ) {
		c = read_int_eeprom(address);
		if ( ! c ) 
			break;
		putchar(c);
		address++;
	}
	if ( crlf ) 
		puts("");
	
}

#inline
void displayDigit(byte num) {
	port_b = disp[num];
}


void update_digits(byte val) {
	tensdigit=0;
	
	while ( val >= 10 ) {
		val -= 10;
		tensdigit++;
	}
	
	onesdigit=val;
}


void printCal(void) {
	//printf("cal=0x%02X\r\n",cal); 
	printf("cal = ");
	print_hex(cal);
	puts("");
	write_int_eeprom(E_CAL,cal);
}

#include <CTYPE.H>

byte gethex1() {
   char digit;

   digit = getch();

   putchar(digit);

   if(digit<='9')
     return(digit-'0');
   else
     return((toupper(digit)-'A')+10);
}

byte gethex() {
   int lo;
   int high;

   high = gethex1();
   lo = gethex1();
   if(lo==0xdd)
     return(high);
   else
     return( high*16+lo );
}
