Digital Clock & Industrial Load Controller

TCCR1B|=(1<<WGM12)|(1<<CS12);       //MODE4 CTC with prescaler 256
TCNT1=0;							 //clear Timer
TIMSK|=(1<<OCIE1A);					 //Timer/Counter1 Output Compare Match Interrupt Enable
sei();								 //Globel Interrupt Enable
OCR1A=31249;						 //F_CPU=8MHz,P=256,Delay=1s
   digits [0]=second%10; 
   digits [1]=second/10;
   digits [2]=minute%10;
   digits [3]=minute/10;
   digits [4]=hour%10;
   digits [5]=hour%10;
uint8_t second,minute,hour;
ISR(TIMER1_COMPA_vect)
{
	second++;
	if(second==60){
		minute++;
		digits[2]=minute%10;
	    digits[3]=minute/10;
		second=0;
	}
	digits[0]=second%10;
	digits[1]=second/10;
		if(minute==60){
			hour++;
			digits[4]=hour%10;
	        digits[5]=hour/10;
			minute=0;
			if(hour==24) hour=0;
		}
}
void delay_ms_1(void)
{
	while(!(TIFR&(1<<OCF0)))
	{
	 //wait for 1ms until the flag is set
	}
	TIFR|=(1<<OCF0); //clear the flag
}
#include<avr/io.h>
#include<stdio.h>
#include<util/delay.h>
#include<avr/interrupt.h>
#include"count.h"
int main(void)
{
DDRB=0xff;							//7 segment port
PORTB=0b11111100;					//default value 0 to all the 7 segment;
DDRC=0x3f;							//7 segment control port
/*********************************************************************************************
***********  Timer1 for 1s delay  F_CPU=8MHz, Prescaler 256 Top value OCR    ****************/
/********************************************************************************************/                         
TCCR1B|=(1<<WGM12)|(1<<CS12);       //MODE4 CTC with prescaler 256
TCNT1=0;							 //clear Timer
TIMSK|=(1<<OCIE1A);					 //Timer/Counter1 Output Compare Match Interrupt Enable
sei();								 //Globel Interrupt Enable
OCR1A=31249;						 //F_CPU=8MHz,P=256,Delay=1s
/********************************************************************************************/

/*********************************************************************************************
********           Timer0 for 1ms, F_CPU=8MHz, Prescaler 64, Top value=124         ***********/
/*********************************************************************************************/
TCCR0|=(1<<WGM01)|(1<<CS01)|(1<<CS00); //CTC mode2, prescaler 64
TCNT0=0;                                //Clear Timer
OCR0=124;                               //delay 1ms       
/*********************************************************************************************/
while(1)
{
  for(int i=0;i<6;i++)
	{	
		PORTC=0x3f;
		delay_ms_1();
		PORTB=seven_segment(digits[i]);
		PORTC&=~(1<<i);
		delay_ms_1();
		PORTC=0x3f;
		delay_ms_1();
		
	}
}
return 0;
}