aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2014-04-08 13:18:27 +0200
committerJakob Odersky <jodersky@gmail.com>2014-04-08 14:57:10 +0200
commit350437ef4b8ba0811d285f7454d2b54ffce6b029 (patch)
tree5084c73adbb4cc3aee9d000b3816d98a57203f36
parentc4ebb91caf33ecf5a47785584a4231eb1e4dfa2a (diff)
downloadmux-350437ef4b8ba0811d285f7454d2b54ffce6b029.tar.gz
mux-350437ef4b8ba0811d285f7454d2b54ffce6b029.tar.bz2
mux-350437ef4b8ba0811d285f7454d2b54ffce6b029.zip
change build structure
-rw-r--r--Makefile61
-rw-r--r--apps/shell/app.c15
-rw-r--r--apps/shell/app.mk1
-rw-r--r--kernel/bug/include/bug/debug.h6
-rw-r--r--kernel/bug/include/bug/panic.h6
-rw-r--r--kernel/include/init.h10
-rw-r--r--kernel/include/mux/clock.h (renamed from kernel/time/include/time/clock.h)4
-rw-r--r--kernel/include/mux/debug.h7
-rw-r--r--kernel/include/mux/idle.h6
-rw-r--r--kernel/include/mux/io.h (renamed from kernel/io/include/io/io.h)4
-rw-r--r--kernel/include/mux/list.h (renamed from kernel/collection/include/collection/list.h)4
-rw-r--r--kernel/include/mux/lock.h (renamed from kernel/task/include/task/lock.h)6
-rw-r--r--kernel/include/mux/rbuffer.h (renamed from kernel/collection/include/collection/rbuffer.h)0
-rw-r--r--kernel/include/mux/sched.h (renamed from kernel/task/include/task/sched.h)55
-rw-r--r--kernel/init.c29
-rw-r--r--kernel/io/io.c12
-rw-r--r--kernel/mcu/atmega2560/clock.c (renamed from kernel/time/mcu/atmega2560/clock.c)6
-rw-r--r--kernel/mcu/atmega2560/context.c (renamed from kernel/task/mcu/atmega2560/context.c)2
-rw-r--r--kernel/mcu/atmega2560/include/mcu/context.h (renamed from kernel/task/mcu/atmega2560/include/mcu/task/context.h)6
-rw-r--r--kernel/mcu/atmega2560/include/mcu/usart.h (renamed from kernel/io/mcu/atmega2560/include/mcu/io/usart.h)2
-rw-r--r--kernel/mcu/atmega2560/usart.c (renamed from kernel/io/mcu/atmega2560/usart.c)12
-rw-r--r--kernel/sched/idle.c (renamed from kernel/task/idle.c)4
-rw-r--r--kernel/sched/sched.c (renamed from kernel/task/sched.c)18
-rw-r--r--kernel/task/include/task/idle.h6
-rw-r--r--kernel/task/include/task/task.h46
-rw-r--r--kernel/task/mcu/atmega2560/include/mcu/task/task.h11
-rw-r--r--main.c58
-rw-r--r--modules/tshield/include/tshield/tshield.h (renamed from kernel/tshield/include/tshield/tshield.h)0
-rw-r--r--modules/tshield/mcu/atmega2560/tshield.c (renamed from kernel/tshield/mcu/atmega2560/tshield.c)2
29 files changed, 202 insertions, 197 deletions
diff --git a/Makefile b/Makefile
index 17cb279..49c728e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,36 @@
# CPU model
+#
MCU=atmega2560
+
# CPU Frequency
+#
F_CPU=16000000L
-# Name of image to produce (can be arbitrary)
-TARGET=firmware
+# App
+#
+APP?=shell
+include apps/$(APP)/app.mk
+
+
+# Hardware modules
+#
+MODULES?=
+
# Serial port used for uploading
+#
SERIAL=/dev/ttyACM0
BAUD=115200
-# Modules to include in kernel
-MODULES=bug collection task tshield time io
+
+# Name of image to produce (can be arbitrary)
+#
+TARGET=firmware
+
# Toolchain flags
+#
CC=avr-gcc
CFLAGS= -std=gnu99 -O2 -Wall -finline-functions -ffunction-sections -fdata-sections -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -mmcu=$(MCU) -DF_CPU=$(F_CPU)
LD=avr-gcc
@@ -32,23 +48,28 @@ CPPFLAGS= -O2 -Wall -fno-exceptions -ffunction-sections -fdata-sections -funsign
GDBINITFILE=gdb.conf
# Derived variables
+SOURCEDIRS=\
+ kernel \
+ kernel/io \
+ kernel/sched \
+ kernel/mcu/$(MCU) \
+ $(foreach module,$(MODULES),modules/$(module)) \
+ $(foreach module,$(MODULES),modules/$(module)/mcu/$(MCU)) \
+ apps/$(APP)
+
+INCLUDES=\
+ kernel/include \
+ kernel/mcu/$(MCU)/include \
+ $(foreach module,$(MODULES),modules/$(module)/include)
+
SOURCES=\
- $(foreach module,$(MODULES),$(wildcard kernel/$(module)/*.c)) \
- $(foreach module,$(MODULES),$(wildcard kernel/$(module)/mcu/$(MCU)/*.S)) \
- $(foreach module,$(MODULES),$(wildcard kernel/$(module)/mcu/$(MCU)/*.c)) \
- $(wildcard arduino/*.s) $(wildcard arduino/*.c) $(wildcard arduino/*.cpp) \
- $(wildcard *.s) $(wildcard *.c) $(wildcard *.cpp)
+ $(foreach dir,$(SOURCEDIRS),$(wildcard $(dir)/*.c)) \
+ $(foreach dir,$(SOURCEDIRS),$(wildcard $(dir)/*.S))
OBJECTS=$(addsuffix .o, $(basename $(SOURCES)))
-INCLUDES=\
- $(foreach module, $(MODULES), kernel/$(module)/include) \
- $(foreach module, $(MODULES), kernel/$(module)/mcu/$(MCU)/include)
-
# Rules
-all: target
-
-target: $(TARGET).hex
+all: $(TARGET).hex
$(TARGET).hex: $(TARGET).elf
$(OC) $(OCFLAGS) $< $@
@@ -92,11 +113,9 @@ cycle:
clean:
@rm -f *.o
- @for module in $(MODULES); do \
- rm -f kernel/$$module/*.o; \
- rm -f kernel/$$module/mcu/$(MCU)/*.o; \
+ @for dir in $(SOURCEDIRS); do \
+ rm -f $$dir/*.o; \
done
- @rm -f arduino/*.o
@rm -f $(TARGET).hex
@rm -f $(TARGET).elf
@rm -f $(GDBINITFILE)
@@ -120,4 +139,4 @@ $(GDBINITFILE): $(TARGET).elf
@echo "Use 'avr-gdb -x $(GDBINITFILE)'"
-.PHONY: clean cycle
+.PHONY: clean cycle target
diff --git a/apps/shell/app.c b/apps/shell/app.c
new file mode 100644
index 0000000..eb85e4e
--- /dev/null
+++ b/apps/shell/app.c
@@ -0,0 +1,15 @@
+#include "init.h"
+#include "mux/sched.h"
+#include "mcu/context.h"
+
+void setup() {
+
+}
+
+void task1(char args) {
+
+}
+
+void task2(char args) {
+
+} \ No newline at end of file
diff --git a/apps/shell/app.mk b/apps/shell/app.mk
new file mode 100644
index 0000000..b1bfae3
--- /dev/null
+++ b/apps/shell/app.mk
@@ -0,0 +1 @@
+MODULES=tshield \ No newline at end of file
diff --git a/kernel/bug/include/bug/debug.h b/kernel/bug/include/bug/debug.h
deleted file mode 100644
index 854f4c6..0000000
--- a/kernel/bug/include/bug/debug.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef DEBUG_H
-#define DEBUG_H
-
-void debug_led(int led, int value);
-
-#endif \ No newline at end of file
diff --git a/kernel/bug/include/bug/panic.h b/kernel/bug/include/bug/panic.h
deleted file mode 100644
index 2a39076..0000000
--- a/kernel/bug/include/bug/panic.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef PANIC_H
-#define PANIC_H
-
-void panic();
-
-#endif \ No newline at end of file
diff --git a/kernel/include/init.h b/kernel/include/init.h
new file mode 100644
index 0000000..8df22f5
--- /dev/null
+++ b/kernel/include/init.h
@@ -0,0 +1,10 @@
+#ifndef MUX_INIT_H
+#define MUX_INIT_H
+
+#include <stddef.h>
+
+void setup();
+void task1(char args);
+void task2(char args);
+
+#endif \ No newline at end of file
diff --git a/kernel/time/include/time/clock.h b/kernel/include/mux/clock.h
index 0a247a8..429a00d 100644
--- a/kernel/time/include/time/clock.h
+++ b/kernel/include/mux/clock.h
@@ -1,5 +1,5 @@
-#ifndef CLOCK_H
-#define CLOCK_H
+#ifndef MUX_CLOCK_H
+#define MUX_CLOCK_H
/**
* Initializes main system clock.
diff --git a/kernel/include/mux/debug.h b/kernel/include/mux/debug.h
new file mode 100644
index 0000000..7119c35
--- /dev/null
+++ b/kernel/include/mux/debug.h
@@ -0,0 +1,7 @@
+#ifndef MUX_DEBUG_H
+#define MUX_DEBUG_H
+
+void panic();
+void debug_led(int led, int value);
+
+#endif \ No newline at end of file
diff --git a/kernel/include/mux/idle.h b/kernel/include/mux/idle.h
new file mode 100644
index 0000000..0d94a9a
--- /dev/null
+++ b/kernel/include/mux/idle.h
@@ -0,0 +1,6 @@
+#ifndef MUX_IDLE_H
+#define MUX_IDLE_H
+
+void idle_entry(char args);
+
+#endif \ No newline at end of file
diff --git a/kernel/io/include/io/io.h b/kernel/include/mux/io.h
index 3c83cdc..4ec45f5 100644
--- a/kernel/io/include/io/io.h
+++ b/kernel/include/mux/io.h
@@ -1,5 +1,5 @@
-#ifndef IO_H
-#define IO_H
+#ifndef MUX_IO_H
+#define MUX_IO_H
#include <stddef.h>
diff --git a/kernel/collection/include/collection/list.h b/kernel/include/mux/list.h
index 3a76885..98ea766 100644
--- a/kernel/collection/include/collection/list.h
+++ b/kernel/include/mux/list.h
@@ -1,5 +1,5 @@
-#ifndef __LIST_H
-#define __LIST_H
+#ifndef MUX_LIST_H
+#define MUX_LIST_H
/* This file is from Linux Kernel (include/linux/list.h)
* and modified by simply removing hardware prefetching of list items.
diff --git a/kernel/task/include/task/lock.h b/kernel/include/mux/lock.h
index 47246b2..b5ac4d9 100644
--- a/kernel/task/include/task/lock.h
+++ b/kernel/include/mux/lock.h
@@ -1,7 +1,7 @@
-#ifndef LOCK_H
-#define LOCK_H
+#ifndef MUX_LOCK_H
+#define MUX_LOCK_H
-#include "task/sched.h"
+#include "mux/sched.h"
typedef volatile char spin_lock_t;
diff --git a/kernel/collection/include/collection/rbuffer.h b/kernel/include/mux/rbuffer.h
index dceaeb0..dceaeb0 100644
--- a/kernel/collection/include/collection/rbuffer.h
+++ b/kernel/include/mux/rbuffer.h
diff --git a/kernel/task/include/task/sched.h b/kernel/include/mux/sched.h
index b8946db..de50f98 100644
--- a/kernel/task/include/task/sched.h
+++ b/kernel/include/mux/sched.h
@@ -1,9 +1,47 @@
-#ifndef SCHED_H
-#define SCHED_H
+#ifndef MUX_SCHED_H
+#define MUX_SCHED_H
+
+#include "mux/list.h"
+
+/**
+ * Task control block, contains runtime
+ * information about tasks.
+ */
+struct tcb_t {
+ /** Stack pointer of this task. (must be first in structure) */
+ char* volatile sp;
+
+ /** Lowest address of this task's memory (inclusive). */
+ char* mem_low;
+
+ /** Highest address of this task's memory (inclusive). */
+ char* mem_high;
+
+ /** Entry function of this task. */
+ void (*entry)(char);
+
+ /** Current wait queue that this task is in.*/
+ struct list_head queue;
+
+ /** ID of task. */
+ char id;
+
+};
+
+/**
+ * Utility for declaring a task with statically allocated memory.
+ * Note: for a task to be scheduled, it must first be spawned (see spawn()).
+*/
+#define DECLARE_TASK(name, stack_size, entry_function) \
+ static char _declared_stack_##name[stack_size]; \
+ static struct tcb_t name = { \
+ .sp = 0, \
+ .mem_low = _declared_stack_##name, \
+ .mem_high = _declared_stack_##name + stack_size - 1, \
+ .entry = entry_function, \
+ .queue = {} \
+ };
-#include "collection/list.h"
-#include "task/task.h"
-#include "mcu/task/task.h"
/**
* Points to currently executing task. If no scheduling has been enabled,
@@ -36,7 +74,12 @@ static inline void wake_all_queue(struct list_head* queue) {
/**
* Initializes a given task and adds it to the ready queue.
*/
-void spawn(struct tcb_t* const tcb);
+void spawn(struct tcb_t* const tcb, char id);
+
+/**
+ * Spawns the idle task
+ */
+void spawn_idle(struct tcb_t* const tcb, char id);
/**
* Voluntarily relinquishes control of the CPU from the current task to the scheduler.
diff --git a/kernel/init.c b/kernel/init.c
new file mode 100644
index 0000000..5a9a2e9
--- /dev/null
+++ b/kernel/init.c
@@ -0,0 +1,29 @@
+#include "init.h"
+#include "mux/debug.h"
+#include "mux/sched.h"
+#include "mux/idle.h"
+#include "mux/clock.h"
+#include "mcu/context.h"
+
+#define HZ 100
+
+DECLARE_TASK(task_idle, IDLE_STACK_SIZE, idle_entry);
+DECLARE_TASK(tcb1, DEFAULT_STACK_SIZE, task1);
+DECLARE_TASK(tcb2, DEFAULT_STACK_SIZE, task2);
+
+int main(int argc, char *argv[]) {
+ cli();
+
+ setup();
+
+ spawn_idle(&task_idle, 0);
+ spawn(&tcb1, 1);
+ spawn(&tcb2, 2);
+
+ sei();
+ clock_init(1000/HZ, schedule);
+ clock_start();
+ sched_init();
+ panic(); //should never reach here
+ while(1){}
+} \ No newline at end of file
diff --git a/kernel/io/io.c b/kernel/io/io.c
index f39168b..63e9669 100644
--- a/kernel/io/io.c
+++ b/kernel/io/io.c
@@ -1,25 +1,25 @@
-#include "io/io.h"
+#include "mux/io.h"
int open(struct file* file) {
- file->fops->open(file);
+ return file->fops->open(file);
}
int ioctl(struct file* file, int cmd, long args) {
- file->fops->ioctl(file, cmd, args);
+ return file->fops->ioctl(file, cmd, args);
}
ssize_t read(struct file* file, char* const buffer, size_t size) {
struct file_operations* fops = file->fops;
if (fops->read == NULL) return -1;
- else fops->read(file, buffer, size);
+ else return fops->read(file, buffer, size);
}
ssize_t write(struct file* file, const char* const buffer, size_t size) {
struct file_operations* fops = file->fops;
if (fops->write == NULL) return -1;
- else fops->write(file, buffer, size);
+ else return fops->write(file, buffer, size);
}
int close(struct file* file) {
- file->fops->close(file);
+ return file->fops->close(file);
} \ No newline at end of file
diff --git a/kernel/time/mcu/atmega2560/clock.c b/kernel/mcu/atmega2560/clock.c
index 95622dc..4f53372 100644
--- a/kernel/time/mcu/atmega2560/clock.c
+++ b/kernel/mcu/atmega2560/clock.c
@@ -1,7 +1,7 @@
#include <avr/interrupt.h>
-#include "time/clock.h"
-#include "task/sched.h"
-#include "mcu/task/context.h"
+#include "mux/clock.h"
+#include "mux/sched.h"
+#include "mcu/context.h"
static void (*on_tick)();
diff --git a/kernel/task/mcu/atmega2560/context.c b/kernel/mcu/atmega2560/context.c
index 9bb7036..137a985 100644
--- a/kernel/task/mcu/atmega2560/context.c
+++ b/kernel/mcu/atmega2560/context.c
@@ -1,4 +1,4 @@
-#include "mcu/task/context.h"
+#include "mcu/context.h"
char* stack_init(const char* const mem_low, const char* const mem_high, void (*entry)(char), char args) {
char* sp = (char*) mem_high;
diff --git a/kernel/task/mcu/atmega2560/include/mcu/task/context.h b/kernel/mcu/atmega2560/include/mcu/context.h
index 0de1fb4..5f6e947 100644
--- a/kernel/task/mcu/atmega2560/include/mcu/task/context.h
+++ b/kernel/mcu/atmega2560/include/mcu/context.h
@@ -4,6 +4,12 @@
#include <avr/interrupt.h>
#define ret() asm volatile ( "ret" )
+/** Default stack size, you may use this definition for declaring tasks. */
+#define DEFAULT_STACK_SIZE 256
+
+/** Stack size to be allocated for the idle task. */
+#define IDLE_STACK_SIZE 64
+
/*
* The macros save_context(), restore_context() as well as the code contained in
* init_stack is adapted from the FreeRTOS kernel (http://www.freertos.org/).
diff --git a/kernel/io/mcu/atmega2560/include/mcu/io/usart.h b/kernel/mcu/atmega2560/include/mcu/usart.h
index 6b210fe..e06f0cf 100644
--- a/kernel/io/mcu/atmega2560/include/mcu/io/usart.h
+++ b/kernel/mcu/atmega2560/include/mcu/usart.h
@@ -1,7 +1,7 @@
#ifndef MCU_USART
#define MCU_USART
-#include "io/io.h"
+#include "mux/io.h"
#define USART_BUFFER_SIZE 64
#define IOCTL_SET_BAUD 0
diff --git a/kernel/io/mcu/atmega2560/usart.c b/kernel/mcu/atmega2560/usart.c
index 6f59787..f07e137 100644
--- a/kernel/io/mcu/atmega2560/usart.c
+++ b/kernel/mcu/atmega2560/usart.c
@@ -1,9 +1,9 @@
-#include "io/io.h"
-#include "collection/list.h"
-#include "collection/rbuffer.h"
-#include "task/sched.h"
-#include "mcu/io/usart.h"
-#include "mcu/task/context.h"
+#include "mux/io.h"
+#include "mux/list.h"
+#include "mux/rbuffer.h"
+#include "mux/sched.h"
+#include "mcu/usart.h"
+#include "mcu/context.h"
#include <avr/interrupt.h>
#include <avr/io.h>
diff --git a/kernel/task/idle.c b/kernel/sched/idle.c
index 7d6576d..aaf4337 100644
--- a/kernel/task/idle.c
+++ b/kernel/sched/idle.c
@@ -2,8 +2,8 @@
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/power.h>
-#include "task/idle.h"
-#include "task/task.h"
+#include "mux/idle.h"
+#include "mux/sched.h"
void idle_entry(char args) {
diff --git a/kernel/task/sched.c b/kernel/sched/sched.c
index 5989136..4b36f03 100644
--- a/kernel/task/sched.c
+++ b/kernel/sched/sched.c
@@ -1,7 +1,5 @@
-#include "bug/panic.h"
-#include "task/task.h"
-#include "task/sched.h"
-#include "mcu/task/context.h"
+#include "mux/sched.h"
+#include "mcu/context.h"
struct tcb_t* volatile current = 0;
@@ -10,15 +8,19 @@ static struct tcb_t* volatile idle = 0;
struct list_head ready = LIST_HEAD_INIT(ready);
-void spawn(struct tcb_t* const tcb) {
+static void _spawn(struct tcb_t* const tcb, char id) {
+ tcb->id = id;
tcb->sp = stack_init(tcb->mem_low, tcb->mem_high, tcb->entry, tcb->id);
INIT_LIST_HEAD(&tcb->queue);
+}
+
+void spawn(struct tcb_t* const tcb, char id) {
+ _spawn(tcb, id);
list_add_tail(&tcb->queue, &ready);
}
-void spawn_idle(struct tcb_t* const tcb) {
- spawn(tcb);
- list_del(&tcb->queue);
+void spawn_idle(struct tcb_t* const tcb, char id) {
+ _spawn(tcb, id);
idle = tcb;
}
diff --git a/kernel/task/include/task/idle.h b/kernel/task/include/task/idle.h
deleted file mode 100644
index 3b6e40a..0000000
--- a/kernel/task/include/task/idle.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef IDLE_H
-#define IDLE_H
-
-void idle_entry(char args);
-
-#endif \ No newline at end of file
diff --git a/kernel/task/include/task/task.h b/kernel/task/include/task/task.h
deleted file mode 100644
index 120bda4..0000000
--- a/kernel/task/include/task/task.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef TASK_H
-#define TASK_H
-
-#include "collection/list.h"
-
-/**
- * Task control block, contains runtime
- * information about tasks.
- */
-struct tcb_t {
- /** Stack pointer of this task. (must be first in structure) */
- char* volatile sp;
-
- /** Lowest address of this task's memory (inclusive). */
- char* mem_low;
-
- /** Highest address of this task's memory (inclusive). */
- char* mem_high;
-
- /** Entry function of this task. */
- void (*entry)(char);
-
- /** Current wait queue that this task is in.*/
- struct list_head queue;
-
- /** ID of task. */
- char id;
-
-};
-
-/**
- * Utility for declaring a task with statically allocated memory.
- * Note: for a task to be scheduled, it must first be spawned (see spawn()).
-*/
-#define DECLARE_TASK(name, stack_size, entry_function, pid) \
- static char _declared_stack_##name[stack_size]; \
- static struct tcb_t name = { \
- .sp = 0, \
- .mem_low = _declared_stack_##name, \
- .mem_high = _declared_stack_##name + stack_size - 1, \
- .entry = entry_function, \
- .queue = {}, \
- .id = pid \
- };
-
-#endif \ No newline at end of file
diff --git a/kernel/task/mcu/atmega2560/include/mcu/task/task.h b/kernel/task/mcu/atmega2560/include/mcu/task/task.h
deleted file mode 100644
index d9823af..0000000
--- a/kernel/task/mcu/atmega2560/include/mcu/task/task.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef MCU_TASK_H
-#define MACU_TASK_H
-
-
-/** Default stack size, you may use this definition for declaring tasks. */
-#define DEFAULT_STACK_SIZE 256
-
-/** Stack size to be allocated for the idle task. */
-#define IDLE_STACK_SIZE 64
-
-#endif \ No newline at end of file
diff --git a/main.c b/main.c
deleted file mode 100644
index 703bbb5..0000000
--- a/main.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#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/idle.h"
-#include "task/lock.h"
-#include "task/idle.h"
-#include "time/clock.h"
-#include "io/io.h"
-#include "mcu/io/usart.h"
-#include "tshield/tshield.h"
-#define IN_LENGTH 64
-
-#define WAIT_CYCLES(cycles) for (volatile unsigned long i = 0; i < cycles; ++i) {}
-
-void worker() {
- char buffer[64];
-
- while(1) {
- int length = read(&usart0, buffer, 64);
-
- int led;
- int value;
- if (sscanf(buffer, "leds/%d:%d", &led, &value) == 2) {
- debug_led(led, value);
- } else {
- debug_led(0,1);
- WAIT_CYCLES(300000);
- debug_led(0,0);
- }
- }
-}
-
-
-DECLARE_TASK(task_idle, IDLE_STACK_SIZE, idle_entry, 0);
-DECLARE_TASK(task1, DEFAULT_STACK_SIZE, worker, 1);
-
-int main(int argc, char *argv[]) {
- cli();
- tshield_init();
-
- open(&usart0);
- ioctl(&usart0, IOCTL_SET_BAUD, 115200);
-
- spawn_idle(&task_idle);
- spawn(&task1);
-
- sei();
- clock_init(10, schedule);
- clock_start();
- sched_init();
- panic(); //should never reach here
- while(1){}
-}
diff --git a/kernel/tshield/include/tshield/tshield.h b/modules/tshield/include/tshield/tshield.h
index b485ad2..b485ad2 100644
--- a/kernel/tshield/include/tshield/tshield.h
+++ b/modules/tshield/include/tshield/tshield.h
diff --git a/kernel/tshield/mcu/atmega2560/tshield.c b/modules/tshield/mcu/atmega2560/tshield.c
index 7cc6e58..59877ec 100644
--- a/kernel/tshield/mcu/atmega2560/tshield.c
+++ b/modules/tshield/mcu/atmega2560/tshield.c
@@ -1,7 +1,7 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include "tshield/tshield.h"
-#include "bug/panic.h"
+#include "mux/debug.h"
static void tshield_init_servo();