problem with wdStart func. - VxWorks

This is a discussion on problem with wdStart func. - VxWorks ; Hi I'm having problem with the following code WDOG_ID myWatchDogId; int task (void) { /* Create watchdog */ if ((myWatchDogId = wdCreate( )) == NULL) return (ERROR); /* Set timer to go off in SECONDS - printing a message to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: problem with wdStart func.

  1. problem with wdStart func.

    Hi
    I'm having problem with the following code
    WDOG_ID myWatchDogId;

    int task (void)
    {
    /* Create watchdog */
    if ((myWatchDogId = wdCreate( )) == NULL)
    return (ERROR);



    /* Set timer to go off in SECONDS - printing a message to stdout */
    if (wdStart (myWatchDogId,sysClkRateGet()*SECONDS, foo,0) == ERROR)
    return (ERROR);
    /* ... */
    }

    foo(int p)
    {
    puts("timer.\n");
    }

    It compiles with
    dld.EXE: warning: Redeclaration of foo
    Defined in SIMNTdiab_DEBUG/utils.o
    and SIMNTdiab_DEBUG/main.o
    make: built targets of G:/Synergy/embed_ayac/proc/sdlc/SDLC
    Build Finished in Project 'SDLC': 2007-09-26 16:53:43 (Elapsed
    Time: 00:02)

    when i run the task simulator crashes.anyone know why?


  2. Re: problem with wdStart func.

    On Sep 26, 2:55 pm, tguclu wrote:
    > Hi
    > I'm having problem with the following code
    > WDOG_ID myWatchDogId;
    >
    > int task (void)
    > {
    > /* Create watchdog */
    > if ((myWatchDogId = wdCreate( )) == NULL)
    > return (ERROR);
    >
    > /* Set timer to go off in SECONDS - printing a message to stdout */
    > if (wdStart (myWatchDogId,sysClkRateGet()*SECONDS, foo,0) == ERROR)
    > return (ERROR);
    > /* ... */
    > }
    >
    > foo(int p)
    > {
    > puts("timer.\n");
    >
    > }
    >
    > It compiles with
    > dld.EXE: warning: Redeclaration of foo
    > Defined in SIMNTdiab_DEBUG/utils.o
    > and SIMNTdiab_DEBUG/main.o
    > make: built targets of G:/Synergy/embed_ayac/proc/sdlc/SDLC
    > Build Finished in Project 'SDLC': 2007-09-26 16:53:43 (Elapsed
    > Time: 00:02)
    >
    > when i run the task simulator crashes.anyone know why?


    Hi,

    Watchdog routine works as ISR, and you can not use printf/puts in ISR
    so the same limitation is applied to watchdog routine. Use logMsg
    instead of printf/puts.
    foo(int p)
    {
    logMsg("timer.\n");
    }
    Check for Programmer guide and watchdog API references for more
    details.

    VKG | Ritsoft Technologies


+ Reply to Thread