From 9d36cbeff99a5522e0e9c5ba3911a196a124626e Mon Sep 17 00:00:00 2001 From: mculover666 <2412828003@qq.com> Date: Thu, 1 Apr 2021 15:53:18 +0800 Subject: [PATCH] add support for the version info --- .../TencentOS_tiny_EVB_MX_Plus/BSP/Src/main.c | 2 +- kernel/core/include/tos_k.h | 1 + kernel/core/include/tos_version.h | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 kernel/core/include/tos_version.h diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/main.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/main.c index 646bdf65..9cb78c24 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/main.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/main.c @@ -17,7 +17,7 @@ __weak void application_entry(void *arg) int main(void) { board_init(); - printf("Welcome to TencentOS tiny\r\n"); + printf("Welcome to TencentOS tiny(%s)\r\n", TOS_VERSION); osKernelInitialize(); // TOS Tiny kernel initialize osThreadCreate(osThread(application_entry), NULL); // Create TOS Tiny task osKernelStart(); // Start TOS Tiny diff --git a/kernel/core/include/tos_k.h b/kernel/core/include/tos_k.h index 0705b449..a9584ee6 100644 --- a/kernel/core/include/tos_k.h +++ b/kernel/core/include/tos_k.h @@ -67,6 +67,7 @@ #endif #endif #include +#include #endif /* _TOS_K_H_ */ diff --git a/kernel/core/include/tos_version.h b/kernel/core/include/tos_version.h new file mode 100644 index 00000000..31feeb01 --- /dev/null +++ b/kernel/core/include/tos_version.h @@ -0,0 +1,32 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_VERSION_H_ +#define _TOS_VERSION_H_ + +// the format of the tencentos-tiny version is major.minor.patch +// major is updated for major changes that will need user code changes +// minor is updated for minor changes/bug fixes that may need user code changes +// patch is updated for patch changes/bug fixes that should not need user code changes + +#define TOS_VERSION_MAJOR 0x02 +#define TOS_VERSION_MINOR 0x02 +#define TOS_VERSION_PATCH 0x00 +#define TOS_VERSION "2.2.0" + +#endif /* _TOS_VERSION_H_ */ +