From b8335062ae7d19bd27e6131fadcd7d3a116c4992 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 11 Mar 2011 01:28:00 +0000 Subject: DimOS RT --- kernel/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 kernel/main.c (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c new file mode 100644 index 0000000..3a1921c --- /dev/null +++ b/kernel/main.c @@ -0,0 +1,52 @@ +/* $Id$ */ +/* + * Copyright (c) 2011 Dimitri Sokolyuk + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include "kernel.h" +#include "tasks.h" + +uint8_t red, green, blue; + +struct rgbarg rgbargs[] = { + { &red, &green, &blue } +}; + +struct pwmarg pwmargs[] = { + { &red, PB2, 0, 0 }, + { &green, PB3, 0, 0 }, + { &blue, PB4, 0, 0 }, +}; + +int +main() +{ + init(STACK); + + init_uart(); + + task(heartbeat, STACK, SEC(0), MSEC(10), 0); + task(rgb, STACK, SEC(0), MSEC(10), &rgbargs[0]); + task(pwm, STACK, SEC(0), MSEC(10), &pwmargs[0]); + task(pwm, STACK, SEC(0), MSEC(10), &pwmargs[1]); + task(pwm, STACK, SEC(0), MSEC(10), &pwmargs[2]); + task(lcd, STACK, MSEC(40), SEC(1), 0); + + for (;;); + + return 0; +} -- cgit v1.2.3