Performance pin interrupt in C


#1

What is the max performance in time when using native C pin interrupt?

If I check with scope, I see drifting delay between 50us - 250us?

void clk_edge_change(int slot, int dir)
{
    if(dir != 0)        
        vhalPinFastSet(0,BUZZER_PIN);
     else
         vhalPinFastClear(0,BUZZER_PIN);
}

vhalPinAttachInterrupt(COM_CLK,PINMODE_EXT_BOTH, clk_edge_change, TIME_U(0,MILLIS));

I need much faster response, let’s say around 10us.


Using HTM in C on ESP32
#2

Hello @Marcel,

if you need a faster response you can try to use directly ESP-IDF APIs like gpio_set_intr_type and gpio_isr_handler_add.
Let me know if those functions satisfy your requirements :slight_smile:


#3

Hi @LorenzoR

Thank you, this works very stable and fast :slight_smile: