GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_timer_expiration.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 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
#include "gx_animation.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_system_timer_expiration                         PORTABLE C      */
37
/*                                                           6.1.3        */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This is the callback function for the gx_system_timer. This         */
45
/*    function updates all of the GUIX application timers, and sends      */
46
/*    events as needed                                                    */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    None                                                                */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    None                                                                */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*   _gx_system_event_send                   Send GUI event               */
59
/*   tx_timer_deactivate                     Deactivate a timer           */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    tx_timer                                                            */
64
/*                                                                        */
65
/**************************************************************************/
66
8367
VOID  _gx_system_timer_expiration(ULONG val)
67
{
68
GX_EVENT timer_event;
69
70
    GX_PARAMETER_NOT_USED(val);
71
72
    /* if there are no active timers just stop the timer from running */
73
8367
    if (_gx_system_active_timer_list == GX_NULL &&
74
3852
        _gx_system_animation_list == GX_NULL)
75
    {
76
#ifdef GX_THREADX_BINDING
77
#ifndef GX_DISABLE_THREADX_TIMER_SOURCE
78
125
        tx_timer_deactivate(&_gx_system_timer);
79
#endif
80
#else
81
        GX_TIMER_STOP;
82
#endif
83
125
        return;
84
    }
85
86
8242
    timer_event.gx_event_type = GX_EVENT_TIMER;
87
8242
    timer_event.gx_event_sender = 0;
88
8242
    timer_event.gx_event_target = GX_NULL;
89
8242
    timer_event.gx_event_payload.gx_event_ulongdata = 1;
90
8242
    _gx_system_event_fold(&timer_event);
91
}
92