summaryrefslogtreecommitdiff
path: root/src/main.c
blob: fb2dfa04a297f9706da753fd162164cd4dc1cfd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * src/main.c
 * (c) 2021 Jonas Gunz <himself@jonasgunz.de>
 * License: MIT
 */

#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>

#include "uart.h"
#include "cmd.h"
#include "pwm.h"

int main(void) {
	cli();

	uart_init();
	cmd_init();
	pwm_init();
	
	/* Go! */
	sei();

	uart_putstring("START\r\n");

	while(1){
		char c;
		if( uart_getchar(&c) )
			continue;

		uart_putchar(c);
		cmd_tick(c);
	}

	return 0;
}