Removed the USART code from the main.c file.
This commit is contained in:
parent
a77e544358
commit
231e2516e3
24
src/main.c
24
src/main.c
|
@ -18,7 +18,6 @@
|
|||
#include "RegEdit.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
#include "usart.h"
|
||||
#include <avr/cpufunc.h> /* Required header file */
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
@ -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));
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue