refactored the led code
I changed it to use the new updated interface that I wrote for the LedController module.
This commit is contained in:
parent
dad3f8f82a
commit
0c083dede1
39
src/main.c
39
src/main.c
|
@ -80,6 +80,8 @@ int main(int argc, char **argv)
|
||||||
uint16_t break_time = 0;
|
uint16_t break_time = 0;
|
||||||
uint8_t temp = 0;
|
uint8_t temp = 0;
|
||||||
|
|
||||||
|
LedByte led_byte = LedController_New(&PORTA.OUT);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
SW1_Wait();
|
SW1_Wait();
|
||||||
|
@ -92,20 +94,8 @@ int main(int argc, char **argv)
|
||||||
make_time = Timer_GetOverflowCount();
|
make_time = Timer_GetOverflowCount();
|
||||||
|
|
||||||
// Output the Make time via LEDS
|
// Output the Make time via LEDS
|
||||||
// temp = (uint8_t)(make_time & 0x0F);
|
temp = (uint8_t)(make_time & 0x0F);
|
||||||
temp = 0x01;
|
LedController_ShowByte(&led_byte, temp);
|
||||||
LedControler_ShowHalfByte(temp);
|
|
||||||
|
|
||||||
_delay_ms(1000);
|
|
||||||
LedControler_ClearHalfByte();
|
|
||||||
|
|
||||||
// temp = (uint8_t)((make_time & 0xF0)>>4);
|
|
||||||
temp = 0x02;
|
|
||||||
LedControler_ShowHalfByte(temp);
|
|
||||||
|
|
||||||
_delay_ms(1000);
|
|
||||||
|
|
||||||
LedControler_ClearHalfByte();
|
|
||||||
|
|
||||||
SW2_Wait();
|
SW2_Wait();
|
||||||
Deactivate_Relay();
|
Deactivate_Relay();
|
||||||
|
@ -117,26 +107,9 @@ int main(int argc, char **argv)
|
||||||
break_time = Timer_GetOverflowCount();
|
break_time = Timer_GetOverflowCount();
|
||||||
|
|
||||||
// Output the Break time via LEDS
|
// Output the Break time via LEDS
|
||||||
// temp = (uint8_t)(break_time & 0x0F);
|
temp = (uint8_t)(break_time & 0x0F);
|
||||||
temp = 0x04;
|
LedController_ShowByte(&led_byte, temp);
|
||||||
LedControler_ShowHalfByte(temp);
|
|
||||||
|
|
||||||
_delay_ms(1000);
|
|
||||||
LedControler_ClearHalfByte();
|
|
||||||
|
|
||||||
// temp = (uint8_t)((break_time & 0xF0)>>4);
|
|
||||||
temp = 0x08;
|
|
||||||
LedControler_ShowHalfByte(temp);
|
|
||||||
|
|
||||||
_delay_ms(1000);
|
|
||||||
|
|
||||||
LedControler_ClearHalfByte();
|
|
||||||
|
|
||||||
/*
|
|
||||||
USART0_sendString(maketime_msg);
|
|
||||||
USART0_sendChar((uint8_t)(0xFF & make_time));
|
|
||||||
USART0_sendString(breaktime_msg);
|
|
||||||
USART0_sendChar((uint8_t)(0xFF & break_time));
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue