There are discussions about machine.Encoder and machine.Counter classes in github. These are implemented in C. I would like to give a python variant a trial and would like to add it as a frozen class to the machine module so my versions are compatible with the ones from the existing PR's.
Is that possible at all? Can one mix python and C in the same module? If yes, how? Simply adding machine/Encoder.py to port/esp32/modules does not work.
Add frozen code to the machine module?
Re: Add frozen code to the machine module?
Hello,
If I understand your need accordingly, I think Damien is cooking something up:
https://github.com/micropython/micropython/pull/8191
If I understand your need accordingly, I think Damien is cooking something up:
https://github.com/micropython/micropython/pull/8191
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
-
- Posts: 50
- Joined: Sun Nov 29, 2020 8:17 pm
Re: Add frozen code to the machine module?
Thanks for the response. But ... no, I don't think this is what I am searching for. I don't have a problem including my code into the firmware. This already works.
I can add
Code: Select all
port/esp32/modules/mymachine/Encoder.py
Code: Select all
from mymachine import Encoder
Code: Select all
port/esp32/modules/machine/Encoder.py
Code: Select all
from machine import Encoder