aboutsummaryrefslogtreecommitdiff
path: root/main.c
blob: f8dde1e2bc2bcda272e72ad15efaefd714e83bc2 (plain) (blame)
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
38
39
#include <stddef.h>
#include <stdio.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "bug/panic.h"
#include "bug/debug.h"
#include "task/task.h"
#include "task/sched.h"
#include "task/lock.h"
#include "task/idle.h"
#include "time/clock.h"
#include "io/usart.h"
#include "tshield/tshield.h"
#include "mcu/task/context.h"
#include "shell.h"

#define IN_LENGTH 64

#define WAIT_CYCLES(cycles) for (volatile unsigned long i = 0; i < cycles; ++i) {}


DECLARE_TASK(task_idle, IDLE_STACK_SIZE, idle_entry, 0);
DECLARE_TASK(task1, DEFAULT_STACK_SIZE, shell, 1);

int main(int argc, char *argv[]) {
  cli();
  tshield_init();
  usart_init(115200);

  spawn_idle(&task_idle);
  spawn(&task1);

  sei();
  clock_init(10, schedule);
  clock_start();
  sched_init();
  panic(); //should never reach here
  while(1){}
}