64 lines
1.0 KiB
C
64 lines
1.0 KiB
C
/*
|
|
* EmbeddedSystemProject.c
|
|
*
|
|
* Created: 21/10/2021 16:55:21
|
|
* Author : n0x
|
|
*/
|
|
|
|
#include "Led.h"
|
|
#include "Taster.h"
|
|
#include "Timer.h"
|
|
#include "Tasks.h"
|
|
#include "StopLight.h"
|
|
#include "uart.h"
|
|
#include "cli.h"
|
|
#include "adc.h"
|
|
#include "rotaryEncoder.h"
|
|
#include <avr/interrupt.h>
|
|
#define F_CPU 1000000
|
|
#include <util/delay.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
/* function declarations */
|
|
void buttonTest (void);
|
|
|
|
uint16_t g_startMS;
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
sei();
|
|
|
|
/* Initialize the LEDs, Buttons, etc. */
|
|
Timer_init();
|
|
Taster_init();
|
|
Led_init();
|
|
uart_init();
|
|
adc_init();
|
|
|
|
drehgeber_init();
|
|
|
|
line_interpreter_init(uart_send_byte);
|
|
uart_send_string("Welcome to the ATmega1284P CLI. Type HELP to display all options.\r\n");
|
|
|
|
while (1)
|
|
{
|
|
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();
|
|
}
|
|
|
|
|
|
|