Skip to content

signal: Add alarm() and pause() function#401

Merged
dpgeorge merged 2 commits into
micropython:masterfrom
Hagb:signal
Jun 30, 2026
Merged

signal: Add alarm() and pause() function#401
dpgeorge merged 2 commits into
micropython:masterfrom
Hagb:signal

Conversation

@Hagb

@Hagb Hagb commented Oct 24, 2020

Copy link
Copy Markdown
Contributor

This PR adds alarm and pause function to call these two syscalls.

Comment thread signal/signal.py Outdated

signal_i = libc.func("i", "signal", "ii")
signal_p = libc.func("i", "signal", "ip")
alarm_i = libc.func("I", "alarm", "I")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

since there is no special handling needed for arguments, this could just be

alarm = libc.func("I", "alarm", "I")

and skip the wrapper below. The same applies to pause.

@Hagb Hagb Oct 24, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. The file has been changed.

@dpgeorge dpgeorge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks fine, and I verified the behaviour is the same as CPython.

@dpgeorge dpgeorge merged commit 1b91e04 into micropython:master Jun 30, 2026
4 of 5 checks passed
@dpgeorge

Copy link
Copy Markdown
Member

Sorry this took nearly 6 years to get to, but it's now merged!

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 this pull request may close these issues.

3 participants