Skip to content

Commit b2d6e2c

Browse files
lygstateRbb666
authored andcommitted
Use time_t for RT_DEVICE_CTRL_RTC_GET_TIME RT_DEVICE_CTRL_RTC_SET_TIME
1 parent 5ae232b commit b2d6e2c

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

bsp/bouffalo_lab/libraries/rt_drivers/drv_rtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static rt_err_t _rtc_control(rt_device_t dev, int cmd, void *args)
4747
switch (cmd)
4848
{
4949
case RT_DEVICE_CTRL_RTC_GET_TIME:
50-
*(rt_uint32_t *)args = rtc_time + BFLB_RTC_TIME2SEC(bflb_rtc_get_time(bflb_rtc));
50+
*(time_t *)args = rtc_time + BFLB_RTC_TIME2SEC(bflb_rtc_get_time(bflb_rtc));
5151
break;
5252

5353
case RT_DEVICE_CTRL_RTC_SET_TIME:
54-
rtc_time = *(rt_uint32_t *)args;
54+
rtc_time = *(time_t *)args;
5555
bflb_rtc_set_time(bflb_rtc, 0);
5656
break;
5757
}

bsp/efm32/drv_rtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ static rt_err_t rt_rtc_control(rt_device_t dev, int cmd, void *args)
8585
switch (cmd)
8686
{
8787
case RT_DEVICE_CTRL_RTC_GET_TIME:
88-
*(rt_uint32_t *)args = rtc_time + RTC_CounterGet();
88+
*(time_t *)args = rtc_time + RTC_CounterGet();
8989
rtc_debug("RTC: get rtc_time %x + %x\n", rtc_time, RTC_CounterGet());
9090
break;
9191

9292
case RT_DEVICE_CTRL_RTC_SET_TIME:
9393
{
94-
rtc_time = *(rt_uint32_t *)args;
94+
rtc_time = *(time_t *)args;
9595
rtc_debug("RTC: set rtc_time %x\n", rtc_time);
9696

9797
/* Reset counter */

bsp/loongson/ls1cdev/drivers/drv_rtc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ static rt_err_t rt_rtc_control(rt_device_t dev, int cmd, void *args)
110110
{
111111
case RT_DEVICE_CTRL_RTC_GET_TIME:
112112

113-
*(rt_uint32_t *)args = get_timestamp();
114-
rtc_debug("RTC: get rtc_time %x\n", *(rt_uint32_t *)args);
113+
*(time_t *)args = get_timestamp();
114+
rtc_debug("RTC: get rtc_time %x\n", *(time_t *)args);
115115
break;
116116

117117
case RT_DEVICE_CTRL_RTC_SET_TIME:
118118
{
119-
result = set_timestamp(*(rt_uint32_t *)args);
120-
rtc_debug("RTC: set rtc_time %x\n", *(rt_uint32_t *)args);
119+
result = set_timestamp(*(time_t *)args);
120+
rtc_debug("RTC: set rtc_time %x\n", *(time_t *)args);
121121
}
122122
break;
123123
}

bsp/maxim/libraries/HAL_Drivers/drv_rtc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ static rt_err_t rt_rtc_control(rt_device_t dev, int cmd, void *args)
6464
switch (cmd)
6565
{
6666
case RT_DEVICE_CTRL_RTC_GET_TIME:
67-
*(rt_uint32_t *)args = get_rtc_timestamp();
68-
LOG_D("RTC: get rtc_time %x\n", *(rt_uint32_t *)args);
67+
*(time_t *)args = get_rtc_timestamp();
68+
LOG_D("RTC: get rtc_time %x\n", *(time_t *)args);
6969
break;
7070

7171
case RT_DEVICE_CTRL_RTC_SET_TIME:
72-
if (set_rtc_time_stamp(*(rt_uint32_t *)args))
72+
if (set_rtc_time_stamp(*(time_t *)args))
7373
{
7474
result = -RT_ERROR;
7575
}
76-
LOG_D("RTC: set rtc_time %x\n", *(rt_uint32_t *)args);
76+
LOG_D("RTC: set rtc_time %x\n", *(time_t *)args);
7777
break;
7878
}
7979

bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static rt_err_t gd32_rtc_control(rt_device_t dev, int cmd, void *args)
116116
{
117117
case RT_DEVICE_CTRL_RTC_GET_TIME:
118118
{
119-
*(uint32_t *)args = get_timestamp();
119+
*(time_t *)args = get_timestamp();
120120
}
121121
break;
122122

bsp/nxp/imx/imxrt/libraries/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static rt_err_t imxrt_hp_rtc_control(rt_device_t dev, int cmd, void *args)
121121
{
122122
case RT_DEVICE_CTRL_RTC_GET_TIME:
123123
{
124-
*(uint32_t *)args = imxrt_hp_get_timestamp();
124+
*(time_t *)args = imxrt_hp_get_timestamp();
125125
}
126126
break;
127127

bsp/qemu-virt64-aarch64/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static rt_err_t pl031_rtc_control(rt_device_t dev, int cmd, void *args)
6767
switch (cmd)
6868
{
6969
case RT_DEVICE_CTRL_RTC_GET_TIME:
70-
*(rt_uint32_t *)args = pl031_read32(RTC_DR);
70+
*(time_t *)args = pl031_read32(RTC_DR);
7171
break;
7272
case RT_DEVICE_CTRL_RTC_SET_TIME:
7373
pl031_write32(RTC_LR, *(time_t *)args);

bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args)
238238
switch (cmd)
239239
{
240240
case RT_DEVICE_CTRL_RTC_GET_TIME:
241-
*(rt_uint32_t *)args = raspi_get_timestamp();
241+
*(time_t *)args = raspi_get_timestamp();
242242
break;
243243
case RT_DEVICE_CTRL_RTC_SET_TIME:
244244
raspi_set_timestamp(*(time_t *)args);

bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args)
8282
switch (cmd)
8383
{
8484
case RT_DEVICE_CTRL_RTC_GET_TIME:
85-
*(rt_uint32_t *)args = raspi_get_timestamp();
85+
*(time_t *)args = raspi_get_timestamp();
8686
break;
8787
case RT_DEVICE_CTRL_RTC_SET_TIME:
8888
raspi_set_timestamp(*(time_t *)args);

bsp/w60x/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static rt_err_t wm_rtc_control(rt_device_t dev, int cmd, void *args)
139139
switch (cmd)
140140
{
141141
case RT_DEVICE_CTRL_RTC_GET_TIME:
142-
*(rt_uint32_t *)args = wm_get_timestamp();
142+
*(time_t *)args = wm_get_timestamp();
143143
break;
144144
case RT_DEVICE_CTRL_RTC_SET_TIME:
145145
wm_set_timestamp(*(time_t *)args);

0 commit comments

Comments
 (0)