This commit is contained in:
MMS 2021-12-05 20:41:22 -05:00
parent d613815f42
commit 8803d8faed
44 changed files with 6551 additions and 4853 deletions

View File

@ -1,5 +1,7 @@
# Doxyfile 1.9.2
@INCLUDE = ../../ql-doxygen/Doxyfile-QL
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
@ -39,16 +41,6 @@ PYTHON_DOCSTRING = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES = "next{1}=<hr><b>Next:</b> @ref \1</p>" \
"description=@par Description" \
"amplification=@par Amplification" \
"rationale=@par Rationale" \
"caption{1}=<div class=\"caption\" align=\"center\">\1</div>" \
"hint=@par Hint" \
"usage=@par Usage" \
"termref{2}=<a class=\"extern\" target=\"_blank\" href=\"https://www.state-machine.com/\1\">\2</a>" \
"reqdef{1}=@anchor \1 @xrefitem reqdef \"Requirement\" \"Requirement Index\" @ref \1" \
"reqref{1}=@ref \1 \"\1\""
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
@ -136,14 +128,14 @@ INPUT = main.dox \
exa.dox \
exa_apps.dox \
exa_native.dox \
../../ql-doxygen/exa_low-power.dox \
../../qp-doxygen/exa_low-power.dox \
exa_rtos.dox \
exa_os.dox \
exa_qutest.dox \
exa_mware.dox \
ports.dox \
ports_native.dox \
../../ql-doxygen/ports_arm-cm.dox \
../../qp-doxygen/ports_arm-cm.dox \
ports_rtos.dox \
ports_os.dox \
history.dox \
@ -214,7 +206,8 @@ HTML_FOOTER = ../../ql-doxygen/footer-awesome.html
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/doxygen-awesome.css \
../../ql-doxygen/ql-awesome.css
HTML_EXTRA_FILES = ../../ql-doxygen/doxygen-awesome-darkmode-toggle.js
HTML_EXTRA_FILES = ../../ql-doxygen/doxygen-awesome-darkmode-toggle.js \
../../ql-doxygen/preview.js
HTML_COLORSTYLE_HUE = 209
HTML_COLORSTYLE_SAT = 255
HTML_COLORSTYLE_GAMMA = 113
@ -265,71 +258,9 @@ SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTERNAL_SEARCH_ID = QPCPP
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
LATEX_MAKEINDEX_CMD = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
@ -355,51 +286,3 @@ PREDEFINED = Q_SPY \
QS_TIME_SIZE
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = YES
UML_LIMIT_NUM_FIELDS = 10
DOT_UML_DETAILS = NO
DOT_WRAP_THRESHOLD = 17
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH = C:/tools/graphviz/bin
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@ -1,4 +1,4 @@
# Doxyfile 1.9.0
# Doxyfile 1.9.2
@INCLUDE = Doxyfile
@ -8,6 +8,7 @@
HTML_OUTPUT = tmp
HTML_HEADER = ../../ql-doxygen/header.html
HTML_FOOTER = ../../ql-doxygen/footer.html
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/ql.css
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/ql.css \
../../ql-doxygen/preview.js
HTML_EXTRA_FILES =
GENERATE_HTMLHELP = YES

View File

@ -1,36 +0,0 @@
/* Image preview script
* powered by jQuery (http://www.jquery.com)
* written by Alen Grakalic (http://cssglobe.com)
* for more info visit
* http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
*/
this.imagePreview = function(){
// you might want to adjust to get the right result
horOffset = -100;
verOffset = 0;
/* END CONFIG */
$("a.preview").hover(function(e){
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
$("#preview")
.css("top",(e.pageY - verOffset) + "px")
.css("left",(e.pageX + horOffset) + "px")
.fadeIn("fast");
},
function(){
this.title = this.t;
$("#preview").remove();
});
$("a.preview").mousemove(function(e){
$("#preview")
.css("top",(e.pageY - verOffset) + "px")
.css("left",(e.pageX + horOffset) + "px");
});
};
// starting the script on page load
$(document).ready(function(){
imagePreview();
});

View File

@ -3,7 +3,7 @@
// Model: start-stop.qm
// File: ${.::launcher.cpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -48,8 +48,8 @@ protected:
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//. Check for the minimum required QP version
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.8.0 or higher required
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$define${AOs::AO_Launcher} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.0" links="1">
<model version="5.1.3" links="1">
<documentation>Start-stop application that demonstrates staring and stopping active objects multiple times during the runtime, as opposed to starting AOs only at the beginning.</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>
@ -180,11 +180,11 @@ m_te.armX(BSP::TICKS_PER_SEC / 5U,
static QEvt const doneEvt = { DONE_SIG, 0 };
QF::PUBLISH(&amp;doneEvt, this);
stop(); // stop this active object</entry>
<state_glyph node="2,54,34,14">
<entry box="1,2,33,9"/>
<state_glyph node="2,54,34,16">
<entry box="1,2,33,12"/>
</state_glyph>
</state>
<state_diagram size="42,70"/>
<state_diagram size="42,72"/>
</statechart>
</class>
<!--${AOs::AO_Launcher}-->

View File

@ -3,7 +3,7 @@
// Model: start-stop.qm
// File: ${.::worker.cpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -24,8 +24,8 @@
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//. Check for the minimum required QP version
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.8.0 or higher required
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$define${AOs::Worker} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

View File

@ -3,7 +3,7 @@
// Model: start-stop.qm
// File: ${.::worker.hpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++ on EMF32, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-07-01
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
@ -255,7 +255,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,322 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_blinky
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C++ framework (if not provided in an env. variable)
ifeq ($(QPCPP),)
QPCPP := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPCPP)/src/qf \
$(QPCPP)/src/qs \
$(QP_PORT_DIR) \
$(QPCPP)/3rd_party/nucleo-l053r8 \
$(QPCPP)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS := \
bsp.cpp \
blinky.cpp \
test_blinky.cpp
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.cpp \
qep_msm.cpp \
qf_act.cpp \
qf_actq.cpp \
qf_defer.cpp \
qf_dyn.cpp \
qf_mem.cpp \
qf_ps.cpp \
qf_qact.cpp \
qf_qeq.cpp \
qf_qmact.cpp \
qf_time.cpp \
qs.cpp \
qs_64bit.cpp \
qs_rx.cpp \
qs_fp.cpp \
qutest.cpp \
qutest_port.cpp
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
CPP_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c++11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -0,0 +1,324 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_dpp
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C++ framework (if not provided in an env. variable)
ifeq ($(QPCPP),)
QPCPP := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPCPP)/src/qf \
$(QPCPP)/src/qs \
$(QP_PORT_DIR) \
$(QPCPP)/3rd_party/nucleo-l053r8 \
$(QPCPP)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS := \
test_dpp.cpp \
main.cpp \
philo.cpp \
table.cpp \
bsp.cpp
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.cpp \
qep_msm.cpp \
qf_act.cpp \
qf_actq.cpp \
qf_defer.cpp \
qf_dyn.cpp \
qf_mem.cpp \
qf_ps.cpp \
qf_qact.cpp \
qf_qeq.cpp \
qf_qmact.cpp \
qf_time.cpp \
qs.cpp \
qs_64bit.cpp \
qs_rx.cpp \
qs_fp.cpp \
qutest.cpp \
qutest_port.cpp
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
CPP_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c++11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -0,0 +1,321 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qhsm
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C++ framework (if not provided in an env. variable)
ifeq ($(QPCPP),)
QPCPP := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPCPP)/src/qf \
$(QPCPP)/src/qs \
$(QP_PORT_DIR) \
$(QPCPP)/3rd_party/nucleo-l053r8 \
$(QPCPP)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS := \
qhsmtst.cpp \
test_qhsm.cpp
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.cpp \
qep_msm.cpp \
qf_act.cpp \
qf_actq.cpp \
qf_defer.cpp \
qf_dyn.cpp \
qf_mem.cpp \
qf_ps.cpp \
qf_qact.cpp \
qf_qeq.cpp \
qf_qmact.cpp \
qf_time.cpp \
qs.cpp \
qs_64bit.cpp \
qs_rx.cpp \
qs_fp.cpp \
qutest.cpp \
qutest_port.cpp
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
CPP_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c++11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -0,0 +1,321 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qmsm
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C++ framework (if not provided in an env. variable)
ifeq ($(QPCPP),)
QPCPP := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPCPP)/src/qf \
$(QPCPP)/src/qs \
$(QP_PORT_DIR) \
$(QPCPP)/3rd_party/nucleo-l053r8 \
$(QPCPP)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS := \
qmsmtst.cpp \
test_qmsm.cpp
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.cpp \
qep_msm.cpp \
qf_act.cpp \
qf_actq.cpp \
qf_defer.cpp \
qf_dyn.cpp \
qf_mem.cpp \
qf_ps.cpp \
qf_qact.cpp \
qf_qeq.cpp \
qf_qmact.cpp \
qf_time.cpp \
qs.cpp \
qs_64bit.cpp \
qs_rx.cpp \
qs_fp.cpp \
qutest.cpp \
qutest_port.cpp
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
CPP_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c++11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -0,0 +1,320 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qutest
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C++ framework (if not provided in an env. variable)
ifeq ($(QPCPP),)
QPCPP := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPCPP)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPCPP)/src/qf \
$(QPCPP)/src/qs \
$(QP_PORT_DIR) \
$(QPCPP)/3rd_party/nucleo-l053r8 \
$(QPCPP)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS := \
test_qutest.cpp
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.cpp \
qep_msm.cpp \
qf_act.cpp \
qf_actq.cpp \
qf_defer.cpp \
qf_dyn.cpp \
qf_mem.cpp \
qf_ps.cpp \
qf_qact.cpp \
qf_qeq.cpp \
qf_qmact.cpp \
qf_time.cpp \
qs.cpp \
qs_64bit.cpp \
qs_rx.cpp \
qs_fp.cpp \
qutest.cpp \
qutest_port.cpp
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
CPP_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-std=c++11 -pedantic -Wall -Wextra \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CPP) $(CPPFLAGS) $(QPCPP)/include/qstamp.cpp -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -0,0 +1,176 @@
/// @file
/// @brief QUTEST port for NUCLEO-L053R8 board
/// @ingroup qs
/// @cond
//////////////////////////////////////////////////////////////////////////////
/// Last updated for version 6.9.4
/// Last updated on 2021-12-01
///
/// Q u a n t u m L e a P s
/// ------------------------
/// Modern Embedded Software
///
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
///
/// This program is open source software: you can redistribute it and/or
/// modify it under the terms of the GNU General Public License as published
/// by the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// Alternatively, this program may be distributed and modified under the
/// terms of Quantum Leaps commercial licenses, which expressly supersede
/// the GNU General Public License and are specifically designed for
/// licensees interested in retaining the proprietary status of their code.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program. If not, see <www.gnu.org/licenses>.
///
/// Contact information:
/// <www.state-machine.com/licensing>
/// <info@state-machine.com>
//////////////////////////////////////////////////////////////////////////////
/// @endcond
#ifndef Q_SPY
#error "Q_SPY must be defined to compile qutest_port.cpp"
#endif // Q_SPY
#define QP_IMPL // this is QP implementation
#include "qf_port.hpp" // QF port
#include "qs_port.hpp" // QS port
#include "qs_pkg.hpp" // QS package-scope interface
#include "qassert.h" // QP embedded systems-friendly assertions
#include "stm32l0xx.h" // CMSIS-compliant header file for the MCU used
// add other drivers if necessary...
//Q_DEFINE_THIS_MODULE("qutest_port")
using namespace QP;
// ISRs defined in this BSP --------------------------------------------------
extern "C" void USART2_IRQHandler(void);
// Local-scope objects -------------------------------------------------------
// LED pins available on the board (just one user LED LD2--Green on PA.5)
#define LED_LD2 (1U << 5)
// Button pins available on the board (just one user Button B1 on PC.13)
#define BTN_B1 (1U << 13)
#define __DIV(__PCLK, __BAUD) (((__PCLK / 4) *25)/(__BAUD))
#define __DIVMANT(__PCLK, __BAUD) (__DIV(__PCLK, __BAUD)/100)
#define __DIVFRAQ(__PCLK, __BAUD) \
(((__DIV(__PCLK, __BAUD) - (__DIVMANT(__PCLK, __BAUD) * 100)) \
* 16 + 50) / 100)
#define __USART_BRR(__PCLK, __BAUD) \
((__DIVMANT(__PCLK, __BAUD) << 4)|(__DIVFRAQ(__PCLK, __BAUD) & 0x0F))
//............................................................................
extern "C" {
// ISR for receiving bytes from the QSPY Back-End
// NOTE: This ISR is "QF-unaware" meaning that it does not interact with
// the QF/QK and is not disabled. Such ISRs don't need to call QK_ISR_ENTRY/
// QK_ISR_EXIT and they cannot post or publish events.
//
void USART2_IRQHandler(void) { // used in QS-RX (kernel UNAWARE interrutp)
// is RX register NOT empty?
if ((USART2->ISR & (1U << 5)) != 0) {
std::uint32_t b = USART2->RDR;
QP::QS::rxPut(b);
}
}
} // extern "C"
// QS callbacks ==============================================================
bool QS::onStartup(void const *arg) {
(void)arg; // unused parameter
static std::uint8_t qsTxBuf[2*1024]; // buffer for Quantum Spy
static std::uint8_t qsRxBuf[128]; // buffer for QS-RX channel
initBuf (qsTxBuf, sizeof(qsTxBuf));
rxInitBuf(qsRxBuf, sizeof(qsRxBuf));
// NOTE: SystemInit() already called from the startup code
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
// enable peripheral clock for USART2
RCC->IOPENR |= ( 1U << 0); // Enable GPIOA clock
RCC->APB1ENR |= ( 1U << 17); // Enable USART#2 clock
// Configure PA3 to USART2_RX, PA2 to USART2_TX
GPIOA->AFR[0] &= ~((15U << 4* 3) | (15U << 4* 2) );
GPIOA->AFR[0] |= (( 4U << 4* 3) | ( 4U << 4* 2) );
GPIOA->MODER &= ~(( 3U << 2* 3) | ( 3U << 2* 2) );
GPIOA->MODER |= (( 2U << 2* 3) | ( 2U << 2* 2) );
USART2->BRR = __USART_BRR(SystemCoreClock, 115200U); // baud rate
USART2->CR3 = 0x0000 | // no flow control
(1U << 12); // disable overrun detection (OVRDIS)
USART2->CR2 = 0x0000; // 1 stop bit
USART2->CR1 = ((1U << 2) | // enable RX
(1U << 3) | // enable TX
(1U << 5) | // enable RX interrupt
(0U << 12) | // 8 data bits
(0U << 28) | // 8 data bits
(1U << 0) ); // enable USART
// explicitly set NVIC priorities of all Cortex-M interrupts used
NVIC_SetPriorityGrouping(0U);
NVIC_SetPriority(USART2_IRQn, 0U); // kernel UNAWARE interrupt
// enable the UART RX interrupt...
NVIC_EnableIRQ(USART2_IRQn); // UART2 interrupt used for QS-RX
return true; // return success
}
//............................................................................
void QS::onCleanup(void) {
}
//............................................................................
void QS::onFlush(void) {
uint16_t b;
while ((b = getByte()) != QS_EOD) { // while not End-Of-Data...
while ((USART2->ISR & (1U << 7)) == 0U) { // while TXE not empty
}
USART2->TDR = (b & 0xFFU); // put into the DR register
}
}
//............................................................................
//! callback function to reset the target (to be implemented in the BSP)
void QS::onReset(void) {
NVIC_SystemReset();
}
//............................................................................
void QS::onTestLoop() {
rxPriv_.inTestLoop = true;
while (rxPriv_.inTestLoop) {
// toggle an LED on and then off (not enough LEDs, see NOTE02)
GPIOA->BSRR |= (LED_LD2); // turn LED[n] on
GPIOA->BSRR |= (LED_LD2 << 16); // turn LED[n] off
rxParse(); // parse all the received bytes
if ((USART2->ISR & (1U << 7)) != 0) { // is TXE empty?
uint16_t b = getByte();
if (b != QS_EOD) { // not End-Of-Data?
USART2->TDR = (b & 0xFFU); // put into the DR register
}
}
}
// set inTestLoop to true in case calls to QS_onTestLoop() nest,
// which can happen through the calls to QS_TEST_PAUSE().
rxPriv_.inTestLoop = true;
}

View File

@ -0,0 +1,139 @@
/*****************************************************************************
* Product: Linker script for for STM32L053R8, GNU-ARM linker
* Last Updated for Version: 5.9.8
* Date of the Last Update: 2017-09-13
*
* Q u a n t u m L e a P s
* ---------------------------
* innovating embedded systems
*
* Copyright (C) Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact information:
* https://state-machine.com
* mailto:info@state-machine.com
*****************************************************************************/
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(Reset_Handler) /* entry Point */
MEMORY { /* memory map of STM32L053R8 */
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
}
/* The size of the stack used by the application. NOTE: you need to adjust */
STACK_SIZE = 1024;
/* The size of the heap used by the application. NOTE: you need to adjust */
HEAP_SIZE = 0;
SECTIONS {
.isr_vector : { /* the vector table goes FIRST into ROM */
KEEP(*(.isr_vector)) /* vector table */
. = ALIGN(4);
} >ROM
.text : { /* code and constants */
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} >ROM
.preinit_array : {
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >ROM
.init_array : {
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >ROM
.fini_array : {
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array*))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
} >ROM
_etext = .; /* global symbols at end of code */
.stack : {
__stack_start__ = .;
. = . + STACK_SIZE;
. = ALIGN(4);
__stack_end__ = .;
} >RAM
.data : AT (_etext) {
__data_load = LOADADDR (.data);
__data_start = .;
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
__data_end__ = .;
_edata = __data_end__;
} >RAM
.bss : {
__bss_start__ = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = .;
} >RAM
__exidx_start = .;
.ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >RAM
__exidx_end = .;
PROVIDE ( end = _ebss );
PROVIDE ( _end = _ebss );
PROVIDE ( __end__ = _ebss );
.heap : {
__heap_start__ = .;
. = . + HEAP_SIZE;
. = ALIGN(4);
__heap_end__ = .;
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ : {
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
}

View File

@ -1,13 +1,13 @@
//****************************************************************************
// Product: DPP example, EK-TM4C123GXL board, ThreadX kernel
// Last updated for version 6.9.1
// Last updated on 2020-09-21
// Last updated for version 6.9.4
// Last updated on 2021-12-05
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
//
// This program is open source software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
@ -69,6 +69,9 @@ static unsigned l_rnd; // random seed
PHILO_STAT = QP::QS_USER,
COMMAND_STAT
};
// QSpy source IDs
static QP::QSpyId const l_clock_tick = { QP::QS_AP_ID };
#endif
extern "C" {
@ -94,7 +97,6 @@ void UART0_IRQHandler(void) {
void UART0_IRQHandler(void) {}
#endif
} // extern "C"
// BSP functions =============================================================
@ -163,7 +165,8 @@ uint32_t BSP::random(void) { // a very cheap pseudo-random-number generator
uint32_t rnd = l_rnd * (3U*7U*11U*13U*23U);
l_rnd = rnd; /* set for the next time */
return (rnd >> 8);}
return l_rnd >> 8;
}
//............................................................................
void BSP::randomSeed(uint32_t seed) {
l_rnd = seed;
@ -182,13 +185,19 @@ namespace QP {
static TX_TIMER l_tick_timer; // ThreadX timer to call QF::tickX_()
#ifdef Q_SPY
// ThreadX thread and thread function for QS output, see NOTE1
static TX_THREAD l_qs_output_thread;
static void qs_thread_function(ULONG thread_input);
static ULONG qs_thread_stkSto[64];
// ThreadX "idle" thread for QS output, see NOTE1
static TX_THREAD idle_thread;
static void idle_thread_fun(ULONG thread_input);
static ULONG idle_thread_stack[64];
#endif
// QF callbacks ==============================================================
extern "C" {
static VOID timer_expiration(ULONG id) {
QP::QF::TICK_X(id, &DPP::l_clock_tick); // QF clock tick processing
}
} // extern "C"
//............................................................................
void QF::onStartup(void) {
//
// NOTE:
@ -202,8 +211,8 @@ void QF::onStartup(void) {
// or from active object(s).
//
Q_ALLEGE(tx_timer_create(&l_tick_timer, // ThreadX timer object
const_cast<CHAR *>("QF_TICK"), // name of the timer
(VOID (*)(ULONG))&QP::QF::tickX_, // expiration fun
const_cast<CHAR *>("QF_TICK"), // name of the timer
&timer_expiration, // expiration function
0U, // expiration function input (tick rate)
1U, // initial ticks
1U, // reschedule ticks
@ -213,14 +222,14 @@ void QF::onStartup(void) {
#ifdef Q_SPY
NVIC_EnableIRQ(UART0_IRQn); // UART0 interrupt used for QS-RX
// start a ThreadX timer to perform QS output. See NOTE1...
Q_ALLEGE(tx_thread_create(&l_qs_output_thread, // thread control block
const_cast<CHAR *>("QS_TX"), // thread name
&qs_thread_function, // thread function
// start a ThreadX "idle" thread. See NOTE1...
Q_ALLEGE(tx_thread_create(&idle_thread, // thread control block
const_cast<CHAR *>("idle"), // thread name
&idle_thread_fun, // thread function
0LU, // thread input (unsued)
qs_thread_stkSto, // stack start
sizeof(qs_thread_stkSto), // stack size in bytes
TX_MAX_PRIORITIES - 1U, // ThreadX priority (lowest possible)
idle_thread_stack, // stack start
sizeof(idle_thread_stack), // stack size in bytes
TX_MAX_PRIORITIES - 1U, // ThreadX priority (LOWEST possible), NOTE1
TX_MAX_PRIORITIES - 1U, // preemption threshold disabled
TX_NO_TIME_SLICE,
TX_AUTO_START)
@ -255,7 +264,7 @@ extern "C" Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {
#ifdef Q_SPY
//............................................................................
static void qs_thread_function(ULONG /*thread_input*/) { // see NOTE1
static void idle_thread_fun(ULONG /*thread_input*/) { // see NOTE1
for (;;) {
QS::rxParse(); // parse all the received bytes
@ -273,7 +282,7 @@ static void qs_thread_function(ULONG /*thread_input*/) { // see NOTE1
}
}
// no blocking in this thread; see NOTE1
// no blocking in this "idle" thread; see NOTE1
}
}
@ -395,12 +404,12 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
//****************************************************************************
// NOTE1:
// This application uses the ThreadX thread of the lowest priority to perform
// ThreadX apparently does not have a concpet of an "idle" thread, but
// it can be emulated by a regular, but NON-BLOCKING ThreadX thread of
// the lowest priority.
//
// In the Q_SPY configuration, this "idle" thread is uded to perform
// the QS data output to the host. This is not the only choice available, and
// other applications might choose to peform the QS output some other way.
//
// The lowest-priority thread does not block, so in effect, it becomes the
// idle loop. This presents no problems to ThreadX - its idle task in the
// scheduler does not need to run.
//

View File

@ -11,9 +11,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Debug\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>dbg</state>
@ -66,15 +70,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -96,27 +92,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -133,7 +115,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -156,7 +138,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -209,13 +191,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -343,10 +333,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -382,16 +368,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -483,7 +459,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -639,6 +615,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -678,13 +658,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -697,17 +673,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -1033,6 +1005,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1056,11 +1048,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -1077,9 +1064,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>BrowseInfoPath</name>
<state>Release\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>rel</state>
@ -1134,14 +1125,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -1162,27 +1145,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -1199,7 +1168,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1222,7 +1191,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1275,13 +1244,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1409,10 +1386,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -1448,16 +1421,6 @@
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -1549,7 +1512,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1705,6 +1668,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -1744,13 +1711,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -1763,17 +1726,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -2099,6 +2058,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2122,11 +2101,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -2143,9 +2117,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Spy\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>spy</state>
@ -2200,14 +2178,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -2228,27 +2198,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -2265,7 +2221,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2288,7 +2244,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2341,13 +2297,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2475,10 +2439,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -2514,16 +2474,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -2615,7 +2565,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2771,6 +2721,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -2810,13 +2764,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -2829,17 +2779,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -3165,6 +3111,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3188,11 +3154,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -3255,6 +3216,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_dyn.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_mem.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf_pkg.h</name>
</file>

View File

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// Product: DPP example for ThreadX
// Last updated for version 6.9.3
// Last updated on 2021-04-08
// Last updated for version 6.9.4
// Last updated on 2021-12-05
//
// Q u a n t u m L e a P s
// ------------------------
@ -51,12 +51,13 @@ static ULONG l_tableStk[256]; // stack for the Table
//............................................................................
int main() {
DPP::BSP::init(); // initialize the Board Support Package
tx_kernel_enter(); // transfet control to the ThreadX RTOS
return 0; // tx_kernel_enter() does not return
}
//............................................................................
void tx_application_define(void * /*first_unused_memory*/) {
DPP::BSP::init(); // initialize the Board Support Package
// initialize the framework and the underlying RT kernel...
QP::QF::init();
@ -68,12 +69,12 @@ void tx_application_define(void * /*first_unused_memory*/) {
sizeof(l_smlPoolSto[0]));
QS_OBJ_DICTIONARY(l_smlPoolSto);
QS_OBJ_DICTIONARY(l_tableQueueSto);
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
QS_OBJ_DICTIONARY(DPP::AO_Table);
QS_OBJ_DICTIONARY(DPP::AO_Philo[0]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[1]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[2]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[3]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[4]);
// start the active objects...
for (uint8_t n = 0; n < N_PHILO; ++n) {

View File

@ -1,13 +1,13 @@
//****************************************************************************
// Product: DPP example, STM32F4-Discovery board, ThreadX kernel
// Last updated for version 6.9.1
// Last updated on 2020-09-21
// Last updated for version 6.9.4
// Last updated on 2021-12-05
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
//
// This program is open source software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
@ -67,13 +67,27 @@ static unsigned l_rnd; // random seed
QP::QSTimeCtr QS_tickPeriod_;
enum AppRecords { // application-specific trace records
PHILO_STAT = QP::QS_USER
PHILO_STAT = QP::QS_USER,
COMMAND_STAT
};
// QSpy source IDs
static QP::QSpyId const l_clock_tick = { QP::QS_AP_ID };
#endif
extern "C" {
// ISRs used in this project =================================================
#ifdef Q_SPY
//
// ISR for receiving bytes from the QSPY Back-End
// NOTE: This ISR is "QF-unaware" meaning that it does not interact with
// the QF/QK and is not disabled. Such ISRs don't need to call QK_ISR_ENTRY/
// QK_ISR_EXIT and they cannot post or publish events.
//
//TBD...
#endif
} // extern "C"
@ -133,6 +147,7 @@ void BSP::init(void) {
Q_ERROR();
}
QS_USR_DICTIONARY(PHILO_STAT);
QS_USR_DICTIONARY(COMMAND_STAT);
// setup the QS filters...
QS_GLB_FILTER(QP::QS_ALL_RECORDS);
@ -200,13 +215,19 @@ namespace QP {
static TX_TIMER l_tick_timer; // ThreadX timer to call QF::tickX_()
#ifdef Q_SPY
// ThreadX thread and thread function for QS output, see NOTE1
static TX_THREAD l_qs_output_thread;
static void qs_thread_function(ULONG thread_input);
static ULONG qs_thread_stkSto[64];
// ThreadX "idle" thread for QS output, see NOTE1
static TX_THREAD idle_thread;
static void idle_thread_fun(ULONG thread_input);
static ULONG idle_thread_stack[64];
#endif
// QF callbacks ==============================================================
extern "C" {
static VOID timer_expiration(ULONG id) {
QP::QF::TICK_X(id, &DPP::l_clock_tick); // QF clock tick processing
}
} // extern "C"
//............................................................................
void QF::onStartup(void) {
//
// NOTE:
@ -220,8 +241,8 @@ void QF::onStartup(void) {
// or from active object(s).
//
Q_ALLEGE(tx_timer_create(&l_tick_timer, // ThreadX timer object
const_cast<CHAR *>("QF_TICK"), // name of the timer
(VOID (*)(ULONG))&QP::QF::tickX_, // expiration fun
const_cast<CHAR *>("QF_TICK"), // name of the timer
&timer_expiration, // expiration function
0U, // expiration function input (tick rate)
1U, // initial ticks
1U, // reschedule ticks
@ -229,14 +250,16 @@ void QF::onStartup(void) {
== TX_SUCCESS);
#ifdef Q_SPY
// start a ThreadX timer to perform QS output. See NOTE1...
Q_ALLEGE(tx_thread_create(&l_qs_output_thread, // thread control block
const_cast<CHAR *>("QS_TX"), // thread name
&qs_thread_function, // thread function
//TBD: enable the UART ISR for receiving bytes...
// start a ThreadX "idle" thread. See NOTE1...
Q_ALLEGE(tx_thread_create(&idle_thread, // thread control block
const_cast<CHAR *>("idle"), // thread name
&idle_thread_fun, // thread function
0LU, // thread input (unsued)
qs_thread_stkSto, // stack start
sizeof(qs_thread_stkSto), // stack size in bytes
TX_MAX_PRIORITIES - 1U, // ThreadX priority (lowest possible)
idle_thread_stack, // stack start
sizeof(idle_thread_stack), // stack size in bytes
TX_MAX_PRIORITIES - 1U, // ThreadX priority (LOWEST possible), NOTE1
TX_MAX_PRIORITIES - 1U, // preemption threshold disabled
TX_NO_TIME_SLICE,
TX_AUTO_START)
@ -262,10 +285,13 @@ extern "C" Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {
#ifdef Q_SPY
//............................................................................
static void qs_thread_function(ULONG /*thread_input*/) { // see NOTE1
static void idle_thread_fun(ULONG /*thread_input*/) { // see NOTE1
for (;;) {
// also perform QS RX/TX
QP::QS::rxParse(); // parse all the received bytes
// turn the LED6 on an off to visualize the QS activity
LED_GPIO_PORT->BSRRL = LED6_PIN; // turn LED on
LED_GPIO_PORT->BSRRL = LED6_PIN; /* turn LED on */
__NOP(); // wait a little to actually see the LED glow
__NOP();
__NOP();
@ -280,14 +306,14 @@ static void qs_thread_function(ULONG /*thread_input*/) { // see NOTE1
b = QP::QS::getByte();
QF_CRIT_EXIT(intStat);
if (b != QP::QS_EOD) { // not End-Of-Data?
if (b != QS_EOD) { // not End-Of-Data?
USART2->DR = (b & 0xFFU); // put into the DR register
}
}
// no blocking in this thread; see NOTE1
// no blocking in this "idle" thread; see NOTE1
}
}
//............................................................................
bool QS::onStartup(void const *arg) {
static uint8_t qsBuf[2*1024]; // buffer for Quantum Spy
@ -325,6 +351,9 @@ bool QS::onStartup(void const *arg) {
USART_Cmd(USART2, ENABLE); // enable USART2
// configure UART interrupts (for the RX channel)
//TBD...
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
@ -364,7 +393,7 @@ void QS::onReset(void) {
//TBD
}
//............................................................................
//! callback function to execute a uesr command (to be implemented in BSP)
//! callback function to execute a user command (to be implemented in BSP)
void QS::onCommand(uint8_t cmdId, uint32_t param1,
uint32_t param2, uint32_t param3)
{
@ -372,23 +401,29 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
(void)param1;
(void)param2;
(void)param3;
//TBD
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_U32(8, param2);
QS_U32(8, param3);
QS_END()
}
#endif // Q_SPY
//----------------------------------------------------------------------------
} // namespace QP
//****************************************************************************
// NOTE1:
// This application uses the ThreadX thread of the lowest priority to perform
// ThreadX apparently does not have a concpet of an "idle" thread, but
// it can be emulated by a regular, but NON-BLOCKING ThreadX thread of
// the lowest priority.
//
// In the Q_SPY configuration, this "idle" thread is uded to perform
// the QS data output to the host. This is not the only choice available, and
// other applications might choose to peform the QS output some other way.
//
// The lowest-priority thread does not block, so in effect, it becomes the
// idle loop. This presents no problems to ThreadX - its idle task in the
// scheduler does not need to run.
//

View File

@ -11,9 +11,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Debug\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>dbg</state>
@ -66,15 +70,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -96,27 +92,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -133,7 +115,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -156,7 +138,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -209,13 +191,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -343,10 +333,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -383,16 +369,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -484,7 +460,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -640,6 +616,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -679,13 +659,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -698,17 +674,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -1034,6 +1006,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1057,11 +1049,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -1078,9 +1065,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>BrowseInfoPath</name>
<state>Release\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>rel</state>
@ -1135,14 +1126,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>STM32F407VG ST STM32F407VG</state>
@ -1163,27 +1146,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1200,7 +1169,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1223,7 +1192,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1276,13 +1245,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1410,10 +1387,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -1450,16 +1423,6 @@
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -1551,7 +1514,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1707,6 +1670,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -1746,13 +1713,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -1765,17 +1728,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -2101,6 +2060,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2124,11 +2103,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -2145,9 +2119,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Spy\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>spy</state>
@ -2200,15 +2178,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -2230,27 +2200,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -2267,7 +2223,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2290,7 +2246,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2343,13 +2299,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2477,10 +2441,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -2517,16 +2477,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -2618,7 +2568,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2774,6 +2724,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -2813,13 +2767,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -2832,17 +2782,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -3168,6 +3114,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3191,11 +3157,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -3243,6 +3204,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_dyn.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_mem.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf_pkg.h</name>
</file>

View File

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// Product: DPP example for ThreadX
// Last updated for version 6.9.3
// Last updated on 2021-04-08
// Last updated for version 6.9.4
// Last updated on 2021-12-05
//
// Q u a n t u m L e a P s
// ------------------------
@ -51,12 +51,13 @@ static ULONG l_tableStk[256]; // stack for the Table
//............................................................................
int main() {
DPP::BSP::init(); // initialize the Board Support Package
tx_kernel_enter(); // transfet control to the ThreadX RTOS
return 0; // tx_kernel_enter() does not return
}
//............................................................................
void tx_application_define(void * /*first_unused_memory*/) {
DPP::BSP::init(); // initialize the Board Support Package
// initialize the framework and the underlying RT kernel...
QP::QF::init();
@ -68,12 +69,12 @@ void tx_application_define(void * /*first_unused_memory*/) {
sizeof(l_smlPoolSto[0]));
QS_OBJ_DICTIONARY(l_smlPoolSto);
QS_OBJ_DICTIONARY(l_tableQueueSto);
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
QS_OBJ_DICTIONARY(DPP::AO_Table);
QS_OBJ_DICTIONARY(DPP::AO_Philo[0]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[1]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[2]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[3]);
QS_OBJ_DICTIONARY(DPP::AO_Philo[4]);
// start the active objects...
for (uint8_t n = 0; n < N_PHILO; ++n) {

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -117,10 +117,6 @@
<pMon>BIN\lmidk-agdi.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
@ -496,10 +492,6 @@
<pMon>BIN\lmidk-agdi.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
@ -922,6 +914,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\src\qf\qf_mem.cpp</PathWithFileName>
<FilenameWithoutPath>qf_mem.cpp</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -932,7 +936,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>27</FileNumber>
<FileNumber>28</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -944,7 +948,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>28</FileNumber>
<FileNumber>29</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -956,7 +960,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>29</FileNumber>
<FileNumber>30</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -968,7 +972,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>30</FileNumber>
<FileNumber>31</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -988,7 +992,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>31</FileNumber>
<FileNumber>32</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1000,7 +1004,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>32</FileNumber>
<FileNumber>33</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1012,7 +1016,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>33</FileNumber>
<FileNumber>34</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1024,7 +1028,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>34</FileNumber>
<FileNumber>35</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1044,7 +1048,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>35</FileNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1056,7 +1060,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>36</FileNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1068,7 +1072,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>37</FileNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1080,7 +1084,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>38</FileNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1092,7 +1096,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>39</FileNumber>
<FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1104,7 +1108,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>40</FileNumber>
<FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1116,7 +1120,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>41</FileNumber>
<FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1128,7 +1132,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>42</FileNumber>
<FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1140,7 +1144,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>43</FileNumber>
<FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1152,7 +1156,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>44</FileNumber>
<FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1172,7 +1176,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>45</FileNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1184,7 +1188,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>46</FileNumber>
<FileNumber>47</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1196,7 +1200,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>47</FileNumber>
<FileNumber>48</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1208,7 +1212,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>48</FileNumber>
<FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

View File

@ -10,7 +10,7 @@
<TargetName>dpp-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -522,6 +523,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>
@ -610,7 +616,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -904,6 +910,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1070,7 +1077,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1241,6 +1248,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>
@ -1329,7 +1341,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1623,6 +1635,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1789,7 +1802,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1960,6 +1973,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>

View File

@ -11,9 +11,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Debug\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>dbg</state>
@ -66,15 +70,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -96,27 +92,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -133,7 +115,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -156,7 +138,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -209,13 +191,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -343,10 +333,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..</state>
@ -383,16 +369,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -484,7 +460,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -640,6 +616,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -679,13 +659,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -698,17 +674,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -1034,6 +1006,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1057,11 +1049,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -1078,9 +1065,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>BrowseInfoPath</name>
<state>Release\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>rel</state>
@ -1135,14 +1126,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.40.2.22864</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -1163,27 +1146,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1200,7 +1169,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1223,7 +1192,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1276,13 +1245,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1411,10 +1388,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..</state>
@ -1451,16 +1424,6 @@
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -1552,7 +1515,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1708,6 +1671,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -1747,13 +1714,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -1766,17 +1729,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -2102,6 +2061,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2125,11 +2104,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -2146,9 +2120,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Spy\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>spy</state>
@ -2203,14 +2181,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.40.2.22864</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -2231,27 +2201,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2268,7 +2224,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2291,7 +2247,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2344,13 +2300,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2479,10 +2443,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..</state>
@ -2519,16 +2479,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -2620,7 +2570,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2776,6 +2726,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -2815,13 +2769,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -2834,17 +2784,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -3170,6 +3116,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3193,11 +3159,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -3278,6 +3239,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_dyn.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_mem.cpp</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_ps.cpp</name>
</file>

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -817,7 +817,7 @@
<Group>
<GroupName>QP</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -941,6 +941,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\src\qf\qf_mem.cpp</PathWithFileName>
<FilenameWithoutPath>qf_mem.cpp</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -951,7 +963,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>25</FileNumber>
<FileNumber>26</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -963,7 +975,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>26</FileNumber>
<FileNumber>27</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -975,7 +987,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>27</FileNumber>
<FileNumber>28</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -987,7 +999,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>28</FileNumber>
<FileNumber>29</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1007,7 +1019,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>29</FileNumber>
<FileNumber>30</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1019,7 +1031,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>30</FileNumber>
<FileNumber>31</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1031,7 +1043,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>31</FileNumber>
<FileNumber>32</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1043,7 +1055,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>32</FileNumber>
<FileNumber>33</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1063,7 +1075,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>33</FileNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1075,7 +1087,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>34</FileNumber>
<FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1087,7 +1099,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>35</FileNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1099,7 +1111,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>36</FileNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1111,7 +1123,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>37</FileNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1123,7 +1135,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>38</FileNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1135,7 +1147,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>39</FileNumber>
<FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1147,7 +1159,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>40</FileNumber>
<FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1159,7 +1171,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>41</FileNumber>
<FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1171,7 +1183,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>42</FileNumber>
<FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1191,7 +1203,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>43</FileNumber>
<FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1203,7 +1215,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>44</FileNumber>
<FileNumber>45</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1215,7 +1227,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>45</FileNumber>
<FileNumber>46</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1227,7 +1239,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>46</FileNumber>
<FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

View File

@ -10,7 +10,7 @@
<TargetName>dpp-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -512,6 +513,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>
@ -600,7 +606,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -894,6 +900,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1060,7 +1067,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1221,6 +1228,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>
@ -1309,7 +1321,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1603,6 +1615,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1769,7 +1782,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1930,6 +1943,11 @@
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.cpp</FilePath>
</File>
<File>
<FileName>qf_mem.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.cpp</FilePath>
</File>
</Files>
</Group>
<Group>

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ for Windows and POSIX *HOSTS*
# Last updated for version 6.8.2
# Last updated on 2020-06-23
# Last updated for version 6.9.4
# Last updated on 2021-11-05
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
@ -56,13 +56,10 @@ PROJECT := dpp
#
# list of all source directories used by this project
VPATH = . \
cont \
comp
VPATH = .
# list of all include directories needed by this project
INCLUDES := -I. \
-Icont
INCLUDES := -I.
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPCPP),)

View File

@ -1,13 +1,13 @@
//****************************************************************************
// Product: DPP example (console)
// Last Updated for Version: 6.9.3
// Date of the Last Update: 2021-03-03
// Last Updated for Version: 6.9.4
// Date of the Last Update: 2021-11-05
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2018 Quantum Leaps, LLC. All rights reserved.
// Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
//
// This program is open source software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
@ -85,7 +85,7 @@ void BSP::terminate(int16_t result) {
void BSP::displayPhilStat(uint8_t n, char const *stat) {
PRINTF_S("Philosopher %2d is %s\n", (int)n, stat);
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
QS_BEGIN_ID(PHILO_STAT, AO_Table->m_prio) // app-specific record begin
QS_U8(1, n); // Philosopher number
QS_STR(stat); // Philosopher status
QS_END()

View File

@ -1,122 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--${Comp}-->
<package name="Comp" stereotype="0x02" namespace="DPP::">
<!--${Comp::Philo}-->
<class name="Philo" superclass="qpcpp::QHsm">
<!--${Comp::Philo::m_timeEvt}-->
<attribute name="m_timeEvt" type="CompTimeEvt" visibility="0x02" properties="0x00"/>
<!--${Comp::Philo::class Table}-->
<attribute name="class Table" type="friend" visibility="0x02" properties="0x00"/>
<!--${Comp::Philo::Philo}-->
<operation name="Philo" type="" visibility="0x00" properties="0x00">
<code> : QHsm(&amp;initial),
m_timeEvt(AO_Table, this, TIMEOUT_SIG, 0U)</code>
</operation>
<!--${Comp::Philo::SM}-->
<statechart properties="0x00">
<!--${Comp::Philo::SM::initial}-->
<initial target="../1">
<action>static bool registered = false; // starts off with 0, per C-standard
(void)e; // suppress the compiler warning about unused parameter
if (!registered) {
registered = true;
QS_FUN_DICTIONARY(&amp;initial);
QS_FUN_DICTIONARY(&amp;thinking);
QS_FUN_DICTIONARY(&amp;hungry);
QS_FUN_DICTIONARY(&amp;eating);
}
QS_SIG_DICTIONARY(HUNGRY_SIG, this); // signal for each Philo</action>
<initial_glyph conn="2,3,5,1,20,5,-4">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${Comp::Philo::SM::thinking}-->
<state name="thinking">
<entry>m_timeEvt.armX(think_time(), 0U);</entry>
<exit>(void)m_timeEvt.disarm();</exit>
<!--${Comp::Philo::SM::thinking::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../2">
<tran_glyph conn="2,14,3,1,20,12,-4">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<!--${Comp::Philo::SM::thinking::TEST}-->
<tran trig="TEST">
<tran_glyph conn="2,18,3,-1,12">
<action box="0,-2,11,4"/>
</tran_glyph>
</tran>
<state_glyph node="2,5,16,17">
<entry box="1,2,5,2"/>
<exit box="1,4,5,2"/>
</state_glyph>
</state>
<!--${Comp::Philo::SM::hungry}-->
<state name="hungry">
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe-&gt;philo = this;
AO_Table-&gt;postLIFO(pe);</entry>
<!--${Comp::Philo::SM::hungry::EAT}-->
<tran trig="EAT" target="../../3">
<tran_glyph conn="2,31,3,1,19,9,-3">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,24,16,12">
<entry box="1,2,5,2"/>
</state_glyph>
</state>
<!--${Comp::Philo::SM::eating}-->
<state name="eating">
<entry>m_timeEvt.armX(eat_time(), 0U);</entry>
<exit>(void)m_timeEvt.disarm();
// asynchronously post event to the Container
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe-&gt;philo = this;
AO_Table-&gt;postLIFO(pe);</exit>
<!--${Comp::Philo::SM::eating::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../1">
<tran_glyph conn="2,48,3,1,22,-38,-6">
<action box="0,-2,12,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,38,16,14">
<entry box="1,2,5,2"/>
<exit box="1,4,5,2"/>
</state_glyph>
</state>
<state_diagram size="28,54"/>
</statechart>
</class>
<!--${Comp::.}-->
<directory name=".">
<!--${Comp::.::philo.cpp}-->
<file name="philo.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;dpp.hpp&quot;
#include &quot;bsp.hpp&quot;
Q_DEFINE_THIS_FILE
namespace DPP {
// helper function to provide a randomized think time for Philos
inline QP::QTimeEvtCtr think_time() {
return static_cast&lt;QP::QTimeEvtCtr&gt;((BSP::random() % BSP::TICKS_PER_SEC)
+ (BSP::TICKS_PER_SEC/2U));
}
// helper function to provide a randomized eat time for Philos
inline QP::QTimeEvtCtr eat_time() {
return static_cast&lt;QP::QTimeEvtCtr&gt;((BSP::random() % BSP::TICKS_PER_SEC)
+ BSP::TICKS_PER_SEC);
}
} // namespace DPP
// Philo definition ----------------------------------------------------------
$define(Comp::Philo)</text>
</file>
</directory>
</package>

View File

@ -1,390 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--${Cont}-->
<package name="Cont" stereotype="0x02" namespace="DPP::">
<!--${Cont::TableEvt}-->
<class name="TableEvt" superclass="qpcpp::QEvt">
<!--${Cont::TableEvt::philo}-->
<attribute name="philo" type="DPP::Philo *" visibility="0x00" properties="0x00"/>
</class>
<!--${Cont::CompTimeEvt}-->
<class name="CompTimeEvt" superclass="qpcpp::QTimeEvt">
<documentation>Specialized time event for components. The time evnet can be owned by a component and can dispatch itself to the component.</documentation>
<!--${Cont::CompTimeEvt::m_comp}-->
<attribute name="m_comp" type="QP::QHsm *" visibility="0x00" properties="0x00"/>
<!--${Cont::CompTimeEvt::CompTimeEvt}-->
<operation name="CompTimeEvt" type="" visibility="0x00" properties="0x00">
<documentation>The constructor to initialize a Component Time Event.
When creating a time event, you must commit it to a specific active object 'act', event signal 'sig', and tick rate 'tickRate'. You cannot change these attributes later.</documentation>
<!--${Cont::CompTimeEvt::CompTimeEvt::act}-->
<parameter name="act" type="QP::QActive *"/>
<!--${Cont::CompTimeEvt::CompTimeEvt::comp}-->
<parameter name="comp" type="QP::QHsm *"/>
<!--${Cont::CompTimeEvt::CompTimeEvt::sig}-->
<parameter name="sig" type="enum_t const"/>
<!--${Cont::CompTimeEvt::CompTimeEvt::tickRate}-->
<parameter name="tickRate" type="uint_fast8_t const"/>
<code> : QTimeEvt(act, sig, tickRate)
m_comp = comp;</code>
</operation>
<!--${Cont::CompTimeEvt::dispatchToComp}-->
<operation name="dispatchToComp" type="void" visibility="0x00" properties="0x02">
<specifiers>const</specifiers>
<!--${Cont::CompTimeEvt::dispatchToComp::qs_id}-->
<parameter name="qs_id" type="std::uint_fast8_t const"/>
<code>m_comp-&gt;dispatch(this, qs_id);</code>
</operation>
</class>
<!--${Cont::Table}-->
<class name="Table" superclass="qpcpp::QActive">
<!--${Cont::Table::inst}-->
<attribute name="inst" type="Table" visibility="0x00" properties="0x01">
<documentation>The only static instance of the Table class (Singleton pattern)</documentation>
</attribute>
<!--${Cont::Table::m_philo[N_PHILO]}-->
<attribute name="m_philo[N_PHILO]" type="Philo" visibility="0x02" properties="0x00">
<documentation>Embedded component state machine objects</documentation>
</attribute>
<!--${Cont::Table::m_fork[N_PHILO]}-->
<attribute name="m_fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
<!--${Cont::Table::m_isHungry[N_PHILO]}-->
<attribute name="m_isHungry[N_PHILO]" type="bool" visibility="0x02" properties="0x00"/>
<!--${Cont::Table::Table}-->
<operation name="Table" type="" visibility="0x00" properties="0x00">
<code> : QActive(Q_STATE_CAST(&amp;Table::initial))
for (uint8_t n = 0U; n &lt; N_PHILO; ++n) {
m_fork[n] = FREE;
m_isHungry[n] = false;
}</code>
</operation>
<!--${Cont::Table::SM}-->
<statechart properties="0x02">
<!--${Cont::Table::SM::initial}-->
<initial target="../1/3">
<action>(void)e; // unused parameter
QS_OBJ_DICTIONARY(&amp;Table::inst);
QS_OBJ_DICTIONARY(&amp;m_philo[0]);
QS_OBJ_DICTIONARY(&amp;m_philo[0].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[1]);
QS_OBJ_DICTIONARY(&amp;m_philo[1].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[2]);
QS_OBJ_DICTIONARY(&amp;m_philo[2].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[3]);
QS_OBJ_DICTIONARY(&amp;m_philo[3].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[4]);
QS_OBJ_DICTIONARY(&amp;m_philo[4].m_timeEvt);
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, (void *)0);
QS_SIG_DICTIONARY(TIMEOUT_SIG, (void *)0);
subscribe(PAUSE_SIG);
subscribe(SERVE_SIG);
subscribe(TEST_SIG);
for (uint8_t n = 0U; n &lt; N_PHILO; ++n) {
m_philo[n].init(m_prio); // top-most initial tran.
m_fork[n] = FREE;
m_isHungry[n] = false;
BSP::displayPhilStat(n, THINKING);
}</action>
<initial_glyph conn="3,3,5,1,45,23,-10">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${Cont::Table::SM::active}-->
<state name="active">
<!--${Cont::Table::SM::active::TIMEOUT}-->
<tran trig="TIMEOUT">
<action>Q_EVT_CAST(CompTimeEvt)-&gt;dispatchToComp(m_prio);</action>
<tran_glyph conn="2,11,3,-1,14">
<action box="0,-2,11,4"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::EAT}-->
<tran trig="EAT">
<action>Q_ERROR();</action>
<tran_glyph conn="2,15,3,-1,14">
<action box="0,-2,10,4"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::TEST}-->
<tran trig="TEST">
<tran_glyph conn="2,20,3,-1,14">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving}-->
<state name="serving">
<entry brief="give pending permitions to eat">for (uint8_t n = 0U; n &lt; N_PHILO; ++n) { // give permissions to eat...
if (m_isHungry[n]
&amp;&amp; (m_fork[LEFT(n)] == FREE)
&amp;&amp; (m_fork[n] == FREE))
{
m_fork[LEFT(n)] = USED;
m_fork[n] = USED;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &amp;m_philo[n];
m_philo[n].dispatch(&amp;evt, m_prio);
m_isHungry[n] = false;
BSP::displayPhilStat(n, EATING);
}
}</entry>
<!--${Cont::Table::SM::active::serving::HUNGRY}-->
<tran trig="HUNGRY">
<action>// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)-&gt;philo - &amp;m_philo[0]);
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, HUNGRY);
uint8_t m = LEFT(n);</action>
<!--${Cont::Table::SM::active::serving::HUNGRY::[bothfree]}-->
<choice>
<guard brief="both free">(m_fork[m] == FREE) &amp;&amp; (m_fork[n] == FREE)</guard>
<action>m_fork[m] = USED;
m_fork[n] = USED;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &amp;m_philo[n];
m_philo[n].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(n, EATING);</action>
<choice_glyph conn="19,31,5,-1,10">
<action box="1,0,10,2"/>
</choice_glyph>
</choice>
<!--${Cont::Table::SM::active::serving::HUNGRY::[else]}-->
<choice>
<guard>else</guard>
<action>m_isHungry[n] = true;</action>
<choice_glyph conn="19,31,4,-1,5,10">
<action box="1,5,6,2"/>
</choice_glyph>
</choice>
<tran_glyph conn="4,31,3,-1,15">
<action box="0,-2,8,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::DONE}-->
<tran trig="DONE">
<action>// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)-&gt;philo - &amp;m_philo[0]);
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, THINKING);
uint8_t m = LEFT(n);
// both forks of Phil[n] must be used
Q_ASSERT((m_fork[n] == USED) &amp;&amp; (m_fork[m] == USED));
m_fork[m] = FREE;
m_fork[n] = FREE;
m = RIGHT(n); // check the right neighbor
if (m_isHungry[m] &amp;&amp; (m_fork[m] == FREE)) {
m_fork[n] = USED;
m_fork[m] = USED;
m_isHungry[m] = false;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &amp;m_philo[m];
m_philo[m].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(m, EATING);
}
m = LEFT(n); // check the left neighbor
n = LEFT(m); // left fork of the left neighbor
if (m_isHungry[m] &amp;&amp; (m_fork[n] == FREE)) {
m_fork[m] = USED;
m_fork[n] = USED;
m_isHungry[m] = false;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &amp;m_philo[m];
m_philo[m].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(m, EATING);
}</action>
<tran_glyph conn="4,39,3,-1,15">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::EAT}-->
<tran trig="EAT">
<action>Q_ERROR();</action>
<tran_glyph conn="4,42,3,-1,15">
<action box="0,-2,12,4"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::PAUSE}-->
<tran trig="PAUSE" target="../../4">
<tran_glyph conn="4,46,3,1,37,6,-3">
<action box="0,-2,7,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,24,34,24">
<entry box="1,2,27,2"/>
</state_glyph>
</state>
<!--${Cont::Table::SM::active::paused}-->
<state name="paused">
<entry>BSP::displayPaused(1U);</entry>
<exit>BSP::displayPaused(0U);</exit>
<!--${Cont::Table::SM::active::paused::SERVE}-->
<tran trig="SERVE" target="../../3">
<tran_glyph conn="4,62,3,1,39,-29,-5">
<action box="0,-2,12,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::paused::HUNGRY}-->
<tran trig="HUNGRY">
<action>// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)-&gt;philo - &amp;m_philo[0]);
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
m_isHungry[n] = true;
BSP::displayPhilStat(n, HUNGRY);</action>
<tran_glyph conn="4,65,3,-1,15">
<action box="0,-2,9,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::paused::DONE}-->
<tran trig="DONE">
<action>// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)-&gt;philo - &amp;m_philo[0]);
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, THINKING);
uint8_t m = LEFT(n);
// both forks of Phil[n] must be used
Q_ASSERT((m_fork[n] == USED) &amp;&amp; (m_fork[m] == USED));
m_fork[m] = FREE;
m_fork[n] = FREE;</action>
<tran_glyph conn="4,68,3,-1,15">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,50,34,20">
<entry box="1,2,18,4"/>
<exit box="1,6,18,4"/>
</state_glyph>
</state>
<state_glyph node="2,5,44,67"/>
</state>
<state_diagram size="50,74"/>
</statechart>
</class>
<!--${Cont::AO_Table}-->
<attribute name="AO_Table" type="QP::QActive * const" visibility="0x00" properties="0x00">
<code>= &amp;Table::inst; // opaque pointer</code>
</attribute>
<!--${Cont::.}-->
<directory name=".">
<!--${Cont::.::dpp.hpp}-->
<file name="dpp.hpp">
<text>#ifndef DPP_HPP
#define DPP_HPP
namespace DPP {
enum DPPSignals {
TIMEOUT_SIG = QP::Q_USER_SIG, // time event timeout
EAT_SIG, // published by Table to let a philosopher eat
DONE_SIG, // published by Philosopher when done eating
PAUSE_SIG, // published by BSP to pause the application
SERVE_SIG, // published by BSP to serve re-start serving forks
TEST_SIG, // published by BSP to test the application
MAX_PUB_SIG, // the last published signal
HUNGRY_SIG, // posted direclty to Table from hungry Philo
MAX_SIG // the last signal
};
class Philo; // forward declaration
} // namespace DPP
enum {
N_PHILO = 5 // number of Philos
};
$declare(Cont::CompTimeEvt)
$declare(Cont::AO_Table)
$declare(Comp::Philo)
$declare(Cont::TableEvt)
#endif // DPP_HPP</text>
</file>
<!--${Cont::.::table.cpp}-->
<file name="table.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;dpp.hpp&quot;
#include &quot;bsp.hpp&quot;
Q_DEFINE_THIS_FILE
// Active object class -------------------------------------------------------
$declare(Cont::Table)
namespace DPP {
// helper function to provide the RIGHT neighbour of a Philo[n]
inline uint8_t RIGHT(uint8_t const n) {
return static_cast&lt;uint8_t&gt;((n + (N_PHILO - 1U)) % N_PHILO);
}
// helper function to provide the LEFT neighbour of a Philo[n]
inline uint8_t LEFT(uint8_t const n) {
return static_cast&lt;uint8_t&gt;((n + 1U) % N_PHILO);
}
static uint8_t const FREE = static_cast&lt;uint8_t&gt;(0);
static uint8_t const USED = static_cast&lt;uint8_t&gt;(1);
static char_t const * const THINKING = &amp;&quot;thinking&quot;[0];
static char_t const * const HUNGRY = &amp;&quot;hungry &quot;[0];
static char_t const * const EATING = &amp;&quot;eating &quot;[0];
// Local objects -------------------------------------------------------------
static Table l_table; // the single instance of the Table active object
// Global-scope objects ------------------------------------------------------
QP::QActive * const AO_Table = &amp;l_table; // &quot;opaque&quot; AO pointer
} // namespace DPP
//............................................................................
$define(Cont::CompTimeEvt)
$define(Cont::Table)</text>
</file>
</directory>
</package>

View File

@ -1,9 +1,9 @@
//.$file${Cont::.::dpp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//.$file${.::dpp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: dpp.qm
// File: ${Cont::.::dpp.hpp}
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -15,7 +15,7 @@
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//.$endhead${Cont::.::dpp.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$endhead${.::dpp.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#ifndef DPP_HPP
#define DPP_HPP
@ -48,17 +48,13 @@ namespace DPP {
//.${Cont::CompTimeEvt} ......................................................
class CompTimeEvt : public QP::QTimeEvt {
public:
QP::QHsm * m_comp;
uint8_t id;
public:
CompTimeEvt(
QP::QActive * act,
QP::QHsm * comp,
enum_t const sig,
uint_fast8_t const tickRate);
void dispatchToComp(std::uint_fast8_t const qs_id) const {
m_comp->dispatch(this, qs_id);
}
};
} // namespace DPP
@ -83,6 +79,8 @@ private:
public:
Philo();
uint8_t getId() noexcept;
void setId(uint8_t id) noexcept;
protected:
Q_STATE_DECL(initial);
@ -100,7 +98,7 @@ namespace DPP {
//.${Cont::TableEvt} .........................................................
class TableEvt : public QP::QEvt {
public:
DPP::Philo * philo;
uint8_t philo_id;
};
} // namespace DPP

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.0" links="1">
<model version="5.1.3" links="1">
<documentation>Dining Philosopher Problem example with the &quot;Orthogonal Component&quot; state pattern (see https://www.state-machine.com/doc/Pattern_Orthogonal.pdf)
The model demonstrates the following features:
@ -12,6 +12,514 @@ The model demonstrates the following features:
6. Component to Container communication via asynchronous event posting using the LIFO policy.</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>
<package file="./cont/cont.qmp"/>
<package file="./comp/comp.qmp"/>
<!--${Cont}-->
<package name="Cont" stereotype="0x02" namespace="DPP::">
<!--${Cont::TableEvt}-->
<class name="TableEvt" superclass="qpcpp::QEvt">
<!--${Cont::TableEvt::philo_id}-->
<attribute name="philo_id" type="uint8_t" visibility="0x00" properties="0x00"/>
</class>
<!--${Cont::CompTimeEvt}-->
<class name="CompTimeEvt" superclass="qpcpp::QTimeEvt">
<documentation>Specialized time event for components. The time evnet can be owned by a component and can dispatch itself to the component.</documentation>
<!--${Cont::CompTimeEvt::id}-->
<attribute name="id" type="uint8_t" visibility="0x00" properties="0x00"/>
<!--${Cont::CompTimeEvt::CompTimeEvt}-->
<operation name="CompTimeEvt" type="" visibility="0x00" properties="0x00">
<documentation>The constructor to initialize a Component Time Event.
When creating a time event, you must commit it to a specific active object 'act', event signal 'sig', and tick rate 'tickRate'. You cannot change these attributes later.</documentation>
<!--${Cont::CompTimeEvt::CompTimeEvt::act}-->
<parameter name="act" type="QP::QActive *"/>
<!--${Cont::CompTimeEvt::CompTimeEvt::sig}-->
<parameter name="sig" type="enum_t const"/>
<!--${Cont::CompTimeEvt::CompTimeEvt::tickRate}-->
<parameter name="tickRate" type="uint_fast8_t const"/>
<code> : QTimeEvt(act, sig, tickRate)</code>
</operation>
</class>
<!--${Cont::Table}-->
<class name="Table" superclass="qpcpp::QActive">
<!--${Cont::Table::inst}-->
<attribute name="inst" type="Table" visibility="0x00" properties="0x01">
<documentation>The only static instance of the Table class (Singleton pattern)</documentation>
</attribute>
<!--${Cont::Table::m_philo[N_PHILO]}-->
<attribute name="m_philo[N_PHILO]" type="Philo" visibility="0x02" properties="0x00">
<documentation>Embedded component state machine objects</documentation>
</attribute>
<!--${Cont::Table::m_fork[N_PHILO]}-->
<attribute name="m_fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
<!--${Cont::Table::m_isHungry[N_PHILO]}-->
<attribute name="m_isHungry[N_PHILO]" type="bool" visibility="0x02" properties="0x00"/>
<!--${Cont::Table::Table}-->
<operation name="Table" type="" visibility="0x00" properties="0x00">
<code> : QActive(Q_STATE_CAST(&amp;Table::initial))
for (uint8_t n = 0U; n &lt; N_PHILO; ++n) {
m_fork[n] = FREE;
m_isHungry[n] = false;
m_philo[n].setId(n);
}</code>
</operation>
<!--${Cont::Table::SM}-->
<statechart properties="0x02">
<!--${Cont::Table::SM::initial}-->
<initial target="../1/3">
<action>(void)e; // unused parameter
QS_OBJ_DICTIONARY(&amp;Table::inst);
QS_OBJ_DICTIONARY(&amp;m_philo[0]);
QS_OBJ_DICTIONARY(&amp;m_philo[0].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[1]);
QS_OBJ_DICTIONARY(&amp;m_philo[1].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[2]);
QS_OBJ_DICTIONARY(&amp;m_philo[2].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[3]);
QS_OBJ_DICTIONARY(&amp;m_philo[3].m_timeEvt);
QS_OBJ_DICTIONARY(&amp;m_philo[4]);
QS_OBJ_DICTIONARY(&amp;m_philo[4].m_timeEvt);
// global signals
QS_SIG_DICTIONARY(DONE_SIG, (void *)0);
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, (void *)0);
QS_SIG_DICTIONARY(TIMEOUT_SIG, (void *)0);
subscribe(PAUSE_SIG);
subscribe(SERVE_SIG);
subscribe(TEST_SIG);
for (uint8_t n = 0U; n &lt; N_PHILO; ++n) {
m_philo[n].init(m_prio); // top-most initial tran.
m_fork[n] = FREE;
m_isHungry[n] = false;
BSP::displayPhilStat(n, THINKING);
}</action>
<initial_glyph conn="2,4,5,1,44,23,-8">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${Cont::Table::SM::active}-->
<state name="active">
<!--${Cont::Table::SM::active::EAT}-->
<tran trig="EAT">
<action>Q_ERROR();</action>
<tran_glyph conn="2,16,3,-1,14">
<action box="0,-2,10,4"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::TEST}-->
<tran trig="TEST">
<tran_glyph conn="2,20,3,-1,14">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::TIMEOUT}-->
<tran trig="TIMEOUT">
<action>uint8_t id = Q_EVT_CAST(CompTimeEvt)-&gt;id;
m_philo[id].dispatch(e, m_prio);</action>
<tran_glyph conn="2,12,3,-1,14">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving}-->
<state name="serving">
<entry brief="give pending permitions to eat">for (uint8_t n = 0U; n &lt; N_PHILO; ++n) { // give permissions to eat...
if (m_isHungry[n]
&amp;&amp; (m_fork[LEFT(n)] == FREE)
&amp;&amp; (m_fork[n] == FREE))
{
m_fork[LEFT(n)] = USED;
m_fork[n] = USED;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo_id = m_philo[n].getId();
m_philo[n].dispatch(&amp;evt, m_prio);
m_isHungry[n] = false;
BSP::displayPhilStat(n, EATING);
}
}</entry>
<!--${Cont::Table::SM::active::serving::HUNGRY}-->
<tran trig="HUNGRY">
<action>// find the index of the Philo from the event
uint8_t n = Q_EVT_CAST(TableEvt)-&gt;philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, HUNGRY);
uint8_t m = LEFT(n);</action>
<!--${Cont::Table::SM::active::serving::HUNGRY::[bothfree]}-->
<choice>
<guard brief="both free">(m_fork[m] == FREE) &amp;&amp; (m_fork[n] == FREE)</guard>
<action>m_fork[m] = USED;
m_fork[n] = USED;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo_id = m_philo[n].getId();
m_philo[n].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(n, EATING);</action>
<choice_glyph conn="20,32,5,-1,10">
<action box="1,0,10,2"/>
</choice_glyph>
</choice>
<!--${Cont::Table::SM::active::serving::HUNGRY::[else]}-->
<choice>
<guard>else</guard>
<action>m_isHungry[n] = true;</action>
<choice_glyph conn="20,32,4,-1,4,10">
<action box="1,4,6,2"/>
</choice_glyph>
</choice>
<tran_glyph conn="4,32,3,-1,16">
<action box="0,-2,8,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::DONE}-->
<tran trig="DONE">
<action>// find the index of the Philo from the event
uint8_t n = Q_EVT_CAST(TableEvt)-&gt;philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, THINKING);
uint8_t m = LEFT(n);
// both forks of Phil[n] must be used
Q_ASSERT((m_fork[n] == USED) &amp;&amp; (m_fork[m] == USED));
m_fork[m] = FREE;
m_fork[n] = FREE;
m = RIGHT(n); // check the right neighbor
if (m_isHungry[m] &amp;&amp; (m_fork[m] == FREE)) {
m_fork[n] = USED;
m_fork[m] = USED;
m_isHungry[m] = false;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo_id = m_philo[m].getId();
m_philo[m].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(m, EATING);
}
m = LEFT(n); // check the left neighbor
n = LEFT(m); // left fork of the left neighbor
if (m_isHungry[m] &amp;&amp; (m_fork[n] == FREE)) {
m_fork[m] = USED;
m_fork[n] = USED;
m_isHungry[m] = false;
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo_id = m_philo[m].getId();
m_philo[m].dispatch(&amp;evt, m_prio);
BSP::displayPhilStat(m, EATING);
}</action>
<tran_glyph conn="4,40,3,-1,16">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::EAT}-->
<tran trig="EAT">
<action>Q_ERROR();</action>
<tran_glyph conn="4,44,3,-1,16">
<action box="0,-2,12,4"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::serving::PAUSE}-->
<tran trig="PAUSE" target="../../4">
<tran_glyph conn="4,48,3,1,36,8,-2">
<action box="0,-2,7,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,24,34,26">
<entry box="1,2,27,2"/>
</state_glyph>
</state>
<!--${Cont::Table::SM::active::paused}-->
<state name="paused">
<entry>BSP::displayPaused(1U);</entry>
<exit>BSP::displayPaused(0U);</exit>
<!--${Cont::Table::SM::active::paused::SERVE}-->
<tran trig="SERVE" target="../../3">
<tran_glyph conn="4,66,3,1,38,-32,-4">
<action box="0,-2,12,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::paused::HUNGRY}-->
<tran trig="HUNGRY">
<action>// find the index of the Philo from the event
uint8_t n = Q_EVT_CAST(TableEvt)-&gt;philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
m_isHungry[n] = true;
BSP::displayPhilStat(n, HUNGRY);</action>
<tran_glyph conn="4,70,3,-1,16">
<action box="0,-2,9,2"/>
</tran_glyph>
</tran>
<!--${Cont::Table::SM::active::paused::DONE}-->
<tran trig="DONE">
<action>// find the index of the Philo from the event
uint8_t n = Q_EVT_CAST(TableEvt)-&gt;philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n &lt; N_PHILO) &amp;&amp; (!m_isHungry[n]));
BSP::displayPhilStat(n, THINKING);
uint8_t m = LEFT(n);
// both forks of Phil[n] must be used
Q_ASSERT((m_fork[n] == USED) &amp;&amp; (m_fork[m] == USED));
m_fork[m] = FREE;
m_fork[n] = FREE;</action>
<tran_glyph conn="4,74,3,-1,16">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,52,34,24">
<entry box="1,2,18,4"/>
<exit box="1,6,18,4"/>
</state_glyph>
</state>
<state_glyph node="2,6,42,72"/>
</state>
<state_diagram size="48,82"/>
</statechart>
</class>
<!--${Cont::AO_Table}-->
<attribute name="AO_Table" type="QP::QActive * const" visibility="0x00" properties="0x00">
<code>= &amp;Table::inst; // opaque pointer</code>
</attribute>
</package>
<!--${Comp}-->
<package name="Comp" stereotype="0x02" namespace="DPP::">
<!--${Comp::Philo}-->
<class name="Philo" superclass="qpcpp::QHsm">
<!--${Comp::Philo::m_timeEvt}-->
<attribute name="m_timeEvt" type="CompTimeEvt" visibility="0x02" properties="0x00"/>
<!--${Comp::Philo::class Table}-->
<attribute name="class Table" type="friend" visibility="0x02" properties="0x00"/>
<!--${Comp::Philo::Philo}-->
<operation name="Philo" type="" visibility="0x00" properties="0x00">
<code> : QHsm(&amp;initial),
m_timeEvt(AO_Table, TIMEOUT_SIG, 0U)</code>
</operation>
<!--${Comp::Philo::getId}-->
<operation name="getId" type="uint8_t" visibility="0x00" properties="0x00">
<specifiers>noexcept</specifiers>
<code>return m_timeEvt.id;</code>
</operation>
<!--${Comp::Philo::setId}-->
<operation name="setId" type="void" visibility="0x00" properties="0x00">
<specifiers>noexcept</specifiers>
<!--${Comp::Philo::setId::id}-->
<parameter name="id" type="uint8_t"/>
<code>m_timeEvt.id = id;</code>
</operation>
<!--${Comp::Philo::SM}-->
<statechart properties="0x00">
<!--${Comp::Philo::SM::initial}-->
<initial target="../1">
<action>static bool registered = false; // starts off with 0, per C-standard
(void)e; // suppress the compiler warning about unused parameter
if (!registered) {
registered = true;
QS_FUN_DICTIONARY(&amp;initial);
QS_FUN_DICTIONARY(&amp;thinking);
QS_FUN_DICTIONARY(&amp;hungry);
QS_FUN_DICTIONARY(&amp;eating);
}
QS_SIG_DICTIONARY(HUNGRY_SIG, this); // signal for each Philo</action>
<initial_glyph conn="2,3,5,1,20,5,-4">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${Comp::Philo::SM::thinking}-->
<state name="thinking">
<entry>m_timeEvt.armX(think_time(), 0U);</entry>
<exit>(void)m_timeEvt.disarm();</exit>
<!--${Comp::Philo::SM::thinking::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../2">
<tran_glyph conn="2,14,3,1,20,12,-4">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<!--${Comp::Philo::SM::thinking::TEST}-->
<tran trig="TEST">
<tran_glyph conn="2,18,3,-1,12">
<action box="0,-2,11,4"/>
</tran_glyph>
</tran>
<state_glyph node="2,5,16,17">
<entry box="1,2,5,2"/>
<exit box="1,4,5,2"/>
</state_glyph>
</state>
<!--${Comp::Philo::SM::hungry}-->
<state name="hungry">
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe-&gt;philo_id = getId();
AO_Table-&gt;postLIFO(pe);</entry>
<!--${Comp::Philo::SM::hungry::EAT}-->
<tran trig="EAT" target="../../3">
<tran_glyph conn="2,31,3,1,19,9,-3">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,24,16,12">
<entry box="1,2,5,2"/>
</state_glyph>
</state>
<!--${Comp::Philo::SM::eating}-->
<state name="eating">
<entry>m_timeEvt.armX(eat_time(), 0U);</entry>
<exit>(void)m_timeEvt.disarm();
// asynchronously post event to the Container
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe-&gt;philo_id = getId();
AO_Table-&gt;postLIFO(pe);</exit>
<!--${Comp::Philo::SM::eating::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../1">
<tran_glyph conn="2,48,3,1,22,-38,-6">
<action box="0,-2,12,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,38,16,14">
<entry box="1,2,5,2"/>
<exit box="1,4,5,2"/>
</state_glyph>
</state>
<state_diagram size="28,54"/>
</statechart>
</class>
</package>
<!--${.}-->
<directory name=".">
<!--${.::dpp.hpp}-->
<file name="dpp.hpp">
<text>#ifndef DPP_HPP
#define DPP_HPP
namespace DPP {
enum DPPSignals {
TIMEOUT_SIG = QP::Q_USER_SIG, // time event timeout
EAT_SIG, // published by Table to let a philosopher eat
DONE_SIG, // published by Philosopher when done eating
PAUSE_SIG, // published by BSP to pause the application
SERVE_SIG, // published by BSP to serve re-start serving forks
TEST_SIG, // published by BSP to test the application
MAX_PUB_SIG, // the last published signal
HUNGRY_SIG, // posted direclty to Table from hungry Philo
MAX_SIG // the last signal
};
class Philo; // forward declaration
} // namespace DPP
enum {
N_PHILO = 5 // number of Philos
};
$declare ${Cont::CompTimeEvt}
$declare ${Cont::AO_Table}
$declare ${Comp::Philo}
$declare ${Cont::TableEvt}
#endif // DPP_HPP</text>
</file>
<!--${.::table.cpp}-->
<file name="table.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;dpp.hpp&quot;
#include &quot;bsp.hpp&quot;
Q_DEFINE_THIS_FILE
// Active object class -------------------------------------------------------
$declare ${Cont::Table}
namespace DPP {
// helper function to provide the RIGHT neighbour of a Philo[n]
inline uint8_t RIGHT(uint8_t const n) {
return static_cast&lt;uint8_t&gt;((n + (N_PHILO - 1U)) % N_PHILO);
}
// helper function to provide the LEFT neighbour of a Philo[n]
inline uint8_t LEFT(uint8_t const n) {
return static_cast&lt;uint8_t&gt;((n + 1U) % N_PHILO);
}
static uint8_t const FREE = static_cast&lt;uint8_t&gt;(0);
static uint8_t const USED = static_cast&lt;uint8_t&gt;(1);
static char_t const * const THINKING = &quot;thinking&quot;;
static char_t const * const HUNGRY = &quot;hungry &quot;;
static char_t const * const EATING = &quot;eating &quot;;
// Local objects -------------------------------------------------------------
static Table l_table; // the single instance of the Table active object
// Global-scope objects ------------------------------------------------------
QP::QActive * const AO_Table = &amp;l_table; // &quot;opaque&quot; AO pointer
} // namespace DPP
//............................................................................
$define ${Cont::CompTimeEvt}
$define ${Cont::Table}</text>
</file>
<!--${.::philo.cpp}-->
<file name="philo.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;dpp.hpp&quot;
#include &quot;bsp.hpp&quot;
Q_DEFINE_THIS_FILE
namespace DPP {
// helper function to provide a randomized think time for Philos
inline QP::QTimeEvtCtr think_time() {
return static_cast&lt;QP::QTimeEvtCtr&gt;((BSP::random() % BSP::TICKS_PER_SEC)
+ (BSP::TICKS_PER_SEC/2U));
}
// helper function to provide a randomized eat time for Philos
inline QP::QTimeEvtCtr eat_time() {
return static_cast&lt;QP::QTimeEvtCtr&gt;((BSP::random() % BSP::TICKS_PER_SEC)
+ BSP::TICKS_PER_SEC);
}
} // namespace DPP
// Philo definition ----------------------------------------------------------
$define ${Comp::Philo}</text>
</file>
</directory>
</model>

View File

@ -1,9 +1,9 @@
//.$file${Comp::.::philo.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//.$file${.::philo.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: dpp.qm
// File: ${Comp::.::philo.cpp}
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -15,7 +15,7 @@
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//.$endhead${Comp::.::philo.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$endhead${.::philo.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#include "qpcpp.hpp"
#include "dpp.hpp"
#include "bsp.hpp"
@ -41,8 +41,8 @@ inline QP::QTimeEvtCtr eat_time() {
// Philo definition ----------------------------------------------------------
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//. Check for the minimum required QP version
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.8.0 or higher required
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$define${Comp::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
@ -52,9 +52,19 @@ namespace DPP {
//.${Comp::Philo::Philo} .....................................................
Philo::Philo()
: QHsm(&initial),
m_timeEvt(AO_Table, this, TIMEOUT_SIG, 0U)
m_timeEvt(AO_Table, TIMEOUT_SIG, 0U)
{}
//.${Comp::Philo::getId} .....................................................
uint8_t Philo::getId() noexcept {
return m_timeEvt.id;
}
//.${Comp::Philo::setId} .....................................................
void Philo::setId(uint8_t id) noexcept {
m_timeEvt.id = id;
}
//.${Comp::Philo::SM} ........................................................
Q_STATE_DEF(Philo, initial) {
//.${Comp::Philo::SM::initial}
@ -110,7 +120,7 @@ Q_STATE_DEF(Philo, hungry) {
//.${Comp::Philo::SM::hungry}
case Q_ENTRY_SIG: {
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe->philo = this;
pe->philo_id = getId();
AO_Table->postLIFO(pe);
status_ = Q_RET_HANDLED;
break;
@ -143,7 +153,7 @@ Q_STATE_DEF(Philo, eating) {
// asynchronously post event to the Container
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe->philo = this;
pe->philo_id = getId();
AO_Table->postLIFO(pe);
status_ = Q_RET_HANDLED;
break;

View File

@ -1,9 +1,9 @@
//.$file${Cont::.::table.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//.$file${.::table.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: dpp.qm
// File: ${Cont::.::table.cpp}
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -15,7 +15,7 @@
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//.$endhead${Cont::.::table.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$endhead${.::table.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#include "qpcpp.hpp"
#include "dpp.hpp"
#include "bsp.hpp"
@ -64,9 +64,9 @@ inline uint8_t LEFT(uint8_t const n) {
static uint8_t const FREE = static_cast<uint8_t>(0);
static uint8_t const USED = static_cast<uint8_t>(1);
static char_t const * const THINKING = &"thinking"[0];
static char_t const * const HUNGRY = &"hungry "[0];
static char_t const * const EATING = &"eating "[0];
static char_t const * const THINKING = "thinking";
static char_t const * const HUNGRY = "hungry ";
static char_t const * const EATING = "eating ";
// Local objects -------------------------------------------------------------
static Table l_table; // the single instance of the Table active object
@ -80,8 +80,8 @@ QP::QActive * const AO_Table = &l_table; // "opaque" AO pointer
//............................................................................
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//. Check for the minimum required QP version
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.8.0 or higher required
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$define${Cont::CompTimeEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
@ -91,14 +91,10 @@ namespace DPP {
//.${Cont::CompTimeEvt::CompTimeEvt} .........................................
CompTimeEvt::CompTimeEvt(
QP::QActive * act,
QP::QHsm * comp,
enum_t const sig,
uint_fast8_t const tickRate)
: QTimeEvt(act, sig, tickRate)
{
m_comp = comp;
}
{}
} // namespace DPP
//.$enddef${Cont::CompTimeEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -115,6 +111,7 @@ Table::Table()
for (uint8_t n = 0U; n < N_PHILO; ++n) {
m_fork[n] = FREE;
m_isHungry[n] = false;
m_philo[n].setId(n);
}
}
@ -135,7 +132,8 @@ Q_STATE_DEF(Table, initial) {
QS_OBJ_DICTIONARY(&m_philo[4]);
QS_OBJ_DICTIONARY(&m_philo[4].m_timeEvt);
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
// global signals
QS_SIG_DICTIONARY(DONE_SIG, (void *)0);
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
@ -144,7 +142,6 @@ Q_STATE_DEF(Table, initial) {
QS_SIG_DICTIONARY(HUNGRY_SIG, (void *)0);
QS_SIG_DICTIONARY(TIMEOUT_SIG, (void *)0);
subscribe(PAUSE_SIG);
subscribe(SERVE_SIG);
subscribe(TEST_SIG);
@ -166,12 +163,6 @@ Q_STATE_DEF(Table, initial) {
Q_STATE_DEF(Table, active) {
QP::QState status_;
switch (e->sig) {
//.${Cont::Table::SM::active::TIMEOUT}
case TIMEOUT_SIG: {
Q_EVT_CAST(CompTimeEvt)->dispatchToComp(m_prio);
status_ = Q_RET_HANDLED;
break;
}
//.${Cont::Table::SM::active::EAT}
case EAT_SIG: {
Q_ERROR();
@ -183,6 +174,13 @@ Q_STATE_DEF(Table, active) {
status_ = Q_RET_HANDLED;
break;
}
//.${Cont::Table::SM::active::TIMEOUT}
case TIMEOUT_SIG: {
uint8_t id = Q_EVT_CAST(CompTimeEvt)->id;
m_philo[id].dispatch(e, m_prio);
status_ = Q_RET_HANDLED;
break;
}
default: {
status_ = super(&top);
break;
@ -207,7 +205,7 @@ Q_STATE_DEF(Table, serving) {
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &m_philo[n];
evt.philo_id = m_philo[n].getId();
m_philo[n].dispatch(&evt, m_prio);
m_isHungry[n] = false;
@ -220,7 +218,7 @@ Q_STATE_DEF(Table, serving) {
//.${Cont::Table::SM::active::serving::HUNGRY}
case HUNGRY_SIG: {
// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)->philo - &m_philo[0]);
uint8_t n = Q_EVT_CAST(TableEvt)->philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n < N_PHILO) && (!m_isHungry[n]));
@ -234,7 +232,7 @@ Q_STATE_DEF(Table, serving) {
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &m_philo[n];
evt.philo_id = m_philo[n].getId();
m_philo[n].dispatch(&evt, m_prio);
BSP::displayPhilStat(n, EATING);
@ -250,7 +248,7 @@ Q_STATE_DEF(Table, serving) {
//.${Cont::Table::SM::active::serving::DONE}
case DONE_SIG: {
// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)->philo - &m_philo[0]);
uint8_t n = Q_EVT_CAST(TableEvt)->philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n < N_PHILO) && (!m_isHungry[n]));
@ -271,7 +269,7 @@ Q_STATE_DEF(Table, serving) {
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &m_philo[m];
evt.philo_id = m_philo[m].getId();
m_philo[m].dispatch(&evt, m_prio);
BSP::displayPhilStat(m, EATING);
@ -286,7 +284,7 @@ Q_STATE_DEF(Table, serving) {
// synchronoulsy dispatch EAT event to the Philo component
TableEvt evt;
evt.sig = EAT_SIG;
evt.philo = &m_philo[m];
evt.philo_id = m_philo[m].getId();
m_philo[m].dispatch(&evt, m_prio);
BSP::displayPhilStat(m, EATING);
@ -336,7 +334,7 @@ Q_STATE_DEF(Table, paused) {
//.${Cont::Table::SM::active::paused::HUNGRY}
case HUNGRY_SIG: {
// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)->philo - &m_philo[0]);
uint8_t n = Q_EVT_CAST(TableEvt)->philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n < N_PHILO) && (!m_isHungry[n]));
@ -348,7 +346,7 @@ Q_STATE_DEF(Table, paused) {
//.${Cont::Table::SM::active::paused::DONE}
case DONE_SIG: {
// find the index of the Philo from the event
uint8_t n = (Q_EVT_CAST(TableEvt)->philo - &m_philo[0]);
uint8_t n = Q_EVT_CAST(TableEvt)->philo_id;
// philo ID must be in range and he must be not hungry
Q_ASSERT((n < N_PHILO) && (!m_isHungry[n]));

View File

@ -1,4 +1,4 @@
QHsmTst example, QEP 6.9.1
QHsmTst example, QEP 6.9.4
top-INIT;s-ENTRY;s2-ENTRY;s2-INIT;s21-ENTRY;s211-ENTRY;
A:s21-A;s211-EXIT;s21-EXIT;s21-ENTRY;s21-INIT;s211-ENTRY;
B:s21-B;s211-EXIT;s211-ENTRY;

View File

@ -3,7 +3,7 @@
// Model: qhsmtst.qm
// File: ${.::qhsmtst.cpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
@ -48,8 +48,8 @@ QP::QHsm * const the_hsm = &l_hsmtst; // the opaque pointer
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//. Check for the minimum required QP version
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.8.0 or higher required
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#endif
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//.$define${HSMs::QHsmTst} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

View File

@ -3,7 +3,7 @@
// Model: qhsmtst.qm
// File: ${.::qhsmtst.hpp}
//
// This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.0" links="1">
<model version="5.1.3" links="1">
<documentation>QHsmTst is a contrived state machine from Chapter 2 of the PSiCC2 book for testing all possible transition topologies with up to 4-levels of state nesting.</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,8 +3,8 @@
/// @ingroup qs
/// @cond
///***************************************************************************
/// Last updated for version 6.9.3
/// Last updated on 2021-02-26
/// Last updated for version 6.9.4
/// Last updated on 2021-10-07
///
/// Q u a n t u m L e a P s
/// ------------------------
@ -295,7 +295,7 @@ using QSCtr = std::uint_fast16_t;
//! QP::QS::getByte() function.
constexpr std::uint16_t QS_EOD = 0xFFFFU;
//! QS logging facilities
//! QS software tracing facilities
/// @description
/// This class groups together QS services. It has only static members and
/// should not be instantiated.

View File

@ -2,8 +2,8 @@
/// @brief QF/C++ port to ThreadX kernel, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 6.9.3
/// Last updated on 2021-04-08
/// Last updated for version 6.9.4
/// Last updated on 2021-12-05
///
/// Q u a n t u m L e a P s
/// ------------------------
@ -66,7 +66,7 @@ enum ThreadX_ThreadAttrs {
#include "qep_port.hpp" // QEP port
#include "qequeue.hpp" // used for event deferral
#include "qmpool.hpp" // used for QS-RX
#include "qmpool.hpp" // native QF event pool
#include "qpset.hpp" // used for publish/subscribe
#include "qf.hpp" // QF platform-independent public interface
@ -106,32 +106,14 @@ enum ThreadX_ThreadAttrs {
extern ULONG volatile _tx_thread_system_state;
}
// TreadX block pool operations...
#define QF_EPOOL_TYPE_ TX_BLOCK_POOL
#define QF_EPOOL_INIT_(pool_, poolSto_, poolSize_, evtSize_) \
Q_ALLEGE(tx_block_pool_create(&(pool_), \
const_cast<CHAR *>("QP"), (evtSize_), \
(poolSto_), (poolSize_)) == TX_SUCCESS)
#define QF_EPOOL_EVENT_SIZE_(pool_) \
(static_cast<std::uint_fast16_t>((pool_).tx_block_pool_block_size))
#define QF_EPOOL_GET_(pool_, e_, margin_, qs_id_) do { \
QF_CRIT_STAT_ \
QF_CRIT_E_(); \
if ((pool_).tx_block_pool_available > (margin_)) { \
Q_ALLEGE(tx_block_allocate(&(pool_), \
reinterpret_cast<VOID **>(&(e_)), TX_NO_WAIT) \
== TX_SUCCESS); \
} \
else { \
(e_) = nullptr; \
} \
QF_CRIT_X_(); \
} while (false)
#define QF_EPOOL_PUT_(dummy, e_, qs_id_) \
Q_ALLEGE(tx_block_release(static_cast<VOID *>(e_)) == TX_SUCCESS)
// native QF event pool operations...
#define QF_EPOOL_TYPE_ QMPool
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
(p_).init((poolSto_), (poolSize_), (evtSize_))
#define QF_EPOOL_EVENT_SIZE_(p_) ((p_).getBlockSize())
#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
((e_) = static_cast<QEvt *>((p_).get((m_), (qs_id_))))
#define QF_EPOOL_PUT_(p_, e_, qs_id_) ((p_).put((e_), (qs_id_)))
#endif // ifdef QP_IMPL

View File

@ -2,8 +2,8 @@
/// @brief QF/C++ port to uC/OS-II (V2.92) kernel, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 6.9.3
/// Last updated on 2021-04-08
/// Last updated for version 6.9.4
/// Last updated on 2021-12-05
///
/// Q u a n t u m L e a P s
/// ------------------------
@ -102,32 +102,14 @@ enum UCOS2_TaskAttrs {
} \
} while (false)
// uC/OS-II event pool operations...
#define QF_EPOOL_TYPE_ OS_MEM*
#define QF_EPOOL_INIT_(pool_, poolSto_, poolSize_, evtSize_) do { \
INT8U err; \
(pool_) = OSMemCreate((poolSto_), (INT32U)((poolSize_)/(evtSize_)), \
(INT32U)(evtSize_), &err); \
Q_ASSERT_ID(105, err == OS_ERR_NONE); \
} while (false)
#define QF_EPOOL_EVENT_SIZE_(pool_) ((pool_)->OSMemBlkSize)
#define QF_EPOOL_GET_(pool_, e_, m_, qs_id_) do { \
QF_CRIT_STAT_ \
QF_CRIT_E_(); \
if ((pool_)->OSMemNFree > (m_)) { \
INT8U err; \
(e_) = (QEvt *)OSMemGet((pool_), &err); \
Q_ASSERT_ID(205, err == OS_ERR_NONE); \
} \
else { \
(e_) = nullptr; \
} \
QF_CRIT_X_(); \
} while (false)
#define QF_EPOOL_PUT_(pool_, e_, qs_id_) \
Q_ALLEGE_ID(305, OSMemPut((pool_), (e_)) == OS_ERR_NONE)
// native QF event pool operations...
#define QF_EPOOL_TYPE_ QMPool
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
(p_).init((poolSto_), (poolSize_), (evtSize_))
#define QF_EPOOL_EVENT_SIZE_(p_) ((p_).getBlockSize())
#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
((e_) = static_cast<QEvt *>((p_).get((m_), (qs_id_))))
#define QF_EPOOL_PUT_(p_, e_, qs_id_) ((p_).put((e_), (qs_id_)))
#endif // ifdef QP_IMPL

View File

@ -2,14 +2,14 @@
/// @brief QP::QActive::QActive() definition
/// @cond
///***************************************************************************
/// Last updated for version 6.8.0
/// Last updated on 2020-01-13
/// Last updated for version 6.9.4
/// Last updated on 2021-10-07
///
/// Q u a n t u m L e a P s
/// ------------------------
/// Modern Embedded Software
///
/// Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
///
/// This program is open source software: you can redistribute it and/or
/// modify it under the terms of the GNU General Public License as published
@ -45,8 +45,6 @@ QActive::QActive(QStateHandler const initial) noexcept
: QHsm(initial),
m_prio(0U)
{
m_state.fun = Q_STATE_CAST(&QHsm::top);
#ifdef QF_OS_OBJECT_TYPE
QF::bzero(&m_osObject, sizeof(m_osObject));
#endif

View File

@ -4,7 +4,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 6.9.4
/// Last updated on 2021-09-03
/// Last updated on 2021-09-16
///
/// Q u a n t u m L e a P s
/// ------------------------
@ -305,20 +305,21 @@ QTimeEvt::QTimeEvt() noexcept
/// a specified interval. If the interval is zero, the time event is armed
/// for one shot ('one-shot' time event). The time event gets directly posted
/// (using the FIFO policy) into the event queue of the host active object.
/// After posting, a one-shot time event gets automatically disarmed
/// while a periodic time event (interval != 0) is automatically re-armed.
///
/// A time event can be disarmed at any time by calling
/// QP::QTimeEvt::disarm(). Also, a time event can be re-armed to fire in a
/// different number of clock ticks by calling the QP::QTimeEvt::rearm().
///
/// @param[in] nTicks number of clock ticks (at the associated rate)
/// to rearm the time event with.
/// @param[in] interval interval (in clock ticks) for periodic time event.
///
/// @note
/// After posting, a one-shot time event gets automatically disarmed
/// while a periodic time event (interval != 0) is automatically re-armed.
///
/// @note
/// A time event can be disarmed at any time by calling
/// QP::QTimeEvt::disarm(). Also, a time event can be re-armed to fire in a
/// different number of clock ticks by calling the QP::QTimeEvt::rearm()
/// function.
/// @attention
/// Arming an already armed time event is __not__ allowed and is considered
/// a programming error. The QP/C++ framework will assert if it detects an
/// attempt to arm an already armed time event.
///
/// @usage
/// The following example shows how to arm a one-shot time event from a state