From 231e2516e3a6d10895fe2c236b7c758108e1c4c2 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Wed, 21 Aug 2024 19:59:30 -0700 Subject: [PATCH] Removed the USART code from the main.c file. --- src/main.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/main.c b/src/main.c index 7a3d111..fd2d083 100644 --- a/src/main.c +++ b/src/main.c @@ -18,7 +18,6 @@ #include "RegEdit.h" #include "config.h" #include "timer.h" -#include "usart.h" #include /* Required header file */ #include #include @@ -29,10 +28,6 @@ #define RELAYREADINGPIN (1<<7) //It would be better to use PA7 so USART worked -//char msg[] = "Attiny404:\n\r"; -char maketime_msg[] = "\r\nMake Time(10Khz):"; -char breaktime_msg[] = "\r\nBreak Time(10Khz):"; - //Set the function pointer for the delay func void (*Delay_MicroSeconds)(double us) = _delay_us; @@ -73,26 +68,15 @@ void WaitForRelayDisconnect(void) int main(int argc, char **argv) { - USART0_Init(); - PORTA.DIR |= RELAYPIN; PORTA.DIR &= ~RELAYREADINGPIN; PORTA.DIR &= ~SW1PIN; PORTA.DIR &= ~SW2PIN; - //PORTA.OUT |= RELAYPIN; - //uint16_t cnt = 0; - //uint8_t hi, lo; uint16_t make_time = 0; uint16_t break_time = 0; - /* - WaitForRelayConnect(); - Activate_Relay(); - WaitForRelayDisconnect(); - Deactivate_Relay(); - */ while(true) { SW1_Wait(); @@ -104,6 +88,9 @@ int main(int argc, char **argv) make_time = Timer_GetOverflowCount(); + + //Output the Make time via LEDS + SW2_Wait(); Deactivate_Relay(); @@ -113,10 +100,13 @@ int main(int argc, char **argv) break_time = Timer_GetOverflowCount(); + //Output the Break time via LEDS + + /* USART0_sendString(maketime_msg); USART0_sendChar((uint8_t)(0xFF & make_time)); USART0_sendString(breaktime_msg); USART0_sendChar((uint8_t)(0xFF & break_time)); - + */ } }