void interface_init(void)
{
+ DDRB |= 0x01;
DDRD = (DDRD&0xFC)|0x02;
serial_init(9600);
count = serial_read_available();
if(count>0)
{
+ PORTB |= 0x01;
if(cmd_length==0)
{
uint8_t l = ~serial_read();
cmd_length = 0;
}
}
+ PORTB &= ~0x01;
}
}
void monitor_init(void)
{
+ DDRB |= 0x02;
adc_init();
}
if(track_current_sum>overcurrent_limit)
{
output_set_power(0);
+ PORTB |= 0x02;
if(!overcurrent_sent)
{
overcurrent_sent = 1;
interface_send1(OVERCURRENT);
}
}
- else
+ else if(overcurrent_sent && output_is_power_on())
+ {
+ PORTB &= ~0x02;
overcurrent_sent = 0;
+ }
}
else if(adc_state==4)
{