コード例 #1
0
ファイル: dport_access.c プロジェクト: Exchizz/esp-idf
static void dport_access_init_core1(void *arg)
{
    int core_id = xPortGetCoreID();

    assert(core_id == 1);

    ESP_INTR_DISABLE(ETS_DPORT_INUM);
    intr_matrix_set(core_id, ETS_FROM_CPU_INTR3_SOURCE, ETS_DPORT_INUM);
    ESP_INTR_ENABLE(ETS_DPORT_INUM);

    dport_access_ref[core_id] = 0;
    dport_access_start[core_id] = 0;
    dport_access_end[core_id] = 0;
    dport_core_state[core_id] = DPORT_CORE_STATE_RUNNING;

    vTaskDelete(NULL);
}
コード例 #2
0
ファイル: gpio.c プロジェクト: aliince77/esp32_playground
/*
 * Register an application-specific interrupt handler for GPIO pin
 * interrupts.  Once the interrupt handler is called, it will not
 * be called again until after a call to gpio_intr_ack.  Any GPIO
 * interrupts that occur during the interim are masked.
 *
 * The application-specific handler is called with a mask of
 * pending GPIO interrupts.  After processing pin interrupts, the
 * application-specific handler may wish to use gpio_intr_pending
 * to check for any additional pending interrupts before it returns.
 */
void gpio_intr_handler_register(void *fn, void *arg)
{
    intr_matrix_set(HW_GPIO_INUM, ETS_GPIO_INUM);
    xt_set_interrupt_handler(ETS_GPIO_INUM, fn, arg);
}