zephyr: Add ability to set feature level in conf file.

Adds the ability to set feature level in board.conf.

Signed-off-by: Vdragon <mail@massdriver.space>
This commit is contained in:
Vdragon
2025-12-03 18:58:36 +01:00
committed by Damien George
parent 02d2e9fb74
commit cfe9048693
2 changed files with 37 additions and 2 deletions
+24
View File
@@ -59,6 +59,30 @@ config MICROPY_USB_DEVICE_PID
hex "USB PID"
default 0x0001
choice MICROPY_CONFIG_ROM_LEVEL
prompt "MicroPython Features level"
default MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES
config MICROPY_CONFIG_ROM_LEVEL_MINIMUM
bool "Disable all optional features"
config MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES
bool "Only enable core features"
config MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES
bool "Enable most common features"
config MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES
bool "Enable convenience features"
config MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES
bool "Enable all common features"
config MICROPY_CONFIG_ROM_LEVEL_EVERYTHING
bool "Enable everything"
endchoice
endmenu # MicroPython Options
source "Kconfig.zephyr"
+13 -2
View File
@@ -31,9 +31,20 @@
#include <zephyr/kernel.h>
#include <zephyr/drivers/spi.h>
// Use the basic configuration level to get a balance between size and features.
#ifndef MICROPY_CONFIG_ROM_LEVEL
#if defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_MINIMUM)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_MINIMUM)
#elif defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
#elif defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES)
#elif defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
#elif defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES)
#elif defined(CONFIG_MICROPY_CONFIG_ROM_LEVEL_EVERYTHING)
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EVERYTHING)
#else
#error "Undefined Feature Level"
#endif
// Usually passed from Makefile