Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timerAttachInterrupt() and timerDetachInterrupt() in esp32-hal-timer.c #6763

Merged
merged 5 commits into from
May 27, 2022

Conversation

sweetlilmre
Copy link
Contributor

@sweetlilmre sweetlilmre commented May 17, 2022

Description of Change

This PR fixes the timerAttachInterrupt() and timerDetachInterrupt() functions in esp32-hal-timer.c.

In timerAttachInterrupt() the change:

  • removes the unnecessary timer_info_t structure
  • removes the allocation of the structure in timerAttachInterrupt()
  • removes the call to timer_enable_intr() in timerAttachInterrupt()
  • rewords the log message for edge handling (this is not relevant in the IDF4.4 timer driver)
  • wraps the ISR function in the correct function type as expected by the IDF4.4 timer driver

Note: to handle the ISR function wrapping a default ISR handler function has been added.

In timerDetachInterrupt() the change:

  • removes the previous code
  • calls the appropriate function in the IDF4.4 driver

Note: the log message in timerBegin() was also reworded.

Tests scenarios

I have tested my Pull Request on Arduino-esp32 core master with an ESP32 Board with this scenario

Related links

Related issue: #6730
Closes #6730

@CLAassistant
Copy link

CLAassistant commented May 17, 2022

CLA assistant check
All committers have signed the CLA.

@P-R-O-C-H-Y P-R-O-C-H-Y added the Area: Peripherals API Relates to peripheral's APIs. label May 17, 2022
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this May 17, 2022
@me-no-dev me-no-dev added the hil_test Run Hardware Tests label May 18, 2022
@me-no-dev
Copy link
Member

@P-R-O-C-H-Y good timing on the timer ci test

@P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y good timing on the timer ci test

Was waiting for the test merge to add the label hil_test there :D

@P-R-O-C-H-Y P-R-O-C-H-Y added hil_test Run Hardware Tests and removed hil_test Run Hardware Tests labels May 18, 2022
@sweetlilmre
Copy link
Contributor Author

@me-no-dev may I ask what is probably a stupid, but genuine question? :)
How does the master merge that you did work? It looks (from the perspective of my fork) that you merged the main repo master into mine. I'm assuming this is a PR option to rebase my PR on your current master, is that correct?
And I guess it follows that it would be better practise in future to make PR changes in a branch.
Always more to learn. :)

@me-no-dev
Copy link
Member

@sweetlilmre I updated your branch to have the new changes in our master, which include timer hardware testing. It is more or less rebasing to the upstream master

@VojtechBartoska
Copy link
Contributor

@Ouss4 Any clue why the bot didn't show up? :(

@Ouss4
Copy link
Contributor

Ouss4 commented May 23, 2022

@Ouss4 Any clue why the bot didn't show up? :(

I talked with Honza regarding this. I see that the Workflow wasn't triggered at all. The only thing that's different here is that the OP is a "First time contributor". Github introduced few months ago an approval step required for this situation, I'm not sure how this works for workflow_runs (i.e Workflow triggered by another workflow), but my assumption for now is that they require the same "approval" step.
I labeled #6770 from another contributor and the Workflow triggered correctly (Also assuming that the author there was not invited to this repo, if that's the case, I'm gonna have to test with another PR.)

Note, that the tests did run and succeeded, it's only the workflow that adds the comment with the summary that didn't run.

@sweetlilmre
Copy link
Contributor Author

Is there anything I can do to help?

@sweetlilmre
Copy link
Contributor Author

@Ouss4 it looks like my upstream fetch has kicked in the approval behaviour.
Would you mind approving so we can move this PR forward and see if that resolves the previous issue?

@P-R-O-C-H-Y
Copy link
Member

@Ouss4 it looks like my upstream fetch has kicked in the approval behaviour.
Would you mind approving so we can move this PR forward and see if that resolves the previous issue?

@sweetlilmre
The tests has succeeded so its fine.
Gonna take a look on the PR today :) and make a review.

@sweetlilmre
Copy link
Contributor Author

@P-R-O-C-H-Y I am excited! :)

Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR 👍
Please look on comments I made. After fixing these logs, it can be merged :)

@sweetlilmre
Copy link
Contributor Author

@P-R-O-C-H-Y  All requested changes have been made :)

@me-no-dev me-no-dev merged commit f9423ab into espressif:master May 27, 2022
@me-no-dev
Copy link
Member

Thanks @sweetlilmre ! Merged :)

@sweetlilmre
Copy link
Contributor Author

Fantastic! Thank you everyone :)

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. hil_test Run Hardware Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

timerAttachInterrupt() and timerDetachInterrupt() broken in 2.0.2+
6 participants