aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/Makefile.inc2
-rw-r--r--kernel/dmx.c50
-rw-r--r--kernel/dmx/Makefile16
-rw-r--r--kernel/remix16/Makefile4
5 files changed, 71 insertions, 3 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
index 8f6b505..fac49e2 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,5 +1,5 @@
# $Id$
-SUBDIR= remix16
+SUBDIR= remix16 dmx
.include <bsd.subdir.mk>
diff --git a/kernel/Makefile.inc b/kernel/Makefile.inc
index 9417686..df574d0 100644
--- a/kernel/Makefile.inc
+++ b/kernel/Makefile.inc
@@ -2,6 +2,8 @@
.PATH: ${.CURDIR}/..
+SRCS+= kernel.c
+
CC= avr-gcc
OBJCOPY= avr-objcopy
OBJDUMP= avr-objdump
diff --git a/kernel/dmx.c b/kernel/dmx.c
new file mode 100644
index 0000000..7a0d43b
--- /dev/null
+++ b/kernel/dmx.c
@@ -0,0 +1,50 @@
+/* $Id$ */
+/*
+ * Copyright (c) 2011 Dimitri Sokolyuk <demon@dim13.org>
+ *
+ * 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 <inttypes.h>
+#include <avr/io.h>
+#include "kernel.h"
+#include "tasks.h"
+
+uint8_t red, green, blue;
+
+struct rgbarg rgbargs = { &red, &green, &blue };
+struct pwmarg pwmargs[] = {
+ { &red, PB2 },
+ { &green, PB3 },
+ { &blue, PB4 }
+};
+
+int
+main()
+{
+ init(STACK);
+
+ init_uart();
+
+ semaphore(0, 1);
+
+ task(heartbeat, STACK, MSEC(0), MSEC(750), 0);
+ task(rgb, STACK, MSEC(1), MSEC(10), &rgbargs);
+ task(pwm, STACK, MSEC(3), MSEC(10), &pwmargs[0]);
+ task(pwm, STACK, MSEC(7), MSEC(10), &pwmargs[1]);
+ task(pwm, STACK, MSEC(11), MSEC(10), &pwmargs[2]);
+
+ for (;;);
+
+ return 0;
+}
diff --git a/kernel/dmx/Makefile b/kernel/dmx/Makefile
new file mode 100644
index 0000000..4268072
--- /dev/null
+++ b/kernel/dmx/Makefile
@@ -0,0 +1,16 @@
+# $Id$
+
+MCU= atmega8
+F_CPU= 16000000
+PRESCALE= 8
+STACK= 64
+TASKS= 8
+SEMAPHORES= 8
+BAUD= 9600
+
+PROG= dmx
+SRCS= dmx.c uart.c heartbeat.c rgb.c hsv.c lcd3.c \
+ adc.c ppm.c
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/kernel/remix16/Makefile b/kernel/remix16/Makefile
index e4e6dfe..fc8355f 100644
--- a/kernel/remix16/Makefile
+++ b/kernel/remix16/Makefile
@@ -8,8 +8,8 @@ TASKS= 8
SEMAPHORES= 8
BAUD= 9600
-PROG= kernel
-SRCS= kernel.c main.c uart.c heartbeat.c rgb.c hsv.c lcd3.c \
+PROG= remix16
+SRCS= remix16.c uart.c heartbeat.c rgb.c hsv.c lcd3.c \
adc.c ppm.c
NOMAN=