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:
Jake Goodwin 2024-08-26 07:56:54 -07:00
parent dad3f8f82a
commit 0c083dede1
1 changed files with 6 additions and 33 deletions

View File

@ -80,6 +80,8 @@ int main(int argc, char **argv)
uint16_t break_time = 0;
uint8_t temp = 0;
LedByte led_byte = LedController_New(&PORTA.OUT);
while (true)
{
SW1_Wait();
@ -92,20 +94,8 @@ int main(int argc, char **argv)
make_time = Timer_GetOverflowCount();
// Output the Make time via LEDS
// temp = (uint8_t)(make_time & 0x0F);
temp = 0x01;
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();
temp = (uint8_t)(make_time & 0x0F);
LedController_ShowByte(&led_byte, temp);
SW2_Wait();
Deactivate_Relay();
@ -117,26 +107,9 @@ int main(int argc, char **argv)
break_time = Timer_GetOverflowCount();
// Output the Break time via LEDS
// temp = (uint8_t)(break_time & 0x0F);
temp = 0x04;
LedControler_ShowHalfByte(temp);
temp = (uint8_t)(break_time & 0x0F);
LedController_ShowByte(&led_byte, 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));
*/
}
}