time_t time_now =0;/* optimization: find rtc device only first. */if(device == RT_NULL) { device = rt_device_find("rtc"); }/* read timestamp from RTC device. */if(device != RT_NULL) {if(rt_device_open(device,0) == RT_EOK) { rt_device_control(device, RT_DEVICE_CTRL_R...
rt_alarm_update(&rtc_device.device, 1); endif LOG_D("RTC: set rtc_time %x\n", *(rt_uint32_t *)args); break; ifdef RT_USING_ALARM case RT_DEVICE_CTRL_RTC_GET_ALARM: args = &rtc_device.wkalarm; break; case RT_DEVICE_CTRL_RTC_SET_ALARM: p_wkalarm = (struct rt_rtc_wkala...
在 RT-Thread 源码提供的drv_rtc.c文件是缺少 RT_DEVICE_CTRL_RTC_SET_ALARM 和 RT_DEVICE_CTRL_RTC_GET_ALARM 的实现,参考论坛中的@Mii的文章对其进行修改,主要添加了函数 set_rtc_alarm_stamp() 和 get_rtc_alarm_stamp(),修改的详细步骤参考上面的文章链接,修改后的 drv_rtc.c 如下,添加的内容均有 2...
rt_alarm_update(&rtc_device.device, 1); #endif LOG_D("RTC: set rtc_time %x\n", *(rt_uint32_t *)args); break; #ifdef RT_USING_ALARM case RT_DEVICE_CTRL_RTC_GET_ALARM: args = &rtc_device.wkalarm; break; case RT_DEVICE_CTRL_RTC_SET_ALARM: p_wkalarm = (struct rt_rtc_wka...
rt_device_control(rt_device_find("rtc"), RT_DEVICE_CTRL_RTC_SET_TIME, &cur_time); 问题分析函数localtime调用流程。graph LR A[localtime] --> B[localtime_r] B --> C[gmtime_r] 其中它返回的地址是localtime函数中声明的静态变量static struct tm tmp。其中cur_tm指针指向struct tm tmp的地址...
#include <rtdevice.h> #include <sys/time.h> #ifdef BSP_USING_ONCHIP_RTC struct rt_rtc_...
remove _spi_bus_device_control Fix rt_qspi_send symbol extension BUG fix issue report #6008 rt_spi_sendrecv8 driver/rtc Adjust ops function input parameters Optimize execution efficiency Add get/set timestamp function Enhanced date command fix the parameter check about "time" use gmtime_r to...
remove _spi_bus_device_control Fix rt_qspi_send symbol extension BUG fix issue report #6008 rt_spi_sendrecv8 driver/rtc Adjust ops function input parameters Optimize execution efficiency Add get/set timestamp function Enhanced date command fix the parameter check about "time" use gmtime_r to...
GET_INT /home/csc/Project/rt-thread/components/libc/compilers/common/ctime.c: Infunction'clock_settime':/home/csc/Project/rt-thread/components/libc/compilers/common/ctime.c:731:33: error:'RT_DEVICE_CTRL_RTC_SET_TIMESPEC'undeclared (first useinthis function);did you mean'RT_DEVICE_CTRL_SET...
remove _spi_bus_device_control Fix rt_qspi_send symbol extension BUG fix issue report #6008 rt_spi_sendrecv8 driver/rtc Adjust ops function input parameters Optimize execution efficiency Add get/set timestamp function Enhanced date command fix the parameter check about "time" use gmtime_r to...