How do pointer arithmetic in viper #11640
Unanswered
GuillaumeLeclerc
asked this question in
Using MicroPython
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to write a tight control loop in micropython. The code uses PIOs, inline assembly and viper and is plenty fast. The only issue is that garbage collection completely ruins the real time aspect of the application.
I need to store state and was using struct until I realized (#11639) that just accessing it in
viper
allocates memory for some reason.My second option, (much less readable/maintanable) was to hard code offsets in my code and use
ptr32
. However it seems that viper will not let me do pointer arithmetic (addition). It complains that it can't addptr32
andint
. What is the proper syntax to do that ?Beta Was this translation helpful? Give feedback.
All reactions