Removed the USART code from the main.c file.

This commit is contained in:
jakeg00dwin 2024-08-21 19:59:30 -07:00
parent a77e544358
commit 231e2516e3
1 changed files with 7 additions and 17 deletions

View File

@ -18,7 +18,6 @@
#include "RegEdit.h" #include "RegEdit.h"
#include "config.h" #include "config.h"
#include "timer.h" #include "timer.h"
#include "usart.h"
#include <avr/cpufunc.h> /* Required header file */ #include <avr/cpufunc.h> /* Required header file */
#include <avr/io.h> #include <avr/io.h>
#include <util/delay.h> #include <util/delay.h>
@ -29,10 +28,6 @@
#define RELAYREADINGPIN (1<<7) //It would be better to use PA7 so USART worked #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 //Set the function pointer for the delay func
void (*Delay_MicroSeconds)(double us) = _delay_us; void (*Delay_MicroSeconds)(double us) = _delay_us;
@ -73,26 +68,15 @@ void WaitForRelayDisconnect(void)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
USART0_Init();
PORTA.DIR |= RELAYPIN; PORTA.DIR |= RELAYPIN;
PORTA.DIR &= ~RELAYREADINGPIN; PORTA.DIR &= ~RELAYREADINGPIN;
PORTA.DIR &= ~SW1PIN; PORTA.DIR &= ~SW1PIN;
PORTA.DIR &= ~SW2PIN; PORTA.DIR &= ~SW2PIN;
//PORTA.OUT |= RELAYPIN;
//uint16_t cnt = 0;
//uint8_t hi, lo;
uint16_t make_time = 0; uint16_t make_time = 0;
uint16_t break_time = 0; uint16_t break_time = 0;
/*
WaitForRelayConnect();
Activate_Relay();
WaitForRelayDisconnect();
Deactivate_Relay();
*/
while(true) { while(true) {
SW1_Wait(); SW1_Wait();
@ -104,6 +88,9 @@ int main(int argc, char **argv)
make_time = Timer_GetOverflowCount(); make_time = Timer_GetOverflowCount();
//Output the Make time via LEDS
SW2_Wait(); SW2_Wait();
Deactivate_Relay(); Deactivate_Relay();
@ -113,10 +100,13 @@ int main(int argc, char **argv)
break_time = Timer_GetOverflowCount(); break_time = Timer_GetOverflowCount();
//Output the Break time via LEDS
/*
USART0_sendString(maketime_msg); USART0_sendString(maketime_msg);
USART0_sendChar((uint8_t)(0xFF & make_time)); USART0_sendChar((uint8_t)(0xFF & make_time));
USART0_sendString(breaktime_msg); USART0_sendString(breaktime_msg);
USART0_sendChar((uint8_t)(0xFF & break_time)); USART0_sendChar((uint8_t)(0xFF & break_time));
*/
} }
} }