From 00c6f5ea40f97385dce7ab7b9d20bc0cb909ad23 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 6 Oct 2007 09:53:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@40 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chinit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/chinit.c') diff --git a/src/chinit.c b/src/chinit.c index b86626fa6..55a69b1fc 100644 --- a/src/chinit.c +++ b/src/chinit.c @@ -37,8 +37,12 @@ static Thread idlethread; * chThdCreate(...); // Starts one or more user threads. * chSysPause(); * @endcode - * @note Interrupts should be still disabled when \p chSysInit() is invoked and - * are internally enabled. + * @note Interrupts should be still disabled when \p chSysInit() is invoked + * and are internally enabled. + * @note The idle thread has absolute priority when exiting from the + * \p chSysInit(), this is done to make sure that all the initializations + * performed in the \p main() procedure are completed before any thread + * starts. The priority is set to \p IDLEPRIO into the \p chSysPause(). */ void chSysInit(void) { @@ -49,7 +53,7 @@ void chSysInit(void) { /* * Now this instructions flow becomes the idle thread. */ - _InitThread(IDLEPRIO, 0, &idlethread); + _InitThread(ABSPRIO, 0, &idlethread); idlethread.p_state = PRCURR; currp = &idlethread; -- cgit v1.2.3