Пример #1
0
void interrupt 2 _watchdogISR( void ) {

    //ourtosShutdown();

    SET_LEDS_OUTPUT();
    SET_LEDS(LED_WATCHDOG);

    for(;;) {
        /* Hang in error state */
    }
}
Пример #2
0
//=========================================================================
// blinkLED: routine that will blink an led when vxWorks is running
//=========================================================================
//  from winSH:  -> show_active starts the thread
//               -> td "show_active" kills the thread
//=========================================================================
static void blinkLED()
{ 
    static int count=0;
    int leds=GET_LEDS;
  
    while (1)
    {
        if(count)
            BIT_ON(leds,HOST_ACTIVE_LED);
        else
            BIT_OFF(leds,HOST_ACTIVE_LED);
        SET_LEDS(leds);
        count=count?0:1;
        taskDelay(calcSysClkTicks(83));  /* taskDelay(5); */
    }
}
Пример #3
0
void shortBlockingTask(void) {

    SET_LEDS(LED_SHORT_BLK);

    DisableInterrupts;
    ourtosAcquireMutex(&blockingMutex);
    EnableInterrupts;

    timerBlockingDelayMsec(SHORT_BLOCK_TIME);

    DisableInterrupts;
    ourtosReleaseMutex(&blockingMutex);
    EnableInterrupts;

    SET_WATCHDOG_FLGS(ID_SHORT_BLK);
}
Пример #4
0
void pollBtnsTask(void) {
    int i;
    bool_t taskEnabled[N_TASKS];

    SET_LEDS(LED_POLL_BTN);

    if ( 1 == GET_MUTEX_DISABLE_BTN() ) {
        DisableInterrupts;
        ourtosEnableMutexes(true);
        EnableInterrupts;
    } else {
        DisableInterrupts;
        ourtosEnableMutexes(false);
        EnableInterrupts;
    }

    /* poll all task enable btns */
    for( i = 0; i < N_TASKS; i++) {
        if ( 0 == GET_TASK_ENABLE_BTN(i) ) {
            taskEnabled[i] = true;
        } else {
            taskEnabled[i] = false;
        }
    }

#ifndef SIMULATION /* disable btns in simulation */
    /* Disable or enable tasks based upon btn.
     * Note that we cannot disable task 1 (i.e. pollButtonTask),
     * because this would prevent us from enabling/disabling any tasks in the
     * future.
     */
    DisableInterrupts;
    ourtosEnableTask(PRIORITY_WATCHDOG, taskEnabled[0]);
    // ourtosEnableTask(PRIORITY_POLL_BTN, taskEnabled[1]);
    ourtosEnableTask(PRIORITY_SHORT, taskEnabled[2]);
    ourtosEnableTask(PRIORITY_LONG, taskEnabled[3]);
    EnableInterrupts;
#endif

    SET_WATCHDOG_FLGS(ID_POLL_BTN);

}
Пример #5
0
void watchdogKickTask(void) {

    SET_LEDS(LED_WATCHDOG_KICK);

    if ( WATCHDOG_FLG_ALL_SET == _watchdogFlags ) {
        _FEED_COP();

        /* watchdog clear must be atomic so that tasks setting flags
         * are not intermingled with clearing the flags.
         */
        DisableInterrupts;
        CLEAR_WATCHDOG_FLGS();
        EnableInterrupts;

    } else {
        /* not all of the watchdog flags are set
         * so watchdog cannot be kicked yet
         */
    }
}
Пример #6
0
void _initLEDs(void) {

    SET_LEDS_OUTPUT();
    SET_LEDS(LED_OFF);

}