From adb9868498b93f89ae875df764d475c9f5c16049 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 4 Sep 2011 02:13:08 +0200 Subject: Added Thread::start(). --- main.cpp | 2 ++ thread.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 040610c..d9faac1 100644 --- a/main.cpp +++ b/main.cpp @@ -108,6 +108,8 @@ int main() { usart_enable(); + thread.start(); + while(1) { // Wait for a new update. while(!(TIM2.SR & 0x01)) { diff --git a/thread.h b/thread.h index 1349ff6..2213d6f 100644 --- a/thread.h +++ b/thread.h @@ -48,7 +48,9 @@ class Thread { // frame->lr = thread exit handler sp->pc = (uint32_t)func; sp->psr = 0x01000000; - + } + + void start() { next = active_thread->next; active_thread->next = this; } -- cgit v1.2.3