reformat the coding style

using -RT_ERROR instead of RT_ERROR for the return value


git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2311 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz@gmail.com 2012-09-29 00:14:29 +00:00
parent 2aab960999
commit ec1f35670d
1 changed files with 174 additions and 173 deletions

View File

@ -74,7 +74,7 @@ rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day)
struct tm *p_tm;
struct tm tm_new;
rt_device_t device;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
/* get current time */
now = time(RT_NULL);
@ -99,12 +99,12 @@ rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day)
device = rt_device_find("rtc");
if (device == RT_NULL)
{
return RT_ERROR;
return -RT_ERROR;
}
/* update to RTC device. */
ret = rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIME, &now);
/* update to RTC device. */
return ret;
}
@ -122,7 +122,7 @@ rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second)
struct tm *p_tm;
struct tm tm_new;
rt_device_t device;
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
/* get current time */
now = time(RT_NULL);
@ -147,18 +147,19 @@ rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second)
device = rt_device_find("rtc");
if (device == RT_NULL)
{
return RT_ERROR;
return -RT_ERROR;
}
/* update to RTC device. */
ret = rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIME, &now);
/* update to RTC device. */
return ret;
}
#ifdef RT_USING_FINSH
#include <finsh.h>
#include <rtdevice.h>
void list_date(void)
{
time_t now;