Changeset e827199 in rtems
- Timestamp:
- 10/12/14 20:38:01 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 5b6438a
- Parents:
- 9fab016
- git-author:
- Joel Sherrill <joel.sherrill@…> (10/12/14 20:38:01)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (10/13/14 15:33:34)
- Location:
- c/src/lib/libcpu/bfin/clock
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/bfin/clock/clock.c
r9fab016 re827199 1 1 /* RTEMS Clock Tick Driver for Blackfin. Uses Blackfin Core Timer. 2 * 2 */ 3 4 /* 3 5 * Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA 4 6 * written by Allan Hessenflow <allanh@kallisti.com> … … 26 28 void Clock_exit(void); 27 29 28 /*29 * Major and minor number.30 */31 32 rtems_device_major_number rtems_clock_major = ~0;33 rtems_device_minor_number rtems_clock_minor;34 35 30 static rtems_isr clockISR(rtems_vector_number vector) { 36 31 … … 50 45 } 51 46 52 53 47 /* 54 48 * Clock_exit … … 56 50 * This routine allows the clock driver to exit by masking the interrupt and 57 51 * disabling the clock's counter. 58 *59 * Input parameters: NONE60 *61 * Output parameters: NONE62 *63 * Return values: NONE64 *65 52 */ 66 67 void Clock_exit(void) { 68 53 void Clock_exit(void) 54 { 69 55 *(uint32_t volatile *) TCNTL = 0; 70 56 } … … 74 60 * 75 61 * This routine initializes the clock driver. 76 *77 * Input parameters:78 * major - clock device major number79 * minor - clock device minor number80 * parg - pointer to optional device driver arguments81 *82 * Output parameters: NONE83 *84 * Return values:85 * rtems_device_driver status code86 62 */ 87 88 rtems_device_driver Clock_initialize(rtems_device_major_number major, 89 rtems_device_minor_number minor, 90 void *pargp) { 91 63 rtems_device_driver Clock_initialize( 64 rtems_device_major_number major, 65 rtems_device_minor_number minor, 66 void *pargp 67 ) 68 { 92 69 Clock_driver_ticks = 0; 93 70 … … 101 78 102 79 atexit(Clock_exit); 103 /*104 * make major/minor avail to others such as shared memory driver105 */106 107 rtems_clock_major = major;108 rtems_clock_minor = minor;109 80 110 81 return RTEMS_SUCCESSFUL; -
c/src/lib/libcpu/bfin/clock/rtc.c
r9fab016 re827199 1 1 /* Real Time Clock Driver for Blackfin 2 * 2 */ 3 4 /* 3 5 * Copyright (c) 2006 by Atos Automacao Industrial Ltda. 4 6 * written by Alain Schaefer <alain.schaefer@easc.ch> … … 31 33 void Init_RTC(void) 32 34 { 33 *((uint16_t*)RTC_PREN) 35 *((uint16_t*)RTC_PREN) = RTC_PREN_PREN; /* Enable Prescaler */ 34 36 } 35 37 … … 37 39 * Read time from RTEMS' clock manager and set it to RTC 38 40 */ 39 40 41 void setRealTimeFromRTEMS (void) 41 42 { … … 52 53 * Read real time from RTC and set it to RTEMS' clock manager 53 54 */ 54 55 55 void setRealTimeToRTEMS (void) 56 56 { … … 61 61 } 62 62 63 64 65 63 /* 64 * Set the RTC time 65 */ 66 66 int setRealTime( 67 67 const rtems_time_of_day *tod … … 88 88 } 89 89 90 /* 91 * Get the time from the RTC. 92 */ 93 90 /* 91 * Get the time from the RTC. 92 */ 94 93 void getRealTime( 95 94 rtems_time_of_day *tod … … 135 134 * If the difference is greater than 1 day, this returns 9999. 136 135 */ 137 138 136 int checkRealTime (void) 139 137 {
Note: See TracChangeset
for help on using the changeset viewer.