source: rtems/cpukit/rtems/src/clockset.c @ fed6210d

4.104.114.84.95
Last change on this file since fed6210d was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
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 *  $Id$
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
36rtems_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}
Note: See TracBrowser for help on using the repository browser.