#include <vxWorks.h>                /* vxWorks system declarations          */
#include <string.h>                 /* vxWorks string library functions     */
#include <taskLib.h>                /* vxWorks task management functions    */
#include <rebootLib.h>              /* vxWorks system reboot library funcs  */
#include <stdioLib.h>               /* vxWorks standard I/O functions       */
#include <msgQLib.h>                /* vxWorks Message Queue Library        */
#include <logLib.h>                 /* vxWorks log message library funcs    */

#include "mbariTypes.h"             /* MBARI style guide type declarations  */
#include "mbariConst.h"             /* Miscellaneous constants              */

#include "usrTime.h"                /* MBARI usrTime Declarations           */

#include "datamgr.h"                /* Data Manager declarations            */
#include "dm_errno.h"               /* Data Manager error declarations      */

#include "sio32Drv.h"               /* Sio32 hardware and driver information*/
#include "sio32Server.h"            /* Sio32 server communication services  */
#include "sio32Client.h"            /* Sio32 client communication services  */

extern void sysVmeBusReset(void);   /* Sends Reset to VME Bus               */

#include "rovPriority.h"            /* MBARI Rov Application Priorities     */
#include "thrusterIF.h"


/****************************************************************************/
/* Function    : spawnTask                                                  */
/* Purpose     : Executes a vxWorks task. Convenience function for taskSpawn*/
/* Inputs      : name, priority, stack size, task options, messages for     */
/*               successful and unsuccessful task creation. func ptr & args */
/* Outputs     : Returns OK or ERROR                                        */
/****************************************************************************/
    LOCAL STATUS
spawnTask( char *name, int priority, int stacksize, int options,
    char *okMsg, char *errorMsg, FUNCPTR entryPoint,
    int arg1, int arg2, int arg3)
{
                                    /* Initialize Task                      */
    if ( taskSpawn( name, priority, options, stacksize,
       entryPoint, arg1, arg2, arg3, 0, 0, 0, 0, 0, 0, 0 ) != ERROR)
       logMsg(okMsg);
    else
    {
        logMsg(errorMsg);
        return(ERROR);
    } /* else */
} /* spawnTask() */


   Void
semiPowerStart( Void )
{
    rebootHookAdd ( (FUNCPTR) sysVmeBusReset);

    usrTimeInit();                   /* Initialize MBARI time library        */

    dm_init(NULL, 0);

    spawnTask("sio32Deamon", SIO32_DEAMON_PRIORITY, SIO32_DEAMON_STACK,
         VX_FP_TASK,
        "Console Init: Telem board SIO32 Deamon Task Initialized\n",
        "Console Init: Telem board SIO32 Deamon Task Initialization Failed\n",
        (FUNCPTR) sio32DeamonTask, (int) TELEM_BOARD_NAME, NULL, NULL);

    thrusterTask(MOTOR_TEST, TELEM_BOARD | 0);
} /* startup */



