EmbeddedSystems/EmbeddedSystemsTHM/main.c

69 lines
1.1 KiB
C
Raw Normal View History

/*
* EmbeddedSystemProject.c
*
* Created: 21/10/2021 16:55:21
* Author : n0x
*/
#include "Led.h"
#include "Taster.h"
#include "Timer.h"
#include "Tasks.h"
2021-11-11 18:28:42 +01:00
#include "StopLight.h"
2021-12-17 22:26:41 +01:00
#include "uart.h"
#include "cli.h"
#include "adc.h"
#include "rotaryEncoder.h"
#include <avr/interrupt.h>
#define F_CPU 1000000
#include <util/delay.h>
2021-12-17 22:26:41 +01:00
#include <stdio.h>
/* function declarations */
void buttonTest (void);
uint16_t g_startMS;
2021-11-11 18:28:42 +01:00
int
main (void)
{
sei();
/* Initialize the LEDs, Buttons, etc. */
Timer_init();
Taster_init();
Led_init();
initTasks();
uart_init();
2021-12-17 22:26:41 +01:00
adc_init();
2021-12-17 22:26:41 +01:00
drehgeber_init();
2021-11-05 09:00:41 +01:00
2021-12-17 22:26:41 +01:00
line_interpreter_init(uart_send_byte);
uart_send_string("Welcome to the ATmega1284P CLI. Type HELP to display all options.\r\n");
while (1)
{
//blinkLedWithTimer();
if(uart_data_available()){
line_interpreter_get_data(uart_get_data());
}
}
}
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();
}