Exemple #1
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
}
Exemple #2
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
}
//;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 */
}
Exemple #4
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 */
}
Exemple #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 */
}
Exemple #6
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
}
Exemple #7
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 */
}
Exemple #8
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
}
Exemple #9
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
}
Exemple #10
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 */
}
/*..........................................................................*/
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 */
}
Exemple #12
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 */
}
Exemple #13
0
/*..........................................................................*/
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 */
}
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 */
}
Exemple #15
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
}
//;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 */
}
Exemple #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 */
}
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 */
}
Exemple #19
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 */
}
Exemple #20
0
/*..........................................................................*/
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 */
}
Exemple #21
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
}
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 */
}
__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 */
}
Exemple #24
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
}
Exemple #25
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 */
}
Exemple #26
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 */
}
Exemple #27
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 */
}
Exemple #28
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 */
}
__interrupt void timer0_ISR(void) {
    QK_ISR_ENTRY();                     /* inform QK about entering the ISR */

    /* No need to clear the interrupt source since the Timer0 compare
    * interrupt is automatically cleard in hardware when the ISR runs.
    */

#ifdef Q_SPY
    l_tickTime += (F_CPU / BSP_TICKS_PER_SEC / 1024);
#endif

    QF_tick();

    QK_ISR_EXIT();                       /* inform QK about exiting the ISR */
}
Exemple #30
0
__interrupt void timerA_ISR(void) {
#ifdef NDEBUG
    __low_power_mode_off_on_exit();
#endif

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

#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 ISR exit */
}