GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fxe_system_time_set.c Lines: 9 9 100.0 %
Date: 2024-01-10 21:53:23 Branches: 6 6 100.0 %

Line Branch Exec Source
1
/**************************************************************************/
2
/*                                                                        */
3
/*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4
/*                                                                        */
5
/*       This software is licensed under the Microsoft Software License   */
6
/*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7
/*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8
/*       and in the root directory of this software.                      */
9
/*                                                                        */
10
/**************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** FileX Component                                                       */
17
/**                                                                       */
18
/**   System                                                              */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
#define FX_SOURCE_CODE
24
25
26
/* Include necessary system files.  */
27
28
#include "fx_api.h"
29
#include "fx_system.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _fxe_system_time_set                                PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    William E. Lamie, Microsoft Corporation                             */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the set the system time call.    */
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_INVALID_HOUR                       Supplied hour is invalid      */
55
/*    FX_INVALID_MINUTE                     Supplied minute is invalid    */
56
/*    FX_INVALID_SECOND                     Supplied second is invalid    */
57
/*    status                                Actual completion status      */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _fx_system_time_set                   Actual system time set call   */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    Application Code                                                    */
66
/*                                                                        */
67
/*  RELEASE HISTORY                                                       */
68
/*                                                                        */
69
/*    DATE              NAME                      DESCRIPTION             */
70
/*                                                                        */
71
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
72
/*  09-30-2020     William E. Lamie         Modified comment(s),          */
73
/*                                            resulting in version 6.1    */
74
/*                                                                        */
75
/**************************************************************************/
76
4
UINT  _fxe_system_time_set(UINT hour, UINT minute, UINT second)
77
{
78
79
UINT status;
80
81
82
    /* Check for invalid hour.  */
83
4
    if (hour > FX_MAXIMUM_HOUR)
84
    {
85
1
        return(FX_INVALID_HOUR);
86
    }
87
88
    /* Check for invalid minute.  */
89
3
    if (minute > FX_MAXIMUM_MINUTE)
90
    {
91
1
        return(FX_INVALID_MINUTE);
92
    }
93
94
    /* Check for invalid second.  */
95
2
    if (second > FX_MAXIMUM_SECOND)
96
    {
97
1
        return(FX_INVALID_SECOND);
98
    }
99
100
    /* Call the actual set system time service.  */
101
1
    status =  _fx_system_time_set(hour, minute, second);
102
103
    /* Return status.  */
104
1
    return(status);
105
}
106