summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/bfin/clock
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2009-11-30 05:09:41 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2009-11-30 05:09:41 +0000
commit359e5374164ccb2a66833354b412a859c144ea2f (patch)
tree6f065d7d6247bc255f43ddb0152fc26c50bd4f87 /c/src/lib/libcpu/bfin/clock
parentWhitespace removal. (diff)
downloadrtems-359e5374164ccb2a66833354b412a859c144ea2f.tar.bz2
Whitespace removal.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libcpu/bfin/clock/clock.c4
-rw-r--r--c/src/lib/libcpu/bfin/clock/rtc.c32
-rw-r--r--c/src/lib/libcpu/bfin/clock/tod.h4
3 files changed, 20 insertions, 20 deletions
diff --git a/c/src/lib/libcpu/bfin/clock/clock.c b/c/src/lib/libcpu/bfin/clock/clock.c
index 6ccab33e81..17df3246b1 100644
--- a/c/src/lib/libcpu/bfin/clock/clock.c
+++ b/c/src/lib/libcpu/bfin/clock/clock.c
@@ -1,5 +1,5 @@
/* RTEMS Clock Tick Driver for Blackfin. Uses Blackfin Core Timer.
- *
+ *
* Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
* written by Allan Hessenflow <allanh@kallisti.com>
*
@@ -9,7 +9,7 @@
*
* $Id$
*/
-
+
#include <rtems.h>
#include <stdlib.h>
diff --git a/c/src/lib/libcpu/bfin/clock/rtc.c b/c/src/lib/libcpu/bfin/clock/rtc.c
index 5120a5efae..07ec729532 100644
--- a/c/src/lib/libcpu/bfin/clock/rtc.c
+++ b/c/src/lib/libcpu/bfin/clock/rtc.c
@@ -10,7 +10,7 @@
*
* $Id$
*/
-
+
#include <rtems.h>
#include "tod.h"
@@ -21,7 +21,7 @@
/* The following are inside RTEMS -- we are violating visibility!!!
* Perhaps an API could be defined to get days since 1 Jan.
- */
+ */
extern const uint16_t _TOD_Days_to_date[2][13];
/*
@@ -42,8 +42,8 @@ void setRealTimeFromRTEMS (void)
{
rtems_time_of_day time_buffer;
rtems_status_code status;
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time_buffer );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time_buffer );
if (status == RTEMS_SUCCESSFUL){
setRealTime(&time_buffer);
}
@@ -56,9 +56,9 @@ void setRealTimeFromRTEMS (void)
void setRealTimeToRTEMS (void)
{
rtems_time_of_day time_buffer;
-
- getRealTime(&time_buffer);
- rtems_clock_set( &time_buffer );
+
+ getRealTime(&time_buffer);
+ rtems_clock_set( &time_buffer );
}
/*
@@ -70,16 +70,16 @@ int setRealTime(
{
uint32_t days;
rtems_time_of_day tod_temp;
-
+
tod_temp = *tod;
-
+
days = (tod_temp.year - TOD_BASE_YEAR) * 365 + \
_TOD_Days_to_date[0][tod_temp.month] + tod_temp.day - 1;
if (tod_temp.month < 3)
days += Leap_years_until_now (tod_temp.year - 1);
else
days += Leap_years_until_now (tod_temp.year);
-
+
*((uint32_t volatile *)RTC_STAT) = (days << RTC_STAT_DAYS_SHIFT)|
(tod_temp.hour << RTC_STAT_HOURS_SHIFT)|
(tod_temp.minute << RTC_STAT_MINUTES_SHIFT)|
@@ -99,21 +99,21 @@ void getRealTime(
uint32_t days, rtc_reg;
rtems_time_of_day tod_temp = { 0, 0, 0 };
int n, Leap_year;
-
- rtc_reg = *((uint32_t volatile *)RTC_STAT);
-
+
+ rtc_reg = *((uint32_t volatile *)RTC_STAT);
+
days = (rtc_reg >> RTC_STAT_DAYS_SHIFT) + 1;
-
+
/* finding year */
tod_temp.year = days/365 + TOD_BASE_YEAR;
if (days%365 > Leap_years_until_now (tod_temp.year - 1)) {
days = (days%365) - Leap_years_until_now (tod_temp.year - 1);
- } else {
+ } else {
tod_temp.year--;
days = (days%365) + 365 - Leap_years_until_now (tod_temp.year - 1);
}
- /* finding month and day */
+ /* finding month and day */
Leap_year = (((!(tod_temp.year%4)) && (tod_temp.year%100)) ||
(!(tod_temp.year%400)))?1:0;
for (n=1; n<=12; n++) {
diff --git a/c/src/lib/libcpu/bfin/clock/tod.h b/c/src/lib/libcpu/bfin/clock/tod.h
index 84e0d15383..6c4f8b39ce 100644
--- a/c/src/lib/libcpu/bfin/clock/tod.h
+++ b/c/src/lib/libcpu/bfin/clock/tod.h
@@ -1,5 +1,5 @@
/* tod.h
- *
+ *
* Real Time Clock definitions for eZKit533.
*
* Copyright (c) 2006 by Atos Automacao Industrial Ltda.
@@ -11,7 +11,7 @@
* http://www.rtems.com/license/LICENSE.
*
* $Id$
- */
+ */
#ifndef TOD_H