Пример #1
0
static cyg_uint32
sys_timer_isr(cyg_vector_t vector, cyg_addrword_t data)
{
    ++sys_timer_ticks;

#ifdef CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF
    HAL_CLOCK_RESET(CYGNUM_HAL_INTERRUPT_RTC, set_period);
#else
    HAL_CLOCK_RESET(CYGNUM_HAL_INTERRUPT_RTC, CYGNUM_HAL_RTC_PERIOD);
#endif // CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF

    cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_RTC);

#ifdef CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF
    if ( timer_callback ) {
        char *intrpc = (char *)0;
        char *intrsp = (char *)0;

        // There may be a number of ways to get the PC and (optional) SP
        // information out of the HAL.  Hence this is conditioned.  In some
        // configurations, a register-set pointer is available as
        // (invisible) argument 3 to this ISR call.

#ifdef HAL_GET_PROFILE_INFO
        HAL_GET_PROFILE_INFO( intrpc, intrsp );
#endif // HAL_GET_PROFILE_INFO available

        CYGARC_HAL_SAVE_GP();
        timer_callback( intrpc, intrsp );
        CYGARC_HAL_RESTORE_GP();
    }
#endif // CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF
    return CYG_ISR_HANDLED;
}
Пример #2
0
cyg_uint32 isr( cyg_uint32 vector, CYG_ADDRWORD data )
{
    CYG_TEST_CHECK( ISR_DATA == data , "Bad data passed to ISR");
    CYG_TEST_CHECK( CYGNUM_HAL_INTERRUPT_RTC == vector ,
                    "Bad vector passed to ISR");

    HAL_CLOCK_RESET( vector, CYGNUM_HAL_RTC_PERIOD );

    HAL_INTERRUPT_ACKNOWLEDGE( vector );
    
    ticks++;

    return CYG_ISR_HANDLED;
}