OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [rtems/] [src/] [clockset.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  Clock Manager
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 *  clockset.c,v 1.2 1999/11/17 17:50:27 joel Exp
12
 */
13
 
14
#include <rtems/system.h>
15
#include <rtems/rtems/status.h>
16
#include <rtems/rtems/clock.h>
17
#include <rtems/score/isr.h>
18
#include <rtems/score/thread.h>
19
#include <rtems/score/tod.h>
20
#include <rtems/score/watchdog.h>
21
 
22
/*PAGE
23
 *
24
 *  rtems_clock_set
25
 *
26
 *  This directive sets the date and time for this node.
27
 *
28
 *  Input parameters:
29
 *    time_buffer - pointer to the time and date structure
30
 *
31
 *  Output parameters:
32
 *    RTEMS_SUCCESSFUL - if successful
33
 *    error code        - if unsuccessful
34
 */
35
 
36
rtems_status_code rtems_clock_set(
37
  rtems_time_of_day *time_buffer
38
)
39
{
40
  rtems_interval     seconds;
41
 
42
  if ( _TOD_Validate( time_buffer ) ) {
43
    seconds = _TOD_To_seconds( time_buffer );
44
    _Thread_Disable_dispatch();
45
      _TOD_Set( time_buffer, seconds );
46
    _Thread_Enable_dispatch();
47
    return RTEMS_SUCCESSFUL;
48
  }
49
  return RTEMS_INVALID_CLOCK;
50
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.