/* Called on boot to increment a count stored in the EEPROM. This is used to ensure the CPU does not reset unexpectedly.  */
static void prvIncrementResetCount(void)
/* Called on boot to increment a count stored in the EEPROM. This is used to ensure the CPU does not reset unexpectedly.  */
static void prvIncrementResetCount(void)
{
unsigned char ucCount;
const unsigned char ucReadBit = ( unsigned char ) 0x01;
const unsigned char ucWrite1 = ( unsigned char ) 0x04;
const unsigned char ucWrite2 = ( unsigned char ) 0x02;
	EEARH = 0x00;
	EEARL = 0x00;
	EECR |= ucReadBit;
	while( EECR & ucReadBit );
	ucCount = EEDR;
	ucCount++;
	EEDR = ucCount;
	EECR = ucWrite1;
	EECR = ( ucWrite1 | ucWrite2 );
}