aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-09-24 12:28:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-09-24 12:28:07 +0000
commitc9205e2fd961c60cffd1000936340806a8e45558 (patch)
tree17a2d7da8aa845a1db466985ec5cf53f8bfff389
parentb72177007695129c089c58f65d05ae6178f604a3 (diff)
downloadChibiOS-c9205e2fd961c60cffd1000936340806a8e45558.tar.gz
ChibiOS-c9205e2fd961c60cffd1000936340806a8e45558.tar.bz2
ChibiOS-c9205e2fd961c60cffd1000936340806a8e45558.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@442 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/ARM7-AT91SAM7X-GCC/main.c2
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/main.c4
-rw-r--r--demos/ARM7-LPC214x-GCC-minimal/main.c4
-rw-r--r--demos/ARM7-LPC214x-GCC/main.c4
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c4
-rw-r--r--demos/AVR-AT90CANx-GCC/main.c2
-rw-r--r--demos/AVR-ATmega128-GCC/main.c2
-rw-r--r--demos/MSP430-MSP430x1611-GCC/main.c4
-rw-r--r--src/include/threads.h5
-rw-r--r--src/lib/ch.cpp4
-rw-r--r--src/lib/ch.hpp8
11 files changed, 23 insertions, 20 deletions
diff --git a/demos/ARM7-AT91SAM7X-GCC/main.c b/demos/ARM7-AT91SAM7X-GCC/main.c
index db1959c0c..abd84bd87 100644
--- a/demos/ARM7-AT91SAM7X-GCC/main.c
+++ b/demos/ARM7-AT91SAM7X-GCC/main.c
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
*/
chSysInit();
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
while (TRUE) {
chThdSleep(500);
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
index 7861a0408..5887beedf 100644
--- a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
@@ -51,8 +51,8 @@ int main(int argc, char **argv) {
*/
chSysInit();
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
- chThdCreateFast(NORMALPRIO - 1, waWebThread, sizeof(waWebThread), WebThread);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ chThdCreateStatic(waWebThread, sizeof(waWebThread), NORMALPRIO - 1, WebThread, NULL);
while (TRUE) {
chThdSleep(500);
diff --git a/demos/ARM7-LPC214x-GCC-minimal/main.c b/demos/ARM7-LPC214x-GCC-minimal/main.c
index bbbc3ce6c..a7c896222 100644
--- a/demos/ARM7-LPC214x-GCC-minimal/main.c
+++ b/demos/ARM7-LPC214x-GCC-minimal/main.c
@@ -69,8 +69,8 @@ int main(int argc, char **argv) {
/*
* Creates the blinker threads.
*/
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
- chThdCreateFast(NORMALPRIO, waThread2, sizeof(waThread2), Thread2);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
/*
* Normal main() thread activity, in this demo it does nothing except
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c
index d83a386d5..588bd21af 100644
--- a/demos/ARM7-LPC214x-GCC/main.c
+++ b/demos/ARM7-LPC214x-GCC/main.c
@@ -131,8 +131,8 @@ int main(int argc, char **argv) {
* are not started in order to make accurate benchmarks.
*/
if ((IO0PIN & 0x00018000) == 0x00018000) {
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
- chThdCreateFast(NORMALPRIO, waThread2, sizeof(waThread2), Thread2);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
}
/*
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index c8d35815c..59e7b792a 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -50,9 +50,9 @@ int main(int argc, char **argv) {
chSysInit();
/*
- * Creates the blinker threads.
+ * Creates the blinker thread.
*/
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
* Normal main() thread activity, in this demo it does nothing except
diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c
index 9dde101ef..987deb072 100644
--- a/demos/AVR-AT90CANx-GCC/main.c
+++ b/demos/AVR-AT90CANx-GCC/main.c
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
/*
* Starts the LED blinker thread.
*/
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
while(TRUE)
chEvtWait(ALL_EVENTS, handlers);
diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c
index f238642ef..873a28a79 100644
--- a/demos/AVR-ATmega128-GCC/main.c
+++ b/demos/AVR-ATmega128-GCC/main.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv) {
/*
* Starts the LED blinker thread.
*/
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
while(TRUE)
chEvtWait(ALL_EVENTS, handlers);
diff --git a/demos/MSP430-MSP430x1611-GCC/main.c b/demos/MSP430-MSP430x1611-GCC/main.c
index 07b420b55..72736fc54 100644
--- a/demos/MSP430-MSP430x1611-GCC/main.c
+++ b/demos/MSP430-MSP430x1611-GCC/main.c
@@ -54,9 +54,9 @@ int main(int argc, char **argv) {
chSysInit();
/*
- * Creates the blinker threads.
+ * Creates the blinker thread.
*/
- chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
* Normal main() thread activity, in this demo it does nothing except
diff --git a/src/include/threads.h b/src/include/threads.h
index 822a9ab69..b2c7bfb1b 100644
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -177,10 +177,14 @@ extern "C" {
tprio_t prio, tfunc_t pf, void *arg);
Thread *chThdCreateStatic(void *workspace, size_t wsize,
tprio_t prio, tfunc_t pf, void *arg);
+#if defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_HEAP)
Thread *chThdCreateFromHeap(size_t wsize, tprio_t prio,
tfunc_t pf, void *arg);
+#endif
+#if defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_MEMPOOLS)
Thread *chThdCreateFromMemoryPool(MemoryPool *mp, tprio_t prio,
tfunc_t pf, void *arg);
+#endif
Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace,
size_t wsize, tfunc_t pf, void *arg);
Thread *chThdCreateFast(tprio_t prio, void *workspace,
@@ -218,7 +222,6 @@ extern "C" {
* Returns the exit event source for the specified thread. The source is
* signaled when the thread terminates.
* @param tp the pointer to the thread
- * @deprecated
* @note When registering on a thread termination make sure the thread
* is still alive, if you do that after the thread termination
* then you would miss the event. There are two ways to ensure
diff --git a/src/lib/ch.cpp b/src/lib/ch.cpp
index 170a143a7..1d63cefd5 100644
--- a/src/lib/ch.cpp
+++ b/src/lib/ch.cpp
@@ -74,9 +74,9 @@ namespace chibios_rt {
return ((BaseThread *)arg)->Main();
}
- BaseThread::BaseThread(tprio_t prio, tmode_t mode, void *workspace, size_t wsize) {
+ BaseThread::BaseThread(void *workspace, size_t wsize, tprio_t prio) {
- thread_ref = chThdCreate(prio, mode, workspace, wsize, thdstart, this);
+ thread_ref = chThdCreateStatic(workspace, wsize, prio, thdstart, this);
}
void BaseThread::Exit(msg_t msg) {
diff --git a/src/lib/ch.hpp b/src/lib/ch.hpp
index f041365d7..79e40e32b 100644
--- a/src/lib/ch.hpp
+++ b/src/lib/ch.hpp
@@ -101,7 +101,7 @@ namespace chibios_rt {
/**
* Thread constructor.
*/
- BaseThread(tprio_t prio, tmode_t mode, void *workspace, size_t wsize);
+ BaseThread(void *workspace, size_t wsize, tprio_t prio);
/**
* Thread exit.
@@ -196,8 +196,8 @@ namespace chibios_rt {
* Full constructor. It allows to set a priority level for the new thread
* and specify the special option flags.
*/
- EnhancedThread(const char *tname, tprio_t prio, tmode_t mode) :
- BaseThread(prio, mode, wa, sizeof wa) {
+ EnhancedThread(const char *tname, tprio_t prio) :
+ BaseThread(wa, sizeof wa, prio) {
name = tname;
}
@@ -208,7 +208,7 @@ namespace chibios_rt {
* and no special option flags.
*/
EnhancedThread(const char *tname) :
- BaseThread(NORMALPRIO, 0, wa, sizeof wa) {
+ BaseThread(wa, sizeof wa, NORMALPRIO) {
name = tname;
}