Commit d460a307 authored by Daniel Campora's avatar Daniel Campora
Browse files

cc3200: Add specific version file for the CC3200 port.

Current version has been numbered as 0.9.0 since Timers/PWM support
is still missing.
parent 3f42f326
......@@ -25,9 +25,12 @@
* THE SOFTWARE.
*/
#include "version.h"
#define LAUNCHXL
#define MICROPY_HW_BOARD_NAME "LaunchPad"
#define BOARD_NAME "LaunchPad "
#define MICROPY_HW_BOARD_NAME VERSION_E(BOARD_NAME, VERSION_NUMBER)
#define MICROPY_HW_MCU_NAME "CC3200"
#define MICROPY_HW_HAS_SDCARD (0)
......
......@@ -25,9 +25,12 @@
* THE SOFTWARE.
*/
#define LAUNCHXL
#include "version.h"
#define MICROPY_HW_BOARD_NAME "WiPy-SD"
#define WIPY-SD
#define BOARD_NAME "WiPy-SD "
#define MICROPY_HW_BOARD_NAME VERSION_E(BOARD_NAME, VERSION_NUMBER)
#define MICROPY_HW_MCU_NAME "CC3200"
#define MICROPY_HW_HAS_SDCARD (1)
......
......@@ -25,9 +25,12 @@
* THE SOFTWARE.
*/
#define LAUNCHXL
#include "version.h"
#define MICROPY_HW_BOARD_NAME "WiPy"
#define WIPY
#define BOARD_NAME "WiPy "
#define MICROPY_HW_BOARD_NAME VERSION_E(BOARD_NAME, VERSION_NUMBER)
#define MICROPY_HW_MCU_NAME "CC3200"
#define MICROPY_HW_HAS_SDCARD (0)
......
......@@ -66,6 +66,7 @@
#include "utils.h"
#include "gccollect.h"
#include "mperror.h"
#include "genhdr/py-version.h"
#ifdef DEBUG
......@@ -233,6 +234,15 @@ STATIC mp_obj_t pyb_repl_uart(uint n_args, const mp_obj_t *args) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_repl_uart_obj, 0, 1, pyb_repl_uart);
/// \function version()
/// Prints the software version (MicroPython + Port)
STATIC mp_obj_t pyb_version(void) {
char version[128];
snprintf(version, sizeof(version), "Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);
return mp_obj_new_str(version, strlen(version), false);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_version_obj, pyb_version);
MP_DECLARE_CONST_FUN_OBJ(pyb_main_obj); // defined in main.c
STATIC const mp_map_elem_t pyb_module_globals_table[] = {
......@@ -257,6 +267,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_elapsed_micros), (mp_obj_t)&pyb_elapsed_micros_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_delay), (mp_obj_t)&pyb_delay_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_udelay), (mp_obj_t)&pyb_udelay_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_version), (mp_obj_t)&pyb_version_obj },
#if MICROPY_HW_ENABLE_RNG
{ MP_OBJ_NEW_QSTR(MP_QSTR_rng), (mp_obj_t)&pyb_rng_get_obj },
......
......@@ -241,7 +241,7 @@ soft_reset_exit:
// soft reset
pybsleep_signal_soft_reset();
printf("WiPy: soft reset\n");
printf("PYB: soft reboot\n");
sflash_disk_flush();
......
......@@ -29,6 +29,7 @@ Q(micros)
Q(elapsed_millis)
Q(elapsed_micros)
Q(udelay)
Q(version)
Q(flush)
Q(FileIO)
Q(mkdisk)
......
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Daniel Campora
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef VERSION_H_
#define VERSION_H_
#define VERSION_NUMBER v0.9.0
#define VERSION_PASTE(name, number) name # number
#define VERSION_E(name, number) VERSION_PASTE(name, number)
#endif /* VERSION_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment