Exemplo n.º 1
0
void us_ticker_set_interrupt(timestamp_t timestamp) {
    // set match value
    uint64_t timestamp64;
    uint64_t set_cmp_val64;
    volatile uint32_t set_cmp_val;
    uint64_t count_val_64;

    /* calc compare mach timestamp */
    timestamp64 = (ticker_us_last64 & 0xFFFFFFFF00000000) + timestamp;
    if (timestamp < (ticker_us_last64 & 0x00000000FFFFFFFF)) {
        /* This event is wrap arround */
        timestamp64 += 0x100000000;
    }

    /* calc compare mach timestamp */
    set_cmp_val64  = timestamp64 * count_clock;
    set_cmp_val    = (uint32_t)(set_cmp_val64 & 0x00000000FFFFFFFF);
    count_val_64   = ticker_read_counter64();
    if (set_cmp_val64 <= (count_val_64 + 500)) {
        GIC_SetPendingIRQ(US_TICKER_TIMER_IRQn);
        GIC_EnableIRQ(US_TICKER_TIMER_IRQn);
        return;
    }
    OSTM1CMP = set_cmp_val;
    GIC_EnableIRQ(US_TICKER_TIMER_IRQn);
}
Exemplo n.º 2
0
void lp_ticker_fire_interrupt(void)
{
    GIC_SetPendingIRQ(LP_TICKER_TIMER_IRQn);
    GIC_EnableIRQ(LP_TICKER_TIMER_IRQn);
}
Exemplo n.º 3
0
void us_ticker_fire_interrupt(void)
{
    GIC_SetPendingIRQ(OSTMI1TINT_IRQn);
    GIC_EnableIRQ(OSTMI1TINT_IRQn);
}