Skip to content

Commit 9382ad6

Browse files
committed
7.3.0
1 parent 012c5c3 commit 9382ad6

File tree

17 files changed

+104
-41
lines changed

17 files changed

+104
-41
lines changed

examples/arm-cm/blinky_ek-tm4c123gxl/qk/gnu/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<link>
8484
<name>qstamp.c</name>
8585
<type>1</type>
86-
<locationURI>PARENT-5-PROJECT_LOC/include/qstamp.c</locationURI>
86+
<locationURI>PARENT-5-PROJECT_LOC/src/qs/qstamp.c</locationURI>
8787
</link>
8888
<link>
8989
<name>rom.h</name>

examples/arm-cm/blinky_ek-tm4c123gxl/qv/gnu/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<link>
8484
<name>qstamp.c</name>
8585
<type>1</type>
86-
<locationURI>PARENT-5-PROJECT_LOC/include/qstamp.c</locationURI>
86+
<locationURI>PARENT-5-PROJECT_LOC/src/qs/qstamp.c</locationURI>
8787
</link>
8888
<link>
8989
<name>rom.h</name>

examples/arm-cm/dpp_ek-tm4c123gxl/qk/gnu/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<link>
8484
<name>qstamp.c</name>
8585
<type>1</type>
86-
<locationURI>PARENT-5-PROJECT_LOC/include/qstamp.c</locationURI>
86+
<locationURI>PARENT-5-PROJECT_LOC/src/qs/qstamp.c</locationURI>
8787
</link>
8888
<link>
8989
<name>rom.h</name>

examples/arm-cm/dpp_ek-tm4c123gxl/qv/gnu/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<link>
8484
<name>qstamp.c</name>
8585
<type>1</type>
86-
<locationURI>PARENT-5-PROJECT_LOC/include/qstamp.c</locationURI>
86+
<locationURI>PARENT-5-PROJECT_LOC/src/qs/qstamp.c</locationURI>
8787
</link>
8888
<link>
8989
<name>rom.h</name>

examples/arm-cm/dpp_ek-tm4c123gxl/qxk/gnu/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<link>
8484
<name>qstamp.c</name>
8585
<type>1</type>
86-
<locationURI>PARENT-5-PROJECT_LOC/include/qstamp.c</locationURI>
86+
<locationURI>PARENT-5-PROJECT_LOC/src/qs/qstamp.c</locationURI>
8787
</link>
8888
<link>
8989
<name>rom.h</name>

examples/posix-win32/history_qmsm/proj.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
</PreBuildEvent>
147147
</ItemDefinitionGroup>
148148
<ItemGroup>
149-
<ClCompile Include="..\..\..\include\qstamp.c" />
149+
<ClCompile Include="..\..\..\src\qs\qstamp.c" />
150150
<ClCompile Include="..\..\..\ports\win32-qv\qf_port.c" />
151151
<ClCompile Include="..\..\..\ports\win32-qv\qs_port.c">
152152
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>

examples/posix-win32/history_qmsm/proj.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
44
<ClCompile Include="main.c" />
5-
<ClCompile Include="..\..\..\include\qstamp.c" />
5+
<ClCompile Include="..\..\..\src\qs\qstamp.c" />
66
<ClCompile Include="..\..\..\ports\win32-qv\qf_port.c">
77
<Filter>QP_port</Filter>
88
</ClCompile>

examples/posix-win32/reminder2/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##############################################################################
22
# Product: Makefile for QP/C for Windows and POSIX *HOSTS*
3-
# Last updated for version 7.2.0
4-
# Last updated on 2022-11-13
3+
# Last updated for version 7.3.0
4+
# Last updated on 2023-09-25
55
#
66
# Q u a n t u m L e a P s
77
# ------------------------
@@ -83,7 +83,8 @@ LIBS :=
8383

8484
# defines...
8585
# QP_API_VERSION controls the QP API compatibility; 9999 means the latest API
86-
DEFINES := -DQP_API_VERSION=9999
86+
DEFINES := -DQP_API_VERSION=9999 \
87+
$(DEF)
8788

8889
ifeq (,$(CONF))
8990
CONF := dbg

examples/posix-win32/reminder2/reminder2.c

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ typedef struct {
5555
// the next iteration to perform
5656
uint32_t iter;
5757
} ReminderEvt;
58+
59+
// public:
60+
61+
#ifdef QEVT_DYN_CTOR
62+
static inline ReminderEvt * ReminderEvt_ctor(ReminderEvt * const me,
63+
uint32_t iter)
64+
{
65+
if (me != (ReminderEvt *)0) {
66+
// don't call QEvt_ctor() because the initialization of all
67+
// QEvt attributes is already done in QF_QF_newX_()
68+
me->iter = iter;
69+
}
70+
return me;
71+
}
72+
#endif // def QEVT_DYN_CTOR
5873
//$enddecl${Events::ReminderEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5974

6075
//..........................................................................
@@ -113,8 +128,13 @@ static QState Cruncher_processing(Cruncher * const me, QEvt const * const e) {
113128
switch (e->sig) {
114129
//${Components::Cruncher::SM::processing}
115130
case Q_ENTRY_SIG: {
131+
#ifdef QEVT_DYN_CTOR
132+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG, 0U);
133+
#else
116134
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
117135
reminder->iter = 0U;
136+
#endif
137+
118138
QACTIVE_POST(&me->super, &reminder->super, me);
119139
me->sum = 0.0;
120140
status_ = Q_HANDLED();
@@ -135,8 +155,13 @@ static QState Cruncher_processing(Cruncher * const me, QEvt const * const e) {
135155
}
136156
//${Components::Cruncher::SM::processing::CRUNCH::[i<0x07000000U]}
137157
if (i < 0x07000000U) {
158+
#ifdef QEVT_DYN_CTOR
159+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG, i);
160+
#else
138161
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
139162
reminder->iter = i;
163+
#endif
164+
140165
QACTIVE_POST(&me->super, &reminder->super, me);
141166
status_ = Q_HANDLED();
142167
}
@@ -223,8 +248,18 @@ int main(int argc, char *argv[]) {
223248
void BSP_onKeyboardInput(uint8_t key) {
224249
switch (key) {
225250
case 'e': { // echo the progress so far
226-
static QEvt const echoEvt = QEVT_INITIALIZER(ECHO_SIG);
227-
QACTIVE_POST((QActive *)&l_cruncher, &echoEvt, (void *)0);
251+
// NOTE:
252+
// The following Q_NEW_X() allocation might potentially fail
253+
// because the "ECHO" event is not considered critical. This
254+
// code illustrates the Q_NEW_X() API and its use.
255+
#ifdef QEVT_DYN_CTOR
256+
QEvt const *echoEvt = Q_NEW_X(QEvt, 2U, ECHO_SIG, QEVT_DYNAMIC);
257+
#else
258+
QEvt const *echoEvt = Q_NEW_X(QEvt, 2U, ECHO_SIG);
259+
#endif
260+
if (echoEvt != (QEvt *)0) { // event allocated successfully?
261+
QACTIVE_POST((QActive *)&l_cruncher, echoEvt, (void *)0);
262+
}
228263
break;
229264
}
230265
case '\033': { // ESC pressed?

examples/posix-win32/reminder2/reminder2.qm

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
<attribute name="iter" type="uint32_t" visibility="0x00" properties="0x00">
1212
<documentation>// the next iteration to perform</documentation>
1313
</attribute>
14+
<!--${Events::ReminderEvt::ctor}-->
15+
<operation name="ctor?def QEVT_DYN_CTOR" type="ReminderEvt *" visibility="0x00" properties="0x02">
16+
<!--${Events::ReminderEvt::ctor::iter}-->
17+
<parameter name="iter" type="uint32_t"/>
18+
<code>if (me != (ReminderEvt *)0) {
19+
// don't call QEvt_ctor() because the initialization of all
20+
// QEvt attributes is already done in QF_QF_newX_()
21+
me-&gt;iter = iter;
22+
}
23+
return me;</code>
24+
</operation>
1425
</class>
1526
</package>
1627
<!--${Components}-->
@@ -38,8 +49,13 @@
3849
</initial>
3950
<!--${Components::Cruncher::SM::processing}-->
4051
<state name="processing">
41-
<entry>ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
52+
<entry>#ifdef QEVT_DYN_CTOR
53+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG, 0U);
54+
#else
55+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
4256
reminder-&gt;iter = 0U;
57+
#endif
58+
4359
QACTIVE_POST(&amp;me-&gt;super, &amp;reminder-&gt;super, me);
4460
me-&gt;sum = 0.0;</entry>
4561
<!--${Components::Cruncher::SM::processing::CRUNCH}-->
@@ -66,8 +82,13 @@ for (; n &lt; i; ++n) {
6682
<!--${Components::Cruncher::SM::processing::CRUNCH::[i<0x07000000U]}-->
6783
<choice>
6884
<guard>i &lt; 0x07000000U</guard>
69-
<action>ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
85+
<action>#ifdef QEVT_DYN_CTOR
86+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG, i);
87+
#else
88+
ReminderEvt *reminder = Q_NEW(ReminderEvt, CRUNCH_SIG);
7089
reminder-&gt;iter = i;
90+
#endif
91+
7192
QACTIVE_POST(&amp;me-&gt;super, &amp;reminder-&gt;super, me);</action>
7293
<choice_glyph conn="24,18,4,-1,-4,14">
7394
<action box="0,-6,17,2"/>
@@ -169,8 +190,19 @@ int main(int argc, char *argv[]) {
169190
void BSP_onKeyboardInput(uint8_t key) {
170191
switch (key) {
171192
case 'e': { // echo the progress so far
172-
static QEvt const echoEvt = QEVT_INITIALIZER(ECHO_SIG);
173-
QACTIVE_POST((QActive *)&amp;l_cruncher, &amp;echoEvt, (void *)0);
193+
// NOTE:
194+
// The following Q_NEW_X() allocation might potentially fail
195+
// but this is acceptable becasue the &quot;ECHO&quot; event is not
196+
// considered critical. This code illustrates the Q_NEW_X()
197+
// API and its use.
198+
#ifdef QEVT_DYN_CTOR
199+
QEvt const *echoEvt = Q_NEW_X(QEvt, 2U, ECHO_SIG, QEVT_DYNAMIC);
200+
#else
201+
QEvt const *echoEvt = Q_NEW_X(QEvt, 2U, ECHO_SIG);
202+
#endif
203+
if (echoEvt != (QEvt *)0) { // event allocated successfully?
204+
QACTIVE_POST((QActive *)&amp;l_cruncher, echoEvt, (void *)0);
205+
}
174206
break;
175207
}
176208
case '\033': { // ESC pressed?

0 commit comments

Comments
 (0)