Write version info to boot_out.txt.

This commit is contained in:
Dan Halbert 2017-12-14 11:51:49 -05:00 committed by Scott Shawcroft
parent 43650b6896
commit f2ad1a3679
3 changed files with 10 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "genhdr/mpversion.h"
#include "py/nlr.h" #include "py/nlr.h"
#include "py/compile.h" #include "py/compile.h"
#include "py/frozenmod.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, 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); boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS);
flash_set_usb_writeable(true); 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 #endif
// TODO(tannewt): Re-add support for flashing boot error output. // TODO(tannewt): Re-add support for flashing boot error output.

View File

@ -256,7 +256,8 @@ STATIC int pyexec_friendly_repl_process_char(int c) {
} else if (ret == CHAR_CTRL_B) { } else if (ret == CHAR_CTRL_B) {
// reset friendly REPL // reset friendly REPL
mp_hal_stdout_tx_str("\r\n"); 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"); // mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n");
goto input_restart; goto input_restart;
} else if (ret == CHAR_CTRL_C) { } else if (ret == CHAR_CTRL_C) {
@ -395,7 +396,9 @@ int pyexec_friendly_repl(void) {
#endif #endif
friendly_repl_reset: 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"); // mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n");
// to test ctrl-C // to test ctrl-C

View File

@ -86,6 +86,7 @@ def make_version_header(filename):
#define MICROPY_VERSION_MINOR (%s) #define MICROPY_VERSION_MINOR (%s)
#define MICROPY_VERSION_MICRO (%s) #define MICROPY_VERSION_MICRO (%s)
#define MICROPY_VERSION_STRING "%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"), """ % (git_tag, git_hash, datetime.date.today().strftime("%Y-%m-%d"),
ver[0].replace('v', ''), ver[1], ver[2], version_string) ver[0].replace('v', ''), ver[1], ver[2], version_string)