Pumpkin, Inc.

Pumpkin User Forums

where should i stick my init routine at?

If you have a general question or comment regarding Salvo, post it here.

where should i stick my init routine at?

Postby aek » Wed Apr 05, 2006 5:45 am

I'd recommend putting them before the OS calls -- that way, you know that interrupts have not yet been enabled.

In general it won't make much difference, simply because the tasks don't run until the scheduler is called via OSSched().

The main thing is to ensure that anything that vectors from an ISR is already properly initialized. By doing the I/O init prior to the call to OSEnable(), you're avoiding any potential pitfalls in that area ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: where should i stick my init routine at?

Postby seulater » Wed Apr 05, 2006 5:46 am

thank you.
seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: where should i stick my init routine at?

Postby seulater » Wed Apr 05, 2006 11:13 am

Below is my startup code in Main, i would like to know where the proper & safe place for me to call my I/O initalize routines at "io_init()".


void Main()
{
OSCreateTask(Task_One, TASK_1, OSDONT_START_TASK |2);
OSCreateTask(Task_Two, TASK_2, OSDONT_START_TASK |12);
OSCreateTask(Task_Three,TASK_3, OSDONT_START_TASK |14);
OSCreateTask(Task_Four, TASK_4, OSDONT_START_TASK |16);


OSEnable();


OSStartTask(TASK_1);
OSStartTask(TASK_2);
OSStartTask(TASK_3);
OSStartTask(TASK_4);


}

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron