xSysDate结构体是在main.c中定义的全局变量
代码1,此处是可以正常将xSysDate.Year的值读取出来的
这部分代码在main.c文件中
uint32_t counter_time=0;
counter_time=HAL_RTC_ReadTimeCounter(hrtc);
TimeUnixToBeiJing(counter_time,&xSysTime,&xSysDate);
counter_time=xSysDate.Year;
counter_time=0;
代码2,此处读取xSysDate.Year的值却是错误的这部分代码是在led.c文件中
uint16_t testdata = 123;
testdata=xSysDate.Year;
ucRetInt=testdata;
keil版本信息
IDE-Version:
μVision V5.25.2.0
Copyright © 2018 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information:
w w
we
LIC=0VRKP-MNLN6-E01N4-F065U-VUYXB-2Q4EX
Tool Ver