Skip to content

Commit f2ad1a3

Browse files
dhalberttannewt
authored andcommitted
Write version info to boot_out.txt.
1 parent 43650b6 commit f2ad1a3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

atmel-samd/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <stdint.h>
2828
#include <string.h>
2929

30+
#include "genhdr/mpversion.h"
3031
#include "py/nlr.h"
3132
#include "py/compile.h"
3233
#include "py/frozenmod.h"
@@ -700,6 +701,9 @@ int main(void) {
700701
f_open(&((fs_user_mount_t *) MP_STATE_VM(vfs_mount_table)->obj)->fatfs,
701702
boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS);
702703
flash_set_usb_writeable(true);
704+
// Write version info to boot_out.txt.
705+
mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO);
706+
mp_hal_stdout_tx_str("\r\n");
703707
#endif
704708

705709
// TODO(tannewt): Re-add support for flashing boot error output.

lib/utils/pyexec.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ STATIC int pyexec_friendly_repl_process_char(int c) {
256256
} else if (ret == CHAR_CTRL_B) {
257257
// reset friendly REPL
258258
mp_hal_stdout_tx_str("\r\n");
259-
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");
259+
mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO);
260+
mp_hal_stdout_tx_str("\r\n");
260261
// mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n");
261262
goto input_restart;
262263
} else if (ret == CHAR_CTRL_C) {
@@ -395,7 +396,9 @@ int pyexec_friendly_repl(void) {
395396
#endif
396397

397398
friendly_repl_reset:
398-
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");
399+
mp_hal_stdout_tx_str("\r\n");
400+
mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO);
401+
mp_hal_stdout_tx_str("\r\n");
399402
// mp_hal_stdout_tx_str("Type \"help()\" for more information.\r\n");
400403

401404
// to test ctrl-C

py/makeversionhdr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def make_version_header(filename):
8686
#define MICROPY_VERSION_MINOR (%s)
8787
#define MICROPY_VERSION_MICRO (%s)
8888
#define MICROPY_VERSION_STRING "%s"
89+
#define MICROPY_FULL_VERSION_INFO ("Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME)
8990
""" % (git_tag, git_hash, datetime.date.today().strftime("%Y-%m-%d"),
9091
ver[0].replace('v', ''), ver[1], ver[2], version_string)
9192

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy