From f2ad1a36799a65ef27a1ee46c772043d97cd0011 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 14 Dec 2017 11:51:49 -0500 Subject: Write version info to boot_out.txt. --- atmel-samd/main.c | 4 ++++ lib/utils/pyexec.c | 7 +++++-- py/makeversionhdr.py | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/atmel-samd/main.c b/atmel-samd/main.c index 880a0e170..091dfa447 100644 --- a/atmel-samd/main.c +++ b/atmel-samd/main.c @@ -27,6 +27,7 @@ #include #include +#include "genhdr/mpversion.h" #include "py/nlr.h" #include "py/compile.h" #include "py/frozenmod.h" @@ -700,6 +701,9 @@ int main(void) { f_open(&((fs_user_mount_t *) MP_STATE_VM(vfs_mount_table)->obj)->fatfs, boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS); flash_set_usb_writeable(true); + // Write version info to boot_out.txt. + mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO); + mp_hal_stdout_tx_str("\r\n"); #endif // TODO(tannewt): Re-add support for flashing boot error output. diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index d95084624..66ccad3b6 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -256,7 +256,8 @@ STATIC int pyexec_friendly_repl_process_char(int c) { } else if (ret == CHAR_CTRL_B) { // reset friendly REPL mp_hal_stdout_tx_str("\r\n"); - mp_hal_stdout_tx_str("Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME "\r\n"); + mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO); + mp_hal_stdout_tx_str("\r\n"); // mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n"); goto input_restart; } else if (ret == CHAR_CTRL_C) { @@ -395,7 +396,9 @@ int pyexec_friendly_repl(void) { #endif friendly_repl_reset: - mp_hal_stdout_tx_str("\r\nAdafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME "\r\n"); + mp_hal_stdout_tx_str("\r\n"); + mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO); + mp_hal_stdout_tx_str("\r\n"); // mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n"); // to test ctrl-C diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 30995f937..ebd887445 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -86,6 +86,7 @@ def make_version_header(filename): #define MICROPY_VERSION_MINOR (%s) #define MICROPY_VERSION_MICRO (%s) #define MICROPY_VERSION_STRING "%s" +#define MICROPY_FULL_VERSION_INFO ("Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME) """ % (git_tag, git_hash, datetime.date.today().strftime("%Y-%m-%d"), ver[0].replace('v', ''), ver[1], ver[2], version_string) -- cgit v1.2.3