Skip to content

Long delay in first call to interrupt #797

Closed
@plerup

Description

@plerup

Hi,

I'm using the standard Arduino routines for setting up an interrupt for a GPIO pin

pinMode(RX_PIN, INPUT);
attachInterrupt(RX_PIN, rxInt, FALLING);

The problem I get is that the very first call to the interrupt routine (after system reset) has a delay of > 20 uS from the GPIO pin flank to the actual call. Any subsequent calls just have a delay of 4 uS.

If I use the SDK routines like this:

ETS_GPIO_INTR_ATTACH(intr, 0);
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, BIT(RX_PIN));
gpio_pin_intr_state_set(GPIO_ID_PIN(RX_PIN), GPIO_PIN_INTR_NEGEDGE);

then I don't get this behavior.

Any ideas why this is so?

Thanks
/Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions