From a3519332b65837987d33cdae1a8fa8a509b9ad4e Mon Sep 17 00:00:00 2001 From: Vincenzo Frascino Date: Wed, 26 Oct 2016 16:26:58 +0100 Subject: [PATCH] zephyr: Use board/SoC values for startup banner based on Zephyr config. This patch modifies the HW macro definition in order to let micropython report correctly the BOARD and the SOC on which it is working on. --- zephyr/mpconfigport.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h index 327719459d..2f12cf7112 100644 --- a/zephyr/mpconfigport.h +++ b/zephyr/mpconfigport.h @@ -60,8 +60,19 @@ #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_PY_BUILTINS_COMPLEX (0) + +#ifdef CONFIG_BOARD +#define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD +#else #define MICROPY_HW_BOARD_NAME "zephyr-generic" +#endif + +#ifdef CONFIG_SOC +#define MICROPY_HW_MCU_NAME CONFIG_SOC +#else #define MICROPY_HW_MCU_NAME "unknown-cpu" +#endif + #define MICROPY_MODULE_FROZEN_STR (1) typedef int mp_int_t; // must be pointer size