mirror of
https://github.com/micropython/micropython.git
synced 2026-05-03 06:10:14 +02:00
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:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user