Adding modules to Micropython and en/disabling them in menuconfig

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
deftris
Posts: 4
Joined: Wed Jul 17, 2019 7:49 pm

Adding modules to Micropython and en/disabling them in menuconfig

Post by deftris » Sun Jul 21, 2019 7:09 am

I wish to integrate this port of FastLED library (https://github.com/aykevl/mpy-pixels) into Micropython.
I´ve read this documentation: https://docs.micropython.org/en/latest/ ... dules.html
and can configure and compile Micropython successfully using ./BUILD.sh menuconfig then ./BUILD.sh
Hovewer, when it comes to adding a module to Micropython I´m a bit confused by the above mentioned docs that explain to modify the makefile, but does not involve the sdkconfig.
I´ve search recursively for the string "USER_C_MODULES" through the Micropython source, but cannot find it.

Which steps should i tak to cleanly add one or several modules to Micropython and be able to configure them with menuconfig ?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Adding modules to Micropython and en/disabling them in menuconfig

Post by jimmo » Sun Jul 21, 2019 7:55 am

Hi,

Is it possible you're using the Loboris fork? I think that's where BUILD.sh and menuconfig come from?

In either case, USER_C_MODULES is part of the upstream MicroPython (i.e. https://github.com/micropython/micropython), and is unrelated to ESP32 components.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Adding modules to Micropython and en/disabling them in menuconfig

Post by jimmo » Sun Jul 21, 2019 8:13 am

Unfortunately I don't know much about how to achieve what you want in the Loboris fork...

If you're interested in trying this with the main MicroPython, I think https://github.com/aykevl/mpy-pixels might be based on an older version of the USER_C_MODULES mechanism (i.e. it doesn't match the documentation you linked to). But it should be fairly easy to update.

Also, you said "this port of FastLED library (https://github.com/aykevl/mpy-pixels) into Micropython", but that's not a port of FastLED, rather it's a bunch of routines for doing pixel calculations. Is that what you want, or are you looking for a way to drive WS2812/APA102 LEDs?

deftris
Posts: 4
Joined: Wed Jul 17, 2019 7:49 pm

Re: Adding modules to Micropython and en/disabling them in menuconfig

Post by deftris » Sun Jul 21, 2019 8:25 am

Well, I forgot to tell: yes i´m using Loboris fork along with ESP32.
Also FastLED lib is mostly about pixel calculations. I can drive WS2812 easily with the existing driver from Micropython, and I have a bunch of effects that I wrote for FastLED on AVR /AVRgcc that I want to use on ESP32/Micropython.

I´ll ask on loboris forum how to make a user module into the Micropython fork, sorry for asking here. I will give a try on the main version of Micropython for ESP32 too anyway. I´m mostly using Lobo fork because of some features that are not (yet) ported to the main Micropython repository, like websockets, mDNS

Post Reply