-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
docs isr_rules, micropython: add note that creating a ref to a bound method causes allocation. #3431
Conversation
This has stray commits, please rebase. |
docs/library/micropython.rst
Outdated
@@ -111,6 +111,13 @@ Functions | |||
Such an IRQ puts restrictions on the code that runs in the IRQ (for example | |||
the heap may be locked) and scheduling a function to call later will lift | |||
those restrictions. | |||
|
|||
If the callback to be passed to ``schedule`` is a bound method, passing this | |||
directly will fail. This is because creating a reference to a bound method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a bound method, passing this directly will fail." This isn't true in general. The paragraph apparently should start with "Note: If schedule is call from a preempting IRQ, when memory allocation is not allowed, ..."
0bd548e
to
e388ca7
Compare
Has this fixed it? Git continues to baffle me, I'm afraid :( |
Nope, as you can see, there're still 2 commits. In your "doc-ref-bound-method" branch, you need to do "git rebase -i master", then follow the on-screen instructions. (You need to remove a commit not related to this patch.) |
74c70c4
to
bade097
Compare
I had to do a force push but hopefully this has worked. |
docs/reference/isr_rules.rst
Outdated
@@ -124,6 +124,30 @@ A means of creating an object without employing a class or globals is as follows | |||
The compiler instantiates the default ``buf`` argument when the function is | |||
loaded for the first time (usually when the module it's in is imported). | |||
|
|||
An instance of object creation occurs when a reference to a bound method is created. This means that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please wrap lines similarly to the paragraph above. (I also would recommend wrapping them at <80 chars for any new paragraphs).
docs/library/micropython.rst
Outdated
@@ -112,5 +112,14 @@ Functions | |||
the heap may be locked) and scheduling a function to call later will lift | |||
those restrictions. | |||
|
|||
Note: If ``schedule`` is called from a preempting IRQ, when memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use the xref syntax as described in https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md#documentation-conventions (specifically, all occurrences should be:
`schedule()`
bade097
to
2167ef5
Compare
Is this OK now? |
Thanks! Merged in ec1e9a1 |
As discussed in #3428.