Skip to content

Conversation

@hasenradball
Copy link

Set Default Parameter for edge in timerAttachInterupt

The actual Documentation for the funtion timerAttachInterupt(...) looks like:

image

But the actual code look like:
image

To be consistent with the documentation, and edgeis not supportet:
see:

void timerAttachInterruptFlag(hw_timer_t *timer, void (*fn)(void), bool edge, int intr_alloc_flags){
    if(edge){
        log_w("EDGE timer interrupt is not supported! Setting to LEVEL...");
    }
    timer_isr_callback_add(timer->group, timer->num, timerFnWrapper, fn, intr_alloc_flags);
}

A default parameter for edge = false would be a good change to be consistent with the documentation.

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2024

CLA assistant check
All committers have signed the CLA.

@VojtechBartoska VojtechBartoska added Area: Peripherals API Relates to peripheral's APIs. Status: Review needed Issue or PR is awaiting review labels Jan 15, 2024
@me-no-dev me-no-dev changed the title Set Default Parameter for edge in timerAttachInterupt(...) Function [release/2.x] Set Default Parameter for edge in timerAttachInterupt(...) Function Jan 16, 2024
@me-no-dev
Copy link
Member

https://github.com/espressif/arduino-esp32/actions/runs/7511742476/job/20531529273?pr=9097#step:5:104

Default values can be given only for C++ functions/methods. In C that is not allowed.

@me-no-dev
Copy link
Member

so... the docs you are looking at are for the 3.0.0 version. In 2.x the parameter exists and should exist to not break compatibility.

Closing

@me-no-dev me-no-dev closed this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Peripherals API Relates to peripheral's APIs. Status: Review needed Issue or PR is awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants