moved contiki-specific initialization to separate function
This commit is contained in:
parent
83adbeee55
commit
93b953f815
1 changed files with 126 additions and 121 deletions
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: contiki-cooja-main.c,v 1.8 2010/05/02 09:42:15 fros4943 Exp $
|
||||
* $Id: contiki-cooja-main.c,v 1.9 2010/09/24 12:59:06 fros4943 Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -177,13 +177,9 @@ rtimer_thread_loop(void *data)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
process_run_thread_loop(void *data)
|
||||
void
|
||||
contiki_init()
|
||||
{
|
||||
/* Yield once during bootup */
|
||||
simProcessRunValue = 1;
|
||||
cooja_mt_yield();
|
||||
|
||||
/* Initialize random generator (moved to moteid.c) */
|
||||
|
||||
/* Start process handler */
|
||||
|
@ -221,7 +217,7 @@ process_run_thread_loop(void *data)
|
|||
|
||||
/* Initialize communication stack */
|
||||
netstack_init();
|
||||
printf("MAC %s RDC %s\n", NETSTACK_MAC.name, NETSTACK_RDC.name);
|
||||
printf("MAC %s RDC %s NETWORK %s\n", NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
||||
|
||||
#if WITH_UIP
|
||||
/* IPv4 CONFIGURATION */
|
||||
|
@ -303,6 +299,16 @@ process_run_thread_loop(void *data)
|
|||
/* Start autostart processes (defined in Contiki application) */
|
||||
print_processes(autostart_processes);
|
||||
autostart_start(autostart_processes);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
process_run_thread_loop(void *data)
|
||||
{
|
||||
/* Yield once during bootup */
|
||||
simProcessRunValue = 1;
|
||||
cooja_mt_yield();
|
||||
|
||||
contiki_init();
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
@ -322,7 +328,6 @@ process_run_thread_loop(void *data)
|
|||
cooja_mt_yield();
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \brief Initialize a mote by starting processes etc.
|
||||
|
|
Loading…
Reference in a new issue