Where are MICROPY_PY_xyz defined?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
davef
Posts: 178
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Where are MICROPY_PY_xyz defined?

Post by davef » Wed Jan 20, 2021 3:40 am

The latest Micropython.doc has nothing on these keywords, ie MICROPY_PY_LWIP etc.

Thanks

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

Re: Where are MICROPY_PY_xyz defined?

Post by jimmo » Wed Jan 20, 2021 3:49 am

davef wrote:
Wed Jan 20, 2021 3:40 am
The latest Micropython.doc has nothing on these keywords, ie MICROPY_PY_LWIP etc.
The docs mostly focus on using MicroPython, and less on the actual development of MicroPython firmware (but this is improving).

Many of the core options are defined, with defaults, in py/mpconfig.h. Mostly these are the options that define the core runtime and standard libraries.

Then it's up to a port (via port/mpconfigport.h) and a board (via port/board/BOARD/mpconfigboard.h) to set these as appropriate (e.g. to enable specific features).

There are other options that are specific to given ports and libraries (e.g. LWIP, Bluetooth, etc).

Some of these options are also set via the build (e.g. via the Makefiles) which set them in CFLAGS using the -D flag.

davef
Posts: 178
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Where are MICROPY_PY_xyz defined?

Post by davef » Wed Jan 20, 2021 4:36 am

I was actually looking in that file and saw MICROPY_PY_LWIP mentioned twice so I think you have put:

Code: Select all

MICROPY_PY_LWIP = 1 
in the mpconfigboard.mk file to get it to work.

Thanks for the explanation.

Post Reply