GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: core/src/ux_utility_short_get.c Lines: 4 4 100.0 %
Date: 2026-03-06 18:57:10 Branches: 0 0 - %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** USBX Component                                                        */
17
/**                                                                       */
18
/**   Utility                                                             */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
24
/* Include necessary system files.  */
25
26
#define UX_SOURCE_CODE
27
28
#include "ux_api.h"
29
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _ux_utility_short_get                               PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Chaoqiong Xiao, Microsoft Corporation                               */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function reads a 16-bit value.                                 */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    address                               Source address                */
48
/*                                                                        */
49
/*  OUTPUT                                                                */
50
/*                                                                        */
51
/*    16-bit value                                                        */
52
/*                                                                        */
53
/*  CALLS                                                                 */
54
/*                                                                        */
55
/*    None                                                                */
56
/*                                                                        */
57
/*  CALLED BY                                                             */
58
/*                                                                        */
59
/*    USBX Components                                                     */
60
/*                                                                        */
61
/**************************************************************************/
62
65842
ULONG  _ux_utility_short_get(UCHAR * address)
63
{
64
65
USHORT   value;
66
67
68
    /* In order to make this function endian agnostic and memory alignment
69
       independent, we read a byte at a time from the address.  */
70
65842
    value =  (USHORT) *address++;
71
65842
    value |=  (USHORT)(*address << 8);
72
73
    /* Return to caller.  */
74
65842
    return((ULONG) value);
75
}
76