/******************************************************************************/
/* Copyright 1995 MBARI                                                       */
/******************************************************************************/
/* Summary  : Spawns the Power Management Module for Tiburon                  */
/* Filename : startPower.c                                                    */
/* Author   : Janice Tarrant                                                  */
/* Project  : Tiburon                                                         */
/* Version  : Version 2.0                                                     */
/* Created  : 10/17/95                                                        */
/* Modified :                                                                 */
/* Archived :                                                                 */
/******************************************************************************/
/* Modification History :                                                     */
/* $Header$
 * $Log$
 *
 */
/******************************************************************************/

#include <vxWorks.h>		/* VxWorks system declarations                */
#include <stdioLib.h>           /* VxWorks standard I/O library               */
#include <ioLib.h>              /* VxWorks I/O interface library              */
#include <semLib.h>             /* VxWorks semaphore library                  */
#include <systime.h>            /* VxWorks system time declarations           */
#include <strLib.h>             /* VxWorks string library                     */
#include <taskLib.h>            /* VxWorks task library                       */
#include <mbariTypes.h>         /* MBARI style guide type declarations        */
#include <datamgr.h>            /* data manager declarations                  */
#include <dm_errno.h>           /* data manager error number declarations     */

#include <powerMgr.h>		/* Power Manager Task definitions             */
#include <rovPriority.h>	/* Task priority list                         */
#include "power.h"		/* Power Manager Application definitions      */

/******************************************************************************/
/* Function : startPower                                                      */
/* Purpose  : Manages power allocation requests from the various vehicle      */
/*            subsystems and devices, and the thruster control system.        */
/* Inputs   : None.                                                           */
/* Outputs  : Returns ERROR on fatal error.                                   */
/******************************************************************************/
    STATUS
startPower(void)
{
    Int32 powerManagerId;		/* power manager task id              */

    if ((powerManagerId = taskSpawn("tpowerManager", POWER_PRIORITY,
                                    VX_DEALLOC_STACK | VX_FP_TASK,
				    POWER_STACKSIZE, (FUNCPTR) powerTask,
	                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) == ERROR)
        logMsg("PowerManager FAILURE :\ncould not spawn power manager task\n");

} /* startPower */
