2021-10-21 19:55:33 +02:00
|
|
|
/*
|
|
|
|
* EmbeddedSystemProject.c
|
|
|
|
*
|
|
|
|
* Created: 21/10/2021 16:55:21
|
|
|
|
* Author : n0x
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Led.h"
|
|
|
|
#include "Taster.h"
|
2021-10-28 19:24:52 +02:00
|
|
|
#include "Timer.h"
|
2021-11-18 19:34:41 +01:00
|
|
|
#include "Tasks.h"
|
2021-11-11 18:28:42 +01:00
|
|
|
#include "StopLight.h"
|
2021-11-18 19:34:41 +01:00
|
|
|
#include "UART.h"
|
2021-10-28 19:24:52 +02:00
|
|
|
#include <avr/interrupt.h>
|
2021-10-21 19:55:33 +02:00
|
|
|
#define F_CPU 1000000
|
2021-11-11 01:33:55 +01:00
|
|
|
#include <util/delay.h>
|
2021-10-21 19:55:33 +02:00
|
|
|
|
2021-10-28 16:36:38 +02:00
|
|
|
/* function declarations */
|
2021-11-11 01:33:55 +01:00
|
|
|
void buttonTest (void);
|
2021-10-28 16:36:38 +02:00
|
|
|
|
2021-11-11 18:28:42 +01:00
|
|
|
|
2021-10-28 16:36:38 +02:00
|
|
|
/* functions */
|
|
|
|
int
|
|
|
|
main (void)
|
2021-10-21 19:55:33 +02:00
|
|
|
{
|
2021-10-28 19:24:52 +02:00
|
|
|
sei();
|
|
|
|
|
2021-11-18 19:34:41 +01:00
|
|
|
/* Initialize the LEDs, Buttons, etc. */
|
|
|
|
//Led_init();
|
|
|
|
//Taster_init();
|
|
|
|
//Timer_init();
|
|
|
|
//initTasks();
|
|
|
|
|
|
|
|
//uart_init();
|
|
|
|
uart_init_isr();
|
|
|
|
|
2021-10-21 19:55:33 +02:00
|
|
|
|
2021-11-05 09:00:41 +01:00
|
|
|
|
2021-11-11 01:33:55 +01:00
|
|
|
while (1)
|
2021-11-05 09:00:41 +01:00
|
|
|
{
|
2021-11-11 01:36:35 +01:00
|
|
|
//buttonTest();
|
2021-11-18 19:34:41 +01:00
|
|
|
//runningLight();
|
|
|
|
//blinkLedWithTimer();
|
2021-11-11 18:28:42 +01:00
|
|
|
//runStopLightTask1();
|
2021-11-18 19:34:41 +01:00
|
|
|
//runStopLightTask2();
|
|
|
|
|
|
|
|
//uart_send ("Hello World\n");
|
|
|
|
uart_send_isr ("Hello World\n");
|
|
|
|
|
2021-11-11 01:33:55 +01:00
|
|
|
}
|
2021-10-28 16:36:38 +02:00
|
|
|
}
|
|
|
|
|
2021-11-11 01:33:55 +01:00
|
|
|
void
|
|
|
|
buttonTest (void)
|
|
|
|
{
|
|
|
|
Taster1_get() ? Led1_On() : Led1_Off();
|
|
|
|
Taster2_get() ? Led2_On() : Led2_Off();
|
|
|
|
Taster3_get() ? Led3_On() : Led3_Off();
|
|
|
|
Taster4_get() ? Led4_On() : Led4_Off();
|
2021-10-28 19:24:52 +02:00
|
|
|
}
|
|
|
|
|
2021-11-11 01:33:55 +01:00
|
|
|
|
|
|
|
|