Is there way to "inline" function? #18743
Replies: 3 comments 1 reply
-
|
Would a |
Beta Was this translation helpful? Give feedback.
-
|
See also micropython.RingIO - an efficient circular buffer. |
Beta Was this translation helpful? Give feedback.
-
That'd be embarrassingly slow. I faced a similar situation quite a while ago and wrote a test to verify the various call penalties. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In micropython on ESP32-S2 function calls are very expensive - like 100 us for call of an empty function. Is it posiible to "inline" a function somehow? I am writing a driver for RMT in Rx mode and I am trying to implement a FIFO. My idea is like
Of course I can copy-paste the body of add_to_FIFO in the two locations but it quickly makes the code unreadable. OTOH using the "hacky" way I am able to read from RMT a pulse every 50 us or so but the readable way takes much much longer.
Beta Was this translation helpful? Give feedback.
All reactions