Skip to content

HardwareTimer lacks a function to check if it's running or not #1525

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

Closed
positron96 opened this issue Oct 26, 2021 · 5 comments · Fixed by #1550
Closed

HardwareTimer lacks a function to check if it's running or not #1525

positron96 opened this issue Oct 26, 2021 · 5 comments · Fixed by #1550
Assignees

Comments

@positron96
Copy link
Contributor

There are functions to pause/resume the timer, but there is no way to check if it's running or not.

Right now one needs to take a HAL structure and check if the required bit is set.

Would be good to have such a function (for the entire timer and maybe for each channel).

ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 18, 2021
* bool isRunning(); //returns true if HardwareTimer is running
* bool isRunningChannel(channel); //returns true if channel is running

Fixes stm32duino#1525

Signed-off-by: Alexandre Bourdiol <[email protected]>
@ABOSTM
Copy link
Contributor

ABOSTM commented Nov 18, 2021

@positron96 ,
Can you please review the proposed Pull Request #1550
and tell me whether it matches your expectations ?

ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 18, 2021
* bool isRunning(); //return true if HardwareTimer is running
* bool isRunningChannel(channel); //return true if channel is running

Fixes stm32duino#1525

Signed-off-by: Alexandre Bourdiol <[email protected]>
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 18, 2021
* bool isRunning(); //return true if HardwareTimer is running
* bool isRunningChannel(channel); //return true if channel is running

Fixes stm32duino#1525

Signed-off-by: Alexandre Bourdiol <[email protected]>
@positron96
Copy link
Contributor Author

Thanks! The PR sems to be doing exactly what I need.

@fpistm fpistm added this to the 2.2.0 milestone Nov 19, 2021
fpistm pushed a commit that referenced this issue Nov 19, 2021
* bool isRunning(); //return true if HardwareTimer is running
* bool isRunningChannel(channel); //return true if channel is running

Fixes #1525

Signed-off-by: Alexandre Bourdiol <[email protected]>
@fpistm
Copy link
Member

fpistm commented Nov 19, 2021

Thank you @positron96 for the quick feedback. PR merged.

@positron96
Copy link
Contributor Author

Great! When is it expected to hit platformio registry?

@fpistm
Copy link
Member

fpistm commented Nov 22, 2021

Well, don't know. we do not manage this. PIO will probably update after the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants