aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-01 16:20:29 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-01 16:20:29 +0000
commitd74271f00d9e8ad97b4bbd25eb674f5c1ae1fa4c (patch)
tree43eb87ed6f557b38ab3658d83ad036fe858f63e0 /os
parent220e3a4c5c70619bfccc3a2da27f6363a31ea488 (diff)
downloadChibiOS-d74271f00d9e8ad97b4bbd25eb674f5c1ae1fa4c.tar.gz
ChibiOS-d74271f00d9e8ad97b4bbd25eb674f5c1ae1fa4c.tar.bz2
ChibiOS-d74271f00d9e8ad97b4bbd25eb674f5c1ae1fa4c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7445 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/include/rtc.h3
-rw-r--r--os/hal/src/rtc.c19
2 files changed, 12 insertions, 10 deletions
diff --git a/os/hal/include/rtc.h b/os/hal/include/rtc.h
index a0f02b502..626fd9f90 100644
--- a/os/hal/include/rtc.h
+++ b/os/hal/include/rtc.h
@@ -128,7 +128,8 @@ extern "C" {
void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
struct tm *timp);
void rtcConvertStructTmToDateTime(const struct tm *timp,
- uint32_t tv_msec, RTCDateTime *timespec);
+ uint32_t tv_msec,
+ RTCDateTime *timespec);
uint32_t rtcConvertDateTimeToFAT(const RTCDateTime *timespec);
#ifdef __cplusplus
}
diff --git a/os/hal/src/rtc.c b/os/hal/src/rtc.c
index 63a9a8b3e..b6d212e64 100644
--- a/os/hal/src/rtc.c
+++ b/os/hal/src/rtc.c
@@ -46,6 +46,13 @@
/* Driver local variables and types. */
/*===========================================================================*/
+/*
+ * Lookup table with months' length
+ */
+static const uint8_t month_len[12] = {
+ 31, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+};
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
@@ -194,7 +201,7 @@ void rtcSetCallback(RTCDriver *rtcp, rtccb_t callback) {
* @api
*/
void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
- struct tm *timp) {
+ struct tm *timp) {
uint32_t tmp;
timp->tm_year = timespec->year + (1980 - 1900);
@@ -220,7 +227,8 @@ void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
* @api
*/
void rtcConvertStructTmToDateTime(const struct tm *timp,
- uint32_t tv_msec, RTCDateTime *timespec) {
+ uint32_t tv_msec,
+ RTCDateTime *timespec) {
timespec->year = timp->tm_year - (1980 - 1900);
timespec->month = timp->tm_mon + 1;
@@ -234,13 +242,6 @@ void rtcConvertStructTmToDateTime(const struct tm *timp,
(timp->tm_hour * 3600 + timp->tm_min * 60 + timp->tm_sec) * 1000;
}
-/*
- * Lookup table with months' length
- */
-static const uint8_t month_len[12] = {
- 31, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
/**
* @brief Get current time in format suitable for usage in FAT file system.
* @note The information about day of week and DST is lost in DOS