GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_system_timer_stop.c Lines: 18 18 100.0 %
Date: 2026-03-06 19:21:09 Branches: 18 18 100.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
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   System Management (System)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_system_timer_stop                              PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function checks for errors in system timer stop call.          */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    owner                                 Pointer to widget control     */
50
/*                                            block                       */
51
/*    timer_id                              ID of timer                   */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    status                                Completion status             */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    _gx_system_timer_stop                 Actual system timer stop call */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    GUIX Application                                                    */
64
/*                                                                        */
65
/**************************************************************************/
66
18
UINT _gxe_system_timer_stop(GX_WIDGET *owner, UINT timer_id)
67
{
68
UINT      status;
69
GX_TIMER *next;
70
18
GX_BOOL   id_flag = GX_FALSE;
71
72
    /* Check for invalid caller.  */
73

18
    GX_INIT_AND_THREADS_CALLER_CHECKING
74
75
    /* Check for timer ID not found.  */
76
77
16
    if (timer_id)
78
    {
79
8
        next = _gx_system_active_timer_list;
80
9
        while (next)
81
        {
82
6
            if (next -> gx_timer_id == timer_id)
83
            {
84
5
                id_flag = GX_TRUE;
85
5
                break;
86
            }
87
1
            next = next -> gx_timer_next;
88
        }
89
8
        if (id_flag == GX_FALSE)
90
        {
91
3
            return(GX_NOT_FOUND);
92
        }
93
    }
94
95
    /* Check for invalid pointer.  */
96
13
    if (owner == GX_NULL)
97
    {
98
3
        return(GX_PTR_ERROR);
99
    }
100
101
    /* Check for invalid widget.  */
102
10
    if (owner -> gx_widget_type == 0)
103
    {
104
1
        return(GX_INVALID_WIDGET);
105
    }
106
107
    /* Call actual system timer stop.  */
108
9
    status = _gx_system_timer_stop(owner, timer_id);
109
110
    /* Return status.  */
111
9
    return(status);
112
}
113