Skip to content

Commit 267c2e5

Browse files
committed
7.0.1
Adapted QP/C++ source code to avoid warings from the new C++20 standard about: "compound assignment with 'volatile'-qualified left operand is deprecated".
1 parent 5c1286a commit 267c2e5

File tree

28 files changed

+1250
-269
lines changed

28 files changed

+1250
-269
lines changed

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#---------------------------------------------------------------------------
88
DOXYFILE_ENCODING = UTF-8
99
PROJECT_NAME = QP/C++
10-
PROJECT_NUMBER = 7.0.0
10+
PROJECT_NUMBER = 7.0.1
1111
PROJECT_BRIEF = "Real-Time Embedded Framework"
1212
PROJECT_LOGO = images/logo_ql.png
1313
OUTPUT_DIRECTORY =

doxygen/history.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ namespace QP {
22

33
/** @page history Revision History
44

5+
@section qpcpp_7_0_1 Version 7.0.1, 2022-05-14
6+
Adapted QP/C++ source code to avoid warings from the new C++20 standard about: "compound assignment with 'volatile'-qualified left operand is deprecated".
7+
8+
59
@section qpcpp_7_0_0 Version 7.0.0, 2022-04-30
610
This major focus of this release is the adaptation of the code and documentation to better support safety certification (see [QP Certification Pack](https://www.state-machine.com/products/qp#CERT))
711

doxygen/metrics.dox

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.
Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
##############################################################################
2+
# Product: Makefile for QP/C++ on EMF32-SLSTK3401A, QK kernel, GNU-ARM
3+
# Last Updated for Version: 7.0.0
4+
# Date of the Last Update: 2022-05-13
5+
#
6+
# Q u a n t u m L e a P s
7+
# ------------------------
8+
# Modern Embedded Software
9+
#
10+
# Copyright (C) 2005-2022 Quantum Leaps, LLC. All rights reserved.
11+
#
12+
# This program is open source software: you can redistribute it and/or
13+
# modify it under the terms of the GNU General Public License as published
14+
# by the Free Software Foundation, either version 3 of the License, or
15+
# (at your option) any later version.
16+
#
17+
# Alternatively, this program may be distributed and modified under the
18+
# terms of Quantum Leaps commercial licenses, which expressly supersede
19+
# the GNU General Public License and are specifically designed for
20+
# licensees interested in retaining the proprietary status of their code.
21+
#
22+
# This program is distributed in the hope that it will be useful,
23+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+
# GNU General Public License for more details.
26+
#
27+
# You should have received a copy of the GNU General Public License
28+
# along with this program. If not, see <http://www.gnu.org/licenses>.
29+
#
30+
# Contact information:
31+
# <www.state-machine.com/licensing>
32+
33+
##############################################################################
34+
# examples of invoking this Makefile:
35+
# building configurations: Debug (default), Release, and Spy
36+
# make
37+
# make CONF=rel
38+
# make CONF=spy
39+
#
40+
# cleaning configurations: Debug (default), Release, and Spy
41+
# make clean
42+
# make CONF=rel clean
43+
# make CONF=spy clean
44+
#
45+
# NOTE:
46+
# To use this Makefile on Windows, you will need the GNU make utility, which
47+
# is included in the Qtools collection for Windows, see:
48+
# https://github.com/QuantumLeaps/qtools/releases
49+
#
50+
51+
#-----------------------------------------------------------------------------
52+
# project name
53+
#
54+
PROJECT := dpp-qk
55+
56+
#-----------------------------------------------------------------------------
57+
# project directories
58+
#
59+
60+
# location of the QP/C++ framework (if not provided in an environemnt var.)
61+
ifeq ($(QPCPP),)
62+
QPCPP := ../../../../..
63+
endif
64+
65+
# QP port used in this project
66+
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qk/gnu
67+
68+
# list of all source directories used by this project
69+
VPATH = \
70+
.. \
71+
../.. \
72+
$(QPCPP)/src/qf \
73+
$(QPCPP)/src/qk \
74+
$(QPCPP)/src/qs \
75+
$(QP_PORT_DIR) \
76+
$(QPCPP)/3rd_party/efm32pg1b \
77+
$(QPCPP)/3rd_party/efm32pg1b/gnu
78+
79+
# list of all include directories needed by this project
80+
INCLUDES = \
81+
-I../.. \
82+
-I$(QPCPP)/include \
83+
-I$(QPCPP)/src \
84+
-I$(QP_PORT_DIR) \
85+
-I$(QPCPP)/3rd_party/CMSIS/Include \
86+
-I$(QPCPP)/3rd_party/efm32pg1b
87+
88+
#-----------------------------------------------------------------------------
89+
# files
90+
#
91+
92+
# assembler source files
93+
ASM_SRCS :=
94+
95+
# C source files
96+
C_SRCS := \
97+
startup_efm32pg1b.c \
98+
system_efm32pg1b.c \
99+
em_cmu.c \
100+
em_emu.c \
101+
em_gpio.c \
102+
em_usart.c
103+
104+
# C++ source files
105+
CPP_SRCS := \
106+
bsp.cpp \
107+
main.cpp \
108+
philo.cpp \
109+
table.cpp
110+
111+
OUTPUT := $(PROJECT)
112+
LD_SCRIPT := $(PROJECT).ld
113+
114+
QP_SRCS := \
115+
qep_hsm.cpp \
116+
qep_msm.cpp \
117+
qf_act.cpp \
118+
qf_actq.cpp \
119+
qf_defer.cpp \
120+
qf_dyn.cpp \
121+
qf_mem.cpp \
122+
qf_ps.cpp \
123+
qf_qact.cpp \
124+
qf_qeq.cpp \
125+
qf_qmact.cpp \
126+
qf_time.cpp \
127+
qk.cpp \
128+
qk_port.cpp
129+
130+
QP_ASMS :=
131+
132+
QS_SRCS := \
133+
qs.cpp \
134+
qs_rx.cpp \
135+
qs_fp.cpp
136+
137+
LIB_DIRS :=
138+
LIBS :=
139+
140+
# defines
141+
DEFINES := -DEFM32PG1B200F256GM48=1 \
142+
-DQK_USE_IRQ_NUM=25 \
143+
-DQK_USE_IRQ_HANDLER=CRYPTO_IRQHandler
144+
145+
# ARM CPU, ARCH, FPU, and Float-ABI types...
146+
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
147+
# ARM_FPU: [ | vfp]
148+
# FLOAT_ABI: [ | soft | softfp | hard]
149+
#
150+
ARM_CPU := -mcpu=cortex-m4
151+
ARM_FPU := -mfpu=vfp
152+
FLOAT_ABI := -mfloat-abi=softfp
153+
154+
#-----------------------------------------------------------------------------
155+
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
156+
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
157+
#
158+
ifeq ($(GNU_ARM),)
159+
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
160+
endif
161+
162+
# make sure that the GNU-ARM toolset exists...
163+
ifeq ("$(wildcard $(GNU_ARM))","")
164+
$(error GNU_ARM toolset not found. Please adjust the Makefile)
165+
endif
166+
167+
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
168+
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
169+
AS := $(GNU_ARM)/bin/arm-none-eabi-as
170+
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
171+
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
172+
173+
174+
##############################################################################
175+
# Typically, you should not need to change anything below this line
176+
177+
# basic utilities (included in Qtools for Windows), see:
178+
# http://sourceforge.net/projects/qpc/files/Qtools
179+
180+
MKDIR := mkdir
181+
RM := rm
182+
183+
#-----------------------------------------------------------------------------
184+
# build options for various configurations for ARM Cortex-M4F
185+
#
186+
187+
# combine all the soruces...
188+
CPP_SRCS += $(QP_SRCS)
189+
ASM_SRCS += $(QP_ASMS)
190+
191+
ifeq (rel, $(CONF)) # Release configuration ..................................
192+
193+
BIN_DIR := rel
194+
195+
ASFLAGS = $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
196+
197+
CFLAGS = -c $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
198+
-ffunction-sections -fdata-sections \
199+
-O1 $(INCLUDES) $(DEFINES) -DNDEBUG
200+
201+
CPPFLAGS = -c $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -std=c++20 -mthumb -Wall \
202+
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
203+
-O1 $(INCLUDES) $(DEFINES) -DNDEBUG
204+
205+
else ifeq (spy, $(CONF)) # Spy configuration ................................
206+
207+
BIN_DIR := spy
208+
209+
CPP_SRCS += $(QS_SRCS)
210+
211+
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
212+
213+
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
214+
-ffunction-sections -fdata-sections \
215+
-O $(INCLUDES) $(DEFINES) -DQ_SPY
216+
217+
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -std=c++20 -mthumb -Wall \
218+
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
219+
-O $(INCLUDES) $(DEFINES) -DQ_SPY
220+
221+
else # default Debug configuration ..........................................
222+
223+
BIN_DIR := dbg
224+
225+
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
226+
227+
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
228+
-ffunction-sections -fdata-sections \
229+
-O $(INCLUDES) $(DEFINES)
230+
231+
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -std=c++20 -mthumb -Wall \
232+
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
233+
-O $(INCLUDES) $(DEFINES)
234+
235+
endif # ......................................................................
236+
237+
238+
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
239+
-specs=nosys.specs -specs=nano.specs \
240+
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
241+
242+
243+
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
244+
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
245+
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
246+
247+
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
248+
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
249+
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
250+
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
251+
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
252+
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
253+
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
254+
255+
# create $(BIN_DIR) if it does not exist
256+
ifeq ("$(wildcard $(BIN_DIR))","")
257+
$(shell $(MKDIR) $(BIN_DIR))
258+
endif
259+
260+
#-----------------------------------------------------------------------------
261+
# rules
262+
#
263+
264+
all: $(TARGET_BIN)
265+
#all: $(TARGET_ELF)
266+
267+
$(TARGET_BIN): $(TARGET_ELF)
268+
$(BIN) -O binary $< $@
269+
270+
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
271+
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
272+
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
273+
274+
$(BIN_DIR)/%.d : %.c
275+
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
276+
277+
$(BIN_DIR)/%.d : %.cpp
278+
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
279+
280+
$(BIN_DIR)/%.o : %.s
281+
$(AS) $(ASFLAGS) $< -o $@
282+
283+
$(BIN_DIR)/%.o : %.c
284+
$(CC) $(CFLAGS) $< -o $@
285+
286+
$(BIN_DIR)/%.o : %.cpp
287+
$(CPP) $(CPPFLAGS) $< -o $@
288+
289+
# include dependency files only if our goal depends on their existence
290+
ifneq ($(MAKECMDGOALS),clean)
291+
ifneq ($(MAKECMDGOALS),show)
292+
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
293+
endif
294+
endif
295+
296+
297+
.PHONY : clean
298+
clean:
299+
-$(RM) $(BIN_DIR)/*.o \
300+
$(BIN_DIR)/*.d \
301+
$(BIN_DIR)/*.bin \
302+
$(BIN_DIR)/*.elf \
303+
$(BIN_DIR)/*.map
304+
305+
show:
306+
@echo PROJECT = $(PROJECT)
307+
@echo CONF = $(CONF)
308+
@echo DEFINES = $(DEFINES)
309+
@echo ASM_FPU = $(ASM_FPU)
310+
@echo ASM_SRCS = $(ASM_SRCS)
311+
@echo C_SRCS = $(C_SRCS)
312+
@echo CPP_SRCS = $(CPP_SRCS)
313+
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
314+
@echo C_OBJS_EXT = $(C_OBJS_EXT)
315+
@echo C_DEPS_EXT = $(C_DEPS_EXT)
316+
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
317+
@echo TARGET_ELF = $(TARGET_ELF)

0 commit comments

Comments
 (0)