RTC

Joel Sherrill joel.sherrill at OARcorp.com
Wed Apr 11 13:04:26 UTC 2001


"D.G.Somerton" wrote:
> 
> Hello,
> 
>   Has anybody managed to use the RTC functions?
>   I have my RTC code (dallas ds1286) in libchip.
>   I have defined
> #define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER

Did you configure it per the example in powerpc/dmv177/tod?

>   The linker map file shows the functions are there.
>   But the initialisation function
> rtems_device_driver
> rtc_initialize (rtems_device_major_number major, rtems_device_minor_number minor_arg, void *arg)
> 
>   Is never called.
> 
>   Looking at confdefs.h i see there is no entry in the device driver table for the RTC, even with the CONFIGURE flag defined.
>   What am I missing here?

The main thing is a few lines in confdefs.h that
appear to have disappeared:

$ cvs diff -u confdefs.h 
Index: confdefs.h
===================================================================
RCS file: /usr1/CVS/rtems/c/src/exec/sapi/include/confdefs.h,v
retrieving revision 1.51
diff -u -r1.51 confdefs.h
--- confdefs.h	2001/01/29 15:43:46	1.51
+++ confdefs.h	2001/04/11 13:20:18
@@ -269,6 +269,10 @@
 #include <timerdrv.h>
 #endif
 
+#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
+#include <rtc.h>
+#endif
+
 #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
 #include <rtems/devnull.h>
 #endif
@@ -282,6 +286,9 @@
 #endif
 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
   CLOCK_DRIVER_TABLE_ENTRY,
+#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
+  RTCL_DRIVER_TABLE_ENTRY,
 #endif
 #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
   DEVNULL_DRIVER_TABLE_ENTRY,


As best I can tell at first glance, there should be
a lib/include/rtc.h file similar in spirit to console.h
that provides a RTC_DRIVER_TABLE_ENTRY with just
an rtc_initialize.

Use the attached rtc.h and add it to lib/include.
Fix the Makefile.am/in.

I am not committing any of this.  Let me know how it
works.  

> Dave

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985
-------------- next part --------------
/*  rtc.h
 *
 *  This file describes the Real-Time Clock driver for all boards.
 *  This driver provides support for the standard RTEMS routines
 *  that set the tod based on an RTC.
 *
 *  COPYRIGHT (c) 1989-2001.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id$
 */

#ifndef _RTC_DRIVER_h
#define _RTC_DRIVER_h

#ifdef __cplusplus
extern "C" {
#endif

#define RTC_DRIVER_TABLE_ENTRY \
  { rtc_initialize, NULL, NULL, NULL, NULL, NULL }

rtems_device_driver rtc_initialize(
  rtems_device_major_number,
  rtems_device_minor_number,
  void *
);

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */


More information about the users mailing list