QP/C
7.3.4
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qf_act.c
Go to the documentation of this file.
1
//$file${src::qf::qf_act.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2
//
3
// Model: qpc.qm
4
// File: ${src::qf::qf_act.c}
5
//
6
// This code has been generated by QM 6.1.1 <www.state-machine.com/qm>.
7
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8
//
9
// This code is covered by the following QP license:
10
// License # : LicenseRef-QL-dual
11
// Issued to : Any user of the QP/C real-time embedded framework
12
// Framework(s) : qpc
13
// Support ends : 2024-12-31
14
// License scope:
15
//
16
// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17
//
18
// Q u a n t u m L e a P s
19
// ------------------------
20
// Modern Embedded Software
21
//
22
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
23
//
24
// This software is dual-licensed under the terms of the open source GNU
25
// General Public License version 3 (or any later version), or alternatively,
26
// under the terms of one of the closed source Quantum Leaps commercial
27
// licenses.
28
//
29
// The terms of the open source GNU General Public License version 3
30
// can be found at: <www.gnu.org/licenses/gpl-3.0>
31
//
32
// The terms of the closed source Quantum Leaps commercial licenses
33
// can be found at: <www.state-machine.com/licensing>
34
//
35
// Redistributions in source code must retain this top-level comment block.
36
// Plagiarizing this software to sidestep the license obligations is illegal.
37
//
38
// Contact information:
39
// <www.state-machine.com/licensing>
40
// <info@state-machine.com>
41
//
42
//$endhead${src::qf::qf_act.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43
#define QP_IMPL
// this is QP implementation
44
#include "
qp_port.h
"
// QP port
45
#include "
qp_pkg.h
"
// QP package-scope interface
46
#include "
qsafe.h
"
// QP Functional Safety (FuSa) Subsystem
47
#ifdef Q_SPY
// QS software tracing enabled?
48
#include "
qs_port.h
"
// QS port
49
#include "
qs_pkg.h
"
// QS facilities for pre-defined trace records
50
#else
51
#include "qs_dummy.h"
// disable the QS software tracing
52
#endif
// Q_SPY
53
54
//Q_DEFINE_THIS_MODULE("qf_act")
55
56
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
57
// Check for the minimum required QP version
58
#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
59
#error qpc version 7.3.0 or higher required
60
#endif
61
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63
//$define${QF::QActive::registry_[QF_MAX_ACTIVE + 1U]} vvvvvvvvvvvvvvvvvvvvvvv
64
QActive
*
QActive_registry_
[
QF_MAX_ACTIVE
+ 1U];
65
//$enddef${QF::QActive::registry_[QF_MAX_ACTIVE + 1U]} ^^^^^^^^^^^^^^^^^^^^^^^
66
67
//$define${QF::QF-pkg} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
68
69
//${QF::QF-pkg::priv_} .......................................................
70
QF_Attr
QF_priv_
;
71
72
//${QF::QF-pkg::bzero_} ......................................................
73
//! @static @private @memberof QF
74
void
QF_bzero_(
75
void
*
const
start,
76
uint_fast16_t
const
len)
77
{
78
uint8_t *ptr = (uint8_t *)start;
79
for
(uint_fast16_t n = len; n > 0U; --n) {
80
*ptr = 0U;
81
++ptr;
82
}
83
}
84
//$enddef${QF::QF-pkg} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
86
//$define${QF::types::QF_LOG2} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
87
88
//${QF::types::QF_LOG2} ......................................................
89
#ifndef QF_LOG2
90
uint_fast8_t
QF_LOG2
(
QPSetBits
const
bitmask) {
91
static
uint8_t
const
log2LUT[16] = {
92
0U, 1U, 2U, 2U, 3U, 3U, 3U, 3U,
93
4U, 4U, 4U, 4U, 4U, 4U, 4U, 4U
94
};
95
uint_fast8_t n = 0U;
96
QPSetBits
tmp;
97
QPSetBits
x = bitmask;
98
99
#if (QF_MAX_ACTIVE > 16U)
100
tmp = (x >> 16U);
101
if
(tmp != 0U) {
102
n += 16U;
103
x = tmp;
104
}
105
#endif
106
#if (QF_MAX_ACTIVE > 8U)
107
tmp = (x >> 8U);
108
if
(tmp != 0U) {
109
n += 8U;
110
x = tmp;
111
}
112
#endif
113
tmp = (x >> 4U);
114
if
(tmp != 0U) {
115
n += 4U;
116
x = tmp;
117
}
118
return
n + log2LUT[x];
119
}
120
#endif
// ndef QF_LOG2
121
//$enddef${QF::types::QF_LOG2} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
QF_priv_
QF_Attr QF_priv_
Definition
qf_act.c:70
QF_LOG2
uint_fast8_t QF_LOG2(QPSetBits const bitmask)
Definition
qf_act.c:90
QActive_registry_
QActive * QActive_registry_[QF_MAX_ACTIVE+1U]
Definition
qf_act.c:64
QPSetBits
uint32_t QPSetBits
Definition
qp.h:648
QF_MAX_ACTIVE
#define QF_MAX_ACTIVE
Definition
qp_config.h:112
qp_pkg.h
Internal (package scope) QP/C interface.
qp_port.h
Sample QP/C port.
qs_pkg.h
QS/C package-scope interface.
qs_port.h
Sample QS/C port.
qsafe.h
QP Functional Safety (FuSa) Subsystem.
QActive
Active object class (based on the QHsm implementation strategy)
Definition
qp.h:800
QF_Attr
Private attributes of the QF framework.
Definition
qp_pkg.h:50
qpc
src
qf
qf_act.c
© 2005-2024 Quantum Leaps
|
Using Online Help
|
QP/C 7.3.4
| Updated on Sat Apr 20 2024
© 2005-2024 Quantum Leaps
|
Using Online Help
|
QP/C 7.3.4
| Updated on Sat Apr 20 2024