[esp32-s3] 2 frozen machine modules #18061
-
In esp32/ESP32_GENERIC_S3 Firmware (Support for Octal-SPIRAM)
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
For the ESP32 port, the purpose of the modules/machine.py file is to include the Counter and Encoder from esp32.PCNT and make these functions more accessible. The help("modules") command returns two machines because 1) the C module extmod/modmachine.c and 2), the frozen Python module ports/esp32/modules/machine.py. The machine.py overwrite modmachine.c so This could be the cause of the problem when you run What happens when you do this in the REPL:
will this cause a crash? |
Beta Was this translation helpful? Give feedback.
-
Here is what I get
|
Beta Was this translation helpful? Give feedback.
-
Ok, thanks for the suggestion. |
Beta Was this translation helpful? Give feedback.
For the ESP32 port, the purpose of the modules/machine.py file is to include the Counter and Encoder from esp32.PCNT and make these functions more accessible.
The help("modules") command returns two machines because 1) the C module extmod/modmachine.c and 2), the frozen Python module ports/esp32/modules/machine.py.
The machine.py overwrite modmachine.c so
import machine
execute machine.py which will then include Counter and Encoder functions together with the functions defined in the modmachine.c into the machine namespace.This could be the cause of the problem when you run
help(machine)
. There may be a subtle bug in the py/builtinhelp.c program. I build my own firmware and never include…