#include <stdio.h>
#include <string.h>
idata int hours_selected = 8;
idata int minutes_selected = 0;
idata int temp_hours_selected = 8;
idata int temp_minutes_selected = 0;
idata unsigned char idata therapy_is_over;
unsigned int timer1_overflow_count = 0;
unsigned int timer0_overflow_count = 0;
idata unsigned char spill_over_count_loaded;
idata unsigned char spill_over_count1_loaded;
void timer1_ISR(void) interrupt 3
{
if(therapy_is_over == 0)
{
if(spill_over_count1_loaded == 1)
{
spill_over_count1_loaded = 0;
timer1_overflow_count = 0;
// minutes_remaining--;
if((minutes_remaining == 0) && (hours_remaining == 0))
{
// hours_remaining = hours_selected;
// minutes_remaining = minutes_selected;
hours_remaining = 0;
minutes_remaining = 0;
}
else
{
minutes_remaining--;
if(minutes_remaining == -1)
{
minutes_remaining = 59;
--hours_remaining;
}
}
show_time_flag = 1;
}
else
{
if((timer1_overflow_count % 10) == 0)
show_seconds_flag = 1;
timer1_overflow_count++;
if(timer1_overflow_count == 1220)
{
spill_over_count1_loaded = 1;
TL1 = 0;
TH1 = 0x4c;
}
}
}
}