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_animation_get PORTABLE C */ |
37 |
|
|
/* 6.1.3 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* Obtain an animation structure from the system pool. */ |
45 |
|
|
/* */ |
46 |
|
|
/* INPUT */ |
47 |
|
|
/* */ |
48 |
|
|
/* animation Adress to return pointer */ |
49 |
|
|
/* */ |
50 |
|
|
/* OUTPUT */ |
51 |
|
|
/* */ |
52 |
|
|
/* status Completion status */ |
53 |
|
|
/* */ |
54 |
|
|
/* CALLS */ |
55 |
|
|
/* */ |
56 |
|
|
/* GX_ENTER_CRITICAL lock system mutex */ |
57 |
|
|
/* GX_EXIT_CRITICAL unlock system mutex */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLED BY */ |
60 |
|
|
/* */ |
61 |
|
|
/* GUIX Application */ |
62 |
|
|
/* GUIX Internal Code */ |
63 |
|
|
/* */ |
64 |
|
|
/**************************************************************************/ |
65 |
|
|
#if (GX_ANIMATION_POOL_SIZE > 0) |
66 |
|
|
|
67 |
|
25 |
UINT _gx_system_animation_get(GX_ANIMATION **animation) |
68 |
|
|
{ |
69 |
|
25 |
UINT status = GX_SUCCESS; |
70 |
|
|
GX_ANIMATION *free_block; |
71 |
|
|
|
72 |
|
|
/* lock entering critical section */ |
73 |
|
25 |
GX_ENTER_CRITICAL |
74 |
|
|
|
75 |
|
|
/* check for already having this timer */ |
76 |
✓✓ |
25 |
if (_gx_system_animation_free_list) |
77 |
|
|
{ |
78 |
|
24 |
free_block = _gx_system_animation_free_list; |
79 |
|
24 |
_gx_system_animation_free_list = free_block -> gx_animation_next; |
80 |
|
24 |
free_block -> gx_animation_next = GX_NULL; |
81 |
|
24 |
free_block -> gx_animation_system_allocated = GX_TRUE; |
82 |
|
24 |
free_block -> gx_animation_status = GX_ANIMATION_IDLE; |
83 |
|
24 |
free_block -> gx_animation_canvas = GX_NULL; |
84 |
|
24 |
*animation = free_block; |
85 |
|
|
} |
86 |
|
|
else |
87 |
|
|
{ |
88 |
|
1 |
*animation = GX_NULL; |
89 |
|
1 |
status = GX_OUT_OF_ANIMATIONS; |
90 |
|
|
} |
91 |
|
|
|
92 |
|
25 |
GX_EXIT_CRITICAL |
93 |
|
25 |
return status; |
94 |
|
|
} |
95 |
|
|
#endif |