Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
non-destructive text micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
badge fixer
non-destructive text micropython
Commits
3a679eaf
Commit
3a679eaf
authored
5 years ago
by
Peter Hinch
Committed by
Damien George
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
docs/reference/speed_python: Update that read-only buffers are accepted.
As allowed by recent
cd35dd9d
parent
11ecdf2e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/reference/speed_python.rst
+6
-4
6 additions, 4 deletions
docs/reference/speed_python.rst
with
6 additions
and
4 deletions
docs/reference/speed_python.rst
+
6
−
4
View file @
3a679eaf
...
...
@@ -293,9 +293,11 @@ microseconds. The rules for casting are as follows:
* The argument to a bool cast must be integral type (boolean or integer); when used as a return
type the viper function will return True or False objects.
* If the argument is a Python object and the cast is ``ptr``, ``ptr``, ``ptr16`` or ``ptr32``,
then the Python object must either have the buffer protocol with read-write capabilities
(in which case a pointer to the start of the buffer is returned) or it must be of integral
type (in which case the value of that integral object is returned).
then the Python object must either have the buffer protocol (in which case a pointer to the
start of the buffer is returned) or it must be of integral type (in which case the value of
that integral object is returned).
Writing to a pointer which points to a read-only object will lead to undefined behaviour.
The following example illustrates the use of a ``ptr16`` cast to toggle pin X1 ``n`` times:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment