예제 #1
0
파일: gpio.c 프로젝트: LucaZulberti/RIOT
/** @brief Interrupt service routine for Port D */
void isr_gpiod(void)
{
    int mis, bit;
    gpio_isr_ctx_t* state;

    /* Latch and clear the interrupt status early on: */
    mis = GPIO_D->MIS;
    GPIO_D->IC             = 0x000000ff;
    GPIO_D->IRQ_DETECT_ACK = 0xff000000;

    for (bit = 0; bit < GPIO_BITS_PER_PORT; bit++) {
        if (mis & 1) {
            state = gpio_config + reverse_pin_lut[GPIO_PXX_TO_NUM(PORT_D, bit)];
            state->cb(state->arg);
        }

        mis >>= 1;
    }

    cortexm_isr_end();
}
예제 #2
0
파일: gpio.c 프로젝트: AnonMall/RIOT
/** @brief Interrupt service routine for Port D */
void isr_gpiod(void)
{
    int mis, bit;
    gpio_state_t* state;

    /* Latch and clear the interrupt status early on: */
    mis = GPIO_D->MIS;
    GPIO_D->IC             = 0x000000ff;
    GPIO_D->IRQ_DETECT_ACK = 0xff000000;

    for (bit = 0; bit < GPIO_BITS_PER_PORT; bit++) {
        if (mis & 1) {
            state = gpio_config + reverse_pin_lut[GPIO_PXX_TO_NUM(PORT_D, bit)];
            state->cb(state->arg);
        }

        mis >>= 1;
    }

    if (sched_context_switch_request) {
        thread_yield();
    }
}