Motion_EC_Stm32_archived/App/Src/th_info.c

49 lines
1.4 KiB
C
Raw Permalink Normal View History

2021-03-14 23:24:59 +08:00
/*
* @Description:
* @Date: 2021-03-09 18:19:26
* @LastEditors: CK.Zh
* @LastEditTime: 2021-03-10 15:07:01
* @FilePath: \NaviKit_EC_stm32\App\Src\th_demo.c
*/
#define LOG_TAG "TH-Info"
#include <th_info.h>
#include "main.h"
#include "cmsis_os2.h"
2021-03-14 23:24:59 +08:00
const osThreadAttr_t InfoOutputTask_attributes = {
.name = "InfoOutputTask",
.priority = (osPriority_t) osPriorityLow1,
2021-03-14 23:24:59 +08:00
.stack_size = 256 * 4
};
2021-03-15 19:26:10 +08:00
void InfoOutputTask(void *argument){
osVersion_t osVersion;
char id_buf[20];
unsigned char id_size=20;
2021-03-14 23:24:59 +08:00
log_d("Start Info Output Task");
log_i("Copyright (c) Powered by www.autolabor.com.cn");
#ifdef DEBUG
log_i("EC Firmware: %s[DEBUG], build: %s, %s",APP_VERSION,__DATE__ ,__TIME__);
#else
log_i("EC Firmware: %s[RELEASE], build: %s, %s",APP_VERSION,__DATE__ ,__TIME__);
#endif
log_i("HAL Version: 0x%X ", HAL_GetHalVersion());
log_i("Revision ID: 0x%X ", HAL_GetREVID());
log_i("Device ID : 0x%X ", HAL_GetDEVID());
log_i("Chip UID : 0x%X%X%X ", HAL_GetUIDw0(),HAL_GetUIDw1(),HAL_GetUIDw2());
if(osOK == osKernelGetInfo(&osVersion,id_buf,id_size)){
log_i("OS Kernel Version : %u ", osVersion.kernel);
log_i("OS Kernel ID : %s ",id_buf);
2021-03-14 23:24:59 +08:00
}
log_i("OS Kernel Tick Frequency: %d Hz",osKernelGetTickFreq());
log_i("System Timer Frequency : %d Hz",osKernelGetSysTimerFreq());
log_i("Log Library Version : V%s",ELOG_SW_VERSION);
osThreadExit();
2021-03-14 23:24:59 +08:00
}