Exemplo n.º 1
0
/*..........................................................................*/
void GPIOPortA_IRQHandler(void) {
    QK_ISR_ENTRY();                      /* infrom QK about entering an ISR */

    QActive_postFIFO(AO_Table, Q_NEW(QEvent, MAX_PUB_SIG));  /* for testing */

    QK_ISR_EXIT();                        /* infrom QK about exiting an ISR */
}
Exemplo n.º 2
0
/*..........................................................................*/
extern "C" void Ethernet_IRQHandler(void) {
#ifdef QK_ISR_ENTRY                           /* preemptive QK kernel used? */
    QK_ISR_ENTRY();                      /* inform QK about entering an ISR */
#endif

    uint32_t eth_stat = ETH->RIS;
    ETH->IACK = eth_stat;                    /* clear the interrupt sources */

    eth_stat &= ETH->IM;                   /* mask only the enabled sources */

    if ((eth_stat & ETH_INT_RX) != 0) {
        l_active->POST(&l_lwipEvt[LWIP_RX_READY_OFFSET],
                       &l_Ethernet_IRQHandler);
        ETH->IM &= ~ETH_INT_RX;                       /* disable further RX */
    }
    if ((eth_stat & ETH_INT_TX) != 0) {
        l_active->POST(&l_lwipEvt[LWIP_TX_READY_OFFSET],
                       &l_Ethernet_IRQHandler);
    }
#if LINK_STATS
    if ((eth_stat & ETH_INT_RXOF) != 0) {
        l_active->POST(&l_lwipEvt[LWIP_RX_OVERRUN_OFFSET],
                       &l_Ethernet_IRQHandler);
    }
#endif

#ifdef QK_ISR_EXIT                            /* preemptive QK kernel used? */
    QK_ISR_EXIT();                        /* inform QK about exiting an ISR */
#endif
}
//;0x0128 IRQ10
void  INT_Excep_IRQ10(void) {
    QK_ISR_ENTRY();          /* inform the QK kernel about entering the ISR */

    QACTIVE_POST(AO_Table, Q_NEW(QEvt, MAX_PUB_SIG),    /* for testing... */
                 &QS_Excep_IRQ10);
    QK_ISR_EXIT();            /* inform the QK kernel about exiting the ISR */
}
Exemplo n.º 4
0
//.............................................................................
extern "C" void GPIOPortA_IRQHandler(void) {
    QK_ISR_ENTRY();                         // infrom QK about entering an ISR

    AO_Table->postFIFO(Q_NEW(QEvent, MAX_PUB_SIG));             // for testing

    QK_ISR_EXIT();                           // infrom QK about exiting an ISR
}
Exemplo n.º 5
0
/*..........................................................................*/
void SysTick_Handler(void) {
    static uint32_t btn_debounced  = USR_SW1;
    static uint8_t  debounce_state = 0U;
    uint32_t btn;

    QK_ISR_ENTRY();                      /* inform QK about entering an ISR */

#ifdef Q_SPY
    {
        uint32_t dummy = SysTick->CTRL;     /* clear SysTick_CTRL_COUNTFLAG */
        QS_tickTime_ += QS_tickPeriod_;   /* account for the clock rollover */
    }
#endif

    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */

                                              /* debounce the SW1 button... */
    btn = GPIOF->DATA_Bits[USR_SW1];                   /* read the push btn */
    switch (debounce_state) {
        case 0:
            if (btn != btn_debounced) {
                debounce_state = 1U;        /* transition to the next state */
            }
            break;
        case 1:
            if (btn != btn_debounced) {
                debounce_state = 2U;        /* transition to the next state */
            }
            else {
                debounce_state = 0U;          /* transition back to state 0 */
            }
            break;
        case 2:
            if (btn != btn_debounced) {
                debounce_state = 3U;        /* transition to the next state */
            }
            else {
                debounce_state = 0U;          /* transition back to state 0 */
            }
            break;
        case 3:
            if (btn != btn_debounced) {
                btn_debounced = btn;     /* save the debounced button value */

                if (btn == 0U) {                /* is the button depressed? */
                    static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
                    QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
                }
                else {
                    static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
                    QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
                }
            }
            debounce_state = 0U;              /* transition back to state 0 */
            break;
    }

    QK_ISR_EXIT();                        /* inform QK about exiting an ISR */
}
Exemplo n.º 6
0
/*..........................................................................*/
void GPIOPortA_IRQHandler(void) {
    QK_ISR_ENTRY();                      /* inform QK about entering an ISR */

    QACTIVE_POST(AO_Table, Q_NEW(QEvt, MAX_PUB_SIG),      /* for testing... */
                 &l_GPIOPortA_IRQHandler);

    QK_ISR_EXIT();                        /* inform QK about exiting an ISR */
}
Exemplo n.º 7
0
extern "C" void EXTI0_IRQHandler(void) {
    QK_ISR_ENTRY();                          // inform QK-nano about ISR entry
    EXTI->PR = 0x1;      // set the EXTI->PR[0] to clear the EXTI_SWIER[0] bit

    AO_Table->POST(Q_NEW(QP::QEvt, MAX_PUB_SIG), (void *)0);    // for testing

    QK_ISR_EXIT();                            // inform QK-nano about ISR exit
}
Exemplo n.º 8
0
/*..........................................................................*/
static void interrupt ISR_tmr() {                             /* see NOTE01 */
    QK_ISR_ENTRY();                       /* inform QK-nano about ISR entry */

    QF_tickISR();                       /* process all time events (timers) */
    Video_printNumAt(20, 17, VIDEO_FGND_YELLOW, ++l_tickCtr);

    QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
}
Exemplo n.º 9
0
extern "C" void PIOINT0_IRQHandler(void) {
    QK_ISR_ENTRY();                          // inform QK-nano about ISR entry

    AO_Table->POST(Q_NEW(QP::QEvt, MAX_PUB_SIG),                // for testing
                   &l_GPIOPortA_IRQHandler);

    QK_ISR_EXIT();                            // inform QK-nano about ISR exit
}
Exemplo n.º 10
0
//.............................................................................
extern "C" void GPIOPortA_IRQHandler(void) {
    QK_ISR_ENTRY();                         // infrom QK about entering an ISR

    DPP::AO_Table->POST(Q_NEW(QP::QEvt, DPP::MAX_PUB_SIG),    // for testing
                   &l_GPIOPortA_IRQHandler);

    QK_ISR_EXIT();                           // infrom QK about exiting an ISR
}
/*..........................................................................*/
QK_ISR(auto_psv) _INT0Interrupt() {
    static QEvt const eat_evt = { EAT_SIG, 0U, 0U };

    _INT0IF = 0;

    QACTIVE_POST(AO_Table, &eat_evt, &l_INT0Interrupt);

    QK_ISR_EXIT();                  /* inform QK-nano about exiting the ISR */
}
Exemplo n.º 12
0
//............................................................................
extern "C" void SysTick_Handler(void) {
    static uint32_t btn_debounced  = 0U;
    static uint8_t  debounce_state = 0U;
    uint32_t volatile tmp;

    QK_ISR_ENTRY();                               // inform QK about ISR entry

    ++l_nTicks;                             // count the number of clock ticks

#ifdef Q_SPY
    tmp = SysTick->CTRL;                       // clear SysTick_CTRL_COUNTFLAG
    QS_tickTime_ += QS_tickPeriod_;          // account for the clock rollover
#endif

    QF::TICK_X(0U, &l_SysTick_Handler);       // process time events at rate 0

    tmp = GPIOF->DATA_Bits[USER_BTN];                  // read the User Button
    switch (debounce_state) {
        case 0:
            if (tmp != btn_debounced) {
                debounce_state = 1U;           // transition to the next state
            }
            break;
        case 1:
            if (tmp != btn_debounced) {
                debounce_state = 2U;           // transition to the next state
            }
            else {
                debounce_state = 0U;             // transition back to state 0
            }
            break;
        case 2:
            if (tmp != btn_debounced) {
                debounce_state = 3U;           // transition to the next state
            }
            else {
                debounce_state = 0U;             // transition back to state 0
            }
            break;
        case 3:
            if (tmp != btn_debounced) {
                btn_debounced = tmp;        // save the debounced button value
                if (tmp == 0U) {                   // is the button depressed?
                    static QEvt const bd = { BTN_DOWN_SIG, 0U, 0U };
                    QF::PUBLISH(&bd, &l_SysTick_Handler);
                }
                else {
                    static QEvt const bu = { BTN_UP_SIG, 0U, 0U };
                    QF::PUBLISH(&bu, &l_SysTick_Handler);
                }
            }
            debounce_state = 0U;                 // transition back to state 0
            break;
    }

    QK_ISR_EXIT();                                 // inform QK about ISR exit
}
Exemplo n.º 13
0
Arquivo: bsp.c Projeto: voileravi/zen
/*..........................................................................*/
interrupt void TINT_isr(void) {
    CSL_SYSCTRL_REGS->TIAFR |= 0x0001U;                 /* clear Timer0 bit */

    QK_ISR_ENTRY();                 /* inform the QK kernel about ISR entry */

    QF_TICK(&l_TINT_isr);                      /* handle the QF time events */

    QK_ISR_EXIT();                   /* inform the QK kernel about ISR exit */
}
Exemplo n.º 14
0
/*..........................................................................*/
static void interrupt tmrISR(void) {
    dispPreemptions(TMR_ISR_PRIO);              /* for testing only, NOTE01 */
    QK_ISR_ENTRY();                /* inform QK-nano about entering the ISR */

    QF_tick();                             /* process all armed time events */
    BSP_busyDelay();                                 /* for testing, NOTE02 */

    QK_ISR_EXIT();                  /* inform QK-nano about exiting the ISR */
}
void EXTI0_IRQHandler(void) {
    QK_ISR_ENTRY();                       /* inform QK-nano about ISR entry */
    EXTI->PR = 0x1;   /* set the EXTI->PR[0] to clear the EXTI_SWIER[0] bit */

                                                             /* for testing */
    QACTIVE_POST(AO_Table, Q_NEW(QEvent, MAX_PUB_SIG), (void *)0);

    QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
}
/*..........................................................................*/
void SysTick_Handler(void) {
    static uint32_t btn_debounced  = 0;
    static uint8_t  debounce_state = 0;
    uint32_t volatile tmp;

    QK_ISR_ENTRY();                            /* inform QK about ISR entry */

    ++l_nTicks;                          /* count the number of clock ticks */

#ifdef Q_SPY
    tmp = SysTick->CTRL;                    /* clear SysTick_CTRL_COUNTFLAG */
    QS_tickTime_ += QS_tickPeriod_;       /* account for the clock rollover */
#endif

    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */

    tmp = GPIOF->DATA_Bits[USER_BTN];               /* read the User Button */
    switch (debounce_state) {
        case 0:
            if (tmp != btn_debounced) {
                debounce_state = 1;         /* transition to the next state */
            }
            break;
        case 1:
            if (tmp != btn_debounced) {
                debounce_state = 2;         /* transition to the next state */
            }
            else {
                debounce_state = 0;           /* transition back to state 0 */
            }
            break;
        case 2:
            if (tmp != btn_debounced) {
                debounce_state = 3;         /* transition to the next state */
            }
            else {
                debounce_state = 0;           /* transition back to state 0 */
            }
            break;
        case 3:
            if (tmp != btn_debounced) {
                btn_debounced = tmp;     /* save the debounced button value */
                if (tmp == 0) {                 /* is the button depressed? */
                    static QEvt const bd = { BTN_DOWN_SIG, 0 };
                    QF_PUBLISH(&bd, &l_SysTick_Handler);
                }
                else {
                    static QEvt const bu = { BTN_UP_SIG, 0 };
                    QF_PUBLISH(&bu, &l_SysTick_Handler);
                }
            }
            debounce_state = 0;               /* transition back to state 0 */
            break;
    }

    QK_ISR_EXIT();                              /* inform QK about ISR exit */
}
Exemplo n.º 17
0
__interrupt void timerA_ISR(void) {
#ifdef NDEBUG
    __low_power_mode_off_on_exit();
#endif
    QK_ISR_ENTRY();                       /* inform QK-nano about ISR entry */

    QF_tickISR();

    QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
}
//;0x0070  CMTU0_CMT0
void  INT_Excep_CMTU0_CMI0(void) {
    QK_ISR_ENTRY();          /* inform the QK kernel about entering the ISR */

#ifdef Q_SPY
    QS_tickTime_ += QS_tickPeriod_;       /* account for the clock rollover */
#endif
    QF_TICK(&QS_Excep_CMTU0_CMT0);         /* process all armed time events */

    QK_ISR_EXIT();            /* inform the QK kernel about exiting the ISR */
}
QK_ISR(no_auto_psv) _T2Interrupt() {
    _T2IF = 0;                              /* clear Timer 2 interrupt flag */

#ifdef Q_SPY
    l_tickTime += BSP_TMR2_PERIOD;             /* account for TMR2 overflow */
#endif

    QF_TICK(&l_T2Interrupt);          /* handle all armed time events in QF */

    QK_ISR_EXIT();                  /* inform QK-nano about exiting the ISR */
}
Exemplo n.º 20
0
/*..........................................................................*/
static void interrupt ISR_tmr(void) {
    QK_ISR_ENTRY();                       /* inform QK-nano about ISR entry */

    QF_tickISR();                          /* process all armed time events */

    QActive_postISR((QActive *)&AO_Tunnel,  TIME_TICK_SIG, 0);
    QActive_postISR((QActive *)&AO_Ship,    TIME_TICK_SIG, 0);
    QActive_postISR((QActive *)&AO_Missile, TIME_TICK_SIG, 0);

    QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
}
Exemplo n.º 21
0
Arquivo: bsp.c Projeto: voileravi/zen
/*..........................................................................*/
interrupt void RTC_isr(void) {
    static QEvent const testEvt = { MAX_SIG, 0U, 0U };

    /*CSL_RTC_REGS->RTCINTFL = 0x01U;*/       /* clear the interrupt source */

    QK_ISR_ENTRY();                 /* inform the QK kernel about ISR entry */

    QACTIVE_POST(AO_Table, &testEvt, 0);      /* post a test event to Table */

    QK_ISR_EXIT();                   /* inform the QK kernel about ISR exit */
}
void SysTick_Handler(void) {
    QK_ISR_ENTRY();                       /* inform QK-nano about ISR entry */
#ifdef Q_SPY
    uint32_t dummy = SysTick->CTRL;        /* clear NVIC_ST_CTRL_COUNT flag */
    QS_tickTime_ += QS_tickPeriod_;       /* account for the clock rollover */
#endif

    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */

    QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
}
void timer_z_isr(void) {
    QK_ISR_ENTRY();                            /* inform QK about ISR entry */

    TZ0.TSR.BIT.IMFA = 0;                       /* clear compare match flag */
#ifdef Q_SPY
    l_tickTime += (uint32_t)((f1_CLK_SPEED/8 + BSP_TICKS_PER_SEC/2)
                             / BSP_TICKS_PER_SEC);
#endif
    QF_tick();                             /* process all armed time events */

    QK_ISR_EXIT();                              /* inform QK about ISR exit */
}
Exemplo n.º 24
0
//............................................................................
extern "C" void SysTick_Handler(void) {
    QK_ISR_ENTRY();                         // inform QK about entering an ISR

#ifdef Q_SPY
    uint32_t dummy = SysTick->CTRL;          // clear the COUNTFLAG in SysTick
    QS_tickTime_ += QS_tickPeriod_;       // account for the clock rollover */
#endif

    QF::tick();                               // process all armed time events

    QK_ISR_EXIT();                           // inform QK about exiting an ISR
}
Exemplo n.º 25
0
//............................................................................
void interrupt ISR_tmr(void) {
    dispPreemptions(TMR_ISR_PRIO);                 // for testing only, NOTE01

    QK_ISR_ENTRY();                        // inform QK about entering the ISR

    QF::tick();                  // call QF_tick() outside of critical section
#ifdef Q_SPY
    l_tickTime += 0x10000;                              // add 16-bit rollover
#endif

    busyDelay();                                        // for testing, NOTE02
    QK_ISR_EXIT();                          // inform QK about exiting the ISR
}
__interrupt void timerA_ISR(void) {
    QK_ISR_ENTRY();                     /* inform QK about entering the ISR */

#ifdef Q_SPY
    TACTL &= ~TAIFG;                    /* clear the interrupt pending flag */
    QS_tickTime_ +=
       (((BSP_SMCLK / 8) + BSP_TICKS_PER_SEC/2) / BSP_TICKS_PER_SEC) + 1;
#endif

    QF_TICK(&l_timerA_ISR);

    QK_ISR_EXIT();                       /* inform QK about exiting the ISR */
}
Exemplo n.º 27
0
__interrupt void port1_ISR(void) {                           /* for testing */
#ifdef NDEBUG
    __low_power_mode_off_on_exit();
#endif

    P1IFG &= ~BIT3;                               /* clear interrupt source */

    QK_ISR_ENTRY();                     /* inform QK kernel about ISR entry */

    QActive_postISR((QActive *)&AO_Ped, TEST_SIG, 0);    /* post test event */

    QK_ISR_EXIT();                       /* inform QK kernel about ISR exit */
}
Exemplo n.º 28
0
/*..........................................................................*/
void SysTick_Handler(void) {
    QK_ISR_ENTRY();                      /* infrom QK about entering an ISR */

#ifdef Q_SPY
    {
        uint32_t dummy = SysTick->CTRL;   /* clear the COUNTFLAG in SysTick */
        QS_tickTime_ += QS_tickPeriod_;   /* account for the clock rollover */
    }
#endif

    QF_tick();                             /* process all armed time events */

    QK_ISR_EXIT();                        /* infrom QK about exiting an ISR */
}
Exemplo n.º 29
0
/*..........................................................................*/
void SysTick_Handler(void) {
    static uint32_t btn_debounced  = USR_SW1;
    static uint8_t  debounce_state = 0U;
    uint32_t btn;

    QK_ISR_ENTRY();                      /* infrom QK about entering an ISR */

    QF_tickISR();                          /* process all armed time events */

                                             /* debounce the USER button... */
    btn = GPIOF->DATA_Bits[USR_SW1];                   /* read the User Sw1 */
    switch (debounce_state) {
        case 0:
            if (btn != btn_debounced) {
                debounce_state = 1U;        /* transition to the next state */
            }
            break;
        case 1:
            if (btn != btn_debounced) {
                debounce_state = 2U;        /* transition to the next state */
            }
            else {
                debounce_state = 0U;          /* transition back to state 0 */
            }
            break;
        case 2:
            if (btn != btn_debounced) {
                debounce_state = 3U;        /* transition to the next state */
            }
            else {
                debounce_state = 0U;          /* transition back to state 0 */
            }
            break;
        case 3:
            if (btn != btn_debounced) {
                btn_debounced = btn;     /* save the debounced button value */

                if (btn == 0U) {                /* is the button depressed? */
                    QActive_postISR((QActive *)&AO_Pelican,
                                    PEDS_WAITING_SIG, 0U);
                }
                else {                                   /* button released */
                }
            }
            debounce_state = 0U;              /* transition back to state 0 */
            break;
    }

    QK_ISR_EXIT();                  /* inform QK-nano about exiting the ISR */
}
Exemplo n.º 30
0
__interrupt void port1_ISR(void) {                           /* for testing */
    static const QEvt tstEvt = { MAX_SIG, 0U, 0U };

#ifdef NDEBUG
    __low_power_mode_off_on_exit();
#endif

    P1IFG &= ~BIT2;                               /* clear interrupt source */

    QK_ISR_ENTRY();                     /* inform QK kernel about ISR entry */

    QACTIVE_POST(AO_Table, &tstEvt, (void *)0);

    QK_ISR_EXIT();                       /* inform QK kernel about ISR exit */
}