forked from Imagelibrary/rtems
libcpu/bfin/clock: Fix warnings
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
/* RTEMS Clock Tick Driver for Blackfin. Uses Blackfin Core Timer.
|
/* RTEMS Clock Tick Driver for Blackfin. Uses Blackfin Core Timer.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
|
* Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
|
||||||
* written by Allan Hessenflow <allanh@kallisti.com>
|
* written by Allan Hessenflow <allanh@kallisti.com>
|
||||||
*
|
*
|
||||||
@@ -25,13 +27,6 @@ volatile uint32_t Clock_driver_ticks;
|
|||||||
|
|
||||||
void Clock_exit(void);
|
void Clock_exit(void);
|
||||||
|
|
||||||
/*
|
|
||||||
* Major and minor number.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_device_major_number rtems_clock_major = ~0;
|
|
||||||
rtems_device_minor_number rtems_clock_minor;
|
|
||||||
|
|
||||||
static rtems_isr clockISR(rtems_vector_number vector) {
|
static rtems_isr clockISR(rtems_vector_number vector) {
|
||||||
|
|
||||||
Clock_driver_ticks += 1;
|
Clock_driver_ticks += 1;
|
||||||
@@ -49,23 +44,14 @@ static rtems_isr clockISR(rtems_vector_number vector) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clock_exit
|
* Clock_exit
|
||||||
*
|
*
|
||||||
* This routine allows the clock driver to exit by masking the interrupt and
|
* This routine allows the clock driver to exit by masking the interrupt and
|
||||||
* disabling the clock's counter.
|
* disabling the clock's counter.
|
||||||
*
|
|
||||||
* Input parameters: NONE
|
|
||||||
*
|
|
||||||
* Output parameters: NONE
|
|
||||||
*
|
|
||||||
* Return values: NONE
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
void Clock_exit(void)
|
||||||
void Clock_exit(void) {
|
{
|
||||||
|
|
||||||
*(uint32_t volatile *) TCNTL = 0;
|
*(uint32_t volatile *) TCNTL = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,22 +59,13 @@ void Clock_exit(void) {
|
|||||||
* Clock_initialize
|
* Clock_initialize
|
||||||
*
|
*
|
||||||
* This routine initializes the clock driver.
|
* This routine initializes the clock driver.
|
||||||
*
|
|
||||||
* Input parameters:
|
|
||||||
* major - clock device major number
|
|
||||||
* minor - clock device minor number
|
|
||||||
* parg - pointer to optional device driver arguments
|
|
||||||
*
|
|
||||||
* Output parameters: NONE
|
|
||||||
*
|
|
||||||
* Return values:
|
|
||||||
* rtems_device_driver status code
|
|
||||||
*/
|
*/
|
||||||
|
rtems_device_driver Clock_initialize(
|
||||||
rtems_device_driver Clock_initialize(rtems_device_major_number major,
|
rtems_device_major_number major,
|
||||||
rtems_device_minor_number minor,
|
rtems_device_minor_number minor,
|
||||||
void *pargp) {
|
void *pargp
|
||||||
|
)
|
||||||
|
{
|
||||||
Clock_driver_ticks = 0;
|
Clock_driver_ticks = 0;
|
||||||
|
|
||||||
set_vector(clockISR, CEC_CORE_TIMER_VECTOR, 1);
|
set_vector(clockISR, CEC_CORE_TIMER_VECTOR, 1);
|
||||||
@@ -100,12 +77,6 @@ rtems_device_driver Clock_initialize(rtems_device_major_number major,
|
|||||||
*(uint32_t volatile *) TCNTL = TCNTL_TMPWR | TCNTL_TAUTORLD | TCNTL_TMREN;
|
*(uint32_t volatile *) TCNTL = TCNTL_TMPWR | TCNTL_TAUTORLD | TCNTL_TMREN;
|
||||||
|
|
||||||
atexit(Clock_exit);
|
atexit(Clock_exit);
|
||||||
/*
|
|
||||||
* make major/minor avail to others such as shared memory driver
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_clock_major = major;
|
|
||||||
rtems_clock_minor = minor;
|
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
/* Real Time Clock Driver for Blackfin
|
/* Real Time Clock Driver for Blackfin
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* Copyright (c) 2006 by Atos Automacao Industrial Ltda.
|
* Copyright (c) 2006 by Atos Automacao Industrial Ltda.
|
||||||
* written by Alain Schaefer <alain.schaefer@easc.ch>
|
* written by Alain Schaefer <alain.schaefer@easc.ch>
|
||||||
* and Antonio Giovanini <antonio@atos.com.br>
|
* and Antonio Giovanini <antonio@atos.com.br>
|
||||||
@@ -36,7 +38,6 @@ void Init_RTC(void)
|
|||||||
/*
|
/*
|
||||||
* Read time from RTEMS' clock manager and set it to RTC
|
* Read time from RTEMS' clock manager and set it to RTC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void setRealTimeFromRTEMS (void)
|
void setRealTimeFromRTEMS (void)
|
||||||
{
|
{
|
||||||
rtems_time_of_day time_buffer;
|
rtems_time_of_day time_buffer;
|
||||||
@@ -51,7 +52,6 @@ void setRealTimeFromRTEMS (void)
|
|||||||
/*
|
/*
|
||||||
* Read real time from RTC and set it to RTEMS' clock manager
|
* Read real time from RTC and set it to RTEMS' clock manager
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void setRealTimeToRTEMS (void)
|
void setRealTimeToRTEMS (void)
|
||||||
{
|
{
|
||||||
rtems_time_of_day time_buffer;
|
rtems_time_of_day time_buffer;
|
||||||
@@ -90,7 +90,6 @@ int setRealTime(
|
|||||||
/*
|
/*
|
||||||
* Get the time from the RTC.
|
* Get the time from the RTC.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void getRealTime(
|
void getRealTime(
|
||||||
rtems_time_of_day *tod
|
rtems_time_of_day *tod
|
||||||
)
|
)
|
||||||
@@ -134,7 +133,6 @@ void getRealTime(
|
|||||||
* Return the difference between RTC and RTEMS' clock manager time in minutes.
|
* Return the difference between RTC and RTEMS' clock manager time in minutes.
|
||||||
* If the difference is greater than 1 day, this returns 9999.
|
* If the difference is greater than 1 day, this returns 9999.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int checkRealTime (void)
|
int checkRealTime (void)
|
||||||
{
|
{
|
||||||
rtems_time_of_day rtems_tod;
|
rtems_time_of_day rtems_tod;
|
||||||
|
|||||||
Reference in New Issue
Block a user