GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_system_time_set.c Lines: 4 4 100.0 %
Date: 2024-03-11 05:15:45 Branches: 0 0 - %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** FileX Component                                                       */
16
/**                                                                       */
17
/**   System                                                              */
18
/**                                                                       */
19
/**************************************************************************/
20
/**************************************************************************/
21
22
#define FX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "fx_api.h"
28
#include "fx_system.h"
29
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _fx_system_time_set                                 PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    William E. Lamie, Microsoft Corporation                             */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function set the system time to the value specified by the     */
44
/*    caller.                                                             */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    hour                                  Hour (0-23)                   */
49
/*    minute                                Minute (0-59)                 */
50
/*    second                                Second (0-59)                 */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    FX_SUCCESS                                                          */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/*  RELEASE HISTORY                                                       */
65
/*                                                                        */
66
/*    DATE              NAME                      DESCRIPTION             */
67
/*                                                                        */
68
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
69
/*  09-30-2020     William E. Lamie         Modified comment(s),          */
70
/*                                            resulting in version 6.1    */
71
/*                                                                        */
72
/**************************************************************************/
73
1
UINT  _fx_system_time_set(UINT hour, UINT minute, UINT second)
74
{
75
76
77
    /* If trace is enabled, insert this event into the trace buffer.  */
78
    FX_TRACE_IN_LINE_INSERT(FX_TRACE_SYSTEM_TIME_SET, hour, minute, second, 0, FX_TRACE_INTERNAL_EVENTS, 0, 0)
79
80
    /* Set the new system time.  */
81
1
    _fx_system_time  =  (hour << FX_HOUR_SHIFT) |
82
1
        (minute << FX_MINUTE_SHIFT) | (second / 2);
83
84
    /* Return successful status.  */
85
1
    return(FX_SUCCESS);
86
}
87