diff --git a/.gitignore b/.gitignore
index 114d074..8673e48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,25 @@
-nxpvee-mimxrt595-evk-round-fp/lib/
-nxpvee-mimxrt595-evk-round-configuration/target~/
-nxpvee-mimxrt595-evk-round-configuration/dropins/include/
-nxpvee-mimxrt595-evk-round-configuration/dropins/javaLibs/
-nxpvee-mimxrt595-evk-round-configuration/dropins/mocks/
-nxpvee-mimxrt595-evk-round-configuration/dropins/scripts/
-nxpvee-mimxrt595-evk-round-configuration/dropins/tools/license-checker.jar
-nxpvee-mimxrt595-evk-round-configuration/dropins/tools/imagegenerator-vectorimage.jar
-nxpvee-mimxrt595-evk-round-configuration/dropins/resources/os/
-nxpvee-mimxrt595-evk-round-configuration/dropins/workbenchExtension_*
-nxpvee-mimxrt595-evk-round-bsp/projects/microej/platform/
-MIMXRT595-*-CM4hardfp_GCC48-*
-nxpvee-mimxrt595-evk-round-imageGenerator/bin/
-nxpvee-mimxrt595-evk-round-configuration/dropins/scripts/init-microvg/microvginit.xml
-nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_patch/
+microej/front-panel/lib/
+microej/vee-port-configuration/target~/
+microej/vee-port-configuration/dropins/include/
+microej/vee-port-configuration/dropins/javaLibs/
+microej/vee-port-configuration/dropins/mocks/
+microej/vee-port-configuration/dropins/scripts/
+microej/vee-port-configuration/dropins/tools/license-checker.jar
+microej/vee-port-configuration/dropins/tools/imagegenerator-vectorimage.jar
+microej/vee-port-configuration/dropins/resources/os/
+microej/vee-port-configuration/dropins/workbenchExtension_*
+microej/vee-port-configuration/dropins/scripts/init-microvg/microvginit.xml
+microej/imageGenerator/bin/
+microej/apps/launchers/*.properties
+microej/MIMXRT595-*-CM4hardfp_GCC48-*
-nxpvee-mimxrt595-evk-round-apps/launchers/*.properties
+bsp/projects/microej/vglite_patch/
+bsp/projects/microej/platform/
+bsp/projects/nxpvee-ui/armgcc/mcux_include.json
+bsp/projects/nxpvee-ui/armgcc/tree_version.c
+bsp/mcux-sdk
+bsp/projects/nxpvee-ui/armgcc/debug
+bsp/projects/nxpvee-ui/armgcc/release
# ctags files
tags
@@ -41,6 +46,3 @@ CMakeCache.txt
.ninja_deps
build.ninja
rules.ninja
-nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/tree_version.c
-nxpvee-mimxrt595-evk-round-bsp/mcux-sdk
-nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/debug
diff --git a/.vscode/cmake-kits.json b/.vscode/cmake-kits.json
deleted file mode 100644
index ecf8f99..0000000
--- a/.vscode/cmake-kits.json
+++ /dev/null
@@ -1,11 +0,0 @@
-[
- {
- "name": "armgcc",
- "keep": true,
- "cmakeSettings": {
- "LANGUAGE": "C",
- "DEBUG_CONSOLE": "UART"
- },
- "toolchainFile": "${workspaceFolder}/nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/tools/cmake_toolchain_files/armgcc.cmake"
- }
-]
diff --git a/.vscode/cmake-variants.json b/.vscode/cmake-variants.json
deleted file mode 100644
index d7a2d1c..0000000
--- a/.vscode/cmake-variants.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "build_type": {
- "default": "debug",
- "choices": {
- "debug": {
- "short": "debug",
- "buildType": "debug"
- },
- "release": {
- "short": "release",
- "buildType": "release"
- }
- }
- }
-}
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 93786ab..c7a773a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -16,15 +16,15 @@
],
"program": "",
"miDebuggerServerAddress": "",
+ "miDebuggerPath": "",
"variables": {
"mcuxStopAtSymbol": "main",
- "mcuxSerialNumber": "02280000082d27a600000000000000000000000097969905",
"mcuxAttach": "false",
- "mcuxRemoteProbeType": ""
+ "mcuxSerialNumber": "",
},
"logging": {
"engineLogging": false
}
}
]
-}
\ No newline at end of file
+}
diff --git a/.vscode/mcuxpresso-tools.json b/.vscode/mcuxpresso-tools.json
index d6e629f..4227fd1 100644
--- a/.vscode/mcuxpresso-tools.json
+++ b/.vscode/mcuxpresso-tools.json
@@ -1,26 +1,17 @@
{
- "version": "1.1",
+ "version": "1.4",
"toolchainPath": "${env:ARMGCC_DIR}",
- "toolchainVersion": "GNU Arm Embedded Toolchain 10.3-2021.10",
"linkedProjects": [],
"trustZoneType": "none",
+ "multicoreType": "none",
"debug": {
"linkserver": {
"device": "MIMXRT595S:EVK-MIMXRT595",
"core": "primary"
},
- "pemicro": {},
"segger": {
"device": "MIMXRT595S_M33"
}
},
- "projectType": "sdk-freestanding",
- "sdk": {
- "version": "2.12.1",
- "path": "${workspaceFolder}/nxpvee-mimxrt595-evk-round-bsp/mcux-sdk",
- "boardId": "evkmimxrt595",
- "deviceId": "MIMXRT595S",
- "coreId": "cm33_MIMXRT595S",
- "manifestId": "SDK_2.x_EVK-MIMXRT595_manifest_v3_13"
- }
+ "projectType": "cmake-freestanding"
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index ead4a0f..b6d7430 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,11 +1,7 @@
{
"cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "disabled",
- "cmake.preferredGenerators": [
- "Ninja",
- "Unix Makefiles",
- "MinGW Makefiles"
- ],
- "cmake.sourceDirectory": "${workspaceFolder}/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc",
- "cmake.buildDirectory": "${workspaceFolder}/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/${buildType}"
-}
\ No newline at end of file
+ "cmake.sourceDirectory": "${workspaceFolder}/bsp/projects/nxpvee-ui/armgcc",
+ "cmake.useCMakePresets": "always",
+ "cmake.buildTask": true
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..3ea8f25
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,36 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "type": "cmake",
+ "label": "CMake: build",
+ "command": "build",
+ "preset": "release",
+ "targets": [
+ "all"
+ ],
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ },
+ "problemMatcher": [],
+ "detail": "CMake template build task"
+ },
+ {
+ "type": "cmake",
+ "label": "CMake: clean",
+ "command": "clean",
+ "preset": "release",
+ "problemMatcher": [],
+ "detail": "CMake template clean task"
+ },
+ {
+ "type": "cmake",
+ "label": "CMake: configure",
+ "command": "configure",
+ "preset": "release",
+ "problemMatcher": [],
+ "detail": "CMake template configure task"
+ }
+ ]
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..8e4cefe
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,51 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+## [2.0.0] - 2024-10-31
+
+### Added
+
+- Add support for CMakePresets in VSCode
+- Add Changelog.
+- Add NXP GPIO support.
+
+### Changed
+
+- Updated UI pack to v14.0.1
+- Updated VG pack to v1.5.1
+- Updated MCUXpresso SDK to v2.15.100
+- Updated MicroEJ Architecture to flopi4G25#8.1.1
+- Fix MicroEJ SDK 6 builds on Linux.
+
+## [1.2.0] - 2023-12-05
+
+### Added
+
+- Add VSCode support.
+- Add the mock implementation of the MicroEJ Demo-Wearable-VG natives.
+
+### Removed
+
+- Remove MCUXPresso IDE support.
+
+## [1.1.0] - 2023-06-30
+
+### Added
+
+- Add MCUXPresso IDE support.
+- Add West for repository management.
+
+### Changed
+
+- Update Documentation of the README.
+
+## [1.0.0] - 2022-11-28
+
+### Added
+
+- Add MicroEJ CORE support.
+- Add MicroEJ UI support.
+- Add MicroEJ VG support.
+- Add Power Management.
+- Add Demo applications (AnimatedMascot & SimpleGFX).
+- Initial release of the VEE Port.
diff --git a/Documentation/pictures/RT595/evk_jtag.jpg b/Documentation/pictures/RT595/evk_jtag.jpg
deleted file mode 100644
index 0af444b..0000000
Binary files a/Documentation/pictures/RT595/evk_jtag.jpg and /dev/null differ
diff --git a/Documentation/pictures/RT595/evk_running_app.jpg b/Documentation/pictures/RT595/evk_running_app.jpg
deleted file mode 100644
index ac8a06e..0000000
Binary files a/Documentation/pictures/RT595/evk_running_app.jpg and /dev/null differ
diff --git a/Documentation/pictures/RT595/evk_uart.jpg b/Documentation/pictures/RT595/evk_uart.jpg
deleted file mode 100644
index d898264..0000000
Binary files a/Documentation/pictures/RT595/evk_uart.jpg and /dev/null differ
diff --git a/Documentation/pictures/RT595/g1120b0mipi.jpg b/Documentation/pictures/RT595/g1120b0mipi.jpg
new file mode 100644
index 0000000..290fb95
Binary files /dev/null and b/Documentation/pictures/RT595/g1120b0mipi.jpg differ
diff --git a/Documentation/pictures/RT595/g1120b0mipi.png b/Documentation/pictures/RT595/g1120b0mipi.png
deleted file mode 100644
index 7b8c01b..0000000
Binary files a/Documentation/pictures/RT595/g1120b0mipi.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/imxrt595evk-g1120b0mipi.jpg b/Documentation/pictures/RT595/imxrt595evk-g1120b0mipi.jpg
deleted file mode 100644
index 56789c7..0000000
Binary files a/Documentation/pictures/RT595/imxrt595evk-g1120b0mipi.jpg and /dev/null differ
diff --git a/Documentation/pictures/RT595/imxrt595evk.jpg b/Documentation/pictures/RT595/imxrt595evk.jpg
new file mode 100644
index 0000000..eefd9e5
Binary files /dev/null and b/Documentation/pictures/RT595/imxrt595evk.jpg differ
diff --git a/Documentation/pictures/RT595/mcuide_debug.png b/Documentation/pictures/RT595/mcuide_debug.png
deleted file mode 100644
index 03110bc..0000000
Binary files a/Documentation/pictures/RT595/mcuide_debug.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/mcuide_file_example.png b/Documentation/pictures/RT595/mcuide_file_example.png
deleted file mode 100644
index 69bdf1b..0000000
Binary files a/Documentation/pictures/RT595/mcuide_file_example.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/mcuide_import.png b/Documentation/pictures/RT595/mcuide_import.png
deleted file mode 100644
index b3e284d..0000000
Binary files a/Documentation/pictures/RT595/mcuide_import.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/mcuide_import_menu.png b/Documentation/pictures/RT595/mcuide_import_menu.png
deleted file mode 100644
index 0a1bc77..0000000
Binary files a/Documentation/pictures/RT595/mcuide_import_menu.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_load_project.png b/Documentation/pictures/RT595/vscode_load_project.png
deleted file mode 100644
index 55d6571..0000000
Binary files a/Documentation/pictures/RT595/vscode_load_project.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_mcuxpr_build_debug.png b/Documentation/pictures/RT595/vscode_mcuxpr_build_debug.png
deleted file mode 100644
index 2efa509..0000000
Binary files a/Documentation/pictures/RT595/vscode_mcuxpr_build_debug.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_reset_probe_selection.png b/Documentation/pictures/RT595/vscode_reset_probe_selection.png
deleted file mode 100644
index 1ec482d..0000000
Binary files a/Documentation/pictures/RT595/vscode_reset_probe_selection.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_scan_for_kits.png b/Documentation/pictures/RT595/vscode_scan_for_kits.png
deleted file mode 100644
index 7388879..0000000
Binary files a/Documentation/pictures/RT595/vscode_scan_for_kits.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_select_a_kit-1.png b/Documentation/pictures/RT595/vscode_select_a_kit-1.png
deleted file mode 100644
index e2d6c36..0000000
Binary files a/Documentation/pictures/RT595/vscode_select_a_kit-1.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_select_a_kit-2.png b/Documentation/pictures/RT595/vscode_select_a_kit-2.png
deleted file mode 100644
index 80a6395..0000000
Binary files a/Documentation/pictures/RT595/vscode_select_a_kit-2.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_select_build.png b/Documentation/pictures/RT595/vscode_select_build.png
deleted file mode 100644
index 36a88af..0000000
Binary files a/Documentation/pictures/RT595/vscode_select_build.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_select_configure.png b/Documentation/pictures/RT595/vscode_select_configure.png
deleted file mode 100644
index d89c9f5..0000000
Binary files a/Documentation/pictures/RT595/vscode_select_configure.png and /dev/null differ
diff --git a/Documentation/pictures/RT595/vscode_select_variant.png b/Documentation/pictures/RT595/vscode_select_variant.png
deleted file mode 100644
index 3654d13..0000000
Binary files a/Documentation/pictures/RT595/vscode_select_variant.png and /dev/null differ
diff --git a/Documentation/pictures/common/sdk6-button.png b/Documentation/pictures/common/sdk6-button.png
new file mode 100644
index 0000000..c87cc20
Binary files /dev/null and b/Documentation/pictures/common/sdk6-button.png differ
diff --git a/Documentation/pictures/RT595/sdk_existing_project.png b/Documentation/pictures/common/sdk_existing_project.png
similarity index 100%
rename from Documentation/pictures/RT595/sdk_existing_project.png
rename to Documentation/pictures/common/sdk_existing_project.png
diff --git a/Documentation/pictures/RT595/sdk_import.png b/Documentation/pictures/common/sdk_import.png
similarity index 100%
rename from Documentation/pictures/RT595/sdk_import.png
rename to Documentation/pictures/common/sdk_import.png
diff --git a/Documentation/pictures/RT595/sdk_mockup_org_name_declaration.png b/Documentation/pictures/common/sdk_mockup_org_name_declaration.png
similarity index 100%
rename from Documentation/pictures/RT595/sdk_mockup_org_name_declaration.png
rename to Documentation/pictures/common/sdk_mockup_org_name_declaration.png
diff --git a/Documentation/pictures/common/vscode_load_project.jpg b/Documentation/pictures/common/vscode_load_project.jpg
new file mode 100644
index 0000000..8e8ce58
Binary files /dev/null and b/Documentation/pictures/common/vscode_load_project.jpg differ
diff --git a/Documentation/pictures/common/vscode_mcuxpr_build_debug.jpg b/Documentation/pictures/common/vscode_mcuxpr_build_debug.jpg
new file mode 100644
index 0000000..3198595
Binary files /dev/null and b/Documentation/pictures/common/vscode_mcuxpr_build_debug.jpg differ
diff --git a/Documentation/pictures/common/vscode_projects_view.jpg b/Documentation/pictures/common/vscode_projects_view.jpg
new file mode 100644
index 0000000..1d5c66b
Binary files /dev/null and b/Documentation/pictures/common/vscode_projects_view.jpg differ
diff --git a/Documentation/pictures/common/vscode_reset_probe_selection.jpg b/Documentation/pictures/common/vscode_reset_probe_selection.jpg
new file mode 100644
index 0000000..361a7e9
Binary files /dev/null and b/Documentation/pictures/common/vscode_reset_probe_selection.jpg differ
diff --git a/Documentation/pictures/common/vscode_scan_for_kits.jpg b/Documentation/pictures/common/vscode_scan_for_kits.jpg
new file mode 100644
index 0000000..285281b
Binary files /dev/null and b/Documentation/pictures/common/vscode_scan_for_kits.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_a_kit-1.jpg b/Documentation/pictures/common/vscode_select_a_kit-1.jpg
new file mode 100644
index 0000000..63221c7
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_a_kit-1.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_a_kit-2.jpg b/Documentation/pictures/common/vscode_select_a_kit-2.jpg
new file mode 100644
index 0000000..8510ebd
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_a_kit-2.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_build.jpg b/Documentation/pictures/common/vscode_select_build.jpg
new file mode 100644
index 0000000..da138a8
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_build.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_configure.jpg b/Documentation/pictures/common/vscode_select_configure.jpg
new file mode 100644
index 0000000..b0e4efe
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_configure.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_preset.jpg b/Documentation/pictures/common/vscode_select_preset.jpg
new file mode 100644
index 0000000..2d85db4
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_preset.jpg differ
diff --git a/Documentation/pictures/common/vscode_select_variant.jpg b/Documentation/pictures/common/vscode_select_variant.jpg
new file mode 100644
index 0000000..4f048a9
Binary files /dev/null and b/Documentation/pictures/common/vscode_select_variant.jpg differ
diff --git a/EULA-EVAL.txt b/EULA-EVAL.txt
deleted file mode 100644
index 990f0e0..0000000
--- a/EULA-EVAL.txt
+++ /dev/null
@@ -1,364 +0,0 @@
-LA_OPT_EVAL_DEMO_ONLY v21 December 2022
-
-IMPORTANT. Read the following NXP Evaluation/Demonstration License Agreement
-(“Agreement”) completely. By selecting the “I Accept” button at the end
-of this page, or by downloading, installing, or using the Licensed Materials,
-you indicate that you accept the terms of the Agreement and you acknowledge
-that you have the authority, for yourself or on behalf of your company, to bind
-your company to these terms. You may then download, install, and/or use the
-Licensed Materials. In the event of a conflict between the terms of this
-Agreement and any license terms and conditions for NXP’s proprietary software
-embedded anywhere in the Licensed Software file, the terms of this Agreement
-will control. If a separate license agreement for the Licensed Materials has
-been signed by you and NXP, then that agreement will govern your use of the
-Licensed Materials and will supersede this Agreement.
-
-NXP EVALUATION/DEMONSTRATION LICENSE AGREEMENT
-This is a legal agreement between your employer, of which you are an authorized
-representative, or, if you have no employer, you as an individual (“you” or
-“Licensee”), and NXP B.V. (“NXP”). It concerns your rights to use the
-software provided to you in binary or source code form and any accompanying
-written materials (the “Licensed Materials”). The Licensed Materials may
-include any updates or error corrections or documentation relating to the
-Licensed Materials provided to you by NXP under this Agreement. In
-consideration for NXP allowing you to access the Licensed Materials, you are
-agreeing to be bound by the terms of this Agreement. If you do not agree to all
-of the terms of this Agreement, do not download, install, or use the Licensed
-Materials. If you change your mind later, stop using the Licensed Materials and
-delete or return all copies of the Licensed Materials in your possession or
-control. Your prior use will be governed by this Agreement.
-1. DEFINITIONS.
-1.1. “Affiliate” means any corporation or other legal entity that,
-at any time, directly or indirectly, Controls, is Controlled by, or is under
-common Control with NXP (but only as long as such Control exists). For the
-purpose of this definition, the term “Control” means (i) the beneficial
-ownership (whether direct or indirect) of more than fifty percent (50%) of the
-voting power of an entity or (ii) in the case of an entity that does not have
-outstanding voting shares or securities, the majority (i.e., more than fifty
-percent (50%)) of the equity interests in such entity is now or hereafter owned
-or controlled by another entity, either directly or indirectly.
-1.2. “Evaluation Period” means the period starting on the date you
-install, download, or otherwise receive the Licensed Software and ending 90
-days thereafter (except for Licensed Hardware and its related Licensed Software
-ending three (3) years).
-1.3. “Intellectual Property Rights” means any and all rights under
-statute, common law or equity in and under copyrights, trade secrets, and
-patents (including utility models), and analogous rights throughout the world,
-including any applications for and the right to apply for, any of the foregoing.
-1.4. “Licensed Hardware” means any hardware provided to you, including
-but not limited to evaluation boards, demonstration boards, evaluation samples,
-and any accompanying documentation.
-1.5 “Licensed Material” means the Licensed Software, the Licensed
-Hardware or both.
-1.6 “Licensed Software” means the software provided to you in
-binary or source code form and any accompanying documentation.
-1.7 “Software Content Register” means the documentation accompanying
-the Licensed Software which identifies the contents of the Licensed Software,
-including but not limited to identification of any Third Party Software.
-1.8 "Third Party Software" means, any software included in the Licensed
-Software that is not NXP proprietary software, and is not open source software,
-and to which different license terms may apply.
-2. LICENSE GRANT.
-2.1. Subject to the terms and conditions of this Agreement, NXP, or an
-Affiliate, grants and agrees to grant you a temporary, personal,
-non-sublicensable, non-exclusive, non-transferable, revocable, fully paid-up,
-limited license during the Evaluation Period to use the Licensed Materials for
-your internal use, examination, testing, development, and validating, and
-exclusively in connection with your evaluation for use in a product containing
-a NXP hardware product (e.g. a microprocessor, microcontroller, or digital
-signal processor) supplied directly or indirectly from NXP (“Authorized
-System”).
-2.2. You may demonstrate the Licensed Materials to your direct
-customers as part of an Authorized System so long as such demonstration is
-directly controlled by you and without prior approval by NXP; however, to all
-other third parties only if NXP has provided its advance, written approval
-(e.g. email approval) of your demonstrating the Licensed Materials to specified
-third parties or at specified event(s). You may not leave the Licensed
-Materials with a direct customer or any other third party at any time.
-2.3. You may use subcontractors on your premises to exercise your
-rights under Section 2.1 and 2.2 so long as you have an agreement in place with
-the subcontractor containing confidentiality restrictions no less stringent
-than those contained in this Agreement. You will remain liable for your
-subcontractors’ adherence to the terms of this Agreement and for any and all
-acts and omissions of such subcontractors with respect to this Agreement and
-the Licensed Materials.
-2.4 Separate license grants to Third Party Software, or other terms
-applicable to the Licensed Software if different from those granted in this
-Section 2, are contained in Appendix A. The Licensed Software may be
-accompanied by a Software Content Register which will identify that portion of
-the Licensed Software, if any, that is subject to the different terms in
-Appendix A.
-3. LICENSE LIMITATIONS AND RESTRICTIONS.
-3.1. The Licensed Materials are licensed to you, not sold. Title to
-Licensed Materials delivered hereunder remains vested in NXP or NXP's licensor
-and cannot be assigned or transferred. You will not, and will not permit any
-third party to: (a) use the Licensed Materials for commercial or revenue
-generating purposes; (b) copy, translate, modify or make derivative works of
-any portion of the Licensed Materials; (c) rent, disclose, publish, sell,
-assign, lease, lend, sublicense, market, transfer, distribute or otherwise
-provide third parties access to any portion of the Licensed Materials, except
-as expressly authorized in Section 2. This Agreement does not grant to you any
-implied rights under any NXP or third party intellectual property.
-3.2. The license granted in Section 2 does not include any license,
-right, power or authority to cause the Licensed Software, in whole or in part,
-to be subject to Open Source Licensing Terms. You will not take or fail to
-take any action that could subject the Licensed Software to Open Source
-Licensing Terms. As used herein, “Open Source Licensing Terms” means terms
-in any license for software which require, as a condition of use, modification
-and/or distribution of such software or other software incorporated into,
-derived from or distributed with such software (a “Work”), any of the
-following: (a) the making available of source code or design information
-regarding the Work; (b) the granting of permission for creating derivative
-works regarding the Work; or (c) the granting of a license to any party under
-intellectual property rights regarding the Work. By means of example and
-without limitation, Open Source Licensing Terms include the following licenses
-or distribution models: (i) the GNU General Public License (GPL) or
-Lesser/Library GPL (LGPL), (ii) the Artistic License (e.g. PERL), (iii) the
-Mozilla Public License, (iv) the Common Public License, (v) the Sun Community
-Source License (SCSL), (vi) the Sun Industry Standards Source License (SISSL),
-and (vii) the Open Software License.
-3.3. You shall not and shall not permit your subcontractors or any
-third party to (i) translate, reverse engineer, decompile, or disassemble the
-Licensed Materials, or (ii) remove or circumvent any protection or other
-restrictive technology mechanism of the Licensed Materials; except to the
-extent applicable law specifically prohibits such restriction.
-3.4. You must reproduce any and all of NXP's (or its third party
-licensor’s) copyright notices and other proprietary legends on copies of
-Licensed Materials.
-3.5. You have no distribution rights under this Agreement.
-Nevertheless, if you distribute the Licensed Software to the United States
-Government, then the Licensed Software is “restricted computer software”
-and is subject to FAR 52.227-19.
-3.6. You grant to NXP a non-exclusive, non-transferable, irrevocable,
-perpetual, worldwide, royalty-free, sublicensable license under your
-Intellectual Property Rights to use without restriction and for any purpose any
-suggestion, comment or other feedback related to the Licensed Materials
-(including, but not limited to, error corrections and bug fixes).
-3.7. You may not publish or distribute information, results or data
-associated with the use of the Licensed Materials to anyone other than NXP;
-however, you must advise NXP of any results obtained including any problems or
-suggested improvements thereof. NXP retains the right to use such results and
-related information in any manner it deems appropriate.
-4. OPEN SOURCE. Open source software included in the Licensed
-Software is not licensed under the terms of this Agreement but is instead
-licensed under the terms of the applicable open source license(s), such as the
-BSD License, Apache License or the GNU Lesser General Public License. Your use
-of the open source software is subject to the terms of each applicable license.
-You must agree to the terms of each applicable license, or you cannot use the
-open source software.
-5. INTELLECTUAL PROPERTY RIGHTS. Upon request, you must provide NXP the
-source code of any derivative of the Licensed Software.
-
-Unless prohibited by law, the following paragraph shall apply. Your
-modifications to the Licensed Software, and all intellectual property rights
-associated with, and title thereto, will be the property of NXP. You agree to
-assign all, and hereby do assign all rights, title, and interest to any such
-modifications to the Licensed Software to NXP and agree to provide all
-assistance reasonably requested by NXP to establish, preserve or enforce such
-right. Further, you agree to waive all moral rights relating to your
-modifications to the Licensed Software, including, without limitation, all
-rights of identification of authorship and all rights of approval, restriction,
-or limitation on use or subsequent modification. Notwithstanding the
-foregoing, you will have the license rights granted in Section 2 hereto to any
-such modifications made by you or your licensees.
-
-Otherwise, you agree to grant an irrevocable, worldwide, and perpetual license
-to NXP to make, have made, use, sell, offer to sell, import, commercialize,
-sublicense and reproduce your modifications or derivative works to the Licensed
-Software without any payment to Licensee. You agree to provide all assistance
-reasonably requested by NXP to establish, preserve or enforce such right.
-
-6. ESSENTIAL PATENTS. NXP has no obligation to identify or obtain any
-license to any Intellectual Property Right of a third-party that may be
-necessary for use in connection with technology that is incorporated into the
-Authorized System (whether or not as part of the Licensed Materials).
-7. TERM AND TERMINATION. This Agreement will remain in effect for the
-Evaluation Period, unless terminated earlier in accordance with this Agreement.
-
-7.1. You may terminate this Agreement immediately upon written notice
-to NXP at the address provided below.
-7.2. NXP may terminate this Agreement immediately upon written notice
-to you.
-7.3. Upon termination of this Agreement, all licenses granted under
-Section 2 will expire.
-7.4. After termination of this Agreement by either party, (a) you will
-promptly return to NXP or, at NXP’s discretion, destroy all of the Licensed
-Materials and all whole and partial copies of the Licensed Materials within
-thirty (30) days after the expiration or termination, (b) you will furnish to
-NXP at the address below a written certification that all of the Licensed
-Materials including all whole and partial copies, have been (i) destroyed or
-returned to NXP, and (ii) erased from all of your storage elements and devices;
-and (c) you will not keep any archival copies of the Licensed Materials except
-and only to the extent that applicable law notwithstanding this limitation
-expressly permits such.
-7.5. Notwithstanding the termination of this Agreement for any reason,
-the terms of Sections 1 and 3 through 24 will survive.
-8. SUPPORT. NXP is not obligated to provide any support, upgrades
-or new releases of the Licensed Materials under this Agreement. If you wish,
-you may contact NXP and report problems and provide suggestions regarding the
-Licensed Materials. NXP has no obligation to respond to such a problem report
-or suggestion. NXP may make changes to the Licensed Materials at any time,
-without any obligation to notify or provide updated versions of the Licensed
-Materials to you.
-9. NO WARRANTY. To the maximum extent permitted by law, NXP
-expressly disclaims any warranty for the Licensed Materials. The Licensed
-Materials are provided “AS IS”, without warranty of any kind, either
-express or implied, including without limitation the implied warranties of
-merchantability, fitness for a particular purpose, or non-infringement. You
-assume the entire risk arising out of the use or performance of the Licensed
-Materials, or any systems you design using the Licensed Materials (if any).
-10. INDEMNITY. You agree to fully defend and indemnify NXP from all
-claims, liabilities, and costs (including reasonable attorney’s fees) related
-to (1) your use (including your contractors or sublicensee’s use, if
-permitted) of the Licensed Materials or (2) your violation of the terms and
-conditions of this Agreement.
-11. LIMITATION OF LIABILITY. IN NO EVENT WILL NXP BE LIABLE, WHETHER
-IN CONTRACT, TORT, OR OTHERWISE, FOR ANY INCIDENTAL, SPECIAL, INDIRECT,
-CONSEQUENTIAL OR PUNITIVE DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR
-ANY LOSS OF USE, LOSS OF TIME, INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS,
-SAVINGS, OR REVENUES, TO THE FULL EXTENT SUCH MAY BE DISCLAIMED BY LAW.
-NXP’S TOTAL LIABILITY FOR ALL COSTS, DAMAGES, CLAIMS, OR LOSSES WHATSOEVER
-ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR PRODUCT(S) SUPPLIED
-UNDER THIS AGREEMENT IS LIMITED TO THE AGGREGATE AMOUNT PAID BY YOU TO NXP IN
-CONNECTION WITH THE LICENSED MATERIALS TO WHICH LOSSES OR DAMAGES ARE CLAIMED.
-12. EXPORT COMPLIANCE. Each party will comply with all applicable
-export and import control laws and regulations including but not limited to the
-US Export Administration Regulation (including restrictions on certain military
-end uses and military end users as specified in Section 15 C.F.R. § 744.21 and
-prohibited party lists issued by other federal governments), Catch-all
-regulations and all national and international embargoes. Each party further
-agrees that it will not knowingly transfer, divert, export or re-export,
-directly or indirectly, any product, software, including software source code,
-or technology restricted by such regulations or by other applicable national
-regulations, received from the other party under this Agreement, or any direct
-product of such software or technical data to any person, firm, entity, country
-or destination to which such transfer, diversion, export or re-export is
-restricted or prohibited, without obtaining prior written authorization from
-the applicable competent government authorities to the extent required by those
-laws. This provision will survive termination or expiration of this Agreement.
-13. GOVERNMENT CONTRACT COMPLIANCE.
-13.1. You are not permitted to distribute the Licensed Materials under
-the terms of this Agreement. Nevertheless, if you sell Authorized Systems
-containing the Licensed Materials directly to any government or public entity,
-including U.S., state, local, foreign or international governments or public
-entities, or indirectly via a prime contractor or subcontractor of such
-governments or entities, NXP makes no representations, certifications, or
-warranties whatsoever about compliance with government or public entity
-acquisition statutes or regulations, including, without limitation, statutes or
-regulations that may relate to pricing, quality, origin or content.
-13.2. The Licensed Materials has been developed at private expense and is
-a “Commercial Item” as defined in 48 C.F.R. Section 2.101, consisting of
-“Commercial Computer Software”, and/or “Commercial Computer Software
-Documentation,” as such terms are used in 48 C.F.R. Section 12.212 (or 48
-C.F.R. Section 227.7202, as applicable) and may only be licensed to or shared
-with U.S. Government end users in object code form as part of, or embedded
-within, Authorized Systems. Any agreement pursuant to which you share the
-Licensed Materials will include a provision that reiterates the limitations of
-this document and requires all sub-agreements to similarly contain such
-limitations.
-14. CRITICAL APPLICATIONS. In some cases, NXP may promote certain
-software for use in the development of, or for incorporation into, products or
-services (a) used in applications requiring fail-safe performance or (b) in
-which failure could lead to death, personal injury, or severe physical or
-environmental damage (these products and services are referred to as "Critical
-Applications"). NXP's goal is to educate customers so that they can design
-their own end-product solutions to meet applicable functional safety standards
-and requirements. Licensee makes the ultimate design decisions regarding its
-products and is solely responsible for compliance with all legal, regulatory,
-safety, and security related requirements concerning its products, regardless
-of any information or support that may be provided by NXP. As such, Licensee
-assumes all risk related to use of the Licensed Materials in Critical
-Applications and NXP WILL NOT BE LIABLE FOR ANY SUCH USE IN CRITICAL
-APPLICATIONS BY LICENSEE. Accordingly, Licensee will indemnify and hold NXP
-harmless from any claims, liabilities, damages and associated costs and
-expenses (including attorneys' fees) that NXP may incur related to Licensee’s
-incorporation of the Licensed Materials in a Critical Application.
-15. CHOICE OF LAW; VENUE. This Agreement will be governed by,
-construed, and enforced in accordance with the laws of The Netherlands, without
-regard to conflicts of laws principles, will apply to all matters relating to
-this Agreement or the Licensed Materials, and you agree that any litigation
-will be subject to the exclusive jurisdiction of the courts of Amsterdam, The
-Netherlands. The United Nations Convention on Contracts for the International
-Sale of Goods will not apply to this document.
-16. CONFIDENTIAL INFORMATION. Subject to the license grants and
-restrictions contained herein, you must treat the Licensed Materials as
-confidential information and you agree to retain the Licensed Materials in
-confidence perpetually. You may not disclose any part of the Licensed Materials
-to anyone other than subcontractors in accordance with Section 2.3, who have a
-need to know of the Licensed Materials and who have executed written agreements
-obligating them to protect such Licensed Materials to at least the same degree
-of confidentiality as in this Agreement. You agree to use the same degree of
-care, but no less than a reasonable degree of care, with the Licensed Materials
-as you do with your own confidential information. You may disclose Licensed
-Materials to the extent required by a court or under operation of law or order
-provided that you notify NXP of such requirement prior to disclosure, which you
-only disclose the minimum of the required information, and that you allow NXP
-the opportunity to object to such court or other legal body requiring such
-disclosure.
-17. TRADEMARKS. You are not authorized to use any NXP trademarks,
-brand names, or logos.
-18. ENTIRE AGREEMENT. This Agreement constitutes the entire
-agreement between you and NXP regarding the subject matter of this Agreement,
-and supersedes all prior communications, negotiations, understandings,
-agreements or representations, either written or oral, if any. This Agreement
-may only be amended in written form, signed by you and NXP.
-19. SEVERABILITY. If any provision of this Agreement is held for any
-reason to be invalid or unenforceable, then the remaining provisions of this
-Agreement will be unimpaired and, unless a modification or replacement of the
-invalid or unenforceable provision is further held to deprive you or NXP of a
-material benefit, in which case the Agreement will immediately terminate, the
-invalid or unenforceable provision will be replaced with a provision that is
-valid and enforceable and that comes closest to the intention underlying the
-invalid or unenforceable provision.
-20. NO WAIVER. The waiver by NXP of any breach of any provision of
-this Agreement will not operate or be construed as a waiver of any other or a
-subsequent breach of the same or a different provision.
-21. AUDIT. You will keep full, clear and accurate records with
-respect to your compliance with the limited license rights granted under this
-Agreement for three years following expiration or termination of this
-Agreement. NXP will have the right, either itself or through an independent
-certified public accountant to examine and audit, at NXP’s expense, not more
-than once a year, and during normal business hours, all such records that may
-bear upon your compliance with the limited license rights granted above. You
-must make prompt adjustment to compensate for any errors and/or omissions
-disclosed by such examination or audit.
-22. NOTICES. All notices and communications under this
-Agreement will be made in writing, and will be effective when received at the
-following addresses:
-
-NXP: NXP B.V.
- High Tech Campus 60
- 5656 AG Eindhoven
- The Netherlands
- ATTN: Legal Department
-
-You: The address provided at registration will be used.
-
-23. RELATIONSHIP OF THE PARTIES. The parties are independent
-contractors. Nothing in this Agreement will be construed to create any
-partnership, joint venture, or similar relationship. Neither party is
-authorized to bind the other to any obligations with third parties.
-24. SUCCESSION AND ASSIGNMENT. This Agreement will be binding upon
-and inure to the benefit of the parties and their permitted successors and
-assigns. You may not assign this Agreement, or any part of this Agreement,
-without the prior written approval of NXP, which approval will not be
-unreasonably withheld or delayed. NXP may assign this Agreement, or any part of
-this Agreement, in its sole discretion.
-
-APPENDIX A
-Other License Grants and Restrictions:
-
-The Licensed Software may include some or all of the following software, which
-is either 1) Third Party Software or 2) NXP proprietary software subject to
-different terms than those in the Agreement. If the Software Content Register
-that accompanies the Licensed Software identifies any of the following Third
-Party Software or specific components of the NXP proprietary software, the
-following terms apply to the extent they deviate from the terms in the
-Agreement:
-
-CEVA D.S.P. Ltd. and CEVA Technologies Inc. (“CEVA”): The CEVA-SPF2 linear
-algebra, CEVA-SPF2 Neural Network Libraries, CEVA-SPF2 Core Libraries,
-CEVA-SPF2 OpenAMP and CEVA-SPF2 STL licensed modules are owned by CEVA and such
-materials may only be used in connection with an NXP product containing the
-S250 or S125 integrated circuits, whether or not the CEVA-SPF2 Core is
-physically implemented and/or enabled on such NXP product.
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..ac7337f
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,775 @@
+LA_OPT_NXP_Software_License v57 July 2024
+IMPORTANT. Read the following NXP Software License Agreement ("Agreement")
+completely. By selecting the "I Accept" button at the end of this page, or by
+downloading, installing, or using the Licensed Software, you indicate that you
+accept the terms of the Agreement, and you acknowledge that you have the
+authority, for yourself or on behalf of your company, to bind your company to
+these terms. You may then download or install the file. In the event of a
+conflict between the terms of this Agreement and any license terms and
+conditions for NXP’s proprietary software embedded anywhere in the Licensed
+Software file, the terms of this Agreement shall control. If a separate
+license agreement for the Licensed Software has been signed by you and NXP,
+then that agreement shall govern your use of the Licensed Software and shall
+supersede this Agreement.
+
+NXP SOFTWARE LICENSE AGREEMENT
+This is a legal agreement between your employer, of which you are an authorized
+representative, or, if you have no employer, you as an individual ("you" or
+"Licensee"), and and NXP USA, Inc., if Licensee is located within the United
+States or NXP Semiconductors Netherlands B.V., if Licensee if located outside
+of the United States (“NXP”). It concerns your rights to use the software
+provided to you in binary or source code form and any accompanying written
+materials (the "Licensed Software"). The Licensed Software may include any
+updates or error corrections or documentation relating to the Licensed Software
+provided to you by NXP under this Agreement. In consideration for NXP allowing
+you to access the Licensed Software, you are agreeing to be bound by the terms
+of this Agreement. If you do not agree to all of the terms of this Agreement,
+do not download or install the Licensed Software. If you change your mind
+later, stop using the Licensed Software and delete all copies of the Licensed
+Software in your possession or control. Any copies of the Licensed Software
+that you have already distributed, where permitted, and do not destroy will
+continue to be governed by this Agreement. Your prior use will also continue to
+be governed by this Agreement.
+1. DEFINITIONS
+1.1. "Affiliate" means, with respect to a party, any corporation or
+other legal entity that now or hereafter Controls, is Controlled by or is under
+common Control with such party; where "Control" means the direct or indirect
+ownership of greater than fifty percent (50%) of the shares or similar
+interests entitled to vote for the election of directors or other persons
+performing similar functions. An entity is considered an Affiliate only so long
+as such Control exists.
+1.2 "Authorized System" means either (i) Licensee’s hardware product
+which incorporates an NXP Product or (ii) Licensee’s software program which
+is used exclusively in connection with an NXP Product and with which the
+Licensed Software will be integrated.
+1.3. "Derivative Work" means a work based upon one or more pre-existing
+works. A work consisting of editorial revisions, annotations, elaborations, or
+other modifications which, as a whole, represent an original work of
+authorship, is a Derivative Work.
+1.4 "Intellectual Property Rights" means any and all rights under statute,
+common law or equity in and under copyrights, trade secrets, and patents
+(including utility models), and analogous rights throughout the world,
+including any applications for and the right to apply for, any of the foregoing.
+1.5 "NXP Product" means a hardware product (e.g. a microprocessor,
+microcontroller, sensor or digital signal processor) and/or services (e.g.
+cloud platform services) supplied directly or indirectly from NXP or an NXP
+Affiliate, unless there is a product specified in the Software Content
+Register, in which case this definition is limited to such product.
+1.6 "Software Content Register" means the documentation which may
+accompany the Licensed Software which identifies the contents of the Licensed
+Software, including but not limited to identification of any Third Party
+Software, if any, and may also contain other related information as whether the
+license in 2.3 is applicable.
+1.7 "Third Party Software" means, any software included in the Licensed
+Software that is not NXP proprietary software, and is not open source software,
+and to which different license terms may apply.
+2. LICENSE GRANT.
+2.1. If you are not expressly granted the distribution license in
+Section 2.3 in the Software Content Register, then you are only granted the
+rights in Section 2.2 and not in 2.3. If you are expressly granted the
+distribution license in Section 2.3 in the Software Content Register, then you
+are granted the rights in both Section 2.2 and 2.3.
+2.2. Standard License. Subject to the terms and conditions of this
+Agreement, NXP grants you a worldwide, personal, non-transferable,
+non-exclusive, non-sublicensable license, solely for the development of an
+Authorized System:
+(a) to use and reproduce the Licensed Software (and its Derivative Works
+prepared under the license in Section 2.2(b)) solely in combination with a NXP
+Product; and
+(b) for Licensed Software provided to you in source code form (human
+readable), to prepare Derivative Works of the Licensed Software solely for use
+in combination with a NXP Product.
+You may not distribute or sublicense the Licensed Software to others under the
+license granted in this Section 2.2.
+You may demonstrate the Licensed Software to your direct customers as part of
+an Authorized System so long as such demonstration is directly controlled by
+you and without prior approval by NXP; however, to all other third parties only
+if NXP has provided its advance, written approval (e.g. email approval) of your
+demonstrating the Licensed Software to specified third parties or at specified
+event(s). You may not leave the Licensed Software with a direct customer or
+any other third party at any time.
+2.3. Additional Distribution License. If expressly authorized in the
+Software Content Register, subject to the terms and conditions of this
+Agreement, NXP grants you a worldwide, personal, non-transferable,
+non-exclusive, non-sublicensable license solely in connection with your
+manufacturing and distribution of an Authorized System:
+(a) to manufacture (or have manufactured), distribute, and market the
+Licensed Software (and its Derivative Works prepared under the license in
+2.2(b)) in object code (machine readable format) only as part of, or embedded
+within, Authorized Systems and not on a standalone basis solely for use in
+combination with a NXP Product. Notwithstanding the foregoing, those files
+marked as .h files ("Header files") may be distributed in source or object code
+form, but only as part of, or embedded within Authorized Systems; and
+(b) to copy and distribute as needed, solely in connection with an
+Authorized System and for use in combination with a NXP Product,
+non-confidential NXP information provided as part of the Licensed Software for
+the purpose of maintaining and supporting Authorized Systems with which the
+Licensed Software is integrated.
+2.4 Separate license grants to Third Party Software, or other terms
+applicable to the Licensed Software if different from those granted in this
+Section 2, are contained in Appendix A. The Licensed Software may be
+accompanied by a Software Content Register which will identify that portion of
+the Licensed Software, if any, that is subject to the different terms in
+Appendix A.
+2.5. You may use subcontractors to exercise your rights under Section
+2.2 and Section 2.3, if any, so long as you have an agreement in place with the
+subcontractor containing confidentiality restrictions no less stringent than
+those contained in this Agreement. You will remain liable for your
+subcontractors’ adherence to the terms of this Agreement and for any and all
+acts and omissions of such subcontractors with respect to this Agreement and
+the Licensed Software.
+3. LICENSE LIMITATIONS AND RESTRICTIONS.
+3.1. The licenses granted above in Section 2 only extend to NXP
+Intellectual Property Rights that would be infringed by the unmodified Licensed
+Software prior to your preparation of any Derivative Work.
+3.2. The Licensed Software is licensed to you, not sold. Title to
+Licensed Software delivered hereunder remains vested in NXP or NXP’s licensor
+and cannot be assigned or transferred. You are expressly forbidden from selling
+or otherwise distributing the Licensed Software, or any portion thereof, except
+as expressly permitted herein. This Agreement does not grant to you any implied
+rights under any NXP or third party Intellectual Property Rights.
+3.3. You may not translate, reverse engineer, decompile, or disassemble
+the Licensed Software except to the extent applicable law specifically
+prohibits such restriction. You must prohibit your subcontractors or customers
+(if distribution is permitted) from translating, reverse engineering,
+decompiling, or disassembling the Licensed Software except to the extent
+applicable law specifically prohibits such restriction.
+3.4. You must reproduce any and all of NXP’s (or its third-party
+licensor’s) copyright notices and other proprietary legends on copies of
+Licensed Software.
+3.5. If you distribute the Licensed Software to the United States
+Government, then the Licensed Software is "restricted computer software" and is
+subject to FAR 52.227-19.
+3.6. You grant to NXP a non-exclusive, non-transferable, irrevocable,
+perpetual, worldwide, royalty-free, sub-licensable license under your
+Intellectual Property Rights to use without restriction and for any purpose any
+suggestion, comment or other feedback related to the Licensed Software
+(including, but not limited to, error corrections and bug fixes).
+3.7. You will not take or fail to take any action that could subject
+the Licensed Software to an Excluded License. An Excluded License means any
+license that requires, as a condition of use, modification or distribution of
+software subject to the Excluded License, that such software or other software
+combined and/or distributed with the software be (i) disclosed or distributed
+in source code form; (ii) licensed for the purpose of making Derivative Works;
+or (iii) redistributable at no charge.
+3.8. You may not publish or distribute reports associated with the use
+of the Licensed Software to anyone other than NXP. You may advise NXP of any
+results obtained from your use of the Licensed Software, including any problems
+or suggested improvements thereof, and NXP retains the right to use such
+results and related information in any manner it deems appropriate.
+4. OPEN SOURCE. Open source software included in the Licensed
+Software is not licensed under the terms of this Agreement but is instead
+licensed under the terms of the applicable open source license(s), such as the
+BSD License, Apache License or the GNU Lesser General Public License. Your use
+of the open source software is subject to the terms of each applicable license.
+You must agree to the terms of each applicable license, or you cannot use the
+open source software.
+5. INTELLECTUAL PROPERTY RIGHTS.
+Upon request, you must provide NXP the source code of any derivative of the
+Licensed Software.
+Unless prohibited by law, the following paragraph shall apply. Your
+modifications to the Licensed Software, and all intellectual property rights
+associated with, and title thereto, will be the property of NXP. You agree to
+assign all, and hereby do assign all rights, title, and interest to any such
+modifications to the Licensed Software to NXP and agree to provide all
+assistance reasonably requested by NXP to establish, preserve or enforce such
+right. Further, you agree to waive all moral rights relating to your
+modifications to the Licensed Software, including, without limitation, all
+rights of identification of authorship and all rights of approval, restriction,
+or limitation on use or subsequent modification. Notwithstanding the
+foregoing, you will have the license rights granted in Section 2 hereto to any
+such modifications made by you or your licensees.
+Otherwise, you agree to grant an irrevocable, worldwide, and perpetual license
+to NXP to make, have made, use, sell, offer to sell, import, commercialize,
+sublicense and reproduce your modifications or derivative works to the Licensed
+Software without any payment to Licensee. You agree to provide all assistance
+reasonably requested by NXP to establish, preserve or enforce such right.
+6. ESSENTIAL PATENTS. NXP has no obligation to identify or obtain any
+license to any Intellectual Property Right of a third-party that may be
+necessary for use in connection with technology that is incorporated into the
+Authorized System (whether or not as part of the Licensed Software).
+7. TERM AND TERMINATION. This Agreement will remain in effect unless
+terminated as provided in this Section.
+7.1. You may terminate this Agreement immediately upon written notice
+to NXP at the address provided below.
+7.2. Either party may terminate this Agreement if the other party is in
+default of any of the terms and conditions of this Agreement, and termination
+is effective if the defaulting party fails to correct such default within 30
+days after written notice thereof by the non-defaulting party to the defaulting
+party at the address below.
+7.3. Notwithstanding the foregoing, NXP may terminate this Agreement
+immediately upon written notice if you: breach any of your confidentiality
+obligations or the license restrictions under this Agreement; become bankrupt,
+insolvent, or file a petition for bankruptcy or insolvency; make an assignment
+for the benefit of its creditors; enter proceedings for winding up or
+dissolution; are dissolved; or are nationalized or become subject to the
+expropriation of all or substantially all of your business or assets.
+7.4. Upon termination of this Agreement, all licenses granted under
+Section 2 will expire.
+7.5. After termination of this Agreement by either party you will
+destroy all parts of Licensed Software and its Derivative Works (if any) and
+will provide to NXP a statement certifying the same.
+7.6. Notwithstanding the termination of this Agreement for any reason,
+the terms of Sections 1 and 3 through 24 will survive.
+8. SUPPORT. NXP is not obligated to provide any support, upgrades or
+new releases of the Licensed Software under this Agreement. If you wish, you
+may contact NXP and report problems and provide suggestions regarding the
+Licensed Software. NXP has no obligation to respond to such a problem report or
+suggestion. NXP may make changes to the Licensed Software at any time, without
+any obligation to notify or provide updated versions of the Licensed Software
+to you.
+9. NO WARRANTY. To the maximum extent permitted by law, NXP expressly
+disclaims any warranty for the Licensed Software. The Licensed Software is
+provided "AS IS", without warranty of any kind, either express or implied,
+including without limitation the implied warranties of merchantability, fitness
+for a particular purpose, or non-infringement. You assume the entire risk
+arising out of the use or performance of the licensed software, or any systems
+you design using the licensed software (if any).
+10. INDEMNITY. You agree to fully defend and indemnify NXP from all
+claims, liabilities, and costs (including reasonable attorney’s fees) related
+to (1) your use (including your subcontractor’s or distributee’s use, if
+permitted) of the Licensed Software or (2) your violation of the terms and
+conditions of this Agreement.
+11. LIMITATION OF LIABILITY. EXCLUDING LIABILITY FOR A BREACH OF
+SECTION 2 (LICENSE GRANTS), SECTION 3 (LICENSE LIMITATIONS AND RESTRICTIONS),
+SECTION 16 (CONFIDENTIAL INFORMATION), OR CLAIMS UNDER SECTION 10 (INDEMNITY),
+IN NO EVENT WILL EITHER PARTY BE LIABLE, WHETHER IN CONTRACT, TORT, OR
+OTHERWISE, FOR ANY INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE
+DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR ANY LOSS OF USE, LOSS OF
+TIME, INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS, SAVINGS, OR REVENUES, TO
+THE FULL EXTENT SUCH MAY BE DISCLAIMED BY LAW. NXP’S TOTAL LIABILITY FOR ALL
+COSTS, DAMAGES, CLAIMS, OR LOSSES WHATSOEVER ARISING OUT OF OR IN CONNECTION
+WITH THIS AGREEMENT OR PRODUCT(S) SUPPLIED UNDER THIS AGREEMENT IS LIMITED TO
+THE AGGREGATE AMOUNT PAID BY YOU TO NXP IN CONNECTION WITH THE LICENSED
+SOFTWARE PROVIDED UNDER THIS AGREEMENT TO WHICH LOSSES OR DAMAGES ARE CLAIMED.
+12. EXPORT COMPLIANCE. Each party shall comply with all applicable
+export and import control laws and regulations including but not limited to the
+US Export Administration Regulation (including restrictions on certain military
+end uses and military end users as specified in Section 15 C.F.R. § 744.21 and
+prohibited party lists issued by other federal governments), Catch-all
+regulations and all national and international embargoes. Each party further
+agrees that it will not knowingly transfer, divert, export or re-export,
+directly or indirectly, any product, software, including software source code,
+or technology restricted by such regulations or by other applicable national
+regulations, received from the other party under this Agreement, or any direct
+product of such software or technical data to any person, firm, entity, country
+or destination to which such transfer, diversion, export or re-export is
+restricted or prohibited, without obtaining prior written authorization from
+the applicable competent government authorities to the extent required by those
+laws.
+13. GOVERNMENT CONTRACT COMPLIANCE
+13.1. If you sell Authorized Systems directly to any government or public
+entity, including U.S., state, local, foreign or international governments or
+public entities, or indirectly via a prime contractor or subcontractor of such
+governments or entities, NXP makes no representations, certifications, or
+warranties whatsoever about compliance with government or public entity
+acquisition statutes or regulations, including, without limitation, statutes or
+regulations that may relate to pricing, quality, origin or content.
+13.2. The Licensed Software has been developed at private expense and is a
+"Commercial Item" as defined in 48 C.F.R. Section 2.101, consisting of
+"Commercial Computer Software", and/or "Commercial Computer Software
+Documentation," as such terms are used in 48 C.F.R. Section 12.212 (or 48
+C.F.R. Section 227.7202, as applicable) and may only be licensed to or shared
+with U.S. Government end users in object code form as part of, or embedded
+within, Authorized Systems. Any agreement pursuant to which you share the
+Licensed Software will include a provision that reiterates the limitations of
+this document and requires all sub-agreements to similarly contain such
+limitations.
+14. CRITICAL APPLICATIONS. In some cases, NXP may promote certain
+software for use in the development of, or for incorporation into, products or
+services (a) used in applications requiring fail-safe performance or (b) in
+which failure could lead to death, personal injury, or severe physical or
+environmental damage (these products and services are referred to as "Critical
+Applications"). NXP’s goal is to educate customers so that they can design
+their own end-product solutions to meet applicable functional safety standards
+and requirements. Licensee makes the ultimate design decisions regarding its
+products and is solely responsible for compliance with all legal, regulatory,
+safety, and security related requirements concerning its products, regardless
+of any information or support that may be provided by NXP. As such, Licensee
+assumes all risk related to use of the Licensed Software in Critical
+Applications and NXP SHALL NOT BE LIABLE FOR ANY SUCH USE IN CRITICAL
+APPLICATIONS BY LICENSEE. Accordingly, Licensee will indemnify and hold NXP
+harmless from any claims, liabilities, damages and associated costs and
+expenses (including attorneys’ fees) that NXP may incur related to
+Licensee’s incorporation of the Licensed Software in a Critical Application.
+15. CHOICE OF LAW; VENUE. When Software is licensed by NXP USA, Inc.,
+Licensee agrees that the laws of the State of Texas, USA, without regard to
+conflicts of laws principles, will apply to all matters relating to this
+Agreement or the Software, and Licensee agrees that any litigation will be
+subject to the exclusive jurisdiction of the state or federal courts in Austin,
+Texas, USA.. When Software is licensed by NXP Semiconductors Netherlands B.V.,
+Licensee agrees that the laws of The Netherlands, without regard to conflicts
+of laws principles, will apply to all matters relating to this Agreement or the
+Software, and Licensee agrees that any litigation will be subject to the
+exclusive jurisdiction of the courts in Amsterdam, The Netherlands.
+Notwithstanding the foregoing, NXP will always be permitted to bring any action
+or proceedings against Licensee in any other court of competent jurisdiction.
+The United Nations Convention on Contracts for the International Sale of Goods
+will not apply to this document.
+16. CONFIDENTIAL INFORMATION. Subject to the license grants and
+restrictions contained herein, you must treat the Licensed Software as
+confidential information and you agree to retain the Licensed Software in
+confidence perpetually. You may not disclose any part of the Licensed Software
+to anyone other than distributees in accordance with Section 2.3 and employees,
+or subcontractors in accordance with Section 2.5, who have a need to know of
+the Licensed Software and who have executed written agreements obligating them
+to protect such Licensed Software to at least the same degree of
+confidentiality as in this Agreement. You agree to use the same degree of care,
+but no less than a reasonable degree of care, with the Licensed Software as you
+do with your own confidential information. You may disclose Licensed Software
+to the extent required by a court or under operation of law or order provided
+that you notify NXP of such requirement prior to disclosure, which you only
+disclose the minimum of the required information, and that you allow NXP the
+opportunity to object to such court or other legal body requiring such
+disclosure.
+17. TRADEMARKS. You are not authorized to use any NXP trademarks, brand
+names, or logos.
+18. ENTIRE AGREEMENT. This Agreement constitutes the entire agreement
+between you and NXP regarding the subject matter of this Agreement, and
+supersedes all prior communications, negotiations, understandings, agreements
+or representations, either written or oral, if any. This Agreement may only be
+amended in written form, signed by you and NXP.
+19. SEVERABILITY. If any provision of this Agreement is held for any
+reason to be invalid or unenforceable, then the remaining provisions of this
+Agreement will be unimpaired and, unless a modification or replacement of the
+invalid or unenforceable provision is further held to deprive you or NXP of a
+material benefit, in which case the Agreement will immediately terminate, the
+invalid or unenforceable provision will be replaced with a provision that is
+valid and enforceable and that comes closest to the intention underlying the
+invalid or unenforceable provision.
+20. NO WAIVER. The waiver by NXP of any breach of any provision of this
+Agreement will not operate or be construed as a waiver of any other or a
+subsequent breach of the same or a different provision.
+21. AUDIT. You will keep full, clear and accurate records with respect
+to your compliance with the limited license rights granted under this Agreement
+for three years following expiration or termination of this Agreement. NXP will
+have the right, either itself or through an independent certified public
+accountant to examine and audit, at NXP’s expense, not more than once a year,
+and during normal business hours, all such records that may bear upon your
+compliance with the limited license rights granted above. You must make prompt
+adjustment to compensate for any errors and/or omissions disclosed by such
+examination or audit.
+22. NOTICES. All notices and communications under this
+Agreement will be made in writing, and will be effective when received at the
+following addresses:
+NXP:
+NXP B.V.
+High Tech Campus 60
+5656 AG Eindhoven
+The Netherlands
+ATTN: Legal Department
+
+You:
+The address provided at registration will be used.
+
+23. RELATIONSHIP OF THE PARTIES. The parties are independent
+contractors. Nothing in this Agreement will be construed to create any
+partnership, joint venture, or similar relationship. Neither party is
+authorized to bind the other to any obligations with third parties.
+24. SUCCESSION AND ASSIGNMENT. This Agreement will be binding upon and
+inure to the benefit of the parties and their permitted successors and assigns.
+ You may not assign this Agreement, or any part of this Agreement, without the
+prior written approval of NXP, which approval will not be unreasonably withheld
+or delayed. NXP may assign this Agreement, or any part of this Agreement, in
+its sole discretion.
+25. PRIVACY. By agreeing to this Agreement and/or utilizing the Licensed
+Software, Licensee consents to use of certain personal information, including
+but not limited to name, email address, and location, for the purpose of
+NXP’s internal analysis regarding future software offerings. NXP’s
+complete Privacy Statement can be found at:
+https://www.nxp.com/company/our-company/about-nxp/privacy-statement:PRIVACYPRACT
+ICES.
+
+APPENDIX A
+Other License Grants and Restrictions:
+
+The Licensed Software may include some or all of the following software, which
+is either 1) Third Party Software or 2) NXP proprietary software subject to
+different terms than those in the Agreement. If the Software Content Register
+that accompanies the Licensed Software identifies any of the following Third
+Party Software or specific components of the NXP proprietary software, the
+following terms apply to the extent they deviate from the terms in the
+Agreement:
+
+AGGIOS, Inc.: EnergyLab LITE and Seed software are distributed by NXP under
+license from AGGIOS, Inc. Your use of AGGIOS software, as the Licensee, is
+subject to the following: (i) use of AGGIOS software is limited to object code
+and Authorized System only; (ii) Licensee may not sublicense the AGGIOS
+software to any third party; (iii) Licensee is only granted an evaluation
+license for the Seed software, defined as license to use the Seed software
+internally for own evaluation purposes, limited to three (3) months. Further
+rights including but not limited to production deployment must be obtained
+directly from AGGIOS, Inc.
+
+Airbiquity Inc.: The Airbiquity software may only be used in object code and
+Licensee may not sublicense the Airbiquity software to any third party.
+Licensee’s license to use the Airbiquity software expires on June 30, 2024.
+
+Amazon: Use of the Amazon software constitutes your acceptance of the terms of
+the Amazon Program Materials License Agreement (including the AVS Component
+Schedule, if applicable), located at
+https://developer.amazon.com/support/legal/pml. All Amazon software is hereby
+designated "Amazon confidential". With the exception of the binary library of
+the Amazon Wake Word Engine for "Alexa", all Amazon software is also hereby
+designated as "Restricted Program Materials". Amazon is a third-party
+beneficiary to this Agreement with respect to the Amazon software.
+
+Amazon Web Services, Inc.: AWS is an intended third-party beneficiary to this
+Agreement with respect to the Greengrass software. If you have an account with
+AWS that is not in good standing, you may not download, install, use or
+distribute the Greengrass software. You will comply with all instructions and
+requirements in any integration documents, guidelines, or other documentation
+AWS provides. The license to the Greengrass software will immediately terminate
+without notice if you (a) fail to comply with this Agreement or any other
+agreement with AWS, (b) fail to make timely payment for any AWS service, (c)
+fail to implement AWS updates, or (d) bring any action for intellectual
+property infringement against AWS or any AWS customer utilizing AWS services.
+Any dispute or claim relating to your use of the Greengrass software will be
+resolved by binding arbitration, rather than in court, except that you may
+assert claims in small claims court if your claims qualify.
+
+Amazon: AWS Fleetwise software must be used consistent with the terms found
+here: https://github.com/aws/aws-iot-fleetwise-edge/blob/main/LICENSE.
+
+Amphion Semiconductor Ltd.: Distribution of Amphion software must be a part of,
+or embedded within, Authorized Systems that include an Amphion Video Decoder.
+
+Apple MFi Software Development Kit: Use of Apple MFi Software and associated
+documentation is restricted to current Apple MFi licensees in accordance with
+the terms of their own valid and in-effect license from Apple.
+
+Aquantia Corp.: You may use Aquantia's API binaries solely to flash the API
+software to an NXP Product which mates with an Aquantia device.
+
+Argus Cyber Security: The Argus software may only be used in object code and
+only for evaluation and demonstration purposes.
+
+Arm Toolkit: This tool is owned by Arm Limited. You may not reverse engineer,
+decompile or dissemble any ARM Toolkit. You agree to abide by any third-party
+IP requirements, including the relevant license terms where applicable, where
+such third-party IP is identified in the documentation provided with the ARM
+Toolkit. You may not copy the Arm Toolkit except solely for archival and backup
+purposes provided all notices are preserved. Arm disclaims any and all
+liability related to your use of the ARM Toolkit.
+
+Atheros: Use of Atheros software is limited to evaluation and demonstration
+only. Permitted distributions must be similarly limited. Further rights must
+be obtained directly from Atheros.
+
+ATI (AMD): Distribution of ATI software must be a part of, or embedded within,
+Authorized Systems that include a ATI graphics processor core.
+
+Au-Zone Technologies: eIQ Portal, Model Tool, DeepViewRT and ModelRunner are
+distributed by NXP under license from Au-Zone Technologies. Your use of the
+Licensed Software, examples and related documentation is subject to the
+following:
+(1) Use of Software is limited to Authorized System only
+(2) In no event may Licensee Sublicense the Software
+(3) AU-ZONE TECHNOLOGIES SHALL NOT BE LIABLE FOR USE OF LICENSED
+SOFTWARE IN CRITICAL APPLICATIONS BY LICENSEE
+
+Broadcom Corporation: Your use of Broadcom Corporation software is restricted
+to Authorized Systems that incorporate a compatible integrated circuit device
+manufactured or sold by Broadcom.
+
+Cadence Design Systems: Use of Cadence audio codec software is limited to
+distribution only of one copy per single NXP Product. The license granted
+herein to the Cadence Design Systems HiFi aacPlus Audio Decoder software does
+not include a license to the AAC family of technologies which you or your
+customer may need to obtain. Configuration tool outputs may only be distributed
+by licensees of the relevant Cadence SDK and distribution is limited to
+distribution of one copy embedded in a single NXP Product. Your use of Cadence
+NatureDSP Libraries whether in source code or in binary is restricted to NXP
+SoC based systems or emulation enablement based on NXP SoC.
+
+CEVA D.S.P. Ltd. And CEVA Technologies Inc. ("CEVA"): The CEVA-SPF2 linear
+algebra, CEVA-SPF2 Neural Network Libraries, CEVA-SPF2 Core Libraries,
+CEVA-SPF2 OpenAMP and CEVA-SPF2 STL licensed modules are owned by CEVA and such
+materials may only be used in connection with an NXP product containing the
+S250 or S125 integrated circuits, whether or not the CEVA-SPF2 Core is
+physically implemented and/or enabled on such NXP product
+
+Cirque Corporation: Use of Cirque Corporation technology is limited to
+evaluation, demonstration, or certification testing only. Permitted
+distributions must be similarly limited. Further rights, including but not
+limited to ANY commercial distribution rights, must be obtained directly from
+Cirque Corporation.
+
+Coding Technologies (Dolby Labs): Use of CTS software is limited to evaluation
+and demonstration only. Permitted distributions must be similarly limited.
+Further rights must be obtained from Dolby Laboratories.
+
+Coremark: Use of the Coremark benchmarking software is subject to the
+following terms and conditions:
+https://github.com/eembc/coremark/blob/main/LICENSE.md
+
+CSR: Use of Cambridge Silicon Radio, Inc. ("CSR") software is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from CSR.
+
+Crank: Use of Crank Software Inc. software is limited to evaluation and
+demonstration only. Permitted distributions must be similarly limited. Further
+rights must be obtained directly from Crank Software Inc.
+
+Cypress Semiconductor Corporation: WWD RTOS source code may only be used in
+accordance with the Cypress IOT Community License Agreement obtained directly
+from Cypress Semiconductor Corporation.
+
+Elektrobit Automotive GmbH ("EB"): EB software must be used consistent with the
+EB License Terms and Conditions, Version 1.4 (Dec 2019) found here:
+https://www.elektrobit.com/legal-notice/ . Licensee is only granted an
+evaluation license for the EB software, defined as license to use the EB
+software internally for own evaluation purposes, limited to three (3) months.
+Production deployment of the EB software using this license is prohibited. See
+additionally Section 2.1.1 EB EULA.
+
+Embedded Systems Academy GmbH (EmSA): Any use of Micro CANopen Plus is subject
+to the acceptance of the license conditions described in the LICENSE.INFO file
+distributed with all example projects and in the documentation and the
+additional clause described below.
+Clause 1: Micro CANopen Plus may not be used for any competitive or comparative
+purpose, including the publication of any form of run time or compile time
+metric, without the express permission of EmSA.
+
+Fenopix Technologies Private Limited: Under no circumstances may the CanvasJS
+software product be used in any way that would compete with any product from
+Fenopix. License to the CanvasJS software will terminate immediately without
+notice if Licensee fail to comply with any provision of this Agreement.
+
+Fraunhofer IIS: Fraunhofer MPEG Audio Decoder (Fraunhofer copyright) - If you
+are provided MPEG-H decoding functionality, you understand that NXP will
+provide Fraunhofer your name and contact information.
+
+Future Technology Devices International Ltd.: Future Technology Devices
+International software must be used consistent with the terms found here:
+http://www.ftdichip.com/Drivers/FTDriverLicenceTerms.htm
+
+Global Locate (Broadcom Corporation): Use of Global Locate, Inc. software is
+limited to evaluation and demonstration only. Permitted distributions must be
+similarly limited. Further rights must be obtained from Global Locate.
+
+IAR Systems: Use of IAR flashloader or any IAR source code is subject to the
+terms of the IAR Source License located within the IAR zip package. The IAR
+Source License applies to linker command files, example projects unless another
+license is explicitly stated, the cstartup code, low_level_init.c, and some
+other low-level runtime library files.
+
+LC3plus: the LC3plus Low Complexity Communication Codec Plus (LC3plus) per ETSI
+TS 103 634 V1.3.1, is subject to ETSI Intellectual Property Rights Policy, See
+https://portal.etsi.org/directives/45_directives_jun_2022.pdf. For application
+in an End Product, Fraunhofer communication applies, see
+https://www.iis.fraunhofer.de/en/ff/amm/communication/lc3.html
+
+Lumissil: Use of the Lumissil software constitutes your acceptance of the terms
+of the Lumissil Software License Agreement. A link to the agreement is
+incorporated as follows:
+https://www.lumissil.com/assets/pdf/support/2023%20Lumissil%20IS3xCG5317%20Softw
+are%20License%20Agreement%20NXP.pdf . The Run-Time Software and Boot ROM Code
+are without warranty of any kind from NXP or Lumissil, either express or
+implied, including without limitation the implied warranties of
+merchantability, fitness for a particular purpose, or non-infringement. You
+assume the entire risk arising out of the use or performance of the Lumissil
+software, or any systems you design using the such, if any. For the use of
+Lumissil software, Lumissil is as a third-party beneficiary of the this
+Agreement with authority to enforce its rights in the Run-Time Software and
+Boot ROM Code.
+
+Microsoft: Except for Microsoft PlayReady software, if the Licensed Software
+includes software owned by Microsoft Corporation ("Microsoft"), it is subject
+to the terms of your license with Microsoft (the "Microsoft Underlying Licensed
+Software") and as such, NXP grants no license to you, beyond evaluation and
+demonstration in connection with NXP processors, in the Microsoft Underlying
+Licensed Software. You must separately obtain rights beyond evaluation and
+demonstration in connection with the Microsoft Underlying Licensed Software
+from Microsoft. Microsoft does not provide support services for the components
+provided to you through this Agreement. If you have any questions or require
+technical assistance, please contact NXP. Microsoft Corporation is a third
+party beneficiary to this Agreement with the right to enforce the terms of this
+Agreement. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MICROSOFT AND ITS
+AFFILIATES DISCLAIM ANY WARRANTIES FOR THE MICROSOFT UNDERLYING LICENSED
+SOFTWARE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NEITHER MICROSOFT NOR ITS
+AFFILIATES WILL BE LIABLE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, FOR ANY
+DIRECT, INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE DAMAGES,
+INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR ANY LOSS OF USE, LOSS OF TIME,
+INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS, SAVINGS, OR REVENUES, ARISING
+FROM THE FROM THE USE OF THE MICROSOFT UNDERLYING LICENSED SOFTWARE. With
+respect to the Microsoft PlayReady software, you will have the license rights
+granted in Section 2, provided that you may not use the Microsoft PlayReady
+software unless you have entered into a Microsoft PlayReady Master Agreement
+and license directly with Microsoft.
+
+MindTree: Notwithstanding the terms contained in Section 2.3 (a), if the
+Licensed Software includes proprietary software of MindTree in source code
+format, Licensee may make modifications and create derivative works only to the
+extent necessary for debugging of the Licensed Software.
+
+MM SOLUTIONS AD: Use of MM SOLUTIONS AEC (Auto Exposure Control) and AWB (Auto
+White Balance) software is limited to demonstration, testing, and evaluation
+only. In no event may Licensee distribute or sublicense the MM SOLUTIONS
+software. Further rights must be obtained directly from MM SOLUTIONS.
+
+MPEG LA: Use of MPEG LA audio or video codec technology is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from MPEG LA.
+
+MQX RTOS Code: MQX RTOS source code may not be re-distributed by any NXP
+Licensee under any circumstance, even by a signed written amendment to this
+Agreement.
+
+NXP Voice Software: VoiceSpot, VoiceSeeker (including AEC), VIT Speech to
+Intent, and Conversa may be used for evaluation or demonstration purposes only.
+Any commercial distribution rights are subject to a separate royalty agreement
+obtained from NXP.
+
+NXP Wireless Charging Library: License to the Software is limited to use in
+inductive coupling or wireless charging applications
+
+ON Semiconductor: ON Semiconductor AP1302 Image Signal Processor Initialization
+Binaries must be used consistent with the terms found here:
+https://github.com/ONSemiconductor/ap1302_binaries/blob/main/AP1302%20Software%2
+0License%20Agreement.pdf
+
+Opus: Use of Opus software must be consistent with the terms of the Opus
+license which can be found at: http://www.opus-codec.org/license/
+
+Oracle JRE (Java): The Oracle JRE must be used consistent with terms found
+here: http://java.com/license
+
+P&E Micro: P&E Software must be used consistent with the terms found here:
+http://www.pemicro.com/licenses/gdbserver/license_gdb.pdf
+
+Pro Design Electronic: Licensee may not modify, create derivative works based
+on, or copy the Pro Design software, documentation, hardware execution key or
+the accompanying materials. Licensee shall not use Pro Design's or any of its
+licensors names, logos or trademarks to market the Authorized System. Only NXP
+customers and distributors are permitted to further redistribute the Pro Design
+software and only as part of an Authorized System which contains the Pro Design
+software.
+
+Qualcomm Atheros, Inc.: Notwithstanding anything in this Agreement, Qualcomm
+Atheros, Inc. Wi-Fi software must be used strictly in accordance with the
+Qualcomm Atheros, Inc. Technology License Agreement that accompanies such
+software. Any other use is expressly prohibited.
+
+Real Networks - GStreamer Optimized Real Format Client Code implementation or
+OpenMax Optimized Real Format Client Code: Use of the GStreamer Optimized Real
+Format Client Code, or OpenMax Optimized Real Format Client code is restricted
+to applications in the automotive market. Licensee must be a final
+manufacturer in good standing with a current license with Real Networks for the
+commercial use and distribution of products containing the GStreamer Optimized
+Real Format Client Code implementation or OpenMax Optimized Real Format Client
+Code
+
+Real-Time Innovations, Inc.: Not withstanding anything in this Agreement,
+Real-Time Innovations, Inc. software must be used strictly in accordance with
+Real-Time Innovations, Inc.'s Automotive Software Evaluation License Agreement,
+available here:
+https://www.rti.com/hubfs/_Collateral/Services_and_Support/Automotive_Evaluation
+_SLA_90_dayNXP.pdf . Any other use is expressly prohibited.
+
+RivieraWaves SAS (a member of the CEVA, Inc. family of companies): You may not
+use the RivieraWaves intellectual property licensed under this Agreement if you
+develop, market, and/or license products similar to such RivieraWaves
+intellectual property. Such use constitutes a breach of this Agreement. Any
+such use rights must be obtained directly from RivieraWaves.
+
+SanDisk Corporation: If the Licensed Software includes software developed by
+SanDisk Corporation ("SanDisk"), you must separately obtain the rights to
+reproduce and distribute this software in source code form from SanDisk.
+Please follow these easy steps to obtain the license and software:
+(1) Contact your local SanDisk sales representative to obtain the SanDisk
+License Agreement.
+(2) Sign the license agreement. Fax the signed agreement to SanDisk USA
+marketing department at 408-542-0403. The license will be valid when fully
+executed by SanDisk.
+(3) If you have specific questions, please send an email to sales@sandisk.com
+You may only use the SanDisk Corporation Licensed Software on products
+compatible with a SanDisk Secure Digital Card. You may not use the SanDisk
+Corporation Licensed Software on any memory device product. SanDisk retains
+all rights to any modifications or derivative works to the SanDisk Corporation
+Licensed Software that you may create.
+
+SEGGER Microcontroller - emWin Software: Your use of SEGGER emWin software and
+components is restricted for development of NXP ARM7, ARM9, Cortex-M0,
+Cortex-M3, Cortex-M4, Cortex-M33, Cortex-M7, and Cortex-A7 based products only.
+
+SEGGER Microcontroller - J-Link/J-Trace Software: Segger software must be used
+consistent with the terms found here: http://www.segger.com/jlink-software.html
+
+SEVENSTAX - Not withstanding anything in this Agreement, SEVENSTAX GmbH
+software must be used for evaluation purposes only, in strict accordance with
+the SEVENSTAX License Agreement, available here:
+https://www.sevenstax.de/fileadmin/documents/SEVENSTAX-NX-ESLA.txt. Any other
+use, and embedding the software into commercial products, is expressly
+prohibited.
+Synopsys/BLE Software: Your use of the Synopsys/BLE Software and related
+documentation is subject to the following:
+(1) Synopsys is third-party beneficiaries of, and thus may enforce against you,
+the license restrictions and confidentiality obligations in this agreement with
+respect to their intellectual property and proprietary information.
+(2) Your distribution of the Licensed Software shall subject any recipient to a
+written agreement at least as protective of the Licensed Software as provided
+in this Agreement.
+
+Synopsys/Target Compiler Technologies: Your use of the Synopsys/Target Compiler
+Technologies Licensed Software and related documentation is subject to the
+following:
+(1) Duration of the license for the Licensed Software is limited to 12 months,
+unless otherwise specified in the license file.
+(2) The Licensed Software is usable by one user at a time on a single
+designated computer, unless otherwise agreed by Synopsys.
+(3) Licensed Software and documentation are to be used only on a designated
+computer at the designated physical address provided by you on the APEX license
+form.
+(4) The Licensed Software is not sub-licensable.
+
+T2 Labs / T2 Software: As a condition to the grant of any license under this
+Agreement, you represent and warrant that you will comply with all licenses,
+agreements, rules and bylaws of the Bluetooth SIG (Special Interest Group )
+applicable to the licensed software and documentation and its use which may
+affect when and if you may take certain actions under licenses granted
+hereunder.
+
+The license grant under this Agreement is conditional to you being (i) a
+Bluetooth SIG Associate member until such time as the specifications for the
+software are made public to Bluetooth SIG members of any level and (ii)
+thereafter a Bluetooth SIG member of any level.
+
+Notwithstanding the terms contained in Section 2.3 (a), if the licensed
+software includes proprietary software in source code format, you may make
+modifications and create derivative works only to the extent necessary for
+improving the performance of the source code with the NXP products or your
+products and for creating enhancements of such products. You may not further
+sublicense or otherwise distribute the source code, or any modifications or
+derivatives thereof as stand-alone products. You will be responsible for
+qualifying any modifications or derivatives with the Bluetooth SIG and any
+other qualifying bodies.
+
+TARA Systems: Use of TARA Systems GUI technology Embedded Wizard is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from TARA Systems.
+
+Teensyduino Core Library: If the Teensyduino Core Library or documentation is
+incorporated into a build system that allows selection among a list of target
+devices, then similar target devices manufactured by PJRC.com must be included
+in the list of target devices and selectable in the same manner.
+
+Texas Instruments: Your use of Texas Instruments Inc. WiLink8 Licensed Software
+is restricted to NXP SoC based systems that include a compatible connectivity
+device manufactured by TI.
+
+TES Electronic Solutions Germany (TES): TES 3D Surround View software and
+associated data and documentation may only be used for evaluation purposes and
+for demonstration to third parties in integrated form on a board package
+containing an NXP S32V234 device. Licensee may not distribute or sublicense the
+TES software. Your license to the TES software may be terminated at any time
+upon notice.
+
+Vivante: Distribution of Vivante software must be a part of, or embedded
+within, Authorized Systems that include a Vivante Graphics Processing Unit.
+
+Wittenstein: Your use of the SafeRTOS v9.x and Networking Stack, in object
+form, is limited to your internal testing, evaluation, feedback and development
+specifically for use with an NXP Product. Licensee’s license to use and
+supply the software to you expires on June 25, 2026. Further rights must be
+obtained directly from Wittenstein.
diff --git a/MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0/.project b/MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0/.project
deleted file mode 100644
index 85faddc..0000000
--- a/MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0
-
-
-
-
-
- com.is2t.microej.pro.workbench.jpfBuilder
-
-
-
-
-
- com.is2t.microej.pro.workbench.jpfNature
-
-
diff --git a/Makefile b/Makefile
index 9f19bc8..a8b5257 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2023 NXP
+# Copyright 2023-2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -24,20 +24,26 @@ BASE_DIR=$(shell pwd)
endif
define del_file
- $(if $(filter $(OS),Windows_NT),$(if $(wildcard $(1)),cmd /c DEL /f /q $(1),),rm -f $(1))
+ $(if $(filter $(OS),Windows_NT),$(if $(wildcard $(1)),cmd /c DEL /f /q $(subst /,\\,$(1)),),rm -f $(1))
endef
define del_dir
$(if $(filter $(OS),Windows_NT),$(if $(wildcard $(1)),cmd /c RD /s /q $(subst /,\\,$(1)),),rm -fr $(1))
endef
-BSP_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-bsp
-PLAT_DIR=$(BASE_DIR)/MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0
-APP_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-apps
-FP_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-fp
-MOCK_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-mock
-CONF_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-configuration
-VAL_DIR=$(BASE_DIR)/nxpvee-mimxrt595-evk-round-validation
+BSP_DIR=$(BASE_DIR)/bsp
+PLAT_DIR=$(BASE_DIR)/microej/MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0
+APP_DIR=$(BASE_DIR)/microej/apps
+FP_DIR=$(BASE_DIR)/microej/front-panel
+MOCK_DIR=$(BASE_DIR)/microej/mock
+CONF_DIR=$(BASE_DIR)/microej/vee-port-configuration
+VAL_DIR=$(BASE_DIR)/microej/validation
+
+TEST_DIR.java.test.core=$(VAL_DIR)/core/java-testsuite-runner-core
+TEST_DIR.java.test.ui=$(VAL_DIR)/ui/ui3/java-testsuite-runner-ui3
+TEST_DIR.java.test.gpio=$(VAL_DIR)/gpio/gpio-testsuite-runner
+
+VALIDATIONS?=core gpio ui
ifeq ($(ECLIPSE_HOME_VAR),)
$(error Define ECLIPSE_HOME_VAR to i.e. ~/MicroEJ/MicroEJ-SDK-21.11/rcp/)
@@ -49,8 +55,11 @@ endif
ifeq ($(strip $(PUBLISH)),1)
PUBLISH_ARTIFACTS=-Dskip.publish=false
+ PUBLISH_MODE=release
+ MODULE_REPOSITORY_SETTINGS=
else
PUBLISH_ARTIFACTS=
+ PUBLISH_MODE=
endif
USAGE?=eval
@@ -71,7 +80,7 @@ PROJS = nxpvee-ui
include Makefile.inc
help:
- @echo "nxpvee-mimxrt1170-evk build system:"
+ @echo "nxp-vee-rt595 build system:"
@echo ""
@echo "Valid targets are:"
@echo " nxpvee-ui.prj build complete UI project"
@@ -86,7 +95,7 @@ help:
@echo ""
@echo "Valid options are:"
@echo " S2S_TTY set validation serial port i.e. ttyACM0"
- @echo " VALIDATIONS='[option]+' overrides validation projetcs to be run
+ @echo " VALIDATIONS='[option]+' overrides validation projects to be run {core gpio ui}"
@echo " VERBOSE=1 compile in verbose mode"
@echo " QUIET=1 compile in quiet mode"
@echo " USAGE=[eval|prod] compile in eval or prod"
diff --git a/Makefile.inc b/Makefile.inc
index 1acabad..11b3918 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,5 +1,5 @@
#
-# Copyright 2023 NXP
+# Copyright 2023-2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -8,21 +8,15 @@ ifeq ($(OS),Windows_NT)
S2SEXE=$(BSP_DIR)/projects/common/scripts/s2s.bat
LINK=&&
TOUCH=cmd /c type nul >
+FIND_JAVA_FILES_IN_APP_DIR=$(shell cmd /c dir /s /b "$(subst /,\,$(APP_DIR))\*.java")
else
S2SEXE=$(BSP_DIR)/projects/common/scripts/s2s.sh
LINK=;
TOUCH=touch
+FIND_JAVA_FILES_IN_APP_DIR=$(shell find $(APP_DIR) -name "*.java")
endif
-.PRECIOUS: .java.fp .java.mock .java.configuration .%.java.app
-
-.java.fp:
- cd $(FP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
- -Declipse.home="$(ECLIPSE_HOME)" \
- -Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
- $(MODULE_REPOSITORY_SETTINGS) \
- $(JAVA_VERBOSE)
- $(TOUCH) $@
+.PRECIOUS: .java.mock .java.configuration .%.java.app
.java.mock:
cd $(MOCK_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
@@ -32,8 +26,8 @@ endif
$(JAVA_VERBOSE)
$(TOUCH) $@
-.java.configuration:
- cd $(CONF_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
+.java.configuration: $(CONF_DIR)/module.ivy
+ cd $(CONF_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish $(PUBLISH_MODE) \
$(PUBLISH_ARTIFACTS) \
-Declipse.home="$(ECLIPSE_HOME)" \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
@@ -47,27 +41,18 @@ endif
javasec.prop :
$(MICROEJ_SEC)
-.java.test.core: javasec.prop
- cd $(VAL_DIR)/core/java-testsuite-runner-core $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
- -Declipse.home="$(ECLIPSE_HOME)" \
- $(MODULE_REPOSITORY_SETTINGS) \
- -Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
- -Dplatform-loader.target.platform.dir=$(PLAT_DIR)/source \
- -Ddeploy.bsp.root.dir=$(BSP_DIR) \
- -Dlaunch.properties.jvm="-Djava.security.properties=$(BASE_DIR)/javasec.prop" \
- -Dplatform-launcher.platform.dir=$(PLAT_DIR)/source $(JAVA_VERBOSE)
-
-.java.test.ui: javasec.prop
- cd $(VAL_DIR)/ui/ui3/java-testsuite-runner-ui3 $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
+$(addprefix .java.test.,$(VALIDATIONS)): javasec.prop
+ cd $(TEST_DIR$@) $(LINK) $(EXPORT) TEST_TYPE="ARMGCC" $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
-Dplatform-loader.target.platform.dir=$(PLAT_DIR)/source \
-Ddeploy.bsp.root.dir=$(BSP_DIR) \
-Dlaunch.properties.jvm="-Djava.security.properties=$(BASE_DIR)/javasec.prop" \
+ -D"local.repo.url=$(BASE_DIR)/test_results/" \
-Dplatform-launcher.platform.dir=$(PLAT_DIR)/source $(JAVA_VERBOSE)
-.%.java.app: javasec.prop
+.%.java.app: javasec.prop $(APP_DIR)/module.ivy $(FIND_JAVA_FILES_IN_APP_DIR)
cd $(APP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
@@ -80,10 +65,10 @@ javasec.prop :
$(call del_file,.*.java.app)
$(TOUCH) $@
-nxpvee-validation.prj: clean .java.fp .java.mock .java.configuration .java.test.s2s .java.test.core .java.test.ui
+nxpvee-validation.prj: clean .java.mock .java.configuration .java.test.s2s $(addprefix .java.test.,$(VALIDATIONS))
echo "done"
-%.prj: .java.fp .java.mock .java.configuration .%.java.app
+%.prj: .java.mock .java.configuration .%.java.app
make -C $(BSP_DIR)/projects/$(basename $@)/sdk_makefile
$(addsuffix -flash,$(PROJS)):
@@ -102,7 +87,7 @@ $(addsuffix -gdb_cmsisdap,$(PROJS)):
make $(@:%-gdb_cmsisdap=%).prj
make -C $(BSP_DIR)/projects/$(@:%-gdb_cmsisdap=%)/sdk_makefile gdb_cmsisdap
-$(addsuffix -java_run,$(PROJS)): .java.fp .java.mock .java.configuration
+$(addsuffix -java_run,$(PROJS)): .java.mock .java.configuration
cd $(APP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm run \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
@@ -111,7 +96,7 @@ $(addsuffix -java_run,$(PROJS)): .java.fp .java.mock .java.configuration
-Dapplication.main.class=$(if $(MAIN),$(MAIN),$(MAIN.$(@:%-java_run=%).java.app)) \
-Dplatform-launcher.platform.dir=$(PLAT_DIR)/source $(JAVA_VERBOSE)
-$(addsuffix -java_rebuild,$(PROJS)): .java.fp .java.mock .java.configuration
+$(addsuffix -java_rebuild,$(PROJS)): .java.mock .java.configuration
$(call del_file,.*.java.app)
make .$(@:%-java_rebuild=%).java.app
diff --git a/README.md b/README.md
index 4b29111..dafa854 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,33 @@
-- [NXP VEE for i.MX RT595 EVK v1.2.0](#nxp-vee-for-imx-rt595-evk-v120)
+- [NXP Platform Accelerator for i.MX RT595 EVK v2.0.0](#nxp-platform-accelerator-for-imx-rt595-evk-v200)
+ - [MicroEJ SDK 6](#microej-sdk-6)
+ - [MicroEJ SDK 5](#microej-sdk-5)
- [VEE Port Specifications](#vee-port-specifications)
- [Requirements](#requirements)
- [Directory structure](#directory-structure)
- [Preliminary steps](#preliminary-steps)
- - [Get West](#get-west)
- [Get the MicroEJ SDK](#get-the-microej-sdk)
- - [Get Visual Studio Code](#get-visual-studio-code)
- - [Get GNU ARM Embedded Toolchain](#get-gnu-arm-embedded-toolchain)
- - [Board Setup](#board-setup)
+ - [Get Visual Studio Code and MCUXpresso Installer tool](#get-visual-studio-code-and-mcuxpresso-installer-tool)
+ - [MCUXpresso Installer tool](#mcuxpresso-installer-tool)
- [Fetch the source code](#fetch-the-source-code)
- - [West : `PermissionError: \[WinError 5\] Access is denied`](#west--permissionerror-winerror-5-access-is-denied)
- [MicroEJ IDE project setup](#microej-ide-project-setup)
- [Import the project in a new workspace](#import-the-project-in-a-new-workspace)
- - [Build the VEE Port](#build-the-vee-port)
+ - [VEE Port Build](#vee-port-build)
+ - [Build the mockup](#build-the-mockup)
+ - [Build the VEE Port](#build-the-vee-port)
- [Build and run applications using the MicroEJ SDK IDE](#build-and-run-applications-using-the-microej-sdk-ide)
- [Build and run the applications in simulation mode](#build-and-run-the-applications-in-simulation-mode)
- [Modify the `AnimatedMascot` application](#modify-the-animatedmascot-application)
- - [Build and run applications on your i.MX RT595](#build-and-run-applications-on-your-imx-rt595)
+ - [Build and run applications on your i.MX RT595 EVK](#build-and-run-applications-on-your-imx-rt595-evk)
+ - [Board Setup](#board-setup)
- [Get an evaluation license](#get-an-evaluation-license)
- [Build the applications for target](#build-the-applications-for-target)
+ - [Output of the build](#output-of-the-build)
- [Build the firmware for target hardware using VS Code](#build-the-firmware-for-target-hardware-using-vs-code)
+ - [Load the project into VS Code](#load-the-project-into-vs-code)
+ - [Select a Preset](#select-a-preset)
+ - [Configure the project](#configure-the-project)
+ - [Configure the bsp features](#configure-the-bsp-features)
+ - [Build the project](#build-the-project)
- [Run Demo Wearable VG application](#run-demo-wearable-vg-application)
- [Get the application](#get-the-application)
- [Run the application in simulation mode](#run-the-application-in-simulation-mode)
@@ -27,122 +35,180 @@
- [Switching to a production license](#switching-to-a-production-license)
- [Alternative: build and run from command line](#alternative-build-and-run-from-command-line)
- [Requirements for building from command line](#requirements-for-building-from-command-line)
+ - [C toolchain](#c-toolchain)
+ - [CMake](#cmake)
+ - [Make](#make)
- [Populate a Build Kit](#populate-a-build-kit)
- [Using default evaluation license](#using-default-evaluation-license)
- [Needed Environment variables](#needed-environment-variables)
- [Explore available options (works on Linux)](#explore-available-options-works-on-linux)
- - [compile and flash](#compile-and-flash)
- - [debug](#debug)
- - [Ninja](#ninja)
+ - [Compile and flash](#compile-and-flash)
+ - [Compilation defaults](#compilation-defaults)
+ - [Compile with just NET support enabled](#compile-with-just-net-support-enabled)
+ - [Debug](#debug)
- [Compile Release image](#compile-release-image)
- [Compile using production license](#compile-using-production-license)
- [Tutorial: Using native C functions from the high level application](#tutorial-using-native-c-functions-from-the-high-level-application)
- [Declaring and using native functions in the Java world](#declaring-and-using-native-functions-in-the-java-world)
- [Implementing the native functions in C world](#implementing-the-native-functions-in-c-world)
- [Implementing a mockup of the native functions for the simulator](#implementing-a-mockup-of-the-native-functions-for-the-simulator)
- - [Get familiar with MICROEJ](#get-familiar-with-microej)
+ - [Get familiar with MicroEJ](#get-familiar-with-microej)
- [Examples](#examples)
- - [MICROEJ Documentation](#microej-documentation)
+ - [MicroEJ Documentation](#microej-documentation)
- [Troubleshooting](#troubleshooting)
+ - [Setup error](#setup-error)
+ - [West update and "Filename too long" issue](#west-update-and-filename-too-long-issue)
+ - [West update and "PermissionError: \[WinError 5\] Access is denied" issue](#west-update-and-permissionerror-winerror-5-access-is-denied-issue)
- [License Error when building application](#license-error-when-building-application)
+ - [\[M65\] - License check failed](#m65---license-check-failed)
- [Flash config issue for i.MX RT595 EVK Rev. D](#flash-config-issue-for-imx-rt595-evk-rev-d)
-# NXP VEE for i.MX RT595 EVK v1.2.0
-This project is used to build an NXP VEE Port for the [i.MX RT595 EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK) with a display panel [G1120B0MIPI](https://www.nxp.com/part/G1120B0MIPI#/).
-![imxrt595evk-g1120b0mipi](Documentation/pictures/RT595/imxrt595evk-g1120b0mipi.jpg)
+# NXP Platform Accelerator for i.MX RT595 EVK v2.0.0
+This project is used to build NXP Platform Accelerator for the [i.MX RT595 EVK](https://www.nxp.com/design/design-center/development-boards-and-design/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK) with a display panel [G1120B0MIPI](https://www.nxp.com/part/G1120B0MIPI#/).
-VEE stands for Virtual Execution Environment and provides a hardware abstraction to develop applications in high-level programming languages such as Java.
-NXP VEE is built upon [MicroEJ technology](https://www.microej.com/product/vee/).
+![imxrt595evk](Documentation/pictures/RT595/imxrt595evk.jpg)
+![g1120b0mipi](Documentation/pictures/RT595/g1120b0mipi.jpg)
-This release provides:
+NXP Platform Accelerator a VEE (Virtual Execution Environment) and provides a hardware abstraction to develop applications in high-level programming languages such as Java.
+
+NXP Platform Accelerator is built upon [MicroEJ technology](https://www.microej.com/product/vee/).
+
+This release includes:
+
+* i.MX RT595 EVK simulator to develop VEE applications and test them on a host PC
+ * The simulator program has a graphic display of the EVK board and its LCD panel
+* The necessary recipes to embed the VEE architecture for GCC
+* Various [Foundation Libraries](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/libraries.html) to provide high level libraries to developers. Notable Foundation Libraries part of this release are:
+ * [MicroUI](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroUI/index.html#section-app-microui) to create user interfaces
+
+ * [MicroVG](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroVG/index.html) to provide accelerated vector drawing capabilities
+
+
+
+
+* [MCUXpresso SDK](https://mcuxpresso.nxp.com/en/welcome) 2.15.100 for i.MX RT595 EVK
+* [FreeRTOS](https://www.freertos.org/index.html) version 10.5.1
+* Sample applications demonstrating NXP VEE:
-* an i.MX RT595 EVK simulator to develop VEE applications and test them on a host PC
-* a front panel showing the EVK and its display in the simulator
-* the necessary recipes to embed the VEE architecture for GCC
-* various [Foundation Libraries](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/libraries.html) to provide high level libraries to developers
-* in particular, Foundation Libraries [MicroUI](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroUI/index.html#section-app-microui) to create user interfaces and [MicroVG](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroVG/index.html) to provide accelerated vector drawing capabilities
-* [MCUXpresso SDK](https://mcuxpresso.nxp.com/en/welcome) 2.12.0 for RT595
-* FreeRTOS version 10.0.0
-* sample applications demonstrating NXP VEE:
* SimpleGFX: draw moving NXP coloured boxes using MicroUI
+
+
* AnimatedMascot: draw an animated [Android Vectordrawable](https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources) image using MicroVG
-* a [Mock](https://docs.microej.com/en/latest/PlatformDeveloperGuide/mock.html) to give Java implementations for C native functions used by application SimpleGFX
+
+
+* [Mock](https://docs.microej.com/en/latest/PlatformDeveloperGuide/mock.html) support with Java stub implementations to mimick C native functions. Thanks to this mock support, the SimpleGFX application can smoothly run on the simulator
+
+## MicroEJ SDK 6
+
+NXP Platform Accelerator is built on MicroEJ technology.
+
+MicroEJ SDK 6 is the latest available MicroEJ SDK.
+The SDK 6 uses Gradle plugin to compile and package MicroEJ modules.
+It allows the user to use his favourite IDE such as Android Studio or IntelliJ IDEA (see [the list of supported IDE](https://docs.microej.com/en/latest/SDK6UserGuide/install.html#install-the-ide)).
+
+SDK 6 is currently limited to the build, test and simulation of **Applications and Add-on Libraries** (see [Scope and Limitations](https://docs.microej.com/en/latest/SDK6UserGuide/limitations.html#sdk-6-limitations) for more information).
+If you need other features, such as **developping a VEE Port**, you have to use the SDK 5.
+
+If you are an application developer only and do not need to make changes to the VEE Port, you can use the SDK 6. Please click on the button below to access to the SDK 6 Getting Started on the i.MX RT595 EVK.
+
+[![sdk6-documentation](Documentation/pictures/common/sdk6-button.png)](https://docs.microej.com/en/latest/SDK6UserGuide/gettingStartedIMXRT595.html)
+
+## MicroEJ SDK 5
+
+If you want to modify the VEE Port, make changes to low level source code, please use SDK 5 and continue following this README.
## VEE Port Specifications
-The architecture version is ```7.20.1```.
+The architecture version is ```8.1.1```.
+
This VEE Port provides the following Foundation Libraries:
|Foundation Library|Version|
|------------------|-------|
|BON |1.4|
+|DEVICE |1.1|
|DRAWING |1.0|
|EDC |1.3|
-|MICROUI |3.1|
-|MICROVG |1.1|
+|KF |1.7|
+|MICROUI |3.5|
+|MICROVG |1.4|
|SNI |1.4.0|
|TRACE |1.1|
+
+The VEE Port is derived into:
+* a Mono-Sandbox VEE Port (default)
+
+
+
## Requirements
* PC with Windows 10 or higher, or Linux (tested on Debian 11)
* Note for Mac users: this documentation does not cover Mac usage, however it is supported by the MicroEJ tools. If you are interested in Mac support, please [contact MicroEJ](https://www.microej.com/contact/#form_2).
-* Java JDK 11 see [Get the MicroEJ SDK](#get-the-microej-sdk) section
-* [West](https://docs.zephyrproject.org/latest/develop/west/install.html), a meta-tool to handle git dependencies
* Internet connection to [MicroEJ Central Repository](https://developer.microej.com/central-repository/)
-* i.MX RT595 EVK board, available [here](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK)
-* G1120B0MIPI display panel, available [here](https://www.nxp.com/part/G1120B0MIPI#/)
+* MicroEJ SDK Distribution 23.07 or higher, available [here](https://developer.microej.com/microej-sdk-software-development-kit/)
+
+* i.MX RT595 EVK board (can be ordered [here](https://www.nxp.com/design/design-center/development-boards-and-design/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK)) and G1120B0MIPI display panel (can be ordered [here](https://www.nxp.com/part/G1120B0MIPI#/))
+
* Optionally: J-Link Debugger to flash the software
## Directory structure
```
nxp-vee-rt595
+├───bsp
+│ └── projects
+│ ├── common
+│ ├── microej
+│ └── nxpvee-ui
+├── BuildKit.readme.txt
+├── CHANGELOG.md
├───Documentation
+├───LICENSE.txt
├───Licenses
-├───MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0
-├───nxpvee-mimxrt595-evk-round-apps
-├───nxpvee-mimxrt595-evk-round-bsp
-├───nxpvee-mimxrt595-evk-round-configuration
-├───nxpvee-mimxrt595-evk-round-fp
-├───nxpvee-mimxrt595-evk-round-imageGenerator
-├───nxpvee-mimxrt595-evk-round-mock
-└───nxpvee-mimxrt595-evk-round-validation
+├── Makefile
+├── Makefile.inc
+├── microej
+│ ├── apps
+│ ├── front-panel
+│ ├── imageGenerator
+│ ├── MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0
+│ ├── mock
+│ ├── validation
+│ └── vee-port-configuration
+├── README.md
+├── SCR-nxpvee-mimxrt595-evk.txt
+├── .vscode
+└── west.yml
```
Following is a quick introduction to each folder:
-* `MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0`: This folder contains the VEE runtime files. Initially, this folder is empty, but it will be populated after the building of the VEE Port.
-* `nxpvee-mimxrt595-evk-round-apps`: This folder contains two Java demo applications named `AnimatedMascot` and `SimpleGFX`. They are used in this Readme as examples.
-* `nxpvee-mimxrt595-evk-round-bsp`: This folder contains the C BSP project of the VEE Port. You will find the C implementation of the libraries used in this VEE Port.
-* `nxpvee-mimxrt595-evk-round-configuration`: This folder contains the VEE Port configuration project. Inside it, you will find the [VEE Port Configuration](https://docs.microej.com/en/latest/VEEPortingGuide/platformConcepts.html#microej-platform-configuration) files.
-* `nxpvee-mimxrt595-evk-round-fp`: This folder contains the [Front Panel](https://docs.microej.com/en/latest/VEEPortingGuide/frontpanel.html) mock of the VEE Port. It allows applications to be developed and tested in a Simulator rather than on the target device.
-* `nxpvee-mimxrt595-evk-round-imageGenerator`: This folder contains the [Extended Mode](https://docs.microej.com/en/latest/VEEPortingGuide/uiImageGenerator.html#extended-mode) of the [Image Generator](https://docs.microej.com/en/latest/VEEPortingGuide/uiImageGenerator.html).
-* `nxpvee-mimxrt595-evk-round-mock`: This folder contains the [Mock](https://docs.microej.com/en/latest/VEEPortingGuide/mock.html) where are implemented native method used by `SimpleGFX` application. If you are not familiar with native methods, please have a look at [Native Interface Mechanisms](https://docs.microej.com/en/latest/VEEPortingGuide/native.html) documentation.
-* `nxpvee-mimxrt595-evk-round-validation`: This folder contains the Java test suites to validate the VEE Port behavior. You will find the core validation that checks the correct runtime execution of the VEE Port. You will also find the UI validation that checks drivers and implementation of LLAPI `LLUI_DISPLAY_IMPL`.
+* `MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0`: This folder contains the VEE runtime files. Initially, this folder is empty, but it will be populated after the building of the VEE Port.
+* `apps`: This folder contains two Java demo applications named `AnimatedMascot` and `SimpleGFX`. They are used in this Readme as examples.
+* `bsp`: This folder contains the C BSP project of the VEE Port. You will find the C implementation of the libraries used in this VEE Port.
+* `vee-port-configuration`: This folder contains the VEE Port configuration project. Inside it, you will find the [VEE Port Configuration](https://docs.microej.com/en/latest/VEEPortingGuide/platformConcepts.html#microej-platform-configuration) files.
+* `front-panel`: This folder contains the [Front Panel](https://docs.microej.com/en/latest/VEEPortingGuide/frontpanel.html) mock of the VEE Port. It allows applications to be developed and tested in a Simulator rather than on the target device.
+* `imageGenerator`: This folder contains the [Extended Mode](https://docs.microej.com/en/latest/VEEPortingGuide/uiImageGenerator.html#extended-mode) of the [Image Generator](https://docs.microej.com/en/latest/VEEPortingGuide/uiImageGenerator.html).
+* `mock`: This folder contains the [Mock](https://docs.microej.com/en/latest/VEEPortingGuide/mock.html) where are implemented native method used by `SimpleGFX` application. If you are not familiar with native methods, please have a look at [Native Interface Mechanisms](https://docs.microej.com/en/latest/VEEPortingGuide/native.html) documentation.
+* `validation`: This folder contains the Java test suites to validate the VEE Port behavior. You will find the core validation that checks the correct runtime execution of the VEE Port. You will also find the UI validation that checks drivers and implementation of LLAPI `LLUI_DISPLAY_IMPL`.
## Preliminary steps
-### Get West
-[West](https://docs.zephyrproject.org/latest/develop/west/index.html) is a Zephyr tool for multiple repository management systems.
-
-It will be used to fetch the code and its dependencies.
-
-Install West by following [Installing west](https://docs.zephyrproject.org/latest/develop/west/install.html) instructions.
-
### Get the MicroEJ SDK
-The MICROEJ SDK is an Eclipse-based IDE used to build the VEE Port and the high-level applications. In addition, it is able to run a simulator of the target hardware.
+The MicroEJ SDK is an Eclipse-based IDE used to build the VEE Port and the high-level applications. The SDK can be used to run the i.MX RT595 EVK simulator.
-The MICROEJ SDK requires Java JDK. JDK version [depends on the MICROEJ SDK version](https://docs.microej.com/en/latest/SDKUserGuide/systemRequirements.html).
+The MicroEJ SDK requires Java JDK. JDK version [depends on the MicroEJ SDK version](https://docs.microej.com/en/latest/SDKUserGuide/systemRequirements.html).
* Install the JDK. You can download it on the [Java SE 11](https://www.oracle.com/java/technologies/downloads/#java11) page
-* Install MICROEJ SDK 23.07. Please refer to [Download and Install – MicroEJ Documentation](https://docs.microej.com/en/latest/SDKUserGuide/installSDKDistributionLatest.html#) and [Installer Repository](https://repository.microej.com/packages/SDK/23.07/)
+* Install MicroEJ SDK 23.07. Please refer to [Download and Install – MicroEJ Documentation](https://docs.microej.com/en/latest/SDKUserGuide/installSDKDistributionLatest.html#) and [Installer Repository](https://repository.microej.com/packages/SDK/23.07/)
This release has been tested with MicroEJ SDK 23.07 and Java JDK 11.
-### Get Visual Studio Code
+
+### Get Visual Studio Code and MCUXpresso Installer tool
VS Code is an IDE used to build, flash and debug embedded projects.
In this VEE Port release, VS Code is used to build the firmware that will be flashed to target. VS Code project uses the VEE Port and high level applications built by the MicroEJ SDK.
@@ -151,91 +217,41 @@ In this VEE Port release, VS Code is used to build the firmware that will be fla
* Start VS Code and install the [MCUXpresso for VS Code](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC?tid=vanMCUXPRESSO-VSC) extension package.
* Install the [MCUXpresso VS Code package dependencies](https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/Dependency-Installation) to support the full development flow.
-### Get GNU ARM Embedded Toolchain
-To build an image that runs on target, you need a Cortex-M toolchain.
-The toolchain used to validate this release is the [GNU ARM Embedded Toolchain](https://developer.arm.com/downloads/-/gnu-rm).
-
-**Toolchain for Linux**: [gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2](https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2?rev=78196d3461ba4c9089a67b5f33edf82a&hash=D484B37FF37D6FC3597EBE2877FB666A41D5253B)
-
-**Toolchain for Windows**: [gcc-arm-none-eabi-10.3-2021.10-win32.exe](https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.exe?rev=29bb46cfa0434fbda93abb33c1d480e6&hash=3C58D05EA5D32EF127B9E4D13B3244D26188713C)
+### MCUXpresso Installer tool
-Once installed, the following environment variable must be set to point to the toolchain directory:
-
-Linux:
+Using previously installed MCUXpresso Installer tool, need to install following tools that are used during compilation/debug:
-* Open ` ~/.bashrc` file.
-* Add the following line at the end of the file:
+* CMake, Ninja, West and ARM GNU Toolchain under MCUXpresso SDK Developer
+* LinkServer under its own section
+* SEGGER J-Link under its own section (if optional J-Link is used)
-```
-export ARMGCC_DIR=/opt/gcc-arm-none-eabi-10.3-2021.10/
-```
+These tools can also be installed independently, MCUXpresso installer tool is just providing a convenient way to install them.
+In case of standalone installation, following versions need to be installed:
-Windows:
+* CMake version 3.27 minimum
+* ARM GNU Toolchain version 13.2.1 minimum
+* LinkServer version 1.6.133 minimum
-* Open the `Edit the system environment variables` application on Windows.
-* Click on the `Environment Variables…` button.
-* Click on the `New…` button under the `User variables` section.
-* Set `Variable` Name to `ARMGCC_DIR`.
-* Set `Variable Value` to the toolchain directory (e.g. `C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10`).
-* Click on the `Ok` button until it closes `Edit the system environment variables` application.
-
-
-## Board Setup
-![Setup](Documentation/pictures/RT595/imxrt595evk-setup.jpg)
-
-Setup the [i.MX RT595 EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK):
-* Check that the dip switches (SW7) are set to OFF, OFF and ON (ISP0, ISP1, ISP2).
-* Ensure jumpers JP18 and JP19 are closed.
-* Remove jumper JP4.
-* Connect the micro-USB cable to J40 to power the board.
-
-The USB connection is used as a serial console for the SoC, as a CMSIS-DAP debugger and as a power input for the board.
-
-MicroEJ VEE Port uses the virtual UART from the i.MX RT595 EVK USB port. A COM port is automatically mounted when the board is plugged into a computer using a USB cable. All board logs are available through this COM port.
-
-The COM port uses the following parameters:
-
-| Baudrate | Data bits bits | Parity bits | Stop bits | Flow control |
-| -------- | -------- | -------- | -------- | -------- |
-| 115200 | 8 | None | 1 | None |
## Fetch the source code
-On Windows, fetching the source code may trigger the following fatal error:
-```error: unable to create file [...]: Filename too long.```
-To avoid this, git configuration needs to be updated to handle long file names:
-
-Start Git Bash as Administrator.
-
-Run following command:
-```git config --system core.longpaths true```
-
Clone the repository with the following command:
```
-mkdir nxpvee-mimxrt595-prj
+mkdir nxpvee-mimxrt595-prj
cd nxpvee-mimxrt595-prj
-west init -m https://github.com/nxp-mcuxpresso/nxp-vee-imxrt595-evk.git .
+west init -m https://github.com/nxp-mcuxpresso/nxp-vee-imxrt595-evk .
west update
```
you will get
+
```
.west nxp-vee-rt595
```
-### West : `PermissionError: [WinError 5] Access is denied`
-If you get the error `PermissionError: [WinError 5] Access is denied`, please consider the following procedure :
-
-```
-rm .west
-cd nxp-vee-rt595
-west init -l
-cd ..
-west update
-```
## MicroEJ IDE project setup
### Import the project in a new workspace
@@ -243,9 +259,9 @@ Launch MicroEJ SDK and create a blank workspace.
Import the cloned repository as an existing project:
-![Import...](Documentation/pictures/RT595/sdk_import.png)
+![Import...](Documentation/pictures/common/sdk_import.png)
-![Existing Projects Into Workspace](Documentation/pictures/RT595/sdk_existing_project.png)
+![Existing Projects Into Workspace](Documentation/pictures/common/sdk_existing_project.png)
Then select all projects from the repository.
@@ -255,7 +271,7 @@ The package explorer view should look like this:
![Package Explorer](Documentation/pictures/RT595/sdk_package_explorer.png)
-### Build the VEE Port
+### VEE Port Build
The VEE Port for the board is the first thing to build with the IDE.
For demonstration purposes, one of the release examples uses a mockup (more details follow in the native functions description).
The mockup is a dependency of the VEE Port and must therefore be built beforehand.
@@ -266,13 +282,13 @@ Right click on the mockup project and select `Build Module`:
![Build mockup](Documentation/pictures/RT595/sdk_build_mock.png)
-#### Build the VEE Port
+#### Build the VEE Port
Once the mockup dependency is resolved, the VEE Port can be built by using [VEE Port Build](https://docs.microej.com/en/latest/VEEPortingGuide/platformCreation.html#platform-build) instructions.
Right-click on the configuration project and select `Build Module`:
![Build platform](Documentation/pictures/RT595/sdk_build_platform.png)
-Building the platform will populate the initally empty `MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0` project which will be used to build VEE applications.
+Building the platform will populate the initally empty `MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0` project which will be used to build VEE applications.
Under the `source` folder of the VEE Port, you will find the following files:
* The C header files of the native needed by the VEE Port libraries are located in the `include` folder.
* The Java API of the VEE Port libraries is located in the `javaAPIS` folder.
@@ -281,25 +297,32 @@ Under the `source` folder of the VEE Port, you will find the following files:
* The VEE core, the MicroJVM, and some tools.
## Build and run applications using the MicroEJ SDK IDE
+
Two example VEE applications are provided with this release.
+
Application `SimpleGFX` displays three moving rectangles using the [MicroUI API](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroUI/index.html#section-app-microui). The coordinates of the rectangles are calculated in C native functions.
-Application `AnimatedMascot` draws an animated [Android Vectordrawable](https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources) image. It uses the i.MX RT595's GCNanoLite-V as an accelerator.
+
+Application `AnimatedMascot` draws an animated [Android Vectordrawable](https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources) image. It uses the RT595's GCNanoLite-V as an accelerator.
+
### Build and run the applications in simulation mode
To run applications in simulation mode, right-click on the apps project and select `Run As -> MicroEJ Application`:
![Run As MicroEJ Application](Documentation/pictures/RT595/sdk_run_as_microej_app.png)
+
The IDE will prompt which application should be built: either `SimpleGFX` or `AnimatedMascot`:
![Select Java Application](Documentation/pictures/RT595/sdk_choose_app.png)
Choose the application. Then run the application in simulation mode by choosing the mode _(SIM)_:
+
![Choose build mode](Documentation/pictures/RT595/sdk_choose_app_mode.png)
+
Here is the `AnimatedMascot` application running in simulation:
![Animated Mascot](Documentation/pictures/RT595/sdk_sim_mascot.png)
@@ -309,7 +332,7 @@ Now we will show you how easy it is to modify and test your Java application on
To do so, we will modify the background color of the `AnimatedMascot` application:
-* Open the `AnimatedMascot.java` file located in the `nxpvee-mimxrt595-evk-round-apps/src/main/java/com/nxp/animatedMascot` folder.
+* Open the `AnimatedMascot.java` file located in the `microej/apps/src/main/java/com/nxp/animatedMascot` folder.
* It sets the background color line 57. Replace the following line:
```
g.setColor(Colors.BLACK);
@@ -325,7 +348,30 @@ Here is the modified `AnimatedMascot` application running in simulation:
![Modified Animated Mascot](Documentation/pictures/RT595/sdk_sim_modified_mascot.png)
-## Build and run applications on your i.MX RT595
+## Build and run applications on your i.MX RT595 EVK
+
+
+### Board Setup
+![Setup](Documentation/pictures/RT595/imxrt595evk-setup.jpg)
+
+Setup the [i.MX RT595 EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt595-evaluation-kit:MIMXRT595-EVK):
+* Check that the dip switches (SW7) are set to OFF, OFF and ON (ISP0, ISP1, ISP2).
+* Ensure jumpers JP18 and JP19 are closed.
+* Remove jumper JP4.
+* Connect the micro-USB cable to J40 to power the board.
+* To use JLink probe ensure jumpers JP17 and JP19 are open, connect the board using J38.
+
+The USB connection is used as a serial console for the SoC, as a CMSIS-DAP debugger and as a power input for the board.
+
+MicroEJ VEE Port uses the virtual UART from the i.MX RT595 EVK USB port. A COM port is automatically mounted when the board is plugged into a computer using a USB cable. All board logs are available through this COM port.
+
+The COM port uses the following parameters:
+
+| Baudrate | Data bits bits | Parity bits | Stop bits | Flow control |
+| -------- | -------- | -------- | -------- | -------- |
+| 115200 | 8 | None | 1 | None |
+
+
### Get an evaluation license
A license is required to build an embedded application.
@@ -353,12 +399,13 @@ The build will produce two artifacts:
These artifacts are copied to the BSP project in the directory `projects/microej/platform/lib`.
### Build the firmware for target hardware using VS Code
-Once the application is ready, the firmware can be built using a C toolchain for Cortex-M.
+
+
#### Load the project into VS Code
Launch VS Code IDE and click on `File -> Add Folder to Workspace...`
-![Add Folder to Workspace](Documentation/pictures/RT595/vscode_load_project.png)
+![Add Folder to Workspace](Documentation/pictures/common/vscode_load_project.jpg)
Navigate to the nxp-vee-rt595 path then click `Add`.
@@ -366,34 +413,34 @@ From here you can compile and debug the project as any other C project.
To do so you need to configure then build the CMake project by following the steps below:
-#### Scan for kits to locate all available toolchains
-Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Scan for kits`.
-
-![VScode scan for kits](Documentation/pictures/RT595/vscode_scan_for_kits.png)
-
-#### Select the toolchain that will build the project
-Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Select a kit`
+#### Select a Preset
+Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Select Configure Preset` to select the build mode you wish to use.
-![VScode select a kit](Documentation/pictures/RT595/vscode_select_a_kit-1.png)
+By default, you can select `debug` variant.
-Choose the compiler `armgcc` in the path of your project.
-![VScode select gcc compiler](Documentation/pictures/RT595/vscode_select_a_kit-2.png)
+![VScode select build variant](Documentation/pictures/common/vscode_select_preset.jpg)
-#### Select a build variant
-Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Select variant` to select the build mode you wish to use.
+This can also be done by using Projects section from MCUXpresso for VS code" view, and choose appropriate build as default.
-![VScode select build variant](Documentation/pictures/RT595/vscode_select_variant.png)
+![VScode Projects view](Documentation/pictures/common/vscode_projects_view.jpg)
#### Configure the project
Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Configure`.
-![VScode select configure](Documentation/pictures/RT595/vscode_select_configure.png)
+![VScode select configure](Documentation/pictures/common/vscode_select_configure.jpg)
+
+#### Configure the bsp features
+
+Compilation flags are located on `./bsp/projects/nxpvee-ui/armgcc/CMakePresets.json`.
+To enable any desired features, please edit `CMakePresets.json` file (and reload preset & re-configure if needed).
+
+
#### Build the project
Open the Command Palette (`CTRL + SHIFT + p`) and run `CMake: Build`.
-![VScode build project](Documentation/pictures/RT595/vscode_select_build.png)
+![VScode build project](Documentation/pictures/common/vscode_select_build.jpg)
You can connect VS Code to the board using the Serial Link USB or using a SEGGER J-Link probe.
Follow the [Board Hardware User Guide](#board-setup) for more information on how to connect the different debuggers.
@@ -402,21 +449,24 @@ Debug session can be started by pressing the `F5` key.
It is also possible to build and debug the project via the MCUXpresso plugin:
-Right click on the project nxp-vee-rt595, then:
+Right click on the project, then:
+
* `Build Selected` to compile
* `Debug` to debug
-![VScode MCUXpresso build and debug project](Documentation/pictures/RT595/vscode_mcuxpr_build_debug.png)
+![VScode MCUXpresso build and debug project](Documentation/pictures/common/vscode_mcuxpr_build_debug.jpg)
Once the firmware is flashed, you should see the application running on the target.
-#### Note:
+Note:
+It is possible to flash (without debug) via the MCUXpresso plugin by selecting `Flash the Selected Target`.
In case of connection issue to the target, reset the debug probe selection via the MCUXpresso plugin:
+
* Select the MCUXpresso plugin in the left banner
* Right-click on the project name and select `Reset Probe Selection`
* Start the debug again
-![VScode MCUXpresso reset probe selection](Documentation/pictures/RT595/vscode_reset_probe_selection.png)
+![VScode MCUXpresso reset probe selection](Documentation/pictures/common/vscode_reset_probe_selection.jpg)
## Run Demo Wearable VG application
@@ -464,6 +514,8 @@ Then follow [Build the firmware for the target hardware](#build-the-firmware-for
## Switching to a production license
To switch to a production license, please contact your NXP representative.
+
+
## Alternative: build and run from command line
This has only been tested on Linux.
@@ -483,9 +535,12 @@ If not, you must add it:
Linux:
```
-export ARMGCC_DIR=/opt/gcc-arm-none-eabi-10.3-2021.10/
+export ARMGCC_DIR=/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/
```
+Note:
+Need at least ARM GNU toolchain version >= 13.2.1
+
#### CMake
The build system used to generate the firmware is based on CMake.
@@ -494,6 +549,9 @@ Linux: to install CMake on a Debian based distro, run:
sudo apt install cmake
```
+Note:
+Need at least cmake version >= 3.27
+
#### Make
Linux: to install GNU Make on a Debian based distro, run:
```
@@ -510,7 +568,7 @@ The Build Kit is bundled with the SDK and can be exported using the following st
Click on the Finish button.
```
### Using default evaluation license
-Please follow [Install the License Key](https://docs.microej.com/en/latest/SDKUserGuide/licenses.html#install-the-license-key) to be able to use make with an evaluation key
+Please follow [Install the License Key](https://docs.microej.com/en/latest/SDKUserGuide/licenses.html#install-the-license-key) to be able to use make with an evaluation key
### Needed Environment variables
In order to compile correctly you will need to export
@@ -527,11 +585,12 @@ export MODULE_REPOSITORY_SETTINGS_FILE_VAR=${HOME}/microej/microej-partial-repos
if you are using LinkServer to flash your board, append your path with the following command:
```
-export PATH=$PATH:/usr/local/LinkServer_1.3.15/binaries/
+export PATH=$PATH:/usr/local/LinkServer_1.6.133/binaries/:/usr/local/LinkServer_1.6.133/
```
-#### Note:
+Note:
Use full path names in above environment variables, do not use special character `~` to represent your home directory.
+LinkServer version 1.6.133 is depicted on the command line because this version is working fine, it may work with other versions as well but this is not tested.
### Explore available options (works on Linux)
```
@@ -539,39 +598,48 @@ make
# will get you
clean # clean all projects
-nxpvee-ui-clean # clean UI project
-nxpvee-ui-gdb # debug UI project using gdb and jlink
-nxpvee-ui-java_run # run simulation, you can override java main using MAIN=com.nxp.animatedMascot.AnimatedMascot make nxpvee-ui-java_run
-nxpvee-ui-flash # flash board using jlink
-nxpvee-ui-gdb_cmsisdap # debug UI project using gdb and CMSIS
nxpvee-ui.prj # build complete UI project
+nxpvee-ui-clean # clean UI project
+nxpvee-ui-flash # flash board using Jlink
nxpvee-ui-flash_cmsisdap # flash board using CMSIS
+nxpvee-ui-gdb # debug UI project using gdb and Jlink
+nxpvee-ui-gdb_cmsisdap # debug UI project using gdb and CMSIS
+nxpvee-ui-java_run # run simulation, you can override java main using MAIN=com.nxp.animatedMascot.AnimatedMascot make nxpvee-ui-java_run
nxpvee-ui-java_rebuild # rebuild java app
nxpvee-validation.prj # compile and run validation
```
-### compile and flash
+### Compile and flash
```
-nxpvee-ui.prj
+make nxpvee-ui.prj
# flash with a J-Link probe
-nxpvee-ui-flash
+make nxpvee-ui-flash
# or flash with USB using CMSIS-DAP
-nxpvee-ui-flash_cmsisdap
+make nxpvee-ui-flash_cmsisdap
```
-### debug
+### Compilation defaults
+Demo app is compiled with
+- NET
+- SSL
+by default
+
+
+### Compile with just NET support enabled
```
-nxpvee-ui-gdb
-# or
-nxpvee-ui-gdb_cmsisdap
+make nxpvee-ui.prj CMAKE_OPTS="-DENABLE_NET=1"
```
-### Ninja
-to speed up compilation you can use ninja instead of make
+
+
+
+### Debug
```
-MAKE=ninja make nxpvee-ui.prj
+make nxpvee-ui-gdb
+# or
+make nxpvee-ui-gdb_cmsisdap
```
### Compile Release image
@@ -589,6 +657,7 @@ make nxpvee-ui.prj USAGE=prod
+
## Tutorial: Using native C functions from the high level application
Some functions directly used by the high-level application can be implemented in C. It is called the [Native Interface Mechanism](https://docs.microej.com/en/latest/VEEPortingGuide/native.html).
@@ -636,12 +705,12 @@ int Java_com_nxp_application_MyClassNatives_NativeFunction(int a)
When you implement a native method, it is recommended to use the type of `sni.h` rather than the native type. This ensures type consistency between Java and C.
You could use `jint` instead of `int` in the example above.
-The `sni.h` file is located on `nxpvee-mimxrt595-evk-round-bsp/project/microej/platform/inc` folder.
+The `sni.h` file is located on `nxp-vee-rt595/bsp/projects/microej/platform/inc` folder.
### Implementing a mockup of the native functions for the simulator
Mockup functions are used to simulate the behavior of native functions when using the MicroEJ SDK Simulator. Mockups are detailed in the [MicroEJ website](https://docs.microej.com/en/latest/PlatformDeveloperGuide/mock.html).
-They are implementated in a different MicroEJ SDK project (`nxpvee-mimxrt595-evk-round-mock`).
+They are implementated in a different MicroEJ SDK project (`microej/mock`).
The name of the file containing the mockup functions is supposed to be the same as the one where the native functions are declared in the application project (e.g. `SimpleGFXNatives.java`).
@@ -660,17 +729,17 @@ public class MyClassNatives {
};
````
-Please note that this project mockup must be added as a dependency inside the VEE Port's `module.ivy` file. The `module.ivy` file is located in the `nxpvee-mimxrt595-evk-round-configuration` folder. You will find inside all the dependencies used by the VEE Port.
+Please note that this project mockup must be added as a dependency inside the VEE Port's `module.ivy` file. The `module.ivy` file is located in the `microej/vee-port-configuration` folder. You will find inside all the dependencies used by the VEE Port.
![Mockup Declaration in platform](Documentation/pictures/RT595/sdk_mockup_declaration_in_platform.png)
The `org` and `name` fields can be found inside the mockup's `module.ivy` file (respectively `organisation` and `module`):
-![Mockup org and name declaration](Documentation/pictures/RT595/sdk_mockup_org_name_declaration.png)
+![Mockup org and name declaration](Documentation/pictures/common/sdk_mockup_org_name_declaration.png)
After any modification to the mockup project, you need to rebuild the mock (right click on the mock project and select `Build Module`) and the platform (see [Build the platform](#build-the-vee-port)).
-## Get familiar with MICROEJ
+## Get familiar with MicroEJ
To discover insights about MicroEJ technology, please follow some of the entry points below. In addition, you will find useful links to our documentation and our GitHub.
@@ -686,16 +755,44 @@ You can try to run other examples on our VEE Port. Here is an exhaustive list of
* Some [Demo projects](https://github.com/orgs/MicroEJ/repositories?q=demo&type=all&language=&sort=).
-### MICROEJ Documentation
+### MicroEJ Documentation
-You can take a look at the MICROEJ development documentation.
+You can take a look at the MicroEJ development documentation.
Below you can find some important chapters:
* [Application Developer Guide](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/index.html): It covers concepts essential to MicroEJ Applications design.
-* [MICROEJ VEE Port Developer Guide](https://docs.microej.com/en/latest/VEEPortingGuide/index.html): It covers the main process and configuration of a MicroEJ VEE.
+* [MicroEJ VEE Port Developer Guide](https://docs.microej.com/en/latest/VEEPortingGuide/index.html): It covers the main process and configuration of a MicroEJ VEE.
* [Tutorials](https://docs.microej.com/en/latest/Tutorials/index.html#): There are multiple tutorials to master different subjects about the MicroEJ environment (including UI development, code quality and debug, CI/CD…).
## Troubleshooting
+### Setup error
+
+#### West update and "Filename too long" issue
+
+On Windows, fetching the source code may trigger the following fatal error:
+```error: unable to create file [...]: Filename too long.```
+
+To avoid this, git configuration needs to be updated to handle long file names:
+
+Start Git Bash as Administrator.
+
+Run following command:
+```git config --system core.longpaths true```
+
+
+#### West update and "PermissionError: [WinError 5] Access is denied" issue
+
+If you get the error `PermissionError: [WinError 5] Access is denied`, please consider the following procedure :
+
+```
+rm .west
+cd nxp-vee-rt595
+west init -l
+cd ..
+west update
+```
+
+
### License Error when building application
#### [M65] - License check failed
@@ -718,3 +815,4 @@ By:
```
+
diff --git a/SCR-nxpvee-mimxrt595-evk.txt b/SCR-nxpvee-mimxrt595-evk.txt
index 326c165..b4557fb 100644
--- a/SCR-nxpvee-mimxrt595-evk.txt
+++ b/SCR-nxpvee-mimxrt595-evk.txt
@@ -1,7 +1,9 @@
Release Name: NXPVEE-MIMXRT595-EVK
-Release Version: 1.2.0
-Date: December 2023
-Package License: EULA_EVAL.txt v21 December 2022
+Release Version: 2.0.0
+Date: October 2024
+Package License: LICENSE.txt
+Outgoing License: LA_OPT_NXP_Software_License v57 July 2024, Section 2.3 applies
+
SDK_Peripheral_Driver Name: SDK Peripheral Driver
Version: 2.x.x
@@ -11,7 +13,7 @@ SDK_Peripheral_Driver Name: SDK Peripheral Driver
Description: Peripheral drivers are designed for
the most common use cases identified for the
underlying hardware block.
- Location: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/devices//drivers
+ Location: bsp/mcux-sdk/core/devices//drivers
Origin: NXP (BSD-3-Clause)
SDK_Examples Name: SDK examples
@@ -23,7 +25,7 @@ SDK_Examples Name: SDK examples
Description: SDK out of box examples to show how
to use peripheral drivers and integrate
middleware.
- Location: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/boards/
+ Location: bsp/mcux-sdk/core/boards/
Origin: NXP (BSD-3-Clause)
SDK_Device Name: SDK SoC files
@@ -33,55 +35,55 @@ SDK_Device Name: SDK SoC files
Format: source code, linker files
Description: Device system files, template files,
IDE related startup and linker files.
- Location: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/devices/
+ Location: bsp/mcux-sdk/core/devices/
Origin: NXP (BSD-3-Clause)
cmsis Name: CMSIS
Version: 5.8.0
Outgoing License: Apache License 2.0
- License File: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/CMSIS/LICENSE.txt
+ License File: bsp/mcux-sdk/core/CMSIS/LICENSE.txt
Format: source code
Description: Vendor-independent hardware
abstraction layer for microcontrollers that are
based on Arm Cortex processors, distributed by
ARM. cores
- Location: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/CMSIS
+ Location: bsp/mcux-sdk/core/CMSIS
Origin: ARM (Apache-2.0) -
https://github.com/ARM-software/CMSIS_5/releases/t
ag/5.8.0
-freertos_kernel Name: FreeRTOS
- Version: 10.2.1
+freertos-kernel Name: FreeRTOS kernel
+ Version: 10.5.1
Outgoing License: MIT
- License File: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/rtos/freertos/freertos-kernel/LICENSE.md
+ License File: bsp/mcux-sdk/rtos/freertos/freertos-kernel/LICENSE.md
Format: source code
Description: Open source RTOS kernel for small
devices
- Location: nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel
+ Location: bsp/sdk_overlay/rtos/freertos/freertos-kernel
Origin: Amazon (MIT)
- Url: https://aws.amazon.com/freertos/
+ Url: https://github.com/FreeRTOS/FreeRTOS-Kernel
cmsis_drivers Name: SDK CMSIS Peripheral Drivers
Version: 2.x.x
Outgoing License: Apache License 2.0
- License File: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/CMSIS/LICENSE.txt
+ License File: bsp/mcux-sdk/core/CMSIS/LICENSE.txt
Format: source code
Description: CMSIS Peripheral drivers are designed
to provide hardware independent APIs which make
application reusable across a wide range of
supported microcontroller devices.
- Location: nxpvee-mimxrt595-evk-round-bsp/mcux-sdk/core/cmsis_drivers
+ Location: bsp/mcux-sdk/core/cmsis_drivers
Origin: NXP (Apache License 2.0)
vglite Name: vglite
- Version: 3.0.15_rev4
+ Version: 3.0.15_rev7
Outgoing License: MIT
License File:
- nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/LICENSE.txt
+ bsp/sdk_overlay/middleware/vglite/LICENSE.txt
Format: source code
Description: VeriSilicon's platform independent
VGLite Graphics library
- Location: nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite
+ Location: bsp/sdk_overlay/middleware/vglite
Origin: VeriSilicon (http://www.verisilicon.com/)
Url: http://www.verisilicon.com/
@@ -89,11 +91,11 @@ mcufont Name: mcufont
Version: 1.0
Outgoing License: MIT
License File:
- nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/LICENSE
+ bsp/sdk_overlay/middleware/vglite/font/mcufont/LICENSE
Format: source code
Description: Font rendering library for
microcontrollers
- Location: nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont
+ Location: bsp/sdk_overlay/middleware/vglite/font/mcufont
Origin: Petteri Aimonen
(https://github.com/PetteriAimonen)
Url: https://github.com/mcufont/mcufont
@@ -102,10 +104,10 @@ FreeType Name: FreeType
Version: 2.11
Outgoing License: FTL
License File:
- nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/FTL.TXT
+ bsp/projects/microej/thirdparty/freetype/FTL.TXT
Format: source code
Description: Software library to render fonts
- Location: nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype
+ Location: bsp/projects/microej/thirdparty/freetype
Origin: The FreeType Project (http://freetype.org/license.html)
Url: https://gitlab.freedesktop.org/freetype/freetype.git
@@ -113,10 +115,10 @@ HarfBuzz Name: HarfBuzz
Version: 4.2.1
Outgoing License: Old MIT
License File:
- nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/COPYING
+ bsp/projects/microej/thirdparty/harfbuzz/COPYING
Format: source code
Description: Text shaping library
- Location: nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz
+ Location: bsp/projects/microej/thirdparty/harfbuzz
Origin: HarfBuzz Project (https://harfbuzz.github.io/)
Url: https://github.com/harfbuzz/harfbuzz
@@ -124,48 +126,48 @@ SystemView Target Sources Name: SystemView Target Sources
Version: 2.52a
Outgoing License: SEGGER BSD
License File:
- nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/LICENSE
+ bsp/projects/microej/thirdparty/systemview/LICENSE
Format: source code
Description: Target code for real-time recording and visualization tool
- Location: nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview
- nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos
+ Location: bsp/projects/microej/thirdparty/systemview
+ bsp/projects/microej/thirdparty/systemview-freertos
Origin: SEGGER (https://www.segger.com)
Url: https://www.segger.com/downloads/systemview/SystemView_Src_V252a.zip
SimpleGFX Name: SimpleGFX
Version: 0.1
Outgoing License: BSD-3-Clause
- License File: nxpvee-mimxrt595-evk-round-apps/LICENSE.txt
+ License File: microej/apps/LICENSE.txt
Format: source code
Description: example of a graphics VEE application
- Location: nxpvee-mimxrt595-evk-round-apps/src/main/java/com/nxp/simpleGFX
+ Location: microej/apps/src/main/java/com/nxp/simpleGFX
Origin: NXP (BSD-3-Clause)
SimpleGFX MOCK Name: SimpleGFX Mock
Version: 0.1
Outgoing License: BSD-3-Clause
- License File: nxpvee-mimxrt595-evk-round-mock/LICENSE.txt
+ License File: microej/mock/LICENSE.txt
Format: source code
Description: Mock the SimpleGFX natives.
- Location: nxpvee-mimxrt595-evk-round-mock/src/main/java/com/nxp/
+ Location: microej/mock/src/main/java/com/nxp/
Origin: NXP (BSD-3-Clause)
AnimatedMascot Name: AnimatedMascot
Version: 0.1
Outgoing License: BSD-3-Clause
- License File: nxpvee-mimxrt595-evk-round-apps/LICENSE.txt
+ License File: microej/apps/LICENSE.txt
Format: source code
Description: VEE application demonstrating vectorial animation
- Location: nxpvee-mimxrt595-evk-round-apps/src/main/java/com/nxp/animatedMascot
+ Location: microej/apps/src/main/java/com/nxp/animatedMascot
Origin: NXP (BSD-3-Clause)
DEMO-WEARABLE-VG MOCK Name: Demo-Wearable-VG Mock
Version: 1.0.0
Outgoing License: BSD-3-Clause
- License File: nxpvee-mimxrt595-evk-round-mock/LICENSE.txt
+ License File: microej/mock/LICENSE.txt
Format: source code
Description: Mock the Demo-Wearable-VG natives.
- Location: nxpvee-mimxrt595-evk-round-mock/src/main/java/com/microej/
+ Location: microej/mock/src/main/java/com/microej/
Origin: MicroEJ
MicroEJ BSP Name: MicroEJ BSP
@@ -174,7 +176,7 @@ MicroEJ BSP Name: MicroEJ BSP
License File: Licenses/COPYING-BSD-3
Format: source code
Description: Board support package for i.MX RT595
- Location: nxpvee-mimxrt595-evk-round-bsp/projects/microej (excluding subdirectory
+ Location: bsp/projects/microej (excluding subdirectory
thirdparty)
Origin: MicroEJ (https://www.microej.com/)
@@ -184,7 +186,7 @@ MicroEJ EDC Name: Embedded Device Configuration (EDC)
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Implementation of the minimal standard runtime environment for
embedded devices
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/runtime.html?highlight=edc#embedded-device-configuration-edc
@@ -193,7 +195,7 @@ MicroEJ BON Name: Beyond Profile (BON)
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Control memory usage and start-up sequences
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/runtime.html?highlight=edc#beyond-profile-bon
@@ -202,7 +204,7 @@ External Resource Loader Name: External Resource Loader
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Allows use of external resources
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/imxrt595evk.platform
+ Location: dependency of microej/vee-port-configuration/imxrt595evk.platform
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/VEEPortingGuide/externalResourceLoader.html
@@ -211,44 +213,62 @@ JAVAFX Name: JavaFX
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Library to create Java user interfaces. Used by Demo-Wearable-VG mock.
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/VEEPortingGuide/mock.html#javafx
Url: https://openjfx.io/
KF Name: Kernel Features (KF)
- Version: 1.6
+ Version: 1.7
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Java implementation of the Multi-Sandbox features
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/VEEPortingGuide/appendix/javalibs/kf.html
MicroUI Name: MicroUI
- Version: 3.1.0
+ Version: 3.5
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
- Description: Enable the creation of user interface in Java
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Description: MicroUI API module.
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroUI/index.html?highlight=microui
+MicroUI Pack Name: MicroUI Pack
+ Version: 14.0.1
+ Outgoing License: MicroEJ SDK EULA
+ License File: Licenses/MICROEJ_SDK_EULA.txt
+ Description: Enable the creation of user interface in Java
+ Location: dependency of microej/vee-port-configuration/module.ivy
+ Origin: MicroEJ
+ Url: https://docs.microej.com/en/latest/VEEPortingGuide/ui.html
+
MicroVG Name: MicroVG
- Version: 1.1.1
+ Version: 1.4.0
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
- Description: Vector drawing library
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Description: MicroVG API module.
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MicroVG/index.html?highlight=microvg
+MicroVG Pack Name: MicroVG Pack
+ Version: 1.5.1
+ Outgoing License: MicroEJ SDK EULA
+ License File: Licenses/MICROEJ_SDK_EULA.txt
+ Description: Vector drawing library
+ Location: dependency of microej/vee-port-configuration/module.ivy
+ Origin: MicroEJ
+ Url: https://docs.microej.com/en/latest/VEEPortingGuide/vg.html
+
MWT Name: Micro Widget Toolkit
Version: 3.2.1
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Simplify the creation and use of graphical user interface widgets in Java
- Location: dependency of nxpvee-mimxrt595-evk-round-apps/module.ivy
+ Location: dependency of microej/imageGenerator/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/MWT/index.html
@@ -257,7 +277,7 @@ NLS Name: Native Language Support (NLS)
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Support translation in different languages
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/nls.html
@@ -266,7 +286,7 @@ PUMP Name: Pump
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Used by MicroUI to manage events
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
RESOURCE MANAGER Name: Resource Manager
@@ -274,7 +294,7 @@ RESOURCE MANAGER Name: Resource Manager
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Manage resources
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
SNI Name: Simple Native Interface (SNI)
@@ -282,7 +302,7 @@ SNI Name: Simple Native Interface (SNI)
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Allow to call native method from managed code
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/VEEPortingGuide/sni.html
@@ -291,7 +311,7 @@ TRACE Name: Trace
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Record integer based events for debugging and monitoring purposes
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/trace.html#event-tracing
@@ -300,7 +320,7 @@ WATCHDOG Name: Watchdog
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Watchdog used by MicroUI
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
WIDGET Name: Widget Toolkit
@@ -308,7 +328,7 @@ WIDGET Name: Widget Toolkit
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Provides very common widgets with basic implementations
- Location: dependency of nxpvee-mimxrt595-evk-round-fp/module.ivy
+ Location: dependency of microej/front-panel/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/ApplicationDeveloperGuide/UI/Widgets/widget.html
@@ -317,7 +337,7 @@ DRAWING Name: Drawing
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Contains shapes rendering and image with transformation rendering algorithms
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-apps/module.ivy
+ Location: transitive dependency of microej/imageGenerator/module.ivy
Origin: MicroEJ
Url: https://repository.microej.com/javadoc/microej_5.x/apis/ej/drawing/package-summary.html
@@ -326,7 +346,7 @@ BASICTOOL Name: Basic Tool
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Miscellaneous tools
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-apps/module.ivy
+ Location: transitive dependency of microej/imageGenerator/module.ivy
Origin: MicroEJ
Url: https://repository.microej.com/javadoc/microej_5.x/apis/ej/basictool/package-summary.html
@@ -335,7 +355,7 @@ COLLECTIONS Name: Collections
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Static methods that operate on or return collections
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-apps/module.ivy
+ Location: transitive dependency of microej/imageGenerator/module.ivy
Origin: MicroEJ
Url: https://repository.microej.com/javadoc/microej_5.x/apis/index.html?java/util/Collections.html
@@ -344,7 +364,7 @@ JUNIT Name: Junit
Outgoing License: Eclipse Public License - v 1.0
License File: https://spdx.org/licenses/EPL-1.0.html
Description: Unit test framework
- Location: dependency of nxpvee-mimxrt595-evk-round-apps/module.ivy
+ Location: dependency of microej/imageGenerator/module.ivy
Origin: JUNIT
Url: https://junit.org/
@@ -353,7 +373,7 @@ FRONTPANEL Name: Frontpanel
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Frontpanel creation library
- Location: dependency of nxpvee-mimxrt595-evk-round-fp/module.ivy
+ Location: dependency of microej/front-panel/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/PlatformDeveloperGuide/frontpanel.html
@@ -362,7 +382,7 @@ MICROVG FRONTPANEL Name: MicroVG Frontpanel
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Provides native implementation of equivalent VectorGraphics classes to Front Panel projects
- Location: transitive dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: transitive dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
FRAMEWORK Name: Frontpanel Framework Library
@@ -370,7 +390,7 @@ FRAMEWORK Name: Frontpanel Framework Library
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Frontpanel framework creation library
- Location: dependency of nxpvee-mimxrt595-evk-round-fp/module.ivy
+ Location: dependency of microej/front-panel/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/PlatformDeveloperGuide/frontpanel.html
@@ -378,7 +398,7 @@ HILEngine Name: Hardware In the Loop interface
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Simulates Java-to-C calls.
- Location: dependency of nxpvee-mimxrt595-evk-round-mock/module.ivy
+ Location: dependency of microej/mock/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/PlatformDeveloperGuide/simulation.html
@@ -387,15 +407,15 @@ IMAGEGENERATOR Name: Image Generator
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: Off-board tool in charge of generating image data
- Location: dependency of nxpvee-mimxrt595-evk-round-imageGenerator/module.ivy
+ Location: dependency of microej/imageGenerator/module.ivy
Origin: MicroEJ
Url: https://docs.microej.com/en/latest/PlatformDeveloperGuide/uiImageGenerator.html
ARCHITECTURE Name: Microej Architecture Image Generator
- Version: flopi4G25-7.20.1
+ Version: flopi4G25-8.1.1
Outgoing License: MicroEJ SDK EULA
License File: Licenses/MICROEJ_SDK_EULA.txt
Description: MicroEJ Architecture for GNU Tools for ARM Embedded Processors 4.8.
- Location: dependency of nxpvee-mimxrt595-evk-round-configuration/module.ivy
+ Location: dependency of microej/vee-port-configuration/module.ivy
Origin: MicroEJ
- Url: https://repository.microej.com/architectures/com/microej/architecture/CM4/CM4hardfp_GCC48/flopi4G25/7.20.1/
+ Url: https://repository.microej.com/architectures/com/microej/architecture/CM4/CM4hardfp_GCC48/flopi4G25/8.1.1/
diff --git a/nxpvee-mimxrt595-evk-round-bsp/.project b/bsp/.project
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/.project
rename to bsp/.project
diff --git a/bsp/nvee_version.txt b/bsp/nvee_version.txt
new file mode 100644
index 0000000..227cea2
--- /dev/null
+++ b/bsp/nvee_version.txt
@@ -0,0 +1 @@
+2.0.0
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.bat b/bsp/projects/common/scripts/s2s.bat
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.bat
rename to bsp/projects/common/scripts/s2s.bat
index cb5142c..e9e1d99 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.bat
+++ b/bsp/projects/common/scripts/s2s.bat
@@ -4,7 +4,7 @@ set S2S_PORT=%2
netstat -an | findstr /RC:":%S2S_PORT% .*LISTENING"
if /I %errorlevel% NEQ 0 (
- cd MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0/source
+ cd microej/MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0/source
start "s2s.bat" cmd /k java ^
-Djava.library.path="resources/os/Windows64" ^
-cp "tools/*" ^
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.sh b/bsp/projects/common/scripts/s2s.sh
similarity index 85%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.sh
rename to bsp/projects/common/scripts/s2s.sh
index b45cdf0..b77e703 100755
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/common/scripts/s2s.sh
+++ b/bsp/projects/common/scripts/s2s.sh
@@ -8,7 +8,7 @@ S2S_PORT=${2}
if [ "$(ss -a | grep "\<${S2S_PORT}\>")" == "" ]
then
- cd MIMXRT595-evk_platform-CM4hardfp_GCC48-1.2.0/source
+ cd microej/MIMXRT595-evk_platform-CM4hardfp_GCC48-2.0.0/source
java \
-Djava.library.path="resources/os/Linux64" \
-cp "tools/*" \
diff --git a/bsp/projects/common/sdk_makefile/Makefile b/bsp/projects/common/sdk_makefile/Makefile
new file mode 100644
index 0000000..da648e7
--- /dev/null
+++ b/bsp/projects/common/sdk_makefile/Makefile
@@ -0,0 +1,90 @@
+#
+# Copyright 2023-2024 NXP
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+COMMON_PATH=../../common/sdk_makefile
+
+define del_file
+ $(if $(filter $(OS),Windows_NT),$(if $(wildcard $(1)),cmd /c DEL /f /q $(subst /,\\,$(1)),),rm -f $(1))
+endef
+
+define del_dir
+ $(if $(filter $(OS),Windows_NT),$(if $(wildcard $(1)),cmd /c RD /s /q $(subst /,\\,$(1)),),rm -fr $(1))
+endef
+
+ifeq ($(OS),Windows_NT)
+JLINKEXE="$(JLINK_INSTALLATION_DIR)/Jlink.exe"
+JLINK_GDB="$(COMMON_PATH)/debug/jlink_gdb.bat"
+else
+JLINKEXE=JLinkExe
+JLINK_GDB="$(COMMON_PATH)"/debug/jlink_gdb.sh
+endif
+
+JLINK_SCRIPT="jlink_flash.script"
+
+MAKE = ninja
+OBJCOPY="$(ARMGCC_DIR)/bin/arm-none-eabi-objcopy"
+
+
+ifeq ($(OS),Windows_NT)
+GDB="$(ARMGCC_DIR)/bin/arm-none-eabi-gdb.exe"
+NUM_PROC=
+CLEAN_SCRIPT="./clean.bat"
+else
+GDB=gdb-multiarch
+NUM_PROC=$(shell nproc)
+CLEAN_SCRIPT="./clean.sh"
+endif
+
+ifeq ($(MAKE),make)
+MAKE_OP=-j$(NUM_PROC)
+endif
+
+BUILD_DIR=../armgcc/$(FLAVOUR)
+
+all: $(BUILD_DIR) remake
+
+ifeq ($(OS),Windows_NT)
+BUILD_SCRIPT="./build_$(FLAVOUR).bat"
+CMSIS_GDB_TEMP_FOLDER="$(TEMP)"/gdb.cmd
+else
+BUILD_SCRIPT=./build_$(FLAVOUR).sh
+CMSIS_GDB_TEMP_FOLDER=/tmp/gdb.cmd
+endif
+
+$(BUILD_DIR):
+ cd ../armgcc/ && $(BUILD_SCRIPT) $(MAKE) $(MAKE_OP)
+
+remake:
+ $(MAKE) $(MAKE_OP) -C $(BUILD_DIR)
+
+clean:
+ $(call_del_dir, $(BUILD_DIR))
+
+distclean:
+ cd ../armgcc/ && $(CLEAN_SCRIPT)
+
+flash: $(BUILD_DIR) remake
+ $(call del_file,$(JLINK_SCRIPT))
+ echo r > $(JLINK_SCRIPT)
+ echo loadbin "$(BUILD_DIR)/$(TARGET).bin" $(ADDRESS) >> $(JLINK_SCRIPT)
+ echo r >> $(JLINK_SCRIPT)
+ echo g >> $(JLINK_SCRIPT)
+ echo qc >> $(JLINK_SCRIPT)
+ $(JLINKEXE) -NoGui 1 -device $(DEVICE) -If SWD -Speed 10000 -CommanderScript $(JLINK_SCRIPT)
+ $(call del_file,$(JLINK_SCRIPT))
+
+flash_cmsisdap: $(BUILD_DIR) remake
+ LinkServer flash $(LS_DEVICE) load $(BUILD_DIR)/$(TARGET).elf
+
+gdb_cmsisdap: $(BUILD_DIR) remake
+ sed "s+FILE_VALUE+$(BUILD_DIR)/$(TARGET).elf+" $(COMMON_PATH)/cmsisdap_support/gdb.commands > $(CMSIS_GDB_TEMP_FOLDER)
+ $(GDB) --command=$(CMSIS_GDB_TEMP_FOLDER)
+
+gdb: $(BUILD_DIR) remake
+ $(JLINK_GDB) $(DEVICE)
+ $(GDB) --command=$(COMMON_PATH)/debug/jlink.gdb $(BUILD_DIR)/$(TARGET).elf
+
+.PHONY : all remake clean dist_clean gdb
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S.xml b/bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S.xml
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S.xml
rename to bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S.xml
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S_part.xml b/bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S_part.xml
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S_part.xml
rename to bsp/projects/common/sdk_makefile/cmsisdap_support/MIMXRT595S_part.xml
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/gdb.commands b/bsp/projects/common/sdk_makefile/cmsisdap_support/gdb.commands
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/cmsisdap_support/gdb.commands
rename to bsp/projects/common/sdk_makefile/cmsisdap_support/gdb.commands
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink.gdb b/bsp/projects/common/sdk_makefile/debug/jlink.gdb
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink.gdb
rename to bsp/projects/common/sdk_makefile/debug/jlink.gdb
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink_gdb.bat b/bsp/projects/common/sdk_makefile/debug/jlink_gdb.bat
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink_gdb.bat
rename to bsp/projects/common/sdk_makefile/debug/jlink_gdb.bat
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink_gdb.sh b/bsp/projects/common/sdk_makefile/debug/jlink_gdb.sh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/common/sdk_makefile/debug/jlink_gdb.sh
rename to bsp/projects/common/sdk_makefile/debug/jlink_gdb.sh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/SYSVIEW_RT595.txt b/bsp/projects/microej/SYSVIEW_RT595.txt
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/SYSVIEW_RT595.txt
rename to bsp/projects/microej/SYSVIEW_RT595.txt
diff --git a/bsp/projects/microej/cco_freetype.properties b/bsp/projects/microej/cco_freetype.properties
new file mode 100644
index 0000000..d4ac79e
--- /dev/null
+++ b/bsp/projects/microej/cco_freetype.properties
@@ -0,0 +1,4 @@
+#Fri, 09 Sep 2022 12:50:57 +0200
+
+version=2.0.2
+buildLabel=20220909-1249
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/cco_harfbuzz.properties b/bsp/projects/microej/cco_harfbuzz.properties
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/cco_harfbuzz.properties
rename to bsp/projects/microej/cco_harfbuzz.properties
diff --git a/bsp/projects/microej/cco_microui-mimxrt595-evk.properties b/bsp/projects/microej/cco_microui-mimxrt595-evk.properties
new file mode 100644
index 0000000..56c26b8
--- /dev/null
+++ b/bsp/projects/microej/cco_microui-mimxrt595-evk.properties
@@ -0,0 +1,4 @@
+#Mon, 17 Jul 2023 17:22:10 +0200
+
+version=7.0.0
+buildLabel=20230717-1722
diff --git a/bsp/projects/microej/cco_microui-vglite.properties b/bsp/projects/microej/cco_microui-vglite.properties
new file mode 100644
index 0000000..30809c1
--- /dev/null
+++ b/bsp/projects/microej/cco_microui-vglite.properties
@@ -0,0 +1,4 @@
+#Tue, 09 Apr 2024 10:23:57 +0200
+
+version=8.0.1
+buildLabel=20240409-1023
diff --git a/bsp/projects/microej/cco_microui.properties b/bsp/projects/microej/cco_microui.properties
new file mode 100644
index 0000000..0c2b83d
--- /dev/null
+++ b/bsp/projects/microej/cco_microui.properties
@@ -0,0 +1,4 @@
+#Tue, 09 Apr 2024 10:15:03 +0200
+
+version=4.0.1
+buildLabel=20240409-1015
diff --git a/bsp/projects/microej/cco_microvg-vglite.properties b/bsp/projects/microej/cco_microvg-vglite.properties
new file mode 100644
index 0000000..09149be
--- /dev/null
+++ b/bsp/projects/microej/cco_microvg-vglite.properties
@@ -0,0 +1,4 @@
+#Thu, 11 Apr 2024 11:50:50 +0200
+
+version=7.0.1
+buildLabel=20240411-1150
diff --git a/bsp/projects/microej/cco_microvg.properties b/bsp/projects/microej/cco_microvg.properties
new file mode 100644
index 0000000..82deef7
--- /dev/null
+++ b/bsp/projects/microej/cco_microvg.properties
@@ -0,0 +1,4 @@
+#Thu, 15 Feb 2024 08:27:09 +0100
+
+version=5.0.0
+buildLabel=20240215-0826
diff --git a/bsp/projects/microej/gpio/inc/LLGPIO_mux.h b/bsp/projects/microej/gpio/inc/LLGPIO_mux.h
new file mode 100644
index 0000000..cdf4aa8
--- /dev/null
+++ b/bsp/projects/microej/gpio/inc/LLGPIO_mux.h
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2023 NXP
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#ifndef LLGPIO_MUX
+#define LLGPIO_MUX
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define IOPCTL_PIO_FUNC0 0x0000u /*!<@brief Selects pin function 0 */
+#define IOPCTL_PIO_PUPD_DI 0x0000u /*!<@brief Disable pull-up / pull-down function */
+#define IOPCTL_PIO_PUPD_EN 0x0010u /*!<@brief Enable pull-up / pull-down function */
+#define IOPCTL_PIO_PULLDOWN_EN 0x0000u /*!<@brief Enable pull-down function */
+#define IOPCTL_PIO_PULLUP_EN 0x0020u /*!<@brief Enable pull-up function */
+#define IOPCTL_PIO_INBUF_DI 0x0000u /*!<@brief Disable input buffer function */
+#define IOPCTL_PIO_INBUF_EN 0x0040u /*!<@brief Enables input buffer function */
+#define IOPCTL_PIO_SLEW_RATE_NORMAL 0x0000u /*!<@brief Normal mode */
+#define IOPCTL_PIO_SLEW_RATE_SLOW 0x0080u /*!<@brief Slow mode */
+#define IOPCTL_PIO_FULLDRIVE_DI 0x0000u /*!<@brief Normal drive */
+#define IOPCTL_PIO_FULLDRIVE_EN 0x0100u /*!<@brief Full drive enable */
+#define IOPCTL_PIO_ANAMUX_DI 0x0000u /*!<@brief Analog mux is disabled */
+#define IOPCTL_PIO_ANAMUX_EN 0x0200u /*!<@brief Analog mux is enabled */
+#define IOPCTL_PIO_PSEDRAIN_DI 0x0000u /*!<@brief Pseudo Output Drain is disabled */
+#define IOPCTL_PIO_PSEDRAIN_EN 0x0400u /*!<@brief Pseudo Output Drain is enabled */
+#define IOPCTL_PIO_INV_DI 0x0000u /*!<@brief Input function is not inverted */
+#define IOPCTL_PIO_INV_EN 0x0800u /*!<@brief Input function is inverted */
+
+#define MAX_PORT_NUMBER 6
+#define GPIO_BANK_SIZE 32
+#define GPIO00 0
+#define GPIO01 1
+#define GPIO02 2
+#define GPIO03 3
+#define GPIO04 4
+#define GPIO05 5
+#define GPIO06 6
+#define GPIO06_MAX_PIN 27
+
+typedef enum
+{
+ kSuccess = 0,
+ kPortError = -1,
+ kPinError = -2,
+} gpio_init_status;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/bsp/projects/microej/gpio/nxp_gpio.cmake b/bsp/projects/microej/gpio/nxp_gpio.cmake
new file mode 100644
index 0000000..ded8786
--- /dev/null
+++ b/bsp/projects/microej/gpio/nxp_gpio.cmake
@@ -0,0 +1,8 @@
+include_guard()
+message("nxp/gpio component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/src/LLGPIO_impl.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/inc)
diff --git a/bsp/projects/microej/gpio/src/LLGPIO_impl.c b/bsp/projects/microej/gpio/src/LLGPIO_impl.c
new file mode 100644
index 0000000..97dd196
--- /dev/null
+++ b/bsp/projects/microej/gpio/src/LLGPIO_impl.c
@@ -0,0 +1,143 @@
+/**
+ * Copyright 2023 NXP
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ * @brief NXP GPIO low level API
+ * @author Julien Jouan
+ * @version 1.0.0
+ */
+
+#include
+#include "LLGPIO_mux.h"
+#include "sni.h"
+#include "fsl_iopctl.h"
+#include "board.h"
+
+static int8_t check_port_and_pin(uint32_t port, uint32_t pin)
+{
+ int8_t ret = kPinError;
+
+ switch (port)
+ {
+ case GPIO00:
+ case GPIO01:
+ case GPIO02:
+ case GPIO03:
+ case GPIO04:
+ case GPIO05:
+ ret = kSuccess;
+ break;
+ case GPIO06:
+ if (pin <= GPIO06_MAX_PIN) ret = kSuccess;
+ break;
+ default:
+ ret = kPortError;
+ break;
+ }
+ return ret;
+}
+
+int32_t LLGPIO_IMPL_init_gpio_pin(uint32_t pin, uint32_t direction, uint32_t pullConfig)
+{
+ uint32_t port = pin / GPIO_BANK_SIZE;
+ pin %= GPIO_BANK_SIZE;
+ gpio_pin_config_t sw_config = {(gpio_pin_direction_t)direction, 0};
+
+ /* Check that GPIO port and pin used is existing */
+ int8_t portPinStatus = check_port_and_pin(port, pin);
+ if (portPinStatus == kSuccess)
+ {
+ const uint32_t portx_piny_config = (/* Pin is configured as PIO{port}_{pin} */
+ IOPCTL_PIO_FUNC0 |
+ /* Disable pull-up / pull-down function */
+ ((pullConfig > 0) ? IOPCTL_PIO_PUPD_EN : IOPCTL_PIO_PUPD_DI) |
+ /* Enable pull-up/down function */
+ ((pullConfig == 1) ? IOPCTL_PIO_PULLUP_EN : IOPCTL_PIO_PULLDOWN_EN) |
+ /* Enables input buffer function */
+ IOPCTL_PIO_INBUF_EN |
+ /* Normal mode */
+ IOPCTL_PIO_SLEW_RATE_NORMAL |
+ /* Normal drive */
+ IOPCTL_PIO_FULLDRIVE_DI |
+ /* Analog mux is disabled */
+ IOPCTL_PIO_ANAMUX_DI |
+ /* Pseudo Output Drain is disabled */
+ IOPCTL_PIO_PSEDRAIN_DI |
+ /* Input function is not inverted */
+ IOPCTL_PIO_INV_DI);
+ IOPCTL_PinMuxSet(IOPCTL, port, pin, portx_piny_config);
+
+ GPIO_PortInit_noreset(GPIO, port);
+ GPIO_PinInit(GPIO, port, pin, &sw_config);
+ }
+ return portPinStatus;
+}
+
+int32_t LLGPIO_IMPL_read_gpio_pin(uint32_t pin)
+{
+ uint32_t port = pin / GPIO_BANK_SIZE;
+ pin %= GPIO_BANK_SIZE;
+
+ /* Check that GPIO port and pin used is existing */
+ int8_t portPinStatus = check_port_and_pin(port, pin);
+ int8_t ret;
+
+ if (portPinStatus == kSuccess)
+ {
+ ret = GPIO_PinRead(GPIO, port, pin);
+ }
+ else
+ {
+ ret = portPinStatus;
+ }
+
+ return ret;
+}
+
+int32_t LLGPIO_IMPL_write_gpio_pin(uint32_t pin, uint32_t level)
+{
+ uint32_t port = pin / GPIO_BANK_SIZE;
+ pin %= GPIO_BANK_SIZE;
+
+ /* Check that GPIO port and pin used is existing */
+ int8_t portPinStatus = check_port_and_pin(port, pin);
+ int8_t ret;
+
+ if (portPinStatus == kSuccess)
+ {
+ GPIO_PinWrite(GPIO, port, pin, level);
+ ret = GPIO_PinRead(GPIO, port, pin);
+ }
+ else
+ {
+ ret = portPinStatus;
+ }
+
+ return ret;
+}
+
+int32_t LLGPIO_IMPL_toggle_gpio_pin(uint32_t pin)
+{
+ uint32_t port = pin / GPIO_BANK_SIZE;
+ pin %= GPIO_BANK_SIZE;
+
+ /* Check that GPIO port and pin used is existing */
+ int8_t portPinStatus = check_port_and_pin(port, pin);
+ int8_t ret;
+
+ if (portPinStatus == kSuccess)
+ {
+ GPIO_PortToggle(GPIO, port, (uint32_t) (1 << pin));
+ ret = GPIO_PinRead(GPIO, port, pin);
+ }
+ else
+ {
+ ret = portPinStatus;
+ }
+
+ return ret;
+}
diff --git a/bsp/projects/microej/kf/inc/LLKERNEL_impl.h b/bsp/projects/microej/kf/inc/LLKERNEL_impl.h
new file mode 100644
index 0000000..6f2ccd7
--- /dev/null
+++ b/bsp/projects/microej/kf/inc/LLKERNEL_impl.h
@@ -0,0 +1,40 @@
+/*
+ * C
+ *
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#include
+#include
+
+#ifndef LLKERNEL_IMPL
+#define LLKERNEL_IMPL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int32_t LLKERNEL_IMPL_allocateFeature(int32_t size_ROM, int32_t size_RAM);
+
+void LLKERNEL_IMPL_freeFeature(int32_t handle);
+
+int32_t LLKERNEL_IMPL_getAllocatedFeaturesCount(void);
+
+int32_t LLKERNEL_IMPL_getFeatureHandle(int32_t allocation_index);
+
+void* LLKERNEL_IMPL_getFeatureAddressRAM(int32_t handle);
+
+void* LLKERNEL_IMPL_getFeatureAddressROM(int32_t handle);
+
+int32_t LLKERNEL_IMPL_copyToROM(void* dest_address_ROM, void* src_address, int32_t size);
+
+int32_t LLKERNEL_IMPL_flushCopyToROM(void);
+
+int32_t LLKERNEL_IMPL_onFeatureInitializationError(int32_t handle, int32_t error_code);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LLKERNEL_IMPL */
diff --git a/bsp/projects/microej/kf/src/LLKERNEL_impl.c b/bsp/projects/microej/kf/src/LLKERNEL_impl.c
new file mode 100644
index 0000000..e2907a8
--- /dev/null
+++ b/bsp/projects/microej/kf/src/LLKERNEL_impl.c
@@ -0,0 +1,83 @@
+/*
+ * C
+ *
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#include
+#include
+
+#include "LLKERNEL_impl.h"
+
+// Your implementation of malloc()
+#define KERNEL_MALLOC(size) malloc((size_t)(size))
+
+// Your implementation of free()
+#define KERNEL_FREE(addr) free((void*)(addr))
+
+// Your implementation of 'ASSERT(0)'
+#define KERNEL_ASSERT_FAIL() while(1)
+
+// Utility macros for allocating RAM and ROM areas with required alignment constraints
+#define KERNEL_AREA_GET_MAX_SIZE(size, alignment) ((size)+((alignment)-1))
+#define KERNEL_AREA_GET_START_ADDRESS(addr, alignment) ((void*)((((int32_t)(addr))+(alignment)-1)&~((alignment)-1)))
+
+typedef struct installed_feature{
+ void* ROM_area;
+ void* RAM_area;
+} installed_feature_t;
+
+int32_t LLKERNEL_IMPL_allocateFeature(int32_t size_ROM, int32_t size_RAM) {
+ int32_t ret = 0;
+ int total_size = sizeof(installed_feature_t);
+ total_size += KERNEL_AREA_GET_MAX_SIZE(size_ROM, LLKERNEL_ROM_AREA_ALIGNMENT);
+ total_size += KERNEL_AREA_GET_MAX_SIZE(size_RAM, LLKERNEL_RAM_AREA_ALIGNMENT);
+
+ void* total_area = KERNEL_MALLOC(total_size);
+ if(NULL != total_area){
+ installed_feature_t* f = (installed_feature_t*)total_area;
+ f->ROM_area = KERNEL_AREA_GET_START_ADDRESS((void*)(((int32_t)f)+((int32_t)sizeof(installed_feature_t))), LLKERNEL_ROM_AREA_ALIGNMENT);
+ f->RAM_area = KERNEL_AREA_GET_START_ADDRESS((void*)(((int32_t)f->ROM_area)+size_ROM), LLKERNEL_RAM_AREA_ALIGNMENT);
+ ret = (int32_t)f;
+ } // else out of memory
+
+ return ret;
+}
+
+void LLKERNEL_IMPL_freeFeature(int32_t handle) {
+ KERNEL_FREE(handle);
+}
+
+int32_t LLKERNEL_IMPL_getAllocatedFeaturesCount(void) {
+ // No persistency support
+ return 0;
+}
+
+int32_t LLKERNEL_IMPL_getFeatureHandle(int32_t allocation_index) {
+ // No persistency support
+ KERNEL_ASSERT_FAIL();
+}
+
+void* LLKERNEL_IMPL_getFeatureAddressRAM(int32_t handle) {
+ return ((installed_feature_t*)handle)->RAM_area;
+}
+
+void* LLKERNEL_IMPL_getFeatureAddressROM(int32_t handle) {
+ return ((installed_feature_t*)handle)->ROM_area;
+}
+
+int32_t LLKERNEL_IMPL_copyToROM(void* dest_address_ROM, void* src_address, int32_t size) {
+ memcpy(dest_address_ROM, src_address, size);
+ return LLKERNEL_OK;
+}
+
+int32_t LLKERNEL_IMPL_flushCopyToROM(void) {
+ return LLKERNEL_OK;
+}
+
+int32_t LLKERNEL_IMPL_onFeatureInitializationError(int32_t handle, int32_t error_code) {
+ // No persistency support
+ KERNEL_ASSERT_FAIL();
+ return 0;
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/.gh-copyright.template b/bsp/projects/microej/lowpower/.gh-copyright.template
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/.gh-copyright.template
rename to bsp/projects/microej/lowpower/.gh-copyright.template
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/inc/fsl_tickless_rtc.h b/bsp/projects/microej/lowpower/inc/fsl_tickless_rtc.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/inc/fsl_tickless_rtc.h
rename to bsp/projects/microej/lowpower/inc/fsl_tickless_rtc.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/inc/power_manager.h b/bsp/projects/microej/lowpower/inc/power_manager.h
similarity index 94%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/inc/power_manager.h
rename to bsp/projects/microej/lowpower/inc/power_manager.h
index 9730efe..d2db76e 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/inc/power_manager.h
+++ b/bsp/projects/microej/lowpower/inc/power_manager.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2020, 2022 NXP
+ * Copyright 2020, 2022, 2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -14,7 +14,6 @@
void power_manager_init(void);
void GPIO_WakeUp_Enable(void);
void GPIO_WakeUp_Disable(void);
-static void GPIO_WakeUp_Power_Enable_Update(void);
typedef enum {
POWER_GLOBAL = 0,
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/src/fsl_tickless_rtc.c b/bsp/projects/microej/lowpower/src/fsl_tickless_rtc.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/src/fsl_tickless_rtc.c
rename to bsp/projects/microej/lowpower/src/fsl_tickless_rtc.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/src/power_manager.c b/bsp/projects/microej/lowpower/src/power_manager.c
similarity index 98%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/src/power_manager.c
rename to bsp/projects/microej/lowpower/src/power_manager.c
index bfd8ea1..07136b6 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/lowpower/src/power_manager.c
+++ b/bsp/projects/microej/lowpower/src/power_manager.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 NXP
+ * Copyright 2020, 2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -83,6 +83,8 @@ static uint32_t used_ram_mask = 0;
/* Keep track of the framebuffer that is currently transmitted to Display */
static framebuffer_t *framebuffer_to_power_off_address = NULL;
+static void GPIO_WakeUp_Power_Enable_Update(void);
+
/*
* Some GPIO pins can be configured to wake up the device from deepsleep mode.
* Once the device has been waked up by a GPIO pin event, entering in deepsleep
@@ -286,14 +288,10 @@ static void set_active_power_config(void)
/* PowerDown clock, RAM, and access to unused peripherals */
CLOCK_AttachClk(kNONE_to_SDIO0_CLK);
- POWER_EnablePD(kPDRUNCFG_LP_HSPAD_SDIO0_VDET);
- POWER_EnablePD(kPDRUNCFG_PD_HSPAD_SDIO0_REF);
POWER_EnablePD(kPDRUNCFG_APD_USDHC0_SRAM);
POWER_EnablePD(kPDRUNCFG_PPD_USDHC0_SRAM);
/* SDIO1 */
CLOCK_AttachClk(kNONE_to_SDIO1_CLK);
- POWER_EnablePD(kPDRUNCFG_LP_HSPAD_SDIO1_VDET);
- POWER_EnablePD(kPDRUNCFG_PD_HSPAD_SDIO1_REF);
POWER_EnablePD(kPDRUNCFG_APD_USDHC1_SRAM);
POWER_EnablePD(kPDRUNCFG_PPD_USDHC1_SRAM);
/* CASPER */
@@ -552,7 +550,7 @@ int32_t power_manager_set_profile(uint32_t power_profile)
SystemCoreClock = CLOCK_GetFreq(kCLOCK_CoreSysClk);
current_power_profile = power_profile;
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SEGGER_SYSVIEW_UpdateTimeStampMultiplier(SystemCoreClock);
#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/microej_freertos.xml b/bsp/projects/microej/microej_freertos.xml
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/microej_freertos.xml
rename to bsp/projects/microej/microej_freertos.xml
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/inc/osal.h b/bsp/projects/microej/osal/inc/osal.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/inc/osal.h
rename to bsp/projects/microej/osal/inc/osal.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/inc/osal_portmacro.h b/bsp/projects/microej/osal/inc/osal_portmacro.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/inc/osal_portmacro.h
rename to bsp/projects/microej/osal/inc/osal_portmacro.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/src/osal_FreeRTOS.c b/bsp/projects/microej/osal/src/osal_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/osal/src/osal_FreeRTOS.c
rename to bsp/projects/microej/osal/src/osal_FreeRTOS.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/.gitignore b/bsp/projects/microej/scripts/.gitignore
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/.gitignore
rename to bsp/projects/microej/scripts/.gitignore
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/Jlink.cmd b/bsp/projects/microej/scripts/Jlink.cmd
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/Jlink.cmd
rename to bsp/projects/microej/scripts/Jlink.cmd
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/build.bat b/bsp/projects/microej/scripts/build.bat
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/build.bat
rename to bsp/projects/microej/scripts/build.bat
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/build.sh b/bsp/projects/microej/scripts/build.sh
similarity index 79%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/build.sh
rename to bsp/projects/microej/scripts/build.sh
index db4037f..c473a04 100755
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/build.sh
+++ b/bsp/projects/microej/scripts/build.sh
@@ -6,6 +6,9 @@ CURRENT_DIRECTORY=$(pwd)
SCRIPT_DIR=$(dirname "$(realpath "$0")")
cd "$SCRIPT_DIR/../../nxpvee-ui/sdk_makefile" || exit 1
+# shell scripts may have lost their execution flag if they come from a zip
+chmod -f +x $SCRIPT_DIR/../../nxpvee-ui/armgcc/*.sh || true
+
make RELEASE=1 || exit 2
cp ../armgcc/release/mimxrt595_freertos-bsp.elf "$CURRENT_DIRECTORY"/application.out || exit 3
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/run.bat b/bsp/projects/microej/scripts/run.bat
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/scripts/run.bat
rename to bsp/projects/microej/scripts/run.bat
diff --git a/bsp/projects/microej/scripts/run.sh b/bsp/projects/microej/scripts/run.sh
new file mode 100755
index 0000000..89d7481
--- /dev/null
+++ b/bsp/projects/microej/scripts/run.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+CURRENT_DIRECTORY=$(pwd)
+
+# go to directory of script's location
+SCRIPT_DIR=$(dirname "$(realpath "$0")")
+cd "${SCRIPT_DIR}/../../nxpvee-ui/sdk_makefile/"
+
+# shell scripts may have lost their execution flag is they come from a zip
+chmod -f +x $SCRIPT_DIR/../../nxpvee-ui/armgcc/*.sh || true
+
+make RELEASE=1 flash_cmsisdap
+
+cd "$CURRENT_DIRECTORY"
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/segger/inc/SEGGER_RTT_Conf.h b/bsp/projects/microej/segger/inc/SEGGER_RTT_Conf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/segger/inc/SEGGER_RTT_Conf.h
rename to bsp/projects/microej/segger/inc/SEGGER_RTT_Conf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/stub/src/stub.c b/bsp/projects/microej/stub/src/stub.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/stub/src/stub.c
rename to bsp/projects/microej/stub/src/stub.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/CHANGES b/bsp/projects/microej/thirdparty/freetype/CHANGES
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/CHANGES
rename to bsp/projects/microej/thirdparty/freetype/CHANGES
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/FTL.TXT b/bsp/projects/microej/thirdparty/freetype/FTL.TXT
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/FTL.TXT
rename to bsp/projects/microej/thirdparty/freetype/FTL.TXT
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/GPLv2.TXT b/bsp/projects/microej/thirdparty/freetype/GPLv2.TXT
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/GPLv2.TXT
rename to bsp/projects/microej/thirdparty/freetype/GPLv2.TXT
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/LICENSE.TXT b/bsp/projects/microej/thirdparty/freetype/LICENSE.TXT
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/LICENSE.TXT
rename to bsp/projects/microej/thirdparty/freetype/LICENSE.TXT
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afblue.h b/bsp/projects/microej/thirdparty/freetype/inc/afblue.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afblue.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afblue.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afcjk.h b/bsp/projects/microej/thirdparty/freetype/inc/afcjk.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afcjk.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afcjk.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afcover.h b/bsp/projects/microej/thirdparty/freetype/inc/afcover.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afcover.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afcover.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afdummy.h b/bsp/projects/microej/thirdparty/freetype/inc/afdummy.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afdummy.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afdummy.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aferrors.h b/bsp/projects/microej/thirdparty/freetype/inc/aferrors.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aferrors.h
rename to bsp/projects/microej/thirdparty/freetype/inc/aferrors.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afglobal.h b/bsp/projects/microej/thirdparty/freetype/inc/afglobal.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afglobal.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afglobal.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afhints.h b/bsp/projects/microej/thirdparty/freetype/inc/afhints.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afhints.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afhints.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afindic.h b/bsp/projects/microej/thirdparty/freetype/inc/afindic.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afindic.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afindic.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aflatin.h b/bsp/projects/microej/thirdparty/freetype/inc/aflatin.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aflatin.h
rename to bsp/projects/microej/thirdparty/freetype/inc/aflatin.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afloader.h b/bsp/projects/microej/thirdparty/freetype/inc/afloader.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afloader.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afloader.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afmodule.h b/bsp/projects/microej/thirdparty/freetype/inc/afmodule.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afmodule.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afmodule.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afmparse.h b/bsp/projects/microej/thirdparty/freetype/inc/afmparse.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afmparse.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afmparse.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afranges.h b/bsp/projects/microej/thirdparty/freetype/inc/afranges.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afranges.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afranges.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afscript.h b/bsp/projects/microej/thirdparty/freetype/inc/afscript.h
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afscript.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afscript.h
index f8c8cf1..95a81bf 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afscript.h
+++ b/bsp/projects/microej/thirdparty/freetype/inc/afscript.h
@@ -46,19 +46,19 @@
"Armenian",
HB_SCRIPT_ARMENIAN,
HINTING_BOTTOM_TO_TOP,
- "\xD5\xBD \xD5\x8D" ) /* ս �? */
+ "\xD5\xBD \xD5\x8D" ) /* ս �? */
SCRIPT( avst, AVST,
"Avestan",
HB_SCRIPT_AVESTAN,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\xAC\x9A" ) /* �?�� */
+ "\xF0\x90\xAC\x9A" ) /* �?�� */
SCRIPT( bamu, BAMU,
"Bamum",
HB_SCRIPT_BAMUM,
HINTING_BOTTOM_TO_TOP,
- "\xEA\x9B\x81 \xEA\x9B\xAF" ) /* �? ꛯ */
+ "\xEA\x9B\x81 \xEA\x9B\xAF" ) /* �? ꛯ */
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( beng, BENG,
@@ -71,7 +71,7 @@
"Buhid",
HB_SCRIPT_BUHID,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x9D\x8B \xE1\x9D\x8F" ) /* �?� �?? */
+ "\xE1\x9D\x8B \xE1\x9D\x8F" ) /* �?� �?? */
SCRIPT( cakm, CAKM,
"Chakma",
@@ -89,13 +89,13 @@
"Carian",
HB_SCRIPT_CARIAN,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\x8A\xAB \xF0\x90\x8B\x89" ) /* �?�� �?�� */
+ "\xF0\x90\x8A\xAB \xF0\x90\x8B\x89" ) /* �?�� �?�� */
SCRIPT( cher, CHER,
"Cherokee",
HB_SCRIPT_CHEROKEE,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x8E\xA4 \xE1\x8F\x85 \xEA\xAE\x95" ) /* Ꭴ �?� ꮕ */
+ "\xE1\x8E\xA4 \xE1\x8F\x85 \xEA\xAE\x95" ) /* Ꭴ �?� ꮕ */
SCRIPT( copt, COPT,
"Coptic",
@@ -107,7 +107,7 @@
"Cypriot",
HB_SCRIPT_CYPRIOT,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\xA0\x85 \xF0\x90\xA0\xA3" ) /* �?�� �?�� */
+ "\xF0\x90\xA0\x85 \xF0\x90\xA0\xA3" ) /* �?�� �?�� */
SCRIPT( cyrl, CYRL,
"Cyrillic",
@@ -125,19 +125,19 @@
"Deseret",
HB_SCRIPT_DESERET,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\x90\x84 \xF0\x90\x90\xAC" ) /* �??� �??� */
+ "\xF0\x90\x90\x84 \xF0\x90\x90\xAC" ) /* �??� �??� */
SCRIPT( ethi, ETHI,
"Ethiopic",
HB_SCRIPT_ETHIOPIC,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x8B\x90" ) /* �? */
+ "\xE1\x8B\x90" ) /* �? */
SCRIPT( geor, GEOR,
"Georgian (Mkhedruli)",
HB_SCRIPT_GEORGIAN,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90 \xE1\xB2\xBF" ) /* ი ე �? Ი */
+ "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90 \xE1\xB2\xBF" ) /* ი ე �? Ი */
SCRIPT( geok, GEOK,
"Georgian (Khutsuri)",
@@ -155,7 +155,7 @@
"Gothic",
HB_SCRIPT_GOTHIC,
HINTING_TOP_TO_BOTTOM,
- "\xF0\x90\x8C\xB4 \xF0\x90\x8C\xBE \xF0\x90\x8D\x83" ) /* �?�� �?�� �??� */
+ "\xF0\x90\x8C\xB4 \xF0\x90\x8C\xBE \xF0\x90\x8D\x83" ) /* �?�� �?�� �??� */
SCRIPT( grek, GREK,
"Greek",
@@ -179,13 +179,13 @@
"Hebrew",
HB_SCRIPT_HEBREW,
HINTING_BOTTOM_TO_TOP,
- "\xD7\x9D" ) /* �? */
+ "\xD7\x9D" ) /* �? */
SCRIPT( kali, KALI,
"Kayah Li",
HB_SCRIPT_KAYAH_LI,
HINTING_BOTTOM_TO_TOP,
- "\xEA\xA4\x8D \xEA\xA4\x80" ) /* �? ꤀ */
+ "\xEA\xA4\x8D \xEA\xA4\x80" ) /* �? ꤀ */
/* only digit zero has a simple shape in the Khmer script */
SCRIPT( khmr, KHMR,
@@ -211,7 +211,7 @@
"Lao",
HB_SCRIPT_LAO,
HINTING_BOTTOM_TO_TOP,
- "\xE0\xBB\x90" ) /* �? */
+ "\xE0\xBB\x90" ) /* �? */
SCRIPT( latn, LATN,
"Latin",
@@ -229,7 +229,7 @@
"Latin Superscript Fallback",
HB_SCRIPT_INVALID,
HINTING_BOTTOM_TO_TOP,
- "\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ �?� */
+ "\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ �?� */
SCRIPT( lisu, LISU,
"Lisu",
@@ -259,7 +259,7 @@
"Myanmar",
HB_SCRIPT_MYANMAR,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x80\x9D \xE1\x80\x84 \xE1\x80\x82" ) /* �? င ဂ */
+ "\xE1\x80\x9D \xE1\x80\x84 \xE1\x80\x82" ) /* �? င ဂ */
SCRIPT( nkoo, NKOO,
"N'Ko",
@@ -283,37 +283,37 @@
"Old Turkic",
HB_SCRIPT_OLD_TURKIC,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\xB0\x97" ) /* �?�� */
+ "\xF0\x90\xB0\x97" ) /* �?�� */
SCRIPT( osge, OSGE,
"Osage",
HB_SCRIPT_OSAGE,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\x93\x82 \xF0\x90\x93\xAA" ) /* �?�� �?�� */
+ "\xF0\x90\x93\x82 \xF0\x90\x93\xAA" ) /* �?�� �?�� */
SCRIPT( osma, OSMA,
"Osmanya",
HB_SCRIPT_OSMANYA,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\x92\x86 \xF0\x90\x92\xA0" ) /* �?�� �?�� */
+ "\xF0\x90\x92\x86 \xF0\x90\x92\xA0" ) /* �?�� �?�� */
SCRIPT( rohg, ROHG,
"Hanifi Rohingya",
HB_SCRIPT_HANIFI_ROHINGYA,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\xB4\xB0" ) /* �?�� */
+ "\xF0\x90\xB4\xB0" ) /* �?�� */
SCRIPT( saur, SAUR,
"Saurashtra",
HB_SCRIPT_SAURASHTRA,
HINTING_BOTTOM_TO_TOP,
- "\xEA\xA2\x9D \xEA\xA3\x90" ) /* �? �? */
+ "\xEA\xA2\x9D \xEA\xA3\x90" ) /* �? �? */
SCRIPT( shaw, SHAW,
"Shavian",
HB_SCRIPT_SHAVIAN,
HINTING_BOTTOM_TO_TOP,
- "\xF0\x90\x91\xB4" ) /* �?�� */
+ "\xF0\x90\x91\xB4" ) /* �?�� */
SCRIPT( sinh, SINH,
"Sinhala",
@@ -358,7 +358,7 @@
"Thai",
HB_SCRIPT_THAI,
HINTING_BOTTOM_TO_TOP,
- "\xE0\xB8\xB2 \xE0\xB9\x85 \xE0\xB9\x90" ) /* า ๅ �? */
+ "\xE0\xB8\xB2 \xE0\xB9\x85 \xE0\xB9\x90" ) /* า ๅ �? */
SCRIPT( vaii, VAII,
"Vai",
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afshaper.h b/bsp/projects/microej/thirdparty/freetype/inc/afshaper.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afshaper.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afshaper.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afstyles.h b/bsp/projects/microej/thirdparty/freetype/inc/afstyles.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afstyles.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afstyles.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aftypes.h b/bsp/projects/microej/thirdparty/freetype/inc/aftypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/aftypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/aftypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afwrtsys.h b/bsp/projects/microej/thirdparty/freetype/inc/afwrtsys.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/afwrtsys.h
rename to bsp/projects/microej/thirdparty/freetype/inc/afwrtsys.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdf.h b/bsp/projects/microej/thirdparty/freetype/inc/bdf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/bdf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdfdrivr.h b/bsp/projects/microej/thirdparty/freetype/inc/bdfdrivr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdfdrivr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/bdfdrivr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdferror.h b/bsp/projects/microej/thirdparty/freetype/inc/bdferror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/bdferror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/bdferror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffcmap.h b/bsp/projects/microej/thirdparty/freetype/inc/cffcmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffcmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffcmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffdecode.h b/bsp/projects/microej/thirdparty/freetype/inc/cffdecode.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffdecode.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffdecode.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffdrivr.h b/bsp/projects/microej/thirdparty/freetype/inc/cffdrivr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffdrivr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffdrivr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cfferrs.h b/bsp/projects/microej/thirdparty/freetype/inc/cfferrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cfferrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cfferrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffgload.h b/bsp/projects/microej/thirdparty/freetype/inc/cffgload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffgload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffgload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffload.h b/bsp/projects/microej/thirdparty/freetype/inc/cffload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/cffobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffparse.h b/bsp/projects/microej/thirdparty/freetype/inc/cffparse.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cffparse.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cffparse.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cfftoken.h b/bsp/projects/microej/thirdparty/freetype/inc/cfftoken.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cfftoken.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cfftoken.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ciderrs.h b/bsp/projects/microej/thirdparty/freetype/inc/ciderrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ciderrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ciderrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidgload.h b/bsp/projects/microej/thirdparty/freetype/inc/cidgload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidgload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidgload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidload.h b/bsp/projects/microej/thirdparty/freetype/inc/cidload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/cidobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidparse.h b/bsp/projects/microej/thirdparty/freetype/inc/cidparse.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidparse.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidparse.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidriver.h b/bsp/projects/microej/thirdparty/freetype/inc/cidriver.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidriver.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidriver.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidtoken.h b/bsp/projects/microej/thirdparty/freetype/inc/cidtoken.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/cidtoken.h
rename to bsp/projects/microej/thirdparty/freetype/inc/cidtoken.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/fnterrs.h b/bsp/projects/microej/thirdparty/freetype/inc/fnterrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/fnterrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/fnterrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftconfig.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftconfig.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftconfig.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftconfig.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftheader.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftheader.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftheader.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftheader.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h
index 847e090..38e3233 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h
+++ b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftmodule.h
@@ -8,7 +8,7 @@
* Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
* FreeType without GNU make.
*
- * Copyright 2019-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * Copyright 2021-2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
*/
#include "microvg_configuration.h"
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h
index a04565f..b4e1824 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h
+++ b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftoption.h
@@ -7,13 +7,14 @@
* Copyright (C) 1996-2021 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
+ * Copyright 2021-2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
- * Copyright 2019-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
#ifndef FTOPTION_H_
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftstdlib.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftstdlib.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftstdlib.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/ftstdlib.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/integer-types.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/integer-types.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/integer-types.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/integer-types.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/mac-support.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/mac-support.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/mac-support.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/mac-support.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/public-macros.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/config/public-macros.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/config/public-macros.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/config/public-macros.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/freetype.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/freetype.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/freetype.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/freetype.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftadvanc.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftadvanc.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftadvanc.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftadvanc.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbbox.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbbox.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbbox.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbbox.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbdf.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbdf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbdf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbdf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbitmap.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbitmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbitmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbitmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbzip2.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbzip2.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbzip2.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftbzip2.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcache.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcache.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcache.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcache.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftchapters.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftchapters.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftchapters.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftchapters.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcid.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcolor.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcolor.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcolor.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftcolor.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftdriver.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftdriver.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftdriver.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftdriver.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrdef.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrdef.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrdef.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrdef.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrors.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrors.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrors.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/fterrors.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftfntfmt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftfntfmt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftfntfmt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftfntfmt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgasp.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgasp.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgasp.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgasp.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftglyph.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftglyph.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftglyph.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftglyph.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgxval.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgxval.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgxval.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgxval.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgzip.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgzip.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgzip.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftgzip.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftimage.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftimage.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftimage.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftimage.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftincrem.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftincrem.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftincrem.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftincrem.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlcdfil.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlcdfil.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlcdfil.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlcdfil.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlist.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlist.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlist.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlist.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlogging.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlogging.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlogging.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlogging.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlzw.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlzw.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlzw.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftlzw.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmac.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmac.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmac.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmac.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmm.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmm.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmm.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmm.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmodapi.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmodapi.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmodapi.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmodapi.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmoderr.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmoderr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmoderr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftmoderr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftotval.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftotval.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftotval.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftotval.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftoutln.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftoutln.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftoutln.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftoutln.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftparams.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftparams.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftparams.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftparams.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftpfr.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftpfr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftpfr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftpfr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftrender.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftrender.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftrender.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftrender.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsizes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsizes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsizes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsizes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsnames.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsnames.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsnames.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsnames.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftstroke.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftstroke.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftstroke.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftstroke.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsynth.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsynth.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsynth.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsynth.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsystem.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsystem.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsystem.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftsystem.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fttrigon.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/fttrigon.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fttrigon.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/fttrigon.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fttypes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/fttypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/fttypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/fttypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftwinfnt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ftwinfnt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ftwinfnt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ftwinfnt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/autohint.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/autohint.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/autohint.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/autohint.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cffotypes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cffotypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cffotypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cffotypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cfftypes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cfftypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cfftypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/cfftypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/compiler-macros.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/compiler-macros.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/compiler-macros.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/compiler-macros.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftcalc.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftcalc.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftcalc.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftcalc.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdebug.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdebug.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdebug.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdebug.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdrv.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdrv.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdrv.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftdrv.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftgloadr.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftgloadr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftgloadr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftgloadr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fthash.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fthash.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fthash.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fthash.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftmemory.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftmemory.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftmemory.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftmemory.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftpsprop.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftpsprop.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftpsprop.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftpsprop.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftrfork.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftrfork.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftrfork.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftrfork.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftserv.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftserv.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftserv.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftserv.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftstream.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftstream.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftstream.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftstream.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fttrace.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fttrace.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fttrace.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/fttrace.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftvalid.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftvalid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftvalid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/ftvalid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/psaux.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/psaux.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/psaux.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/psaux.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/pshints.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/pshints.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/pshints.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/pshints.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svbdf.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svbdf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svbdf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svbdf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcfftl.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcfftl.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcfftl.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcfftl.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcid.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svcid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svfntfmt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svfntfmt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svfntfmt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svfntfmt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgldict.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgldict.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgldict.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgldict.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgxval.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgxval.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgxval.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svgxval.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svkern.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svkern.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svkern.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svkern.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmetric.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmetric.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmetric.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmetric.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmm.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmm.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmm.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svmm.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svotval.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svotval.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svotval.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svotval.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpfr.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpfr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpfr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpfr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpostnm.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpostnm.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpostnm.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpostnm.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svprop.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svprop.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svprop.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svprop.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpscmap.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpscmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpscmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpscmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpsinfo.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpsinfo.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpsinfo.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svpsinfo.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svsfnt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svsfnt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svsfnt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svsfnt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttcmap.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttcmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttcmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttcmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svtteng.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svtteng.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svtteng.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svtteng.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttglyf.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttglyf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttglyf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svttglyf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svwinfnt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svwinfnt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svwinfnt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/services/svwinfnt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/sfnt.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/sfnt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/sfnt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/sfnt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/t1types.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/t1types.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/t1types.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/t1types.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/tttypes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/tttypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/tttypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/tttypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/wofftypes.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/wofftypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/wofftypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/internal/wofftypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/t1tables.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/t1tables.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/t1tables.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/t1tables.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ttnameid.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/ttnameid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/ttnameid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/ttnameid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/tttables.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/tttables.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/tttables.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/tttables.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/tttags.h b/bsp/projects/microej/thirdparty/freetype/inc/freetype/tttags.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/freetype/tttags.h
rename to bsp/projects/microej/thirdparty/freetype/inc/freetype/tttags.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ft2build.h b/bsp/projects/microej/thirdparty/freetype/inc/ft2build.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ft2build.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ft2build.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftbase.h b/bsp/projects/microej/thirdparty/freetype/inc/ftbase.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftbase.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftbase.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftccache.h b/bsp/projects/microej/thirdparty/freetype/inc/ftccache.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftccache.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftccache.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftccback.h b/bsp/projects/microej/thirdparty/freetype/inc/ftccback.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftccback.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftccback.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcerror.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcerror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcerror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcerror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcglyph.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcglyph.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcglyph.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcglyph.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcimage.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcimage.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcimage.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcimage.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcmanag.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcmanag.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcmanag.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcmanag.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcmru.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcmru.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcmru.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcmru.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcsbits.h b/bsp/projects/microej/thirdparty/freetype/inc/ftcsbits.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftcsbits.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftcsbits.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftgrays.h b/bsp/projects/microej/thirdparty/freetype/inc/ftgrays.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftgrays.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftgrays.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftmisc.h b/bsp/projects/microej/thirdparty/freetype/inc/ftmisc.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftmisc.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftmisc.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftraster.h b/bsp/projects/microej/thirdparty/freetype/inc/ftraster.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftraster.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftraster.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftrend1.h b/bsp/projects/microej/thirdparty/freetype/inc/ftrend1.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftrend1.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftrend1.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdf.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsdf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsdf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdfcommon.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsdfcommon.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdfcommon.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsdfcommon.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdferrs.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsdferrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdferrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsdferrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdfrend.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsdfrend.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsdfrend.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsdfrend.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsmerrs.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsmerrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsmerrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsmerrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsmooth.h b/bsp/projects/microej/thirdparty/freetype/inc/ftsmooth.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftsmooth.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftsmooth.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h b/bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h
similarity index 78%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h
index 8babe90..ecd4a54 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h
+++ b/bsp/projects/microej/thirdparty/freetype/inc/ftvector/ftvector.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2019-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2019-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief Freetype vglite renderer
* @author MicroEJ Developer Team
-* @version 3.0.0
+* @version 7.0.1
*/
#ifndef FTVECTOR_H
@@ -22,8 +22,6 @@
#define FT_PARAM_TAG_VGLITE_DESTINATION FT_MAKE_TAG( 'd', 'e', 's', 't' )
#define FT_PARAM_TAG_VGLITE_MATRIX FT_MAKE_TAG( 'm', 'a', 't', 'r' )
-#define FT_PARAM_TAG_VGLITE_QUALITY FT_MAKE_TAG( 'q', 'u', 'a', 'l' )
-#define FT_PARAM_TAG_VGLITE_FORMAT FT_MAKE_TAG( 'f', 'o', 'r', 'm' )
#define FT_PARAM_TAG_VGLITE_BLEND FT_MAKE_TAG( 'b', 'l', 'e', 'n' )
#define FT_PARAM_TAG_VGLITE_COLOR FT_MAKE_TAG( 'c', 'o', 'l', 'o' )
#define FT_PARAM_TAG_VGLITE_GRADIENT FT_MAKE_TAG( 'g', 'r', 'a', 'd' )
@@ -35,21 +33,21 @@
//#define FT_VGLITE_LOG_OUTLINES
#define VGLITE_CMD_MOVE_TO 2
-typedef struct path_move_to_16 {
+typedef struct {
int16_t cmd;
int16_t x;
int16_t y;
} path_move_to_16_t;
#define VGLITE_CMD_LINE_TO 4
-typedef struct path_line_to_16 {
+typedef struct {
int16_t cmd;
int16_t x;
int16_t y;
} path_line_to_16_t;
#define VGLITE_CMD_QUAD_TO 6
-typedef struct path_quad_to_16 {
+typedef struct {
int16_t cmd;
int16_t cx;
int16_t cy;
@@ -58,7 +56,7 @@ typedef struct path_quad_to_16 {
} path_quad_to_16_t;
#define VGLITE_CMD_CUBIC_TO 8
-typedef struct path_cubic_to_16 {
+typedef struct {
int16_t cmd;
int16_t cx1;
int16_t cy1;
@@ -69,7 +67,7 @@ typedef struct path_cubic_to_16 {
} path_cubic_to_16_t;
#define VGLITE_CMD_END 0
-typedef struct path_end_16 {
+typedef struct {
int16_t cmd;
} path_end_16_t;
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftzconf.h b/bsp/projects/microej/thirdparty/freetype/inc/ftzconf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftzconf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftzconf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftzopen.h b/bsp/projects/microej/thirdparty/freetype/inc/ftzopen.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ftzopen.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ftzopen.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvalid.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvalid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvalid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvalid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvcommn.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvcommn.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvcommn.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvcommn.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxverror.h b/bsp/projects/microej/thirdparty/freetype/inc/gxverror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxverror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxverror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvfeat.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvfeat.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvfeat.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvfeat.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmod.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvmod.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmod.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvmod.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmort.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvmort.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmort.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvmort.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmorx.h b/bsp/projects/microej/thirdparty/freetype/inc/gxvmorx.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/gxvmorx.h
rename to bsp/projects/microej/thirdparty/freetype/inc/gxvmorx.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infblock.h b/bsp/projects/microej/thirdparty/freetype/inc/infblock.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infblock.h
rename to bsp/projects/microej/thirdparty/freetype/inc/infblock.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infcodes.h b/bsp/projects/microej/thirdparty/freetype/inc/infcodes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infcodes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/infcodes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/inffixed.h b/bsp/projects/microej/thirdparty/freetype/inc/inffixed.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/inffixed.h
rename to bsp/projects/microej/thirdparty/freetype/inc/inffixed.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/inftrees.h b/bsp/projects/microej/thirdparty/freetype/inc/inftrees.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/inftrees.h
rename to bsp/projects/microej/thirdparty/freetype/inc/inftrees.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infutil.h b/bsp/projects/microej/thirdparty/freetype/inc/infutil.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/infutil.h
rename to bsp/projects/microej/thirdparty/freetype/inc/infutil.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/md5.h b/bsp/projects/microej/thirdparty/freetype/inc/md5.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/md5.h
rename to bsp/projects/microej/thirdparty/freetype/inc/md5.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvalid.h b/bsp/projects/microej/thirdparty/freetype/inc/otvalid.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvalid.h
rename to bsp/projects/microej/thirdparty/freetype/inc/otvalid.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvcommn.h b/bsp/projects/microej/thirdparty/freetype/inc/otvcommn.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvcommn.h
rename to bsp/projects/microej/thirdparty/freetype/inc/otvcommn.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otverror.h b/bsp/projects/microej/thirdparty/freetype/inc/otverror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otverror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/otverror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvgpos.h b/bsp/projects/microej/thirdparty/freetype/inc/otvgpos.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvgpos.h
rename to bsp/projects/microej/thirdparty/freetype/inc/otvgpos.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvmod.h b/bsp/projects/microej/thirdparty/freetype/inc/otvmod.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/otvmod.h
rename to bsp/projects/microej/thirdparty/freetype/inc/otvmod.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcf.h b/bsp/projects/microej/thirdparty/freetype/inc/pcf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pcf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfdrivr.h b/bsp/projects/microej/thirdparty/freetype/inc/pcfdrivr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfdrivr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pcfdrivr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcferror.h b/bsp/projects/microej/thirdparty/freetype/inc/pcferror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcferror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pcferror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfread.h b/bsp/projects/microej/thirdparty/freetype/inc/pcfread.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfread.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pcfread.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfutil.h b/bsp/projects/microej/thirdparty/freetype/inc/pcfutil.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pcfutil.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pcfutil.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrcmap.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrcmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrcmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrcmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrdrivr.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrdrivr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrdrivr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrdrivr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrerror.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrerror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrerror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrerror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrgload.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrgload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrgload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrgload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrload.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrsbit.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrsbit.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrsbit.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrsbit.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrtypes.h b/bsp/projects/microej/thirdparty/freetype/inc/pfrtypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pfrtypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pfrtypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pngshim.h b/bsp/projects/microej/thirdparty/freetype/inc/pngshim.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pngshim.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pngshim.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psarrst.h b/bsp/projects/microej/thirdparty/freetype/inc/psarrst.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psarrst.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psarrst.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psauxerr.h b/bsp/projects/microej/thirdparty/freetype/inc/psauxerr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psauxerr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psauxerr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psauxmod.h b/bsp/projects/microej/thirdparty/freetype/inc/psauxmod.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psauxmod.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psauxmod.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psblues.h b/bsp/projects/microej/thirdparty/freetype/inc/psblues.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psblues.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psblues.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psconv.h b/bsp/projects/microej/thirdparty/freetype/inc/psconv.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psconv.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psconv.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pserror.h b/bsp/projects/microej/thirdparty/freetype/inc/pserror.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pserror.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pserror.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psfixed.h b/bsp/projects/microej/thirdparty/freetype/inc/psfixed.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psfixed.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psfixed.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psfont.h b/bsp/projects/microej/thirdparty/freetype/inc/psfont.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psfont.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psfont.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psft.h b/bsp/projects/microej/thirdparty/freetype/inc/psft.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psft.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psft.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psglue.h b/bsp/projects/microej/thirdparty/freetype/inc/psglue.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psglue.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psglue.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshalgo.h b/bsp/projects/microej/thirdparty/freetype/inc/pshalgo.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshalgo.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshalgo.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshglob.h b/bsp/projects/microej/thirdparty/freetype/inc/pshglob.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshglob.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshglob.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshints.h b/bsp/projects/microej/thirdparty/freetype/inc/pshints.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshints.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshints.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshmod.h b/bsp/projects/microej/thirdparty/freetype/inc/pshmod.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshmod.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshmod.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshnterr.h b/bsp/projects/microej/thirdparty/freetype/inc/pshnterr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshnterr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshnterr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshrec.h b/bsp/projects/microej/thirdparty/freetype/inc/pshrec.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pshrec.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pshrec.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psintrp.h b/bsp/projects/microej/thirdparty/freetype/inc/psintrp.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psintrp.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psintrp.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psmodule.h b/bsp/projects/microej/thirdparty/freetype/inc/psmodule.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psmodule.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psmodule.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psnamerr.h b/bsp/projects/microej/thirdparty/freetype/inc/psnamerr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psnamerr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psnamerr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/psobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psread.h b/bsp/projects/microej/thirdparty/freetype/inc/psread.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psread.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psread.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psstack.h b/bsp/projects/microej/thirdparty/freetype/inc/psstack.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/psstack.h
rename to bsp/projects/microej/thirdparty/freetype/inc/psstack.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pstables.h b/bsp/projects/microej/thirdparty/freetype/inc/pstables.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pstables.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pstables.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pstypes.h b/bsp/projects/microej/thirdparty/freetype/inc/pstypes.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/pstypes.h
rename to bsp/projects/microej/thirdparty/freetype/inc/pstypes.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/rasterrs.h b/bsp/projects/microej/thirdparty/freetype/inc/rasterrs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/rasterrs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/rasterrs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfdriver.h b/bsp/projects/microej/thirdparty/freetype/inc/sfdriver.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfdriver.h
rename to bsp/projects/microej/thirdparty/freetype/inc/sfdriver.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sferrors.h b/bsp/projects/microej/thirdparty/freetype/inc/sferrors.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sferrors.h
rename to bsp/projects/microej/thirdparty/freetype/inc/sferrors.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/sfobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/sfobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfwoff.h b/bsp/projects/microej/thirdparty/freetype/inc/sfwoff.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfwoff.h
rename to bsp/projects/microej/thirdparty/freetype/inc/sfwoff.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfwoff2.h b/bsp/projects/microej/thirdparty/freetype/inc/sfwoff2.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/sfwoff2.h
rename to bsp/projects/microej/thirdparty/freetype/inc/sfwoff2.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1afm.h b/bsp/projects/microej/thirdparty/freetype/inc/t1afm.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1afm.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1afm.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1cmap.h b/bsp/projects/microej/thirdparty/freetype/inc/t1cmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1cmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1cmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1decode.h b/bsp/projects/microej/thirdparty/freetype/inc/t1decode.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1decode.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1decode.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1driver.h b/bsp/projects/microej/thirdparty/freetype/inc/t1driver.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1driver.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1driver.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1errors.h b/bsp/projects/microej/thirdparty/freetype/inc/t1errors.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1errors.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1errors.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1gload.h b/bsp/projects/microej/thirdparty/freetype/inc/t1gload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1gload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1gload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1load.h b/bsp/projects/microej/thirdparty/freetype/inc/t1load.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1load.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1load.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1objs.h b/bsp/projects/microej/thirdparty/freetype/inc/t1objs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1objs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1objs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1parse.h b/bsp/projects/microej/thirdparty/freetype/inc/t1parse.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1parse.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1parse.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1tokens.h b/bsp/projects/microej/thirdparty/freetype/inc/t1tokens.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t1tokens.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t1tokens.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42drivr.h b/bsp/projects/microej/thirdparty/freetype/inc/t42drivr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42drivr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t42drivr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42error.h b/bsp/projects/microej/thirdparty/freetype/inc/t42error.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42error.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t42error.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42objs.h b/bsp/projects/microej/thirdparty/freetype/inc/t42objs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42objs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t42objs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42parse.h b/bsp/projects/microej/thirdparty/freetype/inc/t42parse.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42parse.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t42parse.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42types.h b/bsp/projects/microej/thirdparty/freetype/inc/t42types.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/t42types.h
rename to bsp/projects/microej/thirdparty/freetype/inc/t42types.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttbdf.h b/bsp/projects/microej/thirdparty/freetype/inc/ttbdf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttbdf.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttbdf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcmap.h b/bsp/projects/microej/thirdparty/freetype/inc/ttcmap.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcmap.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttcmap.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcmapc.h b/bsp/projects/microej/thirdparty/freetype/inc/ttcmapc.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcmapc.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttcmapc.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcolr.h b/bsp/projects/microej/thirdparty/freetype/inc/ttcolr.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcolr.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttcolr.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcpal.h b/bsp/projects/microej/thirdparty/freetype/inc/ttcpal.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttcpal.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttcpal.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttdriver.h b/bsp/projects/microej/thirdparty/freetype/inc/ttdriver.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttdriver.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttdriver.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/tterrors.h b/bsp/projects/microej/thirdparty/freetype/inc/tterrors.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/tterrors.h
rename to bsp/projects/microej/thirdparty/freetype/inc/tterrors.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttgload.h b/bsp/projects/microej/thirdparty/freetype/inc/ttgload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttgload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttgload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttgxvar.h b/bsp/projects/microej/thirdparty/freetype/inc/ttgxvar.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttgxvar.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttgxvar.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttinterp.h b/bsp/projects/microej/thirdparty/freetype/inc/ttinterp.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttinterp.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttinterp.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttkern.h b/bsp/projects/microej/thirdparty/freetype/inc/ttkern.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttkern.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttkern.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttload.h b/bsp/projects/microej/thirdparty/freetype/inc/ttload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttmtx.h b/bsp/projects/microej/thirdparty/freetype/inc/ttmtx.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttmtx.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttmtx.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttobjs.h b/bsp/projects/microej/thirdparty/freetype/inc/ttobjs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttobjs.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttobjs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttpload.h b/bsp/projects/microej/thirdparty/freetype/inc/ttpload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttpload.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttpload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttpost.h b/bsp/projects/microej/thirdparty/freetype/inc/ttpost.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttpost.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttpost.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttsbit.h b/bsp/projects/microej/thirdparty/freetype/inc/ttsbit.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttsbit.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttsbit.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttsubpix.h b/bsp/projects/microej/thirdparty/freetype/inc/ttsubpix.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/ttsubpix.h
rename to bsp/projects/microej/thirdparty/freetype/inc/ttsubpix.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/winfnt.h b/bsp/projects/microej/thirdparty/freetype/inc/winfnt.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/winfnt.h
rename to bsp/projects/microej/thirdparty/freetype/inc/winfnt.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/woff2tags.h b/bsp/projects/microej/thirdparty/freetype/inc/woff2tags.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/woff2tags.h
rename to bsp/projects/microej/thirdparty/freetype/inc/woff2tags.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/zlib.h b/bsp/projects/microej/thirdparty/freetype/inc/zlib.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/zlib.h
rename to bsp/projects/microej/thirdparty/freetype/inc/zlib.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/zutil.h b/bsp/projects/microej/thirdparty/freetype/inc/zutil.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/inc/zutil.h
rename to bsp/projects/microej/thirdparty/freetype/inc/zutil.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/.gitignore b/bsp/projects/microej/thirdparty/freetype/lib/.gitignore
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/.gitignore
rename to bsp/projects/microej/thirdparty/freetype/lib/.gitignore
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/freetype.a b/bsp/projects/microej/thirdparty/freetype/lib/freetype.a
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/freetype.a
rename to bsp/projects/microej/thirdparty/freetype/lib/freetype.a
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/lib_freetype.ewp b/bsp/projects/microej/thirdparty/freetype/lib/lib_freetype.ewp
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/lib/lib_freetype.ewp
rename to bsp/projects/microej/thirdparty/freetype/lib/lib_freetype.ewp
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/adler32.c b/bsp/projects/microej/thirdparty/freetype/src/adler32.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/adler32.c
rename to bsp/projects/microej/thirdparty/freetype/src/adler32.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afblue.c b/bsp/projects/microej/thirdparty/freetype/src/afblue.c
similarity index 87%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afblue.c
rename to bsp/projects/microej/thirdparty/freetype/src/afblue.c
index d982aa1..d2c089f 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afblue.c
+++ b/bsp/projects/microej/thirdparty/freetype/src/afblue.c
@@ -26,7 +26,7 @@
af_blue_strings[] =
{
/* */
- '\xF0', '\x9E', '\xA4', '\x8C', ' ', '\xF0', '\x9E', '\xA4', '\x85', ' ', '\xF0', '\x9E', '\xA4', '\x88', ' ', '\xF0', '\x9E', '\xA4', '\x8F', ' ', '\xF0', '\x9E', '\xA4', '\x94', ' ', '\xF0', '\x9E', '\xA4', '\x9A', /* 𞤌 𞤅 𞤈 �? 𞤔 𞤚 */
+ '\xF0', '\x9E', '\xA4', '\x8C', ' ', '\xF0', '\x9E', '\xA4', '\x85', ' ', '\xF0', '\x9E', '\xA4', '\x88', ' ', '\xF0', '\x9E', '\xA4', '\x8F', ' ', '\xF0', '\x9E', '\xA4', '\x94', ' ', '\xF0', '\x9E', '\xA4', '\x9A', /* 𞤌 𞤅 𞤈 �? 𞤔 𞤚 */
'\0',
'\xF0', '\x9E', '\xA4', '\x82', ' ', '\xF0', '\x9E', '\xA4', '\x96', /* 𞤂 𞤖 */
'\0',
@@ -40,9 +40,9 @@
'\0',
'\xD9', '\x80', /* ـ */
'\0',
- '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x8D', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ա Մ Ւ �? Բ Գ Դ Օ */
+ '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x8D', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ա Մ Ւ �? Բ Գ Դ Օ */
'\0',
- '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ւ Ո Դ Ճ Շ �? �? Օ */
+ '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ւ Ո Դ Ճ Շ �? �? Օ */
'\0',
'\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x86', ' ', '\xD5', '\xB3', /* ե է ի մ վ ֆ ճ */
'\0',
@@ -50,13 +50,13 @@
'\0',
'\xD5', '\xB0', ' ', '\xD5', '\xB8', ' ', '\xD5', '\xB3', ' ', '\xD5', '\xA1', ' ', '\xD5', '\xA5', ' ', '\xD5', '\xAE', ' ', '\xD5', '\xBD', ' ', '\xD6', '\x85', /* հ ո ճ ա ե ծ ս օ */
'\0',
- '\xD5', '\xA2', ' ', '\xD5', '\xA8', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xAC', ' ', '\xD5', '\xB2', ' ', '\xD5', '\xBA', ' ', '\xD6', '\x83', ' ', '\xD6', '\x81', /* բ ը ի լ ղ պ փ �? */
+ '\xD5', '\xA2', ' ', '\xD5', '\xA8', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xAC', ' ', '\xD5', '\xB2', ' ', '\xD5', '\xBA', ' ', '\xD6', '\x83', ' ', '\xD6', '\x81', /* բ ը ի լ ղ պ փ �? */
'\0',
- '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', ' ', '\xF0', '\x90', '\xAC', '\x90', ' ', '\xF0', '\x90', '\xAC', '\x9B', /* �?�� �?�? �?�? �?�� */
+ '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', ' ', '\xF0', '\x90', '\xAC', '\x90', ' ', '\xF0', '\x90', '\xAC', '\x9B', /* �?�� �?�? �?�? �?�� */
'\0',
- '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', /* �?�� �?�? */
+ '\xF0', '\x90', '\xAC', '\x80', ' ', '\xF0', '\x90', '\xAC', '\x81', /* �?�� �?�? */
'\0',
- '\xEA', '\x9A', '\xA7', ' ', '\xEA', '\x9A', '\xA8', ' ', '\xEA', '\x9B', '\x9B', ' ', '\xEA', '\x9B', '\x89', ' ', '\xEA', '\x9B', '\x81', ' ', '\xEA', '\x9B', '\x88', ' ', '\xEA', '\x9B', '\xAB', ' ', '\xEA', '\x9B', '\xAF', /* ꚧ ꚨ ꛛ ꛉ �? ꛈ ꛫ ꛯ */
+ '\xEA', '\x9A', '\xA7', ' ', '\xEA', '\x9A', '\xA8', ' ', '\xEA', '\x9B', '\x9B', ' ', '\xEA', '\x9B', '\x89', ' ', '\xEA', '\x9B', '\x81', ' ', '\xEA', '\x9B', '\x88', ' ', '\xEA', '\x9B', '\xAB', ' ', '\xEA', '\x9B', '\xAF', /* ꚧ ꚨ ꛛ ꛉ �? ꛈ ꛫ ꛯ */
'\0',
'\xEA', '\x9A', '\xAD', ' ', '\xEA', '\x9A', '\xB3', ' ', '\xEA', '\x9A', '\xB6', ' ', '\xEA', '\x9B', '\xAC', ' ', '\xEA', '\x9A', '\xA2', ' ', '\xEA', '\x9A', '\xBD', ' ', '\xEA', '\x9B', '\xAF', ' ', '\xEA', '\x9B', '\xB2', /* ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲ */
'\0',
@@ -64,91 +64,91 @@
'\0',
'\xE0', '\xA6', '\x87', ' ', '\xE0', '\xA6', '\x9F', ' ', '\xE0', '\xA6', '\xA0', ' ', '\xE0', '\xA6', '\xBF', ' ', '\xE0', '\xA7', '\x80', ' ', '\xE0', '\xA7', '\x88', ' ', '\xE0', '\xA7', '\x97', /* ই ট ঠ ি ী ৈ ৗ */
'\0',
- '\xE0', '\xA6', '\x93', ' ', '\xE0', '\xA6', '\x8F', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* ও �? ড ত ন ব ল ক */
+ '\xE0', '\xA6', '\x93', ' ', '\xE0', '\xA6', '\x8F', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* ও �? ড ত ন ব ল ক */
'\0',
- '\xE1', '\x9D', '\x90', ' ', '\xE1', '\x9D', '\x88', /* �?? �?� */
+ '\xE1', '\x9D', '\x90', ' ', '\xE1', '\x9D', '\x88', /* �?? �?� */
'\0',
- '\xE1', '\x9D', '\x85', ' ', '\xE1', '\x9D', '\x8A', ' ', '\xE1', '\x9D', '\x8E', /* �?� �?� �?� */
+ '\xE1', '\x9D', '\x85', ' ', '\xE1', '\x9D', '\x8A', ' ', '\xE1', '\x9D', '\x8E', /* �?� �?� �?� */
'\0',
- '\xE1', '\x9D', '\x82', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8C', /* �?� �?� �?� �?� */
+ '\xE1', '\x9D', '\x82', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8C', /* �?� �?� �?� �?� */
'\0',
- '\xE1', '\x9D', '\x80', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x86', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8B', ' ', '\xE1', '\x9D', '\x8F', ' ', '\xE1', '\x9D', '\x91', /* �?� �?� �?� �?� �?� �?? �?� */
+ '\xE1', '\x9D', '\x80', ' ', '\xE1', '\x9D', '\x83', ' ', '\xE1', '\x9D', '\x86', ' ', '\xE1', '\x9D', '\x89', ' ', '\xE1', '\x9D', '\x8B', ' ', '\xE1', '\x9D', '\x8F', ' ', '\xE1', '\x9D', '\x91', /* �?� �?� �?� �?� �?� �?? �?� */
'\0',
- '\xE1', '\x97', '\x9C', ' ', '\xE1', '\x96', '\xB4', ' ', '\xE1', '\x90', '\x81', ' ', '\xE1', '\x92', '\xA3', ' ', '\xE1', '\x91', '\xAB', ' ', '\xE1', '\x91', '\x8E', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xB0', /* ᗜ ᖴ �?? ᒣ ᑫ ᑎ ᔑ ᗰ */
+ '\xE1', '\x97', '\x9C', ' ', '\xE1', '\x96', '\xB4', ' ', '\xE1', '\x90', '\x81', ' ', '\xE1', '\x92', '\xA3', ' ', '\xE1', '\x91', '\xAB', ' ', '\xE1', '\x91', '\x8E', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xB0', /* ᗜ ᖴ �?? ᒣ ᑫ ᑎ ᔑ ᗰ */
'\0',
- '\xE1', '\x97', '\xB6', ' ', '\xE1', '\x96', '\xB5', ' ', '\xE1', '\x92', '\xA7', ' ', '\xE1', '\x90', '\x83', ' ', '\xE1', '\x91', '\x8C', ' ', '\xE1', '\x92', '\x8D', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xA2', /* ᗶ ᖵ ᒧ �?� ᑌ �? ᔑ ᗢ */
+ '\xE1', '\x97', '\xB6', ' ', '\xE1', '\x96', '\xB5', ' ', '\xE1', '\x92', '\xA7', ' ', '\xE1', '\x90', '\x83', ' ', '\xE1', '\x91', '\x8C', ' ', '\xE1', '\x92', '\x8D', ' ', '\xE1', '\x94', '\x91', ' ', '\xE1', '\x97', '\xA2', /* ᗶ ᖵ ᒧ �?� ᑌ �? ᔑ ᗢ */
'\0',
'\xE1', '\x93', '\x93', ' ', '\xE1', '\x93', '\x95', ' ', '\xE1', '\x93', '\x80', ' ', '\xE1', '\x93', '\x82', ' ', '\xE1', '\x93', '\x84', ' ', '\xE1', '\x95', '\x84', ' ', '\xE1', '\x95', '\x86', ' ', '\xE1', '\x98', '\xA3', /* ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ */
'\0',
'\xE1', '\x95', '\x83', ' ', '\xE1', '\x93', '\x82', ' ', '\xE1', '\x93', '\x80', ' ', '\xE1', '\x95', '\x82', ' ', '\xE1', '\x93', '\x97', ' ', '\xE1', '\x93', '\x9A', ' ', '\xE1', '\x95', '\x86', ' ', '\xE1', '\x98', '\xA3', /* ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ */
'\0',
- '\xE1', '\x90', '\xAA', ' ', '\xE1', '\x99', '\x86', ' ', '\xE1', '\xA3', '\x98', ' ', '\xE1', '\x90', '\xA2', ' ', '\xE1', '\x92', '\xBE', ' ', '\xE1', '\xA3', '\x97', ' ', '\xE1', '\x94', '\x86', /* �?� ᙆ ᣘ �?� ᒾ ᣗ ᔆ */
+ '\xE1', '\x90', '\xAA', ' ', '\xE1', '\x99', '\x86', ' ', '\xE1', '\xA3', '\x98', ' ', '\xE1', '\x90', '\xA2', ' ', '\xE1', '\x92', '\xBE', ' ', '\xE1', '\xA3', '\x97', ' ', '\xE1', '\x94', '\x86', /* �?� ᙆ ᣘ �?� ᒾ ᣗ ᔆ */
'\0',
- '\xE1', '\x99', '\x86', ' ', '\xE1', '\x97', '\xAE', ' ', '\xE1', '\x92', '\xBB', ' ', '\xE1', '\x90', '\x9E', ' ', '\xE1', '\x94', '\x86', ' ', '\xE1', '\x92', '\xA1', ' ', '\xE1', '\x92', '\xA2', ' ', '\xE1', '\x93', '\x91', /* ᙆ ᗮ ᒻ �?� ᔆ ᒡ ᒢ ᓑ */
+ '\xE1', '\x99', '\x86', ' ', '\xE1', '\x97', '\xAE', ' ', '\xE1', '\x92', '\xBB', ' ', '\xE1', '\x90', '\x9E', ' ', '\xE1', '\x94', '\x86', ' ', '\xE1', '\x92', '\xA1', ' ', '\xE1', '\x92', '\xA2', ' ', '\xE1', '\x93', '\x91', /* ᙆ ᗮ ᒻ �?� ᔆ ᒡ ᒢ ᓑ */
'\0',
- '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xAC', ' ', '\xF0', '\x90', '\x8A', '\xAD', ' ', '\xF0', '\x90', '\x8A', '\xB1', ' ', '\xF0', '\x90', '\x8A', '\xBA', ' ', '\xF0', '\x90', '\x8A', '\xBC', ' ', '\xF0', '\x90', '\x8A', '\xBF', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xAC', ' ', '\xF0', '\x90', '\x8A', '\xAD', ' ', '\xF0', '\x90', '\x8A', '\xB1', ' ', '\xF0', '\x90', '\x8A', '\xBA', ' ', '\xF0', '\x90', '\x8A', '\xBC', ' ', '\xF0', '\x90', '\x8A', '\xBF', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x8A', '\xA3', ' ', '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xB7', ' ', '\xF0', '\x90', '\x8B', '\x80', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xB8', ' ', '\xF0', '\x90', '\x8B', '\x89', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x8A', '\xA3', ' ', '\xF0', '\x90', '\x8A', '\xA7', ' ', '\xF0', '\x90', '\x8A', '\xB7', ' ', '\xF0', '\x90', '\x8B', '\x80', ' ', '\xF0', '\x90', '\x8A', '\xAB', ' ', '\xF0', '\x90', '\x8A', '\xB8', ' ', '\xF0', '\x90', '\x8B', '\x89', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
'\xF0', '\x91', '\x84', '\x83', ' ', '\xF0', '\x91', '\x84', '\x85', ' ', '\xF0', '\x91', '\x84', '\x89', ' ', '\xF0', '\x91', '\x84', '\x99', ' ', '\xF0', '\x91', '\x84', '\x97', /* 𑄃 𑄅 𑄉 𑄙 𑄗 */
'\0',
- '\xF0', '\x91', '\x84', '\x85', ' ', '\xF0', '\x91', '\x84', '\x9B', ' ', '\xF0', '\x91', '\x84', '\x9D', ' ', '\xF0', '\x91', '\x84', '\x97', ' ', '\xF0', '\x91', '\x84', '\x93', /* 𑄅 𑄛 �? 𑄗 𑄓 */
+ '\xF0', '\x91', '\x84', '\x85', ' ', '\xF0', '\x91', '\x84', '\x9B', ' ', '\xF0', '\x91', '\x84', '\x9D', ' ', '\xF0', '\x91', '\x84', '\x97', ' ', '\xF0', '\x91', '\x84', '\x93', /* 𑄅 𑄛 �? 𑄗 𑄓 */
'\0',
'\xF0', '\x91', '\x84', '\x96', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\x98', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\x99', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\xA4', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', ' ', '\xF0', '\x91', '\x84', '\xA5', '\xF0', '\x91', '\x84', '\xB3', '\xF0', '\x91', '\x84', '\xA2', /* 𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢 */
'\0',
- '\xE1', '\x8F', '\x86', ' ', '\xE1', '\x8E', '\xBB', ' ', '\xE1', '\x8E', '\xAC', ' ', '\xE1', '\x8F', '\x83', ' ', '\xE1', '\x8E', '\xA4', ' ', '\xE1', '\x8F', '\xA3', ' ', '\xE1', '\x8E', '\xA6', ' ', '\xE1', '\x8F', '\x95', /* �?� Ꮋ Ꭼ �?� Ꭴ �?� Ꭶ �?� */
+ '\xE1', '\x8F', '\x86', ' ', '\xE1', '\x8E', '\xBB', ' ', '\xE1', '\x8E', '\xAC', ' ', '\xE1', '\x8F', '\x83', ' ', '\xE1', '\x8E', '\xA4', ' ', '\xE1', '\x8F', '\xA3', ' ', '\xE1', '\x8E', '\xA6', ' ', '\xE1', '\x8F', '\x95', /* �?� Ꮋ Ꭼ �?� Ꭴ �?� Ꭶ �?� */
'\0',
- '\xEA', '\xAE', '\x92', ' ', '\xEA', '\xAE', '\xA4', ' ', '\xEA', '\xAE', '\xB6', ' ', '\xEA', '\xAD', '\xB4', ' ', '\xEA', '\xAD', '\xBE', ' ', '\xEA', '\xAE', '\x97', ' ', '\xEA', '\xAE', '\x9D', ' ', '\xEA', '\xAE', '\xBF', /* ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ �? ꮿ */
+ '\xEA', '\xAE', '\x92', ' ', '\xEA', '\xAE', '\xA4', ' ', '\xEA', '\xAE', '\xB6', ' ', '\xEA', '\xAD', '\xB4', ' ', '\xEA', '\xAD', '\xBE', ' ', '\xEA', '\xAE', '\x97', ' ', '\xEA', '\xAE', '\x9D', ' ', '\xEA', '\xAE', '\xBF', /* ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ �? ꮿ */
'\0',
'\xEA', '\xAE', '\x96', ' ', '\xEA', '\xAD', '\xBC', ' ', '\xEA', '\xAE', '\x93', ' ', '\xEA', '\xAE', '\xA0', ' ', '\xEA', '\xAE', '\xB3', ' ', '\xEA', '\xAD', '\xB6', ' ', '\xEA', '\xAE', '\xA5', ' ', '\xEA', '\xAE', '\xBB', /* ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ */
'\0',
- '\xE1', '\x8F', '\xB8', ' ', '\xEA', '\xAE', '\x90', ' ', '\xEA', '\xAD', '\xB9', ' ', '\xEA', '\xAD', '\xBB', /* �?� �? ꭹ ꭻ */
+ '\xE1', '\x8F', '\xB8', ' ', '\xEA', '\xAE', '\x90', ' ', '\xEA', '\xAD', '\xB9', ' ', '\xEA', '\xAD', '\xBB', /* �?� �? ꭹ ꭻ */
'\0',
- '\xE2', '\xB2', '\x8C', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\xA0', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB2', '\xA4', ' ', '\xE2', '\xB3', '\x8A', /* Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ �? Ⲥ Ⳋ */
+ '\xE2', '\xB2', '\x8C', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\xA0', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB2', '\xA4', ' ', '\xE2', '\xB3', '\x8A', /* Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ �? Ⲥ Ⳋ */
'\0',
- '\xE2', '\xB3', '\x90', ' ', '\xE2', '\xB3', '\x98', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB3', '\x9C', ' ', '\xE2', '\xB2', '\xB0', /* �? Ⳙ Ⳟ Ⲏ Ⲟ �? Ⳝ Ⲱ */
+ '\xE2', '\xB3', '\x90', ' ', '\xE2', '\xB3', '\x98', ' ', '\xE2', '\xB3', '\x9E', ' ', '\xE2', '\xB2', '\x8E', ' ', '\xE2', '\xB2', '\x9E', ' ', '\xE2', '\xB2', '\x90', ' ', '\xE2', '\xB3', '\x9C', ' ', '\xE2', '\xB2', '\xB0', /* �? Ⳙ Ⳟ Ⲏ Ⲟ �? Ⳝ Ⲱ */
'\0',
- '\xE2', '\xB2', '\x8D', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\xA1', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB2', '\xA5', ' ', '\xE2', '\xB3', '\x8B', /* �? �? ⲡ ⳟ ⲟ ⲑ ⲥ ⳋ */
+ '\xE2', '\xB2', '\x8D', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\xA1', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB2', '\xA5', ' ', '\xE2', '\xB3', '\x8B', /* �? �? ⲡ ⳟ ⲟ ⲑ ⲥ ⳋ */
'\0',
- '\xE2', '\xB3', '\x91', ' ', '\xE2', '\xB3', '\x99', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB3', '\x9D', ' ', '\xE2', '\xB3', '\x92', /* ⳑ ⳙ ⳟ �? ⲟ ⲑ �? Ⳓ */
+ '\xE2', '\xB3', '\x91', ' ', '\xE2', '\xB3', '\x99', ' ', '\xE2', '\xB3', '\x9F', ' ', '\xE2', '\xB2', '\x8F', ' ', '\xE2', '\xB2', '\x9F', ' ', '\xE2', '\xB2', '\x91', ' ', '\xE2', '\xB3', '\x9D', ' ', '\xE2', '\xB3', '\x92', /* ⳑ ⳙ ⳟ �? ⲟ ⲑ �? Ⳓ */
'\0',
- '\xF0', '\x90', '\xA0', '\x8D', ' ', '\xF0', '\x90', '\xA0', '\x99', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB1', ' ', '\xF0', '\x90', '\xA0', '\x85', ' ', '\xF0', '\x90', '\xA0', '\x93', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xA6', /* �?�? �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\xA0', '\x8D', ' ', '\xF0', '\x90', '\xA0', '\x99', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB1', ' ', '\xF0', '\x90', '\xA0', '\x85', ' ', '\xF0', '\x90', '\xA0', '\x93', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xA6', /* �?�? �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\xA0', '\x83', ' ', '\xF0', '\x90', '\xA0', '\x8A', ' ', '\xF0', '\x90', '\xA0', '\x9B', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB5', ' ', '\xF0', '\x90', '\xA0', '\x90', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�? */
+ '\xF0', '\x90', '\xA0', '\x83', ' ', '\xF0', '\x90', '\xA0', '\x8A', ' ', '\xF0', '\x90', '\xA0', '\x9B', ' ', '\xF0', '\x90', '\xA0', '\xA3', ' ', '\xF0', '\x90', '\xA0', '\xB3', ' ', '\xF0', '\x90', '\xA0', '\xB5', ' ', '\xF0', '\x90', '\xA0', '\x90', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�? */
'\0',
- '\xF0', '\x90', '\xA0', '\x88', ' ', '\xF0', '\x90', '\xA0', '\x8F', ' ', '\xF0', '\x90', '\xA0', '\x96', /* �?�� �?�? �?�� */
+ '\xF0', '\x90', '\xA0', '\x88', ' ', '\xF0', '\x90', '\xA0', '\x8F', ' ', '\xF0', '\x90', '\xA0', '\x96', /* �?�� �?�? �?�� */
'\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\x9F', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е П З О С Э */
'\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\xA8', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е Ш З О С Э */
'\0',
- '\xD1', '\x85', ' ', '\xD0', '\xBF', ' ', '\xD0', '\xBD', ' ', '\xD1', '\x88', ' ', '\xD0', '\xB5', ' ', '\xD0', '\xB7', ' ', '\xD0', '\xBE', ' ', '\xD1', '\x81', /* х п н ш е з о �? */
+ '\xD1', '\x85', ' ', '\xD0', '\xBF', ' ', '\xD0', '\xBD', ' ', '\xD1', '\x88', ' ', '\xD0', '\xB5', ' ', '\xD0', '\xB7', ' ', '\xD0', '\xBE', ' ', '\xD1', '\x81', /* х п н ш е з о �? */
'\0',
'\xD1', '\x80', ' ', '\xD1', '\x83', ' ', '\xD1', '\x84', /* р у ф */
'\0',
- '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x8B', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x91', /* �??� �??� �??� �??� �??� */
+ '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x8B', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x91', /* �??� �??� �??� �??� �??� */
'\0',
- '\xF0', '\x90', '\x90', '\x80', ' ', '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x9B', /* �??� �??� �??� �??� �??� */
+ '\xF0', '\x90', '\x90', '\x80', ' ', '\xF0', '\x90', '\x90', '\x82', ' ', '\xF0', '\x90', '\x90', '\x84', ' ', '\xF0', '\x90', '\x90', '\x97', ' ', '\xF0', '\x90', '\x90', '\x9B', /* �??� �??� �??� �??� �??� */
'\0',
- '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xB3', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x90', '\xB9', /* �??� �??� �??� �??� �??� */
+ '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xB3', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x90', '\xB9', /* �??� �??� �??� �??� �??� */
'\0',
- '\xF0', '\x90', '\x90', '\xA8', ' ', '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x91', '\x83', /* �??� �??� �??� �??� �?�� */
+ '\xF0', '\x90', '\x90', '\xA8', ' ', '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x91', '\x83', /* �??� �??� �??� �??� �?�� */
'\0',
'\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xA8', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x89', ' ', '\xE0', '\xA4', '\x9B', ' ', '\xE0', '\xA4', '\x9F', ' ', '\xE0', '\xA4', '\xA0', ' ', '\xE0', '\xA4', '\xA1', /* क न म उ छ ट ठ ड */
'\0',
- '\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई �? ओ औ ि ी ो ौ */
+ '\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई �? ओ औ ि ी ो ौ */
'\0',
'\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
'\0',
- '\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* �? ृ */
+ '\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* �? ृ */
'\0',
- '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\x83', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x8D', '\x90', ' ', '\xE1', '\x88', '\x9B', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x8B', ' ', '\xE1', '\x8B', '\x90', /* ሀ ሃ ዘ �?? ማ በ ዋ �? */
+ '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\x83', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x8D', '\x90', ' ', '\xE1', '\x88', '\x9B', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x8B', ' ', '\xE1', '\x8B', '\x90', /* ሀ ሃ ዘ �?? ማ በ ዋ �? */
'\0',
- '\xE1', '\x88', '\x88', ' ', '\xE1', '\x88', '\x90', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\xAA', ' ', '\xE1', '\x8B', '\x90', ' ', '\xE1', '\x8C', '\xA8', /* ለ �? በ ዘ ሀ ሪ �? ጨ */
+ '\xE1', '\x88', '\x88', ' ', '\xE1', '\x88', '\x90', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\xAA', ' ', '\xE1', '\x8B', '\x90', ' ', '\xE1', '\x8C', '\xA8', /* ለ �? በ ዘ ሀ ሪ �? ጨ */
'\0',
- '\xE1', '\x83', '\x92', ' ', '\xE1', '\x83', '\x93', ' ', '\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x97', ' ', '\xE1', '\x83', '\x98', ' ', '\xE1', '\x83', '\x9D', ' ', '\xE1', '\x83', '\xA6', /* გ დ ე ვ თ ი �? ღ */
+ '\xE1', '\x83', '\x92', ' ', '\xE1', '\x83', '\x93', ' ', '\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x97', ' ', '\xE1', '\x83', '\x98', ' ', '\xE1', '\x83', '\x9D', ' ', '\xE1', '\x83', '\xA6', /* გ დ ე ვ თ ი �? ღ */
'\0',
- '\xE1', '\x83', '\x90', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xAB', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\x9E', /* �? ზ მ ს შ ძ ხ პ */
+ '\xE1', '\x83', '\x90', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xAB', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\x9E', /* �? ზ მ ს შ ძ ხ პ */
'\0',
'\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\xA5', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xA9', ' ', '\xE1', '\x83', '\xAC', /* ს ხ ქ ზ მ შ ჩ წ */
'\0',
@@ -158,17 +158,17 @@
'\0',
'\xE1', '\x82', '\xA4', ' ', '\xE1', '\x82', '\xA5', ' ', '\xE1', '\x82', '\xA7', ' ', '\xE1', '\x82', '\xA8', ' ', '\xE1', '\x82', '\xA6', ' ', '\xE1', '\x82', '\xB1', ' ', '\xE1', '\x82', '\xAA', ' ', '\xE1', '\x82', '\xAB', /* Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ */
'\0',
- '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x97', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x87', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x96', /* �? ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ */
+ '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x97', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x87', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x96', /* �? ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ */
'\0',
'\xE2', '\xB4', '\x88', ' ', '\xE2', '\xB4', '\x8C', ' ', '\xE2', '\xB4', '\x96', ' ', '\xE2', '\xB4', '\x8E', ' ', '\xE2', '\xB4', '\x83', ' ', '\xE2', '\xB4', '\x86', ' ', '\xE2', '\xB4', '\x8B', ' ', '\xE2', '\xB4', '\xA2', /* ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ */
'\0',
- '\xE2', '\xB4', '\x90', ' ', '\xE2', '\xB4', '\x91', ' ', '\xE2', '\xB4', '\x93', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x99', ' ', '\xE2', '\xB4', '\x9B', ' ', '\xE2', '\xB4', '\xA1', ' ', '\xE2', '\xB4', '\xA3', /* �? ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ */
+ '\xE2', '\xB4', '\x90', ' ', '\xE2', '\xB4', '\x91', ' ', '\xE2', '\xB4', '\x93', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x99', ' ', '\xE2', '\xB4', '\x9B', ' ', '\xE2', '\xB4', '\xA1', ' ', '\xE2', '\xB4', '\xA3', /* �? ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ */
'\0',
- '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* ⴄ ⴅ ⴔ ⴕ �? ⴂ ⴘ �? */
+ '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* ⴄ ⴅ ⴔ ⴕ �? ⴂ ⴘ �? */
'\0',
- '\xE1', '\xB2', '\x9C', ' ', '\xE1', '\xB2', '\x9F', ' ', '\xE1', '\xB2', '\xB3', ' ', '\xE1', '\xB2', '\xB8', ' ', '\xE1', '\xB2', '\x92', ' ', '\xE1', '\xB2', '\x94', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xB4', /* Ნ Ჟ Ჳ Ჸ Გ Ე �? Ჴ */
+ '\xE1', '\xB2', '\x9C', ' ', '\xE1', '\xB2', '\x9F', ' ', '\xE1', '\xB2', '\xB3', ' ', '\xE1', '\xB2', '\xB8', ' ', '\xE1', '\xB2', '\x92', ' ', '\xE1', '\xB2', '\x94', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xB4', /* Ნ Ჟ Ჳ Ჸ Გ Ე �? Ჴ */
'\0',
- '\xE1', '\xB2', '\x98', ' ', '\xE1', '\xB2', '\xB2', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xA9', ' ', '\xE1', '\xB2', '\x9B', ' ', '\xE1', '\xB2', '\xA8', ' ', '\xE1', '\xB2', '\xAF', ' ', '\xE1', '\xB2', '\xBD', /* Ი Ჲ �? Ჩ Მ Შ Ჯ Ჽ */
+ '\xE1', '\xB2', '\x98', ' ', '\xE1', '\xB2', '\xB2', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xA9', ' ', '\xE1', '\xB2', '\x9B', ' ', '\xE1', '\xB2', '\xA8', ' ', '\xE1', '\xB2', '\xAF', ' ', '\xE1', '\xB2', '\xBD', /* Ი Ჲ �? Ჩ Მ Შ Ჯ Ჽ */
'\0',
'\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x94', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\xAB', ' ', '\xE2', '\xB0', '\x8B', /* Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ */
'\0',
@@ -178,9 +178,9 @@
'\0',
'\xE2', '\xB0', '\xB5', ' ', '\xE2', '\xB0', '\xB4', ' ', '\xE2', '\xB0', '\xB2', ' ', '\xE2', '\xB1', '\x9A', ' ', '\xE2', '\xB1', '\x8E', ' ', '\xE2', '\xB1', '\x91', ' ', '\xE2', '\xB0', '\xBA', ' ', '\xE2', '\xB1', '\x84', /* ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ */
'\0',
- '\xF0', '\x90', '\x8C', '\xB2', ' ', '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8D', '\x80', ' ', '\xF0', '\x90', '\x8D', '\x84', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', ' ', '\xF0', '\x90', '\x8C', '\xBE', /* �?�� �?�� �??� �??� �?�� �??� �??� �?�� */
+ '\xF0', '\x90', '\x8C', '\xB2', ' ', '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8D', '\x80', ' ', '\xF0', '\x90', '\x8D', '\x84', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', ' ', '\xF0', '\x90', '\x8C', '\xBE', /* �?�� �?�� �??� �??� �?�� �??� �??� �?�� */
'\0',
- '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', /* �?�� �?�� �??� �??� */
+ '\xF0', '\x90', '\x8C', '\xB6', ' ', '\xF0', '\x90', '\x8C', '\xB4', ' ', '\xF0', '\x90', '\x8D', '\x83', ' ', '\xF0', '\x90', '\x8D', '\x88', /* �?�� �?�� �??� �??� */
'\0',
'\xCE', '\x93', ' ', '\xCE', '\x92', ' ', '\xCE', '\x95', ' ', '\xCE', '\x96', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', ' ', '\xCE', '\xA9', /* Γ Β Ε Ζ Θ Ο Ω */
'\0',
@@ -190,15 +190,15 @@
'\0',
'\xCE', '\xB1', ' ', '\xCE', '\xB5', ' ', '\xCE', '\xB9', ' ', '\xCE', '\xBF', ' ', '\xCF', '\x80', ' ', '\xCF', '\x83', ' ', '\xCF', '\x84', ' ', '\xCF', '\x89', /* α ε ι ο π σ τ ω */
'\0',
- '\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ �? φ χ ψ */
+ '\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ �? φ χ ψ */
'\0',
'\xE0', '\xAA', '\xA4', ' ', '\xE0', '\xAA', '\xA8', ' ', '\xE0', '\xAA', '\x8B', ' ', '\xE0', '\xAA', '\x8C', ' ', '\xE0', '\xAA', '\x9B', ' ', '\xE0', '\xAA', '\x9F', ' ', '\xE0', '\xAA', '\xB0', ' ', '\xE0', '\xAB', '\xA6', /* ત ન ઋ ઌ છ ટ ર ૦ */
'\0',
'\xE0', '\xAA', '\x96', ' ', '\xE0', '\xAA', '\x97', ' ', '\xE0', '\xAA', '\x98', ' ', '\xE0', '\xAA', '\x9E', ' ', '\xE0', '\xAA', '\x87', ' ', '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\xA0', ' ', '\xE0', '\xAA', '\x9C', /* ખ ગ ઘ ઞ ઇ ઈ ઠ જ */
'\0',
- '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\x8A', ' ', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB2', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB6', '\xE0', '\xAB', '\x8D', '\xE0', '\xAA', '\x9A', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\x9C', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\xB8', '\xE0', '\xAB', '\x80', /* ઈ ઊ િ ી લી શ�?ચિ જિ સી */
+ '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\x8A', ' ', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB2', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB6', '\xE0', '\xAB', '\x8D', '\xE0', '\xAA', '\x9A', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\x9C', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\xB8', '\xE0', '\xAB', '\x80', /* ઈ ઊ િ ી લી શ�?ચિ જિ સી */
'\0',
- '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAB', '\x84', ' ', '\xE0', '\xAA', '\x96', '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x84', /* �? ૃ ૄ ખ�? છૃ છૄ */
+ '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAB', '\x84', ' ', '\xE0', '\xAA', '\x96', '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x84', /* �? ૃ ૄ ખ�? છૃ છૄ */
'\0',
'\xE0', '\xAB', '\xA6', ' ', '\xE0', '\xAB', '\xA7', ' ', '\xE0', '\xAB', '\xA8', ' ', '\xE0', '\xAB', '\xA9', ' ', '\xE0', '\xAB', '\xAD', /* ૦ ૧ ૨ ૩ ૭ */
'\0',
@@ -206,25 +206,25 @@
'\0',
'\xE0', '\xA8', '\x95', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x99', ' ', '\xE0', '\xA8', '\x9A', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA4', ' ', '\xE0', '\xA8', '\xA7', ' ', '\xE0', '\xA8', '\xB8', /* ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ */
'\0',
- '\xE0', '\xA8', '\x87', ' ', '\xE0', '\xA8', '\x88', ' ', '\xE0', '\xA8', '\x89', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA9', '\xB3', ' ', '\xE0', '\xA8', '\xBF', ' ', '\xE0', '\xA9', '\x80', /* ਇ ਈ ਉ �? ਓ ੳ ਿ ੀ */
+ '\xE0', '\xA8', '\x87', ' ', '\xE0', '\xA8', '\x88', ' ', '\xE0', '\xA8', '\x89', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA9', '\xB3', ' ', '\xE0', '\xA8', '\xBF', ' ', '\xE0', '\xA9', '\x80', /* ਇ ਈ ਉ �? ਓ ੳ ਿ ੀ */
'\0',
- '\xE0', '\xA8', '\x85', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA0', ' ', '\xE0', '\xA8', '\xB0', ' ', '\xE0', '\xA8', '\xB8', /* ਅ �? ਓ ਗ ਜ ਠ ਰ ਸ */
+ '\xE0', '\xA8', '\x85', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA0', ' ', '\xE0', '\xA8', '\xB0', ' ', '\xE0', '\xA8', '\xB8', /* ਅ �? ਓ ਗ ਜ ਠ ਰ ਸ */
'\0',
'\xE0', '\xA9', '\xA6', ' ', '\xE0', '\xA9', '\xA7', ' ', '\xE0', '\xA9', '\xA8', ' ', '\xE0', '\xA9', '\xA9', ' ', '\xE0', '\xA9', '\xAD', /* ੦ ੧ ੨ ੩ ੭ */
'\0',
- '\xD7', '\x91', ' ', '\xD7', '\x93', ' ', '\xD7', '\x94', ' ', '\xD7', '\x97', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', /* ב ד ה ח ך כ �? ס */
+ '\xD7', '\x91', ' ', '\xD7', '\x93', ' ', '\xD7', '\x94', ' ', '\xD7', '\x97', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', /* ב ד ה ח ך כ �? ס */
'\0',
- '\xD7', '\x91', ' ', '\xD7', '\x98', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', ' ', '\xD7', '\xA6', /* ב ט כ �? ס צ */
+ '\xD7', '\x91', ' ', '\xD7', '\x98', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', ' ', '\xD7', '\xA6', /* ב ט כ �? ס צ */
'\0',
'\xD7', '\xA7', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9F', ' ', '\xD7', '\xA3', ' ', '\xD7', '\xA5', /* ק ך ן ף ץ */
'\0',
- '\xE0', '\xB2', '\x87', ' ', '\xE0', '\xB2', '\x8A', ' ', '\xE0', '\xB2', '\x90', ' ', '\xE0', '\xB2', '\xA3', ' ', '\xE0', '\xB2', '\xB8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA6', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xB0', '\xE0', '\xB2', '\xBE', /* ಇ ಊ �? ಣ ಸಾ ನಾ ದಾ ರಾ */
+ '\xE0', '\xB2', '\x87', ' ', '\xE0', '\xB2', '\x8A', ' ', '\xE0', '\xB2', '\x90', ' ', '\xE0', '\xB2', '\xA3', ' ', '\xE0', '\xB2', '\xB8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA6', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xB0', '\xE0', '\xB2', '\xBE', /* ಇ ಊ �? ಣ ಸಾ ನಾ ದಾ ರಾ */
'\0',
'\xE0', '\xB2', '\x85', ' ', '\xE0', '\xB2', '\x89', ' ', '\xE0', '\xB2', '\x8E', ' ', '\xE0', '\xB2', '\xB2', ' ', '\xE0', '\xB3', '\xA6', ' ', '\xE0', '\xB3', '\xA8', ' ', '\xE0', '\xB3', '\xAC', ' ', '\xE0', '\xB3', '\xAD', /* ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭ */
'\0',
- '\xEA', '\xA4', '\x85', ' ', '\xEA', '\xA4', '\x8F', ' ', '\xEA', '\xA4', '\x81', ' ', '\xEA', '\xA4', '\x8B', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', /* ꤅ �? �? ꤋ ꤀ �? */
+ '\xEA', '\xA4', '\x85', ' ', '\xEA', '\xA4', '\x8F', ' ', '\xEA', '\xA4', '\x81', ' ', '\xEA', '\xA4', '\x8B', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', /* ꤅ �? �? ꤋ ꤀ �? */
'\0',
- '\xEA', '\xA4', '\x88', ' ', '\xEA', '\xA4', '\x98', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', ' ', '\xEA', '\xA4', '\xA2', /* ꤈ ꤘ ꤀ �? ꤢ */
+ '\xEA', '\xA4', '\x88', ' ', '\xEA', '\xA4', '\x98', ' ', '\xEA', '\xA4', '\x80', ' ', '\xEA', '\xA4', '\x8D', ' ', '\xEA', '\xA4', '\xA2', /* ꤈ ꤘ ꤀ �? ꤢ */
'\0',
'\xEA', '\xA4', '\x96', ' ', '\xEA', '\xA4', '\xA1', /* ꤖ ꤡ */
'\0',
@@ -232,15 +232,15 @@
'\0',
'\xEA', '\xA4', '\x91', '\xEA', '\xA4', '\xAC', ' ', '\xEA', '\xA4', '\x9C', '\xEA', '\xA4', '\xAD', ' ', '\xEA', '\xA4', '\x94', '\xEA', '\xA4', '\xAC', /* ꤑ꤬ ꤜ꤭ ꤔ꤬ */
'\0',
- '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x91', ' ', '\xE1', '\x9E', '\x93', ' ', '\xE1', '\x9E', '\xA7', ' ', '\xE1', '\x9E', '\xA9', ' ', '\xE1', '\x9E', '\xB6', /* �? ទ ន ឧ ឩ ា */
+ '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x91', ' ', '\xE1', '\x9E', '\x93', ' ', '\xE1', '\x9E', '\xA7', ' ', '\xE1', '\x9E', '\xA9', ' ', '\xE1', '\x9E', '\xB6', /* �? ទ ន ឧ ឩ ា */
'\0',
- '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x80', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x82', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x90', /* ក្ក ក្�? ក្គ ក្�? */
+ '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x80', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x82', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x90', /* ក្ក ក្�? ក្គ ក្�? */
'\0',
- '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x83', ' ', '\xE1', '\x9E', '\x85', ' ', '\xE1', '\x9E', '\x8B', ' ', '\xE1', '\x9E', '\x94', ' ', '\xE1', '\x9E', '\x98', ' ', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xB2', /* �? ឃ ច ឋ ប ម យ ឲ */
+ '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x83', ' ', '\xE1', '\x9E', '\x85', ' ', '\xE1', '\x9E', '\x8B', ' ', '\xE1', '\x9E', '\x94', ' ', '\xE1', '\x9E', '\x98', ' ', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xB2', /* �? ឃ ច ឋ ប ម យ ឲ */
'\0',
- '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', ' ', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\xB2', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xA2', '\xE1', '\x9E', '\xBF', /* �?្រ រៀ ឲ្យ អឿ */
+ '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', ' ', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\xB2', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xA2', '\xE1', '\x9E', '\xBF', /* �?្រ រៀ ឲ្យ អឿ */
'\0',
- '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x83', ' ', '\xE1', '\x9E', '\x84', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x85', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9E', '\xBF', ' ', '\xE1', '\x9E', '\x9B', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9E', '\xBF', /* ន្�?្រៃ ង្�?្យ ក្បៀ ច្រៀ ន្�?ឿ ល្បឿ */
+ '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x83', ' ', '\xE1', '\x9E', '\x84', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x85', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9E', '\xBF', ' ', '\xE1', '\x9E', '\x9B', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9E', '\xBF', /* ន្�?្រៃ ង្�?្យ ក្បៀ ច្រៀ ន្�?ឿ ល្បឿ */
'\0',
'\xE1', '\xA7', '\xA0', ' ', '\xE1', '\xA7', '\xA1', /* ᧠ ᧡ */
'\0',
@@ -248,9 +248,9 @@
'\0',
'\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\x94', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\xA1', ' ', '\xE0', '\xBA', '\xA5', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */
'\0',
- '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\x9A', ' ', '\xE0', '\xBA', '\x8D', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\xAE', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA2', /* າ ອ ບ �? ຣ ຮ ວ ຢ */
+ '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\x9A', ' ', '\xE0', '\xBA', '\x8D', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\xAE', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA2', /* າ ອ ບ �? ຣ ຮ ວ ຢ */
'\0',
- '\xE0', '\xBA', '\x9B', ' ', '\xE0', '\xBA', '\xA2', ' ', '\xE0', '\xBA', '\x9F', ' ', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ �? */
+ '\xE0', '\xBA', '\x9B', ' ', '\xE0', '\xBA', '\xA2', ' ', '\xE0', '\xBA', '\x9F', ' ', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ �? */
'\0',
'\xE0', '\xBB', '\x82', ' ', '\xE0', '\xBB', '\x84', ' ', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */
'\0',
@@ -270,35 +270,35 @@
'\0',
'\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x85', ' ', '\xE2', '\x82', '\x87', ' ', '\xE2', '\x82', '\x88', /* ₀ ₃ ₅ ₇ ₈ */
'\0',
- '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x81', ' ', '\xE2', '\x82', '\x82', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x88', /* ₀ �? ₂ ₃ ₈ */
+ '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x81', ' ', '\xE2', '\x82', '\x82', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x88', /* ₀ �? ₂ ₃ ₈ */
'\0',
'\xE1', '\xB5', '\xA2', ' ', '\xE2', '\xB1', '\xBC', ' ', '\xE2', '\x82', '\x95', ' ', '\xE2', '\x82', '\x96', ' ', '\xE2', '\x82', '\x97', /* ᵢ ⱼ ₕ ₖ ₗ */
'\0',
- '\xE2', '\x82', '\x90', ' ', '\xE2', '\x82', '\x91', ' ', '\xE2', '\x82', '\x92', ' ', '\xE2', '\x82', '\x93', ' ', '\xE2', '\x82', '\x99', ' ', '\xE2', '\x82', '\x9B', ' ', '\xE1', '\xB5', '\xA5', ' ', '\xE1', '\xB5', '\xA4', ' ', '\xE1', '\xB5', '\xA3', /* �? ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ */
+ '\xE2', '\x82', '\x90', ' ', '\xE2', '\x82', '\x91', ' ', '\xE2', '\x82', '\x92', ' ', '\xE2', '\x82', '\x93', ' ', '\xE2', '\x82', '\x99', ' ', '\xE2', '\x82', '\x9B', ' ', '\xE1', '\xB5', '\xA5', ' ', '\xE1', '\xB5', '\xA4', ' ', '\xE1', '\xB5', '\xA3', /* �? ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ */
'\0',
'\xE1', '\xB5', '\xA6', ' ', '\xE1', '\xB5', '\xA7', ' ', '\xE1', '\xB5', '\xA8', ' ', '\xE1', '\xB5', '\xA9', ' ', '\xE2', '\x82', '\x9A', /* ᵦ ᵧ ᵨ ᵩ ₚ */
'\0',
- '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB3', ' ', '\xE2', '\x81', '\xB5', ' ', '\xE2', '\x81', '\xB7', ' ', '\xE1', '\xB5', '\x80', ' ', '\xE1', '\xB4', '\xB4', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xBC', /* �?� ³ �?� �?� ᵀ ᴴ ᴱ ᴼ */
+ '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB3', ' ', '\xE2', '\x81', '\xB5', ' ', '\xE2', '\x81', '\xB7', ' ', '\xE1', '\xB5', '\x80', ' ', '\xE1', '\xB4', '\xB4', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xBC', /* �?� ³ �?� �?� ᵀ ᴴ ᴱ ᴼ */
'\0',
- '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB9', ' ', '\xC2', '\xB2', ' ', '\xC2', '\xB3', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xB8', ' ', '\xE1', '\xB4', '\xBC', ' ', '\xE1', '\xB5', '\x81', /* �?� ¹ ² ³ ᴱ ᴸ ᴼ �? */
+ '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB9', ' ', '\xC2', '\xB2', ' ', '\xC2', '\xB3', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xB8', ' ', '\xE1', '\xB4', '\xBC', ' ', '\xE1', '\xB5', '\x81', /* �?� ¹ ² ³ ᴱ ᴸ ᴼ �? */
'\0',
- '\xE1', '\xB5', '\x87', ' ', '\xE1', '\xB5', '\x88', ' ', '\xE1', '\xB5', '\x8F', ' ', '\xCA', '\xB0', ' ', '\xCA', '\xB2', ' ', '\xE1', '\xB6', '\xA0', ' ', '\xE2', '\x81', '\xB1', /* ᵇ ᵈ �? ʰ ʲ ᶠ �?� */
+ '\xE1', '\xB5', '\x87', ' ', '\xE1', '\xB5', '\x88', ' ', '\xE1', '\xB5', '\x8F', ' ', '\xCA', '\xB0', ' ', '\xCA', '\xB2', ' ', '\xE1', '\xB6', '\xA0', ' ', '\xE2', '\x81', '\xB1', /* ᵇ ᵈ �? ʰ ʲ ᶠ �?� */
'\0',
'\xE1', '\xB5', '\x89', ' ', '\xE1', '\xB5', '\x92', ' ', '\xCA', '\xB3', ' ', '\xCB', '\xA2', ' ', '\xCB', '\xA3', ' ', '\xE1', '\xB6', '\x9C', ' ', '\xE1', '\xB6', '\xBB', /* ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ */
'\0',
- '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ �? */
+ '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ �? */
'\0',
'\xEA', '\x93', '\xA1', ' ', '\xEA', '\x93', '\xA7', ' ', '\xEA', '\x93', '\xB1', ' ', '\xEA', '\x93', '\xB6', ' ', '\xEA', '\x93', '\xA9', ' ', '\xEA', '\x93', '\x9A', ' ', '\xEA', '\x93', '\xB5', ' ', '\xEA', '\x93', '\xB3', /* ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ */
'\0',
'\xEA', '\x93', '\x95', ' ', '\xEA', '\x93', '\x9C', ' ', '\xEA', '\x93', '\x9E', ' ', '\xEA', '\x93', '\xA1', ' ', '\xEA', '\x93', '\x9B', ' ', '\xEA', '\x93', '\xA2', ' ', '\xEA', '\x93', '\xB3', ' ', '\xEA', '\x93', '\xB4', /* ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ */
'\0',
- '\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA', /* ഒ ട ഠ റ ച പ ച�?ച പ�?പ */
+ '\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA', /* ഒ ട ഠ റ ച പ ച�?ച പ�?പ */
'\0',
'\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* ട ഠ ധ ശ ഘ ച ഥ ല */
'\0',
- '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x9F', /* 𖹀 �? 𖹂 𖹃 �? 𖹚 𖹟 */
+ '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x9F', /* 𖹀 �? 𖹂 𖹃 �? 𖹚 𖹟 */
'\0',
- '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x92', ' ', '\xF0', '\x96', '\xB9', '\x93', /* 𖹀 �? 𖹂 𖹃 �? 𖹚 𖹒 𖹓 */
+ '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x92', ' ', '\xF0', '\x96', '\xB9', '\x93', /* 𖹀 �? 𖹂 𖹃 �? 𖹚 𖹒 𖹓 */
'\0',
'\xF0', '\x96', '\xB9', '\xA4', ' ', '\xF0', '\x96', '\xB9', '\xAC', ' ', '\xF0', '\x96', '\xB9', '\xA7', ' ', '\xF0', '\x96', '\xB9', '\xB4', ' ', '\xF0', '\x96', '\xB9', '\xB6', ' ', '\xF0', '\x96', '\xB9', '\xBE', /* 𖹤 𖹬 𖹧 𖹴 𖹶 𖹾 */
'\0',
@@ -308,75 +308,75 @@
'\0',
'\xF0', '\x96', '\xB9', '\xA5', ' ', '\xF0', '\x96', '\xB9', '\xA8', ' ', '\xF0', '\x96', '\xB9', '\xA9', /* 𖹥 𖹨 𖹩 */
'\0',
- '\xF0', '\x96', '\xBA', '\x80', ' ', '\xF0', '\x96', '\xBA', '\x85', ' ', '\xF0', '\x96', '\xBA', '\x88', ' ', '\xF0', '\x96', '\xBA', '\x84', ' ', '\xF0', '\x96', '\xBA', '\x8D', /* 𖺀 𖺅 𖺈 𖺄 �? */
+ '\xF0', '\x96', '\xBA', '\x80', ' ', '\xF0', '\x96', '\xBA', '\x85', ' ', '\xF0', '\x96', '\xBA', '\x88', ' ', '\xF0', '\x96', '\xBA', '\x84', ' ', '\xF0', '\x96', '\xBA', '\x8D', /* 𖺀 𖺅 𖺈 𖺄 �? */
'\0',
- '\xE1', '\xA0', '\xB3', ' ', '\xE1', '\xA0', '\xB4', ' ', '\xE1', '\xA0', '\xB6', ' ', '\xE1', '\xA0', '\xBD', ' ', '\xE1', '\xA1', '\x82', ' ', '\xE1', '\xA1', '\x8A', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xA1', '\xE2', '\x80', '\x8D', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xB3', '\xE2', '\x80', '\x8D', /* ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ �?ᡡ�? �?ᡳ�? */
+ '\xE1', '\xA0', '\xB3', ' ', '\xE1', '\xA0', '\xB4', ' ', '\xE1', '\xA0', '\xB6', ' ', '\xE1', '\xA0', '\xBD', ' ', '\xE1', '\xA1', '\x82', ' ', '\xE1', '\xA1', '\x8A', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xA1', '\xE2', '\x80', '\x8D', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xB3', '\xE2', '\x80', '\x8D', /* ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ �?ᡡ�? �?ᡳ�? */
'\0',
'\xE1', '\xA1', '\x83', /* ᡃ */
'\0',
- '\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* �? ဂ င ဒ �? �?� �?� �?� */
+ '\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* �? ဂ င ဒ �? �?� �?� �?� */
'\0',
- '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* င ဎ ဒ ပ ဗ �? �?� �?� */
+ '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* င ဎ ဒ ပ ဗ �? �?� �?� */
'\0',
- '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xBC', ' ', '\xE1', '\x81', '\x8D', ' ', '\xE1', '\x81', '\x8F', ' ', '\xE1', '\x81', '\x86', ' ', '\xE1', '\x80', '\xAB', ' ', '\xE1', '\x80', '\xAD', /* ဩ ြ �?? �?? �?� ါ ိ */
+ '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xBC', ' ', '\xE1', '\x81', '\x8D', ' ', '\xE1', '\x81', '\x8F', ' ', '\xE1', '\x81', '\x86', ' ', '\xE1', '\x80', '\xAB', ' ', '\xE1', '\x80', '\xAD', /* ဩ ြ �?? �?? �?� ါ ိ */
'\0',
- '\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89', /* ဉ ည ဥ ဩ ဨ �?� �?� �?� */
+ '\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89', /* ဉ ည ဥ ဩ ဨ �?� �?� �?� */
'\0',
- '\xDF', '\x90', ' ', '\xDF', '\x89', ' ', '\xDF', '\x92', ' ', '\xDF', '\x9F', ' ', '\xDF', '\x96', ' ', '\xDF', '\x9C', ' ', '\xDF', '\xA0', ' ', '\xDF', '\xA5', /* �? ߉ ߒ ߟ ߖ ߜ ߠ ߥ */
+ '\xDF', '\x90', ' ', '\xDF', '\x89', ' ', '\xDF', '\x92', ' ', '\xDF', '\x9F', ' ', '\xDF', '\x96', ' ', '\xDF', '\x9C', ' ', '\xDF', '\xA0', ' ', '\xDF', '\xA5', /* �? ߉ ߒ ߟ ߖ ߜ ߠ ߥ */
'\0',
'\xDF', '\x80', ' ', '\xDF', '\x98', ' ', '\xDF', '\xA1', ' ', '\xDF', '\xA0', ' ', '\xDF', '\xA5', /* ߀ ߘ ߡ ߠ ߥ */
'\0',
- '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* �? ߛ ߋ */
+ '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* �? ߛ ߋ */
'\0',
- '\xDF', '\x8E', ' ', '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* ߎ �? ߛ ߋ */
+ '\xDF', '\x8E', ' ', '\xDF', '\x8F', ' ', '\xDF', '\x9B', ' ', '\xDF', '\x8B', /* ߎ �? ߛ ߋ */
'\0',
- '\xE1', '\xB1', '\x9B', ' ', '\xE1', '\xB1', '\x9C', ' ', '\xE1', '\xB1', '\x9D', ' ', '\xE1', '\xB1', '\xA1', ' ', '\xE1', '\xB1', '\xA2', ' ', '\xE1', '\xB1', '\xA5', /* ᱛ ᱜ �? ᱡ ᱢ ᱥ */
+ '\xE1', '\xB1', '\x9B', ' ', '\xE1', '\xB1', '\x9C', ' ', '\xE1', '\xB1', '\x9D', ' ', '\xE1', '\xB1', '\xA1', ' ', '\xE1', '\xB1', '\xA2', ' ', '\xE1', '\xB1', '\xA5', /* ᱛ ᱜ �? ᱡ ᱢ ᱥ */
'\0',
- '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\x98', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* �?�� �?�� �?�� */
+ '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\x98', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\xB0', '\x89', ' ', '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\xA6', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\xB0', '\x89', ' ', '\xF0', '\x90', '\xB0', '\x97', ' ', '\xF0', '\x90', '\xB0', '\xA6', ' ', '\xF0', '\x90', '\xB0', '\xA7', /* �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x92', '\xBE', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x92', ' ', '\xF0', '\x90', '\x93', '\x93', ' ', '\xF0', '\x90', '\x92', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xB5', ' ', '\xF0', '\x90', '\x93', '\x86', /* �?�� �?�? �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x92', '\xBE', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x92', ' ', '\xF0', '\x90', '\x93', '\x93', ' ', '\xF0', '\x90', '\x92', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xB5', ' ', '\xF0', '\x90', '\x93', '\x86', /* �?�� �?�? �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x92', '\xB0', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xBF', ' ', '\xF0', '\x90', '\x93', '\x8E', ' ', '\xF0', '\x90', '\x92', '\xB9', /* �?�� �?�? �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x92', '\xB0', ' ', '\xF0', '\x90', '\x93', '\x8D', ' ', '\xF0', '\x90', '\x93', '\x82', ' ', '\xF0', '\x90', '\x92', '\xBF', ' ', '\xF0', '\x90', '\x93', '\x8E', ' ', '\xF0', '\x90', '\x92', '\xB9', /* �?�� �?�? �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x92', '\xBC', ' ', '\xF0', '\x90', '\x92', '\xBD', ' ', '\xF0', '\x90', '\x92', '\xBE', /* �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x92', '\xBC', ' ', '\xF0', '\x90', '\x92', '\xBD', ' ', '\xF0', '\x90', '\x92', '\xBE', /* �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xB6', ' ', '\xF0', '\x90', '\x93', '\xBA', ' ', '\xF0', '\x90', '\x93', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x9D', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xAE', /* �?�� �?�� �?�� �?�� �?�? �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xB6', ' ', '\xF0', '\x90', '\x93', '\xBA', ' ', '\xF0', '\x90', '\x93', '\xBB', ' ', '\xF0', '\x90', '\x93', '\x9D', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xAE', /* �?�� �?�� �?�� �?�� �?�? �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x93', '\x98', ' ', '\xF0', '\x90', '\x93', '\x9A', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xA1', ' ', '\xF0', '\x90', '\x93', '\xA7', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xB6', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x93', '\x98', ' ', '\xF0', '\x90', '\x93', '\x9A', ' ', '\xF0', '\x90', '\x93', '\xA3', ' ', '\xF0', '\x90', '\x93', '\xB5', ' ', '\xF0', '\x90', '\x93', '\xA1', ' ', '\xF0', '\x90', '\x93', '\xA7', ' ', '\xF0', '\x90', '\x93', '\xAA', ' ', '\xF0', '\x90', '\x93', '\xB6', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA6', ' ', '\xF0', '\x90', '\x93', '\xB8', ' ', '\xF0', '\x90', '\x93', '\xB9', ' ', '\xF0', '\x90', '\x93', '\x9B', /* �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA6', ' ', '\xF0', '\x90', '\x93', '\xB8', ' ', '\xF0', '\x90', '\x93', '\xB9', ' ', '\xF0', '\x90', '\x93', '\x9B', /* �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA5', ' ', '\xF0', '\x90', '\x93', '\xA6', /* �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x93', '\xA4', ' ', '\xF0', '\x90', '\x93', '\xA5', ' ', '\xF0', '\x90', '\x93', '\xA6', /* �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x89', ' ', '\xF0', '\x90', '\x92', '\x90', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\x98', ' ', '\xF0', '\x90', '\x92', '\x9B', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA3', /* �?�� �?�� �?�? �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x89', ' ', '\xF0', '\x90', '\x92', '\x90', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\x98', ' ', '\xF0', '\x90', '\x92', '\x9B', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA3', /* �?�� �?�� �?�? �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x92', '\x80', ' ', '\xF0', '\x90', '\x92', '\x82', ' ', '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x88', ' ', '\xF0', '\x90', '\x92', '\x8A', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA9', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x92', '\x80', ' ', '\xF0', '\x90', '\x92', '\x82', ' ', '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x88', ' ', '\xF0', '\x90', '\x92', '\x8A', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA9', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\xB4', '\x83', ' ', '\xF0', '\x90', '\xB4', '\x80', ' ', '\xF0', '\x90', '\xB4', '\x86', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', /* �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\xB4', '\x83', ' ', '\xF0', '\x90', '\xB4', '\x80', ' ', '\xF0', '\x90', '\xB4', '\x86', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', /* �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\xB4', '\x94', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', ' ', '\xF0', '\x90', '\xB4', '\x91', ' ', '\xF0', '\x90', '\xB4', '\x90', /* �?�� �?�� �?�� �?�� �?�? */
+ '\xF0', '\x90', '\xB4', '\x94', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', ' ', '\xF0', '\x90', '\xB4', '\x91', ' ', '\xF0', '\x90', '\xB4', '\x90', /* �?�� �?�� �?�� �?�� �?�? */
'\0',
'\xD9', '\x80', /* ـ */
'\0',
- '\xEA', '\xA2', '\x9C', ' ', '\xEA', '\xA2', '\x9E', ' ', '\xEA', '\xA2', '\xB3', ' ', '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\x96', ' ', '\xEA', '\xA2', '\x92', ' ', '\xEA', '\xA2', '\x9D', ' ', '\xEA', '\xA2', '\x9B', /* ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ �? ꢛ */
+ '\xEA', '\xA2', '\x9C', ' ', '\xEA', '\xA2', '\x9E', ' ', '\xEA', '\xA2', '\xB3', ' ', '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\x96', ' ', '\xEA', '\xA2', '\x92', ' ', '\xEA', '\xA2', '\x9D', ' ', '\xEA', '\xA2', '\x9B', /* ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ �? ꢛ */
'\0',
'\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\xA8', ' ', '\xEA', '\xA2', '\xBA', ' ', '\xEA', '\xA2', '\xA4', ' ', '\xEA', '\xA2', '\x8E', /* ꢂ ꢨ ꢺ ꢤ ꢎ */
'\0',
- '\xF0', '\x90', '\x91', '\x95', ' ', '\xF0', '\x90', '\x91', '\x99', /* �?�� �?�� */
+ '\xF0', '\x90', '\x91', '\x95', ' ', '\xF0', '\x90', '\x91', '\x99', /* �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x91', '\x94', ' ', '\xF0', '\x90', '\x91', '\x96', ' ', '\xF0', '\x90', '\x91', '\x97', ' ', '\xF0', '\x90', '\x91', '\xB9', ' ', '\xF0', '\x90', '\x91', '\xBB', /* �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x91', '\x94', ' ', '\xF0', '\x90', '\x91', '\x96', ' ', '\xF0', '\x90', '\x91', '\x97', ' ', '\xF0', '\x90', '\x91', '\xB9', ' ', '\xF0', '\x90', '\x91', '\xBB', /* �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x91', '\x9F', ' ', '\xF0', '\x90', '\x91', '\xA3', /* �?�� �?�� */
+ '\xF0', '\x90', '\x91', '\x9F', ' ', '\xF0', '\x90', '\x91', '\xA3', /* �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x91', '\xB1', ' ', '\xF0', '\x90', '\x91', '\xB2', ' ', '\xF0', '\x90', '\x91', '\xB3', ' ', '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xB8', ' ', '\xF0', '\x90', '\x91', '\xBA', ' ', '\xF0', '\x90', '\x91', '\xBC', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x91', '\xB1', ' ', '\xF0', '\x90', '\x91', '\xB2', ' ', '\xF0', '\x90', '\x91', '\xB3', ' ', '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xB8', ' ', '\xF0', '\x90', '\x91', '\xBA', ' ', '\xF0', '\x90', '\x91', '\xBC', /* �?�� �?�� �?�� �?�� �?�� �?�� �?�� */
'\0',
- '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xBB', ' ', '\xF0', '\x90', '\x91', '\xB9', /* �?�� �?�� �?�� */
+ '\xF0', '\x90', '\x91', '\xB4', ' ', '\xF0', '\x90', '\x91', '\xBB', ' ', '\xF0', '\x90', '\x91', '\xB9', /* �?�� �?�� �?�� */
'\0',
- '\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86', /* ඉ ක �? ඳ ප ය ල ෆ */
+ '\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86', /* ඉ ක �? ඳ ප ය ල ෆ */
'\0',
- '\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB', /* එ ඔ �? ජ ට ථ ධ ර */
+ '\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB', /* එ ඔ �? ජ ට ථ ධ ර */
'\0',
'\xE0', '\xB6', '\xAF', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\x8B', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x96', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xB6', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xAF', '\xE0', '\xB7', '\x94', /* ද ඳ උ ල තූ තු බු දු */
'\0',
@@ -398,62 +398,62 @@
'\0',
'\xE0', '\xB0', '\x85', ' ', '\xE0', '\xB0', '\x95', ' ', '\xE0', '\xB0', '\x9A', ' ', '\xE0', '\xB0', '\xB0', ' ', '\xE0', '\xB0', '\xBD', ' ', '\xE0', '\xB1', '\xA8', ' ', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */
'\0',
- '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB9', '\x80', ' ', '\xE0', '\xB9', '\x81', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\x81', ' ', '\xE0', '\xB8', '\xB2', /* บ เ �? อ �? า */
+ '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB9', '\x80', ' ', '\xE0', '\xB9', '\x81', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\x81', ' ', '\xE0', '\xB8', '\xB2', /* บ เ �? อ �? า */
'\0',
'\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\xA9', ' ', '\xE0', '\xB8', '\xAF', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\xA2', ' ', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */
'\0',
- '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\x9D', ' ', '\xE0', '\xB8', '\x9F', /* ป �? ฟ */
+ '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\x9D', ' ', '\xE0', '\xB8', '\x9F', /* ป �? ฟ */
'\0',
'\xE0', '\xB9', '\x82', ' ', '\xE0', '\xB9', '\x83', ' ', '\xE0', '\xB9', '\x84', /* โ ใ ไ */
'\0',
- '\xE0', '\xB8', '\x8E', ' ', '\xE0', '\xB8', '\x8F', ' ', '\xE0', '\xB8', '\xA4', ' ', '\xE0', '\xB8', '\xA6', /* ฎ �? ฤ ฦ */
+ '\xE0', '\xB8', '\x8E', ' ', '\xE0', '\xB8', '\x8F', ' ', '\xE0', '\xB8', '\xA4', ' ', '\xE0', '\xB8', '\xA6', /* ฎ �? ฤ ฦ */
'\0',
- '\xE0', '\xB8', '\x8D', ' ', '\xE0', '\xB8', '\x90', /* �? �? */
+ '\xE0', '\xB8', '\x8D', ' ', '\xE0', '\xB8', '\x90', /* �? �? */
'\0',
- '\xE0', '\xB9', '\x90', ' ', '\xE0', '\xB9', '\x91', ' ', '\xE0', '\xB9', '\x93', /* �? ๑ ๓ */
+ '\xE0', '\xB9', '\x90', ' ', '\xE0', '\xB9', '\x91', ' ', '\xE0', '\xB9', '\x93', /* �? ๑ ๓ */
'\0',
'\xE2', '\xB5', '\x94', ' ', '\xE2', '\xB5', '\x99', ' ', '\xE2', '\xB5', '\x9B', ' ', '\xE2', '\xB5', '\x9E', ' ', '\xE2', '\xB4', '\xB5', ' ', '\xE2', '\xB4', '\xBC', ' ', '\xE2', '\xB4', '\xB9', ' ', '\xE2', '\xB5', '\x8E', /* ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ */
'\0',
- '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x98', '\x9C', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x96', '\x9D', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', /* �? ꘖ ꘙ ꘜ ꖜ �? ꔅ ꕢ */
+ '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x98', '\x9C', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x96', '\x9D', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', /* �? ꘖ ꘙ ꘜ ꖜ �? ꔅ ꕢ */
'\0',
- '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x97', '\x9E', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x94', '\x86', /* �? ꘖ ꘙ ꗞ ꔅ ꕢ ꖜ ꔆ */
+ '\xEA', '\x97', '\x8D', ' ', '\xEA', '\x98', '\x96', ' ', '\xEA', '\x98', '\x99', ' ', '\xEA', '\x97', '\x9E', ' ', '\xEA', '\x94', '\x85', ' ', '\xEA', '\x95', '\xA2', ' ', '\xEA', '\x96', '\x9C', ' ', '\xEA', '\x94', '\x86', /* �? ꘖ ꘙ ꗞ ꔅ ꕢ ꖜ ꔆ */
#ifdef AF_CONFIG_OPTION_CJK
'\0',
'\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 他 们 你 來 們 到 和 地 */
- ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB8', '\xAD', ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x83', /* 对 �? 就 席 我 时 時 會 */
- ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\x88', '\xB0', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* �?� 為 能 舰 說 说 这 這 */
+ ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB8', '\xAD', ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x83', /* 对 �? 就 席 我 时 時 會 */
+ ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\x88', '\xB0', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* �?� 為 能 舰 說 说 这 這 */
' ', '\xE9', '\xBD', '\x8A', ' ', '|', /* 齊 | */
- ' ', '\xE5', '\x86', '\x9B', ' ', '\xE5', '\x90', '\x8C', ' ', '\xE5', '\xB7', '\xB2', ' ', '\xE6', '\x84', '\xBF', ' ', '\xE6', '\x97', '\xA2', ' ', '\xE6', '\x98', '\x9F', ' ', '\xE6', '\x98', '\xAF', ' ', '\xE6', '\x99', '\xAF', /* 军 �?� 已 愿 既 星 是 景 */
- ' ', '\xE6', '\xB0', '\x91', ' ', '\xE7', '\x85', '\xA7', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\xA8', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\xA6', '\x81', /* 民 照 现 �?� �?� 用 置 �? */
- ' ', '\xE8', '\xBB', '\x8D', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x85', '\x8D', ' ', '\xE9', '\x87', '\x8C', ' ', '\xE9', '\x96', '\x8B', ' ', '\xE9', '\x9B', '\xB7', ' ', '\xE9', '\x9C', '\xB2', ' ', '\xE9', '\x9D', '\xA2', /* �? 那 �? 里 開 雷 露 �?� */
+ ' ', '\xE5', '\x86', '\x9B', ' ', '\xE5', '\x90', '\x8C', ' ', '\xE5', '\xB7', '\xB2', ' ', '\xE6', '\x84', '\xBF', ' ', '\xE6', '\x97', '\xA2', ' ', '\xE6', '\x98', '\x9F', ' ', '\xE6', '\x98', '\xAF', ' ', '\xE6', '\x99', '\xAF', /* 军 �?� 已 愿 既 星 是 景 */
+ ' ', '\xE6', '\xB0', '\x91', ' ', '\xE7', '\x85', '\xA7', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\xA8', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\xA6', '\x81', /* 民 照 现 �?� �?� 用 置 �? */
+ ' ', '\xE8', '\xBB', '\x8D', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x85', '\x8D', ' ', '\xE9', '\x87', '\x8C', ' ', '\xE9', '\x96', '\x8B', ' ', '\xE9', '\x9B', '\xB7', ' ', '\xE9', '\x9C', '\xB2', ' ', '\xE9', '\x9D', '\xA2', /* �? 那 �? 里 開 雷 露 �?� */
' ', '\xE9', '\xA1', '\xBE', /* 顾 */
'\0',
'\xE4', '\xB8', '\xAA', ' ', '\xE4', '\xB8', '\xBA', ' ', '\xE4', '\xBA', '\xBA', ' ', '\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xA5', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', /* 个 为 人 他 以 们 你 來 */
- ' ', '\xE5', '\x80', '\x8B', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\xA4', '\xA7', ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', /* 個 們 到 和 大 对 �? 就 */
- ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x89', ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\xA6', '\x81', ' ', '\xE8', '\xAA', '\xAA', /* 我 时 時 有 �?� 為 �? 說 */
+ ' ', '\xE5', '\x80', '\x8B', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\xA4', '\xA7', ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', /* 個 們 到 和 大 对 �? 就 */
+ ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x89', ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\xA6', '\x81', ' ', '\xE8', '\xAA', '\xAA', /* 我 时 時 有 �?� 為 �? 說 */
' ', '\xE8', '\xAF', '\xB4', ' ', '|', /* 说 | */
- ' ', '\xE4', '\xB8', '\xBB', ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE5', '\x9B', '\xA0', ' ', '\xE5', '\xAE', '\x83', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x84', '\x8F', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\x9F', /* 主 些 因 它 想 �? �?� 生 */
- ' ', '\xE7', '\x95', '\xB6', ' ', '\xE7', '\x9C', '\x8B', ' ', '\xE7', '\x9D', '\x80', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\x80', '\x85', ' ', '\xE8', '\x87', '\xAA', ' ', '\xE8', '\x91', '\x97', ' ', '\xE8', '\xA3', '\xA1', /* 當 看 �?� 置 者 自 著 裡 */
- ' ', '\xE8', '\xBF', '\x87', ' ', '\xE8', '\xBF', '\x98', ' ', '\xE8', '\xBF', '\x9B', ' ', '\xE9', '\x80', '\xB2', ' ', '\xE9', '\x81', '\x8E', ' ', '\xE9', '\x81', '\x93', ' ', '\xE9', '\x82', '\x84', ' ', '\xE9', '\x87', '\x8C', /* 过 还 进 進 �?� �?� 還 里 */
- ' ', '\xE9', '\x9D', '\xA2', /* �?� */
+ ' ', '\xE4', '\xB8', '\xBB', ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE5', '\x9B', '\xA0', ' ', '\xE5', '\xAE', '\x83', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x84', '\x8F', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\x9F', /* 主 些 因 它 想 �? �?� 生 */
+ ' ', '\xE7', '\x95', '\xB6', ' ', '\xE7', '\x9C', '\x8B', ' ', '\xE7', '\x9D', '\x80', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\x80', '\x85', ' ', '\xE8', '\x87', '\xAA', ' ', '\xE8', '\x91', '\x97', ' ', '\xE8', '\xA3', '\xA1', /* 當 看 �?� 置 者 自 著 裡 */
+ ' ', '\xE8', '\xBF', '\x87', ' ', '\xE8', '\xBF', '\x98', ' ', '\xE8', '\xBF', '\x9B', ' ', '\xE9', '\x80', '\xB2', ' ', '\xE9', '\x81', '\x8E', ' ', '\xE9', '\x81', '\x93', ' ', '\xE9', '\x82', '\x84', ' ', '\xE9', '\x87', '\x8C', /* 过 还 进 進 �?� �?� 還 里 */
+ ' ', '\xE9', '\x9D', '\xA2', /* �?� */
#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
'\0',
' ', '\xE4', '\xBA', '\x9B', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 些 们 你 來 們 到 和 地 */
' ', '\xE5', '\xA5', '\xB9', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB9', '\xB4', ' ', '\xE5', '\xBE', '\x97', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x9C', '\x80', /* 她 将 將 就 年 得 情 最 */
- ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE7', '\x90', '\x86', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 样 樣 �?� 能 說 说 这 這 */
+ ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE7', '\x90', '\x86', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 样 樣 �?� 能 說 说 这 這 */
' ', '\xE9', '\x80', '\x9A', ' ', '|', /* 通 | */
- ' ', '\xE5', '\x8D', '\xB3', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x90', '\xA7', ' ', '\xE5', '\x90', '\xAC', ' ', '\xE5', '\x91', '\xA2', ' ', '\xE5', '\x93', '\x81', ' ', '\xE5', '\x93', '\x8D', ' ', '\xE5', '\x97', '\x8E', /* �?� �?� �?� �?� 呢 �? �? 嗎 */
+ ' ', '\xE5', '\x8D', '\xB3', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x90', '\xA7', ' ', '\xE5', '\x90', '\xAC', ' ', '\xE5', '\x91', '\xA2', ' ', '\xE5', '\x93', '\x81', ' ', '\xE5', '\x93', '\x8D', ' ', '\xE5', '\x97', '\x8E', /* �?� �?� �?� �?� 呢 �? �? 嗎 */
' ', '\xE5', '\xB8', '\x88', ' ', '\xE5', '\xB8', '\xAB', ' ', '\xE6', '\x94', '\xB6', ' ', '\xE6', '\x96', '\xAD', ' ', '\xE6', '\x96', '\xB7', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE7', '\x9C', '\xBC', ' ', '\xE9', '\x96', '\x93', /* 师 師 收 断 斷 明 眼 間 */
- ' ', '\xE9', '\x97', '\xB4', ' ', '\xE9', '\x99', '\x85', ' ', '\xE9', '\x99', '\x88', ' ', '\xE9', '\x99', '\x90', ' ', '\xE9', '\x99', '\xA4', ' ', '\xE9', '\x99', '\xB3', ' ', '\xE9', '\x9A', '\x8F', ' ', '\xE9', '\x9A', '\x9B', /* 间 际 陈 �? 除 陳 �? 際 */
+ ' ', '\xE9', '\x97', '\xB4', ' ', '\xE9', '\x99', '\x85', ' ', '\xE9', '\x99', '\x88', ' ', '\xE9', '\x99', '\x90', ' ', '\xE9', '\x99', '\xA4', ' ', '\xE9', '\x99', '\xB3', ' ', '\xE9', '\x9A', '\x8F', ' ', '\xE9', '\x9A', '\x9B', /* 间 际 陈 �? 除 陳 �? 際 */
' ', '\xE9', '\x9A', '\xA8', /* 隨 */
'\0',
- '\xE4', '\xBA', '\x8B', ' ', '\xE5', '\x89', '\x8D', ' ', '\xE5', '\xAD', '\xB8', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x88', '\x96', /* 事 �? 學 将 將 情 想 或 */
+ '\xE4', '\xBA', '\x8B', ' ', '\xE5', '\x89', '\x8D', ' ', '\xE5', '\xAD', '\xB8', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x88', '\x96', /* 事 �? 學 将 將 情 想 或 */
' ', '\xE6', '\x94', '\xBF', ' ', '\xE6', '\x96', '\xAF', ' ', '\xE6', '\x96', '\xB0', ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE6', '\xB0', '\x91', ' ', '\xE6', '\xB2', '\x92', ' ', '\xE6', '\xB2', '\xA1', /* 政 斯 新 样 樣 民 沒 没 */
- ' ', '\xE7', '\x84', '\xB6', ' ', '\xE7', '\x89', '\xB9', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x83', ' ', '\xE7', '\xAC', '\xAC', ' ', '\xE7', '\xB6', '\x93', ' ', '\xE8', '\xB0', '\x81', /* 然 特 现 �?� �?� 第 經 �? */
+ ' ', '\xE7', '\x84', '\xB6', ' ', '\xE7', '\x89', '\xB9', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x83', ' ', '\xE7', '\xAC', '\xAC', ' ', '\xE7', '\xB6', '\x93', ' ', '\xE8', '\xB0', '\x81', /* 然 特 现 �?� �?� 第 經 �? */
' ', '\xE8', '\xB5', '\xB7', ' ', '|', /* 起 | */
- ' ', '\xE4', '\xBE', '\x8B', ' ', '\xE5', '\x88', '\xA5', ' ', '\xE5', '\x88', '\xAB', ' ', '\xE5', '\x88', '\xB6', ' ', '\xE5', '\x8A', '\xA8', ' ', '\xE5', '\x8B', '\x95', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x97', '\x8E', /* 例 別 别 制 动 動 �?� 嗎 */
- ' ', '\xE5', '\xA2', '\x9E', ' ', '\xE6', '\x8C', '\x87', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE6', '\x9C', '\x9D', ' ', '\xE6', '\x9C', '\x9F', ' ', '\xE6', '\x9E', '\x84', ' ', '\xE7', '\x89', '\xA9', ' ', '\xE7', '\xA1', '\xAE', /* 增 指 明 �? 期 构 物 确 */
- ' ', '\xE7', '\xA7', '\x8D', ' ', '\xE8', '\xAA', '\xBF', ' ', '\xE8', '\xB0', '\x83', ' ', '\xE8', '\xB2', '\xBB', ' ', '\xE8', '\xB4', '\xB9', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x83', '\xBD', ' ', '\xE9', '\x96', '\x93', /* �? 調 调 費 费 那 都 間 */
+ ' ', '\xE4', '\xBE', '\x8B', ' ', '\xE5', '\x88', '\xA5', ' ', '\xE5', '\x88', '\xAB', ' ', '\xE5', '\x88', '\xB6', ' ', '\xE5', '\x8A', '\xA8', ' ', '\xE5', '\x8B', '\x95', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x97', '\x8E', /* 例 別 别 制 动 動 �?� 嗎 */
+ ' ', '\xE5', '\xA2', '\x9E', ' ', '\xE6', '\x8C', '\x87', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE6', '\x9C', '\x9D', ' ', '\xE6', '\x9C', '\x9F', ' ', '\xE6', '\x9E', '\x84', ' ', '\xE7', '\x89', '\xA9', ' ', '\xE7', '\xA1', '\xAE', /* 增 指 明 �? 期 构 物 确 */
+ ' ', '\xE7', '\xA7', '\x8D', ' ', '\xE8', '\xAA', '\xBF', ' ', '\xE8', '\xB0', '\x83', ' ', '\xE8', '\xB2', '\xBB', ' ', '\xE8', '\xB4', '\xB9', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x83', '\xBD', ' ', '\xE9', '\x96', '\x93', /* �? 調 调 費 费 那 都 間 */
' ', '\xE9', '\x97', '\xB4', /* 间 */
#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
#endif /* AF_CONFIG_OPTION_CJK */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afcjk.c b/bsp/projects/microej/thirdparty/freetype/src/afcjk.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afcjk.c
rename to bsp/projects/microej/thirdparty/freetype/src/afcjk.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afdummy.c b/bsp/projects/microej/thirdparty/freetype/src/afdummy.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afdummy.c
rename to bsp/projects/microej/thirdparty/freetype/src/afdummy.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afglobal.c b/bsp/projects/microej/thirdparty/freetype/src/afglobal.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afglobal.c
rename to bsp/projects/microej/thirdparty/freetype/src/afglobal.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afhints.c b/bsp/projects/microej/thirdparty/freetype/src/afhints.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afhints.c
rename to bsp/projects/microej/thirdparty/freetype/src/afhints.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afindic.c b/bsp/projects/microej/thirdparty/freetype/src/afindic.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afindic.c
rename to bsp/projects/microej/thirdparty/freetype/src/afindic.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/aflatin.c b/bsp/projects/microej/thirdparty/freetype/src/aflatin.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/aflatin.c
rename to bsp/projects/microej/thirdparty/freetype/src/aflatin.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afloader.c b/bsp/projects/microej/thirdparty/freetype/src/afloader.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afloader.c
rename to bsp/projects/microej/thirdparty/freetype/src/afloader.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afmodule.c b/bsp/projects/microej/thirdparty/freetype/src/afmodule.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afmodule.c
rename to bsp/projects/microej/thirdparty/freetype/src/afmodule.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afmparse.c b/bsp/projects/microej/thirdparty/freetype/src/afmparse.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afmparse.c
rename to bsp/projects/microej/thirdparty/freetype/src/afmparse.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afranges.c b/bsp/projects/microej/thirdparty/freetype/src/afranges.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afranges.c
rename to bsp/projects/microej/thirdparty/freetype/src/afranges.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afshaper.c b/bsp/projects/microej/thirdparty/freetype/src/afshaper.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/afshaper.c
rename to bsp/projects/microej/thirdparty/freetype/src/afshaper.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/apinames.c b/bsp/projects/microej/thirdparty/freetype/src/apinames.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/apinames.c
rename to bsp/projects/microej/thirdparty/freetype/src/apinames.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/autofit.c b/bsp/projects/microej/thirdparty/freetype/src/autofit.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/autofit.c
rename to bsp/projects/microej/thirdparty/freetype/src/autofit.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdf.c b/bsp/projects/microej/thirdparty/freetype/src/bdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/bdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdfdrivr.c b/bsp/projects/microej/thirdparty/freetype/src/bdfdrivr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdfdrivr.c
rename to bsp/projects/microej/thirdparty/freetype/src/bdfdrivr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdflib.c b/bsp/projects/microej/thirdparty/freetype/src/bdflib.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/bdflib.c
rename to bsp/projects/microej/thirdparty/freetype/src/bdflib.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cff.c b/bsp/projects/microej/thirdparty/freetype/src/cff.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cff.c
rename to bsp/projects/microej/thirdparty/freetype/src/cff.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffcmap.c b/bsp/projects/microej/thirdparty/freetype/src/cffcmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffcmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffcmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffdecode.c b/bsp/projects/microej/thirdparty/freetype/src/cffdecode.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffdecode.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffdecode.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffdrivr.c b/bsp/projects/microej/thirdparty/freetype/src/cffdrivr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffdrivr.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffdrivr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffgload.c b/bsp/projects/microej/thirdparty/freetype/src/cffgload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffgload.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffgload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffload.c b/bsp/projects/microej/thirdparty/freetype/src/cffload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffload.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffobjs.c b/bsp/projects/microej/thirdparty/freetype/src/cffobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffparse.c b/bsp/projects/microej/thirdparty/freetype/src/cffparse.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cffparse.c
rename to bsp/projects/microej/thirdparty/freetype/src/cffparse.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidgload.c b/bsp/projects/microej/thirdparty/freetype/src/cidgload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidgload.c
rename to bsp/projects/microej/thirdparty/freetype/src/cidgload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidload.c b/bsp/projects/microej/thirdparty/freetype/src/cidload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidload.c
rename to bsp/projects/microej/thirdparty/freetype/src/cidload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidobjs.c b/bsp/projects/microej/thirdparty/freetype/src/cidobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/cidobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidparse.c b/bsp/projects/microej/thirdparty/freetype/src/cidparse.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidparse.c
rename to bsp/projects/microej/thirdparty/freetype/src/cidparse.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidriver.c b/bsp/projects/microej/thirdparty/freetype/src/cidriver.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/cidriver.c
rename to bsp/projects/microej/thirdparty/freetype/src/cidriver.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/dlgwrap.c b/bsp/projects/microej/thirdparty/freetype/src/dlgwrap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/dlgwrap.c
rename to bsp/projects/microej/thirdparty/freetype/src/dlgwrap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftadvanc.c b/bsp/projects/microej/thirdparty/freetype/src/ftadvanc.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftadvanc.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftadvanc.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbase.c b/bsp/projects/microej/thirdparty/freetype/src/ftbase.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbase.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbase.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbbox.c b/bsp/projects/microej/thirdparty/freetype/src/ftbbox.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbbox.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbbox.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbdf.c b/bsp/projects/microej/thirdparty/freetype/src/ftbdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbitmap.c b/bsp/projects/microej/thirdparty/freetype/src/ftbitmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbitmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbitmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbsdf.c b/bsp/projects/microej/thirdparty/freetype/src/ftbsdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbsdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbsdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbzip2.c b/bsp/projects/microej/thirdparty/freetype/src/ftbzip2.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftbzip2.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftbzip2.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcache.c b/bsp/projects/microej/thirdparty/freetype/src/ftcache.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcache.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcache.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcalc.c b/bsp/projects/microej/thirdparty/freetype/src/ftcalc.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcalc.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcalc.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcbasic.c b/bsp/projects/microej/thirdparty/freetype/src/ftcbasic.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcbasic.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcbasic.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftccache.c b/bsp/projects/microej/thirdparty/freetype/src/ftccache.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftccache.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftccache.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftccmap.c b/bsp/projects/microej/thirdparty/freetype/src/ftccmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftccmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftccmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcglyph.c b/bsp/projects/microej/thirdparty/freetype/src/ftcglyph.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcglyph.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcglyph.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcid.c b/bsp/projects/microej/thirdparty/freetype/src/ftcid.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcid.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcid.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcimage.c b/bsp/projects/microej/thirdparty/freetype/src/ftcimage.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcimage.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcimage.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcmanag.c b/bsp/projects/microej/thirdparty/freetype/src/ftcmanag.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcmanag.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcmanag.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcmru.c b/bsp/projects/microej/thirdparty/freetype/src/ftcmru.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcmru.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcmru.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcolor.c b/bsp/projects/microej/thirdparty/freetype/src/ftcolor.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcolor.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcolor.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcsbits.c b/bsp/projects/microej/thirdparty/freetype/src/ftcsbits.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftcsbits.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftcsbits.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftdbgmem.c b/bsp/projects/microej/thirdparty/freetype/src/ftdbgmem.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftdbgmem.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftdbgmem.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftdebug.c b/bsp/projects/microej/thirdparty/freetype/src/ftdebug.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftdebug.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftdebug.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fterrors.c b/bsp/projects/microej/thirdparty/freetype/src/fterrors.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fterrors.c
rename to bsp/projects/microej/thirdparty/freetype/src/fterrors.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftfntfmt.c b/bsp/projects/microej/thirdparty/freetype/src/ftfntfmt.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftfntfmt.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftfntfmt.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftfstype.c b/bsp/projects/microej/thirdparty/freetype/src/ftfstype.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftfstype.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftfstype.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgasp.c b/bsp/projects/microej/thirdparty/freetype/src/ftgasp.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgasp.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftgasp.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgloadr.c b/bsp/projects/microej/thirdparty/freetype/src/ftgloadr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgloadr.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftgloadr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftglyph.c b/bsp/projects/microej/thirdparty/freetype/src/ftglyph.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftglyph.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftglyph.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgrays.c b/bsp/projects/microej/thirdparty/freetype/src/ftgrays.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgrays.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftgrays.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgxval.c b/bsp/projects/microej/thirdparty/freetype/src/ftgxval.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgxval.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftgxval.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgzip.c b/bsp/projects/microej/thirdparty/freetype/src/ftgzip.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftgzip.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftgzip.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fthash.c b/bsp/projects/microej/thirdparty/freetype/src/fthash.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fthash.c
rename to bsp/projects/microej/thirdparty/freetype/src/fthash.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftinit.c b/bsp/projects/microej/thirdparty/freetype/src/ftinit.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftinit.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftinit.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftlcdfil.c b/bsp/projects/microej/thirdparty/freetype/src/ftlcdfil.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftlcdfil.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftlcdfil.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftlzw.c b/bsp/projects/microej/thirdparty/freetype/src/ftlzw.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftlzw.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftlzw.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftmac.c b/bsp/projects/microej/thirdparty/freetype/src/ftmac.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftmac.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftmac.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftmm.c b/bsp/projects/microej/thirdparty/freetype/src/ftmm.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftmm.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftmm.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftobjs.c b/bsp/projects/microej/thirdparty/freetype/src/ftobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftotval.c b/bsp/projects/microej/thirdparty/freetype/src/ftotval.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftotval.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftotval.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftoutln.c b/bsp/projects/microej/thirdparty/freetype/src/ftoutln.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftoutln.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftoutln.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpatent.c b/bsp/projects/microej/thirdparty/freetype/src/ftpatent.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpatent.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftpatent.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpfr.c b/bsp/projects/microej/thirdparty/freetype/src/ftpfr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpfr.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftpfr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpsprop.c b/bsp/projects/microej/thirdparty/freetype/src/ftpsprop.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftpsprop.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftpsprop.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrandom.c b/bsp/projects/microej/thirdparty/freetype/src/ftrandom.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrandom.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftrandom.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftraster.c b/bsp/projects/microej/thirdparty/freetype/src/ftraster.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftraster.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftraster.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrend1.c b/bsp/projects/microej/thirdparty/freetype/src/ftrend1.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrend1.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftrend1.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrfork.c b/bsp/projects/microej/thirdparty/freetype/src/ftrfork.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftrfork.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftrfork.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdf.c b/bsp/projects/microej/thirdparty/freetype/src/ftsdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdfcommon.c b/bsp/projects/microej/thirdparty/freetype/src/ftsdfcommon.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdfcommon.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsdfcommon.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdfrend.c b/bsp/projects/microej/thirdparty/freetype/src/ftsdfrend.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsdfrend.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsdfrend.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsmooth.c b/bsp/projects/microej/thirdparty/freetype/src/ftsmooth.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsmooth.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsmooth.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsnames.c b/bsp/projects/microej/thirdparty/freetype/src/ftsnames.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsnames.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsnames.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftstream.c b/bsp/projects/microej/thirdparty/freetype/src/ftstream.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftstream.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftstream.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftstroke.c b/bsp/projects/microej/thirdparty/freetype/src/ftstroke.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftstroke.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftstroke.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsynth.c b/bsp/projects/microej/thirdparty/freetype/src/ftsynth.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsynth.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsynth.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c b/bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c
index 10190e0..faea39e 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c
+++ b/bsp/projects/microej/thirdparty/freetype/src/ftsystem/ftsystem.c
@@ -7,13 +7,13 @@
* Copyright (C) 1996-2021 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
+ * Copyright 2021-2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
- *
- * Copyright 2019-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
/**************************************************************************
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fttrigon.c b/bsp/projects/microej/thirdparty/freetype/src/fttrigon.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fttrigon.c
rename to bsp/projects/microej/thirdparty/freetype/src/fttrigon.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fttype1.c b/bsp/projects/microej/thirdparty/freetype/src/fttype1.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/fttype1.c
rename to bsp/projects/microej/thirdparty/freetype/src/fttype1.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftutil.c b/bsp/projects/microej/thirdparty/freetype/src/ftutil.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftutil.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftutil.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c b/bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c
index 4985c8a..841f2d4 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c
+++ b/bsp/projects/microej/thirdparty/freetype/src/ftvector/ftvector.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2019-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2019-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief Freetype vglite renderer
* @author MicroEJ Developer Team
-* @version 3.0.0
+* @version 7.0.1
*/
#define FT_MAKE_OPTION_SINGLE_OBJECT
@@ -43,32 +43,8 @@
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
#endif
-#include "trace_vglite.h"
-#include "display_vglite.h"
-#include "vglite_path.h"
#include "microvg_helper.h"
-
-/*
- * @brief Logs an init gpu start event
- *
- * @param[in] operation: The VGLite operation sent to the GPU
- */
-// cppcheck-suppress [misra-c2012-20.10]
-#define FT_VGLITE_TRACE_INIT_GPU_START(operation) \
- TRACE_PLATFORM_START_U32( \
- VGLITE, \
- VGLITE_TRACE_INIT_GPU, \
- VGLITE_TRACE_OP_ ## operation \
- );
-
-/*
- * @brief Logs an init gpu end event
- */
-#define FT_VGLITE_TRACE_INIT_GPU_END() \
- TRACE_PLATFORM_END_VOID( \
- VGLITE, \
- VGLITE_TRACE_INIT_GPU \
- );
+#include "vg_drawing_vglite.h"
/*
* @brief INIT_GPU event identifier
@@ -91,7 +67,7 @@
typedef struct vglite_TWorker_ {
FT_Outline outline;
- void* vglite_dest;
+ VG_DRAWING_VGLITE_draw_glyph_t vglite_dest;
vg_lite_matrix_t* vglite_matrix;
vg_lite_path_t vglite_path;
uint32_t vglite_path_pool_size;
@@ -346,28 +322,15 @@ vglite_convert_glyph( void )
FT_TRACE7(("horiBearingX: %d\n", _worker.metrics->horiBearingX));
FT_TRACE7(("horiBearingY: %d\n", _worker.metrics->horiBearingY));
- // FIXME the commented code break characters alignment on the baseline.
- // I guess they were added to fix wrong positions.
- // int offX = _worker.metrics->horiBearingX;
- // int offY = _worker.metrics->horiBearingY - _worker.metrics->height;
-
// Get fill rule from outline
vg_lite_fill_t vg_lite_fill_rule = (_worker.outline.flags & FT_OUTLINE_EVEN_ODD_FILL) ? VG_LITE_FILL_EVEN_ODD : VG_LITE_FILL_NON_ZERO;
- // vg_lite_translate(offX, offY, _worker.vglite_matrix);
- if(_worker.vg_lite_gradient == MICROVG_HELPER_NULL_GRADIENT){
- FT_VGLITE_TRACE_INIT_GPU_START(DRAW);
- void* target = _worker.vglite_dest;
- VG_DRAWER_draw_path(target, &_worker.vglite_path, vg_lite_fill_rule, _worker.vglite_matrix, _worker.vg_lite_blend, _worker.vg_lite_color);
- FT_VGLITE_TRACE_INIT_GPU_END();
- }
- else {
- FT_VGLITE_TRACE_INIT_GPU_START(DRAW_GRAD);
- void* target = _worker.vglite_dest;
- VG_DRAWER_draw_gradient(target, &_worker.vglite_path, vg_lite_fill_rule, _worker.vglite_matrix, _worker.vg_lite_gradient, _worker.vg_lite_blend);
- FT_VGLITE_TRACE_INIT_GPU_END();
+ VG_DRAWING_VGLITE_draw_glyph_t drawer = (VG_DRAWING_VGLITE_draw_glyph_t)(_worker.vglite_dest);
+ jint llvg_error = (*drawer)(&_worker.vglite_path, vg_lite_fill_rule, _worker.vglite_matrix, _worker.vg_lite_blend, _worker.vg_lite_color, _worker.vg_lite_gradient);
+
+ if (LLVG_SUCCESS != llvg_error) {
+ error = (LLVG_OUT_OF_MEMORY == llvg_error) ? FT_ERR( Out_Of_Memory ) : FT_ERR( Cannot_Render_Glyph ) ;
}
- // vg_lite_translate(0, offY, _worker.vglite_matrix);
}
}
@@ -416,12 +379,18 @@ vglite_reset( FT_Raster raster,
_worker.vglite_matrix = NULL;
_worker.vglite_path_pool_size = 0;
- (void)memset(&_worker.vglite_path, 0, sizeof(_worker.vglite_path));
-
- _worker.vglite_path.bounding_box[0] = -4000; // Left
- _worker.vglite_path.bounding_box[1] = -4000; // Top
- _worker.vglite_path.bounding_box[2] = 4000; // Right
- _worker.vglite_path.bounding_box[3] = 4000; // Bottom
+ vg_lite_init_path(
+ &_worker.vglite_path,
+ VG_LITE_S16,
+ VG_LITE_HIGH,
+ 0,
+ NULL,
+ -4000, // Left
+ -4000, // Top
+ 4000, // Right
+ 4000 // Bottom
+ );
+ _worker.vglite_path.path_type = VG_LITE_DRAW_FILL_PATH;
}
@@ -485,7 +454,7 @@ static FT_Error ft_vglite_set_mode(FT_Renderer render, FT_ULong mode_tag, FT_Po
switch (mode_tag){
case FT_PARAM_TAG_VGLITE_DESTINATION:{
- _worker.vglite_dest = data;
+ _worker.vglite_dest = (VG_DRAWING_VGLITE_draw_glyph_t)data;
ret = FT_ERR(Ok);
break;
}
@@ -494,16 +463,6 @@ static FT_Error ft_vglite_set_mode(FT_Renderer render, FT_ULong mode_tag, FT_Po
ret = FT_ERR(Ok);
break;
}
- case FT_PARAM_TAG_VGLITE_QUALITY:{
- _worker.vglite_path.quality = (vg_lite_quality_t) (uint32_t) data;
- ret = FT_ERR(Ok);
- break;
- }
- case FT_PARAM_TAG_VGLITE_FORMAT:{
- _worker.vglite_path.format = (vg_lite_format_t) (uint32_t) data;
- ret = FT_ERR(Ok);
- break;
- }
case FT_PARAM_TAG_VGLITE_BLEND:{
_worker.vg_lite_blend = (vg_lite_blend_t) (uint32_t) data;
ret = FT_ERR(Ok);
@@ -512,15 +471,11 @@ static FT_Error ft_vglite_set_mode(FT_Renderer render, FT_ULong mode_tag, FT_Po
case FT_PARAM_TAG_VGLITE_COLOR:{
// convert the color only once, see FT_PARAM_TAG_VGLITE_DESTINATION
_worker.vg_lite_color = (uint32_t) data;
- VG_DRAWER_update_color(_worker.vglite_dest, &_worker.vg_lite_color, _worker.vg_lite_blend);
ret = FT_ERR(Ok);
break;
}
case FT_PARAM_TAG_VGLITE_GRADIENT:{
_worker.vg_lite_gradient = data;
- if (MICROVG_HELPER_NULL_GRADIENT != data) {
- VG_DRAWER_update_gradient(_worker.vglite_dest, _worker.vg_lite_gradient, _worker.vg_lite_blend);
- }
ret = FT_ERR(Ok);
break;
}
@@ -552,7 +507,7 @@ ft_vglite_transform( FT_Renderer render,
if (NULL != delta ){
FT_Outline_Translate( &slot->outline, delta->x, delta->y );
}
- error = FT_Err_Ok;
+ error = FT_ERR( Ok );
}
else {
error = FT_THROW( Invalid_Argument );
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftwinfnt.c b/bsp/projects/microej/thirdparty/freetype/src/ftwinfnt.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftwinfnt.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftwinfnt.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftzopen.c b/bsp/projects/microej/thirdparty/freetype/src/ftzopen.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ftzopen.c
rename to bsp/projects/microej/thirdparty/freetype/src/ftzopen.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvalid.c b/bsp/projects/microej/thirdparty/freetype/src/gxvalid.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvalid.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvalid.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvbsln.c b/bsp/projects/microej/thirdparty/freetype/src/gxvbsln.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvbsln.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvbsln.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvcommn.c b/bsp/projects/microej/thirdparty/freetype/src/gxvcommn.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvcommn.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvcommn.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvfeat.c b/bsp/projects/microej/thirdparty/freetype/src/gxvfeat.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvfeat.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvfeat.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvfgen.c b/bsp/projects/microej/thirdparty/freetype/src/gxvfgen.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvfgen.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvfgen.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvjust.c b/bsp/projects/microej/thirdparty/freetype/src/gxvjust.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvjust.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvjust.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvkern.c b/bsp/projects/microej/thirdparty/freetype/src/gxvkern.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvkern.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvkern.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvlcar.c b/bsp/projects/microej/thirdparty/freetype/src/gxvlcar.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvlcar.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvlcar.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmod.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmod.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmod.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmod.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort0.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort0.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort0.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort0.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort1.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort1.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort1.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort1.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort2.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort2.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort2.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort2.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort4.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort4.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort4.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort4.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort5.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmort5.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmort5.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmort5.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx0.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx0.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx0.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx0.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx1.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx1.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx1.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx1.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx2.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx2.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx2.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx2.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx4.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx4.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx4.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx4.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx5.c b/bsp/projects/microej/thirdparty/freetype/src/gxvmorx5.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvmorx5.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvmorx5.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvopbd.c b/bsp/projects/microej/thirdparty/freetype/src/gxvopbd.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvopbd.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvopbd.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvprop.c b/bsp/projects/microej/thirdparty/freetype/src/gxvprop.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvprop.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvprop.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvtrak.c b/bsp/projects/microej/thirdparty/freetype/src/gxvtrak.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/gxvtrak.c
rename to bsp/projects/microej/thirdparty/freetype/src/gxvtrak.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infblock.c b/bsp/projects/microej/thirdparty/freetype/src/infblock.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infblock.c
rename to bsp/projects/microej/thirdparty/freetype/src/infblock.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infcodes.c b/bsp/projects/microej/thirdparty/freetype/src/infcodes.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infcodes.c
rename to bsp/projects/microej/thirdparty/freetype/src/infcodes.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/inflate.c b/bsp/projects/microej/thirdparty/freetype/src/inflate.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/inflate.c
rename to bsp/projects/microej/thirdparty/freetype/src/inflate.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/inftrees.c b/bsp/projects/microej/thirdparty/freetype/src/inftrees.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/inftrees.c
rename to bsp/projects/microej/thirdparty/freetype/src/inftrees.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infutil.c b/bsp/projects/microej/thirdparty/freetype/src/infutil.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/infutil.c
rename to bsp/projects/microej/thirdparty/freetype/src/infutil.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/md5.c b/bsp/projects/microej/thirdparty/freetype/src/md5.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/md5.c
rename to bsp/projects/microej/thirdparty/freetype/src/md5.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvalid.c b/bsp/projects/microej/thirdparty/freetype/src/otvalid.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvalid.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvalid.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvbase.c b/bsp/projects/microej/thirdparty/freetype/src/otvbase.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvbase.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvbase.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvcommn.c b/bsp/projects/microej/thirdparty/freetype/src/otvcommn.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvcommn.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvcommn.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgdef.c b/bsp/projects/microej/thirdparty/freetype/src/otvgdef.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgdef.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvgdef.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgpos.c b/bsp/projects/microej/thirdparty/freetype/src/otvgpos.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgpos.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvgpos.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgsub.c b/bsp/projects/microej/thirdparty/freetype/src/otvgsub.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvgsub.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvgsub.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvjstf.c b/bsp/projects/microej/thirdparty/freetype/src/otvjstf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvjstf.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvjstf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvmath.c b/bsp/projects/microej/thirdparty/freetype/src/otvmath.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvmath.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvmath.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvmod.c b/bsp/projects/microej/thirdparty/freetype/src/otvmod.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/otvmod.c
rename to bsp/projects/microej/thirdparty/freetype/src/otvmod.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcf.c b/bsp/projects/microej/thirdparty/freetype/src/pcf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcf.c
rename to bsp/projects/microej/thirdparty/freetype/src/pcf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfdrivr.c b/bsp/projects/microej/thirdparty/freetype/src/pcfdrivr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfdrivr.c
rename to bsp/projects/microej/thirdparty/freetype/src/pcfdrivr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfread.c b/bsp/projects/microej/thirdparty/freetype/src/pcfread.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfread.c
rename to bsp/projects/microej/thirdparty/freetype/src/pcfread.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfutil.c b/bsp/projects/microej/thirdparty/freetype/src/pcfutil.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pcfutil.c
rename to bsp/projects/microej/thirdparty/freetype/src/pcfutil.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfr.c b/bsp/projects/microej/thirdparty/freetype/src/pfr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfr.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrcmap.c b/bsp/projects/microej/thirdparty/freetype/src/pfrcmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrcmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrcmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrdrivr.c b/bsp/projects/microej/thirdparty/freetype/src/pfrdrivr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrdrivr.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrdrivr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrgload.c b/bsp/projects/microej/thirdparty/freetype/src/pfrgload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrgload.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrgload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrload.c b/bsp/projects/microej/thirdparty/freetype/src/pfrload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrload.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrobjs.c b/bsp/projects/microej/thirdparty/freetype/src/pfrobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrsbit.c b/bsp/projects/microej/thirdparty/freetype/src/pfrsbit.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pfrsbit.c
rename to bsp/projects/microej/thirdparty/freetype/src/pfrsbit.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pngshim.c b/bsp/projects/microej/thirdparty/freetype/src/pngshim.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pngshim.c
rename to bsp/projects/microej/thirdparty/freetype/src/pngshim.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psarrst.c b/bsp/projects/microej/thirdparty/freetype/src/psarrst.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psarrst.c
rename to bsp/projects/microej/thirdparty/freetype/src/psarrst.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psaux.c b/bsp/projects/microej/thirdparty/freetype/src/psaux.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psaux.c
rename to bsp/projects/microej/thirdparty/freetype/src/psaux.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psauxmod.c b/bsp/projects/microej/thirdparty/freetype/src/psauxmod.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psauxmod.c
rename to bsp/projects/microej/thirdparty/freetype/src/psauxmod.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psblues.c b/bsp/projects/microej/thirdparty/freetype/src/psblues.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psblues.c
rename to bsp/projects/microej/thirdparty/freetype/src/psblues.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psconv.c b/bsp/projects/microej/thirdparty/freetype/src/psconv.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psconv.c
rename to bsp/projects/microej/thirdparty/freetype/src/psconv.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pserror.c b/bsp/projects/microej/thirdparty/freetype/src/pserror.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pserror.c
rename to bsp/projects/microej/thirdparty/freetype/src/pserror.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psfont.c b/bsp/projects/microej/thirdparty/freetype/src/psfont.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psfont.c
rename to bsp/projects/microej/thirdparty/freetype/src/psfont.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psft.c b/bsp/projects/microej/thirdparty/freetype/src/psft.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psft.c
rename to bsp/projects/microej/thirdparty/freetype/src/psft.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshalgo.c b/bsp/projects/microej/thirdparty/freetype/src/pshalgo.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshalgo.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshalgo.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshglob.c b/bsp/projects/microej/thirdparty/freetype/src/pshglob.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshglob.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshglob.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshinter.c b/bsp/projects/microej/thirdparty/freetype/src/pshinter.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshinter.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshinter.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshints.c b/bsp/projects/microej/thirdparty/freetype/src/pshints.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshints.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshints.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshmod.c b/bsp/projects/microej/thirdparty/freetype/src/pshmod.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshmod.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshmod.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshrec.c b/bsp/projects/microej/thirdparty/freetype/src/pshrec.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/pshrec.c
rename to bsp/projects/microej/thirdparty/freetype/src/pshrec.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psintrp.c b/bsp/projects/microej/thirdparty/freetype/src/psintrp.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psintrp.c
rename to bsp/projects/microej/thirdparty/freetype/src/psintrp.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psmodule.c b/bsp/projects/microej/thirdparty/freetype/src/psmodule.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psmodule.c
rename to bsp/projects/microej/thirdparty/freetype/src/psmodule.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psnames.c b/bsp/projects/microej/thirdparty/freetype/src/psnames.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psnames.c
rename to bsp/projects/microej/thirdparty/freetype/src/psnames.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psobjs.c b/bsp/projects/microej/thirdparty/freetype/src/psobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/psobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psread.c b/bsp/projects/microej/thirdparty/freetype/src/psread.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psread.c
rename to bsp/projects/microej/thirdparty/freetype/src/psread.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psstack.c b/bsp/projects/microej/thirdparty/freetype/src/psstack.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/psstack.c
rename to bsp/projects/microej/thirdparty/freetype/src/psstack.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/raster.c b/bsp/projects/microej/thirdparty/freetype/src/raster.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/raster.c
rename to bsp/projects/microej/thirdparty/freetype/src/raster.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sdf.c b/bsp/projects/microej/thirdparty/freetype/src/sdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/sdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfdriver.c b/bsp/projects/microej/thirdparty/freetype/src/sfdriver.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfdriver.c
rename to bsp/projects/microej/thirdparty/freetype/src/sfdriver.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfnt.c b/bsp/projects/microej/thirdparty/freetype/src/sfnt.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfnt.c
rename to bsp/projects/microej/thirdparty/freetype/src/sfnt.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfobjs.c b/bsp/projects/microej/thirdparty/freetype/src/sfobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/sfobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfwoff.c b/bsp/projects/microej/thirdparty/freetype/src/sfwoff.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfwoff.c
rename to bsp/projects/microej/thirdparty/freetype/src/sfwoff.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfwoff2.c b/bsp/projects/microej/thirdparty/freetype/src/sfwoff2.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/sfwoff2.c
rename to bsp/projects/microej/thirdparty/freetype/src/sfwoff2.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/smooth.c b/bsp/projects/microej/thirdparty/freetype/src/smooth.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/smooth.c
rename to bsp/projects/microej/thirdparty/freetype/src/smooth.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1afm.c b/bsp/projects/microej/thirdparty/freetype/src/t1afm.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1afm.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1afm.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1cmap.c b/bsp/projects/microej/thirdparty/freetype/src/t1cmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1cmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1cmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1decode.c b/bsp/projects/microej/thirdparty/freetype/src/t1decode.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1decode.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1decode.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1driver.c b/bsp/projects/microej/thirdparty/freetype/src/t1driver.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1driver.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1driver.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1gload.c b/bsp/projects/microej/thirdparty/freetype/src/t1gload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1gload.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1gload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1load.c b/bsp/projects/microej/thirdparty/freetype/src/t1load.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1load.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1load.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1objs.c b/bsp/projects/microej/thirdparty/freetype/src/t1objs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1objs.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1objs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1parse.c b/bsp/projects/microej/thirdparty/freetype/src/t1parse.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t1parse.c
rename to bsp/projects/microej/thirdparty/freetype/src/t1parse.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42drivr.c b/bsp/projects/microej/thirdparty/freetype/src/t42drivr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42drivr.c
rename to bsp/projects/microej/thirdparty/freetype/src/t42drivr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42objs.c b/bsp/projects/microej/thirdparty/freetype/src/t42objs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42objs.c
rename to bsp/projects/microej/thirdparty/freetype/src/t42objs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42parse.c b/bsp/projects/microej/thirdparty/freetype/src/t42parse.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/t42parse.c
rename to bsp/projects/microej/thirdparty/freetype/src/t42parse.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_afm.c b/bsp/projects/microej/thirdparty/freetype/src/test_afm.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_afm.c
rename to bsp/projects/microej/thirdparty/freetype/src/test_afm.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_bbox.c b/bsp/projects/microej/thirdparty/freetype/src/test_bbox.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_bbox.c
rename to bsp/projects/microej/thirdparty/freetype/src/test_bbox.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_trig.c b/bsp/projects/microej/thirdparty/freetype/src/test_trig.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/test_trig.c
rename to bsp/projects/microej/thirdparty/freetype/src/test_trig.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/truetype.c b/bsp/projects/microej/thirdparty/freetype/src/truetype.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/truetype.c
rename to bsp/projects/microej/thirdparty/freetype/src/truetype.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttbdf.c b/bsp/projects/microej/thirdparty/freetype/src/ttbdf.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttbdf.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttbdf.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcmap.c b/bsp/projects/microej/thirdparty/freetype/src/ttcmap.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcmap.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttcmap.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcolr.c b/bsp/projects/microej/thirdparty/freetype/src/ttcolr.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcolr.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttcolr.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcpal.c b/bsp/projects/microej/thirdparty/freetype/src/ttcpal.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttcpal.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttcpal.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttdriver.c b/bsp/projects/microej/thirdparty/freetype/src/ttdriver.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttdriver.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttdriver.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttgload.c b/bsp/projects/microej/thirdparty/freetype/src/ttgload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttgload.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttgload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttgxvar.c b/bsp/projects/microej/thirdparty/freetype/src/ttgxvar.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttgxvar.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttgxvar.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttinterp.c b/bsp/projects/microej/thirdparty/freetype/src/ttinterp.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttinterp.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttinterp.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttkern.c b/bsp/projects/microej/thirdparty/freetype/src/ttkern.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttkern.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttkern.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttload.c b/bsp/projects/microej/thirdparty/freetype/src/ttload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttload.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttmtx.c b/bsp/projects/microej/thirdparty/freetype/src/ttmtx.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttmtx.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttmtx.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttobjs.c b/bsp/projects/microej/thirdparty/freetype/src/ttobjs.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttobjs.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttobjs.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttpload.c b/bsp/projects/microej/thirdparty/freetype/src/ttpload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttpload.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttpload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttpost.c b/bsp/projects/microej/thirdparty/freetype/src/ttpost.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttpost.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttpost.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttsbit.c b/bsp/projects/microej/thirdparty/freetype/src/ttsbit.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttsbit.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttsbit.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttsubpix.c b/bsp/projects/microej/thirdparty/freetype/src/ttsubpix.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/ttsubpix.c
rename to bsp/projects/microej/thirdparty/freetype/src/ttsubpix.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type1.c b/bsp/projects/microej/thirdparty/freetype/src/type1.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type1.c
rename to bsp/projects/microej/thirdparty/freetype/src/type1.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type1cid.c b/bsp/projects/microej/thirdparty/freetype/src/type1cid.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type1cid.c
rename to bsp/projects/microej/thirdparty/freetype/src/type1cid.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type42.c b/bsp/projects/microej/thirdparty/freetype/src/type42.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/type42.c
rename to bsp/projects/microej/thirdparty/freetype/src/type42.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/winfnt.c b/bsp/projects/microej/thirdparty/freetype/src/winfnt.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/winfnt.c
rename to bsp/projects/microej/thirdparty/freetype/src/winfnt.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/woff2tags.c b/bsp/projects/microej/thirdparty/freetype/src/woff2tags.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/woff2tags.c
rename to bsp/projects/microej/thirdparty/freetype/src/woff2tags.c
diff --git a/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_base_wrapper.c b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_base_wrapper.c
new file mode 100644
index 0000000..76d9200
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_base_wrapper.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ */
+
+/**
+* @file
+* @brief MicroEJ Freetype wrapper on freetype c files
+* @author MicroEJ Developer Team
+* @version 2.0.2
+*/
+
+#include "microvg_configuration.h"
+#if defined (VG_FEATURE_FONT)
+
+#include "../ftbase.c"
+#include "../ftinit.c"
+#include "../autofit.c"
+#include "../pshinter.c"
+#include "../sfnt.c"
+#include "../ftsystem/ftsystem.c"
+
+#endif // defined (VG_FEATURE_FONT)
diff --git a/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_bitmap_wrapper.c b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_bitmap_wrapper.c
new file mode 100644
index 0000000..1244e51
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_bitmap_wrapper.c
@@ -0,0 +1,27 @@
+/*
+ * C
+ *
+ * Copyright 2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ */
+
+/**
+* @file
+* @brief MicroEJ Freetype wrapper on freetype c files
+* @author MicroEJ Developer Team
+* @version 2.0.2
+*/
+
+#include "microvg_configuration.h"
+
+#if defined (VG_FEATURE_FONT) && defined (VG_FEATURE_FONT_FREETYPE_BITMAP) && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_BITMAP)
+#include "../ftsmooth.c"
+#include "../ftgrays.c"
+#include "../ftdebug.c"
+#endif // defined (VG_FEATURE_FONT) && defined (VG_FEATURE_FONT_FREETYPE_BITMAP) && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_BITMAP)
+
diff --git a/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_otf_wrapper.c b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_otf_wrapper.c
new file mode 100644
index 0000000..987b219
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_otf_wrapper.c
@@ -0,0 +1,29 @@
+/*
+ * C
+ *
+ * Copyright 2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ */
+
+/**
+* @file
+* @brief MicroEJ Freetype wrapper on freetype c files
+* @author MicroEJ Developer Team
+* @version 2.0.2
+*/
+
+#include "microvg_configuration.h"
+#if defined (VG_FEATURE_FONT)
+
+#ifdef VG_FEATURE_FREETYPE_OTF
+#include "../cff.c"
+#include "../psaux.c"
+#include "../psnames.c"
+#endif // VG_FEATURE_FREETYPE_OTF
+
+#endif // defined (VG_FEATURE_FONT)
diff --git a/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_ttf_wrapper.c b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_ttf_wrapper.c
new file mode 100644
index 0000000..089ebb6
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_ttf_wrapper.c
@@ -0,0 +1,27 @@
+/*
+ * C
+ *
+ * Copyright 2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ */
+
+/**
+* @file
+* @brief MicroEJ Freetype wrapper on freetype c files
+* @author MicroEJ Developer Team
+* @version 2.0.2
+*/
+
+#include "microvg_configuration.h"
+#if defined (VG_FEATURE_FONT)
+
+#ifdef VG_FEATURE_FREETYPE_TTF
+#include "../truetype.c"
+#endif // VG_FEATURE_FREETYPE_TTF
+
+#endif // defined (VG_FEATURE_FONT)
diff --git a/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_vector_wrapper.c b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_vector_wrapper.c
new file mode 100644
index 0000000..d0b4e16
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/src/wrappers/ft_vector_wrapper.c
@@ -0,0 +1,24 @@
+/*
+ * C
+ *
+ * Copyright 2022 MicroEJ Corp. This file has been modified and/or created by MicroEJ Corp.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ */
+
+/**
+* @file
+* @brief MicroEJ Freetype wrapper on freetype c files
+* @author MicroEJ Developer Team
+* @version 2.0.2
+*/
+
+#include "microvg_configuration.h"
+
+#if defined (VG_FEATURE_FONT) && defined (VG_FEATURE_FONT_FREETYPE_VECTOR) && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_VECTOR)
+#include "../ftvector/ftvector.c"
+#endif // defined (VG_FEATURE_FONT) && defined (VG_FEATURE_FONT_FREETYPE_VECTOR) && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_VECTOR)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/zutil.c b/bsp/projects/microej/thirdparty/freetype/src/zutil.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/freetype/src/zutil.c
rename to bsp/projects/microej/thirdparty/freetype/src/zutil.c
diff --git a/bsp/projects/microej/thirdparty/freetype/thirdparty_freetype.cmake b/bsp/projects/microej/thirdparty/freetype/thirdparty_freetype.cmake
new file mode 100644
index 0000000..791a513
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/freetype/thirdparty_freetype.cmake
@@ -0,0 +1,11 @@
+include_guard()
+message("microej/thirdparty/freetype component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/src/wrappers/ft_base_wrapper.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/wrappers/ft_otf_wrapper.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/wrappers/ft_ttf_wrapper.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/wrappers/ft_vector_wrapper.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/inc)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/COPYING b/bsp/projects/microej/thirdparty/harfbuzz/COPYING
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/COPYING
rename to bsp/projects/microej/thirdparty/harfbuzz/COPYING
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSet.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSet.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSet.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSet.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubstFormat1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubstFormat1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubstFormat1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/AlternateSubstFormat1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ChainContextSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ChainContextSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ChainContextSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ChainContextSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ContextSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ContextSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ContextSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ContextSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ExtensionSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ExtensionSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ExtensionSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ExtensionSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/GSUB.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/GSUB.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/GSUB.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/GSUB.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Ligature.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Ligature.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Ligature.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Ligature.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSet.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSet.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSet.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSet.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubstFormat1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubstFormat1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubstFormat1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/LigatureSubstFormat1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubstFormat1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubstFormat1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubstFormat1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/MultipleSubstFormat1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Sequence.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Sequence.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Sequence.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/Sequence.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubst.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubst.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubst.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubst.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat2.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat2.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat2.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SingleSubstFormat2.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookup.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookup.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookup.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookup.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookupSubTable.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookupSubTable.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookupSubTable.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/OT/Layout/GSUB/SubstLookupSubTable.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-ankr-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-ankr-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-ankr-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-ankr-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-bsln-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-bsln-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-bsln-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-bsln-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-feat-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-feat-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-feat-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-feat-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-just-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-just-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-just-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-just-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-kerx-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-kerx-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-kerx-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-kerx-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-morx-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-morx-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-morx-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-morx-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-opbd-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-opbd-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-opbd-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-opbd-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-trak-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-trak-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-trak-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout-trak-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-layout.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-ltag-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-ltag-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-ltag-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-ltag-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-map.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-map.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-map.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat-map.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-aat.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-algs.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-algs.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-algs.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-algs.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-array.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-array.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-array.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-array.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-atomic.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-atomic.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-atomic.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-atomic.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bimap.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bimap.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bimap.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bimap.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-page.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-page.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-page.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-page.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set-invertible.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set-invertible.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set-invertible.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set-invertible.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-bit-set.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-blob.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-json.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-json.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-json.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-json.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-text.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-text.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-text.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer-deserialize-text.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-buffer.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cache.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cache.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cache.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cache.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-cs-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-cs-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-cs-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-cs-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-dict-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-dict-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-dict-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff-interp-dict-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff1-interp-cs.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff1-interp-cs.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff1-interp-cs.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff1-interp-cs.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff2-interp-cs.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff2-interp-cs.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff2-interp-cs.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-cff2-interp-cs.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-common.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-common.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-common.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-common.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-config.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-config.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-config.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-config.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-coretext.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-coretext.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-coretext.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-coretext.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-debug.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-debug.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-debug.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-debug.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-deprecated.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-deprecated.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-deprecated.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-deprecated.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-directwrite.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-directwrite.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-directwrite.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-directwrite.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-dispatch.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-dispatch.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-dispatch.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-dispatch.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-draw.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-face.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-font.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ft.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ft.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ft.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ft.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gdi.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gdi.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gdi.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gdi.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-glib.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-glib.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-glib.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-glib.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject-structs.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject-structs.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject-structs.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject-structs.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-gobject.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-graphite2.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-graphite2.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-graphite2.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-graphite2.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-icu.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-icu.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-icu.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-icu.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-iter.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-iter.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-iter.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-iter.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-kern.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-kern.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-kern.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-kern.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-machinery.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-machinery.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-machinery.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-machinery.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-map.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-meta.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-meta.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-meta.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-meta.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ms-feature-ranges.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ms-feature-ranges.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ms-feature-ranges.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ms-feature-ranges.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-mutex.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-mutex.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-mutex.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-mutex.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-null.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-null.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-null.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-null.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number-parser.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number-parser.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number-parser.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number-parser.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-number.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-object.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-object.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-object.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-object.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-file.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-file.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-file.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-file.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-type.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-type.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-type.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-open-type.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-std-str.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-std-str.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-std-str.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-std-str.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff1-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff2-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff2-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff2-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cff2-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cmap-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cmap-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cmap-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-cmap-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cbdt-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cbdt-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cbdt-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cbdt-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colr-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colr-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colr-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colr-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colrv1-closure.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colrv1-closure.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colrv1-closure.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-colrv1-closure.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cpal-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cpal-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cpal-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-cpal-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-sbix-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-sbix-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-sbix-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-sbix-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-svg-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-svg-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-svg-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color-svg-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-color.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-deprecated.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-deprecated.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-deprecated.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-deprecated.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face-table-list.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face-table-list.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face-table-list.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face-table-list.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-face.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-font.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-font.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-font.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-font.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-gasp-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-gasp-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-gasp-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-gasp-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-glyf-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-glyf-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-glyf-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-glyf-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hdmx-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hdmx-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hdmx-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hdmx-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-head-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-head-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-head-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-head-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hhea-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hhea-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hhea-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hhea-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hmtx-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hmtx-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hmtx-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-hmtx-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-kern-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-kern-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-kern-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-kern-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-base-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-base-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-base-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-base-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gdef-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gdef-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gdef-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gdef-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gpos-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gpos-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gpos-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gpos-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsub-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsub-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsub-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsub-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsubgpos.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsubgpos.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsubgpos.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-gsubgpos.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-jstf-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-jstf-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-jstf-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout-jstf-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-layout.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-map.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-map.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-map.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-map.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-math.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-maxp-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-maxp-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-maxp-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-maxp-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-meta.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-metrics.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language-static.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language-static.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language-static.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language-static.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-language.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-name.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-unicode-ranges.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-unicode-ranges.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-unicode-ranges.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-os2-unicode-ranges.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-macroman.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-macroman.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-macroman.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-macroman.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table-v2subset.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table-v2subset.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table-v2subset.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table-v2subset.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-post-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-fallback.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-fallback.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-fallback.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-fallback.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-joining-list.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-joining-list.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-joining-list.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-joining-list.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-win1256.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-win1256.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-win1256.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic-win1256.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-arabic.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic-machine.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic-machine.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic-machine.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic-machine.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-indic.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer-machine.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer-machine.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer-machine.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer-machine.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-khmer.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar-machine.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar-machine.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar-machine.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar-machine.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-myanmar.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-syllabic.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-syllabic.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-syllabic.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-syllabic.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-machine.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-machine.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-machine.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-machine.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-use-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-vowel-constraints.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-vowel-constraints.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-vowel-constraints.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex-vowel-constraints.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-complex.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-fallback.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-fallback.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-fallback.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-fallback.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-normalize.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-normalize.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-normalize.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape-normalize.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-shape.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-stat-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-stat-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-stat-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-stat-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-tag-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-tag-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-tag-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-tag-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-avar-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-avar-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-avar-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-avar-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-fvar-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-fvar-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-fvar-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-fvar-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-gvar-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-gvar-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-gvar-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-gvar-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-hvar-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-hvar-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-hvar-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-hvar-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-mvar-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-mvar-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-mvar-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var-mvar-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-var.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-vorg-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-vorg-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-vorg-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot-vorg-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ot.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-pool.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-pool.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-pool.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-pool.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-priority-queue.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-priority-queue.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-priority-queue.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-priority-queue.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-repacker.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-repacker.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-repacker.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-repacker.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-sanitize.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-sanitize.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-sanitize.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-sanitize.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-serialize.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-serialize.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-serialize.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-serialize.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set-digest.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set-digest.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set-digest.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set-digest.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-set.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape-plan.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shape.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-impl.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-impl.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-impl.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-impl.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-list.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-list.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-list.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper-list.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-shaper.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-string-array.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-string-array.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-string-array.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-string-array.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-style.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-style.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-style.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-style.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff-common.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff-common.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff-common.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff-common.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff1.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff1.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff1.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff1.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff2.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff2.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff2.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-cff2.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-input.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-input.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-input.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-input.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-plan.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-plan.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-plan.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-plan.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-repacker.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-repacker.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-repacker.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset-repacker.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-subset.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ucd-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ucd-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ucd-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-ucd-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode-emoji-table.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode-emoji-table.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode-emoji-table.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode-emoji-table.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-unicode.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-uniscribe.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-uniscribe.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-uniscribe.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-uniscribe.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-utf.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-utf.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-utf.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-utf.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-vector.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-vector.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-vector.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-vector.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-version.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb-version.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb-version.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb-version.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb.h b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb.h
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb.hh b/bsp/projects/microej/thirdparty/harfbuzz/inc/hb.hh
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/inc/hb.hh
rename to bsp/projects/microej/thirdparty/harfbuzz/inc/hb.hh
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/.gitignore b/bsp/projects/microej/thirdparty/harfbuzz/lib/.gitignore
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/.gitignore
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/.gitignore
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/README.md b/bsp/projects/microej/thirdparty/harfbuzz/lib/README.md
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/README.md
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/README.md
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.c b/bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.c
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.cmd b/bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.cmd
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.cmd
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/iarprebuild.cmd
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/lib_harfbuzz.ewp b/bsp/projects/microej/thirdparty/harfbuzz/lib/lib_harfbuzz.ewp
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/lib_harfbuzz.ewp
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/lib_harfbuzz.ewp
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/makefile b/bsp/projects/microej/thirdparty/harfbuzz/lib/makefile
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/makefile
rename to bsp/projects/microej/thirdparty/harfbuzz/lib/makefile
index 43f1f63..9a49ae0 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/lib/makefile
+++ b/bsp/projects/microej/thirdparty/harfbuzz/lib/makefile
@@ -54,7 +54,7 @@ ARCHFLAGS := -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb
CFLAGS := $(ARCHFLAGS)
CFLAGS += -D__NEWLIB__ -O3 -g3 -Wall -fmessage-length=0
-CFLAGS += -ffunction-sections -fdata-sections -ffreestanding -fno-builtin
+CFLAGS += -ffunction-sections -fdata-sections -fno-builtin
CFLAGS += -specs=nano.specs -fpermissive
# Some LIBC and LIBGCC files are needed in the harfbuzz.a library
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/harfbuzz.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/harfbuzz.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/harfbuzz.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/harfbuzz.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-layout.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-layout.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-layout.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-layout.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-map.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-map.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-map.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-aat-map.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-alloc.c b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-alloc.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-alloc.c
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-alloc.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-blob.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-blob.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-blob.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-blob.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-serialize.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-serialize.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-serialize.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-serialize.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-verify.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-verify.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-verify.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer-verify.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-buffer.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-common.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-common.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-common.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-common.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-coretext.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-coretext.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-coretext.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-coretext.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-directwrite.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-directwrite.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-directwrite.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-directwrite.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-draw.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-draw.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-draw.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-draw.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-face.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-face.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-face.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-face.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-fallback-shape.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-fallback-shape.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-fallback-shape.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-fallback-shape.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-font.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-font.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-font.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-font.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ft.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ft.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ft.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ft.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-gdi.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-gdi.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-gdi.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-gdi.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-glib.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-glib.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-glib.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-glib.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-gobject-structs.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-gobject-structs.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-gobject-structs.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-gobject-structs.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-graphite2.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-graphite2.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-graphite2.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-graphite2.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-icu.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-icu.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-icu.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-icu.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-map.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-map.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-map.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-map.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-number.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-number.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-number.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-number.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff1-table.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff1-table.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff1-table.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff1-table.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff2-table.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff2-table.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff2-table.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-cff2-table.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-color.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-color.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-color.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-color.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-face.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-face.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-face.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-face.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-font.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-font.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-font.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-font.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-layout.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-layout.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-layout.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-layout.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-map.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-map.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-map.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-map.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-math.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-math.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-math.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-math.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-meta.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-meta.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-meta.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-meta.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-metrics.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-metrics.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-metrics.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-metrics.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-name.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-name.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-name.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-name.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-shape.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-tag.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-tag.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-tag.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-tag.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-var.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-var.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-var.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ot-var.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-set.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-set.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-set.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-set.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape-plan.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape-plan.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape-plan.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape-plan.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-shape.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shaper.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-shaper.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-shaper.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-shaper.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-static.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-static.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-static.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-static.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-style.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-style.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-style.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-style.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff-common.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff-common.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff-common.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff-common.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff1.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff1.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff1.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff1.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff2.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff2.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff2.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-cff2.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-input.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-input.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-input.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-input.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-plan.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-plan.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-plan.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-plan.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-repacker.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-repacker.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-repacker.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset-repacker.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-subset.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ucd.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-ucd.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-ucd.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-ucd.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-unicode.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-unicode.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-unicode.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-unicode.cc
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-uniscribe.cc b/bsp/projects/microej/thirdparty/harfbuzz/src/hb-uniscribe.cc
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/harfbuzz/src/hb-uniscribe.cc
rename to bsp/projects/microej/thirdparty/harfbuzz/src/hb-uniscribe.cc
diff --git a/bsp/projects/microej/thirdparty/harfbuzz/thirdparty_harfbuzz.cmake b/bsp/projects/microej/thirdparty/harfbuzz/thirdparty_harfbuzz.cmake
new file mode 100644
index 0000000..d07764d
--- /dev/null
+++ b/bsp/projects/microej/thirdparty/harfbuzz/thirdparty_harfbuzz.cmake
@@ -0,0 +1,9 @@
+include_guard()
+message("microej/thirdparty/harfbuzz component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/src/harfbuzz.cc
+ ${CMAKE_CURRENT_LIST_DIR}/src/hb-alloc.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/inc)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/LICENSE b/bsp/projects/microej/thirdparty/systemview-freertos/LICENSE
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/LICENSE
rename to bsp/projects/microej/thirdparty/systemview-freertos/LICENSE
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h b/bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h
rename to bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h
index 69cd544..51e96cb 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h
+++ b/bsp/projects/microej/thirdparty/systemview-freertos/inc/SEGGER_SYSVIEW_FreeRTOS.h
@@ -153,19 +153,19 @@ Revision: $Rev: 7745 $
#define apiID_XSTREAMBUFFERRECEIVE (110u)
#define apiID_XSTREAMBUFFERRECEIVEFROMISR (111u)
-#define traceTASK_NOTIFY_TAKE() SEGGER_SYSVIEW_RecordU32x2(apiID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait)
+#define traceTASK_NOTIFY_TAKE(uxIndexToWait) SEGGER_SYSVIEW_RecordU32x2(apiID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait)
#define traceTASK_DELAY() SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VTASKDELAY, xTicksToDelay)
#define traceTASK_DELAY_UNTIL(xTimeToWake) SEGGER_SYSVIEW_RecordVoid (apiID_OFFSET + apiID_VTASKDELAYUNTIL)
-#define traceTASK_NOTIFY_GIVE_FROM_ISR() SEGGER_SYSVIEW_RecordU32x2(apiID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken)
+#define traceTASK_NOTIFY_GIVE_FROM_ISR(uxIndexToNotify) SEGGER_SYSVIEW_RecordU32x2(apiID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken)
#define traceTASK_PRIORITY_INHERIT( pxTCB, uxPriority ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VTASKPRIORITYINHERIT, (U32)pxMutexHolder)
#define traceTASK_RESUME( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VTASKRESUME, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
#define traceINCREASE_TICK_COUNT( xTicksToJump ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VTASKSTEPTICK, xTicksToJump)
#define traceTASK_SUSPEND( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VTASKSUSPEND, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
#define traceTASK_PRIORITY_DISINHERIT( pxTCB, uxBasePriority ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_XTASKPRIORITYDISINHERIT, (U32)pxMutexHolder)
#define traceTASK_RESUME_FROM_ISR( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_XTASKRESUMEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
-#define traceTASK_NOTIFY() SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XTASKGENERICNOTIFY, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue)
-#define traceTASK_NOTIFY_FROM_ISR() SEGGER_SYSVIEW_RecordU32x5(apiID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken)
-#define traceTASK_NOTIFY_WAIT() SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XTASKNOTIFYWAIT, ulBitsToClearOnEntry, ulBitsToClearOnExit, (U32)pulNotificationValue, xTicksToWait)
+#define traceTASK_NOTIFY(uxIndexToNotify) SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XTASKGENERICNOTIFY, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue)
+#define traceTASK_NOTIFY_FROM_ISR(uxIndexToNotify) SEGGER_SYSVIEW_RecordU32x5(apiID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken)
+#define traceTASK_NOTIFY_WAIT(uxIndexToWait) SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XTASKNOTIFYWAIT, ulBitsToClearOnEntry, ulBitsToClearOnExit, (U32)pulNotificationValue, xTicksToWait)
#define traceQUEUE_CREATE( pxNewQueue ) SEGGER_SYSVIEW_RecordU32x3(apiID_OFFSET + apiID_XQUEUEGENERICCREATE, uxQueueLength, uxItemSize, ucQueueType)
#define traceQUEUE_DELETE( pxQueue ) SEGGER_SYSVIEW_RecordU32 (apiID_OFFSET + apiID_VQUEUEDELETE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue))
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/src/SEGGER_SYSVIEW_FreeRTOS.c b/bsp/projects/microej/thirdparty/systemview-freertos/src/SEGGER_SYSVIEW_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview-freertos/src/SEGGER_SYSVIEW_FreeRTOS.c
rename to bsp/projects/microej/thirdparty/systemview-freertos/src/SEGGER_SYSVIEW_FreeRTOS.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/LICENSE b/bsp/projects/microej/thirdparty/systemview/LICENSE
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/LICENSE
rename to bsp/projects/microej/thirdparty/systemview/LICENSE
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/Global.h b/bsp/projects/microej/thirdparty/systemview/inc/Global.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/Global.h
rename to bsp/projects/microej/thirdparty/systemview/inc/Global.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT_configuration.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT_configuration.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT_configuration.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_RTT_configuration.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_ConfDefaults.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_ConfDefaults.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_ConfDefaults.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_ConfDefaults.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_Int.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_Int.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_Int.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_Int.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_configuration.h b/bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_configuration.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_configuration.h
rename to bsp/projects/microej/thirdparty/systemview/inc/SEGGER_SYSVIEW_configuration.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/src/SEGGER_RTT.c b/bsp/projects/microej/thirdparty/systemview/src/SEGGER_RTT.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/src/SEGGER_RTT.c
rename to bsp/projects/microej/thirdparty/systemview/src/SEGGER_RTT.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c b/bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c
rename to bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c
index 507fc5d..be2fecb 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c
+++ b/bsp/projects/microej/thirdparty/systemview/src/SEGGER_SYSVIEW.c
@@ -156,6 +156,7 @@ Additional information:
#include
#include
#include
+#include
/*********************************************************************
*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/inc/LLMJVM_MONITOR_sysview.h b/bsp/projects/microej/trace/inc/LLMJVM_MONITOR_sysview.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/inc/LLMJVM_MONITOR_sysview.h
rename to bsp/projects/microej/trace/inc/LLMJVM_MONITOR_sysview.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/inc/LLTRACE_sysview_configuration.h b/bsp/projects/microej/trace/inc/LLTRACE_sysview_configuration.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/inc/LLTRACE_sysview_configuration.h
rename to bsp/projects/microej/trace/inc/LLTRACE_sysview_configuration.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c b/bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c
rename to bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c
index 963ccdd..d0670b3 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c
+++ b/bsp/projects/microej/trace/src/LLMJVM_MONITOR_sysview.c
@@ -2,6 +2,7 @@
* C
*
* Copyright 2017-2021 MicroEJ Corp. All rights reserved.
+ * Copyright 2024 NXP
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -17,7 +18,7 @@
#include
#include
-#include
+#include
#include
#include
#include
@@ -99,7 +100,7 @@ void LLMJVM_MONITOR_SYSTEMVIEW_send_task_list(void) {
void LLMJVM_MONITOR_IMPL_initialize(bool auto_start) {
if(auto_start == true){
- TRACE_start();
+ LLTRACE_start();
}
SEGGER_SYSVIEW_OnTaskCreate(THREAD_GC_UID);
LLMJVM_MONITOR_SYSTEMVIEW_send_gc_thread_info();
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/src/LLTRACE_sysview.c b/bsp/projects/microej/trace/src/LLTRACE_sysview.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/src/LLTRACE_sysview.c
rename to bsp/projects/microej/trace/src/LLTRACE_sysview.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/systemview/SYSVIEW_MicroEJ.txt b/bsp/projects/microej/trace/systemview/SYSVIEW_MicroEJ.txt
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/trace/systemview/SYSVIEW_MicroEJ.txt
rename to bsp/projects/microej/trace/systemview/SYSVIEW_MicroEJ.txt
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper.h b/bsp/projects/microej/ui/inc/buttons_helper.h
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper.h
rename to bsp/projects/microej/ui/inc/buttons_helper.h
index 0e57785..3b15bb1 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper.h
+++ b/bsp/projects/microej/ui/inc/buttons_helper.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined BUTTONS_HELPER_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper_configuration.h b/bsp/projects/microej/ui/inc/buttons_helper_configuration.h
similarity index 79%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper_configuration.h
rename to bsp/projects/microej/ui/inc/buttons_helper_configuration.h
index 262e6a9..4714e7d 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_helper_configuration.h
+++ b/bsp/projects/microej/ui/inc/buttons_helper_configuration.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2019-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined BUTTONS_HELPER_CONFIGURATION_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_manager.h b/bsp/projects/microej/ui/inc/buttons_manager.h
similarity index 82%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_manager.h
rename to bsp/projects/microej/ui/inc/buttons_manager.h
index ddef1ba..248b5e9 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/buttons_manager.h
+++ b/bsp/projects/microej/ui/inc/buttons_manager.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined BUTTONS_MANAGER_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/color.h b/bsp/projects/microej/ui/inc/color.h
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/color.h
rename to bsp/projects/microej/ui/inc/color.h
index 78a5048..fccd170 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/color.h
+++ b/bsp/projects/microej/ui/inc/color.h
@@ -1,15 +1,16 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
/*
* @file
- * @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite. Provides
+ * a set of defines to manipulate colors.
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 8.0.1
*/
#if !defined COLOR_H
diff --git a/bsp/projects/microej/ui/inc/display_configuration.h b/bsp/projects/microej/ui/inc/display_configuration.h
new file mode 100644
index 0000000..216c985
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/display_configuration.h
@@ -0,0 +1,86 @@
+/*
+ * C
+ *
+ * Copyright 2019-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board. Provides a set of defines to configure the implementation.
+ * @author MicroEJ Developer Team
+ */
+
+#if !defined DISPLAY_CONFIGURATION_H
+# define DISPLAY_CONFIGURATION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+//#error "This header must be customized with platform specific configuration. Remove this #error when done. This file is not modified when a new version of the CCO is installed."
+
+/**
+ * @brief Compatibility sanity check value.
+ * This define value is checked in the implementation to validate that the version of this configuration
+ * is compatible with the implementation.
+ *
+ * This value must not be changed by the user of the CCO.
+ * This value must be incremented by the implementor of the CCO when a configuration define is added, deleted or modified.
+ */
+#define DISPLAY_CONFIGURATION_VERSION (3)
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Width of the display panel
+ */
+#define DISPLAY_PANEL_WIDTH (400)
+
+/*
+ * @brief Height of the display panel
+ */
+#define DISPLAY_PANEL_HEIGHT (392)
+
+/*
+ * @brief Width of the frame buffers
+ */
+#define FRAME_BUFFER_WIDTH (392)
+
+/*
+ * @brief Height of the frame buffers
+ */
+#define FRAME_BUFFER_HEIGHT (392)
+
+/*
+ * @brief Source image line alignment (in bytes), required by VGLite library
+ * when an image is used as source: 32 bits for RGB565 format
+ * (see _check_source_aligned() in vg_lite.c).
+ */
+#define VGLITE_IMAGE_LINE_ALIGN_BYTE (32)
+
+/*
+ * @brief Frame buffer line alignment (in bytes), required by VGLite library
+ * when frame buffer is used as source.
+ * Note: Set (1) to not use the frame buffer as source image.
+ * Note 2: Require a patch in fsl_dc_fb_dsi_cmd.c
+ */
+#define FRAME_BUFFER_LINE_ALIGN_BYTE (1) /* 1 | VGLITE_IMAGE_LINE_ALIGN_BYTE */
+
+/*
+ * @brief Available number of frame buffers
+ */
+#define FRAME_BUFFER_COUNT (2)
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined DISPLAY_CONFIGURATION_H
diff --git a/bsp/projects/microej/ui/inc/display_dma.h b/bsp/projects/microej/ui/inc/display_dma.h
new file mode 100644
index 0000000..4b411ad
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/display_dma.h
@@ -0,0 +1,88 @@
+/*
+ * C
+ *
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board. Provides a set of functions to drive a DMA (to use
+ * it as "framebuffer backcopy").
+ * @author MicroEJ Developer Team
+ * @version 7.0.0
+ */
+
+#if !defined DISPLAY_DMA_H
+#define DISPLAY_DMA_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "display_framebuffer.h"
+#include "ui_display_brs.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_LEGACY
+#define DISPLAY_DMA_ENABLED ( FRAME_BUFFER_COUNT > 1 )
+#endif
+
+// --------------------------------------------------------------------------------
+// Optional functions to implement (already implemented as weak functions)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Notifies the DMA will be used just after this call. The implementation
+ * must ensure the DMA can be used (power management, clocks, etc.).
+ *
+ * Default implementation does nothing.
+ */
+void DISPLAY_DMA_IMPL_notify_dma_start(void) ;
+
+/*
+ * @brief Notifies the DMA is not used anymore by the library until the next call to
+ * DISPLAY_DMA_IMPL_notify_dma_start().
+ *
+ * Default implementation does nothing.
+ */
+void DISPLAY_DMA_IMPL_notify_dma_stop(void) ;
+
+// -----------------------------------------------------------------------------
+// API
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief: Initialize the DMA synchronization between the framebuffers
+ *
+ * @param[in] framebuffers: display framebuffers
+ */
+void DISPLAY_DMA_initialize(const framebuffer_t * framebuffers[]);
+
+/*
+ * @brief: Starts a DMA transfert
+ *
+ * @param[in] src: source framebuffer
+ * @param[in] dst: destination framebuffer
+ * @param[in] ymin: first line to transfert
+ * @param[in] ymax: last line to transfert + 1
+ */
+void DISPLAY_DMA_start(framebuffer_t *src, framebuffer_t *dst, int ymin, int ymax);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined DISPLAY_DMA_H
diff --git a/bsp/projects/microej/ui/inc/display_framebuffer.h b/bsp/projects/microej/ui/inc/display_framebuffer.h
new file mode 100644
index 0000000..3fc4ed2
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/display_framebuffer.h
@@ -0,0 +1,113 @@
+/*
+ * C
+ *
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board. Provides a set of types to manipulate the frame and
+ * back buffers.
+ * @author MicroEJ Developer Team
+ * @version 7.0.0
+ */
+
+#if !defined DISPLAY_FRAMEBUFFER_H
+#define DISPLAY_FRAMEBUFFER_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "display_configuration.h"
+
+// -----------------------------------------------------------------------------
+// Configuration Sanity Check
+// -----------------------------------------------------------------------------
+
+/**
+ * Sanity check between the expected version of the configuration and the actual version of
+ * the configuration.
+ * If an error is raised here, it means that a new version of the CCO has been installed and
+ * the configuration display_configuration.h must be updated based on the one provided
+ * by the new CCO version.
+ */
+
+#if !defined DISPLAY_CONFIGURATION_VERSION
+#error "Undefined DISPLAY_CONFIGURATION_VERSION, it must be defined in display_configuration.h"
+#endif
+
+#if defined DISPLAY_CONFIGURATION_VERSION && DISPLAY_CONFIGURATION_VERSION != 3
+#error "Version of the configuration file display_configuration.h is not compatible with this implementation."
+#endif
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Available number of bytes per pixels (RGB565)
+ */
+#define FRAME_BUFFER_BYTE_PER_PIXEL (2)
+
+/*
+ * @brief Frame buffer alignment.
+ * - 4 bits are required by SMARTDMA
+ * - 64 bits are required by DMA
+ * Note: Full frame buffer memory size is a value aligned on 64 too;
+ * so next allocation behind frame buffer memory is aligned on 64 too.
+ */
+#define FRAME_BUFFER_ALIGN (64)
+
+/*
+ * @brief Macro to align data
+ */
+#define ALIGN(value, align) (((value) + (align) - 1) & ~((align) - 1))
+
+/*
+ * @brief Frame buffer line size in bytes (stride), according to FRAME_BUFFER_LINE_ALIGN
+ */
+#define FRAME_BUFFER_STRIDE_BYTE ALIGN(FRAME_BUFFER_WIDTH * FRAME_BUFFER_BYTE_PER_PIXEL, FRAME_BUFFER_LINE_ALIGN_BYTE)
+
+/*
+ * @brief Frame buffer line size in pixels (stride), according to FRAME_BUFFER_LINE_ALIGN
+ */
+#define FRAME_BUFFER_STRIDE_PIXELS (FRAME_BUFFER_STRIDE_BYTE / FRAME_BUFFER_BYTE_PER_PIXEL)
+
+// -----------------------------------------------------------------------------
+// Types
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Frame buffer structure definition
+ */
+typedef struct s_framebuffer {
+ uint16_t p[FRAME_BUFFER_HEIGHT][FRAME_BUFFER_STRIDE_PIXELS];
+} framebuffer_t;
+
+// -----------------------------------------------------------------------------
+// Variables
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Frame buffer address array
+ */
+extern const framebuffer_t * s_frameBufferAddress[FRAME_BUFFER_COUNT];
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined DISPLAY_FRAMEBUFFER_H
diff --git a/bsp/projects/microej/ui/inc/display_impl.h b/bsp/projects/microej/ui/inc/display_impl.h
new file mode 100644
index 0000000..c5b70ec
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/display_impl.h
@@ -0,0 +1,70 @@
+/*
+ * C
+ *
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board. Provides a set of functions to extend the implementation.
+ * @author MicroEJ Developer Team
+ * @version 7.0.0
+ *
+ * @brief This file lists a set of functions called by the display*.c files. First functions
+ * are mandatory; optional functions are listed in a second time.
+ *
+ * These functions are
+ * optional and a stub implementation is already available in the CCO (see display_stub.c).
+ */
+
+#if !defined DISPLAY_IMPL_H
+#define DISPLAY_IMPL_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "display_framebuffer.h"
+
+// --------------------------------------------------------------------------------
+// Optional functions to implement (already implemented as weak functions)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Notifies the LLUI_DISPLAY_IMPL is initialized. The implementation can
+ * initialize 3rd-party elements.
+ *
+ * Default implementation does nothing.
+ */
+void DISPLAY_IMPL_initialized(void) ;
+
+/*
+ * @brief Notifies the first frame buffer will be used just after this call and
+ * the second frame buffer will not be used anymore until the next call to
+ * DISPLAY_IMPL_update_frame_buffer_status().
+ *
+ * Default implementation does nothing.
+ *
+ * @param[in] frame_buffer_on: the frame buffer that will be used
+ * @param[in] frame_buffer_off: the frame buffer that not used anymore
+ */
+void DISPLAY_IMPL_update_frame_buffer_status(framebuffer_t* frame_buffer_on, framebuffer_t* frame_buffer_off);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined DISPLAY_IMPL_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/event_generator.h b/bsp/projects/microej/ui/inc/event_generator.h
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/event_generator.h
rename to bsp/projects/microej/ui/inc/event_generator.h
index f538886..c980de8 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/event_generator.h
+++ b/bsp/projects/microej/ui/inc/event_generator.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2014-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate.h b/bsp/projects/microej/ui/inc/framerate.h
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate.h
rename to bsp/projects/microej/ui/inc/framerate.h
index d539912..a3fa5a9 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate.h
+++ b/bsp/projects/microej/ui/inc/framerate.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2014-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined FRAMERATE_H
#define FRAMERATE_H
diff --git a/bsp/projects/microej/ui/inc/framerate_conf.h b/bsp/projects/microej/ui/inc/framerate_conf.h
new file mode 100644
index 0000000..1f6388d
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/framerate_conf.h
@@ -0,0 +1,22 @@
+/*
+ * C
+ *
+ * Copyright 2014-2020 MicroEJ Corp. All rights reserved.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
+ */
+#if !defined FRAMERATE_CONF_H
+#define FRAMERATE_CONF_H
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Change value to disable/enable the framerate monitoring:
+ * 0: Disables the framerate monitoring
+ * 1: Enables the framerate monitoring
+ */
+#define FRAMERATE_ENABLED 1
+
+#endif // !defined FRAMERATE_CONF_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate_impl.h b/bsp/projects/microej/ui/inc/framerate_impl.h
similarity index 82%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate_impl.h
rename to bsp/projects/microej/ui/inc/framerate_impl.h
index 5de3df8..0f7398c 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/framerate_impl.h
+++ b/bsp/projects/microej/ui/inc/framerate_impl.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2014-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder.h b/bsp/projects/microej/ui/inc/microui_event_decoder.h
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder.h
rename to bsp/projects/microej/ui/inc/microui_event_decoder.h
index 6140069..e53705d 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder.h
+++ b/bsp/projects/microej/ui/inc/microui_event_decoder.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,13 +9,12 @@
* @file
* @brief See microui_event_decoder.c.
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
#if !defined MICROUI_EVENT_DECODER_H
-# define MICROUI_EVENT_DECODER_H
+#define MICROUI_EVENT_DECODER_H
// -----------------------------------------------------------------------------
// Includes
@@ -32,7 +31,7 @@ extern "C" {
#endif
#ifdef MICROUIEVENTDECODER_ENABLED
-
+
// -----------------------------------------------------------------------------
// Types
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder_conf.h b/bsp/projects/microej/ui/inc/microui_event_decoder_conf.h
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder_conf.h
rename to bsp/projects/microej/ui/inc/microui_event_decoder_conf.h
index 37342d7..0d8cbf6 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_event_decoder_conf.h
+++ b/bsp/projects/microej/ui/inc/microui_event_decoder_conf.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,13 +9,12 @@
* @file
* @brief This file allows to configure the implementation of microui_event_decoder.c.
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
#if !defined MICROUI_EVENT_DECODER_CONF_H
-# define MICROUI_EVENT_DECODER_CONF_H
+#define MICROUI_EVENT_DECODER_CONF_H
// -----------------------------------------------------------------------------
// Includes
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_heap.h b/bsp/projects/microej/ui/inc/microui_heap.h
similarity index 90%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_heap.h
rename to bsp/projects/microej/ui/inc/microui_heap.h
index 665d5fb..70393f3 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/microui_heap.h
+++ b/bsp/projects/microej/ui/inc/microui_heap.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,13 +9,12 @@
* @file
* @brief See LLUI_DISPLAY_HEAP_impl.c.
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
#if !defined MICROUI_HEAP_H
-# define MICROUI_HEAP_H
+#define MICROUI_HEAP_H
// -----------------------------------------------------------------------------
// Includes
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper.h b/bsp/projects/microej/ui/inc/touch_helper.h
similarity index 81%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper.h
rename to bsp/projects/microej/ui/inc/touch_helper.h
index 6fda552..c0bbb62 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper.h
+++ b/bsp/projects/microej/ui/inc/touch_helper.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined TOUCH_HELPER_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper_configuration.h b/bsp/projects/microej/ui/inc/touch_helper_configuration.h
similarity index 76%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper_configuration.h
rename to bsp/projects/microej/ui/inc/touch_helper_configuration.h
index 26fd85b..97060da 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_helper_configuration.h
+++ b/bsp/projects/microej/ui/inc/touch_helper_configuration.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2019-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined TOUCH_HELPER_CONFIGURATION_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_manager.h b/bsp/projects/microej/ui/inc/touch_manager.h
similarity index 78%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_manager.h
rename to bsp/projects/microej/ui/inc/touch_manager.h
index 2b38f1a..76ae8ed 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/inc/touch_manager.h
+++ b/bsp/projects/microej/ui/inc/touch_manager.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined TOUCH_MANAGER_H
diff --git a/bsp/projects/microej/ui/inc/ui_display_brs.h b/bsp/projects/microej/ui/inc/ui_display_brs.h
new file mode 100644
index 0000000..a99e9d6
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_display_brs.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_DISPLAY_BRS_H
+#define UI_DISPLAY_BRS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Provides some implementations of the LLUI_DISPLAY_impl.h functions relating
+ * to the display buffer strategy (BRS).
+ *
+ * A BRS
+ * - implements the LLUI_DISPLAY_impl.h's API LLUI_DISPLAY_IMPL_refresh() and
+ * LLUI_DISPLAY_IMPL_newDrawingRegion().
+ * - calls the LLUI_DISPLAY_impl.h's API LLUI_DISPLAY_IMPL_flush() to let the display
+ * driver transmit / copy / flush back buffer data to the front buffer or swap back and
+ * front buffer (double or triple buffer management).
+ * - ensures the coherence of the back buffer's content before and after a flush.
+ *
+ * Several BRS are available in ui_display_brs_configuration.h (the implementation has
+ * to select one of them).
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "ui_util.h"
+#include "ui_display_brs_configuration.h"
+#include "ui_log.h"
+
+// -----------------------------------------------------------------------------
+// Configuration Sanity Check
+// -----------------------------------------------------------------------------
+
+/**
+ * Sanity check between the expected version of the configuration and the actual version of
+ * the configuration.
+ * If an error is raised here, it means that a new version of the CCO has been installed and
+ * the configuration ui_display_brs_configuration.h must be updated based on the one provided
+ * by the new CCO version.
+ */
+
+#if !defined UI_DISPLAY_BRS_CONFIGURATION_VERSION
+#error "Undefined UI_DISPLAY_BRS_CONFIGURATION_VERSION, it must be defined in ui_display_brs_configuration.h"
+#endif
+
+#if defined UI_DISPLAY_BRS_CONFIGURATION_VERSION && UI_DISPLAY_BRS_CONFIGURATION_VERSION != 1
+#error "Version of the configuration file ui_display_brs_configuration.h is not compatible with this implementation."
+#endif
+
+// -----------------------------------------------------------------------------
+// Macros and defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Logs a region (a rectangle)
+ */
+#define LOG_REGION(log,rect) LLTRACE_record_event_u32x4((LLUI_EVENT_group), (LLUI_EVENT_offset) + (log), (rect)->x1, (rect)->y1, (rect)->x2, (rect)->y2)
+
+
+// --------------------------------------------------------------------------------
+// Display BRS public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Restores (copies) the given rectangular region from old back buffer to the graphics
+ * context's current buffer (the destination buffer can be retrieved thanks
+ * LLUI_DISPLAY_getBufferAddress(&gc->image)).
+ *
+ * When the copy is synchronous (immediate), the implementation has to return
+ * DRAWING_DONE. When the copy is asynchronous (performed by a DMA for instance), the
+ * the implementation has to return DRAWING_RUNNING. As the end of the asynchronous
+ * copy, the implementation has to call LLUI_DISPLAY_notifyAsynchronousDrawingEnd()
+ * to unlock the caller of this function.
+ *
+ * The implementation of this function is optional; a weak function provides a simple
+ * implementation using memcpy().
+ *
+ * @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
+ * @param[in] old_back_buffer a MicroUI Image that symbolizes (targets) the old back buffer.
+ * @param[in] rect the rectangular region to copy from old back buffer to new back
+ * buffer.
+ */
+DRAWING_Status UI_DISPLAY_BRS_restore(MICROUI_GraphicsContext* gc, MICROUI_Image* old_back_buffer, ui_rect_t* rect);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DISPLAY_BRS_H
diff --git a/bsp/projects/microej/ui/inc/ui_display_brs_configuration.h b/bsp/projects/microej/ui/inc/ui_display_brs_configuration.h
new file mode 100644
index 0000000..9d83a14
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_display_brs_configuration.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_DISPLAY_BRS_CONFIGURATION_H
+#define UI_DISPLAY_BRS_CONFIGURATION_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Provides some implementations of the LLUI_DISPLAY_impl.h functions relating
+ * to the display buffer strategy (BRS).
+ *
+ * Several BRS are available. This header file allows to select an existing BRS or to
+ * let the BSP implements its own strategy. Note that if no strategy is used, the default
+ * Graphics Engine's strategy is used that consists to only called LLUI_DISPLAY_IMPL_flush()
+ * (always full screen, no restore).
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+//#error "This header must be customized with VEE Port specific configuration. Remove this #error when done. This file is not modified when a new version of the CCO is installed."
+
+/*
+ * @brief Compatibility sanity check value.
+ * This define value is checked in the implementation to validate that the version of this configuration
+ * is compatible with the implementation.
+ *
+ * This value must not be changed by the user of the CCO.
+ * This value must be incremented by the implementor of the CCO when a configuration define is added, deleted or modified.
+ */
+#define UI_DISPLAY_BRS_CONFIGURATION_VERSION (1)
+
+// -----------------------------------------------------------------------------
+// Display Buffer Refresh Strategies (BRS)
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Defines the "legacy" strategy (equivalent to the one available in UI Packs 13.x)
+ * dedicated to the buffer policy SWAP (see MicroEJ documentation).
+ */
+#define UI_DISPLAY_BRS_LEGACY (0u)
+
+/*
+ * @brief Defines the "single" strategy dedicated to the display with one buffer on the MCU side
+ * and one buffer on the display side (the front buffer is not mapped to the MCU address
+ * space). The refresh consists in transmitting the back buffer data to the front buffer. The
+ * content to transmit is a list of rectangles that have been modified since last flush or an
+ * unique rectangle that encapsulates all regions (see the option UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE).
+ *
+ * Note: the maximum number of rectangles given as parameter to the function
+ * LLUI_DISPLAY_IMPL_flush() is equal to UI_RECT_COLLECTION_MAX_LENGTH.
+ */
+#define UI_DISPLAY_BRS_SINGLE (1u)
+
+/*
+ * @brief Defines the "predraw" strategy that consists in restoring the back buffer with the
+ * content of the previous drawings (the past) just before the very first drawing after a
+ * flush (and not just after the flush).
+ *
+ * This strategy requires the available number of back buffers (i.e. the number of buffers
+ * where the drawings can be performed):
+ *
+ * #define UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT (2u)
+ *
+ * This strategy manages, by default, two or three back buffers. Its implementation can be
+ * easily modified to manage more back buffers. An error is thrown if the code is not modified
+ * and the number of back buffers is higher than three.
+ *
+ * A warning is thrown if there is only one back buffer because this strategy is optimized
+ * for two or more back buffers. However, this strategy works with only one buffer but it
+ * is a little bit too complex for this use case.
+ *
+ * Notes:
+ * - The maximum number of rectangles given as parameter to the function LLUI_DISPLAY_IMPL_flush()
+ * is equal to UI_RECT_COLLECTION_MAX_LENGTH.
+ * - This BRS takes in consideration the option UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE.
+ */
+#define UI_DISPLAY_BRS_PREDRAW (2u)
+
+// -----------------------------------------------------------------------------
+// Display BRS Implementation and Options
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Defines the display buffer strategy (BRS) to use: one of the strategies above,
+ * the Graphics Engine's default flush strategy or a BSP's custom flush strategy.
+ *
+ * When not set, the BSP has to implement the LLUI_DISPLAY_impl.h's API to define its custom
+ * display buffer strategy (otherwise the basic Graphics Engine's strategy will be used, see
+ * file comment).
+ */
+#ifndef UI_DISPLAY_BRS
+#define UI_DISPLAY_BRS (UI_DISPLAY_BRS_PREDRAW)
+#endif
+
+/*
+ * @brief Defines the available number of drawing buffers; in other words, the number of buffers the
+ * Graphics Engine can use to draw into. According to the display BRS and the LCD connection, a drawing
+ * buffer can be alternatively a back buffer (the buffer currently used by the Graphics Engine), a
+ * front buffer (the buffer currently used by the LCD driver to map the LCD device), a transmission
+ * buffer (the buffer currently used by the LCD driver to transmit the data to the LCD device) or a free
+ * buffer (a buffer currently unused).
+ *
+ * Warning: This counter only defines the buffers the Graphics Engine can use and not the buffer reserved
+ * to the LCD device (mapped or or not on the MCU address space).
+ */
+#ifndef UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT
+#define UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT (2u)
+#endif
+
+/*
+ * @brief Defines the number of rectangles the strategy uses when calling LLUI_DISPLAY_IMPL_flush().
+ * When set, the strategy gives only one rectangle that includes all dirty regions (a rectangle that
+ * encapsulates all rectangles). When not set, the strategy gives all rectangles.
+ *
+ * When the implementation of LLUI_DISPLAY_IMPL_flush() only consists to swap the back buffers, the
+ * rectangles list is useless.
+ *
+ * When the implementation of LLUI_DISPLAY_IMPL_flush() consists to transmit an unique portion of the
+ * back buffer (for instance: the back buffer is transmitted to the LCD through a DSI bus), the single
+ * rectangle mode is useful.
+ *
+ * When the implementation of LLUI_DISPLAY_IMPL_flush() consists to transmit several portions of the back
+ * buffer (for instance: the back buffer is transmitted to the LCD through a SPI bus), the rectangle list
+ * is useful.
+ *
+ * By default, the rectangles list is given as-is (the option is not enabled).
+ * @see the strategies comments to have more information on the use of this option.
+ */
+//#define UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DISPLAY_BRS_CONFIGURATION_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing.h b/bsp/projects/microej/ui/inc/ui_drawing.h
new file mode 100644
index 0000000..464f3d9
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing.h
@@ -0,0 +1,844 @@
+/*
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_DRAWING_H
+#define UI_DRAWING_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @brief Provides drawing functions called by MicroUI native drawing functions.
+ *
+ * Default MicroUI native drawing functions implementations manage the synchronization
+ * with the Graphics Engine and allow a third party drawer perform the drawings.
+ *
+ * This header file lists all drawing functions to implement. This cut between MicroUI
+ * native functions default implementation and this file allows to simplify the
+ * writing of drawing functions: a drawing function has just to consider the drawing
+ * itself and not the synchronization with the Graphics Engine.
+ *
+ * The drawer has the responsibility to check the graphics context (when not disabled
+ * by caller) and to update the new flush dirty region.
+ *
+ * This cut simplifies the MicroUI native function implementation, which becomes:
+ *
+ * void _drawing_native_xxx(MICROUI_GraphicsContext* gc, ...) {
+ * // tell to the Graphics Engine if drawing can be performed
+ * if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&_drawing_native_xxx)) {
+ * // perform the drawings and set drawing status
+ * LLUI_DISPLAY_setDrawingStatus(_drawing_xxx(gc, ...));
+ * }
+ * // else: refused drawing
+ * }
+ *
+ * When clip is checked very early, the native implementation becomes:
+ *
+ * void _drawing_native_xxx(MICROUI_GraphicsContext* gc, ...) {
+ * // tell to the Graphics Engine if drawing can be performed
+ * if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&_drawing_native_xxx)) {
+ * DRAWING_Status status;
+ *
+ * if (LLUI_DISPLAY_isInClip(gc, ...)) {
+ * // perform the drawings
+ * status = _drawing_xxx(gc, ...);
+ * }
+ * else {
+ * // drawing is out of clip: nothing to draw
+ * status = DRAWING_DONE;
+ * }
+ *
+ * // set drawing status
+ * LLUI_DISPLAY_setDrawingStatus(status);
+ * }
+ * // else: refused drawing
+ * }
+ *
+ * This cut allows to use a third party drawer like a dedicated CPU (hardware accelerator).
+ * However, all drawing functions are already implemented in ui_drawing.c as
+ * weak implementation. This allows to override one or several functions without
+ * the need to override all functions. Default ui_drawing.c implementation calls the
+ * Graphics Engine software algorithms.
+ *
+ * The Graphics Engine software algorithms are listed in ui_drawing_soft.h.
+ * This allows to the ui_drawing.h to test if it is able to perform a drawing and
+ * if not, to call the software algorithm instead. For instance a GPU may be able
+ * to draw an image applying a rotation but it can't apply this rotation and an opacity
+ * at the same time. In this case, the drawing implementation function has to check
+ * the parameter "alpha" and calls or not Graphics Engine software algorithm.
+ *
+ * The implementation of these drawings must respect the graphics context clip and
+ * the flush dirty region as explained in LLUI_PAINTER_impl.h.
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+#include
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Concat two defines
+ */
+#ifndef CONCAT
+#define CONCAT0(p,s) p ## s
+#define CONCAT(p,s) CONCAT0(p,s)
+#endif
+
+// --------------------------------------------------------------------------------
+// API
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Tells if drawer "1" matches the destination format. The VEE port must implement
+ * this function when it includes the support to target the destination format. It not, the
+ * default weak implementation in ui_drawing.c redirects all the drawings for this destination
+ * format in the stub implementation.
+ */
+bool UI_DRAWING_is_drawer_1(jbyte image_format);
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+/*
+ * @brief Tells drawer "2" matches the destination format. See UI_DRAWING_is_drawer_1.
+ */
+bool UI_DRAWING_is_drawer_2(jbyte image_format);
+
+#endif // #if (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+#endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Returns the new image row stride in bytes.
+ *
+ * @param[in] image_format the new RAW image format. The format is one value from the
+ * MICROUI_ImageFormat enumeration.
+ * @param[in] image_width the new image width (in pixels).
+ * @param[in] image_height the new image height (in pixels).
+ * @param[in] default_stride the minimal row stride (in bytes)
+ *
+ * @return expected row stride (in bytes)
+ *
+ * @see LLUI_DISPLAY_IMPL_getNewImageStrideInBytes()
+ */
+uint32_t UI_DRAWING_getNewImageStrideInBytes(jbyte image_format, uint32_t image_width, uint32_t image_height, uint32_t default_stride);
+
+/*
+ * @brief Adjusts the new image characteristics: data size and alignment.
+ *
+ * @param[in] image_format the new RAW image format. The format is one value from the
+ * MICROUI_ImageFormat enumeration.
+ * @param[in] width the new image width (in pixels).
+ * @param[in] height the new image height (in pixels).
+ * @param[in/out] data_size the minimal data size (in bytes).
+ * @param[in/out] data_alignment the minimal data alignment to respect (in bytes).
+ *
+ * @see LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics()
+ */
+void UI_DRAWING_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
+
+/*
+ * @brief Initializes the image's buffer.
+ *
+ * @param[in] image the MicroUI Image to initialize.
+ *
+ * @see LLUI_DISPLAY_IMPL_initializeNewImage()
+ */
+void UI_DRAWING_initializeNewImage(MICROUI_Image* image);
+
+/*
+ * @brief Frees the image's resources (if any). This function is called just before releasing
+ * the image buffer and closing the image.
+ *
+ * @param[in] image the MicroUI Image to close.
+ *
+ * @see LLUI_DISPLAY_IMPL_freeImageResources()
+ */
+void UI_DRAWING_freeImageResources(MICROUI_Image* image);
+
+/*
+ * @brief Draws a pixel at given position.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the pixel X coordinate.
+ * @param[in] y the pixel Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y);
+
+/*
+ * @brief Draws a line at between points startX,startY (included) and endX,endY (included).
+ * Note: startX may be higher than endX (and/or startY may be higher than endY).
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] startX the first pixel line X coordinate.
+ * @param[in] startY the first pixel line Y coordinate.
+ * @param[in] endX the last pixel line X coordinate.
+ * @param[in] endY the last pixel line Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+
+/*
+ * @brief Draws a horizontal line at between points x1,y (included) and x2,y (included).
+ * Caller ensures that x1 <= x2.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x1 the first pixel line X coordinate.
+ * @param[in] x2 the last pixel line X coordinate.
+ * @param[in] y the both pixels line Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+
+/*
+ * @brief Draws a vertical line at between points x,y1 (included) and x,y2 (included).
+ * Caller ensures that y1 <= y2.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the both pixels line X coordinate.
+ * @param[in] y1 the first pixel line Y coordinate.
+ * @param[in] y2 the last pixel line Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+
+/*
+ * @brief Draws an orthogonal rectangle at from top-left point x1,y1 (included) and bottom-right
+ * point x2,y2 (included).
+ * Caller ensures that x1 <= x2 and y1 <= y2.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x1 the top-left pixel X coordinate.
+ * @param[in] y1 the top-left pixel Y coordinate.
+ * @param[in] x2 the bottom-right pixel X coordinate.
+ * @param[in] y2 the top-right pixel Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Fills a rectangle at from top-left point x1,y1 (included) and bottom-right
+ * point x2,y2 (included).
+ * Caller ensures that x1 <= x2 and y1 <= y2.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x1 the top-left pixel X coordinate.
+ * @param[in] y1 the top-left pixel Y coordinate.
+ * @param[in] x2 the bottom-right pixel X coordinate.
+ * @param[in] y2 the top-right pixel Y coordinate.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Draws a rounded rectangle at from top-left point x,y (included) and bottom-right
+ * point x+width-1,y+height-1 (included).
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the rectangle width.
+ * @param[in] height the rectangle height.
+ * @param[in] cornerEllipseWidth the horizontal diameter of the arc at the corners.
+ * @param[in] cornerEllipseHeight the vertical diameter of the arc at the corners.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Fills a rounded rectangle at from top-left point x,y (included) and bottom-right
+ * point x+width-1,y+height-1 (included).
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the rectangle width.
+ * @param[in] height the rectangle height.
+ * @param[in] cornerEllipseWidth the horizontal diameter of the arc at the corners.
+ * @param[in] cornerEllipseHeight the vertical diameter of the arc at the corners.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Draws a circular arc covering the square defined by top-left point x,y (included)
+ * and bottom-right point x+diameter-1,y+diameter-1 (included).
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is
+ * defined as the center of the square whose origin is at (x,y) (upper-left corner)
+ * and whose dimension is given by width and height.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates
+ * a clockwise rotation.
+ *
+ * If either the given diameter is negative or zero, or if arcAngle is zero,
+ * nothing is drawn.
+ *
+ * The angles are given relative to the square. For instance an angle of 45
+ * degrees is always defined by the line from the center of the square to the
+ * upper right corner of the square.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] square the diameter of the arc to draw.
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Draws an elliptical arc covering the rectangle defined by top-left point x,y (included)
+ * and bottom-right point x+width-1,y+height-1 (included).
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is
+ * defined as the center of the rectangle whose origin is at (x,y) (upper-left corner)
+ * and whose dimension is given by width and height.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates
+ * a clockwise rotation.
+ *
+ * If either the given width or height is negative or zero, or if arcAngle is zero,
+ * nothing is drawn.
+ *
+ * The angles are given relative to the rectangle. For instance an angle of 45
+ * degrees is always defined by the line from the center of the rectangle to the
+ * upper right corner of the rectangle. Thus for a non squared rectangle
+ * angles are skewed along either height or width.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the rectangle width.
+ * @param[in] height the rectangle height.
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Fills a circular arc covering the square defined by top-left point x,y (included)
+ * and bottom-right point x+diameter-1,y+diameter-1 (included).
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is
+ * defined as the center of the rectangle whose origin is at (x,y) (upper-left corner)
+ * and whose dimension is given by width and height.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates
+ * a clockwise rotation.
+ *
+ * If either the given diameter is negative or zero, or if arcAngle is zero,
+ * nothing is drawn.
+ *
+ * The angles are given relative to the square. For instance an angle of 45
+ * degrees is always defined by the line from the center of the square to the
+ * upper right corner of the square.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] diameter the diameter of the arc to draw.
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Fills an elliptical arc covering the rectangle defined by top-left point x,y (included)
+ * and bottom-right point x+width-1,y+height-1 (included).
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is
+ * defined as the center of the rectangle whose origin is at (x,y) (upper-left corner)
+ * and whose dimension is given by width and height.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates
+ * a clockwise rotation.
+ *
+ * If either the given width or height is negative or zero, or if arcAngle is zero,
+ * nothing is drawn.
+ *
+ * The angles are given relative to the rectangle. For instance an angle of 45
+ * degrees is always defined by the line from the center of the rectangle to the
+ * upper right corner of the rectangle. Thus for a non squared rectangle
+ * angles are skewed along either height or width.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the rectangle width.
+ * @param[in] height the rectangle height.
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Draws an ellipse covering the rectangle defined by top-left point x,y (included)
+ * and bottom-right point x+width-1,y+height-1 (included). Ellipses which focal points are not
+ * on the same axis are not supported.
+ *
+ * If either the given width or height is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the ellipse width.
+ * @param[in] height the ellipse height.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Fills an ellipse covering the rectangle defined by top-left point x,y (included)
+ * and bottom-right point x+width-1,y+height-1 (included).
+ *
+ * If either the given width or height is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] width the ellipse width.
+ * @param[in] height the ellipse height.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Draws a circle covering the square defined by top-left point x,y (included)
+ * and bottom-right point x+diameter-1,y+diameter-1 (included).
+ *
+ * If the given diameter is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] diameter the circle square size.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Fills a circle covering the square defined by top-left point x,y (included)
+ * and bottom-right point x+diameter-1,y+diameter-1 (included)
+ *
+ * If the given diameter is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the top-left pixel X coordinate.
+ * @param[in] y the top-left pixel Y coordinate.
+ * @param[in] diameter the circle square size.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Draws a region of an image.
+ *
+ * The image and the destination (MICROUI_GraphicsContext) never target the same image. See
+ * UI_DRAWING_copyImage() and UI_DRAWING_drawRegion().
+ *
+ * The region of the image to draw is given relative to the image (origin at the
+ * upper-left corner) as a rectangle.
+ *
+ * If the specified source region exceeds the image bounds, the copied region is
+ * limited to the image boundary. If the copied region goes out of the bounds of
+ * the graphics context area, pixels out of the range will not be drawn.
+ *
+ * A global opacity value is given. When this value is 0xff (255, opaque), that means the image
+ * is drawn on the graphics context without managing an extra opacity. Only the image transparent
+ * pixels must have been merged with destination. All image opaque pixels override destination.
+ *
+ * When this value is a value between 0 and 0xff, that means each pixel of the image must be merged
+ * with destination in addition with the image transparent pixels. An image opaque pixel becomes
+ * transparent (its opacity is the given alpha) and the opacity of an image transparent pixel becomes
+ * (alpha * alpha(pixel)) / 255.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] regionX the x coordinate of the upper-left corner of the region to copy.
+ * @param[in] regionY the y coordinate of the upper-left corner of the region to copy.
+ * @param[in] width the width of the region to copy.
+ * @param[in] height the height of the region to copy.
+ * @param[in] x the x coordinate of the top-left point in the destination.
+ * @param[in] y the y coordinate of the top-left point in the destination.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Copy a region of an image in another image with the same pixel format.
+ *
+ * Contrary to UI_DRAWING_drawImage(), the opacity is not an option. As the source and destination
+ * have the same pixel representation, this function has just to perform a "memory copy".
+ *
+ * The region of the image to draw is given relative to the image (origin at the
+ * upper-left corner) as a rectangle.
+ *
+ * If the specified source region exceeds the image bounds, the copied region is
+ * limited to the image boundary. If the copied region goes out of the bounds of
+ * the graphics context area, pixels out of the range will not be drawn.
+ *
+ * The image and the destination (MICROUI_GraphicsContext) may target the same image. By consequence,
+ * the implementation has to check the "overlap" use-case: the region to copy overlaps the destination
+ * region.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to copy.
+ * @param[in] regionX the x coordinate of the upper-left corner of the region to copy.
+ * @param[in] regionY the y coordinate of the upper-left corner of the region to copy.
+ * @param[in] width the width of the region to copy.
+ * @param[in] height the height of the region to copy.
+ * @param[in] x the x coordinate of the top-left point in the destination.
+ * @param[in] y the y coordinate of the top-left point in the destination.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+/*
+ * @brief Draw a region of an image in the same image.
+ *
+ * Contrary to UI_DRAWING_drawImage(), the implementation has to check the "overlap" use-case:
+ * the region to copy overlaps the destination region.
+ *
+ * The region of the image to draw is given relative to the image (origin at the
+ * upper-left corner) as a rectangle.
+ *
+ * If the specified source region exceeds the image bounds, the copied region is
+ * limited to the image boundary. If the copied region goes out of the bounds of
+ * the graphics context area, pixels out of the range will not be drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext source and target.
+ * @param[in] regionX the x coordinate of the upper-left corner of the region to copy.
+ * @param[in] regionY the y coordinate of the upper-left corner of the region to copy.
+ * @param[in] width the width of the region to copy.
+ * @param[in] height the height of the region to copy.
+ * @param[in] x the x coordinate of the top-left point in the destination.
+ * @param[in] y the y coordinate of the top-left point in the destination.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Draws a thick point with fade at given position.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the point X coordinate.
+ * @param[in] y the point Y coordinate.
+ * @param[in] thickness the point thickness.
+ * @param[in] fade the fade to apply.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+
+/*
+ * @brief Draws a thick line with fade between given points.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] startX the x coordinate of the start of the line
+ * @param[in] startY the y coordinate of the start of the line
+ * @param[in] endX the x coordinate of the end of the line
+ * @param[in] endY the y coordinate of the end of the line
+ * @param[in] thickness the line thickness.
+ * @param[in] fade the fade to apply.
+ * @param[in] startCap cap representation of start of shape
+ * @param[in] endCap cap representation of end of shape
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+
+/*
+ * @brief Draws a thick circle with fade covering the square specified by its diameter.
+ *
+ * If diameter is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] diameter the diameter of the circle to draw
+ * @param[in] thickness the circle thickness.
+ * @param[in] fade the fade to apply.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+
+/*
+ * @brief Draws a thick circle with fade arc covering the specified square.
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc
+ * is defined as the center of the square whose origin is at (x,y) (upper-left
+ * corner) and whose dimension is given by diameter.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates
+ * a clockwise rotation.
+ *
+ * If diameter is negative or zero, nothing is drawn.
+ *
+ * The angles are given relative to the square. For instance an angle of 45 degrees
+ * is always defined by the line from the center of the square to the upper right
+ * corner of the square. Thus for a non squared square angles are skewed along
+ * either height or width.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] diameter the diameter of the circle to draw
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ * @param[in] thickness the arc thickness.
+ * @param[in] fade the fade to apply.
+ * @param[in] start cap representation of start of shape
+ * @param[in] end cap representation of end of shape
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+
+/*
+ * @brief Draws a thick ellipse with fade covering the specified rectangle.
+ *
+ * The center of the ellipse is defined as the center of the rectangle whose origin
+ * is at (x,y) (upper-left corner) and whose dimension is given by width and height.
+ *
+ * If either width or height is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the rectangle where the ellipse is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the rectangle where the ellipse is drawn
+ * @param[in] width the width of the ellipse to draw
+ * @param[in] height the height of the ellipse to draw
+ * @param[in] thickness the ellipse thickness.
+ * @param[in] fade the fade to apply.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+
+/*
+ * @brief Draws a thick line between given points.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] startX the x coordinate of the start of the line
+ * @param[in] startY the y coordinate of the start of the line
+ * @param[in] endX the x coordinate of the end of the line
+ * @param[in] endY the y coordinate of the end of the line
+ * @param[in] thickness the line thickness.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+
+/*
+ * @brief Draws a thick circle covering the square specified by its diameter.
+ *
+ * If diameter is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] diameter the diameter of the circle to draw
+ * @param[in] thickness the circle thickness.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Draws a thick ellipse covering the specified rectangle.
+ *
+ * The center of the ellipse is defined as the center of the rectangle whose origin
+ * is at (x,y) (upper-left corner) and whose dimension is given by width and height.
+ *
+ * If either width or height is negative or zero, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the square where the circle is drawn
+ * @param[in] width the width of the ellipse to draw
+ * @param[in] height the height of the ellipse to draw
+ * @param[in] thickness the circle thickness.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Draws a thick arc covering the square specified by its diameter.
+ *
+ * The arc is drawn from startAngle up to arcAngle degrees. The center of the arc is
+ * defined as the center of the square whose origin is at (x,y) (upper-left corner)
+ * and whose dimension is given by diameter.
+ *
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive
+ * value indicates a counter-clockwise rotation while a negative value indicates a
+ * clockwise rotation.
+ *
+ * If diameter is negative, nothing is drawn.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] x the x coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] y the y coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] diameter the diameter of the circle to draw
+ * @param[in] startAngle the beginning angle of the arc to draw
+ * @param[in] arcAngle the angular extent of the arc from startAngle
+ * @param[in] thickness the arc thickness.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+
+/*
+ * @brief Draws an image applying a flip (0, 90, 180 or 270 degrees with or without
+ * mirror).
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] regionX the x coordinate of the upper-left corner of the region to draw.
+ * @param[in] regionY the y coordinate of the upper-left corner of the region to draw.
+ * @param[in] width the width of the region to copy.
+ * @param[in] height the height of the region to copy.
+ * @param[in] x the x coordinate of the top-left point in the destination.
+ * @param[in] y the y coordinate of the top-left point in the destination.
+ * @param[in] transformation the flip to apply.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+/*
+ * @brief Draws an image applying a free rotation (0 to 360 degrees).
+ *
+ * The rotation is specified by the center and the angle. The reference point is
+ * the graphical object top-left corner. The rotation point is relative where the
+ * graphical object will be drawn.
+ *
+ * This method uses the nearest neighbor algorithm to render the content. This algorithm
+ * is faster than bilinear algorithm but its rendering is faster.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] x the x coordinate of the image reference anchor top-left point.
+ * @param[in] y the y coordinate of the image reference anchor top-left point.
+ * @param[in] rotationX the x coordinate of the rotation center.
+ * @param[in] rotationY the y coordinate of the rotation center.
+ * @param[in] angle the rotation angle.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Draws an image applying a free rotation (0 to 360 degrees).
+ *
+ * The rotation is specified by the center and the angle. The reference point is
+ * the graphical object top-left corner. The rotation point is relative where the
+ * graphical object will be drawn.
+ *
+ * This method uses the bilinear algorithm to render the content. This algorithm
+ * performs better rendering than nearest neighbor algorithm but it is slower to
+ * apply.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] x the x coordinate of the image reference anchor top-left point.
+ * @param[in] y the y coordinate of the image reference anchor top-left point.
+ * @param[in] rotationX the x coordinate of the rotation center.
+ * @param[in] rotationY the y coordinate of the rotation center.
+ * @param[in] angle the rotation angle.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Draws an image applying a scaling.
+ *
+ * This method uses the nearest neighbor algorithm to render the content. This algorithm
+ * is faster than bilinear algorithm but its rendering is faster.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] x the x coordinate of the image reference anchor top-left point.
+ * @param[in] y the y coordinate of the image reference anchor top-left point.
+ * @param[in] factorX scaling X factor.
+ * @param[in] factorY scaling Y factor.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+/*
+ * @brief Draws an image applying a scaling.
+ *
+ * This method uses the bilinear algorithm to render the content. This algorithm
+ * performs better rendering than nearest neighbor algorithm but it is slower to
+ * apply.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] img the MicroUI Image to draw.
+ * @param[in] x the x coordinate of the image reference anchor top-left point.
+ * @param[in] y the y coordinate of the image reference anchor top-left point.
+ * @param[in] factorX scaling X factor.
+ * @param[in] factorY scaling Y factor.
+ * @param[in] alpha the opacity level to apply to the region.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status UI_DRAWING_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DRAWING_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing_bvi.h b/bsp/projects/microej/ui/inc/ui_drawing_bvi.h
new file mode 100644
index 0000000..9bae930
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing_bvi.h
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_DRAWING_BVI_H
+#define UI_DRAWING_BVI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of a set of ui_drawing.h drawing functions (MicroUI and
+ * Drawing libraries). These are implementations over a BufferedVectorImage and
+ * the destination buffer format is the BufferedVectorImage format. When the drawing
+ * cannot be performed for any reason, the stub implementation is used instead.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+#include "microvg_configuration.h"
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Redirects all ui_drawing.h functions to the BufferedVectorImage functions
+ */
+
+#define UI_DRAWING_BVI_is_drawer CONCAT(UI_DRAWING_is_drawer_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_adjustNewImageCharacteristics CONCAT(UI_DRAWING_adjustNewImageCharacteristics_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_initializeNewImage CONCAT(UI_DRAWING_initializeNewImage_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_freeImageResources CONCAT(UI_DRAWING_freeImageResources_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+
+#define UI_DRAWING_BVI_drawLine CONCAT(UI_DRAWING_drawLine_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawHorizontalLine CONCAT(UI_DRAWING_drawHorizontalLine_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawVerticalLine CONCAT(UI_DRAWING_drawVerticalLine_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillRectangle CONCAT(UI_DRAWING_fillRectangle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawRoundedRectangle CONCAT(UI_DRAWING_drawRoundedRectangle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillRoundedRectangle CONCAT(UI_DRAWING_fillRoundedRectangle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawCircleArc CONCAT(UI_DRAWING_drawCircleArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawEllipseArc CONCAT(UI_DRAWING_drawEllipseArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillCircleArc CONCAT(UI_DRAWING_fillCircleArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillEllipseArc CONCAT(UI_DRAWING_fillEllipseArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawEllipse CONCAT(UI_DRAWING_drawEllipse_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillEllipse CONCAT(UI_DRAWING_fillEllipse_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawCircle CONCAT(UI_DRAWING_drawCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_fillCircle CONCAT(UI_DRAWING_fillCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickFadedPoint CONCAT(UI_DRAWING_drawThickFadedPoint_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickFadedLine CONCAT(UI_DRAWING_drawThickFadedLine_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickFadedCircle CONCAT(UI_DRAWING_drawThickFadedCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickFadedCircleArc CONCAT(UI_DRAWING_drawThickFadedCircleArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickFadedEllipse CONCAT(UI_DRAWING_drawThickFadedEllipse_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickLine CONCAT(UI_DRAWING_drawThickLine_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickCircle CONCAT(UI_DRAWING_drawThickCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickEllipse CONCAT(UI_DRAWING_drawThickEllipse_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define UI_DRAWING_BVI_drawThickCircleArc CONCAT(UI_DRAWING_drawThickCircleArc_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h API
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Implementation of adjustNewImageCharacteristics for a BufferedVectorImage. See ui_drawing.h
+ */
+void UI_DRAWING_BVI_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
+
+/*
+ * @brief Implementation of initializeNewImage for a BufferedVectorImage. See ui_drawing.h
+ */
+void UI_DRAWING_BVI_initializeNewImage(MICROUI_Image* image);
+
+/*
+ * @brief Implementation of freeImageResources for a BufferedVectorImage. See ui_drawing.h
+ */
+void UI_DRAWING_BVI_freeImageResources(MICROUI_Image* image) ;
+
+/*
+ * @brief Implementation of drawLine over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+
+/*
+ * @brief Implementation of drawHorizontalLine over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+
+/*
+ * @brief Implementation of drawVerticalLine over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+
+/*
+ * @brief Implementation of fillRectangle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Implementation of drawRoundedRectangle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of fillRoundedRectangle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of drawCircleArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipseArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillCircleArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillEllipseArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipse over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of fillEllipse over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of drawCircle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of fillCircle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of drawImage over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Implementation of copyImage over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+/*
+ * @brief Implementation of drawRegion over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Implementation of drawThickFadedPoint over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickFadedLine over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+
+/*
+ * @brief Implementation of drawThickFadedCircle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickFadedCircleArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+
+/*
+ * @brief Implementation of drawThickFadedEllipse over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickLine over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircle over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Implementation of drawThickEllipse over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircleArc over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+
+/*
+ * @brief Implementation of drawFlippedImage over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+/*
+ * @brief Implementation of drawRotatedImageNearestNeighbor over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Implementation of drawRotatedImageBilinear over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Implementation of drawScaledImageNearestNeighbor over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+/*
+ * @brief Implementation of drawScaledImageBilinear over a BufferedVectorImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_BVI_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DRAWING_BVI_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing_stub.h b/bsp/projects/microej/ui/inc/ui_drawing_stub.h
new file mode 100644
index 0000000..4033181
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing_stub.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_DRAWING_STUB_H
+#define UI_DRAWING_STUB_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of all drawing functions of ui_drawing.h (MicroUI and Drawing libraries).
+ * These are stubbed implementations, there is no error but the drawings are not performed. Useful to
+ * stub a drawing on a custom destination (custom GraphicsContext format not supported by the Graphics
+ * Engine).
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// Public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Stubbed implementation of writePixel. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y);
+
+/*
+ * @brief Stubbed implementation of drawLine. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+
+/*
+ * @brief Stubbed implementation of drawHorizontalLine. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+
+/*
+ * @brief Stubbed implementation of drawVerticalLine. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+
+/*
+ * @brief Stubbed implementation of drawRectangle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Stubbed implementation of fillRectangle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Stubbed implementation of drawRoundedRectangle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Stubbed implementation of fillRoundedRectangle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Stubbed implementation of drawCircleArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Stubbed implementation of drawEllipseArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Stubbed implementation of fillCircleArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Stubbed implementation of fillEllipseArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Stubbed implementation of drawEllipse. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Stubbed implementation of fillEllipse. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Stubbed implementation of drawCircle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Stubbed implementation of fillCircle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Stubbed implementation of drawImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Stubbed implementation of copyImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+/*
+ * @brief Stubbed implementation of drawRegion. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Stubbed implementation of drawThickFadedPoint. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+
+/*
+ * @brief Stubbed implementation of drawThickFadedLine. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+
+/*
+ * @brief Stubbed implementation of drawThickFadedCircle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+
+/*
+ * @brief Stubbed implementation of drawThickFadedCircleArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+
+/*
+ * @brief Stubbed implementation of drawThickFadedEllipse. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+
+/*
+ * @brief Stubbed implementation of drawThickLine. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+
+/*
+ * @brief Stubbed implementation of drawThickCircle. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Stubbed implementation of drawThickEllipse. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Stubbed implementation of drawThickCircleArc. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+
+/*
+ * @brief Stubbed implementation of drawFlippedImage. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+/*
+ * @brief Stubbed implementation of drawRotatedImageNearestNeighbor. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Stubbed implementation of drawRotatedImageBilinear. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Stubbed implementation of drawScaledImageNearestNeighbor. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+/*
+ * @brief Stubbed implementation of drawScaledImageBilinear. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_STUB_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DRAWING_STUB_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing_vglite.h b/bsp/projects/microej/ui/inc/ui_drawing_vglite.h
new file mode 100644
index 0000000..4b12a4c
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing_vglite.h
@@ -0,0 +1,289 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_DRAWING_VGLITE_H
+#define UI_DRAWING_VGLITE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of a set of ui_drawing.h drawing functions (MicroUI and Drawing libraries).
+ * These are implementations over VGLite and the destination buffer format is the format specified
+ * in the VEE port. When the drawing cannot be performed by the GPU, the software implementation
+ * is used instead.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_drawing.h"
+
+#include "vg_lite.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions UI_DRAWING_VGLITE_xxx() are directly called by LLUI_PAINTER_impl.c
+ * and LLDW_PAINTER_impl.c. This file overrides each function independently to use the
+ * VGLite GPU.
+ */
+
+#define UI_DRAWING_VGLITE_writePixel UI_DRAWING_writePixel
+#define UI_DRAWING_VGLITE_drawLine UI_DRAWING_drawLine
+#define UI_DRAWING_VGLITE_drawHorizontalLine UI_DRAWING_drawHorizontalLine
+#define UI_DRAWING_VGLITE_drawVerticalLine UI_DRAWING_drawVerticalLine
+#define UI_DRAWING_VGLITE_drawRectangle UI_DRAWING_drawRectangle
+#define UI_DRAWING_VGLITE_fillRectangle UI_DRAWING_fillRectangle
+#define UI_DRAWING_VGLITE_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle
+#define UI_DRAWING_VGLITE_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle
+#define UI_DRAWING_VGLITE_drawCircleArc UI_DRAWING_drawCircleArc
+#define UI_DRAWING_VGLITE_drawEllipseArc UI_DRAWING_drawEllipseArc
+#define UI_DRAWING_VGLITE_fillCircleArc UI_DRAWING_fillCircleArc
+#define UI_DRAWING_VGLITE_fillEllipseArc UI_DRAWING_fillEllipseArc
+#define UI_DRAWING_VGLITE_drawEllipse UI_DRAWING_drawEllipse
+#define UI_DRAWING_VGLITE_fillEllipse UI_DRAWING_fillEllipse
+#define UI_DRAWING_VGLITE_drawCircle UI_DRAWING_drawCircle
+#define UI_DRAWING_VGLITE_fillCircle UI_DRAWING_fillCircle
+#define UI_DRAWING_VGLITE_drawImage UI_DRAWING_drawImage
+#define UI_DRAWING_VGLITE_copyImage UI_DRAWING_copyImage
+#define UI_DRAWING_VGLITE_drawRegion UI_DRAWING_drawRegion
+
+#define UI_DRAWING_VGLITE_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint
+#define UI_DRAWING_VGLITE_drawThickFadedLine UI_DRAWING_drawThickFadedLine
+#define UI_DRAWING_VGLITE_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle
+#define UI_DRAWING_VGLITE_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc
+#define UI_DRAWING_VGLITE_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse
+#define UI_DRAWING_VGLITE_drawThickLine UI_DRAWING_drawThickLine
+#define UI_DRAWING_VGLITE_drawThickCircle UI_DRAWING_drawThickCircle
+#define UI_DRAWING_VGLITE_drawThickEllipse UI_DRAWING_drawThickEllipse
+#define UI_DRAWING_VGLITE_drawThickCircleArc UI_DRAWING_drawThickCircleArc
+#define UI_DRAWING_VGLITE_drawFlippedImage UI_DRAWING_drawFlippedImage
+#define UI_DRAWING_VGLITE_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor
+#define UI_DRAWING_VGLITE_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear
+#define UI_DRAWING_VGLITE_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor
+#define UI_DRAWING_VGLITE_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear
+
+#else // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions UI_DRAWING_VGLITE_xxx() are indirectly called through some tables.
+ * The functions have got the identifier "0" as suffix. This file overrides each function
+ * independently to use the VGLite GPU.
+ */
+
+#define UI_DRAWING_VGLITE_writePixel UI_DRAWING_writePixel_0
+#define UI_DRAWING_VGLITE_drawLine UI_DRAWING_drawLine_0
+#define UI_DRAWING_VGLITE_drawHorizontalLine UI_DRAWING_drawHorizontalLine_0
+#define UI_DRAWING_VGLITE_drawVerticalLine UI_DRAWING_drawVerticalLine_0
+#define UI_DRAWING_VGLITE_drawRectangle UI_DRAWING_drawRectangle_0
+#define UI_DRAWING_VGLITE_fillRectangle UI_DRAWING_fillRectangle_0
+#define UI_DRAWING_VGLITE_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle_0
+#define UI_DRAWING_VGLITE_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle_0
+#define UI_DRAWING_VGLITE_drawCircleArc UI_DRAWING_drawCircleArc_0
+#define UI_DRAWING_VGLITE_drawEllipseArc UI_DRAWING_drawEllipseArc_0
+#define UI_DRAWING_VGLITE_fillCircleArc UI_DRAWING_fillCircleArc_0
+#define UI_DRAWING_VGLITE_fillEllipseArc UI_DRAWING_fillEllipseArc_0
+#define UI_DRAWING_VGLITE_drawEllipse UI_DRAWING_drawEllipse_0
+#define UI_DRAWING_VGLITE_fillEllipse UI_DRAWING_fillEllipse_0
+#define UI_DRAWING_VGLITE_drawCircle UI_DRAWING_drawCircle_0
+#define UI_DRAWING_VGLITE_fillCircle UI_DRAWING_fillCircle_0
+#define UI_DRAWING_VGLITE_drawImage UI_DRAWING_drawImage_0
+#define UI_DRAWING_VGLITE_copyImage UI_DRAWING_copyImage_0
+#define UI_DRAWING_VGLITE_drawRegion UI_DRAWING_drawRegion_0
+
+#define UI_DRAWING_VGLITE_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint_0
+#define UI_DRAWING_VGLITE_drawThickFadedLine UI_DRAWING_drawThickFadedLine_0
+#define UI_DRAWING_VGLITE_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle_0
+#define UI_DRAWING_VGLITE_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc_0
+#define UI_DRAWING_VGLITE_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse_0
+#define UI_DRAWING_VGLITE_drawThickLine UI_DRAWING_drawThickLine_0
+#define UI_DRAWING_VGLITE_drawThickCircle UI_DRAWING_drawThickCircle_0
+#define UI_DRAWING_VGLITE_drawThickEllipse UI_DRAWING_drawThickEllipse_0
+#define UI_DRAWING_VGLITE_drawThickCircleArc UI_DRAWING_drawThickCircleArc_0
+#define UI_DRAWING_VGLITE_drawFlippedImage UI_DRAWING_drawFlippedImage_0
+#define UI_DRAWING_VGLITE_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor_0
+#define UI_DRAWING_VGLITE_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear_0
+#define UI_DRAWING_VGLITE_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor_0
+#define UI_DRAWING_VGLITE_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear_0
+
+#endif // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h API
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Implementation of drawLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+
+/*
+ * @brief Implementation of drawHorizontalLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+
+/*
+ * @brief Implementation of drawVerticalLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+
+/*
+ * @brief Implementation of fillRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Implementation of drawRoundedRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of fillRoundedRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of drawCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipseArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillEllipseArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of fillEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of drawCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of fillCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of drawImage over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Implementation of copyImage over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+/*
+ * @brief Implementation of drawRegion over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Implementation of drawThickFadedPoint over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickFadedLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+
+/*
+ * @brief Implementation of drawThickFadedCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickFadedCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+
+/*
+ * @brief Implementation of drawThickFadedEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+
+/*
+ * @brief Implementation of drawThickLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Implementation of drawThickEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+
+/*
+ * @brief Implementation of drawFlippedImage over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+/*
+ * @brief Implementation of drawRotatedImageNearestNeighbor over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Implementation of drawRotatedImageBilinear over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Implementation of drawScaledImageNearestNeighbor over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+/*
+ * @brief Implementation of drawScaledImageBilinear over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DRAWING_VGLITE_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing_vglite_path.h b/bsp/projects/microej/ui/inc/ui_drawing_vglite_path.h
new file mode 100644
index 0000000..c65ac20
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing_vglite_path.h
@@ -0,0 +1,474 @@
+/*
+ * C
+ *
+ * Copyright 2019-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite. Provides
+ * a set of defines and functions to compute some shapes in VGLite paths.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+#if !defined UI_DRAWING_VGLITE_PATH_H
+#define UI_DRAWING_VGLITE_PATH_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "mej_math.h"
+
+#include "vg_lite.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Length of a VGLite line path
+ */
+#define MEJ_VGLITE_PATH_LINE_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 6 * MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) /* line have 6 sides */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Length of a VGLite thick shape line path
+ */
+#define MEJ_VGLITE_PATH_THICK_SHAPE_LINE_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 2 * MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) /* line have 6 sides */ \
+ + 2 * MEJ_MAX( MEJ_VGLITE_PATH_ROUNDED_CAP_LENGTH(t), \
+ MEJ_VGLITE_PATH_NO_CAP_LENGTH(t)) /* CAPS */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Length of a VGLite ellipse path
+ */
+#define MEJ_VGLITE_PATH_CIRCLE_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 4 * MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t) /* 4 sections per ellipse */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Length of a VGLite ellipse path
+ */
+#define MEJ_VGLITE_PATH_CIRCLE_ARC_OUTLINE_MAX_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 2 * MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) /* 2 ends */ \
+ + 8 * MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t) /* 4 sections per ellipse */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Length of a VGLite filled rectangle path
+ */
+#define MEJ_VGLITE_PATH_RECT_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 4 * MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) /* 4 sides */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Length of a VGLite filled rounded rectangle path
+ */
+#define MEJ_VGLITE_PATH_ROUND_RECT_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 4 * MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) /* 4 sides */ \
+ + 4 * MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t) /* 4 corners */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Maximum length of a VGLite filled ellipse arc path
+ */
+#define MEJ_VGLITE_PATH_CIRCLE_ARC_MAX_LENGTH(t) \
+ (0 \
+ + 1 * MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) /* move to command */ \
+ + 2 * MEJ_MAX( MEJ_VGLITE_PATH_ROUNDED_CAP_LENGTH(t), \
+ MEJ_VGLITE_PATH_NO_CAP_LENGTH(t)) /* CAPS */ \
+ + 8 * MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t) /* Up to 4 sections per curve in and out */ \
+ + 1 * MEJ_VGLITE_PATH_END_LENGTH(t) /* end command */ \
+ )
+
+/*
+ * @brief Size of a rounded cap: 2 cubic curves
+ */
+#define MEJ_VGLITE_PATH_ROUNDED_CAP_LENGTH(t) (2 * MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t))
+
+/*
+ * @brief Size of a "no cap": 1 line
+ */
+#define MEJ_VGLITE_PATH_NO_CAP_LENGTH(t) MEJ_VGLITE_PATH_LINE_TO_LENGTH(t)
+
+/*
+ * @brief Size of a move_to command
+ */
+#define MEJ_VGLITE_PATH_MOVE_TO_LENGTH(t) (sizeof(path_move_to_ ## t))
+
+/*
+ * @brief Size of a line_to command
+ */
+#define MEJ_VGLITE_PATH_LINE_TO_LENGTH(t) (sizeof(path_line_to_ ## t))
+
+/*
+ * @brief Size of a cubic_to command
+ */
+#define MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(t) (sizeof(path_cubic_to_ ## t))
+
+/*
+ * @brief Size of a end command
+ */
+#define MEJ_VGLITE_PATH_END_LENGTH(t) (sizeof(path_end_ ## t))
+
+/*
+ * @brief Position of the starting cap in the caps bitfield
+ */
+#define MEJ_VGLITE_PATH_CAPS_START_SHIFT 0
+
+/*
+ * @brief Position of the ending cap in the caps bitfield
+ */
+#define MEJ_VGLITE_PATH_CAPS_END_SHIFT 2
+
+/*
+ * @brief Mask of a cap in the caps bitfield
+ */
+#define MEJ_VGLITE_PATH_CAPS_MASK 0x03
+
+/*
+ * @brief Sets the starting cap in the bitfield
+ */
+#define MEJ_VGLITE_PATH_SET_CAPS_START(x) (((x) & MEJ_VGLITE_PATH_CAPS_MASK) << MEJ_VGLITE_PATH_CAPS_START_SHIFT)
+
+/*
+ * @brief Sets the ending cap in the bitfield
+ */
+#define MEJ_VGLITE_PATH_SET_CAPS_END(x) (((x) & MEJ_VGLITE_PATH_CAPS_MASK) << MEJ_VGLITE_PATH_CAPS_END_SHIFT)
+
+/*
+ * @brief Gets the starting cap from the bitfield
+ */
+#define MEJ_VGLITE_PATH_GET_CAPS_START(x) (((x) >> MEJ_VGLITE_PATH_CAPS_START_SHIFT) & MEJ_VGLITE_PATH_CAPS_MASK)
+
+/*
+ * @brief Gets the ending cap from the bitfield
+ */
+#define MEJ_VGLITE_PATH_GET_CAPS_END(x) (((x) >> MEJ_VGLITE_PATH_CAPS_END_SHIFT) & MEJ_VGLITE_PATH_CAPS_MASK)
+
+/*
+ * @brief Scale factor to improve drawing quality in vector mode
+ */
+#define DRAWING_SCALE_FACTOR (2.f)
+#define DRAWING_SCALE_DIV (1.0 / (vg_lite_float_t)DRAWING_SCALE_FACTOR)
+
+// -----------------------------------------------------------------------------
+// Types
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief VGLite S16 move to command
+ */
+typedef struct path_move_to_s16 {
+ int16_t cmd; // @brief Command
+ int16_t x; // @brief Horizontal coordinate of the position to move to
+ int16_t y; // @brief Vertical coordinate of the position to move to
+} path_move_to_s16_t;
+
+/*
+ * @brief VGLite S16 line to command
+ */
+typedef struct path_line_s16 {
+ int16_t cmd; // @brief Command
+ int16_t x; // @brief Horizontal coordinate of the position to move to
+ int16_t y; // @brief Vertical coordinate of the position to move to
+} path_line_to_s16_t;
+
+/*
+ * @brief VGLite S16 cubic to command
+ */
+typedef struct path_cubic_s16 {
+ int16_t cmd; // @brief command
+ int16_t cx1; // @brief Horizontal coordinate of the first control point
+ int16_t cy1; // @brief Vertical coordinate of the first control point
+ int16_t cx2; // @brief Horizontal coordinate of the second control point
+ int16_t cy2; // @brief Vertical coordinate of the second control point
+ int16_t x; // @brief Horizontal coordinate of the end of the curve
+ int16_t y; // @brief Vertical coordinate of the end of the curve
+} path_cubic_to_s16_t;
+
+/*
+ * @brief VGLite S16 end command
+ */
+typedef struct path_end_s16 {
+ int16_t cmd; // @brief command
+} path_end_s16_t;
+
+/*
+ * @brief Fixed array size to store a line path
+ */
+typedef uint8_t vglite_path_line_t[MEJ_VGLITE_PATH_LINE_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a thick shape line path
+ */
+typedef uint8_t vglite_path_thick_shape_line_t[MEJ_VGLITE_PATH_THICK_SHAPE_LINE_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a ellipse
+ */
+typedef uint8_t vglite_path_ellipse_t[MEJ_VGLITE_PATH_CIRCLE_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a ellipse arc
+ */
+typedef uint8_t vglite_path_ellipse_arc_t[MEJ_VGLITE_PATH_CIRCLE_ARC_OUTLINE_MAX_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a rectangle path
+ */
+typedef uint8_t vglite_path_rectangle_t[MEJ_VGLITE_PATH_RECT_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a line path
+ */
+typedef uint8_t vglite_path_rounded_rectangle_t[MEJ_VGLITE_PATH_ROUND_RECT_LENGTH(s16_t)];
+
+/*
+ * @brief Fixed array size to store a thick ellipse arc path
+ */
+typedef uint8_t vglite_path_thick_ellipse_arc_t[MEJ_VGLITE_PATH_CIRCLE_ARC_MAX_LENGTH(s16_t)];
+
+// -----------------------------------------------------------------------------
+// API
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Computes a ellipse arc
+ *
+ * This function uses bezier curves to apporoximate the ellipse arcs
+ * The path computed by this function is intended to be used with VGLite
+ * The function supports the followin caps: DRAWING_ENDOFLINE_NONE and DRAWING_ENDOFLINE_ROUNDED.
+ * DRAWING_ENDOFLINE_PERPENDICULAR is considered as DRAWING_ENDOFLINE_NONE.
+ * @param[out] thick_shape_ellipse_arc: the vg_lite path to compute
+ * @param[in]: radius_out_w: the horizontal inner radius of the ellipse arc
+ * @param[in]: radius_out_h: the vertical inner radius of the ellipse arc
+ * @param[in]: radius_in_w: the horizontal outer radius of the ellipse arc
+ * @param[in]: radius_in_h: the vertical outer radius of the ellipse arc
+ * @param[in]: start_angle_degree: the start angle of the ellipse arc in degrees
+ * @param[in]: arc_angle_degree: the arc angle of the ellipse arc in degrees
+ * @param[in] fill: the flag indicating if the ellipse arc will be filled
+ * - true: the ellipse arc will be filled
+ * - false: the ellipse arc will not be filled
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_ellipse_arc(
+ vg_lite_path_t *thick_ellipse_arc_shape,
+ int radius_out_w,
+ int radius_out_h,
+ int radius_in_w,
+ int radius_in_h,
+ float32_t start_angle_degree,
+ float32_t arc_angle_degree,
+ bool fill);
+
+/*
+ * @brief Computes a thick ellipse arc shape
+ *
+ * This function uses bezier curves to apporoximate the ellipse arcs
+ * The path computed by this function is intended to be used with VGLite
+ * The function supports the followin caps: DRAWING_ENDOFLINE_NONE and DRAWING_ENDOFLINE_ROUNDED.
+ * DRAWING_ENDOFLINE_PERPENDICULAR is considered as DRAWING_ENDOFLINE_NONE.
+ * @param[out] thick_shape_ellipse_arc: vg_lite path to compute
+ * @param[in]: diameter_w: diameter of the ellipse arc
+ * @param[in]: diameter_h: diameter of the ellipse arc
+ * @param[in]: thickness: thickness of the ellipse arc
+ * @param[in]: start_angle_degree: starting angle of the ellipse arc in degrees
+ * @param[in]: arc_angle_degree: angle of the ellipse arc in degrees
+ * @param[in]: caps of the start and end of the ellipse arc, bits [0:1] contains the starting cap, bits [2:3] contains the ending cap.
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_thick_shape_ellipse_arc(
+ vg_lite_path_t *thick_ellipse_arc_shape,
+ int diameter_w,
+ int diameter_h,
+ int thickness,
+ float32_t start_angle_degree,
+ float32_t arc_angle_degree,
+ int caps);
+
+/*
+ * @brief Computes a ellipse
+ *
+ * This function uses bezier curves to apporoximate the ellipse
+ * The path computed by this function is intended to be used with VGLite
+ * @param[out] point_shape: vg_lite path to compute
+ * @param[in] thickness: thickness (diameter) of the point
+ * @param[in,out] matrix: transformation matrix (updated to scale the point)
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_ellipse(
+ vg_lite_path_t *point_shape,
+ int path_offset,
+ int radius_w,
+ int radius_h,
+ bool end_path);
+
+/*
+ * @brief Computes a plain ellipse
+ *
+ * This function uses a hard coded path of a thircle of diameter 200.
+ * The matrix is updated to scale the ellipse to match the diameter.
+ *
+ * This function uses bezier curves to apporoximate the ellipse
+ * The path computed by this function is intended to be used with VGLite
+ * @param[out] point_shape: vg_lite path to compute
+ * @param[in] radius_w: the horizontal radius of the ellipse.
+ * @param[in] radius_h: the vertical radius of the ellipse.
+ * @param[in,out] matrix: transformation matrix (updated to scale the point)
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_filled_ellipse(
+ vg_lite_path_t *point_shape,
+ int radius_w,
+ int radius_h,
+ vg_lite_matrix_t *matrix);
+
+/*
+ * @brief Computes a rectangle
+ *
+ * The path computed by this function is intended to be used with VGLite
+ * @param[out] rectangle_shape: vg_lite path to compute
+ * @param[in] path_offset: offset in the path buffer
+ * @param[in] x: horizontal coordinate of the left side of the shape
+ * @param[in] y: vertical coordinate of the top side of the shape
+ * @param[in] width: width of the rectangle
+ * @param[in] height: height of the rectangle
+ * @param[in] end_path: true to end the path, false to leave path open
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_rectangle(
+ vg_lite_path_t *rounded_rectangle_shape,
+ int path_offset,
+ int x,
+ int y,
+ int width,
+ int height,
+ bool end_path);
+
+/*
+ * @brief Computes a rounded rectangle
+ *
+ * This function uses bezier curves to apporoximate the corners
+ * The path computed by this function is intended to be used with VGLite
+ * @param[out] rounded_rectangle_shape: vg_lite path to compute
+ * @param[in] path_offset: offset in the path buffer
+ * @param[in] x: horizontal coordinate of the left side of the shape
+ * @param[in] y: vertical coordinate of the top side of the shape
+ * @param[in] height: height of the rounded rectangle
+ * @param[in] width: width of the rounded rectangle
+ * @param[in] height: height of the rounded rectangle
+ * @param[in] arc_width: horizontal diameter of the rounded corner arc
+ * @param[in] arc_height: vertical diameter of the rounded corner arc
+ * @param[in] end_path: true to end the path, false to leave path open
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_rounded_rectangle(
+ vg_lite_path_t *rounded_rectangle_shape,
+ int path_offset,
+ int x,
+ int y,
+ int width,
+ int height,
+ int arc_width,
+ int arc_height,
+ bool end_path);
+
+/*
+ * @brief Computes a line
+ *
+ * The path computed by this function is intended to be used with VGLite
+ * The line will be computed from origin (0,0) to (x,y)
+ * @param[out] line_shape: vg_lite path to compute
+ * @param[in]: x: horizontal coordinate of the end point of the line
+ * @param[in]: y: vertical coordinate of the end point of the line
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_line(vg_lite_path_t *line_shape, int x, int y);
+
+/*
+ * @brief Computes a thick shape line
+ *
+ * The path computed by this function is intended to be used with VGLite
+ * This function will compute an horizontal line and update a matrix to rotate it
+ * The line will be computed from origin (0,0) to sqrt(x^2,y^2)
+ * The matrix will be updated to rotate it by atan2(y, x)
+ * @param[out] line_shape: vg_lite path to compute
+ * @param[in]: x: horizontal coordinate of the end point of the line
+ * @param[in]: y: vertical coordinate of the end point of the line
+ * @param[in]: thickness: thickness (diameter) of the point
+ * @param[in]: caps: caps of the start and end of the ellipse arc, bits [0:1] contains the starting cap, bits [2:3] contains the ending cap.
+ * @param[out]: matrix: matrix to be updated with rotation atan2(y, x)
+ *
+ * @return:
+ * -1: an error occured,
+ * otherwise: number of bytes written in the path
+ */
+int UI_DRAWING_VGLITE_PATH_compute_thick_shape_line(
+ vg_lite_path_t *thick_line_shape,
+ int x,
+ int y,
+ int thickness,
+ int caps,
+ vg_lite_matrix_t *matrix);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined UI_DRAWING_VGLITE_PATH_H
diff --git a/bsp/projects/microej/ui/inc/ui_drawing_vglite_process.h b/bsp/projects/microej/ui/inc/ui_drawing_vglite_process.h
new file mode 100644
index 0000000..dd59902
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_drawing_vglite_process.h
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_DRAWING_VGLITE_PROCESS_H
+#define UI_DRAWING_VGLITE_PROCESS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite. Provides
+ * a set of drawing functions over the VGLite library. First the MicroUI parameters
+ * are converted to VGLite objects and then a drawing function is called to render the
+ * drawing.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_drawing.h"
+#include "ui_vglite.h"
+
+#include "vg_lite.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief A fade higher than 1 is not compatible with VGLite
+ */
+#define UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(f) ((f) <= 1)
+
+/*
+ * @brief Gets the thickness according to a thickness (t) and a fade (f).
+ */
+#define UI_DRAWING_VGLITE_GET_THICKNESS(t, f) ((t) + (f))
+
+// --------------------------------------------------------------------------------
+// Typedef
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Function to draw a path.
+ *
+ * @see vg_lite_draw()
+ */
+typedef DRAWING_Status (* UI_DRAWING_VGLITE_PROCESS_draw_path_t) (
+ MICROUI_GraphicsContext* gc,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color);
+
+/*
+ * @brief Function to blit a part of the source.
+ *
+ * @see vg_lite_blit_rect()
+ */
+typedef DRAWING_Status (* UI_DRAWING_VGLITE_PROCESS_blit_rect_t)(
+ MICROUI_GraphicsContext* gc,
+ vg_lite_buffer_t *source,
+ uint32_t *rect,
+ vg_lite_matrix_t *matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color,
+ vg_lite_filter_t filter);
+
+/*
+ * @brief Function to clear the source.
+ *
+ * @see vg_lite_clear()
+ */
+typedef DRAWING_Status (* UI_DRAWING_VGLITE_PROCESS_clear_t)(
+ MICROUI_GraphicsContext* gc,
+ vg_lite_rectangle_t * rect,
+ vg_lite_color_t color);
+
+// --------------------------------------------------------------------------------
+// Public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Tells if the source is GPU compatible. If yes, configures the given matrix,
+ * blit rectangle and color and returns a VGLite source buffer to draw a raster image.
+ * Returns NULL if the image cannot be drawn (image format not supported by the GPU)
+ * or if the image region to draw is fully outside the clip.
+ *
+ * @return a VGLite source buffer if the GPU can be used to draw the image.
+ */
+vg_lite_buffer_t* UI_DRAWING_VGLITE_PROCESS_prepare_draw_image(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x_src, jint y_src, jint width, jint height, jint x_dest, jint y_dest, jint alpha, vg_lite_color_t* color, vg_lite_matrix_t* matrix, uint32_t* blit_rect);
+
+/*
+ * @brief Implementation of drawLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawLine(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+
+/*
+ * @brief Implementation of drawHorizontalLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawHorizontalLine(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+
+/*
+ * @brief Implementation of drawVerticalLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawVerticalLine(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+
+/*
+ * @brief Implementation of fillRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillRectangle(UI_DRAWING_VGLITE_PROCESS_clear_t drawer, MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+
+/*
+ * @brief Implementation of drawRoundedRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRoundedRectangle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of fillRoundedRectangle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillRoundedRectangle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+
+/*
+ * @brief Implementation of drawCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawCircleArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipseArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawEllipseArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillCircleArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of fillEllipseArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillEllipseArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+
+/*
+ * @brief Implementation of drawEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawEllipse(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of fillEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillEllipse(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+
+/*
+ * @brief Implementation of drawCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawCircle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of fillCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillCircle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+
+/*
+ * @brief Implementation of drawThickFadedPoint over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedPoint(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness);
+
+/*
+ * @brief Implementation of drawThickFadedLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedLine(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, DRAWING_Cap startCap, DRAWING_Cap endCap);
+
+/*
+ * @brief Implementation of drawThickFadedCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Implementation of drawThickFadedCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircleArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, DRAWING_Cap start, DRAWING_Cap end);
+
+/*
+ * @brief Implementation of drawThickFadedEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedEllipse(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Implementation of drawThickLine over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickLine(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircle over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickCircle(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+
+/*
+ * @brief Implementation of drawThickEllipse over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickEllipse(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+
+/*
+ * @brief Implementation of drawThickCircleArc over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickCircleArc(UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer, MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+
+/*
+ * @brief Implementation of drawFlippedImage over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawFlippedImage(UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer, MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha, bool* is_gpu_compatible);
+
+/*
+ * @brief Implementation of drawRotatedImageNearestNeighbor over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRotatedImageNearestNeighbor(UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer, MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha, bool* is_gpu_compatible);
+
+/*
+ * @brief Implementation of drawRotatedImageBilinear over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRotatedImageBilinear(UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer, MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha, bool* is_gpu_compatible);
+
+/*
+ * @brief Implementation of drawScaledImageNearestNeighbor over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawScaledImageNearestNeighbor(UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer, MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha, bool* is_gpu_compatible);
+
+/*
+ * @brief Implementation of drawScaledImageBilinear over VGLite. See ui_drawing.h
+ */
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawScaledImageBilinear(UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer, MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha, bool* is_gpu_compatible);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_DRAWING_VGLITE_PROCESS_H
diff --git a/bsp/projects/microej/ui/inc/ui_image_drawing.h b/bsp/projects/microej/ui/inc/ui_image_drawing.h
new file mode 100644
index 0000000..bd4ef28
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_image_drawing.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_IMAGE_DRAWING_H
+#define UI_IMAGE_DRAWING_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @brief Provides image drawing functions called by ui_drawing.c.
+ *
+ * The default weak functions of ui_drawing.c call the ui_image_drawing.h functions to draw
+ * the image. According to the kind of image (standard or custom), the implementation
+ * of ui_image_drawing.h calls the right image manager functions.
+ *
+ * When the image is a standard image, the implementation calls the Graphics Engine
+ * software algorithms.
+ *
+ * When the image is a custom image, the associated image manager is mandatory (the
+ * Graphics Engine is not able to decode this custom image). The implementation
+ * dispatches the image drawing to this image manager (the custom image manager is
+ * retrieved thanks to the custom image format: MICROUI_IMAGE_FORMAT_CUSTOM_0 to
+ * MICROUI_IMAGE_FORMAT_CUSTOM_7).
+ *
+ * Several cases:
+ *
+ * 1- The image manager is available and it is able to draw in the given Graphics
+ * Context: it has to decode the image and draw into the Graphics Context.
+ *
+ * 2- The image manager is available and the given Graphics Context format is the
+ * same format as the image: the image should be copied in the destination.
+ *
+ * 3- The image manager is available and it is not able to draw in the given Graphics
+ * Context (unknown ouput format) but it is able to draw the image into the Graphics
+ * Context by using the ui_drawing.h functions.
+ *
+ * 4- The image manager is available, it is not able to draw in the given Graphics
+ * Context (unknown ouput format) and it is not able to call standard ui_drawing.h
+ * functions to draw the image: it has to call the stub implementation.
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Draws a region of an image.
+ * @see UI_DRAWING_drawImage
+ */
+DRAWING_Status UI_IMAGE_DRAWING_draw(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Copy a region of an image in another image with the same pixel format.
+ * @see UI_DRAWING_copyImage
+ */
+DRAWING_Status UI_IMAGE_DRAWING_copy(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+/*
+ * @brief Draw a region of an image in the same image.
+ * @see UI_DRAWING_drawRegion
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+/*
+ * @brief Draws an image applying a flip.
+ * @see UI_DRAWING_drawFlippedImage
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawFlipped(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+/*
+ * @brief Draws an image applying a free rotation (0 to 360 degrees).
+ * @see UI_DRAWING_drawRotatedImageNearestNeighbor
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Draws an image applying a free rotation (0 to 360 degrees).
+ * @see UI_DRAWING_drawRotatedImageBilinear
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+/*
+ * @brief Draws an image applying a scaling.
+ * @see UI_DRAWING_drawScaledImageNearestNeighbor
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+/*
+ * @brief Draws an image applying a scaling.
+ * @see UI_DRAWING_drawScaledImageBilinear
+ */
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_IMAGE_DRAWING_H
diff --git a/bsp/projects/microej/ui/inc/ui_log.h b/bsp/projects/microej/ui/inc/ui_log.h
new file mode 100644
index 0000000..060265b
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_log.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined UI_LOG_H
+#define UI_LOG_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @brief Provides elements that allow to log some external events in the MicroUI event
+ * group.
+ *
+ * The MicroUI event group is identified by the global LLUI_EVENT_group. The events are
+ * 0-based and have to start at the offset LLUI_EVENT_offset.
+ *
+ * Notes:
+ * - The number of events is 100 (fixed by MicroUI).
+ * - The event 0 is reserved to log the drawings. It is used by the MicroUI CCO and by
+ * the MicroUI Graphics Engine (to log the internal drawings).
+ * - The events [10,20] are reserved to log the buffer refresh strategies (BRS) events.
+ *
+ * Example:
+ *
+ * #include "ui_log.h"
+ * LLTRACE_record_event_u32(LLUI_EVENT_group, LLUI_EVENT_offset + MY_EVENT_OFFSET, my_event_data);
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+
+/*
+ * @brief Includes right header file according the Architecture.
+ * - Architecture 7: include "trace.h"
+ * - Architecture 8: include "LLTRACE.h"
+ */
+#define UI_LOG_LLTRACE __has_include("LLTRACE.h")
+#if UI_LOG_LLTRACE == (0u)
+#include
+#else
+#include
+#endif
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Identifies the log for the drawings (known by the MicroUI CCO and by the
+ * MicroUI Graphics Engine).
+ */
+#define UI_LOG_DRAW (0)
+
+/*
+ * @brief Identifies the logs for the Buffer Refresh Strategies (BRS).
+ */
+#define UI_LOG_BRS_NewDrawing (10) // New drawing region (%u,%u) to (%u,%u)
+#define UI_LOG_BRS_FlushSingle (11) // Flush LCD (id=%u buffer=%p) single region (%u,%u) to (%u,%u)
+#define UI_LOG_BRS_FlushMulti (12) // Flush LCD (id=%u buffer=%p) %u regions
+#define UI_LOG_BRS_AddRegion (13) // Add region (%u,%u) to (%u,%u)
+#define UI_LOG_BRS_RemoveRegion (14) // Remove region (%u,%u) to (%u,%u)
+#define UI_LOG_BRS_RestoreRegion (15) // Restore region (%u,%u) to (%u,%u)
+#define UI_LOG_BRS_ClearList (16) // Clear the list of regions
+
+/*
+ * @brief Compatibility of Architecture 7 with Architecture 8: use the prototypes
+ * of LLTRACE.h (Architecture 8).
+ */
+#if UI_LOG_LLTRACE == (0u)
+#define LLTRACE_record_event_void TRACE_record_event_void
+#define LLTRACE_record_event_u32 TRACE_record_event_u32
+#define LLTRACE_record_event_u32x2 TRACE_record_event_u32x2
+#define LLTRACE_record_event_u32x3 TRACE_record_event_u32x3
+#define LLTRACE_record_event_u32x4 TRACE_record_event_u32x4
+#define LLTRACE_record_event_u32x5 TRACE_record_event_u32x5
+#define LLTRACE_record_event_u32x6 TRACE_record_event_u32x6
+#define LLTRACE_record_event_u32x7 TRACE_record_event_u32x7
+#define LLTRACE_record_event_u32x8 TRACE_record_event_u32x8
+#define LLTRACE_record_event_u32x9 TRACE_record_event_u32x9
+#define LLTRACE_record_event_u32x10 TRACE_record_event_u32x10
+#define LLTRACE_record_event_end TRACE_record_event_end
+#define LLTRACE_record_event_end_u32 TRACE_record_event_end_u32
+#endif
+
+// --------------------------------------------------------------------------------
+// Fields
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Identifies the MicroUI group to log an event.
+ */
+extern int32_t LLUI_EVENT_group;
+
+/*
+ * @brief Identifies the offset in the MicroUI group to log an event.
+ */
+extern int32_t LLUI_EVENT_offset;
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_LOG_H
diff --git a/bsp/projects/microej/ui/inc/ui_rect_collection.h b/bsp/projects/microej/ui/inc/ui_rect_collection.h
new file mode 100644
index 0000000..2f2425a
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_rect_collection.h
@@ -0,0 +1,176 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_RECT_COLLECTION_H
+#define UI_RECT_COLLECTION_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @brief Exposes the ui_rect_collection_t type that handles unordered ui_rect_t collections
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_rect.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Defines the number of rectangles that collections can contain.
+ */
+#ifndef UI_RECT_COLLECTION_MAX_LENGTH
+#define UI_RECT_COLLECTION_MAX_LENGTH 8u
+#endif
+
+// --------------------------------------------------------------------------------
+// Typedefs
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief A rectangle collection contains an array of rectangles and a pointer to
+ * the latest rectangle.
+ */
+typedef struct ui_rect_collection_t {
+ ui_rect_t data[UI_RECT_COLLECTION_MAX_LENGTH];
+ size_t length;
+} ui_rect_collection_t;
+
+// --------------------------------------------------------------------------------
+// Public functions
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Clears the collection: the latest rectangle points on the first rectangle.
+ *
+ * @param[in] collection the collection to clear
+ */
+static inline void UI_RECT_COLLECTION_clear(ui_rect_collection_t* collection) {
+ collection->length = 0;
+}
+
+/*
+ * @brief Initializes the collection.
+ *
+ * @param[in] collection the collection to initialize
+ */
+static inline void UI_RECT_COLLECTION_init(ui_rect_collection_t* collection) {
+ UI_RECT_COLLECTION_clear(collection);
+}
+
+/*
+ * @brief Gets the number of rectangles that have been added to the collection.
+ *
+ * @param[in] collection the collection to check
+ *
+ * @return the available number of rectangles in the collection
+ */
+static inline size_t UI_RECT_COLLECTION_get_length(const ui_rect_collection_t* collection) {
+ return collection->length;
+}
+
+/*
+ * @brief Tells if the collection is full.
+ *
+ * @param[in] collection the collection to check
+ *
+ * @return true when the collection is full
+ */
+static inline bool UI_RECT_COLLECTION_is_full(const ui_rect_collection_t* collection) {
+ return UI_RECT_COLLECTION_get_length(collection) >= UI_RECT_COLLECTION_MAX_LENGTH;
+}
+
+/*
+ * @brief Tells if the collection is empty.
+ *
+ * @param[in] collection the collection to check
+ *
+ * @return true when the collection is empty
+ */
+static inline bool UI_RECT_COLLECTION_is_empty(const ui_rect_collection_t* collection) {
+ return collection->length == 0u;
+}
+
+/*
+ * @brief Gets the last rectangle added to the collection or NULL if the collection is empty.
+ *
+ * @param[in] collection the collection where retrieve latest element
+ *
+ * @return a rectangle or NULL
+ */
+static inline ui_rect_t* UI_RECT_COLLECTION_get_last(ui_rect_collection_t* collection) {
+ return UI_RECT_COLLECTION_is_empty(collection) ? NULL : (collection->data + collection->length - 1u);
+}
+
+/*
+ * @brief Gets a pointer to the address after the last rectangle in the collection.
+ *
+ * @param[in] collection the collection
+ *
+ * @return a pointer to the address after the last element in the collection
+ */
+static inline ui_rect_t* UI_RECT_COLLECTION_get_end(ui_rect_collection_t* collection) {
+ return collection->data + collection->length;
+}
+
+/*
+ * @brief Adds a rectangle in the collection. The implementation assumes that caller ensure that
+ * the collection is not full. The rectangle is copied to the collection.
+ *
+ * @param[in] collection the collection where copying the rectangle
+ * @param[in] element the rectangle to add
+ */
+static inline void UI_RECT_COLLECTION_add_rect(ui_rect_collection_t* collection, const ui_rect_t element) {
+ assert(!UI_RECT_COLLECTION_is_full(collection));
+ collection->data[collection->length] = element;
+ collection->length++;
+}
+
+/*
+ * @brief Removes a rectangle from the collection. The behavior is undefined if the rectangle is not part of the collection.
+ *
+ * @param[in] collection the collection which contains the rectangle
+ * @param[in] element the rectangle to remove
+ */
+static inline void UI_RECT_COLLECTION_remove_rect(ui_rect_collection_t* collection, ui_rect_t* element) {
+ assert(!UI_RECT_COLLECTION_is_empty(collection));
+ assert(element >= collection->data);
+ assert(element < (collection->data + collection->length));
+ *element = *UI_RECT_COLLECTION_get_last(collection);
+ collection->length--;
+}
+
+/*
+ * @brief Removes all empty rectangles from the collection.
+ *
+ * @param[in] collection the collection
+ */
+static inline void UI_RECT_COLLECTION_remove_empty_rects(ui_rect_collection_t* collection) {
+ for (size_t i = 0; i < collection->length;) {
+ if (UI_RECT_is_empty(&collection->data[i])) {
+ UI_RECT_COLLECTION_remove_rect(collection, &collection->data[i]);
+ } else {
+ i++;
+ }
+ }
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // UI_RECT_COLLECTION_H
diff --git a/bsp/projects/microej/ui/inc/ui_rect_util.h b/bsp/projects/microej/ui/inc/ui_rect_util.h
new file mode 100644
index 0000000..1e8cd54
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_rect_util.h
@@ -0,0 +1,88 @@
+/*
+ * C
+ *
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_RECT_UTIL_H
+#define UI_RECT_UTIL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_rect.h"
+#include "ui_util.h"
+
+// --------------------------------------------------------------------------------
+// Constants
+// --------------------------------------------------------------------------------
+
+#define UI_RECT_EMPTY { 1u, 1u, 0u, 0u }
+
+// --------------------------------------------------------------------------------
+// Functions
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Computes the minimum bounding rectangle of an array of two rectangles
+ *
+ * The behavior is undefined if the array is empty.
+ *
+ * @param[in] first the first rectangle
+ * @param[in] second the second rectangle
+ * @return the minimum bounding rectangle
+ */
+static inline ui_rect_t UI_RECT_get_minimum_bounding_rect_two_rects(const ui_rect_t* first, const ui_rect_t* second) {
+ return UI_RECT_new_xyxy(MIN(first->x1, second->x1), MIN(first->y1, second->y1), MAX(first->x2, second->x2), MAX(first->y2, second->y2));
+}
+
+/*
+ * @brief Computes the minimum bounding rectangle of an array of rectangles
+ *
+ * The behavior is undefined if the array is empty.
+ *
+ * @param[in] rects the array of rectangles
+ * @param[in] count the length of the array
+ * @return the minimum bounding rectangle
+ */
+ui_rect_t UI_RECT_get_minimum_bounding_rect(const ui_rect_t rects[], const size_t count);
+
+/*
+ * @brief Computes the union of two rectangles
+ *
+ * @param[out] output rectangles defining the union of the parameters
+ * @param[in] first the first rectangle
+ * @param[in] second the second rectangle
+ *
+ * @return the number of resulting rectangles. Some of them may be empty.
+ */
+uint32_t UI_RECT_union(ui_rect_t output[3], const ui_rect_t* first, const ui_rect_t* second);
+
+/*
+ * @brief Computes the difference between two rectangles
+ *
+ * @param[out] rectangles defining the difference between the parameters
+ * @param[in] first the original rectangle
+ * @param[in] second the rectangle that will be removed from the original one
+ *
+ * @return the number of resulting rectangles. Some of them may be empty.
+ */
+uint32_t UI_RECT_subtract(ui_rect_t output[4], const ui_rect_t* first, const ui_rect_t* second);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // UI_RECT_UTIL_H
diff --git a/bsp/projects/microej/ui/inc/ui_util.h b/bsp/projects/microej/ui/inc/ui_util.h
new file mode 100644
index 0000000..399dcaf
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_util.h
@@ -0,0 +1,41 @@
+/*
+ * C
+ *
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#ifndef UI_UTIL_H
+#define UI_UTIL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Macros and defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Gets the lowest value.
+ */
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+/*
+ * @brief Gets the highest value.
+ */
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // UI_UTIL_H
diff --git a/bsp/projects/microej/ui/inc/ui_vglite.h b/bsp/projects/microej/ui/inc/ui_vglite.h
new file mode 100644
index 0000000..131c568
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_vglite.h
@@ -0,0 +1,306 @@
+/*
+ * C
+ *
+ * Copyright 2019-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite. Provides
+ * a set of helper functions to target the VGLite library.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+#if !defined UI_VGLITE_H
+#define UI_VGLITE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "ui_vglite_configuration.h"
+#include "vg_lite.h"
+
+// -----------------------------------------------------------------------------
+// Configuration Sanity Check
+// -----------------------------------------------------------------------------
+
+#ifndef VG_DRIVER_SINGLE_THREAD
+#error "This define must be set in the BSP pre-processor options."
+#endif
+
+/**
+ * Sanity check between the expected version of the configuration and the actual version of
+ * the configuration.
+ * If an error is raised here, it means that a new version of the CCO has been installed and
+ * the configuration ui_vglite_configuration.h must be updated based on the one provided
+ * by the new CCO version.
+ */
+
+#if !defined UI_VGLITE_CONFIGURATION_VERSION
+#error "Undefined UI_VGLITE_CONFIGURATION_VERSION, it must be defined in ui_vglite_configuration.h"
+#endif
+
+#if defined UI_VGLITE_CONFIGURATION_VERSION && UI_VGLITE_CONFIGURATION_VERSION != 1
+#error "Version of the configuration file ui_vglite_configuration.h is not compatible with this implementation."
+#endif
+
+// -----------------------------------------------------------------------------
+// API
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Initializes the VGLite library.
+ *
+ * @param[in] binary_semaphore: pointer to a binary semaphore; the semaphore must
+ * be configured in a state such that the semaphore must first be 'given' before it
+ * can be 'taken'.
+ */
+void UI_VGLITE_init(void* binary_semaphore);
+
+/*
+ * @brief The VEE Port must call this function in the GPU interrupt routine, just
+ * after calling vg_lite_IRQHandler() (often implemented in vglite_support.c).
+ */
+void UI_VGLITE_IRQHandler(void);
+
+/*
+ * @brief Flush the GPU operations.
+ *
+ * @param[in] wakeup_graphics_engine: true to wakeup the graphics engine as soon as
+ * the drawing is performed, false to perform an active waiting until the GPU interrupt
+ * is thrown
+ */
+void UI_VGLITE_start_operation(bool wakeup_graphics_engine);
+
+/*
+ * @brief Operation to perform after a VGLite drawing operation.
+ * On success, the asynchronous drawing is launched. This function does not wait for the end
+ * of the drawing.
+ * On error, an error message is displayed, the error flags in the graphics context are set,
+ * the drawing is considered as done (there is nothing to draw), and a call to UI_VGLITE_IMPL_notify_gpu_stop()
+ * is made to request GPU deactivation (if the function is implemented).
+ *
+ * @param[in] gc: the graphics context holding the error flags.
+ * @param[in] vg_lite_error: the VGLite drawing operation's return code.
+ *
+ * @return: the MicroUI status according to the drawing operation status.
+ */
+DRAWING_Status UI_VGLITE_post_operation(MICROUI_GraphicsContext* gc, vg_lite_error_t vg_lite_error);
+
+/*
+ * @brief Enables hardware rendering
+ * @see VGLITE_OPTION_TOGGLE_GPU
+ */
+void UI_VGLITE_enable_hardware_rendering(void);
+
+/*
+ * @brief Disables hardware rendering
+ * @see VGLITE_OPTION_TOGGLE_GPU
+ */
+void UI_VGLITE_disable_hardware_rendering(void);
+
+/*
+ * @brief Checks if hardware rendering is enabled
+ *
+ * @return: true if hardware rendering is enabled, false otherwise
+ * @see VGLITE_OPTION_TOGGLE_GPU
+ */
+bool UI_VGLITE_is_hardware_rendering_enabled(void);
+
+/*
+ * @brief Toggles hardware rendering
+ * @see VGLITE_OPTION_TOGGLE_GPU
+ */
+void UI_VGLITE_toggle_hardware_rendering(void);
+
+/*
+ * Because of VGLite library implementation,
+ * a buffer located at the same address should not be modified and reused
+ * as the VGLite library check if the buffer address match with the one
+ * stored in its context. If matching is successfull, render target will not
+ * be updated.
+ * This function rotate over an array of vg_lite_buffers to give a different
+ * buffer address at each call and configures it from a MICROUI_Image.
+ * The caller MUST send it to the vg_lite library to update its context.
+ *
+ * @param[in] gc: graphics context of destination
+ *
+ * @return a vg_lite buffer that should not match vg_lite library render context
+ */
+vg_lite_buffer_t* UI_VGLITE_configure_destination(MICROUI_GraphicsContext* gc);
+
+/*
+ * This function configures a source buffer from a MICROUI_Image.
+ *
+ * The blend mode in MicroUI is always SRC_OVER. VG_LITE_IMAGE_TRANSPARENT
+ * ignores fully transparent pixels, which is not a problem with this blend mode.
+ *
+ * In the case an other blend mode is used and drawing fully transparent pixels is
+ * needed, the caller could set buffer->transparency_mode to VG_LITE_IMAGE_OPAQUE
+ * after this function returns true, at the cost of a slight performance drop.
+ *
+ * @param[in] buffer: source buffer
+ * @param[in] image: source image
+ *
+ * @return false if source image format is not supported by vg_lite, true on success
+ */
+bool UI_VGLITE_configure_source(vg_lite_buffer_t *buffer, MICROUI_Image* image);
+
+/*
+ * @brief Premultiplies color components with the opacity to be compatible with VGLite GPU.
+ *
+ * @param[in] color: the color in non-premultiplied xRGB8888 format ('A' is ignored)
+ * @param[in] alpha: the opacity to apply
+ * @return the color in premultiplied ARGB8888 format
+ */
+uint32_t UI_VGLITE_premultiply_alpha(uint32_t color, uint8_t alpha);
+
+/*
+ * @brief Converts a non-premultiplied color into a premultiplied color.
+ *
+ * @param[in] color: the color in non-premultiplied ARGB8888 format
+ * @return the color in premultiplied ARGB8888 format
+ */
+uint32_t UI_VGLITE_premultiply(uint32_t color);
+
+/*
+ * @brief Tells if the GPU requires a pre-multiplied color (means the color components are multiplied by the alpha component).
+ *
+ * @return false if the GPU can manage non pre-multiplied colors.
+ */
+bool UI_VGLITE_need_to_premultiply(void);
+
+/*
+ * @brief Get color to give to VGLite library according to destination's foreground
+ * color, image format and opacity level.
+ *
+ * @param[in] gc: the MicroUI GraphicsContext of destination
+ * @param[in] img: the MicroUI Image of source
+ * @param[in] alpha: the application opacity
+ *
+ * @return The VGLite color
+ */
+vg_lite_color_t UI_VGLITE_get_vglite_color(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint alpha);
+
+/*
+ * @brief Configures the vg_lite's scissor according to the MicroUI clip.
+ *
+ * If the clip is disabled or empty, the drawing is useless and this function
+ * returns false.
+ *
+ * Otherwise the VGLite scissor is configured to match the MicroUI clip.
+ *
+ * @param[in] gc: the destination where performing the drawing (MicroUI Graphics Context)
+ *
+ * @return false when the drawing is useless (bounds out of clip)
+ */
+bool UI_VGLITE_enable_vg_lite_scissor(MICROUI_GraphicsContext* gc);
+
+/*
+ * @brief Configures the vg_lite's scissor according to the MicroUI clip and
+ * the given region.
+ *
+ * If the clip is disabled or empty or if the region is fully outside the clip,
+ * the drawing is useless and this function returns false.
+ *
+ * Otherwise the VGLite scissor is configured to match the intersection of the
+ * MicroUI clip and the region.
+ *
+ * @param[in] gc: the destination where performing the drawing (MicroUI Graphics Context)
+ * @param[in] x1..y2: the region
+ *
+ * @return false when the drawing is useless (bounds out of clip)
+ */
+bool UI_VGLITE_enable_vg_lite_scissor_region(MICROUI_GraphicsContext* gc, int x1, int y1, int x2, int y2);
+
+/*
+ * @brief Configures the vg_lite's scissor according to the MicroUI clip and
+ * the given area, transformed with the given matrix.
+ *
+ * If the clip is disabled or empty or if the area is fully outside the clip,
+ * the drawing is useless and this function returns false.
+ *
+ * Otherwise the VGLite scissor is configured to match the intersection of the
+ * MicroUI clip and the transformed area.
+ *
+ * @param[in] gc: the destination where performing the drawing (MicroUI Graphics Context)
+ * @param[in] width, height: the area size
+ * @param[in] matrix: the transformation to apply on the area
+ *
+ * @return false when the drawing is useless (bounds out of clip)
+ */
+bool UI_VGLITE_enable_vg_lite_scissor_area(MICROUI_GraphicsContext* gc, jfloat width, jfloat height, jfloat* matrix);
+
+/*
+ * @brief Returns the bit per pixel from a MicroUI image format
+ *
+ * @param[in] image_format: The MicroUI format of the image
+ *
+ * @return The bit per pixel of the image, or -1 if the image format is unknown
+ */
+int32_t UI_VGLITE_get_bpp(MICROUI_ImageFormat image_format);
+
+/*
+ * @brief Sets the drawing log flags matching a VGLite error code.
+ *
+ * The error will be reported to UI_VGLITE_IMPL_error().
+ *
+ * @see LLUI_DISPLAY_reportError
+ *
+ * @param[in] gc: the graphics context holding the drawing log flags.
+ * @param[in] vg_lite_error: the VGLite error code.
+ *
+ * @return the drawing status that should be return by the calling drawing function.
+ */
+DRAWING_Status UI_VGLITE_report_vglite_error(MICROUI_GraphicsContext* gc, vg_lite_error_t vg_lite_error) ;
+
+// -----------------------------------------------------------------------------
+// Low Level API
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Notifies the GPU will be used just after this call. The implementation
+ * must ensure the GPU can be used (power management, clocks, etc.).
+ *
+ * Default implementation does nothing.
+ */
+void UI_VGLITE_IMPL_notify_gpu_start(void) ;
+
+/*
+ * @brief Notifies the GPU is not used anymore by the library until the next call to
+ * UI_VGLITE_IMPL_notify_gpu_start().
+ *
+ * Default implementation does nothing.
+ */
+void UI_VGLITE_IMPL_notify_gpu_stop(void) ;
+
+/*
+ * @brief Notifies an error has occurred. This error may be critical, in this case,
+ * the implementation must stop the application execution (message + infinite loop).
+ *
+ * On error, default implementation loops indefinitely on error.
+ *
+ * @param[in] critical: tell whether the error is critical or not.
+ * @param[in] format: the error message and its arguments
+ */
+void UI_VGLITE_IMPL_error(bool critical, const char* format, ...);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined UI_VGLITE_H
diff --git a/bsp/projects/microej/ui/inc/ui_vglite_configuration.h b/bsp/projects/microej/ui/inc/ui_vglite_configuration.h
new file mode 100644
index 0000000..4e3b19a
--- /dev/null
+++ b/bsp/projects/microej/ui/inc/ui_vglite_configuration.h
@@ -0,0 +1,94 @@
+/*
+ * C
+ *
+ * Copyright 2019-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over VG-Lite. Provides
+ * a set of defines to configure the implementation.
+ * @author MicroEJ Developer Team
+ */
+
+#if !defined UI_VGLITE_CONFIGURATION_H
+# define UI_VGLITE_CONFIGURATION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+//#error "This header must be customized with platform specific configuration. Remove this #error when done. This file is not modified when a new version of the CCO is installed."
+
+/**
+ * @brief Compatibility sanity check value.
+ * This define value is checked in the implementation to validate that the version of this configuration
+ * is compatible with the implementation.
+ *
+ * This value must not be changed by the user of the CCO.
+ * This value must be incremented by the implementor of the CCO when a configuration define is added, deleted or modified.
+ */
+#define UI_VGLITE_CONFIGURATION_VERSION (1)
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Width of the Tesselation window
+ *
+ * @Warning: this impacts the VGLite allocation size
+ */
+#define VGLITE_TESSELATION_WIDTH 256
+
+/*
+ * @brief Height of the Tesselation window
+ *
+ * @Warning: this impacts the VGLite allocation size
+ */
+#define VGLITE_TESSELATION_HEIGHT 256
+
+/*
+ * @brief GPU is less efficient than CPU to perform simple aliased drawings (line, rectangle etc.)
+ *
+ * This define forces to use the GPU. Comment it to use the software algorithms instead.
+ */
+#define VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+/*
+ * @brief GPU is less efficient than CPU to perform a simple "draw image": when the image to render has
+ * the same pixel definition than the destination buffer and no alpha blending is required.
+ *
+ * This defines forces to use the GPU to draw RGB565 images. Comment it to use the software algorithms
+ * instead.
+ */
+//#define VGLITE_USE_GPU_FOR_RGB565_IMAGES
+
+/*
+ * @brief GCNanoLite-V does not support MSAA. By consequence the "draw image" functions (with or without
+ * transformation like rotation or scale) cannot use GPU when the image to render contains transparent
+ * pixels.
+ *
+ * This defines forces to use the GPU to draw transparent images. Comment it to use the software algorithms
+ * instead.
+ */
+//#define VGLITE_USE_GPU_FOR_TRANSPARENT_IMAGES
+
+/*
+ * @brief Option to enable and disable the use of the GPU (toggle) at runtime. When the option is disabled,
+ * the calls to UI_VGLITE_xxx_hardware_rendering have no effect.
+ *
+ * This defines forces to enable the option. Comment it to disable the option.
+ */
+//#define VGLITE_OPTION_TOGGLE_GPU
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined UI_VGLITE_CONFIGURATION_H
diff --git a/bsp/projects/microej/ui/src/LLDW_PAINTER_impl.c b/bsp/projects/microej/ui/src/LLDW_PAINTER_impl.c
new file mode 100644
index 0000000..f84a65c
--- /dev/null
+++ b/bsp/projects/microej/ui/src/LLDW_PAINTER_impl.c
@@ -0,0 +1,195 @@
+
+/*
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief This file implements all "Drawing" (MicroUI extended library) drawing native functions.
+ * @see LLDW_PAINTER_impl.h file comment
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ * @since MicroEJ UI Pack 13.0.0
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+// implements LLDW_PAINTER_impl functions
+#include
+
+// use graphical engine functions to synchronize drawings
+#include
+
+// calls ui_drawing functions
+#include "ui_drawing.h"
+
+// logs the drawings
+#include "ui_log.h"
+
+// --------------------------------------------------------------------------------
+// Macros and Defines
+// --------------------------------------------------------------------------------
+
+// macros to log a drawing
+#define LOG_DRAW_START(fn) LLTRACE_record_event_u32(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_DRAW, CONCAT_DEFINES(LOG_DRAW_, fn))
+#define LOG_DRAW_END(s) LLTRACE_record_event_end_u32(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_DRAW, (s))
+
+/*
+ * LOG_DRAW_EVENT logs identifiers
+ */
+#define LOG_DRAW_drawThickFadedPoint 100
+#define LOG_DRAW_drawThickFadedLine 101
+#define LOG_DRAW_drawThickFadedCircle 102
+#define LOG_DRAW_drawThickFadedCircleArc 103
+#define LOG_DRAW_drawThickFadedEllipse 104
+#define LOG_DRAW_drawThickLine 105
+#define LOG_DRAW_drawThickCircle 106
+#define LOG_DRAW_drawThickEllipse 107
+#define LOG_DRAW_drawThickCircleArc 108
+
+#define LOG_DRAW_drawFlippedImage 200
+#define LOG_DRAW_drawRotatedImageNearestNeighbor 201
+#define LOG_DRAW_drawRotatedImageBilinear 202
+#define LOG_DRAW_drawScaledImageNearestNeighbor 203
+#define LOG_DRAW_drawScaledImageBilinear 204
+
+// --------------------------------------------------------------------------------
+// LLDW_PAINTER_impl.h functions
+// --------------------------------------------------------------------------------
+
+void LLDW_PAINTER_IMPL_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade) {
+ if (((thickness > 0) || (fade > 0)) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickFadedPoint)) {
+ LOG_DRAW_START(drawThickFadedPoint);
+ DRAWING_Status status = UI_DRAWING_drawThickFadedPoint(gc, x, y, thickness, fade);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap) {
+ if (((thickness > 0) || (fade > 0)) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickFadedLine)) {
+ LOG_DRAW_START(drawThickFadedLine);
+ DRAWING_Status status = UI_DRAWING_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade) {
+ if (((thickness > 0) || (fade > 0)) && (diameter > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickFadedCircle)) {
+ LOG_DRAW_START(drawThickFadedCircle);
+ DRAWING_Status status = UI_DRAWING_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end) {
+ if (((thickness > 0) || (fade > 0)) && (diameter > 0) && ((int32_t)arcAngle != 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickFadedCircleArc)) {
+ LOG_DRAW_START(drawThickFadedCircleArc);
+ DRAWING_Status status = UI_DRAWING_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade) {
+ if (((thickness > 0) || (fade > 0)) && (width > 0) && (height > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickFadedEllipse)) {
+ LOG_DRAW_START(drawThickFadedEllipse);
+ DRAWING_Status status = UI_DRAWING_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness) {
+ if ((thickness > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickLine)) {
+ LOG_DRAW_START(drawThickLine);
+ DRAWING_Status status = UI_DRAWING_drawThickLine(gc, startX, startY, endX, endY, thickness);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness) {
+ if ((thickness > 0) && (diameter > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickCircle)) {
+ LOG_DRAW_START(drawThickCircle);
+ DRAWING_Status status = UI_DRAWING_drawThickCircle(gc, x, y, diameter, thickness);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness) {
+ if ((thickness > 0) && (width > 0) && (height > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickEllipse)) {
+ LOG_DRAW_START(drawThickEllipse);
+ DRAWING_Status status = UI_DRAWING_drawThickEllipse(gc, x, y, width, height, thickness);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness) {
+ if ((thickness > 0) && (diameter > 0) && ((int32_t)arcAngle != 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawThickCircleArc)) {
+ LOG_DRAW_START(drawThickCircleArc);
+ DRAWING_Status status = UI_DRAWING_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha) {
+ if (!LLUI_DISPLAY_isClosed(img) && (alpha > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawFlippedImage)) {
+ LOG_DRAW_START(drawFlippedImage);
+ DRAWING_Status status = UI_DRAWING_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha) {
+ if (!LLUI_DISPLAY_isClosed(img) && (alpha > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawRotatedImageNearestNeighbor)) {
+ LOG_DRAW_START(drawRotatedImageNearestNeighbor);
+ DRAWING_Status status = UI_DRAWING_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha) {
+ if (!LLUI_DISPLAY_isClosed(img) && (alpha > 0) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawRotatedImageBilinear)) {
+ LOG_DRAW_START(drawRotatedImageBilinear);
+ DRAWING_Status status = UI_DRAWING_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha) {
+ if (!LLUI_DISPLAY_isClosed(img) && (alpha > 0) && (factorX > 0.f) && (factorY > 0.f) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawScaledImageNearestNeighbor)) {
+ LOG_DRAW_START(drawScaledImageNearestNeighbor);
+ DRAWING_Status status = UI_DRAWING_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+void LLDW_PAINTER_IMPL_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha) {
+ if (!LLUI_DISPLAY_isClosed(img) && (alpha > 0) && (factorX > 0.f) && (factorY > 0.f) && LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLDW_PAINTER_IMPL_drawScaledImageBilinear)) {
+ LOG_DRAW_START(drawScaledImageBilinear);
+ DRAWING_Status status = UI_DRAWING_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
+ }
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c b/bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c
rename to bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c
index 3da0b1a..77a76e8 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c
+++ b/bsp/projects/microej/ui/src/LLUI_DISPLAY_HEAP_impl.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -13,8 +13,7 @@
*
* @see LLUI_DISPLAY_impl.h file comment
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
@@ -25,10 +24,6 @@
#include "microui_heap.h"
#include "BESTFIT_ALLOCATOR.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
// --------------------------------------------------------------------------------
// Macros and Defines
// --------------------------------------------------------------------------------
@@ -75,14 +70,14 @@ uint32_t MICROUI_HEAP_number_of_allocated_blocks(void) {
// --------------------------------------------------------------------------------
-void LLUI_DISPLAY_IMPL_image_heap_initialize(uint8_t* heap_start, uint8_t* heap_limit) {
+void LLUI_DISPLAY_IMPL_imageHeapInitialize(uint8_t* heap_start, uint8_t* heap_limit) {
heap_size = heap_limit - heap_start - BESTFITALLOCATOR_HEADER_SIZE;
free_space = heap_size;
BESTFIT_ALLOCATOR_new(&image_heap);
BESTFIT_ALLOCATOR_initialize(&image_heap, (int32_t)heap_start, (int32_t)heap_limit);
}
-uint8_t* LLUI_DISPLAY_IMPL_image_heap_allocate(uint32_t size) {
+uint8_t* LLUI_DISPLAY_IMPL_imageHeapAllocate(uint32_t size) {
uint8_t* addr = (uint8_t*)BESTFIT_ALLOCATOR_allocate(&image_heap, (int32_t)size);
if ((uint8_t*)0 != addr) {
@@ -92,7 +87,7 @@ uint8_t* LLUI_DISPLAY_IMPL_image_heap_allocate(uint32_t size) {
return addr;
}
-void LLUI_DISPLAY_IMPL_image_heap_free(uint8_t* block) {
+void LLUI_DISPLAY_IMPL_imageHeapFree(uint8_t* block) {
free_space += BESTFITALLOCATOR_BLOCK_SIZE(block);
allocated_blocks_number--;
BESTFIT_ALLOCATOR_free(&image_heap, (void*)block);
@@ -102,6 +97,3 @@ void LLUI_DISPLAY_IMPL_image_heap_free(uint8_t* block) {
// EOF
// --------------------------------------------------------------------------------
-#ifdef __cplusplus
-}
-#endif
diff --git a/bsp/projects/microej/ui/src/LLUI_DISPLAY_impl.c b/bsp/projects/microej/ui/src/LLUI_DISPLAY_impl.c
new file mode 100644
index 0000000..7e7a44a
--- /dev/null
+++ b/bsp/projects/microej/ui/src/LLUI_DISPLAY_impl.c
@@ -0,0 +1,359 @@
+/*
+ * C
+ *
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board.
+ * @author MicroEJ Developer Team
+ * @version 7.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include
+
+#include
+#include
+
+#include "bsp_util.h"
+#include "display_dma.h"
+#include "ui_vglite.h"
+#include "display_impl.h"
+#include "framerate.h"
+#include "ui_display_brs.h"
+#include "power_manager.h"
+
+#include "vglite_window.h"
+
+#include "fsl_debug_console.h"
+#include "fsl_dc_fb_dsi_cmd.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+#if (CUSTOM_VGLITE_MEMORY_CONFIG != 1)
+#error "Application must be compiled with CUSTOM_VGLITE_MEMORY_CONFIG=1"
+#else
+#define VGLITE_COMMAND_BUFFER_SZ (128 * 1024)
+#define VGLITE_HEAP_SZ 0x100000
+#endif
+
+#define DISPLAY_STACK_SIZE (8 * 1024)
+#define DISPLAY_TASK_PRIORITY (12) /** Should be > tskIDLE_PRIORITY & < configTIMER_TASK_PRIORITY */
+#define DISPLAY_TASK_STACK_SIZE (DISPLAY_STACK_SIZE / 4)
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+
+/* Allocate the heap and set the command buffer(s) size */
+AT_NONCACHEABLE_SECTION_ALIGN(uint8_t vglite_heap[VGLITE_HEAP_SZ], 64);
+
+void *vglite_heap_base = &vglite_heap;
+uint32_t vglite_heap_size = VGLITE_HEAP_SZ;
+uint32_t vglite_cmd_buff_size = VGLITE_COMMAND_BUFFER_SZ;
+
+/*
+ * @brief: Semaphore to synchronize the display flush with MicroUI
+ */
+static SemaphoreHandle_t sync_flush;
+static uint8_t* dirty_area_addr; // Address of the source framebuffer
+static uint8_t dirty_area_flush; // Identifier of the flush
+
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_LEGACY
+static int32_t dirty_area_ymin; // Top-most coordinate of the area to synchronize
+static int32_t dirty_area_ymax; // Bottom-most coordinate of the area to synchronize
+#endif
+
+/*
+ * @brief VGLite display context
+ */
+static vg_lite_display_t display;
+
+/*
+ * @brief VGLite window context
+ */
+static vg_lite_window_t window;
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief: Task to manage display flushes and synchronize with hardware rendering
+ * operations
+ */
+static void __display_task(void * pvParameters) {
+ (void)pvParameters;
+
+ do {
+
+ xSemaphoreTake(sync_flush, portMAX_DELAY);
+
+ // save the flush conf: can be modified by the next call to flush() as soon as LLUI_DISPLAY_setDrawingBuffer() will wake up the Graphics Engine
+ uint8_t* flush_addr = dirty_area_addr;
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_PREDRAW
+ uint8_t flush_identifier = dirty_area_flush;
+#endif
+
+ // Two actions:
+ // 1- wait for the end of previous swap (if not already done): wait the
+ // end of sending of current frame buffer to display
+ // 2- start sending of current_buffer to display (without waiting the
+ // end)
+ VGLITE_SwapBuffers(&window);
+
+ // Increment framerate
+ framerate_increment();
+
+#if defined (FRAME_BUFFER_COUNT) && (FRAME_BUFFER_COUNT > 1)
+ vg_lite_buffer_t *current_buffer = VGLITE_GetRenderTarget(&window);
+
+ // Configure frame buffer powering; at that point current_buffer is back buffer
+ // cppcheck-suppress [misra-c2012-11.3] cast to (framebuffer_t *) is valid
+ DISPLAY_IMPL_update_frame_buffer_status(current_buffer->memory, (framebuffer_t *)flush_addr);
+
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_LEGACY
+#if defined (DISPLAY_DMA_ENABLED) && (DISPLAY_DMA_ENABLED != 0)
+ DISPLAY_DMA_start(
+ (void *) flush_addr,
+ current_buffer->memory,
+ dirty_area_ymin,
+ dirty_area_ymax);
+ // back buffer currently in restoration; wait for restoration before unlocking next drawing
+#else
+ memcpy(
+ &((uint8_t*) current_buffer->memory)[dirty_area_ymin * current_buffer->stride],
+ &((uint8_t*) flush_addr)[dirty_area_ymin * current_buffer->stride],
+ (dirty_area_ymax - dirty_area_ymin + 1) * current_buffer->stride
+ );
+ // back buffer restored can be used for next drawing
+ if (!LLUI_DISPLAY_setDrawingBuffer(flush_identifier, current_buffer->memory, false)) {
+ // end of flush not expected; the Graphics Engine keeps using previous back buffer;
+ // have to cancel the buffers swap
+ VGLITE_CancelSwapBuffers();
+ }
+#endif // defined DISPLAY_DMA_ENABLED
+#elif UI_DISPLAY_BRS == UI_DISPLAY_BRS_PREDRAW
+
+ // back buffer not restored but can be used for next drawing
+ if (LLUI_DISPLAY_setDrawingBuffer(flush_identifier, current_buffer->memory, false)) {
+
+ // wait for LCD refresh
+ (void)FBDEV_GetFrameBuffer(&(display.g_fbdev), 0);
+
+ // here: back buffer sent to the LCD, the buffer can be used again for next drawing
+ // in case of no new drawing has been already performed in new back buffer
+
+ // if another flush is already pending: xxx
+
+ // reuse same back buffer if no drawing has been already performed
+ if (LLUI_DISPLAY_setDrawingBuffer(flush_identifier, flush_addr, false)){
+ // new back buffer set: cancel the previous swap to synchronoze the driver with the Graphics Engine
+ // PRINTF("reuse 0x%x\n", flush_addr);
+ VGLITE_CancelSwapBuffers();
+ }
+ // else: too late to set this old LCD buffer back buffer; nothing to do
+ }
+ else {
+ // end of flush not expected; the Graphics Engine keeps using previous back buffer;
+ // have to cancel the buffers swap
+ VGLITE_CancelSwapBuffers();
+ }
+
+
+#endif // UI_DISPLAY_BRS
+#else // FRAME_BUFFER_COUNT
+ // buffer being sent, should not be used for next drawing until end of drawing
+ (void)FBDEV_GetFrameBuffer(&(display.g_fbdev), 0);
+#endif // FRAME_BUFFER_COUNT
+
+
+
+ } while (1);
+}
+
+// -----------------------------------------------------------------------------
+// Low Level API [optional]: weak functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void DISPLAY_IMPL_initialized(void) {
+ // does nothing by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void DISPLAY_IMPL_update_frame_buffer_status(framebuffer_t* frame_buffer_on, framebuffer_t* frame_buffer_off) {
+ // does nothing by default
+ (void)frame_buffer_on;
+ (void)frame_buffer_off;
+}
+
+/*
+ * @brief Asks to the CCO MicroUI-VGLite to initialize the VG-Lite library. When this CCO
+ * is not installed / available, the default function is used and does nothing.
+ */
+BSP_DECLARE_WEAK_FCNT void UI_VGLITE_init(void* sem) {
+ // does nothing by default
+ vSemaphoreDelete((SemaphoreHandle_t) sem);
+}
+
+// -----------------------------------------------------------------------------
+// LLUI_DISPLAY_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void DISPLAY_DMA_IMPL_notify_dma_stop(void) {
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_PREDRAW
+ LLUI_DISPLAY_notifyAsynchronousDrawingEnd(true);
+#else
+ // restoration done -> use the previous LCD buffer (== VGLITE_GetRenderTarget()) as new back buffer
+ vg_lite_buffer_t *current_buffer = VGLITE_GetRenderTarget(&window);
+ if (!LLUI_DISPLAY_setDrawingBuffer(dirty_area_flush, current_buffer->memory, true)) {
+ // end of flush not expected; the Graphics Engine keeps using previous back buffer;
+ // have to cancel the buffers swap
+ VGLITE_CancelSwapBuffers();
+ }
+#endif
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_initialize(LLUI_DISPLAY_SInitData* init_data) {
+
+ /***************
+ * Init VGLite *
+ ***************/
+
+ if (kStatus_Success != BOARD_PrepareVGLiteController()) {
+ UI_VGLITE_IMPL_error(true, "Prepare VGlite controlor error");
+ }
+
+ vg_lite_error_t ret = VG_LITE_SUCCESS;
+
+ if (VG_LITE_SUCCESS != VGLITE_CreateDisplay(&display)) {
+ UI_VGLITE_IMPL_error(true, "VGLITE_CreateDisplay failed: VGLITE_CreateDisplay() returned error %d", ret);
+ }
+
+ // Initialize the window.
+ if (VG_LITE_SUCCESS != VGLITE_CreateWindow(&display, &window)) {
+ UI_VGLITE_IMPL_error(true, "VGLITE_CreateWindow failed: VGLITE_CreateWindow() returned error %d", ret);
+ }
+
+ // force to empty the counter
+ for (uint8_t i = 0; i < window.bufferCount; i++) {
+ (void)FBDEV_GetFrameBuffer(&(display.g_fbdev), 0);
+ }
+
+ UI_VGLITE_init((void*)xSemaphoreCreateBinary());
+
+ /************
+ * Init DMA *
+ ************/
+
+#if defined (DISPLAY_DMA_ENABLED) && (DISPLAY_DMA_ENABLED != 0)
+ DISPLAY_DMA_initialize(s_frameBufferAddress);
+#endif // defined DISPLAY_DMA_ENABLED
+
+ /*************
+ * Init task *
+ *************/
+
+ sync_flush = xSemaphoreCreateBinary();
+ if (pdPASS != xTaskCreate(
+ __display_task,
+ "Display",
+ DISPLAY_TASK_STACK_SIZE,
+ NULL,
+ DISPLAY_TASK_PRIORITY,
+ NULL)){
+ UI_VGLITE_IMPL_error(true, "failed to create task __display\n");
+ }
+
+ /****************
+ * Init MicroUI *
+ ****************/
+
+ vg_lite_buffer_t *buffer = VGLITE_GetRenderTarget(&window);
+ init_data->binary_semaphore_0 = (void*)xSemaphoreCreateBinary();
+ init_data->binary_semaphore_1 = (void*)xSemaphoreCreateBinary();
+ init_data->lcd_width = window.width;
+ init_data->lcd_height = window.height;
+ init_data->memory_width = FRAME_BUFFER_STRIDE_PIXELS;
+ init_data->back_buffer_address = (uint8_t*)buffer->memory;
+
+ // notify that the display is initialized
+ DISPLAY_IMPL_initialized();
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_flush(MICROUI_GraphicsContext* gc, uint8_t flush_identifier, const ui_rect_t areas[], size_t length) {
+
+ uint8_t* addr = LLUI_DISPLAY_getBufferAddress(&gc->image);
+
+ // store dirty area to restore after the flush
+ dirty_area_addr = addr;
+ dirty_area_flush = flush_identifier;
+
+#if UI_DISPLAY_BRS == UI_DISPLAY_BRS_LEGACY
+ dirty_area_ymin = areas[0].y1;
+ dirty_area_ymax = areas[0].y2;
+#endif
+
+ // wakeup display task
+ xSemaphoreGive(sync_flush);
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_binarySemaphoreTake(void* sem) {
+ xSemaphoreTake((SemaphoreHandle_t)sem, portMAX_DELAY);
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_binarySemaphoreGive(void* sem, bool under_isr) {
+
+ if (under_isr) {
+ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
+ xSemaphoreGiveFromISR((SemaphoreHandle_t)sem, &xHigherPriorityTaskWoken);
+ if(xHigherPriorityTaskWoken != pdFALSE ) {
+ // Force a context switch here.
+ portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
+ }
+ }
+ else {
+ xSemaphoreGive((SemaphoreHandle_t)sem);
+ }
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_IMPL_notify_gpu_start(void) {
+ power_manager_enable_low_power(POWER_GPU, LOW_POWER_FORBIDDEN);
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_IMPL_notify_gpu_stop(void) {
+ power_manager_enable_low_power(POWER_GPU, LOW_POWER_AUTHORIZED);
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_IMPL_error(bool critical, const char* format, ...) {
+ (void)format;
+ va_list arg;
+ va_start (arg, format);
+ PRINTF(format, arg);
+ va_end (arg);
+ while (critical){}
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c b/bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c
rename to bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c
index 2bd9619..feb46b1 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c
+++ b/bsp/projects/microej/ui/src/LLUI_INPUT_LOG_impl.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -17,8 +17,7 @@
*
* @see LLUI_INPUT_impl.h file comment
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
@@ -30,15 +29,11 @@
#include
// implements some LLUI_INPUT_impl functions
-#include "LLUI_INPUT_impl.h"
+#include
// deport event description to another file
#include "microui_event_decoder.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef MICROUIEVENTDECODER_ENABLED
// -----------------------------------------------------------------------------
@@ -182,7 +177,3 @@ void LLUI_INPUT_IMPL_log_dump(bool log_type, uint32_t log, uint32_t index) {
// EOF
// -----------------------------------------------------------------------------
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_impl.c b/bsp/projects/microej/ui/src/LLUI_INPUT_impl.c
similarity index 90%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_impl.c
rename to bsp/projects/microej/ui/src/LLUI_INPUT_impl.c
index 07e7c89..701faea 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_INPUT_impl.c
+++ b/bsp/projects/microej/ui/src/LLUI_INPUT_impl.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2019-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c b/bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c
rename to bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c
index 5b7c6f1..97ed224 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c
+++ b/bsp/projects/microej/ui/src/LLUI_PAINTER_impl.c
@@ -1,6 +1,6 @@
/*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,8 +9,7 @@
* @brief This file implements all MicroUI drawing native functions.
* @see LLUI_PAINTER_impl.h file comment
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.0.0
*/
@@ -19,25 +18,31 @@
// --------------------------------------------------------------------------------
// implements LLUI_PAINTER_impl functions
-#include "LLUI_PAINTER_impl.h"
+#include
+
+// use graphical engine functions to synchronize drawings
+#include
+
+// check UI Pack version
+#include
// calls ui_drawing functions
#include "ui_drawing.h"
-// use graphical engine functions to synchronize drawings
-#include "LLUI_DISPLAY.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+// logs the drawings
+#include "ui_log.h"
// --------------------------------------------------------------------------------
// Macros and Defines
// --------------------------------------------------------------------------------
+#if (defined(LLUI_MAJOR_VERSION) && (LLUI_MAJOR_VERSION != 14)) || (defined(LLUI_MINOR_VERSION) && (LLUI_MINOR_VERSION < 0))
+#error "This CCO is only compatible with UI Pack [14.0.0,15.0.0["
+#endif
+
// macros to log a drawing
-#define LOG_DRAW_START(fn) LLUI_DISPLAY_logDrawingStart(CONCAT_DEFINES(LOG_DRAW_, fn))
-#define LOG_DRAW_END(fn) LLUI_DISPLAY_logDrawingEnd(CONCAT_DEFINES(LOG_DRAW_, fn))
+#define LOG_DRAW_START(fn) LLTRACE_record_event_u32(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_DRAW, CONCAT_DEFINES(LOG_DRAW_, fn))
+#define LOG_DRAW_END(s) LLTRACE_record_event_end_u32(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_DRAW, (s))
/*
* LOG_DRAW_EVENT logs identifiers
@@ -85,6 +90,7 @@ static inline void _check_bound(jint max, jint* bound, jint* size, jint* origin)
// LLUI_PAINTER_impl.h functions
// --------------------------------------------------------------------------------
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_writePixel)) {
DRAWING_Status status;
@@ -98,21 +104,22 @@ void LLUI_PAINTER_IMPL_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y) {
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(writePixel);
+ LOG_DRAW_END(status);
}
- // else: pixel out of clip: nothing to do (requestDrawing() has not been called)
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawLine)) {
LOG_DRAW_START(drawLine);
// cannot reduce/clip line: may be endX < startX and / or endY < startY
- LLUI_DISPLAY_setDrawingStatus(UI_DRAWING_drawLine(gc, startX, startY, endX, endY));
- LOG_DRAW_END(drawLine);
+ DRAWING_Status status = UI_DRAWING_drawLine(gc, startX, startY, endX, endY);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x, jint y, jint length) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawHorizontalLine)) {
DRAWING_Status status;
@@ -131,11 +138,11 @@ void LLUI_PAINTER_IMPL_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x, j
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawHorizontalLine);
+ LOG_DRAW_END(status);
}
- // else: line out of clip: nothing to do (requestDrawing() has not been called)
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y, jint length) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawVerticalLine)) {
DRAWING_Status status;
@@ -154,11 +161,11 @@ void LLUI_PAINTER_IMPL_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jin
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawVerticalLine);
+ LOG_DRAW_END(status);
}
- // else: line out of clip: nothing to do (requestDrawing() has not been called)
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawRectangle)) {
DRAWING_Status status;
@@ -180,11 +187,11 @@ void LLUI_PAINTER_IMPL_drawRectangle(MICROUI_GraphicsContext* gc, jint x, jint y
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawRectangle);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillRectangle)) {
DRAWING_Status status;
@@ -196,20 +203,21 @@ void LLUI_PAINTER_IMPL_fillRectangle(MICROUI_GraphicsContext* gc, jint x, jint y
jint y2 = y + height - 1;
// tests on size and clip are performed after suspend to prevent to perform it several times
- if ((width > 0) && (height) > 0 && LLUI_DISPLAY_clipRectangle(gc, &x1, &y1, &x2, &y2)) {
+ if ((width > 0) && (height > 0) && LLUI_DISPLAY_clipRectangle(gc, &x1, &y1, &x2, &y2)) {
LLUI_DISPLAY_configureClip(gc, false /* rectangle has been clipped */);
status = UI_DRAWING_fillRectangle(gc, x1, y1, x2, y2);
+
}
else {
// requestDrawing() has been called and accepted: notify the end of empty drawing
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillRectangle);
+ LOG_DRAW_END(status);
}
- // else: rectangle out of clip: nothing to do (requestDrawing() has not been called)
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawRoundedRectangle)) {
DRAWING_Status status;
@@ -226,11 +234,11 @@ void LLUI_PAINTER_IMPL_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x,
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawRoundedRectangle);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillRoundedRectangle)) {
DRAWING_Status status;
@@ -247,11 +255,11 @@ void LLUI_PAINTER_IMPL_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x,
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillRoundedRectangle);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawCircleArc)) {
DRAWING_Status status;
@@ -268,11 +276,11 @@ void LLUI_PAINTER_IMPL_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawCircleArc);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawEllipseArc)) {
DRAWING_Status status;
@@ -289,11 +297,11 @@ void LLUI_PAINTER_IMPL_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawEllipseArc);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillCircleArc)) {
DRAWING_Status status;
@@ -310,11 +318,11 @@ void LLUI_PAINTER_IMPL_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillCircleArc);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillEllipseArc)) {
DRAWING_Status status;
@@ -331,11 +339,11 @@ void LLUI_PAINTER_IMPL_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillEllipseArc);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawEllipse)) {
DRAWING_Status status;
@@ -352,11 +360,11 @@ void LLUI_PAINTER_IMPL_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y,
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawEllipse);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillEllipse)) {
DRAWING_Status status;
@@ -373,11 +381,11 @@ void LLUI_PAINTER_IMPL_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y,
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillEllipse);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawCircle)) {
DRAWING_Status status;
@@ -394,11 +402,11 @@ void LLUI_PAINTER_IMPL_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, j
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawCircle);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_fillCircle)) {
DRAWING_Status status;
@@ -415,11 +423,11 @@ void LLUI_PAINTER_IMPL_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, j
status = DRAWING_DONE;
}
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(fillCircle);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
+// See the header file for the function documentation
void LLUI_PAINTER_IMPL_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha) {
if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLUI_PAINTER_IMPL_drawImage)) {
DRAWING_Status status = DRAWING_DONE;
@@ -446,9 +454,11 @@ void LLUI_PAINTER_IMPL_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img
if (gc->image.format == img->format) {
// source & destination have got the same pixels memory representation
- if (0xff /* fully opaque */ == l_alpha && !LLUI_DISPLAY_isTransparent(img)) {
+ MICROUI_Image* image = LLUI_DISPLAY_getSourceImage(img);
+
+ if ((0xff /* fully opaque */ == l_alpha) && !LLUI_DISPLAY_isTransparent(img)) {
// copy source on destination without applying an opacity (beware about the overlapping)
- status = UI_DRAWING_copyImage(gc, img, regionX, regionY, width, height, x, y);
+ status = UI_DRAWING_copyImage(gc, image, regionX, regionY, width, height, x, y);
}
else if (img == &gc->image){
// blend source on itself applying an opacity (beware about the overlapping)
@@ -456,7 +466,7 @@ void LLUI_PAINTER_IMPL_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img
}
else {
// blend source on destination applying an opacity
- status = UI_DRAWING_drawImage(gc, img, regionX, regionY, width, height, x, y, l_alpha);
+ status = UI_DRAWING_drawImage(gc, image, regionX, regionY, width, height, x, y, l_alpha);
}
}
else {
@@ -470,15 +480,10 @@ void LLUI_PAINTER_IMPL_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img
// requestDrawing() has been called and accepted: notify the end of empty drawing
LLUI_DISPLAY_setDrawingStatus(status);
- LOG_DRAW_END(drawImage);
+ LOG_DRAW_END(status);
}
- // else: refused drawing
}
// --------------------------------------------------------------------------------
// EOF
// --------------------------------------------------------------------------------
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_helper.c b/bsp/projects/microej/ui/src/buttons_helper.c
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_helper.c
rename to bsp/projects/microej/ui/src/buttons_helper.c
index d4c7ebd..ea1f0c3 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_helper.c
+++ b/bsp/projects/microej/ui/src/buttons_helper.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_manager.c b/bsp/projects/microej/ui/src/buttons_manager.c
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_manager.c
rename to bsp/projects/microej/ui/src/buttons_manager.c
index 92e973c..16db6c2 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/buttons_manager.c
+++ b/bsp/projects/microej/ui/src/buttons_manager.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2013-2021 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_dma.c b/bsp/projects/microej/ui/src/display_dma.c
similarity index 79%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_dma.c
rename to bsp/projects/microej/ui/src/display_dma.c
index 118d2a3..06ef884 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_dma.c
+++ b/bsp/projects/microej/ui/src/display_dma.c
@@ -1,15 +1,16 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
/*
* @file
- * @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board.
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 7.0.0
*/
// -----------------------------------------------------------------------------
@@ -21,6 +22,8 @@
#include "display_dma.h"
#include "display_impl.h"
#include "vglite_window.h"
+#include "bsp_util.h"
+#include "interrupts.h"
#include "fsl_dma.h"
@@ -61,11 +64,11 @@ static dma_handle_t g_DMA_Handle;
#if defined(__ICCARM__)
#pragma data_alignment = 16U
-static dma_descriptor_t dma_descriptors[2 * DISPLAY_DMA_NB_DESCS];
+static dma_descriptor_t dma_descriptors[FRAME_BUFFER_COUNT * DISPLAY_DMA_NB_DESCS];
#elif defined(__CC_ARM)
-static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[2 * DISPLAY_DMA_NB_DESCS];
+static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[FRAME_BUFFER_COUNT * DISPLAY_DMA_NB_DESCS];
#elif defined(__GNUC__)
-static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[2 * DISPLAY_DMA_NB_DESCS];
+static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[FRAME_BUFFER_COUNT * DISPLAY_DMA_NB_DESCS];
#endif
#endif // DISPLAY_DMA_ENABLED != 0
@@ -74,6 +77,7 @@ static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[2 * DISPLA
// Internal function definitions
// -----------------------------------------------------------------------------
+#if defined (DISPLAY_DMA_ENABLED) && (DISPLAY_DMA_ENABLED != 0)
/*
* @brief: Callback called when a DMA transfer is done
*
@@ -82,6 +86,21 @@ static dma_descriptor_t __attribute__((aligned(16U))) dma_descriptors[2 * DISPLA
* @param[in] transfer_done: Flag indicating if the current transfer is done
*/
static void __dma_callback(dma_handle_t *handle, void *param, bool transfer_done, uint32_t tcds);
+#endif // DISPLAY_DMA_ENABLED != 0
+
+// -----------------------------------------------------------------------------
+// Low Level API [optional]: weak functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void DISPLAY_DMA_IMPL_notify_dma_start(void) {
+ // does nothing by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void DISPLAY_DMA_IMPL_notify_dma_stop(void) {
+ // does nothing by default
+}
// -----------------------------------------------------------------------------
// display_dma.h
@@ -97,9 +116,9 @@ void DISPLAY_DMA_initialize(const framebuffer_t * framebuffers[]) {
DMA_SetCallback(&g_DMA_Handle, __dma_callback, NULL);
// Initialize the dma descriptors
- for (int i = 0; i < 2; i++) {
+ for (int i = 0; i < FRAME_BUFFER_COUNT; i++) {
framebuffer_t const * fb_src = framebuffers[i];
- framebuffer_t const * fb_dst = framebuffers[1-i];
+ framebuffer_t const * fb_dst = framebuffers[(FRAME_BUFFER_COUNT == (i+1) ? 0 : (i+1))];
int offset = i*DISPLAY_DMA_NB_DESCS;
int y;
int d;
@@ -107,12 +126,12 @@ void DISPLAY_DMA_initialize(const framebuffer_t * framebuffers[]) {
d = offset;
do {
- y = DISPLAY_DMA_NB_LINES * (d - offset);
-
if (d >= (offset+(DISPLAY_DMA_NB_DESCS-1))) {
break;
}
+ y = DISPLAY_DMA_NB_LINES * (d - offset);
+
DMA_SetupDescriptor(
&(dma_descriptors[d]),
DMA_CHANNEL_XFER(
@@ -181,7 +200,7 @@ void DISPLAY_DMA_start(framebuffer_t *src, framebuffer_t *dst, int ymin, int yma
dma_descriptor_t *p_dma_desc;
- DISPLAY_IMPL_notify_dma_start();
+ DISPLAY_DMA_IMPL_notify_dma_start();
if (src == s_frameBufferAddress[1]) {
p_dma_desc = &dma_descriptors[DISPLAY_DMA_NB_DESCS];
@@ -207,8 +226,11 @@ static void __dma_callback(dma_handle_t *handle, void *param, bool transfer_done
if (transfer_done)
{
uint8_t it = interrupt_enter();
- LLUI_DISPLAY_flushDone(true);
- DISPLAY_IMPL_notify_dma_stop();
+
+ // use the notification to let LLUI_DISPLAY_impl.c calls the right Grpahics Engine
+ // function according to the display buffer refresh strategy
+ DISPLAY_DMA_IMPL_notify_dma_stop();
+
interrupt_leave(it);
}
}
diff --git a/bsp/projects/microej/ui/src/display_framebuffer.c b/bsp/projects/microej/ui/src/display_framebuffer.c
new file mode 100644
index 0000000..2375a21
--- /dev/null
+++ b/bsp/projects/microej/ui/src/display_framebuffer.c
@@ -0,0 +1,54 @@
+/*
+ * C
+ *
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of MicroEJ MicroUI library low level API "LLUI_DISPLAY_impl.h"
+ * for the NXP MIMXRT595-EVK board.
+ * @author MicroEJ Developer Team
+ * @version 7.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "display_framebuffer.h"
+
+#include "fsl_dc_fb.h"
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+
+_Pragma( "location = \"framebuffer0\"") static framebuffer_t s_frameBuffer0;
+#define FRAME_BUFFER0_ADDR &s_frameBuffer0
+
+#if defined (FRAME_BUFFER_COUNT) && (FRAME_BUFFER_COUNT > 1)
+_Pragma( "location = \"framebuffer1\"") static framebuffer_t s_frameBuffer1;
+#define FRAME_BUFFER1_ADDR &s_frameBuffer1
+#endif
+
+#if defined (FRAME_BUFFER_COUNT) && (FRAME_BUFFER_COUNT > 2)
+_Pragma( "location = \"framebuffer2\"") static framebuffer_t s_frameBuffer2;
+#define FRAME_BUFFER2_ADDR &s_frameBuffer2
+#endif
+
+// cppcheck-suppress [misra-c2012-9.3] array is fully initialized
+const framebuffer_t * s_frameBufferAddress[FRAME_BUFFER_COUNT] = {
+ FRAME_BUFFER0_ADDR,
+#if defined (FRAME_BUFFER_COUNT) && (FRAME_BUFFER_COUNT > 1)
+ FRAME_BUFFER1_ADDR,
+#endif
+#if defined (FRAME_BUFFER_COUNT) && (FRAME_BUFFER_COUNT > 2)
+ FRAME_BUFFER2_ADDR
+#endif
+ };
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_impl.c b/bsp/projects/microej/ui/src/display_impl.c
similarity index 85%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_impl.c
rename to bsp/projects/microej/ui/src/display_impl.c
index dc226b4..4843247 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/display_impl.c
+++ b/bsp/projects/microej/ui/src/display_impl.c
@@ -1,133 +1,133 @@
-/*
- * C
- *
- * Copyright 2022 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
- */
-
-/*
- * @brief Implementation of "display_impl.h"
- */
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
-#include "display_impl.h"
-#include "display_vglite.h"
-
-#include "fsl_debug_console.h"
-#include "power_manager.h"
-#include "trace_platform.h"
-#include "event_generator.h"
-#include "mej_log.h"
-
-#include
-
-// -----------------------------------------------------------------------------
-// Internal function definitions
-// -----------------------------------------------------------------------------
-
-/*
- * @brief Special function that manages overlay and rendering mode.
- *
- * @param[in] params: contain which button is pressed when triggering the special function
- */
-static void __vglite_special_function(void *params);
-
-// -----------------------------------------------------------------------------
-// display_impl.h functions
-// -----------------------------------------------------------------------------
-
-void DISPLAY_IMPL_initialized(void) {
-
- // registers callback to event generator to enable / disable hardware rendering
- EVENT_GENERATOR_register_special_cb(__vglite_special_function, 0);
-}
-
-void DISPLAY_IMPL_error(bool critical, const char* format, ...) {
- va_list arg;
- va_start (arg, format);
- MEJ_LOG_PRINTF(format, arg);
- va_end (arg);
- while (critical){}
-}
-
-void DISPLAY_IMPL_notify_gpu_start(void) {
- power_manager_enable_low_power(POWER_GPU, LOW_POWER_FORBIDDEN);
-}
-
-void DISPLAY_IMPL_notify_gpu_stop(void) {
- power_manager_enable_low_power(POWER_GPU, LOW_POWER_AUTHORIZED);
-}
-
-void DISPLAY_IMPL_notify_dma_start(void) {
- power_manager_enable_low_power(POWER_DMA, LOW_POWER_FORBIDDEN);
-
- TRACE_HW_TASK_START(HW_TASK_DMA_ID);
-}
-
-void DISPLAY_IMPL_notify_dma_stop(void) {
- power_manager_enable_low_power(POWER_DMA, LOW_POWER_AUTHORIZED);
-
- // Request power_manager to power down this buffer
- power_manager_framebuffer_request_power_off();
-
- TRACE_HW_TASK_STOP(HW_TASK_DMA_ID);
-}
-
-void DISPLAY_IMPL_update_frame_buffer_status(framebuffer_t* frame_buffer_on, framebuffer_t* frame_buffer_off) {
- power_manager_framebuffer_power_on(frame_buffer_on);
- power_manager_framebuffer_set_next_off(frame_buffer_off);
-}
-
-// -----------------------------------------------------------------------------
-// NHardwareRendering functions
-// -----------------------------------------------------------------------------
-
-/*
- * @brief Checks if hardware rendering is enabled
- *
- * @return true if hardware rendering is enabled, false otherwise
- * Updates current Graphics Context with vglite's rendering area
- */
-jboolean Java_com_microej_display_utils_NHardwareRendering_isEnabled(void) {
- return DISPLAY_VGLITE_is_hardware_rendering_enabled();
-}
-
-/*
- * @brief Checks if hardware rendering is disabled
- *
- * @return true if hardware rendering is disabled, false otherwise
- */
-jboolean Java_com_microej_display_utils_NHardwareRendering_isDisabled(void) {
- return !DISPLAY_VGLITE_is_hardware_rendering_enabled();
-}
-
-/*
- * @brief Disables hardware rendering
- */
-void Java_com_microej_display_utils_NHardwareRendering_disable(void) {
- DISPLAY_VGLITE_disable_hardware_rendering();
-}
-
-/*
- * @brief Enables hardware rendering
- */
-void Java_com_microej_display_utils_NHardwareRendering_enable(void) {
- DISPLAY_VGLITE_enable_hardware_rendering();
-}
-
-// -----------------------------------------------------------------------------
-// Internal functions
-// -----------------------------------------------------------------------------
-
-// See the section 'Internal function definitions' for the function documentation
-static void __vglite_special_function(void *params) {
- DISPLAY_VGLITE_toggle_hardware_rendering();
-}
-
-// -----------------------------------------------------------------------------
-// EOF
-// -----------------------------------------------------------------------------
-
+/*
+ * C
+ *
+ * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @brief Implementation of "display_impl.h"
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "display_impl.h"
+
+#include "fsl_debug_console.h"
+#include "power_manager.h"
+#include "trace_platform.h"
+#include "event_generator.h"
+#include "mej_log.h"
+#include "sni.h"
+
+#include
+
+// -----------------------------------------------------------------------------
+// Internal function definitions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Special function that manages overlay and rendering mode.
+ *
+ * @param[in] params: contain which button is pressed when triggering the special function
+ */
+static void __vglite_special_function(void *params);
+
+// -----------------------------------------------------------------------------
+// display_impl.h functions
+// -----------------------------------------------------------------------------
+
+void DISPLAY_IMPL_initialized(void) {
+
+ // registers callback to event generator to enable / disable hardware rendering
+ EVENT_GENERATOR_register_special_cb(__vglite_special_function, 0);
+}
+
+void UI_VGLITE_IMPL_error(bool critical, const char* format, ...) {
+ va_list arg;
+ va_start (arg, format);
+ MEJ_LOG_PRINTF(format, arg);
+ va_end (arg);
+ while (critical){}
+}
+
+void UI_VGLITE_IMPL_notify_gpu_start(void) {
+ power_manager_enable_low_power(POWER_GPU, LOW_POWER_FORBIDDEN);
+}
+
+void UI_VGLITE_IMPL_notify_gpu_stop(void) {
+ power_manager_enable_low_power(POWER_GPU, LOW_POWER_AUTHORIZED);
+}
+
+void DISPLAY_DMA_IMPL_notify_dma_start(void) {
+ power_manager_enable_low_power(POWER_DMA, LOW_POWER_FORBIDDEN);
+
+ TRACE_HW_TASK_START(HW_TASK_DMA_ID);
+}
+
+void DISPLAY_DMA_IMPL_notify_dma_stop(void) {
+ power_manager_enable_low_power(POWER_DMA, LOW_POWER_AUTHORIZED);
+
+ // Request power_manager to power down this buffer
+ power_manager_framebuffer_request_power_off();
+
+ TRACE_HW_TASK_STOP(HW_TASK_DMA_ID);
+}
+
+void DISPLAY_IMPL_update_frame_buffer_status(framebuffer_t* frame_buffer_on, framebuffer_t* frame_buffer_off) {
+ power_manager_framebuffer_power_on(frame_buffer_on);
+ power_manager_framebuffer_set_next_off(frame_buffer_off);
+}
+
+// -----------------------------------------------------------------------------
+// NHardwareRendering functions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Checks if hardware rendering is enabled
+ *
+ * @return true if hardware rendering is enabled, false otherwise
+ * Updates current Graphics Context with vglite's rendering area
+ */
+jboolean Java_com_microej_display_utils_NHardwareRendering_isEnabled(void) {
+ return UI_VGLITE_is_hardware_rendering_enabled();
+}
+
+/*
+ * @brief Checks if hardware rendering is disabled
+ *
+ * @return true if hardware rendering is disabled, false otherwise
+ */
+jboolean Java_com_microej_display_utils_NHardwareRendering_isDisabled(void) {
+ return !UI_VGLITE_is_hardware_rendering_enabled();
+}
+
+/*
+ * @brief Disables hardware rendering
+ */
+void Java_com_microej_display_utils_NHardwareRendering_disable(void) {
+ UI_VGLITE_disable_hardware_rendering();
+}
+
+/*
+ * @brief Enables hardware rendering
+ */
+void Java_com_microej_display_utils_NHardwareRendering_enable(void) {
+ UI_VGLITE_enable_hardware_rendering();
+}
+
+// -----------------------------------------------------------------------------
+// Internal functions
+// -----------------------------------------------------------------------------
+
+// See the section 'Internal function definitions' for the function documentation
+static void __vglite_special_function(void *params) {
+ UI_VGLITE_toggle_hardware_rendering();
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/event_generator.c b/bsp/projects/microej/ui/src/event_generator.c
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/event_generator.c
rename to bsp/projects/microej/ui/src/event_generator.c
index 89946ff..a5506a9 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/event_generator.c
+++ b/bsp/projects/microej/ui/src/event_generator.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2019-2021 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate.c b/bsp/projects/microej/ui/src/framerate.c
similarity index 90%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate.c
rename to bsp/projects/microej/ui/src/framerate.c
index c578076..680f4de 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate.c
+++ b/bsp/projects/microej/ui/src/framerate.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2014-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c b/bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c
rename to bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c
index 0b22090..c1259ee 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c
+++ b/bsp/projects/microej/ui/src/framerate_impl_FreeRTOS.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/microui_event_decoder.c b/bsp/projects/microej/ui/src/microui_event_decoder.c
similarity index 94%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/microui_event_decoder.c
rename to bsp/projects/microej/ui/src/microui_event_decoder.c
index 28953c3..2c3332d 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/microui_event_decoder.c
+++ b/bsp/projects/microej/ui/src/microui_event_decoder.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2021-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -12,8 +12,7 @@
*
* @see LLUI_INPUT_LOG_impl.c file comment
* @author MicroEJ Developer Team
- * @version 2.0.0
- * @date 22 July 2022
+ * @version 4.0.1
* @since MicroEJ UI Pack 13.1.0
*/
@@ -24,10 +23,6 @@
// calls Microui events decoder functions
#include "microui_event_decoder.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef MICROUIEVENTDECODER_ENABLED
// -----------------------------------------------------------------------------
@@ -314,6 +309,7 @@ static void decode_event_user_data(uint32_t event, uint32_t data, uint32_t index
}
static void decode_event_user(uint32_t event, uint32_t index, MICROUI_EVENT_DECODER_decode_event_data* fct_data_decoder) {
+ (void)index;
LLUI_DEBUG_TRACE("User input event");
uint8_t size = (uint8_t)USEREVENT_SIZE(event);
@@ -421,6 +417,3 @@ void MICROUI_EVENT_DECODER_decode_event(uint32_t event, uint32_t index, MICROUI_
// EOF
// -----------------------------------------------------------------------------
-#ifdef __cplusplus
-}
-#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_helper.c b/bsp/projects/microej/ui/src/touch_helper.c
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_helper.c
rename to bsp/projects/microej/ui/src/touch_helper.c
index c7689e6..0ed3bc7 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_helper.c
+++ b/bsp/projects/microej/ui/src/touch_helper.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2015-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
/*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_manager.c b/bsp/projects/microej/ui/src/touch_manager.c
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_manager.c
rename to bsp/projects/microej/ui/src/touch_manager.c
index af59a42..9a9d267 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/ui/src/touch_manager.c
+++ b/bsp/projects/microej/ui/src/touch_manager.c
@@ -1,11 +1,9 @@
/*
- * C
+ * C
*
- * Copyright 2019-2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
- *
- * Copyright 2023 NXP
- * SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2019-2020 MicroEJ Corp. All rights reserved.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
// -----------------------------------------------------------------------------
@@ -168,7 +166,7 @@ static void __touch_manager_task(void *pvParameters)
while (1)
{
/* Suspend ourselves */
- (void)xSemaphoreTake(touch_interrupt_sem, portMAX_DELAY);
+ xSemaphoreTake(touch_interrupt_sem, portMAX_DELAY);
/* We have been woken up, lets work ! */
__touch_manager_read();
diff --git a/bsp/projects/microej/ui/src/ui_display_brs.c b/bsp/projects/microej/ui/src/ui_display_brs.c
new file mode 100644
index 0000000..13572a5
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_display_brs.c
@@ -0,0 +1,77 @@
+
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief This file implements is the common part of all display buffer strategies (BRS).
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_display_brs.h"
+#include "bsp_util.h"
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// ui_display_brs.h API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Provides a simple implementation of the restore: use memcpy().
+ * See the header file for the function documentation
+ */
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DISPLAY_BRS_restore(MICROUI_GraphicsContext* gc, MICROUI_Image* old_back_buffer, ui_rect_t* rect) {
+
+ DRAWING_Status ret;
+ uint32_t bpp = LLUI_DISPLAY_getImageBPP(old_back_buffer);
+ uint32_t width = UI_RECT_get_width(rect);
+ uint32_t height = UI_RECT_get_height(rect);
+
+ if (8u > bpp) {
+ // this weak function is not designed to target this kind of buffer
+ // -> let the standard function copyImage() performing the job
+ ret = UI_DRAWING_copyImage(gc, old_back_buffer, rect->x1, rect->y1, width, height, rect->x1, rect->y1);
+ }
+ else {
+
+ uint8_t* dst = LLUI_DISPLAY_getBufferAddress(&gc->image);
+ uint8_t* src = LLUI_DISPLAY_getBufferAddress(old_back_buffer);
+ uint32_t stride = LLUI_DISPLAY_getStrideInBytes(&gc->image);
+
+ dst += rect->y1 * stride;
+ src += rect->y1 * stride;
+
+ if ((0 == rect->x1) && (old_back_buffer->width == width)) {
+ // a simple memcpy is required!
+ (void)memcpy(dst, src, stride * height);
+ }
+ else {
+ // have to perform one memcpy per line
+ dst += rect->x1 * bpp / 8u;
+ src += rect->x1 * bpp / 8u;
+ uint32_t size = width * bpp / 8u;
+
+ for (uint32_t y = 0; y < height; y++) {
+ (void)memcpy(dst, src, size);
+ dst += stride;
+ src += stride;
+ }
+ }
+
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_display_brs_legacy.c b/bsp/projects/microej/ui/src/ui_display_brs_legacy.c
new file mode 100644
index 0000000..3f5cb89
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_display_brs_legacy.c
@@ -0,0 +1,64 @@
+
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief This file implements all the LLUI_DISPLAY_impl.h functions relating to the
+ * display buffer strategy (BRS) "legacy"
+ * @see UI_DISPLAY_BRS_LEGACY comment
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+#include "ui_display_brs.h"
+#if defined UI_DISPLAY_BRS && UI_DISPLAY_BRS == UI_DISPLAY_BRS_LEGACY
+
+// --------------------------------------------------------------------------------
+// Private fields
+// --------------------------------------------------------------------------------
+
+static ui_rect_t flush_bounds = {
+ .x1 = INT16_MAX,
+ .y1 = INT16_MAX,
+ .x2 = 0,
+ .y2 = 0,
+};
+
+// --------------------------------------------------------------------------------
+// LLUI_DISPLAY_impl.h API
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status LLUI_DISPLAY_IMPL_newDrawingRegion(MICROUI_GraphicsContext* gc, ui_rect_t* region, bool drawing_now) {
+ (void)gc;
+ (void)drawing_now;
+ flush_bounds.x1 = MIN(flush_bounds.x1, region->x1);
+ flush_bounds.y1 = MIN(flush_bounds.y1, region->y1);
+ flush_bounds.x2 = MAX(flush_bounds.x2, region->x2);
+ flush_bounds.y2 = MAX(flush_bounds.y2, region->y2);
+ return DRAWING_DONE;
+}
+
+DRAWING_Status LLUI_DISPLAY_IMPL_refresh(MICROUI_GraphicsContext* gc, uint8_t flushIdentifier) {
+
+ LLTRACE_record_event_u32x6(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushSingle, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), flush_bounds.x1, flush_bounds.y1, flush_bounds.x2, flush_bounds.y2);
+
+ LLUI_DISPLAY_IMPL_flush(gc, flushIdentifier, &flush_bounds, 1);
+
+ // reset flush bounds to no flush again if there is no drawing until next flush
+ flush_bounds.x1 = INT16_MAX;
+ flush_bounds.y1 = INT16_MAX;
+ flush_bounds.x2 = 0;
+ flush_bounds.y2 = 0;
+
+ return DRAWING_DONE;
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#endif // UI_DISPLAY_BRS_LEGACY
diff --git a/bsp/projects/microej/ui/src/ui_display_brs_predraw.c b/bsp/projects/microej/ui/src/ui_display_brs_predraw.c
new file mode 100644
index 0000000..1ed7a34
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_display_brs_predraw.c
@@ -0,0 +1,348 @@
+
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief This file implements all the LLUI_DISPLAY_impl.h functions relating to the
+ * display buffer strategy (BRS) "pre draw"
+ * @see UI_DISPLAY_BRS_PREDRAW comment
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+#include "ui_display_brs.h"
+#if defined UI_DISPLAY_BRS && UI_DISPLAY_BRS == UI_DISPLAY_BRS_PREDRAW
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_rect_collection.h"
+#include "ui_rect_util.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief This strategy requires the available number of back buffers.
+ * @see the comment of UI_DISPLAY_BRS_PREDRAW.
+ */
+#ifndef UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT
+#error "Require the available number of display buffers (back and front buffers)."
+#elif UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT < 2
+#warning "This strategy is not optimized for less than two buffers."
+#endif
+
+// --------------------------------------------------------------------------------
+// Private fields
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief A collection of dirty regions is kept for each back buffers.
+ */
+#if UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT > 1u
+static ui_rect_collection_t dirty_regions[UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT - 1u] = {0};
+#else
+static ui_rect_collection_t dirty_regions[1u] = {0};
+#endif
+
+/*
+ * @brief Index of the back buffer's collection to restore in the new back buffer.
+ */
+static uint32_t index_dirty_region_to_restore = 0;
+
+static bool backbuffer_ready = true;
+
+ui_rect_t diff[4] = { UI_RECT_EMPTY, UI_RECT_EMPTY, UI_RECT_EMPTY, UI_RECT_EMPTY } ;
+
+#ifdef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+/*
+ * @brief Rectangle given to LLUI_DISPLAY_IMPL_flush(): it includes all dirty regions since
+ * last call to flush().
+ */
+static ui_rect_t flush_bounds = {
+ .x1 = INT16_MAX,
+ .y1 = INT16_MAX,
+ .x2 = 0,
+ .y2 = 0,
+};
+
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+/*
+ * This function removes all regions saved in the next collection to restore in the
+ * new back buffer if they are included in the new region.
+ */
+static void _remove_drawing_regions(MICROUI_GraphicsContext* gc, ui_rect_t* region) {
+ (void)gc;
+
+ for(uint32_t i = 0u; i < (UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT - 1u); i++) {
+ ui_rect_t* r = dirty_regions[i].data;
+ while (r != UI_RECT_COLLECTION_get_end(&dirty_regions[i])) {
+ if (!UI_RECT_is_empty(r) && UI_RECT_contains_rect(region, r)) {
+ // this region will be re-drawn: remove it from the restoration array
+ LOG_REGION(UI_LOG_BRS_RemoveRegion, r);
+ UI_RECT_mark_empty(r);
+ }
+ r++;
+ }
+ }
+}
+
+/*
+ * This function adds the region to the regions to restore.
+ */
+static void _add_drawing_region(MICROUI_GraphicsContext* gc, ui_rect_t* region) {
+
+ for(uint32_t i = 0u; i < (UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT - 1u); i++) {
+ ui_rect_t* previous = UI_RECT_COLLECTION_get_last(&dirty_regions[i]);
+ if ((NULL == previous) || !UI_RECT_contains_rect(previous, region)){
+ // add the dirty region if and only if previous dirty region does not
+ // include the new dirty region
+ ui_rect_t new_region;
+ if (!UI_RECT_COLLECTION_is_full(&dirty_regions[i])) {
+ new_region = *region;
+ }
+ else {
+ // too many rectangles: replace them by only one whose fits the full display
+ LLTRACE_record_event_void(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_ClearList);
+ UI_RECT_COLLECTION_clear(&dirty_regions[i]);
+ new_region = UI_RECT_new_xyxy(0, 0, gc->image.width - 1, gc->image.height - 1);
+ }
+ LOG_REGION(UI_LOG_BRS_AddRegion, &new_region);
+ UI_RECT_COLLECTION_add_rect(&dirty_regions[i], new_region);
+ }
+ }
+
+#ifdef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+ flush_bounds.x1 = MIN(flush_bounds.x1, region->x1);
+ flush_bounds.y1 = MIN(flush_bounds.y1, region->y1);
+ flush_bounds.x2 = MAX(flush_bounds.x2, region->x2);
+ flush_bounds.y2 = MAX(flush_bounds.y2, region->y2);
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+}
+
+/*
+ * @brief Checks if the past has to be restored and if the collection that represents
+ * the past has to be cleared.
+ *
+ * The past may be not restored if the new drawing region includes the past (no need to
+ * restore) or if the current back buffer is the same buffer than before last flush()
+ * (because it already contains the past).
+ *
+ * @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
+ * @param[in] dirty_region the region of the next drawing.
+ * @param[out] clear_past true if the caller has to clear the past collection.
+ * @return true if the past has to be restored.
+ */
+static bool _check_restore(MICROUI_GraphicsContext* gc, ui_rect_t* dirty_region, bool* clear_past) {
+
+ bool restore;
+ *clear_past = false;
+
+ if (!UI_RECT_COLLECTION_is_empty(&dirty_regions[index_dirty_region_to_restore])) {
+ // remains something to restore
+ restore = true;
+
+ if (!UI_RECT_is_empty(dirty_regions[index_dirty_region_to_restore].data)) {
+ // very first call after a flush (not a SNI callback)
+
+ if (LLUI_DISPLAY_getBufferAddress(LLUI_DISPLAY_getSourceImage(&gc->image)) != LLUI_DISPLAY_getBufferAddress(&gc->image)) {
+ // target a new buffer
+
+ if ((dirty_region->x1 == 0) && (dirty_region->y1 == 0) && (dirty_region->x2 == (gc->image.width - 1)) && (dirty_region->y2 == (gc->image.height - 1))) {
+ // new dirty region fits the full screen; the "past" is useless
+ *clear_past = true;
+ restore = false;
+ }
+ }
+ else {
+ // target the same buffer: restore is useless and just add the new dirty region (do not clear the past)
+ restore = false;
+ }
+ }
+ // else: continue the restore
+ }
+ else {
+ // nothing to restore
+ restore = false;
+ }
+ return restore;
+}
+
+/*
+ * @brief Restores the rectangles stored in the array of 4 rectangles (a region previously splitted in four
+ * rectangles).
+ *
+ * @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
+ * @param[in] previous_buffer the MicroUI Image that targets the current front buffer
+ * @return DRAWING_RUNNING if the a restoration is step is running or DRAWING_DONE if the restoration
+ * is fully completed.
+ */
+static DRAWING_Status _restore_sub_rect(MICROUI_GraphicsContext* gc, MICROUI_Image* previous_buffer) {
+ DRAWING_Status restore_status = DRAWING_DONE;
+ int ri = 0;
+ do {
+ ui_rect_t* r = &diff[ri];
+ if (!UI_RECT_is_empty(r)) {
+ LOG_REGION(UI_LOG_BRS_RestoreRegion, r);
+ restore_status = UI_DISPLAY_BRS_restore(gc, previous_buffer, r);
+ UI_RECT_mark_empty(r);
+ }
+ ri++;
+ } while((DRAWING_DONE == restore_status) && (ri < 4));
+ return restore_status;
+}
+
+/*
+ * @brief Prepares the back buffer before the very first drawing, which consists to
+ * restore the past if it is required (see _check_restore()).
+ *
+ * The restoration steps are symbolized by a collection of rectangles. The restoration
+ * of one rectangle might be asynchronous. In that case, this function launches a
+ * restoration step and returns false. The complete restoration will be completed
+ * until this function returns true.
+ *
+ * @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
+ * @param[in] dirty_region the region of the next drawing.
+ * @return DRAWING_RUNNING if the a restoration is step is running or DRAWING_DONE if the restoration
+ * is fully completed and the region added as region to restore
+ */
+static DRAWING_Status _prepare_back_buffer(MICROUI_GraphicsContext* gc, ui_rect_t* dirty_region) {
+
+ DRAWING_Status restore_status = DRAWING_DONE;
+ bool clear_past = false;
+
+ if (_check_restore(gc, dirty_region, &clear_past)) {
+ MICROUI_Image* previous_buffer = LLUI_DISPLAY_getSourceImage(&gc->image);
+ LLUI_DISPLAY_configureClip(gc, false); // regions to restore can be fully out of clip
+
+ // restore sub parts of previous restoration (if any)
+ restore_status = _restore_sub_rect(gc, previous_buffer);
+
+ if (DRAWING_DONE == restore_status) {
+ ui_rect_t* r = dirty_regions[index_dirty_region_to_restore].data;
+ while ((DRAWING_DONE == restore_status) && (r != UI_RECT_COLLECTION_get_end(&dirty_regions[index_dirty_region_to_restore]))) {
+ if (!UI_RECT_is_empty(r)) {
+
+ // split (if required) the current region in sub-parts
+ if (0u < UI_RECT_subtract(diff, r, dirty_region)) {
+ // restore sub-part(s)
+ restore_status = _restore_sub_rect(gc, previous_buffer);
+ }
+
+ // current region is now restored or is currently in restore (thanks to array of sub-parts)
+ UI_RECT_mark_empty(r);
+ }
+ r++;
+ }
+
+ // do not clear the past if a restoration step is running
+ clear_past = DRAWING_DONE == restore_status;
+ }
+ // else: the restoration of a sub-part is running
+ }
+
+ if (clear_past) {
+ UI_RECT_COLLECTION_clear(&dirty_regions[index_dirty_region_to_restore]);
+#if UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT > 1
+ index_dirty_region_to_restore++;
+ index_dirty_region_to_restore %= (uint32_t) UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT - 1u;
+#endif
+ }
+
+ if (DRAWING_DONE == restore_status) {
+ // back buffer is considered as ready when it is fully restored
+ backbuffer_ready = true;
+
+ // add the new region as a region to restore
+ _add_drawing_region(gc, dirty_region);
+ }
+
+ return restore_status;
+}
+
+// --------------------------------------------------------------------------------
+// LLUI_DISPLAY_impl.h API
+// --------------------------------------------------------------------------------
+/*
+ * @brief See the header file for the function documentation.
+ *
+ * This function restores the back buffer if required and store the new region as new
+ * region to restore after next call to flush().
+ */
+DRAWING_Status LLUI_DISPLAY_IMPL_newDrawingRegion(MICROUI_GraphicsContext* gc, ui_rect_t* region, bool drawing_now) {
+
+ LOG_REGION(UI_LOG_BRS_NewDrawing, region);
+
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (!backbuffer_ready) {
+
+ if (!drawing_now) {
+ _remove_drawing_regions(gc, region);
+ }
+ else {
+ ret = _prepare_back_buffer(gc, region);
+ }
+ }
+ else {
+ _add_drawing_region(gc, region); // don't care if drawing now or not
+ }
+
+ return ret;
+}
+
+/*
+ * @brief See the header file for the function documentation.
+ *
+ * This function calls LLUI_DISPLAY_IMPL_flush() with the rectangle that includes all dirty regions.
+ */
+DRAWING_Status LLUI_DISPLAY_IMPL_refresh(MICROUI_GraphicsContext* gc, uint8_t flushIdentifier) {
+
+#ifdef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ LLTRACE_record_event_u32x6(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushSingle, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), flush_bounds.x1, flush_bounds.y1, flush_bounds.x2, flush_bounds.y2);
+
+ // refresh the LCD; use the flush_bounds as dirty region (includes all dirty regions)
+ LLUI_DISPLAY_IMPL_flush(gc, flushIdentifier, &flush_bounds, 1);
+
+ // reset flush bounds to no flush again if there is no drawing until next flush
+ flush_bounds.x1 = INT16_MAX;
+ flush_bounds.y1 = INT16_MAX;
+ flush_bounds.x2 = 0;
+ flush_bounds.y2 = 0;
+
+#else // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ size_t size = UI_RECT_COLLECTION_get_length(&dirty_regions[index_dirty_region_to_restore]);
+ if (1u == size) {
+ ui_rect_t* rect = &dirty_regions[index_dirty_region_to_restore].data[0];
+ LLTRACE_record_event_u32x6(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushSingle, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), rect->x1, rect->y1, rect->x2, rect->y2);
+ }
+ else {
+ LLTRACE_record_event_u32x3(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushMulti, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), size);
+ }
+
+ LLUI_DISPLAY_IMPL_flush(gc, flushIdentifier, dirty_regions[index_dirty_region_to_restore].data, UI_RECT_COLLECTION_get_length(&dirty_regions[index_dirty_region_to_restore]));
+
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ backbuffer_ready = false;
+ return DRAWING_DONE;
+}
+
+#endif // UI_DISPLAY_BRS_PREDRAW
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_display_brs_single.c b/bsp/projects/microej/ui/src/ui_display_brs_single.c
new file mode 100644
index 0000000..b4605cf
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_display_brs_single.c
@@ -0,0 +1,152 @@
+
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief This file implements all the LLUI_DISPLAY_impl.h functions relating to the
+ * display buffer strategy (BRS) "single"
+ * @see UI_DISPLAY_BRS_SINGLE comment
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ */
+
+#include "ui_display_brs.h"
+#if defined UI_DISPLAY_BRS && UI_DISPLAY_BRS == UI_DISPLAY_BRS_SINGLE
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_rect_collection.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief This strategy uses only one buffer
+ * @see the comment of UI_DISPLAY_BRS_SINGLE.
+ */
+#if defined UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT && UI_DISPLAY_BRS_DRAWING_BUFFER_COUNT != 1
+#error "This strategy uses always the same back buffer."
+#endif
+
+// --------------------------------------------------------------------------------
+// Private fields
+// --------------------------------------------------------------------------------
+
+#ifndef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+/*
+ * @brief A collection of rectangles to transmit to the LCD
+ */
+static ui_rect_collection_t dirty_regions;
+
+#else // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+/*
+ * @brief Rectangle given to LLUI_DISPLAY_IMPL_flush(): it includes all dirty regions since
+ * last call to flush().
+ */
+static ui_rect_t flush_bounds = {
+ .x1 = INT16_MAX,
+ .y1 = INT16_MAX,
+ .x2 = 0,
+ .y2 = 0,
+};
+
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+// --------------------------------------------------------------------------------
+// LLUI_DISPLAY_impl.h API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief See the header file for the function documentation.
+ *
+ * This function stores the new region as new region to transmit to the LCD at next call to flush().
+ */
+DRAWING_Status LLUI_DISPLAY_IMPL_newDrawingRegion(MICROUI_GraphicsContext* gc, ui_rect_t* region, bool drawing_now) {
+ (void)drawing_now;
+
+ LOG_REGION(UI_LOG_BRS_NewDrawing, region);
+
+#ifndef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ ui_rect_t* previous = UI_RECT_COLLECTION_get_last(&dirty_regions);
+ if ((NULL == previous) || !UI_RECT_contains_rect(previous, region)){
+ // add the dirty region if and only if previous dirty region does not
+ // include the new dirty region
+ ui_rect_t new_region;
+ if (!UI_RECT_COLLECTION_is_full(&dirty_regions)) {
+ new_region = *region;
+ }
+ else {
+ // too many rectangles: replace them by only one whose fits the full display
+ LLTRACE_record_event_void(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_ClearList);
+ UI_RECT_COLLECTION_clear(&dirty_regions);
+ new_region = UI_RECT_new_xyxy(0, 0, gc->image.width - 1, gc->image.height - 1);
+ }
+ LOG_REGION(UI_LOG_BRS_AddRegion, &new_region);
+ UI_RECT_COLLECTION_add_rect(&dirty_regions, new_region);
+ }
+#else // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+ (void)gc;
+
+ flush_bounds.x1 = MIN(flush_bounds.x1, region->x1);
+ flush_bounds.y1 = MIN(flush_bounds.y1, region->y1);
+ flush_bounds.x2 = MAX(flush_bounds.x2, region->x2);
+ flush_bounds.y2 = MAX(flush_bounds.y2, region->y2);
+
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ return DRAWING_DONE;
+}
+
+/*
+ * @brief See the header file for the function documentation.
+ *
+ * This function calls LLUI_DISPLAY_IMPL_flush() with the rectangle that includes all dirty regions.
+ */
+DRAWING_Status LLUI_DISPLAY_IMPL_refresh(MICROUI_GraphicsContext* gc, uint8_t flushIdentifier) {
+
+#ifndef UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ size_t size = UI_RECT_COLLECTION_get_length(&dirty_regions);
+ if (1u == size) {
+ ui_rect_t* rect = &dirty_regions.data[0];
+ LLTRACE_record_event_u32x6(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushSingle, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), rect->x1, rect->y1, rect->x2, rect->y2);
+ }
+ else {
+ LLTRACE_record_event_u32x3(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushMulti, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), size);
+ }
+
+ LLUI_DISPLAY_IMPL_flush(gc, flushIdentifier, dirty_regions.data, UI_RECT_COLLECTION_get_length(&dirty_regions));
+ UI_RECT_COLLECTION_clear(&dirty_regions);
+
+#else // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ LLTRACE_record_event_u32x6(LLUI_EVENT_group, LLUI_EVENT_offset + UI_LOG_BRS_FlushSingle, flushIdentifier, (uint32_t)LLUI_DISPLAY_getBufferAddress(&gc->image), flush_bounds.x1, flush_bounds.y1, flush_bounds.x2, flush_bounds.y2);
+
+ // refresh the LCD; use the flush_bounds as dirty region (includes all dirty regions)
+ LLUI_DISPLAY_IMPL_flush(gc, flushIdentifier, &flush_bounds, 1);
+
+ // reset flush bounds to no flush again if there is no drawing until next flush
+ flush_bounds.x1 = INT16_MAX;
+ flush_bounds.y1 = INT16_MAX;
+ flush_bounds.x2 = 0;
+ flush_bounds.y2 = 0;
+
+#endif // UI_DISPLAY_BRS_FLUSH_SINGLE_RECTANGLE
+
+ return DRAWING_DONE;
+}
+
+#endif // UI_DISPLAY_BRS_PREDRAW
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_drawing.c b/bsp/projects/microej/ui/src/ui_drawing.c
new file mode 100644
index 0000000..f82f394
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing.c
@@ -0,0 +1,1635 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Redirection of all MicroUI and Drawing libraries drawing functions. This file
+ * is required (must be compiled in the C project) but should not be modified (except when
+ * the VEE port uses more than 3 destination formats, see below).
+ *
+ * According to the available number of destination formats, this file redirects all drawings
+ * to the Graphics Engine software algorithms or uses some tables to target the right drawer
+ * according to the destination format.
+ *
+ * When only one destination format is available and no hardware acceleration (GPU) is
+ * available, the C compiler must just include this file. The default weak implementations
+ * call the Graphics Engine sofware algorithms.
+ *
+ * When only one destination format is available and a hardware acceleration (GPU) is
+ * available, a custom implementation over the GPU must override a set of these default
+ * weak implementations (function UI_DRAWING_xxx()). This allows to override only a set
+ * of functions which are GPU compatible.
+ *
+ * When several destination formats are available, this file uses some tables to target
+ * the right drawer. Each drawer (that targets a specific destination format) has to
+ * specify the table index and has to override a maximum of drawing functions. When a
+ * function is not overridden for a given destination format, the default weak implementation
+ * is used. This implementation uses the stub implementation.
+ *
+ * The BSP should specify the define "LLUI_GC_SUPPORTED_FORMATS". When not set or smaller than
+ * "2", this file considers only one destination format is available: the same format than
+ * the buffer of the display.
+ *
+ * When this define is "2" or "3", this file uses the tables indirections. The format "0" is
+ * reserved for the display buffer format (and for the GraphicsContext that uses the same
+ * format). The formats "1" and "2" are specific to the VEE Port.
+ *
+ * This file does not manages more than 3 destination formats ("0" == display buffer format
+ * and custom formats "1" and "2"). However the file can be easily modified to target more
+ * than 3 destination formats. See format "2" support and apply same patterns to add the
+ * format "3".
+ *
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ * @see ui_drawing.h
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing.h"
+#include "ui_drawing_stub.h"
+#include "ui_drawing_soft.h"
+#include "dw_drawing_soft.h"
+#include "ui_image_drawing.h"
+#include "bsp_util.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions UI_DRAWING_DEFAULT_xxx() are directly called by LLUI_DISPLAY_impl.c,
+ * LLUI_PAINTER_impl.c and LLDW_PAINTER_impl.c. Other files can override each weak
+ * function independently to use a GPU.
+ */
+
+#define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel
+#define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine
+#define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine
+#define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine
+#define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle
+#define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle
+#define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle
+#define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle
+#define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc
+#define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc
+#define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc
+#define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc
+#define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse
+#define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse
+#define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle
+#define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle
+#define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage
+#define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage
+#define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion
+
+#define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint
+#define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine
+#define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle
+#define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc
+#define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse
+#define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine
+#define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle
+#define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse
+#define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc
+#define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage
+#define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor
+#define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear
+#define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor
+#define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear
+
+#else // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions UI_DRAWING_DEFAULT_xxx() are indirectly called through some tables.
+ * The functions have got the identifier "0" as suffix. Another file can override
+ * each weak function independently to use a GPU.
+ */
+
+#define UI_DRAWING_DEFAULT_writePixel UI_DRAWING_writePixel_0
+#define UI_DRAWING_DEFAULT_drawLine UI_DRAWING_drawLine_0
+#define UI_DRAWING_DEFAULT_drawHorizontalLine UI_DRAWING_drawHorizontalLine_0
+#define UI_DRAWING_DEFAULT_drawVerticalLine UI_DRAWING_drawVerticalLine_0
+#define UI_DRAWING_DEFAULT_drawRectangle UI_DRAWING_drawRectangle_0
+#define UI_DRAWING_DEFAULT_fillRectangle UI_DRAWING_fillRectangle_0
+#define UI_DRAWING_DEFAULT_drawRoundedRectangle UI_DRAWING_drawRoundedRectangle_0
+#define UI_DRAWING_DEFAULT_fillRoundedRectangle UI_DRAWING_fillRoundedRectangle_0
+#define UI_DRAWING_DEFAULT_drawCircleArc UI_DRAWING_drawCircleArc_0
+#define UI_DRAWING_DEFAULT_drawEllipseArc UI_DRAWING_drawEllipseArc_0
+#define UI_DRAWING_DEFAULT_fillCircleArc UI_DRAWING_fillCircleArc_0
+#define UI_DRAWING_DEFAULT_fillEllipseArc UI_DRAWING_fillEllipseArc_0
+#define UI_DRAWING_DEFAULT_drawEllipse UI_DRAWING_drawEllipse_0
+#define UI_DRAWING_DEFAULT_fillEllipse UI_DRAWING_fillEllipse_0
+#define UI_DRAWING_DEFAULT_drawCircle UI_DRAWING_drawCircle_0
+#define UI_DRAWING_DEFAULT_fillCircle UI_DRAWING_fillCircle_0
+#define UI_DRAWING_DEFAULT_drawImage UI_DRAWING_drawImage_0
+#define UI_DRAWING_DEFAULT_copyImage UI_DRAWING_copyImage_0
+#define UI_DRAWING_DEFAULT_drawRegion UI_DRAWING_drawRegion_0
+
+#define UI_DRAWING_DEFAULT_drawThickFadedPoint UI_DRAWING_drawThickFadedPoint_0
+#define UI_DRAWING_DEFAULT_drawThickFadedLine UI_DRAWING_drawThickFadedLine_0
+#define UI_DRAWING_DEFAULT_drawThickFadedCircle UI_DRAWING_drawThickFadedCircle_0
+#define UI_DRAWING_DEFAULT_drawThickFadedCircleArc UI_DRAWING_drawThickFadedCircleArc_0
+#define UI_DRAWING_DEFAULT_drawThickFadedEllipse UI_DRAWING_drawThickFadedEllipse_0
+#define UI_DRAWING_DEFAULT_drawThickLine UI_DRAWING_drawThickLine_0
+#define UI_DRAWING_DEFAULT_drawThickCircle UI_DRAWING_drawThickCircle_0
+#define UI_DRAWING_DEFAULT_drawThickEllipse UI_DRAWING_drawThickEllipse_0
+#define UI_DRAWING_DEFAULT_drawThickCircleArc UI_DRAWING_drawThickCircleArc_0
+#define UI_DRAWING_DEFAULT_drawFlippedImage UI_DRAWING_drawFlippedImage_0
+#define UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor UI_DRAWING_drawRotatedImageNearestNeighbor_0
+#define UI_DRAWING_DEFAULT_drawRotatedImageBilinear UI_DRAWING_drawRotatedImageBilinear_0
+#define UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor UI_DRAWING_drawScaledImageNearestNeighbor_0
+#define UI_DRAWING_DEFAULT_drawScaledImageBilinear UI_DRAWING_drawScaledImageBilinear_0
+
+#endif // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+// --------------------------------------------------------------------------------
+// Extern functions
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Set of drawing functions according to the index of the destination format in
+ * the drawing tables ("0", "1" or "2").
+ *
+ * These functions must be declared in other H files.
+ */
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 3)
+#error "Increase the number of following functions and update the next tables"
+#endif
+
+extern DRAWING_Status UI_DRAWING_writePixel_0(MICROUI_GraphicsContext* gc, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+extern DRAWING_Status UI_DRAWING_drawHorizontalLine_0(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+extern DRAWING_Status UI_DRAWING_drawVerticalLine_0(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRectangle_0(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_fillRectangle_0(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_drawCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipseArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillEllipseArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_fillEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_drawCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_fillCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_drawImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_copyImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawRegion_0(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickLine_0(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircle_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickEllipse_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircleArc_0(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawFlippedImage_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+extern uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
+extern void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
+extern void UI_DRAWING_initializeNewImage_1(MICROUI_Image* image);
+extern void UI_DRAWING_freeImageResources_1(MICROUI_Image* image);
+extern DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext* gc, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+extern DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+extern DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+extern uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
+extern void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
+extern void UI_DRAWING_initializeNewImage_2(MICROUI_Image* image);
+extern void UI_DRAWING_freeImageResources_2(MICROUI_Image* image);
+extern DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext* gc, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+extern DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+extern DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+extern DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+extern DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+extern DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+extern DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+extern DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+extern DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+extern DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+extern DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+#endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+#endif // defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// --------------------------------------------------------------------------------
+// Typedef of drawing functions
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Typedef used by next tables. See the function comments in ui_drawing.h
+ */
+
+typedef uint32_t (* UI_DRAWING_getNewImageStrideInBytes_t) (jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride);
+typedef void (* UI_DRAWING_adjustNewImageCharacteristics_t) (jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment);
+typedef void (* UI_DRAWING_initializeNewImage_t) (MICROUI_Image* image);
+typedef void (* UI_DRAWING_freeImageResources_t) (MICROUI_Image* image);
+typedef DRAWING_Status (* UI_DRAWING_writePixel_t) (MICROUI_GraphicsContext* gc, jint x, jint y);
+typedef DRAWING_Status (* UI_DRAWING_drawLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY);
+typedef DRAWING_Status (* UI_DRAWING_drawHorizontalLine_t) (MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y);
+typedef DRAWING_Status (* UI_DRAWING_drawVerticalLine_t) (MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2);
+typedef DRAWING_Status (* UI_DRAWING_drawRectangle_t) (MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+typedef DRAWING_Status (* UI_DRAWING_fillRectangle_t) (MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2);
+typedef DRAWING_Status (* UI_DRAWING_drawRoundedRectangle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+typedef DRAWING_Status (* UI_DRAWING_fillRoundedRectangle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
+typedef DRAWING_Status (* UI_DRAWING_drawCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+typedef DRAWING_Status (* UI_DRAWING_drawEllipseArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+typedef DRAWING_Status (* UI_DRAWING_fillCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle);
+typedef DRAWING_Status (* UI_DRAWING_fillEllipseArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle);
+typedef DRAWING_Status (* UI_DRAWING_drawEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+typedef DRAWING_Status (* UI_DRAWING_fillEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height);
+typedef DRAWING_Status (* UI_DRAWING_drawCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+typedef DRAWING_Status (* UI_DRAWING_fillCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter);
+typedef DRAWING_Status (* UI_DRAWING_drawImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_copyImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+typedef DRAWING_Status (* UI_DRAWING_drawRegion_t) (MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_drawThickFadedPoint_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade);
+typedef DRAWING_Status (* UI_DRAWING_drawThickFadedLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap);
+typedef DRAWING_Status (* UI_DRAWING_drawThickFadedCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade);
+typedef DRAWING_Status (* UI_DRAWING_drawThickFadedCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end);
+typedef DRAWING_Status (* UI_DRAWING_drawThickFadedEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade);
+typedef DRAWING_Status (* UI_DRAWING_drawThickLine_t) (MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness);
+typedef DRAWING_Status (* UI_DRAWING_drawThickCircle_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness);
+typedef DRAWING_Status (* UI_DRAWING_drawThickEllipse_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness);
+typedef DRAWING_Status (* UI_DRAWING_drawThickCircleArc_t) (MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness);
+typedef DRAWING_Status (* UI_DRAWING_drawFlippedImage_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_drawRotatedImageNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_drawRotatedImageBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_drawScaledImageNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+typedef DRAWING_Status (* UI_DRAWING_drawScaledImageBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+#endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// --------------------------------------------------------------------------------
+// Tables according to the destination format.
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+static const UI_DRAWING_getNewImageStrideInBytes_t UI_DRAWER_getNewImageStrideInBytes[] = {
+ &UI_DRAWING_getNewImageStrideInBytes,
+ &UI_DRAWING_getNewImageStrideInBytes_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_getNewImageStrideInBytes_2,
+#endif
+};
+
+static const UI_DRAWING_adjustNewImageCharacteristics_t UI_DRAWER_adjustNewImageCharacteristics[] = {
+ &UI_DRAWING_adjustNewImageCharacteristics,
+ &UI_DRAWING_adjustNewImageCharacteristics_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_adjustNewImageCharacteristics_2,
+#endif
+};
+
+static const UI_DRAWING_initializeNewImage_t UI_DRAWER_initializeNewImage[] = {
+ &UI_DRAWING_initializeNewImage,
+ &UI_DRAWING_initializeNewImage_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_initializeNewImage_2,
+#endif
+};
+
+static const UI_DRAWING_freeImageResources_t UI_DRAWER_freeImageResources[] = {
+ &UI_DRAWING_freeImageResources,
+ &UI_DRAWING_freeImageResources_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_freeImageResources_2,
+#endif
+};
+
+static const UI_DRAWING_writePixel_t UI_DRAWER_writePixel[] = {
+ &UI_DRAWING_writePixel_0,
+ &UI_DRAWING_writePixel_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_writePixel_2,
+#endif
+};
+
+static const UI_DRAWING_drawLine_t UI_DRAWER_drawLine[] = {
+ &UI_DRAWING_drawLine_0,
+ &UI_DRAWING_drawLine_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawLine_2,
+#endif
+};
+
+static const UI_DRAWING_drawHorizontalLine_t UI_DRAWER_drawHorizontalLine[] = {
+ &UI_DRAWING_drawHorizontalLine_0,
+ &UI_DRAWING_drawHorizontalLine_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawHorizontalLine_2,
+#endif
+};
+
+static const UI_DRAWING_drawVerticalLine_t UI_DRAWER_drawVerticalLine[] = {
+ &UI_DRAWING_drawVerticalLine_0,
+ &UI_DRAWING_drawVerticalLine_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawVerticalLine_2,
+#endif
+};
+
+static const UI_DRAWING_drawRectangle_t UI_DRAWER_drawRectangle[] = {
+ &UI_DRAWING_drawRectangle_0,
+ &UI_DRAWING_drawRectangle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawRectangle_2,
+#endif
+};
+
+static const UI_DRAWING_fillRectangle_t UI_DRAWER_fillRectangle[] = {
+ &UI_DRAWING_fillRectangle_0,
+ &UI_DRAWING_fillRectangle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillRectangle_2,
+#endif
+};
+
+static const UI_DRAWING_drawRoundedRectangle_t UI_DRAWER_drawRoundedRectangle[] = {
+ &UI_DRAWING_drawRoundedRectangle_0,
+ &UI_DRAWING_drawRoundedRectangle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawRoundedRectangle_2,
+#endif
+};
+
+static const UI_DRAWING_fillRoundedRectangle_t UI_DRAWER_fillRoundedRectangle[] = {
+ &UI_DRAWING_fillRoundedRectangle_0,
+ &UI_DRAWING_fillRoundedRectangle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillRoundedRectangle_2,
+#endif
+};
+
+static const UI_DRAWING_drawCircleArc_t UI_DRAWER_drawCircleArc[] = {
+ &UI_DRAWING_drawCircleArc_0,
+ &UI_DRAWING_drawCircleArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawCircleArc_2,
+#endif
+};
+
+static const UI_DRAWING_drawEllipseArc_t UI_DRAWER_drawEllipseArc[] = {
+ &UI_DRAWING_drawEllipseArc_0,
+ &UI_DRAWING_drawEllipseArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawEllipseArc_2,
+#endif
+};
+
+static const UI_DRAWING_fillCircleArc_t UI_DRAWER_fillCircleArc[] = {
+ &UI_DRAWING_fillCircleArc_0,
+ &UI_DRAWING_fillCircleArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillCircleArc_2,
+#endif
+};
+
+static const UI_DRAWING_fillEllipseArc_t UI_DRAWER_fillEllipseArc[] = {
+ &UI_DRAWING_fillEllipseArc_0,
+ &UI_DRAWING_fillEllipseArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillEllipseArc_2,
+#endif
+};
+
+static const UI_DRAWING_drawEllipse_t UI_DRAWER_drawEllipse[] = {
+ &UI_DRAWING_drawEllipse_0,
+ &UI_DRAWING_drawEllipse_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawEllipse_2,
+#endif
+};
+
+static const UI_DRAWING_fillEllipse_t UI_DRAWER_fillEllipse[] = {
+ &UI_DRAWING_fillEllipse_0,
+ &UI_DRAWING_fillEllipse_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillEllipse_2,
+#endif
+};
+
+static const UI_DRAWING_drawCircle_t UI_DRAWER_drawCircle[] = {
+ &UI_DRAWING_drawCircle_0,
+ &UI_DRAWING_drawCircle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawCircle_2,
+#endif
+};
+
+static const UI_DRAWING_fillCircle_t UI_DRAWER_fillCircle[] = {
+ &UI_DRAWING_fillCircle_0,
+ &UI_DRAWING_fillCircle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_fillCircle_2,
+#endif
+};
+
+static const UI_DRAWING_drawImage_t UI_DRAWER_drawImage[] = {
+ &UI_DRAWING_drawImage_0,
+ &UI_DRAWING_drawImage_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawImage_2,
+#endif
+};
+
+static const UI_DRAWING_copyImage_t UI_DRAWER_copyImage[] = {
+ &UI_DRAWING_copyImage_0,
+ &UI_DRAWING_copyImage_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_copyImage_2,
+#endif
+};
+
+static const UI_DRAWING_drawRegion_t UI_DRAWER_drawRegion[] = {
+ &UI_DRAWING_drawRegion_0,
+ &UI_DRAWING_drawRegion_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawRegion_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickFadedPoint_t UI_DRAWER_drawThickFadedPoint[] = {
+ &UI_DRAWING_drawThickFadedPoint_0,
+ &UI_DRAWING_drawThickFadedPoint_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickFadedPoint_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickFadedLine_t UI_DRAWER_drawThickFadedLine[] = {
+ &UI_DRAWING_drawThickFadedLine_0,
+ &UI_DRAWING_drawThickFadedLine_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickFadedLine_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickFadedCircle_t UI_DRAWER_drawThickFadedCircle[] = {
+ &UI_DRAWING_drawThickFadedCircle_0,
+ &UI_DRAWING_drawThickFadedCircle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickFadedCircle_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickFadedCircleArc_t UI_DRAWER_drawThickFadedCircleArc[] = {
+ &UI_DRAWING_drawThickFadedCircleArc_0,
+ &UI_DRAWING_drawThickFadedCircleArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickFadedCircleArc_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickFadedEllipse_t UI_DRAWER_drawThickFadedEllipse[] = {
+ &UI_DRAWING_drawThickFadedEllipse_0,
+ &UI_DRAWING_drawThickFadedEllipse_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickFadedEllipse_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickLine_t UI_DRAWER_drawThickLine[] = {
+ &UI_DRAWING_drawThickLine_0,
+ &UI_DRAWING_drawThickLine_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickLine_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickCircle_t UI_DRAWER_drawThickCircle[] = {
+ &UI_DRAWING_drawThickCircle_0,
+ &UI_DRAWING_drawThickCircle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickCircle_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickEllipse_t UI_DRAWER_drawThickEllipse[] = {
+ &UI_DRAWING_drawThickEllipse_0,
+ &UI_DRAWING_drawThickEllipse_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickEllipse_2,
+#endif
+};
+
+static const UI_DRAWING_drawThickCircleArc_t UI_DRAWER_drawThickCircleArc[] = {
+ &UI_DRAWING_drawThickCircleArc_0,
+ &UI_DRAWING_drawThickCircleArc_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawThickCircleArc_2,
+#endif
+};
+
+static const UI_DRAWING_drawFlippedImage_t UI_DRAWER_drawFlippedImage[] = {
+ &UI_DRAWING_drawFlippedImage_0,
+ &UI_DRAWING_drawFlippedImage_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawFlippedImage_2,
+#endif
+};
+
+static const UI_DRAWING_drawRotatedImageNearestNeighbor_t UI_DRAWER_drawRotatedImageNearestNeighbor[] = {
+ &UI_DRAWING_drawRotatedImageNearestNeighbor_0,
+ &UI_DRAWING_drawRotatedImageNearestNeighbor_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawRotatedImageNearestNeighbor_2,
+#endif
+};
+
+static const UI_DRAWING_drawRotatedImageBilinear_t UI_DRAWER_drawRotatedImageBilinear[] = {
+ &UI_DRAWING_drawRotatedImageBilinear_0,
+ &UI_DRAWING_drawRotatedImageBilinear_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawRotatedImageBilinear_2,
+#endif
+};
+
+static const UI_DRAWING_drawScaledImageNearestNeighbor_t UI_DRAWER_drawScaledImageNearestNeighbor[] = {
+ &UI_DRAWING_drawScaledImageNearestNeighbor_0,
+ &UI_DRAWING_drawScaledImageNearestNeighbor_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawScaledImageNearestNeighbor_2,
+#endif
+};
+
+static const UI_DRAWING_drawScaledImageBilinear_t UI_DRAWER_drawScaledImageBilinear[] = {
+ &UI_DRAWING_drawScaledImageBilinear_0,
+ &UI_DRAWING_drawScaledImageBilinear_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &UI_DRAWING_drawScaledImageBilinear_2,
+#endif
+};
+
+#endif // defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// --------------------------------------------------------------------------------
+// LLUI_DISPLAY_impl.h functions that depend on image format
+// (the functions are redirected to ui_drawing.h)
+// --------------------------------------------------------------------------------
+
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The VEE port supports only one destination format: the display buffer format. The
+ * application mutable images have the same format as the display buffer.
+ */
+
+// See the header file for the function documentation
+int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
+ return LLUI_DISPLAY_isDisplayFormat(image_format) ? 0 /* no error */ : -1 /* means invalid */;
+}
+
+// See the header file for the function documentation
+uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
+ // just make an indirection (useful for multi destination formats)
+ return UI_DRAWING_getNewImageStrideInBytes(image_format, width, height, default_stride);
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
+ // just make an indirection (useful for multi destination formats)
+ UI_DRAWING_adjustNewImageCharacteristics(image_format, width, height, data_size, data_alignment);
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image* image) {
+ // just make an indirection (useful for multi destination formats)
+ UI_DRAWING_initializeNewImage(image);
+}
+
+// See the header file for the function documentation
+void LLUI_DISPLAY_IMPL_freeImageResources(MICROUI_Image* image) {
+ // just make an indirection (useful for multi destination formats)
+ UI_DRAWING_freeImageResources(image);
+}
+
+#else // #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The VEE port supports several destination formats. All drawing functions use a
+ * dedicated table to redirect to the right implementation. The VEE Port must implement
+ * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
+ * the destination format.
+ *
+ * The "DEFAULT" functions (see below) are used as element "0" of the tables (this is the
+ * display buffer format).
+ */
+
+int32_t LLUI_DISPLAY_IMPL_getDrawerIdentifier(jbyte image_format) {
+
+ int32_t index;
+
+ if (LLUI_DISPLAY_isDisplayFormat(image_format)) {
+ index = 0;
+ } else if (UI_DRAWING_is_drawer_1(image_format)) {
+ index = 1;
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ } else if (UI_DRAWING_is_drawer_2(image_format)) {
+ index = 2;
+#endif
+ }
+ else {
+ // unknown format
+ index = -1;
+ }
+
+ return index;
+}
+
+/*
+ * @brief See the header file for the function documentation
+ *
+ * Implementation details: The new image to create is an immutable image or a mutable image.
+ *
+ * - If it is a mutable image, that means a drawer is able to draw into it (see
+ * LLUI_DISPLAY_IMPL_getDrawerIdentifier()). In this case, this function redirects the
+ * implementation to the drawer (that should be able to adjust image characteristics if
+ * required).
+ *
+ * - If it is an immutable image (PNG decoder, automatic image format convert, etc.), that
+ * means (most of the time) no drawer can manage this image format. In such case, this function
+ * redirects the implementation to the default implementation (the indirection table
+ * UI_DRAWER_getNewImageStrideInBytes points to the default function at index 0).
+ *
+ * - In the case a drawer is available for this new immutable image, this function redirects
+ * to the drawer.
+ */
+uint32_t LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
+ int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
+ drawer = (drawer >= 0) ? drawer : 0;
+ return (*UI_DRAWER_getNewImageStrideInBytes[drawer])(image_format, width, height, default_stride);
+}
+
+// See the header file foar the function documentation and implementation of
+// LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
+void LLUI_DISPLAY_IMPL_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
+ int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image_format);
+ drawer = (drawer >= 0) ? drawer : 0;
+ (*UI_DRAWER_adjustNewImageCharacteristics[drawer])(image_format, width, height, data_size, data_alignment);
+}
+
+// See the header file for the function documentation and implementation of
+// LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
+void LLUI_DISPLAY_IMPL_initializeNewImage(MICROUI_Image* image) {
+ int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image->format);
+ drawer = (drawer >= 0) ? drawer : 0;
+ (*UI_DRAWER_initializeNewImage[drawer])(image);
+}
+
+// See the header file for the function documentation and implementation of
+// LLUI_DISPLAY_IMPL_getNewImageStrideInBytes
+void LLUI_DISPLAY_IMPL_freeImageResources(MICROUI_Image* image) {
+ int32_t drawer = LLUI_DISPLAY_IMPL_getDrawerIdentifier(image->format);
+ drawer = (drawer >= 0) ? drawer : 0;
+ (*UI_DRAWER_freeImageResources[drawer])(image);
+}
+
+#endif // #if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h functions
+// (the function names don't differ regardless of the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride) {
+ (void)image_format;
+ (void)width;
+ (void)height;
+ // no specific stride by default
+ return default_stride;
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
+ (void)image_format;
+ (void)width;
+ (void)height;
+ (void)data_size;
+ (void)data_alignment;
+ // nothing to adjust by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage(MICROUI_Image* image){
+ (void)image;
+ // nothing to initialize by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources(MICROUI_Image* image){
+ (void)image;
+ // nothing to initialize by default
+}
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h functions
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y){
+ return UI_DRAWING_SOFT_writePixel(gc, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ return UI_DRAWING_SOFT_drawLine(gc, startX, startY, endX, endY);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ return UI_DRAWING_SOFT_drawHorizontalLine(gc, x1, x2, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ return UI_DRAWING_SOFT_drawVerticalLine(gc, x, y1, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_SOFT_drawRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_SOFT_fillRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_SOFT_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_SOFT_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_SOFT_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_SOFT_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_SOFT_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_SOFT_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_SOFT_drawEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_SOFT_fillEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_SOFT_drawCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_SOFT_fillCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+#else
+ return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return UI_DRAWING_SOFT_copyImage(gc, img, regionX, regionY, width, height, x, y);
+#else
+ return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ return DW_DRAWING_SOFT_drawThickFadedPoint(gc, x, y, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ return DW_DRAWING_SOFT_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ return DW_DRAWING_SOFT_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ return DW_DRAWING_SOFT_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ return DW_DRAWING_SOFT_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ return DW_DRAWING_SOFT_drawThickLine(gc, startX, startY, endX, endY, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ return DW_DRAWING_SOFT_drawThickCircle(gc, x, y, diameter, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ return DW_DRAWING_SOFT_drawThickEllipse(gc, x, y, width, height, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ return DW_DRAWING_SOFT_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+#endif
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_DEFAULT_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ return DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+#else
+ return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
+#endif
+}
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * The VEE port supports several destination formats. All drawing functions use a
+ * dedicated table to redirect to the right implementation. The VEE Port must implement
+ * the functions UI_DRAWING_is_drawer_X() to identify the right drawer according to
+ * the destination format.
+ *
+ * The "DEFAULT" functions (see above) are used as element "0" of the tables (== display
+ * buffer format).
+ */
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y){
+ return (*UI_DRAWER_writePixel[gc->drawer])(gc, x, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ return (*UI_DRAWER_drawLine[gc->drawer])(gc, startX, startY, endX, endY);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ return (*UI_DRAWER_drawHorizontalLine[gc->drawer])(gc, x1, x2, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ return (*UI_DRAWER_drawVerticalLine[gc->drawer])(gc, x, y1, y2);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return (*UI_DRAWER_drawRectangle[gc->drawer])(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return (*UI_DRAWER_fillRectangle[gc->drawer])(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return (*UI_DRAWER_drawRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return (*UI_DRAWER_fillRoundedRectangle[gc->drawer])(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return (*UI_DRAWER_drawCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return (*UI_DRAWER_drawEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return (*UI_DRAWER_fillCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return (*UI_DRAWER_fillEllipseArc[gc->drawer])(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return (*UI_DRAWER_drawEllipse[gc->drawer])(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return (*UI_DRAWER_fillEllipse[gc->drawer])(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return (*UI_DRAWER_drawCircle[gc->drawer])(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return (*UI_DRAWER_fillCircle[gc->drawer])(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return (*UI_DRAWER_drawImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return (*UI_DRAWER_copyImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return (*UI_DRAWER_drawRegion[gc->drawer])(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ return (*UI_DRAWER_drawThickFadedPoint[gc->drawer])(gc, x, y, thickness, fade);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ return (*UI_DRAWER_drawThickFadedLine[gc->drawer])(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ return (*UI_DRAWER_drawThickFadedCircle[gc->drawer])(gc, x, y, diameter, thickness, fade);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ return (*UI_DRAWER_drawThickFadedCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ return (*UI_DRAWER_drawThickFadedEllipse[gc->drawer])(gc, x, y, width, height, thickness, fade);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ return (*UI_DRAWER_drawThickLine[gc->drawer])(gc, startX, startY, endX, endY, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ return (*UI_DRAWER_drawThickCircle[gc->drawer])(gc, x, y, diameter, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ return (*UI_DRAWER_drawThickEllipse[gc->drawer])(gc, x, y, width, height, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ return (*UI_DRAWER_drawThickCircleArc[gc->drawer])(gc, x, y, diameter, startAngle, arcAngle, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return (*UI_DRAWER_drawFlippedImage[gc->drawer])(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return (*UI_DRAWER_drawRotatedImageNearestNeighbor[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return (*UI_DRAWER_drawRotatedImageBilinear[gc->drawer])(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return (*UI_DRAWER_drawScaledImageNearestNeighbor[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return (*UI_DRAWER_drawScaledImageBilinear[gc->drawer])(gc, img, x, y, factorX, factorY, alpha);
+}
+
+/*
+ * The next functions are used as elements "1" of the tables. They call STUB functions and should be
+ * overridden by the drawer that manages the format identified by the index "1".
+ *
+ * Only the functions UI_DRAWING_adjustNewImageCharacteristics_1() and UI_DRAWING_initializeNewImage_1()
+ * are mandatory. If the drawing engine (for the format identified by the index "1") does not override these
+ * functions, the application will not be able to open an image with the associated format (the default functions
+ * are implemented as weak functions in case there is no drawing engine for this format).
+ *
+ * If no engine supports the format identified by the index "1", the application will not be able to open
+ * an image with the associated format.
+ */
+
+BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_1(jbyte image_format) {
+ (void)image_format;
+ // default behavior: format is not supported
+ return false;
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride){
+ (void)image_format;
+ (void)width;
+ (void)height;
+ // does nothing and will throw an error if the application tries to open this kind of image.
+ // see above.
+ return default_stride;
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_1(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
+ (void)image_format;
+ (void)width;
+ (void)height;
+ (void)data_size;
+ (void)data_alignment;
+ // does nothing and will throw an error if the application tries to open this kind of image.
+ // see above.
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_1(MICROUI_Image* image){
+ (void)image;
+ // nothing to do
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources_1(MICROUI_Image* image){
+ (void)image;
+ // nothing to do
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_1(MICROUI_GraphicsContext* gc, jint x, jint y){
+ return UI_DRAWING_STUB_writePixel(gc, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_1(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_1(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_1(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_1(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_1(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+/*
+ * The next functions are used as elements "2" of the tables. They call STUB functions and should be
+ * overridden by the drawer that manages the format identified by the index "2".
+ *
+ * Only the functions UI_DRAWING_adjustNewImageCharacteristics_2() and UI_DRAWING_initializeNewImage_2()
+ * are mandatory. If the drawing engine (for the format identified by the index "2") does not override these
+ * functions, the application will not be able to open an image with the associated format (the default functions
+ * are implemented as weak functions in case there is no drawing engine for this format).
+ *
+ * If no engine supports the format identified by the index "2", the application will not be able to open
+ * an image with the associated format.
+ */
+
+BSP_DECLARE_WEAK_FCNT bool UI_DRAWING_is_drawer_2(jbyte image_format) {
+ (void)image_format;
+ // default behavior: format is not supported
+ return false;
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t UI_DRAWING_getNewImageStrideInBytes_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t default_stride){
+ (void)image_format;
+ (void)width;
+ (void)height;
+ // does nothing and will throw an error if the application tries to open this kind of image.
+ // see above.
+ return default_stride;
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_adjustNewImageCharacteristics_2(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment){
+ (void)image_format;
+ (void)width;
+ (void)height;
+ (void)data_size;
+ (void)data_alignment;
+ // does nothing and will throw an error if the application tries to open this kind of image.
+ // see above.
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_initializeNewImage_2(MICROUI_Image* image){
+ (void)image;
+ // nothing to do
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_DRAWING_freeImageResources_2(MICROUI_Image* image){
+ (void)image;
+ // nothing to do
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_writePixel_2(MICROUI_GraphicsContext* gc, jint x, jint y){
+ return UI_DRAWING_STUB_writePixel(gc, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ return UI_DRAWING_STUB_drawLine(gc, startX, startY, endX, endY);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawHorizontalLine_2(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ return UI_DRAWING_STUB_drawHorizontalLine(gc, x1, x2, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawVerticalLine_2(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ return UI_DRAWING_STUB_drawVerticalLine(gc, x, y1, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_STUB_drawRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRectangle_2(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_STUB_fillRectangle(gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_STUB_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillRoundedRectangle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_STUB_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipseArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_STUB_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_STUB_drawEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_STUB_fillEllipse(gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_STUB_drawCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_fillCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_STUB_fillCircle(gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_copyImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRegion_2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedPoint_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ return UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ return UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickFadedEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ return UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickLine_2(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ return UI_DRAWING_STUB_drawThickLine(gc, startX, startY, endX, endY, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircle_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ return UI_DRAWING_STUB_drawThickCircle(gc, x, y, diameter, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickEllipse_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ return UI_DRAWING_STUB_drawThickEllipse(gc, x, y, width, height, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawThickCircleArc_2(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ return UI_DRAWING_STUB_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawFlippedImage_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_IMAGE_DRAWING_drawFlipped(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawRotatedImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_IMAGE_DRAWING_drawRotatedBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageNearestNeighbor_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_IMAGE_DRAWING_drawScaledNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_DRAWING_drawScaledImageBilinear_2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_IMAGE_DRAWING_drawScaledBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+#endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+#else // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * The VEE port supports only one destination format: the display buffer format. The
+ * application can only create immutable images or mutable images with the same format as
+ * the display buffer. All drawing functions are redirected to the software implementation
+ * by default. A third party implementation (often on a GPU) can replace each weak function
+ * independently.
+ *
+ * The VEE Port can tune the new image characteristics to add a header before the pixel
+ * array for instance.
+ */
+
+#endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_drawing_argb8888.c b/bsp/projects/microej/ui/src/ui_drawing_argb8888.c
new file mode 100644
index 0000000..4469bef
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_argb8888.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#include
+
+#include "ui_drawing_vglite.h"
+#include "vg_drawing_vglite.h"
+
+/*
+ * The current VEE port supports two output formats: BufferedVectorImage (see the MicroVG CCO) and ARGB8888 (this file).
+ * To add another output format, add the same mechanism as in the UI testsuite VEE port (see ui_drawing_composite.c) and modify this file accordingly.
+ */
+
+#define UI_DRAWING_IDENTIFIER_ARGB8888_FORMAT 2 // fake identifier to not overlap ui_drawing_composite
+#define VG_DRAWING_IDENTIFIER_ARGB8888_FORMAT UI_DRAWING_IDENTIFIER_ARGB8888_FORMAT
+
+#define UI_DRAWING_ARGB8888_is_drawer CONCAT(UI_DRAWING_is_drawer_, UI_DRAWING_IDENTIFIER_ARGB8888_FORMAT)
+#define UI_DRAWING_ARGB8888_getNewImageStrideInBytes CONCAT(UI_DRAWING_getNewImageStrideInBytes_, UI_DRAWING_IDENTIFIER_ARGB8888_FORMAT)
+#define VG_DRAWING_ARGB8888_drawPath CONCAT(VG_DRAWING_drawPath_, VG_DRAWING_IDENTIFIER_ARGB8888_FORMAT)
+
+
+bool UI_DRAWING_ARGB8888_is_drawer(jbyte image_format) {
+ return image_format == MICROUI_IMAGE_FORMAT_ARGB8888;
+}
+
+uint32_t UI_DRAWING_ARGB8888_getNewImageStrideInBytes(jbyte image_format, uint32_t image_width, uint32_t image_height, uint32_t default_stride) {
+ return UI_DRAWING_getNewImageStrideInBytes(image_format, image_width, image_height, default_stride);
+}
+
+DRAWING_Status VG_DRAWING_ARGB8888_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color) {
+ return VG_DRAWING_drawPath_0(gc, path, x, y, matrix, fillRule, blend, color);
+}
diff --git a/bsp/projects/microej/ui/src/ui_drawing_bvi.c b/bsp/projects/microej/ui/src/ui_drawing_bvi.c
new file mode 100644
index 0000000..9c55471
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_bvi.c
@@ -0,0 +1,256 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of a set of ui_drawing.h drawing functions (MicroUI and Drawing libraries).
+ * These are implementations over VGLite and the destination buffer format is the BufferedVectorImage
+ * format (VEE Port specific). When the drawing cannot be performed by the GPU, the stub implementation
+ * is used insted.
+ *
+ * Like ui_drawing_vglite.c, this file just configures the destination buffer and redirects all drawings
+ * to drawing_vglite.c. The file drawing_vglite.c converts the MicroUI drawing in a path can call a specific
+ * function to draw the path; it does not perform the drawing itself and let the caller do it. This
+ * drawing function is specified by ui_drawing_bvi.c to target BufferedVectorImage buffer.
+ *
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ * @see ui_drawing_vglite.c
+ */
+
+#include "microvg_configuration.h"
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing_bvi.h"
+#include "bvi_vglite.h"
+#include "ui_drawing_stub.h"
+#include "ui_drawing_vglite_process.h"
+#include "ui_drawing_vglite_path.h"
+#include "microvg_vglite_helper.h"
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static DRAWING_Status _add_path(MICROUI_GraphicsContext* gc, vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color) {
+ jint err = BVI_VGLITE_add_draw_path(MAP_BVI_ON_GC(gc), path, fill_rule, matrix, blend, color);
+ MICROVG_VGLITE_handle_error(gc, err);
+ return DRAWING_DONE;
+}
+
+static DRAWING_Status _add_clear(MICROUI_GraphicsContext* gc, vg_lite_rectangle_t * rect, vg_lite_color_t color) {
+
+ // Compute the rectangle shape path
+ vg_lite_path_t shape_vg_path;
+ vglite_path_rectangle_t rectangle_path;
+ shape_vg_path.path = &rectangle_path;
+ shape_vg_path.path_length = sizeof(rectangle_path);
+ int path_offset = UI_DRAWING_VGLITE_PATH_compute_rectangle(&shape_vg_path, 0, rect->x, rect->y, rect->width, rect->height, true);
+
+ if (0 < path_offset) {
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ jint err = BVI_VGLITE_add_draw_path(MAP_BVI_ON_GC(gc), &shape_vg_path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, color);
+ MICROVG_VGLITE_handle_error(gc, err);
+ }
+ else {
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ }
+ return DRAWING_DONE;
+}
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h functions
+// (the function names differ according to the index of destination format)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+bool UI_DRAWING_BVI_is_drawer(jbyte image_format) {
+ return BVI_FORMAT == (MICROUI_ImageFormat)image_format;
+}
+
+// See the header file for the function documentation
+void UI_DRAWING_BVI_adjustNewImageCharacteristics(jbyte image_format, uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
+ (void)image_format;
+ BVI_VGLITE_adjust_new_image_characteristics(width, height, data_size, data_alignment);
+}
+
+// See the header file for the function documentation
+void UI_DRAWING_BVI_initializeNewImage(MICROUI_Image* image) {
+ BVI_VGLITE_initialize_new_image(image);
+}
+
+// See the header file for the function documentation
+void UI_DRAWING_BVI_freeImageResources(MICROUI_Image* image) {
+ BVI_VGLITE_free_resources(image);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ return UI_DRAWING_VGLITE_PROCESS_drawLine(&_add_path, gc, startX, startY, endX, endY);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ return UI_DRAWING_VGLITE_PROCESS_drawHorizontalLine(&_add_path, gc, x1, x2, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ return UI_DRAWING_VGLITE_PROCESS_drawVerticalLine(&_add_path, gc, x, y1, y2);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ return UI_DRAWING_VGLITE_PROCESS_fillRectangle(&_add_clear, gc, x1, y1, x2, y2);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_VGLITE_PROCESS_drawRoundedRectangle(&_add_path, gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ return UI_DRAWING_VGLITE_PROCESS_fillRoundedRectangle(&_add_path, gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_VGLITE_PROCESS_drawCircleArc(&_add_path, gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_VGLITE_PROCESS_fillCircleArc(&_add_path, gc, x, y, diameter, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_VGLITE_PROCESS_drawEllipseArc(&_add_path, gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ return UI_DRAWING_VGLITE_PROCESS_fillEllipseArc(&_add_path, gc, x, y, width, height, startAngle, arcAngle);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_VGLITE_PROCESS_drawCircle(&_add_path, gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ return UI_DRAWING_VGLITE_PROCESS_fillCircle(&_add_path, gc, x, y, diameter);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_VGLITE_PROCESS_drawEllipse(&_add_path, gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ return UI_DRAWING_VGLITE_PROCESS_fillEllipse(&_add_path, gc, x, y, width, height);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ DRAWING_Status status;
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)) {
+ status = UI_DRAWING_STUB_drawThickFadedPoint(gc, x, y, thickness, fade);
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedPoint(&_add_path, gc, x, y, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ DRAWING_Status status;
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)) {
+ status = UI_DRAWING_STUB_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedLine(&_add_path, gc, startX, startY, endX, endY, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade), startCap, endCap);
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ DRAWING_Status status;
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)) {
+ status = UI_DRAWING_STUB_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircle(&_add_path, gc, x, y, diameter, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ DRAWING_Status status;
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)) {
+ status = UI_DRAWING_STUB_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircleArc(&_add_path, gc, x, y, diameter, startAngle, arcAngle, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade), start, end);
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ DRAWING_Status status;
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)) {
+ status = UI_DRAWING_STUB_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedEllipse(&_add_path, gc, x, y, width, height, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ return UI_DRAWING_VGLITE_PROCESS_drawThickLine(&_add_path, gc, startX, startY, endX, endY, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ return UI_DRAWING_VGLITE_PROCESS_drawThickCircle(&_add_path, gc, x, y, diameter, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ return UI_DRAWING_VGLITE_PROCESS_drawThickEllipse(&_add_path, gc, x, y, width, height, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_BVI_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ return UI_DRAWING_VGLITE_PROCESS_drawThickCircleArc(&_add_path, gc, x, y, diameter, startAngle, arcAngle, thickness);
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
diff --git a/bsp/projects/microej/ui/src/ui_drawing_stub.c b/bsp/projects/microej/ui/src/ui_drawing_stub.c
new file mode 100644
index 0000000..06d8241
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_stub.c
@@ -0,0 +1,414 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of all drawing functions of ui_drawing_stub.h.
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ * @see ui_drawing_stub.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing_stub.h"
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static inline DRAWING_Status not_implemented(MICROUI_GraphicsContext* gc){
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_NOT_IMPLEMENTED);
+ return DRAWING_DONE;
+}
+
+// --------------------------------------------------------------------------------
+// ui_drawing_stub.h functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_writePixel(MICROUI_GraphicsContext* gc, jint x, jint y){
+ (void)gc;
+ (void)x;
+ (void)y;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+ (void)gc;
+ (void)startX;
+ (void)startY;
+ (void)endX;
+ (void)endY;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+ (void)gc;
+ (void)x1;
+ (void)x2;
+ (void)y;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+ (void)gc;
+ (void)x;
+ (void)y1;
+ (void)y2;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ (void)gc;
+ (void)x1;
+ (void)y1;
+ (void)x2;
+ (void)y2;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+ (void)gc;
+ (void)x1;
+ (void)y1;
+ (void)x2;
+ (void)y2;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)cornerEllipseWidth;
+ (void)cornerEllipseHeight;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)cornerEllipseWidth;
+ (void)cornerEllipseHeight;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)startAngle;
+ (void)arcAngle;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)startAngle;
+ (void)arcAngle;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)startAngle;
+ (void)arcAngle;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)startAngle;
+ (void)arcAngle;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)regionX;
+ (void)regionY;
+ (void)width;
+ (void)height;
+ (void)x;
+ (void)y;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ (void)gc;
+ (void)img;
+ (void)regionX;
+ (void)regionY;
+ (void)width;
+ (void)height;
+ (void)x;
+ (void)y;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ (void)gc;
+ (void)regionX;
+ (void)regionY;
+ (void)width;
+ (void)height;
+ (void)x;
+ (void)y;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)thickness;
+ (void)fade;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+ (void)gc;
+ (void)startX;
+ (void)startY;
+ (void)endX;
+ (void)endY;
+ (void)thickness;
+ (void)fade;
+ (void)startCap;
+ (void)endCap;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)thickness;
+ (void)fade;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)startAngle;
+ (void)arcAngle;
+ (void)thickness;
+ (void)fade;
+ (void)start;
+ (void)end;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)thickness;
+ (void)fade;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+ (void)gc;
+ (void)startX;
+ (void)startY;
+ (void)endX;
+ (void)endY;
+ (void)thickness;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)thickness;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)thickness;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+ (void)gc;
+ (void)x;
+ (void)y;
+ (void)diameter;
+ (void)startAngle;
+ (void)arcAngle;
+ (void)thickness;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)regionX;
+ (void)regionY;
+ (void)width;
+ (void)height;
+ (void)x;
+ (void)y;
+ (void)transformation;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)x;
+ (void)y;
+ (void)rotationX;
+ (void)rotationY;
+ (void)angle;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)x;
+ (void)y;
+ (void)rotationX;
+ (void)rotationY;
+ (void)angle;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)x;
+ (void)y;
+ (void)factorX;
+ (void)factorY;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_STUB_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ (void)gc;
+ (void)img;
+ (void)x;
+ (void)y;
+ (void)factorX;
+ (void)factorY;
+ (void)alpha;
+ return not_implemented(gc);
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_drawing_vglite.c b/bsp/projects/microej/ui/src/ui_drawing_vglite.c
new file mode 100644
index 0000000..54f8bdf
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_vglite.c
@@ -0,0 +1,901 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of a set of ui_drawing.h drawing functions (MicroUI and Drawing libraries).
+ * These are implementations over VGLite and the destination buffer format is the format specified
+ * in the VEE port. When the drawing cannot be performed by the GPU, the software implementation
+ * is used insted.
+ *
+ * This file just configures the destination buffer and redirects all drawings to drawing_vglite.c.
+ * The file drawing_vglite.c converts the MicroUI drawing in a path can call a specific function to
+ * draw the path; it does not perform the drawing itself and let the caller do it. This drawing function
+ * is specified by ui_drawing_vglite.c to target standard destination buffers (display buffer and all
+ * MicroUI BufferedImage).
+ *
+ * Some MicroUI and Drawing drawing functions are disabled for performance reasons or rendering quality
+ * reasons. See ui_vglite_configuration.h to force the use of the GPU.
+ *
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "ui_drawing_vglite.h"
+#include "ui_drawing_soft.h"
+#include "dw_drawing_soft.h"
+#include "ui_image_drawing.h"
+#include "ui_drawing_vglite_process.h"
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static DRAWING_Status _draw_path(MICROUI_GraphicsContext* gc, vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color) {
+ vg_lite_buffer_t* target = UI_VGLITE_configure_destination(gc);
+ vg_lite_error_t err = vg_lite_draw(target, path, fill_rule, matrix, blend, color);
+ return UI_VGLITE_post_operation(gc, err);
+}
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+static DRAWING_Status _clear(MICROUI_GraphicsContext* gc, vg_lite_rectangle_t * rect, vg_lite_color_t color) {
+ vg_lite_buffer_t* target = UI_VGLITE_configure_destination(gc);
+ vg_lite_error_t err = vg_lite_clear(target, rect, color);
+ return UI_VGLITE_post_operation(gc, err);
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+static DRAWING_Status _blit_rect(MICROUI_GraphicsContext* gc, vg_lite_buffer_t *source, uint32_t *rect, vg_lite_matrix_t *matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_filter_t filter) {
+ vg_lite_buffer_t* target = UI_VGLITE_configure_destination(gc);
+ vg_lite_error_t err = vg_lite_blit_rect(target, source, rect, matrix, blend, color, filter);
+ return UI_VGLITE_post_operation(gc, err);
+}
+
+static DRAWING_Status _draw_region(MICROUI_GraphicsContext* gc, vg_lite_buffer_t* source, uint32_t* rect, vg_lite_matrix_t* matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_filter_t filter, uint32_t element_index) {
+
+ vg_lite_buffer_t* target = UI_VGLITE_configure_destination(gc);
+ DRAWING_Status ret = DRAWING_RUNNING;
+
+ // rect[x,y,w,h]
+ uint32_t rect_index = element_index + (uint32_t)2;
+
+ // retrieve band's size (width or height)
+ jint size = rect[rect_index];
+ rect[rect_index] = (uint32_t)(matrix->m[element_index][2] - rect[element_index]);
+
+ // go to x + band size
+ rect[element_index] += size;
+ matrix->m[element_index][2] = rect[element_index] + rect[rect_index];
+
+ while (size > 0) {
+
+ // adjust band's size
+ if (size < rect[rect_index]){
+ rect[rect_index] = size;
+ }
+
+ // adjust src & dest positions
+ rect[element_index] -= rect[rect_index];
+ matrix->m[element_index][2] -= rect[rect_index];
+
+ size -= rect[rect_index];
+
+ if (VG_LITE_SUCCESS != vg_lite_blit_rect(target, source, rect, matrix, blend, color, filter)) {
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ ret = DRAWING_DONE;
+ size = 0; // stop the loop
+ }
+ else {
+ // wakeup task only for the last iteration, otherwise waits the end of the drawing before continue
+ UI_VGLITE_start_operation(size <= 0);
+ }
+ }
+
+ return ret;
+}
+
+// --------------------------------------------------------------------------------
+// ui_drawing.h / ui_drawing_vglite.h functions
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawLine(gc, startX, startY, endX, endY);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawLine(&_draw_path, gc, startX, startY, endX, endY);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawHorizontalLine(MICROUI_GraphicsContext* gc, jint x1, jint x2, jint y){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawHorizontalLine(gc, x1, x2, y);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawHorizontalLine(&_draw_path, gc, x1, x2, y);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawVerticalLine(MICROUI_GraphicsContext* gc, jint x, jint y1, jint y2){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawVerticalLine(gc, x, y1, y2);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawVerticalLine(&_draw_path, gc, x, y1, y2);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillRectangle(MICROUI_GraphicsContext* gc, jint x1, jint y1, jint x2, jint y2){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillRectangle(gc, x1, y1, x2, y2);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillRectangle(&_clear, gc, x1, y1, x2, y2);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawRoundedRectangle(&_draw_path, gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillRoundedRectangle(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint cornerEllipseWidth, jint cornerEllipseHeight){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillRoundedRectangle(gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillRoundedRectangle(&_draw_path, gc, x, y, width, height, cornerEllipseWidth, cornerEllipseHeight);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawCircleArc(&_draw_path, gc, x, y, diameter, startAngle, arcAngle);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawEllipseArc(&_draw_path, gc, x, y, width, height, startAngle, arcAngle);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillCircleArc(gc, x, y, diameter, startAngle, arcAngle);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillCircleArc(&_draw_path, gc, x, y, diameter, startAngle, arcAngle);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillEllipseArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jfloat startAngle, jfloat arcAngle){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillEllipseArc(gc, x, y, width, height, startAngle, arcAngle);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillEllipseArc(&_draw_path, gc, x, y, width, height, startAngle, arcAngle);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawEllipse(gc, x, y, width, height);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawEllipse(&_draw_path, gc, x, y, width, height);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillEllipse(gc, x, y, width, height);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillEllipse(&_draw_path, gc, x, y, width, height);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#ifdef VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_drawCircle(gc, x, y, diameter);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawCircle(&_draw_path, gc, x, y, diameter);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_SIMPLE_DRAWINGS
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_fillCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = UI_DRAWING_SOFT_fillCircle(gc, x, y, diameter);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_fillCircle(&_draw_path, gc, x, y, diameter);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ status = UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+#else
+ status = UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
+#endif
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ vg_lite_color_t color;
+ vg_lite_matrix_t matrix;
+ uint32_t blit_rect[4];
+
+ vg_lite_buffer_t* source_buffer = UI_DRAWING_VGLITE_PROCESS_prepare_draw_image(gc, img, regionX, regionY, width, height, x, y, alpha, &color, &matrix, blit_rect);
+
+ if (NULL != source_buffer){
+ status = _blit_rect(gc, source_buffer, blit_rect, &matrix, VG_LITE_BLEND_SRC_OVER, color, VG_LITE_FILTER_POINT);
+ }
+ else {
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ status = UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+#else
+ status = UI_IMAGE_DRAWING_draw(gc, img, regionX, regionY, width, height, x, y, alpha);
+#endif
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#ifdef VGLITE_USE_GPU_FOR_RGB565_IMAGES
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_copyImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ status = UI_DRAWING_SOFT_copyImage(gc, img, regionX, regionY, width, height, x, y);
+#else
+ status = UI_IMAGE_DRAWING_copy(gc, img, regionX, regionY, width, height, x, y);
+#endif
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = (img == &gc->image) ?
+ // have to manage the overlap
+ UI_DRAWING_VGLITE_drawRegion(gc, regionX, regionY, width, height, x, y, 0xff)
+ // no overlap: draw image as usual
+ : UI_DRAWING_VGLITE_drawImage(gc, img, regionX, regionY, width, height, x, y, 0xff);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+#endif // VGLITE_USE_GPU_FOR_RGB565_IMAGES
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ status = UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#else
+ status = UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#endif
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ vg_lite_color_t color;
+ vg_lite_matrix_t matrix;
+ uint32_t blit_rect[4];
+
+ vg_lite_buffer_t* source_buffer = UI_DRAWING_VGLITE_PROCESS_prepare_draw_image(gc, &gc->image, regionX, regionY, width, height, x, y, alpha, &color, &matrix, blit_rect);
+
+ if (NULL != source_buffer){
+
+ if ((y == regionY) && (x > regionX) && (x < (regionX + width))){
+ // draw with overlap: cut the drawings in several widths
+ status = _draw_region(gc, source_buffer, blit_rect, &matrix, VG_LITE_BLEND_SRC_OVER, color, VG_LITE_FILTER_POINT, 0);
+ }
+ else if ((y > regionY) && (y < (regionY + height))){
+ // draw with overlap: cut the drawings in several heights
+ status = _draw_region(gc, source_buffer, blit_rect, &matrix, VG_LITE_BLEND_SRC_OVER, color, VG_LITE_FILTER_POINT, 1);
+ }
+ else {
+ // draw in one shot
+ status = _blit_rect(gc, source_buffer, blit_rect, &matrix, VG_LITE_BLEND_SRC_OVER, color, VG_LITE_FILTER_POINT);
+ }
+ }
+ else {
+#if !defined(LLUI_IMAGE_CUSTOM_FORMATS)
+ status = UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#else
+ status = UI_IMAGE_DRAWING_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+#endif
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedPoint(MICROUI_GraphicsContext* gc, jint x, jint y, jint thickness, jint fade){
+
+ DRAWING_Status status;
+
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ || !UI_VGLITE_is_hardware_rendering_enabled()
+#endif // VGLITE_OPTION_TOGGLE_GPU
+ ) {
+ DW_DRAWING_SOFT_drawThickFadedPoint(gc, x, y, thickness, fade);
+ status = DRAWING_DONE;
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedPoint(&_draw_path, gc, x, y, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap){
+
+ DRAWING_Status status;
+
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ || !UI_VGLITE_is_hardware_rendering_enabled()
+#endif // VGLITE_OPTION_TOGGLE_GPU
+ ) {
+ DW_DRAWING_SOFT_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
+ status = DRAWING_DONE;
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedLine(&_draw_path, gc, startX, startY, endX, endY, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade), startCap, endCap);
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness, jint fade){
+
+ DRAWING_Status status;
+
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ || !UI_VGLITE_is_hardware_rendering_enabled()
+#endif // VGLITE_OPTION_TOGGLE_GPU
+ ) {
+ DW_DRAWING_SOFT_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
+ status = DRAWING_DONE;
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircle(&_draw_path, gc, x, y, diameter, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness, jint fade, DRAWING_Cap start, DRAWING_Cap end){
+
+ DRAWING_Status status;
+
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ || !UI_VGLITE_is_hardware_rendering_enabled()
+#endif // VGLITE_OPTION_TOGGLE_GPU
+ ) {
+ DW_DRAWING_SOFT_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade, start, end);
+ status = DRAWING_DONE;
+ }
+ else {
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircleArc(&_draw_path, gc, x, y, diameter, startAngle, arcAngle, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade), start, end);
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickFadedEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness, jint fade){
+
+ DRAWING_Status status;
+
+ if (!UI_DRAWING_VGLITE_IS_COMPATIBLE_FADE(fade)
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ || !UI_VGLITE_is_hardware_rendering_enabled()
+#endif // VGLITE_OPTION_TOGGLE_GPU
+ ) {
+ DW_DRAWING_SOFT_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
+ status = DRAWING_DONE;
+ }
+ else {
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickFadedEllipse(&_draw_path, gc, x, y, width, height, UI_DRAWING_VGLITE_GET_THICKNESS(thickness, fade));
+ }
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickLine(MICROUI_GraphicsContext* gc, jint startX, jint startY, jint endX, jint endY, jint thickness){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawThickLine(gc, startX, startY, endX, endY, thickness);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickLine(&_draw_path, gc, startX, startY, endX, endY, thickness);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickCircle(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jint thickness){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawThickCircle(gc, x, y, diameter, thickness);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickCircle(&_draw_path, gc, x, y, diameter, thickness);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickEllipse(MICROUI_GraphicsContext* gc, jint x, jint y, jint width, jint height, jint thickness){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawThickEllipse(gc, x, y, width, height, thickness);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickEllipse(&_draw_path, gc, x, y, width, height, thickness);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawThickCircleArc(MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter, jfloat startAngle, jfloat arcAngle, jint thickness){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ status = UI_DRAWING_VGLITE_PROCESS_drawThickCircleArc(&_draw_path, gc, x, y, diameter, startAngle, arcAngle, thickness);
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawFlippedImage(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+#ifndef VGLITE_USE_GPU_FOR_RGB565_IMAGES
+ // CPU (memcpy) is faster than GPU
+ if((MICROUI_IMAGE_FORMAT_RGB565 == img->format) && (DRAWING_FLIP_NONE == transformation) && (0xff == alpha)) {
+ DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+ status = DRAWING_DONE;
+ }
+ else {
+#endif // VGLITE_USE_GPU_FOR_RGB565_IMAGES
+
+ bool is_gpu_compatible;
+ status = UI_DRAWING_VGLITE_PROCESS_drawFlippedImage(&_blit_rect, gc, img, regionX, regionY, width, height, x, y, transformation, alpha, &is_gpu_compatible);
+
+ if (!is_gpu_compatible) {
+ DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+ status = DRAWING_DONE;
+ }
+
+#ifndef VGLITE_USE_GPU_FOR_RGB565_IMAGES
+ }
+#endif // VGLITE_USE_GPU_FOR_RGB565_IMAGES
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ bool is_gpu_compatible;
+ status = UI_DRAWING_VGLITE_PROCESS_drawRotatedImageNearestNeighbor(&_blit_rect, gc, img, x, y, rotationX, rotationY, angle, alpha, &is_gpu_compatible);
+
+ if (!is_gpu_compatible) {
+ DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ status = DRAWING_DONE;
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawRotatedImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ bool is_gpu_compatible;
+ status = UI_DRAWING_VGLITE_PROCESS_drawRotatedImageBilinear(&_blit_rect, gc, img, x, y, rotationX, rotationY, angle, alpha, &is_gpu_compatible);
+
+ if (!is_gpu_compatible) {
+ DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+ status = DRAWING_DONE;
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ bool is_gpu_compatible;
+ status = UI_DRAWING_VGLITE_PROCESS_drawScaledImageNearestNeighbor(&_blit_rect, gc, img, x, y, factorX, factorY, alpha, &is_gpu_compatible);
+
+ if (!is_gpu_compatible) {
+ DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+ status = DRAWING_DONE;
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_drawScaledImageBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+
+ DRAWING_Status status;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ if (!UI_VGLITE_is_hardware_rendering_enabled()) {
+ status = DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+ }
+ else {
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ bool is_gpu_compatible;
+ status = UI_DRAWING_VGLITE_PROCESS_drawScaledImageBilinear(&_blit_rect, gc, img, x, y, factorX, factorY, alpha, &is_gpu_compatible);
+
+ if (!is_gpu_compatible) {
+ DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+ status = DRAWING_DONE;
+ }
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ }
+#endif // VGLITE_OPTION_TOGGLE_GPU
+
+ return status;
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_drawing_vglite_path.c b/bsp/projects/microej/ui/src/ui_drawing_vglite_path.c
new file mode 100644
index 0000000..744a40e
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_vglite_path.c
@@ -0,0 +1,1292 @@
+/*
+ * C
+ *
+ * Copyright 2019-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over ui_drawing_vglite_path.h.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "ui_drawing_vglite_path.h"
+#include "ui_drawing.h"
+#include "ui_vglite.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * Precomputation of tangente for rounded caps
+ */
+#define CAP_TAN 1.3333333333333333
+#define QUARTER_TAN 0.5522847498307933
+
+#define COS_0 1.0
+#define COS_90 0.0
+#define COS_180 -1.0
+#define COS_270 0.0
+
+#define SIN_0 0.0
+#define SIN_90 1.0
+#define SIN_180 0.0
+#define SIN_270 -1.0
+
+/*
+ * Constant used to compute the ellipse path
+ */
+
+#define CIRCLE_RADIUS 200 // radius
+#define CIRCLE_CP 111 // control point
+
+#define VGLITE_END_CMD 0
+#define VGLITE_MOVE_CMD 2
+#define VGLITE_LINE_CMD 4
+#define VGLITE_CUBIC_CMD 8
+
+// -----------------------------------------------------------------------------
+// Types
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief enumeration that identifies the direction of a quarter curve
+ */
+typedef enum {
+ __horizontal = 0, // The quarter curve starts horizontaly
+ __vertical, // The quarter curve starts verticaly
+} __axis_t;
+
+/*
+ * @brief data to draw a quarter curve
+ */
+typedef struct {
+ int x;
+ int y;
+} __quarter_curve_data_t;
+
+/*
+ * @brief drawing context
+ */
+static struct {
+ uint8_t *path; // Current path buffer
+ int offset; // Offset in the path buffer
+ int x; // Current horizontal coordinate
+ int y; // Current vertical coordinate
+ float32_t sin; // Last computed sinus
+ float32_t cos; // Last computed cosinus
+ float32_t tangent; // Last computed tangent
+ int center_x; // horizontal coordinate of the current ellipse center
+ int center_y; // vertical coordinate of the current ellipse center
+ float32_t control_x; // horizontal coordinate of the last control point
+ float32_t control_y; // vertical coordinate of the last control point
+ __axis_t tangent_axis; // Last tangent (if last command was a quarter curve)
+} __ctxt;
+
+// -----------------------------------------------------------------------------
+// Constants
+// -----------------------------------------------------------------------------
+
+/*
+ * Circle path
+ * This path can be used to draw a circle of anysize anywhere with the proper
+ * transformation matrix
+ */
+static const int16_t __circle_s16[] = {
+ VGLITE_MOVE_CMD, // move to (r, 0)
+ CIRCLE_RADIUS, 0,
+
+ VGLITE_CUBIC_CMD, // cubic to (r, -4/3 * tan(pi/8), 4/3 * tan(pi/8), -r, 0, -r)
+ CIRCLE_RADIUS, -CIRCLE_CP, CIRCLE_CP, -CIRCLE_RADIUS, 0, -CIRCLE_RADIUS,
+
+ VGLITE_CUBIC_CMD, // cubic to (-4/3 * tan(pi/8), -r, -r, -4/3 * tan(pi/8), -r, 0)
+ -CIRCLE_CP, -CIRCLE_RADIUS, -CIRCLE_RADIUS, -CIRCLE_CP, -CIRCLE_RADIUS, 0,
+
+ VGLITE_CUBIC_CMD, // cubic to (-r, 4/3 * tan(pi/8), -4/3 * tan(pi/8), r, 0, r)
+ -CIRCLE_RADIUS, CIRCLE_CP, -CIRCLE_CP, CIRCLE_RADIUS, 0, CIRCLE_RADIUS,
+
+ VGLITE_CUBIC_CMD, // cubic to (4/3 * tan(pi/8), r, r, 4/3 * tan(pi/8), r, 0)
+ CIRCLE_CP, CIRCLE_RADIUS, CIRCLE_RADIUS, CIRCLE_CP, CIRCLE_RADIUS, 0,
+
+ VGLITE_END_CMD, // end
+};
+
+/*
+ * @brief data to draw all the quarter curves
+ */
+static __quarter_curve_data_t __quarter_curve_data[4] = {
+ { SIN_0, COS_0, },
+ { SIN_90, COS_90, },
+ { SIN_180, COS_180, },
+ { SIN_270, COS_270, },
+};
+
+// -----------------------------------------------------------------------------
+// Internal function definitions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Sets the center for ellipse drawing
+ *
+ * @param[out]: x: the horizontal coordinate of the point to compute
+ * @param[out]: y: the vertical coordinate of the point to compute
+ */
+static inline void __set_center(int x, int y) {
+ __ctxt.center_x = x;
+ __ctxt.center_y = y;
+}
+
+/*
+ * @brief Computes the control point to approximate an ellipse arc
+ *
+ * @param[out]: x: the horizontal coordinate of the point to compute
+ * @param[out]: y: the vertical coordinate of the point to compute
+ * @param[in]: point_angle: the angle of the point to control in radians
+ * @param[in]: section_angle: the section angle in radians
+ */
+static inline void __compute_control_point(
+ float32_t *x,
+ float32_t *y,
+ float32_t point_angle,
+ float32_t section_angle) {
+
+ __ctxt.tangent = 4 * mej_tan_f32(section_angle/4) / 3;
+
+ __ctxt.control_x = __ctxt.tangent * arm_cos_f32(point_angle);
+ __ctxt.control_y = __ctxt.tangent * arm_sin_f32(point_angle);
+ *x = __ctxt.control_x;
+ *y = __ctxt.control_y;
+}
+
+/*
+ * @brief Initializes the drawing context
+ *
+ * @param[in] path: vg_lite path to use for drawing
+ * @param[in] offset: offset in the vg_lite path
+ */
+static void __init_drawing(vg_lite_path_t *path, int offset);
+
+/*
+ * @brief Computes a "move_to" VGLite command
+ *
+ * @param[in] x: x coordinate of the destination
+ * @param[in] y: y coordinate of the destination
+ *
+ * @return: -1 if there is not enough memory in the buffer, otherwise the new path_offset
+ */
+static int __move_to(int16_t x, int16_t y);
+
+/*
+ * @brief Computes a "line_to" VGLite command
+ *
+ * @param[in] x: horizontal coordinate of the destination
+ * @param[in] y: vertical coordinate of the destination
+ *
+ * @return: -1 if there is not enough memory in the buffer, otherwise the new path_offset
+ */
+static int __line_to(int16_t x, int16_t y);
+
+/*
+ * @brief Computes a "cubic_to" VGLite command
+ *
+ * @param[in] cy1: y coordinate of the first control point
+ * @param[in] cx2: x coordinate of the second control point
+ * @param[in] cy2: y coordinate of the second control point
+ * @param[in] x: x coordinate of the destination
+ * @param[in] y: y coordinate of the destination
+ *
+ * @return: -1 if there is not enough memory in the buffer, otherwise the new path_offset
+ */
+static int __cubic_to(
+ int16_t cx1,
+ int16_t cy1,
+ int16_t cx2,
+ int16_t cy2,
+ int16_t x,
+ int16_t y);
+
+/*
+ * @brief Computes an "end" VGLite command
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __end(void);
+
+/*
+ * @brief Updates a path structure
+ *
+ * @param[in,out] path: pointer to the path to update.
+ * @param[in] first_path:
+ * - if true: the bounding box is set, the offset is set to zero.
+ * - otherwise: the bounding box is increased.
+ * @param[in] last_path:
+ * - if true: the path is closed calling __end
+ * and the path_length will be set to the current offset.
+ * @param[in] left: left most coordinate of the shape.
+ * @param[in] top: top most coordinate of the shape.
+ * @param[in] right: right most coordinate of the shape.
+ * @param[in] bottom: bottom most coordinate of the shape.
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __update_path(vg_lite_path_t *path,
+ bool first_path,
+ bool last_path,
+ int left,
+ int top,
+ int right,
+ int bottom);
+
+/*
+ * @brief Computes an approximation of an ellipse arc
+ * This computation uses multiple calls to __approximate_ellipse_arc_fragment_to
+ * The center point stored in the context must be set before calling this function.
+ *
+ * @param[in] radius_w: the width radius of the ellipse, sign indicates the direction:
+ * - if negative, drawing to the left of current point.
+ * - if positive, drawing to the righ of the current point.
+ * @param[in] radius_h: the height radius of the ellipse, sign indicates the direction:
+ * - if negative, drawing to the top of the current point.
+ * - if positive, drawing to the bottom of the current point.
+ * @param[in] start_angle: the angle of the start point in radians.
+ * @param[in] end_angle: the angle of the end point in radians.
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __approximate_ellipse_arc_to(
+ int radius_w,
+ int radius_h,
+ float32_t start_angle,
+ float32_t end_angle);
+
+/*
+ * @brief Computes an approximation of an ellipse arc fragment
+ * This computation uses one VGLite cubic_to command * (bezier curves of 3rd order)
+ * This algorithm is implemented from the following source:
+ * https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%c3%a9zier-curves
+ * The approximation is acceptable if the angle is less than PI/2.
+ * For ellipse arcs with angles bigger than PI/2, multiple fragments should be computed
+ * A is the starting point
+ * B is the ending point
+ * C and D are the control points
+ * The computed arc will start from start_angle until end_angle
+ * The center point stored in the context must be set before calling this function.
+ *
+ * @param[in] radius_w: the width radius of the ellipse, sign indicates the direction:
+ * - if negative, drawing to the left of current point.
+ * - if positive, drawing to the righ of the current point.
+ * @param[in] radius_h: the height radius of the ellipse, sign indicates the direction:
+ * - if negative, drawing to the top of the current point.
+ * - if positive, drawing to the bottom of the current point.
+ * @param[in] start_angle: the angle of the start point in radians.
+ * @param[in] end_angle: the angle of the end point in radians.
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __approximate_ellipse_arc_fragment_to(
+ int radius_w,
+ int radius_h,
+ float32_t start_angle,
+ float32_t end_angle);
+
+/*
+ * @brief Computes an approximation of a ellipse arc fragment
+ * This computation uses one VGLite cubic_to command * (bezier curves of 3rd order)
+ * This algorithm is implemented from the following source:
+ * https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%c3%a9zier-curves
+ * The approximation is acceptable if the angle is less than 90 degrees.
+ * For ellipse arcs with angles bigger than 90 degrees, multiple fragments should be computed
+ * A is the starting point
+ * B is the ending point
+ * C and D are the control points
+ *
+ * @param[in] center_x: the horizontal coordinate of the center of the ellipse
+ * @param[in] center_y: the vetical coordinate of the center of the ellipse
+ * @param[in] radius_w: the horizontal radius of the ellipse
+ * @param[in] radius_h: the vertical radius of the ellipse
+ * @param[in] start_angle_rad: the angle of the beginning of the ellipse in radians
+ * @param[in] end_angle_rad: the angle of the end of the ellipse in radians
+ * @param[in] tangent: the tangent of 1/4 th of the angle (end_angle_rad - start_angle_rad) as described
+ * by the algorithm (see source mentionned previously), this must be computed by the caller
+ * as the computation is heavy and can be reused.
+ * @param[in] revert:
+ * - 0: angle is drawn from start_angle_rad to end_angle_rad
+ * - 1: angle is drawn from end_angle_rad to start_angle_rad
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __approximate_ellipse_arc_fragment(
+ uint16_t center_x,
+ uint16_t center_y,
+ int radius_w,
+ int radius_h,
+ float32_t start_angle_rad,
+ float32_t end_angle_rad,
+ float32_t tangent,
+ int revert);
+
+/*
+ * @brief Sets the tangent for the quarter curve algorithm.
+ *
+ * @param tangent: the orientation (tangent) of the beginning of the curve
+ */
+static inline void __set_quarter_curve_tangent_axis(__axis_t tangent_axis) {
+ __ctxt.tangent_axis = tangent_axis;
+}
+
+/*
+ * @brief Computes a path fragment for a quarter curve from current context position to
+ * the given destination coordinates
+ *
+ * @param x: the horizontal coordinate of the destination point
+ * @param y: the vertical coordinate of the destination point
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __quarter_curve_to(int x, int y);
+
+/*
+ * @brief Computes a path fragment for multiple quarter curve from current context position.
+ * This function approximates ellipse quarters with bezier curves.
+ *
+ * @param radius_w: the width radius of the curves, the sign indicates the direction to draw:
+ * - negative, draw to the left of the current point.
+ * - positive, draw to the right of the current point.
+ * @param radius_h: the height radius of the curves, the sign indeicates the direction to draw:
+ * - negative, draw to the top of the current point.
+ * - positive, draw to the bottom of the current point.
+ * @param start: the first quarter to draw (between 1 to 4).
+ * - 0: from 0 to 90 deg
+ * - 1: from 90 to 180 deg
+ * - 2: from 180 to 270 deg
+ * - 3: from 270 to 360 deg
+ * @param number: the number of quarters to draw
+ * - positive: clockwise
+ * - negative: counter clockwise
+ *
+ * @return:
+ * - 1: not enough memory in the path buffer.
+ * - otherwise: the updated path offset
+ */
+static int __multiple_quarter_curve_to(
+ int radius_w,
+ int radius_h,
+ int start,
+ int number);
+
+/*
+ * @brief Computes an approximation of an ellipse arc
+ *
+ * This computation is based on the function __approximate_ellipse_arc_fragment
+ *
+ * The computed path is always centered to (0, 0), the caller can use matrix
+ * to position the ellipse arc
+ *
+ * @param[in]: radius_out_w: the horizontal radius of the outer edge of the ellipse arc
+ * @param[in]: radius_out_h: the vertical radius of the outer edge of the ellipse arc
+ * @param[in]: radius_in_w: the horizontal radius of the inner edge of the ellipse arc
+ * @param[in]: radius_in_h: the vertical radius of the inner edge of the ellipse arc
+ * @param[in]: start_angle_rad: the angle of the beginning of the ellipse in degrees
+ * @param[in]: end_angle_rad: the angle of the end of the ellipse in degrees
+ * @param[in]: caps: the cap representation of the start and the end of the ellipse arc
+ * This is a bit field that can be manipulated with macros MEJ_VGLITE_PATH_CAPS_XXX,
+ * MEJ_VGLITE_PATH_SET_CAPS_XXX and MEJ_VGLITE_PATH_GET_CAPS_XXX,
+ * bits[0-1] represent the cap of the start of the shape,
+ * bits[2-3] represent the cap of the end of the shape,
+ * See DRAWING_ENDOFLINE_XXX for caps values
+ *
+ * @return: -1 if there is not enough memory in the buffer, otherwise the new path_offset
+ */
+static int __approximate_ellipse_arc(
+ int radius_out_w,
+ int radius_out_h,
+ int radius_in_w,
+ int radius_in_h,
+ float32_t start_angle_rad,
+ float32_t arc_angle_rad,
+ int caps);
+
+/*
+ * @brief Normalize an angle so that it is in the range [0, 360[
+ *
+ * @param[in] angle_deg: the angle to normalize in degrees
+ *
+ * @return: the normalized angle
+ */
+static float32_t __normalize_angle(float32_t angle_deg);
+
+// -----------------------------------------------------------------------------
+// ui_drawing_vglite_path.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_line(vg_lite_path_t *line_shape, int x, int y) {
+ // Initialize the drawing context
+ __init_drawing(line_shape, 0);
+
+ int xs;
+ int ys;
+ int xi;
+ int yi;
+
+ if (x >= 0) {
+ xs = 0;
+ xi = 1;
+ } else {
+ xs = 1;
+ xi = -1;
+ }
+
+ if (y >= 0) {
+ ys = 0;
+ yi = 1;
+ } else {
+ ys = 1;
+ yi = -1;
+ }
+
+ const int xe = xs + x + xi;
+ const int ye = ys + y + yi;
+
+ // Move to beginning
+ (void)__move_to(xs, ys);
+
+ // Compute edges of the line
+ (void)__line_to(xs + xi, ys);
+ (void)__line_to(xe, ye - yi);
+ (void)__line_to(xe, ye);
+ (void)__line_to(xe - xi, ye);
+ (void)__line_to(xs, ys + yi);
+
+ return __update_path(line_shape, true, true, xs, ys, xe, ye);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_rectangle(
+ vg_lite_path_t *rectangle_shape,
+ int path_offset,
+ int x, int y,
+ int width, int height,
+ bool end_path) {
+ bool first_path = (path_offset == 0);
+
+ // Precompute all necessary coordinates
+ int left = x;
+ int right = left + width;
+ int top = y;
+ int bottom = top + height;
+
+ // Initialize the drawing context
+ __init_drawing(rectangle_shape, path_offset);
+
+ // Move to beginning (beginning of top side)
+ (void)__move_to(left, top);
+
+ // Compute top side
+ (void)__line_to(right, top);
+
+ // Compute right side
+ (void)__line_to(right, bottom);
+
+ // Compute bottom side
+ (void)__line_to(left, bottom);
+
+ // Compute left side
+ (void)__line_to(left, top);
+
+ return __update_path(rectangle_shape, first_path, end_path,
+ left, top, right, bottom);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_rounded_rectangle(
+ vg_lite_path_t *rounded_rectangle_shape,
+ int path_offset,
+ int x, int y,
+ int width, int height,
+ int arc_width, int arc_height,
+ bool end_path) {
+ bool first_path = (path_offset == 0);
+
+ // Convert diameter to radius
+ int radius_width = (arc_width <= 0) ? 0 : (arc_width / 2);
+ int radius_height = (arc_height <= 0) ? 0 : (arc_height / 2);
+
+ // Precompute all necessary coordinates
+ int left = x;
+ int right = left + width;
+ int top = y;
+ int bottom = top + height;
+ int left_radius = left + radius_width;
+ int right_radius = right - radius_width;
+ int top_radius = top + radius_height;
+ int bottom_radius = bottom - radius_height;
+
+ // Initialize the drawing context
+ __init_drawing(rounded_rectangle_shape, path_offset);
+
+ // Move to beginning (beginning of top side)
+ (void)__move_to(left_radius, top);
+
+ // Compute top side
+ (void)__line_to(right_radius, top);
+
+ // Compute top right corner
+ __set_quarter_curve_tangent_axis(__horizontal);
+ (void)__quarter_curve_to(right, top_radius);
+
+ // Compute right side
+ (void)__line_to(right, bottom_radius);
+
+ // Compute bottom right corner
+ (void)__quarter_curve_to(right_radius, bottom);
+
+ // Compute bottom side
+ (void)__line_to(left_radius, bottom);
+
+ // Compute bottom left corner
+ (void)__quarter_curve_to(left, bottom_radius);
+
+ // Compute left side
+ (void)__line_to(left, top_radius);
+
+ // Compute top left corner
+ (void)__quarter_curve_to(left_radius, top);
+
+ return __update_path(rounded_rectangle_shape, first_path, end_path,
+ left, top, right, bottom);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_ellipse_arc(
+ vg_lite_path_t *ellipse_arc,
+ int radius_out_w,
+ int radius_out_h,
+ int radius_in_w,
+ int radius_in_h,
+ float32_t start_angle_degree,
+ float32_t arc_angle_degree,
+ bool fill) {
+ float32_t start_angle;
+ float32_t end_angle;
+ float32_t arc_angle;
+
+ arc_angle = MEJ_DEG2RAD(arc_angle_degree);
+
+ start_angle = MEJ_DEG2RAD(start_angle_degree);
+ end_angle = start_angle + arc_angle;
+
+ // Initialize the drawing context
+ __init_drawing(ellipse_arc, 0);
+
+ // Move to start
+ __set_center(0, 0);
+ __ctxt.x = (int) (radius_out_w * arm_sin_f32(start_angle));
+ __ctxt.y = (int) (-radius_out_h * arm_cos_f32(start_angle));
+
+ (void)__move_to(__ctxt.x, __ctxt.y);
+
+ // Draw outer ellipse
+ (void)__approximate_ellipse_arc_to(radius_out_w, radius_out_h, start_angle, end_angle);
+
+ if (fill == false) {
+ // Line to inner ellipse start
+ (void)__line_to(
+ (int) (__ctxt.center_x + (__ctxt.sin * radius_in_w)),
+ (int) (__ctxt.center_y - (__ctxt.cos * radius_in_h)));
+
+ // Draw inner ellipse
+ (void)__approximate_ellipse_arc_to(radius_in_w, radius_in_h, end_angle, start_angle);
+ } else {
+ (void)__line_to(0, 0);
+ }
+
+ (void)__end();
+
+ return __update_path(ellipse_arc, true, true,
+ -radius_out_w, -radius_out_h, radius_out_w, radius_out_h);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_ellipse(
+ vg_lite_path_t *ellipse_shape,
+ int path_offset,
+ int radius_w,
+ int radius_h,
+ bool end_path) {
+ bool first_path = (path_offset == 0);
+
+ // Initialize the drawing context
+ __init_drawing(ellipse_shape, path_offset);
+
+ // Move to top
+ (void)__move_to(0, -radius_h);
+
+ (void)__multiple_quarter_curve_to(radius_w, radius_h, 0, 4);
+
+ return __update_path(ellipse_shape, first_path, end_path,
+ -radius_w, -radius_h, radius_w, radius_h);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_filled_ellipse(
+ vg_lite_path_t *point_shape,
+ int radius_w,
+ int radius_h,
+ vg_lite_matrix_t *matrix) {
+
+ // cppcheck-suppress [misra-c2012-11.8] cast to (void *) is valid
+ point_shape->path = (void *) __circle_s16;
+ vg_lite_float_t scale_w = (float32_t) radius_w / CIRCLE_RADIUS;
+ vg_lite_float_t scale_h = (float32_t) radius_h / CIRCLE_RADIUS;
+
+ vg_lite_scale(scale_w, scale_h, matrix);
+
+ point_shape->path_length = sizeof(__circle_s16);
+
+ return __update_path(point_shape, true, false,
+ -CIRCLE_RADIUS,
+ -CIRCLE_RADIUS,
+ +CIRCLE_RADIUS,
+ +CIRCLE_RADIUS);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_thick_shape_line(
+ vg_lite_path_t *thick_line_shape,
+ int x,
+ int y,
+ int thickness,
+ int caps,
+ vg_lite_matrix_t *matrix) {
+ int length;
+ int top;
+ int bottom;
+ int cap;
+
+ // Compute the length of the line: sqrt(dx^2 + dy^2)
+ length = (int) (mej_sqrt_f32((x*x) + (y*y)) + DRAWING_SCALE_FACTOR);
+
+ // Compute line angle with x axis
+ vg_lite_translate(1, 1, matrix);
+ vg_lite_rotate(MEJ_RAD2DEG(atan2(y, x)), matrix);
+ vg_lite_translate(-1, -1, matrix);
+
+ int half_thickness = thickness / 2;
+ top = -half_thickness + 1;
+ bottom = half_thickness + 1;
+
+ // Initialize the drawing context
+ __init_drawing(thick_line_shape, 0);
+
+ // Move to top
+ (void)__move_to(0, top);
+
+ // Line to upper end side
+ (void)__line_to(length, top);
+
+ cap = MEJ_VGLITE_PATH_GET_CAPS_END(caps);
+ switch(cap) {
+ case DRAWING_ENDOFLINE_ROUNDED:{
+ // Cubics for end cap
+ __set_quarter_curve_tangent_axis(__horizontal);
+ (void)__quarter_curve_to(length + half_thickness, 0);
+ (void)__quarter_curve_to(length, bottom);
+ break;
+ }
+ case DRAWING_ENDOFLINE_NONE:
+ case DRAWING_ENDOFLINE_PERPENDICULAR:{
+ // Compute line cap
+ (void)__line_to(length, bottom);
+ break;
+ }
+ default:
+ UI_VGLITE_IMPL_error(false, "Unknown cap: %d", cap);
+ break;
+ }
+
+ // Line to bottom origin
+ (void)__line_to(0, bottom);
+
+ // Cubics for start cap
+ cap = MEJ_VGLITE_PATH_GET_CAPS_START(caps);
+ switch(cap) {
+ case DRAWING_ENDOFLINE_ROUNDED:{
+ // Cubics for end cap
+ __set_quarter_curve_tangent_axis(__horizontal);
+ (void)__quarter_curve_to(-half_thickness, 0);
+ (void)__quarter_curve_to(0, top);
+ break;
+ }
+ case DRAWING_ENDOFLINE_NONE:
+ case DRAWING_ENDOFLINE_PERPENDICULAR:{
+ // Compute line cap
+ (void)__line_to(0, top);
+ break;
+ }
+ default:
+ UI_VGLITE_IMPL_error(false, "Unknown cap: %d", cap);
+ break;
+ }
+
+ return __update_path(thick_line_shape, true, true,
+ -half_thickness, top, length + half_thickness, bottom);
+}
+
+// See the header file for the function documentation
+int UI_DRAWING_VGLITE_PATH_compute_thick_shape_ellipse_arc(
+ vg_lite_path_t *thick_ellipse_arc_shape,
+ int diameter_w,
+ int diameter_h,
+ int thickness,
+ float32_t start_angle_deg,
+ float32_t arc_angle_deg,
+ int caps) {
+ int path_length;
+
+ float32_t l_arc_angle_deg = arc_angle_deg;
+ float32_t l_start_angle_deg = start_angle_deg;
+ int l_caps = caps;
+
+ if (l_arc_angle_deg < 0) {
+ // invert start angle and end angle
+ l_start_angle_deg += l_arc_angle_deg;
+ l_arc_angle_deg = -l_arc_angle_deg;
+ int cap1 = MEJ_VGLITE_PATH_GET_CAPS_START(l_caps);
+ int cap2 = MEJ_VGLITE_PATH_GET_CAPS_END(l_caps);
+ l_caps = 0;
+ l_caps |= MEJ_VGLITE_PATH_SET_CAPS_START(cap2);
+ l_caps |= MEJ_VGLITE_PATH_SET_CAPS_END(cap1);
+ }
+
+ if (l_arc_angle_deg > 360) {
+ l_arc_angle_deg = 360;
+ }
+ l_start_angle_deg = __normalize_angle(l_start_angle_deg);
+
+ float32_t start_angle_rad = MEJ_DEG2RAD(l_start_angle_deg);
+ float32_t arc_angle_rad = MEJ_DEG2RAD(l_arc_angle_deg);
+
+ int radius_out_w = (diameter_w + thickness)/2;
+ int radius_out_h = (diameter_h + thickness)/2;
+ int radius_in_w = ((diameter_w - thickness)/2) - 1;
+ int radius_in_h = ((diameter_h - thickness)/2) - 1;
+
+ // Initialize the drawing context
+ __init_drawing(thick_ellipse_arc_shape, 0);
+
+ path_length = __approximate_ellipse_arc(
+ radius_out_w,
+ radius_out_h,
+ radius_in_w,
+ radius_in_h,
+ start_angle_rad,
+ arc_angle_rad,
+ l_caps);
+
+ thick_ellipse_arc_shape->path_length = path_length;
+
+ return __update_path(thick_ellipse_arc_shape, true, true,
+ -radius_out_w,
+ -radius_out_h,
+ +radius_out_w,
+ +radius_out_h);
+}
+
+// -----------------------------------------------------------------------------
+// Internal functions
+// -----------------------------------------------------------------------------
+
+// See the section 'Internal function definitions' for the function documentation
+static void __init_drawing(vg_lite_path_t *path, int offset) {
+ __ctxt.path = path->path;
+ __ctxt.offset = offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __move_to(int16_t x, int16_t y) {
+ uint8_t *path = __ctxt.path;
+
+ // cppcheck-suppress [misra-c2012-11.3] cast to (path_move_to_s16_t *) is valid
+ path_move_to_s16_t *move_to = (path_move_to_s16_t *) &path[__ctxt.offset];
+
+ move_to->cmd = VGLITE_MOVE_CMD;
+ move_to->x = x;
+ move_to->y = y;
+
+ __ctxt.x = x;
+ __ctxt.y = y;
+ __ctxt.offset += (int)MEJ_VGLITE_PATH_MOVE_TO_LENGTH(s16_t);
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __line_to(int16_t x, int16_t y) {
+ // cppcheck-suppress [misra-c2012-11.3] cast to (path_line_to_s16_t *) is valid
+ path_line_to_s16_t *line_to = (path_line_to_s16_t *) &__ctxt.path[__ctxt.offset];
+
+ line_to->cmd = VGLITE_LINE_CMD;
+ line_to->x = x;
+ line_to->y = y;
+
+ __ctxt.x = x;
+ __ctxt.y = y;
+ __ctxt.offset += (int)MEJ_VGLITE_PATH_LINE_TO_LENGTH(s16_t);
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __quarter_curve_to(int x, int y) {
+ int radius_h = x - __ctxt.x;
+ int radius_v = y - __ctxt.y;
+ int control_h = (int) (QUARTER_TAN * radius_h);
+ int control_v = (int) (QUARTER_TAN * radius_v);
+ int c1_x;
+ int c1_y;
+ int c2_x;
+ int c2_y;
+
+ if (__horizontal == __ctxt.tangent_axis) {
+ c1_x = __ctxt.x + control_h;
+ c1_y = __ctxt.y;
+
+ c2_x = x;
+ c2_y = y - control_v;
+
+ __ctxt.tangent_axis = __vertical;
+ } else {
+ c1_x = __ctxt.x;
+ c1_y = __ctxt.y + control_v;
+
+ c2_x = x - control_h;
+ c2_y = y;
+
+ __ctxt.tangent_axis = __horizontal;
+ }
+
+ // Start tangeant to horizontal
+ (void)__cubic_to(c1_x, c1_y, c2_x, c2_y, x, y);
+
+ __ctxt.x = x;
+ __ctxt.y = y;
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __multiple_quarter_curve_to(
+ int radius_w,
+ int radius_h,
+ int start,
+ int number) {
+ int data_idx;
+
+ data_idx = start;
+ int l_number = number;
+ int l_radius_w = radius_w;
+ int l_radius_h = radius_h;
+
+ if (l_number < 0) {
+ l_number = -l_number;
+
+ if (1 == (data_idx & 1)) {
+ l_radius_h = -l_radius_h;
+ } else {
+ l_radius_w = -l_radius_w;
+ }
+ }
+
+ if (1 == (data_idx & 1)) {
+ __set_quarter_curve_tangent_axis(__vertical);
+ } else {
+ __set_quarter_curve_tangent_axis(__horizontal);
+ }
+
+ // Compute center
+ __ctxt.center_x = __ctxt.x - (l_radius_w * __quarter_curve_data[data_idx & (4 - 1)].x);
+ __ctxt.center_y = __ctxt.y + (l_radius_h * __quarter_curve_data[data_idx & (4 - 1)].y);
+
+ while (0 != l_number) {
+ data_idx = (data_idx + 1) & (4 - 1);
+
+ int next_x = __ctxt.center_x + (l_radius_w * __quarter_curve_data[data_idx & (4 - 1)].x);
+ int next_y = __ctxt.center_y - (l_radius_h * __quarter_curve_data[data_idx & (4 - 1)].y);
+
+ (void)__quarter_curve_to(next_x, next_y);
+ --l_number;
+ }
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __approximate_ellipse_arc(
+ int radius_out_w,
+ int radius_out_h,
+ int radius_in_w,
+ int radius_in_h,
+ float32_t start_angle_rad,
+ float32_t arc_angle_rad,
+ int caps) {
+
+ // Number of sections per curve.
+ // CircleArc approximation from Bezier curves is acceptable if the arc angle is less than 90 degrees.
+ // If the caller require and arc angle bigger than 90 degrees,
+ // the curve should be splited in sections of less than 90 degrees.
+ int nb_sections = (int) ceil(arc_angle_rad / (PI / 2));
+
+ // angle of one section
+ float32_t section_angle = arc_angle_rad / nb_sections;
+
+ float32_t cos_start_angle = arm_cos_f32(start_angle_rad);
+ float32_t sin_start_angle = arm_sin_f32(start_angle_rad);
+ float32_t cos_end_angle = arm_cos_f32(start_angle_rad + arc_angle_rad);
+ float32_t sin_end_angle = arm_sin_f32(start_angle_rad + arc_angle_rad);
+
+ float32_t tangent = 4 * mej_tan_f32(section_angle/4) / 3;
+
+ // Compute outside start point
+ int16_t out_start_x = (int16_t) (+radius_out_w * cos_start_angle);
+ int16_t out_start_y = (int16_t) (-radius_out_h * sin_start_angle);
+
+ // Compute inside start point
+ int16_t in_start_x = (int16_t) (+radius_in_w * cos_start_angle);
+ int16_t in_start_y = (int16_t) (-radius_in_h * sin_start_angle);
+
+ // Compute outside end point
+ int16_t out_end_x = (int16_t) (+radius_out_w * cos_end_angle);
+ int16_t out_end_y = (int16_t) (-radius_out_h * sin_end_angle);
+
+ // Compute inside end point
+ int16_t in_end_x = (int16_t) (+radius_in_w * cos_end_angle);
+ int16_t in_end_y = (int16_t) (-radius_in_h * sin_end_angle);
+
+ // Move to beginning
+ (void)__move_to(out_start_x, out_start_y);
+
+ // Compute first (going) curve
+ for (int i = 0; i < nb_sections; i++) {
+ float32_t section_start_angle = start_angle_rad + (i * section_angle);
+ float32_t section_end_angle = start_angle_rad + (i+1) * section_angle;
+ (void)__approximate_ellipse_arc_fragment(
+ 0, 0,
+ radius_out_w, radius_out_h,
+ section_start_angle, section_end_angle, tangent, 0);
+ }
+
+ // Compute end cap
+ int cap = MEJ_VGLITE_PATH_GET_CAPS_END(caps);
+ switch(cap) {
+ case DRAWING_ENDOFLINE_ROUNDED:{
+ // Compute rounded cap
+ float32_t cap_start_angle = start_angle_rad + arc_angle_rad;
+ float32_t cap_end_angle = start_angle_rad + arc_angle_rad + PI;
+ uint16_t cap_x = (in_end_x + out_end_x) / 2;
+ uint16_t cap_y = (in_end_y + out_end_y) / 2;
+ // FIXME radius should depend on position of start/end points
+ int cap_radius = (radius_out_w - radius_in_w) / 2;
+ (void)__approximate_ellipse_arc_fragment(
+ cap_x, cap_y,
+ (uint16_t)cap_radius, (uint16_t)cap_radius,
+ cap_start_angle, cap_end_angle, CAP_TAN, 0);
+ break;
+ }
+ case DRAWING_ENDOFLINE_NONE:
+ case DRAWING_ENDOFLINE_PERPENDICULAR:{
+ // Compute line cap
+ (void)__line_to(in_end_x, in_end_y);
+ break;
+ }
+ default:
+ UI_VGLITE_IMPL_error(false, "Unknown cap: %d", cap);
+ break;
+ }
+
+ // Compute second (return) curve
+ for (int i = 0; i < nb_sections; i++) {
+ float32_t section_start_angle = start_angle_rad + (nb_sections-1-i) * section_angle;
+ float32_t section_end_angle = start_angle_rad + (nb_sections-i) * section_angle;
+ (void)__approximate_ellipse_arc_fragment(
+ 0, 0, radius_in_w, radius_in_h,
+ section_start_angle, section_end_angle, tangent, 1);
+ }
+
+ // Compute start cap
+ cap = MEJ_VGLITE_PATH_GET_CAPS_START(caps);
+ switch(cap) {
+ case DRAWING_ENDOFLINE_ROUNDED:{
+ // Compute rounded cap
+ float32_t cap_start_angle = start_angle_rad + PI;
+ float32_t cap_end_angle = start_angle_rad;
+ uint16_t cap_x = (in_start_x + out_start_x) / 2;
+ uint16_t cap_y = (in_start_y + out_start_y) / 2;
+ // FIXME radius should depend on position of start/end points
+ int cap_radius = (radius_out_w - radius_in_w) / 2;
+ (void)__approximate_ellipse_arc_fragment(
+ cap_x, cap_y,
+ (uint16_t)cap_radius, (uint16_t)cap_radius,
+ cap_start_angle, cap_end_angle, CAP_TAN, 0);
+ break;
+ }
+ case DRAWING_ENDOFLINE_NONE:
+ case DRAWING_ENDOFLINE_PERPENDICULAR:
+ // Compute line cap
+ (void)__line_to(out_start_x, out_start_y);
+ break;
+ default:
+ UI_VGLITE_IMPL_error(false, "Unknown cap: %d", cap);
+ break;
+ }
+
+ // End path
+ return __end();
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __approximate_ellipse_arc_to(
+ int radius_w,
+ int radius_h,
+ float32_t start_angle,
+ float32_t end_angle) {
+ float32_t start_angle_temp;
+ float32_t end_angle_temp;
+ float32_t arc_angle;
+ float32_t arc_angle_temp;
+ float32_t arc_angle_abs;
+
+ arc_angle = end_angle - start_angle;
+
+ start_angle_temp = start_angle;
+
+ arc_angle_abs = MEJ_ABS(arc_angle);
+
+ while (arc_angle_abs > 0) {
+ arc_angle_temp = end_angle - start_angle_temp;
+ arc_angle_temp = MEJ_BOUNDS(arc_angle_temp, -(PI/2), +(PI/2));
+ end_angle_temp = start_angle_temp + arc_angle_temp;
+
+ (void)__approximate_ellipse_arc_fragment_to(
+ radius_w, radius_h,
+ start_angle_temp,
+ end_angle_temp);
+
+ start_angle_temp += arc_angle_temp;
+
+ arc_angle_abs -= PI/2;
+ }
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __approximate_ellipse_arc_fragment_to(
+ int radius_w,
+ int radius_h,
+ float32_t start_angle,
+ float32_t end_angle) {
+ // End point angle
+ float32_t section_angle;
+ float32_t temp_x;
+ float32_t temp_y;
+
+ // End point coordinates
+ int end_x;
+ int end_y;
+
+ // Control point 1 coordinates
+ int c1_x;
+ int c1_y;
+
+ // Control point 2 coordinates
+ int c2_x;
+ int c2_y;
+
+ section_angle = end_angle - start_angle;
+
+ // Compute start point
+ __compute_control_point(
+ &temp_x, &temp_y,
+ start_angle,
+ section_angle);
+
+ c1_x = __ctxt.x + (int) (temp_x * radius_w);
+ c1_y = __ctxt.y + (int) (temp_y * radius_h);
+
+ // Compute end point
+ __ctxt.sin = arm_sin_f32(end_angle);
+ __ctxt.cos = arm_cos_f32(end_angle);
+
+ end_x = (int) (__ctxt.center_x + (radius_w * __ctxt.sin));
+ end_y = (int) (__ctxt.center_y + (radius_h * -__ctxt.cos));
+
+ __compute_control_point(
+ &temp_x, &temp_y,
+ end_angle,
+ -section_angle);
+
+ c2_x = end_x + (int) (temp_x * radius_w);
+ c2_y = end_y + (int) (temp_y * radius_h);
+
+ return __cubic_to(c1_x, c1_y, c2_x, c2_y, end_x, end_y);
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static int __approximate_ellipse_arc_fragment(
+ uint16_t center_x, uint16_t center_y,
+ int radius_w, int radius_h,
+ float32_t start_angle_rad,
+ float32_t end_angle_rad,
+ float32_t tangent,
+ int revert) {
+ float32_t tx;
+ float32_t ty;
+
+ // Compute start point A1 & A2
+ int16_t Ax = (int16_t) (radius_w * arm_cos_f32(start_angle_rad));
+ int16_t Ay = (int16_t) (radius_h * -arm_sin_f32(start_angle_rad)); // minus because y axis is inverted (0,0 is top left)
+
+ // Compute end point B1 & B2
+ int16_t Bx = (int16_t) (radius_w * arm_cos_f32(end_angle_rad));
+ int16_t By = (int16_t) (radius_h * -arm_sin_f32(end_angle_rad));
+
+ // Compute control point C
+ tx = tangent * arm_cos_f32(start_angle_rad + (PI/2));
+ ty = tangent * -arm_sin_f32(start_angle_rad + (PI/2));
+
+ int16_t Cx = (int16_t) (Ax + (radius_w * tx));
+ int16_t Cy = (int16_t) (Ay + (radius_h * ty));
+
+ // Compute control point D
+ tx = tangent * arm_cos_f32(end_angle_rad - (PI/2));
+ ty = tangent * -arm_sin_f32(end_angle_rad - (PI/2));
+
+ int16_t Dx = (int16_t) (Bx + (radius_w * tx));
+ int16_t Dy = (int16_t) (By + (radius_h * ty));
+
+ Ax += (int16_t)center_x;
+ Ay += (int16_t)center_y;
+ Bx += (int16_t)center_x;
+ By += (int16_t)center_y;
+ Cx += (int16_t)center_x;
+ Cy += (int16_t)center_y;
+ Dx += (int16_t)center_x;
+ Dy += (int16_t)center_y;
+
+ // Compute path
+ return (revert == 0) ?
+ __cubic_to(Cx, Cy, Dx, Dy, Bx, By) :
+ __cubic_to(Dx, Dy, Cx, Cy, Ax, Ay);
+}
+
+// See the section 'Internal function definitions' for the function documentation
+int __cubic_to(
+ int16_t cx1,
+ int16_t cy1,
+ int16_t cx2,
+ int16_t cy2,
+ int16_t x,
+ int16_t y) {
+ // cppcheck-suppress [misra-c2012-11.3] cast to (path_cubic_to_s16_t *) is valid
+ path_cubic_to_s16_t *cubic_to = (path_cubic_to_s16_t *) &__ctxt.path[__ctxt.offset];
+
+ cubic_to->cmd = VGLITE_CUBIC_CMD;
+ cubic_to->cx1 = cx1; // control point 1
+ cubic_to->cy1 = cy1; // control point 1
+ cubic_to->cx2 = cx2; // control point 2
+ cubic_to->cy2 = cy2; // control point 2
+ cubic_to->x = x; // curve end
+ cubic_to->y = y; // curve end
+
+ __ctxt.x = x;
+ __ctxt.y = y;
+ __ctxt.offset += (int)MEJ_VGLITE_PATH_CUBIC_TO_LENGTH(s16_t);
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+int __end(void) {
+ // cppcheck-suppress [misra-c2012-11.3] cast to (path_end_s16_t *) is valid
+ path_end_s16_t *end = (path_end_s16_t *) &__ctxt.path[__ctxt.offset];
+ end->cmd = VGLITE_END_CMD;
+
+ __ctxt.offset += (int)MEJ_VGLITE_PATH_END_LENGTH(s16_t);
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+int __update_path(vg_lite_path_t *path,
+ bool first_path,
+ bool last_path,
+ int left,
+ int top,
+ int right,
+ int bottom) {
+
+ if (first_path) {
+ // use VGLite API to reset the path
+ int32_t path_length = path->path_length;
+ void *path_data = path->path;
+ vg_lite_init_path(
+ path,
+ VG_LITE_S16,
+ VG_LITE_HIGH,
+ path_length,
+ path_data,
+ left,
+ top,
+ right,
+ bottom
+ );
+ path->path_type = VG_LITE_DRAW_FILL_PATH;
+ }
+ else {
+ // not first path and maybe not the last one
+ path->bounding_box[0] = (int) MEJ_MIN(path->bounding_box[0], left);
+ path->bounding_box[1] = (int) MEJ_MIN(path->bounding_box[1], top);
+ path->bounding_box[2] = (int) MEJ_MAX(path->bounding_box[2], right);
+ path->bounding_box[3] = (int) MEJ_MAX(path->bounding_box[3], bottom);
+ }
+
+ if (last_path) {
+ (void)__end();
+ path->path_length = __ctxt.offset;
+ }
+
+ return __ctxt.offset;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static float32_t __normalize_angle(float32_t angle) {
+ float32_t l_angle = fmod(angle, 360);
+ return (l_angle >= 0) ? l_angle : (l_angle + 360);
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_drawing_vglite_process.c b/bsp/projects/microej/ui/src/ui_drawing_vglite_process.c
new file mode 100644
index 0000000..c828af2
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_drawing_vglite_process.c
@@ -0,0 +1,1563 @@
+/*
+ * C
+ *
+ * Copyright 2019-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation of ui_drawing_vglite_process.h.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing_vglite_process.h"
+#include "ui_drawing_vglite_path.h"
+
+// -----------------------------------------------------------------------------
+// Types
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Variable to store the vglite pathes during the GPU computation.
+ *
+ * MicroUI design must ensure that only one computation is done at a time.
+ */
+static union {
+ vglite_path_line_t line; // line
+ vglite_path_thick_shape_line_t thick_shape_line; // thick shape line
+ vglite_path_ellipse_t ellipse[2]; // ellipse (in & out)
+ vglite_path_ellipse_arc_t ellipse_arc; // ellipse arc
+ vglite_path_rounded_rectangle_t rounded_rectangle[2]; // round rect (in & out)
+ vglite_path_thick_ellipse_arc_t thick_ellipse_arc; // anti aliased ellipse arc
+} __shape_paths;
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Unique path used to render the shape (there is only one shape to render at any time).
+ */
+static vg_lite_path_t shape_vg_path;
+
+/*
+ * @brief Variable to target a vglite source buffer (there is only one source at any time)
+ */
+static vg_lite_buffer_t source_buffer;
+
+// -----------------------------------------------------------------------------
+// Internal function definitions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Draws an ellipse arc covering the square specified by its diameter.
+ * See DRAWING_impl.h for more information
+ *
+ * @param[in] gc: the MicroUI GraphicsContext target.
+ * @param[in] x: the x coordinate of the upper-left corner of the square where the ellipse arc is drawn
+ * @param[in] y: the y coordinate of the upper-left corner of the square where the ellipse arc is drawn
+ * @param[in] diameter_w: the horizontal diameter of the ellipse arc to draw
+ * @param[in] diameter_h: the vertical diameter of the ellipse arc to draw
+ * @param[in] start_angle_deg: the beginning angle of the arc to draw
+ * @param[in] arc_angle_deg: the angular extent of the arc from start_angle_deg
+ * @param[in] fill: the flag indicating if the ellipse arc will be filled
+ * - true: the ellipse arc will be filled
+ * - false: the ellipse arc will not be filled
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __draw_ellipse_arc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int x,
+ int y,
+ int diameter_w,
+ int diameter_h,
+ float start_angle,
+ float arc_angle,
+ bool fill);
+
+/*
+ * @brief Draws a ellipse covering the square specified by its diameter.
+ * See DRAWING_impl.h for more information
+ *
+ * @param[in] gc: the MicroUI GraphicsContext target.
+ * @param[in] x: the x coordinate of the upper-left corner of the square where the ellipse is drawn
+ * @param[in] y: the y coordinate of the upper-left corner of the square where the ellipse is drawn
+ * @param[in] diameter_out_w: the horizontal outer diameter of the ellipse to draw
+ * @param[in] diameter_out_h: the vertical outer diameter of the ellipse to draw
+ * @param[in] diameter_in_w: the horizontal inner diameter of the ellipse to draw
+ * @param[in] diameter_in_h: the vertical inner diameter of the ellipse to draw
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __draw_ellipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ float x,
+ float y,
+ int diameter_out_w,
+ int diameter_out_h,
+ int diameter_in_w,
+ int diameter_in_h);
+
+/*
+ * @brief Fills a ellipse covering the square specified by its diameter.
+ * See DRAWING_impl.h for more information
+ *
+ * @param[in] gc: the MicroUI GraphicsContext target.
+ * @param[in] x: the x coordinate of the upper-left corner of the square where the ellipse is drawn
+ * @param[in] y: the y coordinate of the upper-left corner of the square where the ellipse is drawn
+ * @param[in] diameter_w: the horizontal diameter of the ellipse to draw
+ * @param[in] diameter_h: the vertical diameter of the ellipse to draw
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __fill_ellipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ float x,
+ float y,
+ int diameter_w,
+ int diameter_h);
+
+/*
+ * @brief Draws a line between two points
+ * See DRAWING_impl.h for more information
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] xs: the horizontal coordinate of the start of the line
+ * @param[in] ys: the vertical coordinate of start of the line
+ * @param[in] xe: the horizontal coordinate of the end of the line
+ * @param[in] ye: the vertical coordinate of end of the line
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __draw_line(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int xs,
+ int ys,
+ int xe,
+ int ye);
+
+/*
+ * @brief Draws a thick line between two points
+ * See DRAWING_impl.h for more information
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] xs: the horizontal coordinate of the start of the line
+ * @param[in] ys: the vertical coordinate of start of the line
+ * @param[in] xe: the horizontal coordinate of the end of the line
+ * @param[in] ye: the vertical coordinate of end of the line
+ * @param[in] thickness: the line thickness.
+ * @param[in] start cap representation of start of the line
+ * @param[in] end cap representation of end of the line
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __thick_line(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int xs,
+ int ys,
+ int xe,
+ int ye,
+ int thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end);
+
+/*
+ * @brief Draws a thick arc covering the square specified by its diameter.
+ * See dw_drawing.h for more information
+ *
+ * @param[in] gc: the MicroUI GraphicsContext target.
+ * @param[in] x: the x coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] y: the y coordinate of the upper-left corner of the square where the arc is drawn
+ * @param[in] diameter_w: the horizontal diameter of the ellipse arc to draw
+ * @param[in] diameter_h: the vertical diameter of the ellipse arc to draw
+ * @param[in] start_angle_deg: the beginning angle of the arc to draw
+ * @param[in] arc_angle_deg: the angular extent of the arc from start_angle_deg
+ * @param[in] thickness: the arc thickness.
+ * @param[in] start: cap representation of start of shape
+ * @param[in] end: cap representation of end of shape
+ *
+ * @return the drawing status.
+ */
+static DRAWING_Status __draw_thick_shape_ellipse_arc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int x,
+ int y,
+ int diameter_w,
+ int diameter_h,
+ float start_angle_deg,
+ float arc_angle,
+ int thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end);
+
+/*
+ * @brief Rotates an image using the GPU
+ *
+ * @param[in] gc: Graphics context where to draw
+ * @param[in] img: Source image to draw
+ * @param[in] src: Source buffer
+ * @param[in] x: Horizontal coordinate of the image reference anchor top-left point.
+ * @param[in] y: Vertical coordinate of the image reference anchor top-left point.
+ * @param[in] xRotation: Horizontal coordinate of the rotation center
+ * @param[in] yRotation: Vertical coordinate of the rotation center
+ * @param[in] angle: Angle that must be used to rotate the image
+ * @param[in] alpha: The opacity level to apply while drawing the rotated image
+ * @param[in] filter: Quality of drawing.
+ *
+ * @return The drawing status.
+ */
+static DRAWING_Status __rotate_image(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ vg_lite_buffer_t* src,
+ int x,
+ int y,
+ int xRotation,
+ int yRotation,
+ float angle_deg,
+ int alpha,
+ vg_lite_filter_t filter);
+
+/*
+ * @brief Scales an image using the GPU
+ *
+ * @param[in] gc: Graphics context where to draw.
+ * @param[in] img: Source image to draw.
+ * @param[in] src: Source buffer
+ * @param[in] x: Horizontal coordinate of the image reference anchor top-left point.
+ * @param[in] y: Vertical coordinate of the image reference anchor top-left point.
+ * @param[in] factorX: Horizontal scaling factor.
+ * @param[in] yRotation: Vertical scaling factor.
+ * @param[in] alpha: The opacity level to apply while drawing the image
+ * @param[in] filter: Quality of drawing.
+ *
+ * @return The drawing status.
+ */
+static DRAWING_Status __scale_image(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ vg_lite_buffer_t* src,
+ int x,
+ int y,
+ float factorX,
+ float factorY,
+ int alpha,
+ vg_lite_filter_t filter);
+
+// -----------------------------------------------------------------------------
+// Public functions
+// -----------------------------------------------------------------------------
+
+// See the section 'Internal function definitions' for the function documentation
+vg_lite_buffer_t* UI_DRAWING_VGLITE_PROCESS_prepare_draw_image(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x_src, jint y_src, jint width, jint height, jint x_dest, jint y_dest, jint alpha, vg_lite_color_t* color, vg_lite_matrix_t* matrix, uint32_t* blit_rect){
+
+ vg_lite_buffer_t* ret;
+
+ if(UI_VGLITE_configure_source(&source_buffer, img) && UI_VGLITE_enable_vg_lite_scissor_region(gc, x_dest, y_dest, x_dest + width - 1, y_dest + height - 1)) {
+
+ *color = UI_VGLITE_get_vglite_color(gc, img, alpha);
+
+ vg_lite_identity(matrix);
+ matrix->m[0][2] = x_dest;
+ matrix->m[1][2] = y_dest;
+
+ blit_rect[0] = x_src;
+ blit_rect[1] = y_src;
+ blit_rect[2] = width;
+ blit_rect[3] = height;
+
+ ret = &source_buffer;
+ }
+ else{
+ ret = NULL;
+ }
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawLine(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x1, jint y1,
+ jint x2, jint y2) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ // TODO try to crop region (x1 may lower than x2 and y1 may be lower than y2)
+ if (UI_VGLITE_enable_vg_lite_scissor_region(
+ gc,
+ 0, 0,
+ gc->image.width, gc->image.height)) {
+ ret = __draw_line(drawer, gc, x1, y1, x2, y2);
+ }
+ else {
+ // nothing to draw
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawHorizontalLine(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x1, jint x2, jint y) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x1, y, x2, y)) {
+ ret = __draw_line(drawer, gc, x1, y, x2, y);
+ }
+ else {
+ // nothing to draw
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawVerticalLine(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y1, jint y2) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x, y1, x, y2)) {
+ ret = __draw_line(drawer, gc, x, y1, x, y2);
+ }
+ else {
+ // nothing to draw
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillRectangle(
+ UI_DRAWING_VGLITE_PROCESS_clear_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x1, jint y1, jint x2, jint y2) {
+
+ DRAWING_Status ret = DRAWING_DONE;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x1, y1, x2, y2)) {
+
+ vg_lite_rectangle_t shape_vg_rectangle;
+ shape_vg_rectangle.x = x1;
+ shape_vg_rectangle.y = y1;
+ shape_vg_rectangle.width = (x2-x1+1);
+ shape_vg_rectangle.height = (y2-y1+1);
+
+ ret = (*drawer)(gc, &shape_vg_rectangle, gc->foreground_color);
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRoundedRectangle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height,
+ jint arc_width, jint arc_height) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x, y, x + width, y + height)) {
+
+ jint l_arc_width = (arc_width > width) ? width : arc_width;
+ jint l_arc_height = (arc_height > height) ? height : arc_height;
+
+ vg_lite_identity(&matrix);
+ // Compute the rounded rectangle shape path
+ shape_vg_path.path = &__shape_paths.rounded_rectangle[0];
+ shape_vg_path.path_length = sizeof(__shape_paths.rounded_rectangle);
+ int path_offset = 0;
+ path_offset = UI_DRAWING_VGLITE_PATH_compute_rounded_rectangle(
+ &shape_vg_path, path_offset,
+ x, y, width, height, l_arc_width, l_arc_height, false);
+
+ path_offset = UI_DRAWING_VGLITE_PATH_compute_rounded_rectangle(
+ &shape_vg_path, path_offset,
+ x + 1, y + 1,
+ width - 2, height - 2,
+ l_arc_width - 1, l_arc_height - 1,
+ true);
+
+ if (0 > path_offset) {
+ UI_VGLITE_IMPL_error(false, "Error during path computation");
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ ret = DRAWING_DONE;
+ }
+ else {
+ // Draw the point with the GPU
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_EVEN_ODD,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+ }
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillRoundedRectangle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height,
+ jint arc_width, jint arc_height) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x, y, x + width, y + height)) {
+
+ jint l_arc_width = (arc_width > width) ? width : arc_width;
+ jint l_arc_height = (arc_height > height) ? height : arc_height;
+
+ vg_lite_identity(&matrix);
+ // Compute the rounded rectangle shape path
+ shape_vg_path.path = &__shape_paths.rounded_rectangle[0];
+ shape_vg_path.path_length = sizeof(__shape_paths.rounded_rectangle);
+ int path_offset = UI_DRAWING_VGLITE_PATH_compute_rounded_rectangle(&shape_vg_path, 0,
+ x, y, width, height, l_arc_width, l_arc_height, true);
+
+ if (0 > path_offset) {
+ UI_VGLITE_IMPL_error(false, "Error during path computation");
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ ret = DRAWING_DONE;
+ }
+ else {
+ // Draw the point with the GPU
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_EVEN_ODD,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+ }
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawCircle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter) {
+ DRAWING_Status ret;
+
+ ret = __draw_ellipse(
+ drawer,
+ gc,
+ x, y,
+ diameter, diameter,
+ diameter - 2, diameter - 2);
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawCircleArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint diameter,
+ jfloat start_angle,
+ jfloat arc_angle) {
+ DRAWING_Status ret;
+
+ if (MEJ_ABS(arc_angle) >= 360) {
+ ret = UI_DRAWING_VGLITE_PROCESS_drawCircle(drawer, gc, x, y, diameter);
+ }
+ else {
+ ret = __draw_ellipse_arc(
+ drawer,
+ gc,
+ x - 1, y - 1,
+ diameter, diameter,
+ start_angle, arc_angle,
+ false);
+ }
+ return ret;
+}
+
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillEllipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height) {
+ DRAWING_Status ret;
+
+ ret = __fill_ellipse(drawer, gc, x, y, width, height);
+
+ return ret;
+}
+
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawEllipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height) {
+ DRAWING_Status ret;
+
+ ret = __draw_ellipse(drawer, gc, x, y, width, height, width - 2, height - 2);
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillCircle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc, jint x, jint y, jint diameter) {
+ DRAWING_Status ret;
+
+ ret = __fill_ellipse(drawer, gc, x, y, diameter, diameter);
+
+ return ret;
+}
+
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawEllipseArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint width,
+ jint height,
+ jfloat start_angle,
+ jfloat arc_angle) {
+ DRAWING_Status ret;
+
+ if (MEJ_ABS(arc_angle) >= 360) {
+ ret = UI_DRAWING_VGLITE_PROCESS_drawEllipse(drawer, gc, x, y, width, height);
+ }
+ else {
+ ret = __draw_ellipse_arc(
+ drawer,
+ gc,
+ x - 1, y - 1,
+ width, height,
+ start_angle, arc_angle,
+ false);
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillCircleArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint diameter,
+ jfloat start_angle, jfloat arc_angle) {
+ DRAWING_Status ret;
+
+ if (MEJ_ABS(arc_angle) >= 360) {
+ ret = UI_DRAWING_VGLITE_PROCESS_fillCircle(drawer, gc, x, y, diameter);
+ }
+ else {
+ ret = __draw_ellipse_arc(
+ drawer,
+ gc,
+ x, y,
+ diameter, diameter,
+ start_angle, arc_angle,
+ true);
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_fillEllipseArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height,
+ jfloat start_angle, jfloat arc_angle) {
+ DRAWING_Status ret;
+
+ if (MEJ_ABS(arc_angle) >= 360) {
+ ret = UI_DRAWING_VGLITE_PROCESS_fillEllipse(
+ drawer,
+ gc,
+ x, y,
+ width, height);
+ }
+ else {
+ ret = __draw_ellipse_arc(
+ drawer,
+ gc,
+ x, y,
+ width, height,
+ start_angle, arc_angle,
+ true);
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedPoint(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint thickness) {
+ float dx = x + 0.5f;
+ float dy = y + 0.5f;
+ float ft = thickness;
+ ft /= 2.f;
+ return __fill_ellipse(drawer, gc, dx - ft, dy - ft, thickness, thickness);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedLine(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x1,
+ jint y1,
+ jint x2,
+ jint y2,
+ jint thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end) {
+ return __thick_line(
+ drawer,
+ gc,
+ x1,
+ y1,
+ x2,
+ y2,
+ thickness,
+ start,
+ end);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint diameter, jint thickness) {
+
+ int diameter_out;
+ int diameter_in;
+
+ diameter_out = diameter + thickness;
+ diameter_in = diameter - thickness;
+ float dx = x;
+ float dy = y;
+ float ft = thickness;
+ ft /= 2.f;
+
+ return __draw_ellipse(
+ drawer,
+ gc,
+ dx - ft, dy - ft,
+ diameter_out, diameter_out,
+ diameter_in, diameter_in);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedCircleArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint diameter,
+ jfloat start_angle_deg,
+ jfloat arc_angle,
+ jint thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end) {
+ return __draw_thick_shape_ellipse_arc(
+ drawer,
+ gc,
+ x, y,
+ diameter, diameter,
+ start_angle_deg, arc_angle,
+ thickness,
+ start, end);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickFadedEllipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height,
+ jint thickness) {
+
+ int diameter_out_w;
+ int diameter_out_h;
+ int diameter_in_w;
+ int diameter_in_h;
+
+ diameter_out_w = width + thickness;
+ diameter_out_h = height + thickness;
+ diameter_in_w = width - thickness;
+ diameter_in_h = height - thickness;
+
+ float dx = x;
+ float dy = y;
+ float ft = thickness;
+ ft /= 2.f;
+
+ return __draw_ellipse(
+ drawer,
+ gc,
+ dx - ft, dy - ft,
+ diameter_out_w, diameter_out_h,
+ diameter_in_w, diameter_in_h);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickLine(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x1,
+ jint y1,
+ jint x2,
+ jint y2,
+ jint thickness) {
+ DRAWING_Status ret;
+
+ ret = __thick_line(
+ drawer,
+ gc,
+ x1,
+ y1,
+ x2,
+ y2,
+ thickness,
+ DRAWING_ENDOFLINE_NONE,
+ DRAWING_ENDOFLINE_NONE);
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickCircle(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint diameter,
+ jint thickness) {
+
+ int diameter_out;
+ int diameter_in;
+ DRAWING_Status ret;
+
+ diameter_out = diameter + thickness;
+ diameter_in = diameter - thickness;
+ float dx = x;
+ float dy = y;
+ float ft = thickness;
+ ft /= 2.f;
+
+ ret = __draw_ellipse(
+ drawer,
+ gc,
+ dx - ft, dy - ft,
+ diameter_out, diameter_out,
+ diameter_in, diameter_in);
+
+ return ret;
+}
+
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickEllipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x, jint y,
+ jint width, jint height,
+ jint thickness) {
+
+ int diameter_out_w;
+ int diameter_out_h;
+ int diameter_in_w;
+ int diameter_in_h;
+ DRAWING_Status ret;
+
+
+ diameter_out_w = width + thickness;
+ diameter_out_h = height + thickness;
+ diameter_in_w = width - thickness;
+ diameter_in_h = height - thickness;
+
+ float dx = x;
+ float dy = y;
+ float ft = thickness;
+ ft /= 2.f;
+
+ ret = __draw_ellipse(
+ drawer,
+ gc,
+ dx - ft, dy - ft,
+ diameter_out_w, diameter_out_h,
+ diameter_in_w, diameter_in_h);
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawThickCircleArc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ jint x,
+ jint y,
+ jint diameter,
+ jfloat start_angle_deg,
+ jfloat arc_angle,
+ jint thickness) {
+ DRAWING_Status ret;
+
+ ret = __draw_thick_shape_ellipse_arc(
+ drawer,
+ gc,
+ x, y,
+ diameter, diameter,
+ start_angle_deg, arc_angle,
+ thickness,
+ DRAWING_ENDOFLINE_NONE,
+ DRAWING_ENDOFLINE_NONE);
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawFlippedImage(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ jint region_x,
+ jint region_y,
+ jint width,
+ jint height,
+ jint x,
+ jint y,
+ DRAWING_Flip transformation,
+ jint alpha, bool* is_gpu_compatible) {
+
+ // the next algorithm does not support another origin than (0,0) but MicroUI never uses this condition
+ assert(0 == region_x);
+ assert(0 == region_y);
+
+ DRAWING_Status ret;
+ *is_gpu_compatible = UI_VGLITE_configure_source(&source_buffer, img);
+
+ if(*is_gpu_compatible) {
+
+ uint32_t dest_width = 0;
+ uint32_t dest_height = 0;
+
+ switch (transformation) {
+ case DRAWING_FLIP_NONE:
+ case DRAWING_FLIP_180:
+ case DRAWING_FLIP_MIRROR:
+ case DRAWING_FLIP_MIRROR_180:
+ dest_width = img->width;
+ dest_height = img->height;
+ break;
+ case DRAWING_FLIP_90:
+ case DRAWING_FLIP_270:
+ case DRAWING_FLIP_MIRROR_90:
+ case DRAWING_FLIP_MIRROR_270:
+ dest_width = img->height;
+ dest_height = img->width;
+ break;
+ default:
+ UI_VGLITE_IMPL_error(false, "Unexpected transformation: %d\n", transformation);
+ break;
+ }
+
+ // Check if there is something to draw and clip drawing limits
+ if ((dest_width > 0) && (dest_height > 0) && UI_VGLITE_enable_vg_lite_scissor_region(
+ gc,
+ x, y,
+ (x + dest_width - 1), (y + dest_height - 1))) {
+
+ // Exclude bottom right region
+ source_buffer.width = width;
+ source_buffer.height = height;
+
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ vg_lite_translate(x + (dest_width / 2), y + (dest_height / 2), &matrix);
+
+ switch (transformation) {
+ default:
+ case DRAWING_FLIP_NONE:
+ // nothing to do
+ break;
+ case DRAWING_FLIP_90:
+ vg_lite_rotate(-90, &matrix);
+ break;
+ case DRAWING_FLIP_180:
+ vg_lite_rotate(-180, &matrix);
+ break;
+ case DRAWING_FLIP_270:
+ vg_lite_rotate(-270, &matrix);
+ break;
+ case DRAWING_FLIP_MIRROR:
+ vg_lite_scale(-1, 1, &matrix);
+ break;
+ case DRAWING_FLIP_MIRROR_90:
+ vg_lite_rotate(90, &matrix);
+ vg_lite_scale(1, -1, &matrix);
+ break;
+ case DRAWING_FLIP_MIRROR_180:
+ vg_lite_rotate(180, &matrix);
+ vg_lite_scale(-1, 1, &matrix);
+ break;
+ case DRAWING_FLIP_MIRROR_270:
+ vg_lite_rotate(270, &matrix);
+ vg_lite_scale(1, -1, &matrix);
+ break;
+ }
+
+ vg_lite_translate(-img->width/2, -img->height/2, &matrix);
+
+ uint32_t blit_rect[4];
+ blit_rect[0] = 0;
+ blit_rect[1] = 0;
+ blit_rect[2] = img->width;
+ blit_rect[3] = img->height;
+
+ ret = (*drawer)(
+ gc,
+ &source_buffer,
+ blit_rect,
+ &matrix, VG_LITE_BLEND_SRC_OVER,
+ UI_VGLITE_get_vglite_color(gc, img, alpha),
+ VG_LITE_FILTER_BI_LINEAR);
+ }
+ else {
+ // no error: the drawing is just "out of clip"
+ ret = DRAWING_DONE;
+ }
+ }
+ else {
+ // no error: the drawing is just "not performed"
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRotatedImageNearestNeighbor(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ jint x,
+ jint y,
+ jint xRotation,
+ jint yRotation,
+ jfloat angle,
+ jint alpha, bool* is_gpu_compatible) {
+ DRAWING_Status ret;
+ *is_gpu_compatible = UI_VGLITE_configure_source(&source_buffer, img);
+
+ if(*is_gpu_compatible) {
+ // The GCNanoLiteV limitation: Same rendering around 90 degrees (89.0, 89.1 ... 90.9, 91)
+ // Render is acceptable since vglite 3.0.4-rev4
+ ret = __rotate_image(drawer, gc, img, &source_buffer, x, y, xRotation, yRotation, angle, alpha, VG_LITE_FILTER_POINT);
+ }
+ else {
+ // no error: the drawing is just "not performed"
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawRotatedImageBilinear(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ jint x,
+ jint y,
+ jint xRotation,
+ jint yRotation,
+ jfloat angle,
+ jint alpha, bool* is_gpu_compatible) {
+ DRAWING_Status ret;
+ *is_gpu_compatible = UI_VGLITE_configure_source(&source_buffer, img);
+
+ if(*is_gpu_compatible) {
+ // The GCNanoLiteV limitation: Same rendering around 90 degrees (89.0, 89.1 ... 90.9, 91)
+ // Render is acceptable since vglite 3.0.4-rev4
+ ret = __rotate_image(drawer, gc, img, &source_buffer, x, y, xRotation, yRotation, angle, alpha, VG_LITE_FILTER_BI_LINEAR);
+ }
+ else {
+ // no error: the drawing is just "not performed"
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawScaledImageNearestNeighbor(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ jint x,
+ jint y,
+ jfloat factorX,
+ jfloat factorY,
+ jint alpha, bool* is_gpu_compatible) {
+ DRAWING_Status ret;
+ *is_gpu_compatible = UI_VGLITE_configure_source(&source_buffer, img);
+
+ if(*is_gpu_compatible) {
+ ret =__scale_image(drawer, gc, img, &source_buffer, x, y, factorX, factorY, alpha, VG_LITE_FILTER_POINT);
+ }
+ else {
+ // no error: the drawing is just "not performed"
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_DRAWING_VGLITE_PROCESS_drawScaledImageBilinear(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ jint x,
+ jint y,
+ jfloat factorX,
+ jfloat factorY,
+ jint alpha, bool* is_gpu_compatible) {
+ DRAWING_Status ret;
+ *is_gpu_compatible = UI_VGLITE_configure_source(&source_buffer, img);
+
+ if(*is_gpu_compatible) {
+ // when the factor is 1x1, the filter "point" draws something closer than draw_image
+ vg_lite_filter_t filter = ((1.0f == factorX) && (1.0f == factorY)) ? VG_LITE_FILTER_POINT : VG_LITE_FILTER_BI_LINEAR;
+ ret = __scale_image(drawer, gc, img, &source_buffer, x, y, factorX, factorY, alpha, filter);
+ }
+ else {
+ // no error: the drawing is just "not performed"
+ ret = DRAWING_DONE;
+ }
+
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// Internal functions
+// -----------------------------------------------------------------------------
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __draw_ellipse_arc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int x,
+ int y,
+ int diameter_w,
+ int diameter_h,
+ float start_angle_deg,
+ float arc_angle_deg,
+ bool fill) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ // +/- 1: consider 1 pixel of antialiasing
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, x - 1, y - 1, x + diameter_w, y + diameter_h)) {
+
+ vg_lite_identity(&matrix);
+
+ float radius_out_w = (float)diameter_w;
+ float radius_out_h = (float)diameter_h;
+ radius_out_w /= 2.f;
+ radius_out_h /= 2.f;
+ float radius_in_w = radius_out_w - 1.f;
+ float radius_in_h = radius_out_h - 1.f;
+
+ vg_lite_translate(x + radius_out_w, y + radius_out_h, &matrix);
+
+ radius_out_w *= DRAWING_SCALE_FACTOR;
+ radius_out_h *= DRAWING_SCALE_FACTOR;
+ radius_in_w *= DRAWING_SCALE_FACTOR;
+ radius_in_h *= DRAWING_SCALE_FACTOR;
+
+ vg_lite_scale(DRAWING_SCALE_DIV, DRAWING_SCALE_DIV, &matrix);
+
+ shape_vg_path.path = &__shape_paths.ellipse_arc;
+ shape_vg_path.path_length = sizeof(__shape_paths.ellipse_arc);
+ int path_offset = UI_DRAWING_VGLITE_PATH_compute_ellipse_arc(
+ &shape_vg_path,
+ (int)radius_out_w, (int)radius_out_h,
+ (int)radius_in_w, (int)radius_in_h,
+
+ // 0 degrees:
+ // - MicroUI: 3 o'clock.
+ // - RT595 VGLite implementation : 0 o'clock.
+ 90.f - start_angle_deg,
+
+ -arc_angle_deg, fill);
+
+ if (0 > path_offset) {
+ UI_VGLITE_IMPL_error(false, "Error during path computation");
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ ret = DRAWING_DONE;
+ }
+ else {
+
+ // Draw the point with the GPU
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_EVEN_ODD,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+ }
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __draw_ellipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ float x, float y,
+ int diameter_out_w, int diameter_out_h,
+ int diameter_in_w, int diameter_in_h) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ // +/- 1: consider 1 pixel of antialiasing
+ if (UI_VGLITE_enable_vg_lite_scissor_region(gc, (int)(x - 1), (int)(y - 1), (int)(x + diameter_out_w), (int)(y + diameter_out_h))) {
+
+ vg_lite_identity(&matrix);
+
+ float radius_w = (float)diameter_out_w ;
+ float radius_h = (float)diameter_out_h ;
+
+ radius_w /= 2.f;
+ radius_h /= 2.f;
+
+ vg_lite_translate(x + radius_w, y + radius_h, &matrix);
+
+ radius_w *= DRAWING_SCALE_FACTOR;
+ radius_h *= DRAWING_SCALE_FACTOR;
+
+ vg_lite_scale(DRAWING_SCALE_DIV, DRAWING_SCALE_DIV, &matrix);
+ // Compute the rounded rectangle shape path
+ shape_vg_path.path = &__shape_paths.ellipse[0];
+ shape_vg_path.path_length = sizeof(__shape_paths.ellipse);
+ int path_offset = UI_DRAWING_VGLITE_PATH_compute_ellipse(
+ &shape_vg_path, 0,
+ (int)radius_w, (int)radius_h,
+ false);
+
+ radius_w = (float)diameter_in_w ;
+ radius_h = (float)diameter_in_h ;
+
+ radius_w /= 2.f;
+ radius_h /= 2.f;
+
+ radius_w *= DRAWING_SCALE_FACTOR;
+ radius_h *= DRAWING_SCALE_FACTOR;
+
+ path_offset = UI_DRAWING_VGLITE_PATH_compute_ellipse(
+ &shape_vg_path,
+ path_offset,
+ (int)radius_w, (int)radius_h,
+ true);
+
+ if (0 > path_offset) {
+ UI_VGLITE_IMPL_error(false, "Error during path computation");
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT);
+ ret = DRAWING_DONE;
+ }
+ else {
+ // Draw the point with the GPU
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_EVEN_ODD,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+ }
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __fill_ellipse(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ float x, float y,
+ int diameter_w, int diameter_h) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ // +/- 1: consider 1 pixel of antialiasing
+ if (UI_VGLITE_enable_vg_lite_scissor_region( gc,
+ (int)(x - 1),
+ (int)(y - 1),
+ (int)(x + diameter_w),
+ (int)(y + diameter_h))) {
+
+ float radius_w = (float)diameter_w ;
+ float radius_h = (float)diameter_h ;
+ radius_w /= 2.f;
+ radius_h /= 2.f;
+
+ vg_lite_identity(&matrix);
+ vg_lite_translate(x + radius_w, y + radius_h, &matrix);
+
+ radius_w *= DRAWING_SCALE_FACTOR;
+ radius_h *= DRAWING_SCALE_FACTOR;
+
+ vg_lite_scale(DRAWING_SCALE_DIV, DRAWING_SCALE_DIV, &matrix);
+
+ // Compute the thick shape path
+ shape_vg_path.path = &__shape_paths.ellipse;
+ shape_vg_path.path_length = sizeof(__shape_paths.ellipse);
+ (void)UI_DRAWING_VGLITE_PATH_compute_filled_ellipse(&shape_vg_path, (int)radius_w, (int)radius_h, &matrix);
+
+ // Draw the point with the GPU
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_NON_ZERO,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __draw_line(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int xs, int ys,
+ int xe, int ye) {
+
+ // Translate to the line starting point
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ vg_lite_translate(xs, ys, &matrix);
+
+ // Compute the thick shape path
+ shape_vg_path.path = &__shape_paths.line;
+ shape_vg_path.path_length = sizeof(__shape_paths.line);
+ (void)UI_DRAWING_VGLITE_PATH_compute_line(&shape_vg_path, xe - xs, ye - ys);
+
+ // Draw the line with the GPU
+ return (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_NON_ZERO,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color
+ );
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __thick_line(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int xs,
+ int ys,
+ int xe,
+ int ye,
+ int thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end) {
+
+ vg_lite_matrix_t matrix;
+ DRAWING_Status ret;
+
+ int min_x = MEJ_MIN(xs, xe);
+ int min_y = MEJ_MIN(ys, ye);
+ int max_x = MEJ_MAX(xs, xe);
+ int max_y = MEJ_MAX(ys, ye);
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(
+ gc,
+ min_x - (thickness / 2),
+ min_y - (thickness / 2),
+ max_x + (thickness / 2),
+ max_y + (thickness / 2))) {
+
+ // Translate to the line starting point
+ vg_lite_identity(&matrix);
+ vg_lite_translate(xs, ys, &matrix);
+
+ vg_lite_scale(DRAWING_SCALE_DIV, DRAWING_SCALE_DIV, &matrix);
+
+ shape_vg_path.path = &__shape_paths.thick_shape_line;
+ shape_vg_path.path_length = sizeof(__shape_paths.thick_shape_line);
+
+ int caps = 0;
+ caps |= MEJ_VGLITE_PATH_SET_CAPS_START(start);
+ caps |= MEJ_VGLITE_PATH_SET_CAPS_END(end);
+
+ (void)UI_DRAWING_VGLITE_PATH_compute_thick_shape_line(
+ &shape_vg_path,
+ (int)(DRAWING_SCALE_FACTOR * (xe - xs)),
+ (int)(DRAWING_SCALE_FACTOR * (ye - ys)),
+ (int)(DRAWING_SCALE_FACTOR * thickness),
+ caps,
+ &matrix);
+
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_NON_ZERO,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color);
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __draw_thick_shape_ellipse_arc(
+ UI_DRAWING_VGLITE_PROCESS_draw_path_t drawer,
+ MICROUI_GraphicsContext* gc,
+ int x,
+ int y,
+ int diameter_w,
+ int diameter_h,
+ float start_angle_deg,
+ float arc_angle,
+ int thickness,
+ DRAWING_Cap start,
+ DRAWING_Cap end) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(
+ gc,
+ x - thickness,
+ y - thickness,
+ x + diameter_w + (2 * thickness) - 1,
+ y + diameter_h + (2 * thickness) - 1)) {
+
+ float translate_x = (float)diameter_w;
+ float translate_y = (float)diameter_h;
+ translate_x /= 2.f;
+ translate_y /= 2.f;
+
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ vg_lite_translate(x + translate_x, y + translate_y, &matrix);
+ vg_lite_rotate(-start_angle_deg, &matrix);
+ vg_lite_scale(DRAWING_SCALE_DIV, DRAWING_SCALE_DIV, &matrix);
+
+ int caps = 0;
+ caps |= MEJ_VGLITE_PATH_SET_CAPS_START(start);
+ caps |= MEJ_VGLITE_PATH_SET_CAPS_END(end);
+
+ // Compute the thick shape path
+ shape_vg_path.path = &__shape_paths.thick_ellipse_arc;
+ shape_vg_path.path_length = sizeof(__shape_paths.thick_ellipse_arc);
+
+ (void)UI_DRAWING_VGLITE_PATH_compute_thick_shape_ellipse_arc(
+ &shape_vg_path,
+ (int)(DRAWING_SCALE_FACTOR * diameter_w),
+ (int)(DRAWING_SCALE_FACTOR * diameter_h),
+ (int)(DRAWING_SCALE_FACTOR * thickness),
+ 0,
+ arc_angle,
+ caps);
+
+ ret = (*drawer)(
+ gc,
+ &shape_vg_path,
+ VG_LITE_FILL_NON_ZERO,
+ &matrix,
+ VG_LITE_BLEND_SRC_OVER,
+ gc->foreground_color);
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __rotate_image(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ vg_lite_buffer_t* src,
+ int x,
+ int y,
+ int xRotation,
+ int yRotation,
+ float angle_deg,
+ int alpha,
+ vg_lite_filter_t filter) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ // TODO try to crop region
+ if (UI_VGLITE_enable_vg_lite_scissor_region(
+ gc,
+ 0, 0,
+ gc->image.width, gc->image.height)) {
+
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ vg_lite_translate(xRotation, yRotation, &matrix);
+ vg_lite_rotate(-angle_deg, &matrix);
+ vg_lite_translate(x-xRotation, y-yRotation, &matrix);
+
+ uint32_t blit_rect[4];
+ blit_rect[0] = 0;
+ blit_rect[1] = 0;
+ blit_rect[2] = img->width;
+ blit_rect[3] = img->height;
+
+ ret = (*drawer)(
+ gc,
+ src,
+ blit_rect,
+ &matrix, VG_LITE_BLEND_SRC_OVER,
+ UI_VGLITE_get_vglite_color(gc, img, alpha),
+ filter);
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// See the section 'Internal function definitions' for the function documentation
+static DRAWING_Status __scale_image(
+ UI_DRAWING_VGLITE_PROCESS_blit_rect_t drawer,
+ MICROUI_GraphicsContext* gc,
+ MICROUI_Image* img,
+ vg_lite_buffer_t* src,
+ int x,
+ int y,
+ float factorX,
+ float factorY,
+ int alpha,
+ vg_lite_filter_t filter) {
+
+ DRAWING_Status ret;
+
+ // Check if there is something to draw and clip drawing limits
+ if (UI_VGLITE_enable_vg_lite_scissor_region(
+ gc, x, y,
+ (int) (x + (factorX * img->width)),
+ (int) (y + (factorY * img->height)))) {
+
+ vg_lite_matrix_t matrix;
+ vg_lite_identity(&matrix);
+ vg_lite_translate(x, y, &matrix);
+ vg_lite_scale(factorX, factorY, &matrix);
+
+ uint32_t blit_rect[4];
+ blit_rect[0] = 0;
+ blit_rect[1] = 0;
+ blit_rect[2] = img->width;
+ blit_rect[3] = img->height;
+
+ ret = (*drawer)(
+ gc,
+ src,
+ blit_rect,
+ &matrix, VG_LITE_BLEND_SRC_OVER,
+ UI_VGLITE_get_vglite_color(gc, img, alpha),
+ filter);
+ }
+ else {
+ ret = DRAWING_DONE;
+ }
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_image_drawing.c b/bsp/projects/microej/ui/src/ui_image_drawing.c
new file mode 100644
index 0000000..a0f9c91
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_image_drawing.c
@@ -0,0 +1,741 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Implementation of all drawing functions of ui_image_drawing.h.
+ * @author MicroEJ Developer Team
+ * @version 4.0.1
+ * @see ui_image_drawing.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_image_drawing.h"
+#include "ui_drawing_soft.h"
+#include "dw_drawing_soft.h"
+#include "ui_drawing_stub.h"
+#include "bsp_util.h"
+
+#if defined(LLUI_IMAGE_CUSTOM_FORMATS)
+
+/*
+ * VEE Port supports several images formats: standard (ARGB8888, A8, etc) and one or
+ * several custom formats. The next functions and tables redirect the image drawing
+ * to the right image manager (stub, soft or custom).
+ *
+ * VEE Port may support several destination formats: display format, one or several
+ * standard formats and one or several custom formats. See _get_table_index().
+ *
+ * Note: The functions are called by ui_drawing.c. The use of GPU should be checked
+ * in ui_drawing.c and not here.
+ */
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Indices in the tables UI_IMAGE_DRAWING_xxx_custom[]
+ */
+#define TABLE_INDEX_STUB 0 // index to call functions stub
+#define TABLE_INDEX_SOFT 1 // index to call functions in software
+#define TABLE_INDEX_CUSTOM_OFFSET 2 // index to call VEE Port functions
+
+#define GET_CUSTOM_IMAGE_INDEX(img) (((uint8_t)TABLE_INDEX_CUSTOM_OFFSET) + ((uint8_t)MICROUI_IMAGE_FORMAT_CUSTOM_0) - ((uint8_t)((img)->format)))
+
+// --------------------------------------------------------------------------------
+// Extern functions
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Set of drawing functions according to the source image format.
+ *
+ * These functions must be declared in other H files.
+ */
+
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_draw_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+extern DRAWING_Status UI_IMAGE_DRAWING_copy_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom0(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom3(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom4(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom5(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom6(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom7(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+extern DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// Typedef of drawing functions
+// --------------------------------------------------------------------------------
+
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_draw_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_copy_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawRegion_t) (MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawFlipped_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawRotatedBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawScaledNearestNeighbor_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+typedef DRAWING_Status (* UI_IMAGE_DRAWING_drawScaledBilinear_t) (MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha);
+
+// --------------------------------------------------------------------------------
+// Tables according to the source image format.
+// --------------------------------------------------------------------------------
+
+static const UI_IMAGE_DRAWING_draw_t UI_IMAGE_DRAWING_draw_custom[] = {
+ &UI_DRAWING_STUB_drawImage,
+ &UI_DRAWING_SOFT_drawImage,
+ &UI_IMAGE_DRAWING_draw_custom0,
+ &UI_IMAGE_DRAWING_draw_custom1,
+ &UI_IMAGE_DRAWING_draw_custom2,
+ &UI_IMAGE_DRAWING_draw_custom3,
+ &UI_IMAGE_DRAWING_draw_custom4,
+ &UI_IMAGE_DRAWING_draw_custom5,
+ &UI_IMAGE_DRAWING_draw_custom6,
+ &UI_IMAGE_DRAWING_draw_custom7,
+};
+
+static const UI_IMAGE_DRAWING_copy_t UI_IMAGE_DRAWING_copy_custom[] = {
+ UI_DRAWING_STUB_copyImage,
+ UI_DRAWING_SOFT_copyImage,
+ &UI_IMAGE_DRAWING_copy_custom0,
+ &UI_IMAGE_DRAWING_copy_custom1,
+ &UI_IMAGE_DRAWING_copy_custom2,
+ &UI_IMAGE_DRAWING_copy_custom3,
+ &UI_IMAGE_DRAWING_copy_custom4,
+ &UI_IMAGE_DRAWING_copy_custom5,
+ &UI_IMAGE_DRAWING_copy_custom6,
+ &UI_IMAGE_DRAWING_copy_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawRegion_t UI_IMAGE_DRAWING_drawRegion_custom[] = {
+ UI_DRAWING_STUB_drawRegion,
+ UI_DRAWING_SOFT_drawRegion,
+ &UI_IMAGE_DRAWING_drawRegion_custom0,
+ &UI_IMAGE_DRAWING_drawRegion_custom1,
+ &UI_IMAGE_DRAWING_drawRegion_custom2,
+ &UI_IMAGE_DRAWING_drawRegion_custom3,
+ &UI_IMAGE_DRAWING_drawRegion_custom4,
+ &UI_IMAGE_DRAWING_drawRegion_custom5,
+ &UI_IMAGE_DRAWING_drawRegion_custom6,
+ &UI_IMAGE_DRAWING_drawRegion_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawFlipped_t UI_IMAGE_DRAWING_drawFlipped_custom[] = {
+ UI_DRAWING_STUB_drawFlippedImage,
+ DW_DRAWING_SOFT_drawFlippedImage,
+ &UI_IMAGE_DRAWING_drawFlipped_custom0,
+ &UI_IMAGE_DRAWING_drawFlipped_custom1,
+ &UI_IMAGE_DRAWING_drawFlipped_custom2,
+ &UI_IMAGE_DRAWING_drawFlipped_custom3,
+ &UI_IMAGE_DRAWING_drawFlipped_custom4,
+ &UI_IMAGE_DRAWING_drawFlipped_custom5,
+ &UI_IMAGE_DRAWING_drawFlipped_custom6,
+ &UI_IMAGE_DRAWING_drawFlipped_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_t UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom[] = {
+ UI_DRAWING_STUB_drawRotatedImageNearestNeighbor,
+ DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom0,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom1,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom2,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom3,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom4,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom5,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom6,
+ &UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawRotatedBilinear_t UI_IMAGE_DRAWING_drawRotatedBilinear_custom[] = {
+ UI_DRAWING_STUB_drawRotatedImageBilinear,
+ DW_DRAWING_SOFT_drawRotatedImageBilinear,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom0,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom1,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom2,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom3,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom4,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom5,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom6,
+ &UI_IMAGE_DRAWING_drawRotatedBilinear_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawScaledNearestNeighbor_t UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom[] = {
+ UI_DRAWING_STUB_drawScaledImageNearestNeighbor,
+ DW_DRAWING_SOFT_drawScaledImageNearestNeighbor,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom0,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom1,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom2,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom3,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom4,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom5,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom6,
+ &UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom7,
+};
+
+static const UI_IMAGE_DRAWING_drawScaledBilinear_t UI_IMAGE_DRAWING_drawScaledBilinear_custom[] = {
+ UI_DRAWING_STUB_drawScaledImageBilinear,
+ DW_DRAWING_SOFT_drawScaledImageBilinear,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom0,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom1,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom2,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom3,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom4,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom5,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom6,
+ &UI_IMAGE_DRAWING_drawScaledBilinear_custom7,
+};
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static inline uint32_t _get_table_index(MICROUI_GraphicsContext* gc, MICROUI_Image* img) {
+ uint32_t index;
+ if (!LLUI_DISPLAY_isCustomFormat(img->format)) {
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+ (void)gc;
+ // standard image in display GC -> can use soft algo
+ index = TABLE_INDEX_SOFT;
+#else
+ index = LLUI_DISPLAY_isDisplayFormat(gc->image.format) ? TABLE_INDEX_SOFT : TABLE_INDEX_STUB;
+#endif
+ }
+ else {
+ // use the specific image manager to draw the custom image
+ // (this manager must check the destination format)
+ // cppcheck-suppress [misra-c2012-10.6] convert image format to an index
+ index = GET_CUSTOM_IMAGE_INDEX(img);
+ }
+ return index;
+}
+
+// --------------------------------------------------------------------------------
+// ui_image_drawing.h functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_draw(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return (*UI_IMAGE_DRAWING_draw_custom[_get_table_index(gc, img)])(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_copy(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return (*UI_IMAGE_DRAWING_copy_custom[_get_table_index(gc, img)])(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawRegion_custom[_get_table_index(gc, &gc->image)])(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawFlipped(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawFlipped_custom[_get_table_index(gc, img)])(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom[_get_table_index(gc, img)])(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawRotatedBilinear_custom[_get_table_index(gc, img)])(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom[_get_table_index(gc, img)])(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return (*UI_IMAGE_DRAWING_drawScaledBilinear_custom[_get_table_index(gc, img)])(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// --------------------------------------------------------------------------------
+// Table weak functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_draw_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_copy_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom0(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom1(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom2(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom3(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom4(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom5(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom6(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRegion_custom7(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawFlipped_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom0(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom1(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom2(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom3(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom4(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom5(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom6(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear_custom7(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+#else // #if defined(LLUI_IMAGE_CUSTOM_FORMATS)
+
+/*
+ * VEE Port supports only standard images formats: standard (ARGB8888, A8, etc). The
+ * next functions redirect the image drawing to the software algorithms.
+ *
+ * VEE Port may support several destination formats: display format and one or several
+ * standard formats.
+ *
+ * Note: The functions are called by ui_drawing.c. The use of GPU should be checked
+ * in ui_drawing.c and not here.
+ */
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static inline bool _can_call_soft_algo(MICROUI_GraphicsContext* gc) {
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+ (void)gc;
+ // standard image in display GC -> can use soft algo
+ return true;
+#else
+ return LLUI_DISPLAY_isDisplayFormat(gc->image.format);
+#endif
+}
+
+// --------------------------------------------------------------------------------
+// ui_image_drawing.h functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_draw(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ UI_DRAWING_SOFT_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha)
+ : UI_DRAWING_STUB_drawImage(gc, img, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_copy(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y){
+ return _can_call_soft_algo(gc) ?
+ UI_DRAWING_SOFT_copyImage(gc, img, regionX, regionY, width, height, x, y)
+ : UI_DRAWING_STUB_copyImage(gc, img, regionX, regionY, width, height, x, y);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRegion(MICROUI_GraphicsContext* gc, jint regionX, jint regionY, jint width, jint height, jint x, jint y, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ UI_DRAWING_SOFT_drawRegion(gc, regionX, regionY, width, height, x, y, alpha)
+ : UI_DRAWING_STUB_drawRegion(gc, regionX, regionY, width, height, x, y, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawFlipped(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint regionX, jint regionY, jint width, jint height, jint x, jint y, DRAWING_Flip transformation, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ DW_DRAWING_SOFT_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha)
+ : UI_DRAWING_STUB_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y, transformation, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ DW_DRAWING_SOFT_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha)
+ : UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawRotatedBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jint rotationX, jint rotationY, jfloat angle, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ DW_DRAWING_SOFT_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha)
+ : UI_DRAWING_STUB_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledNearestNeighbor(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ DW_DRAWING_SOFT_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha)
+ : UI_DRAWING_STUB_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_IMAGE_DRAWING_drawScaledBilinear(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint x, jint y, jfloat factorX, jfloat factorY, jint alpha){
+ return _can_call_soft_algo(gc) ?
+ DW_DRAWING_SOFT_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha)
+ : UI_DRAWING_STUB_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
+}
+
+#endif // #if defined(LLUI_IMAGE_CUSTOM_FORMATS)
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/ui/src/ui_rect_util.c b/bsp/projects/microej/ui/src/ui_rect_util.c
new file mode 100644
index 0000000..c57ad53
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_rect_util.c
@@ -0,0 +1,106 @@
+/*
+ * C
+ *
+ * Copyright 2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_util.h"
+#include "ui_rect_util.h"
+
+// --------------------------------------------------------------------------------
+// Functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+ui_rect_t UI_RECT_get_minimum_bounding_rect(const ui_rect_t rects[], const size_t count) {
+ assert(count > 0u);
+ ui_rect_t result = rects[0];
+ for (size_t i=1; iy1 < second->y1) ? first : second;
+ const ui_rect_t* top_below = (first->y1 < second->y1) ? second : first;
+ const ui_rect_t* bottom_below = (first->y2 > second->y2) ? first : second;
+ const ui_rect_t* bottom_above = (first->y2 > second->y2) ? second : first;
+
+ uint32_t count = 0u;
+
+ output[count] = UI_RECT_new_xyxy(top_above->x1, top_above->y1, top_above->x2, top_below->y1-1);
+ if (!UI_RECT_is_empty(output)) {
+ count++;
+ }
+
+ output[count] = UI_RECT_new_xyxy(MIN(first->x1, second->x1), top_below->y1, MAX(first->x2, second->x2), bottom_above->y2);
+ if (!UI_RECT_is_empty(output)) {
+ count++;
+ }
+
+ output[count] = UI_RECT_new_xyxy(bottom_below->x1, bottom_above->y2+1, bottom_below->x2, bottom_below->y2);
+ if (!UI_RECT_is_empty(output)) {
+ count++;
+ }
+
+ ret = count;
+ }
+ return ret;
+}
+
+// See the header file for the function documentation
+uint32_t UI_RECT_subtract(ui_rect_t output[4], const ui_rect_t* first, const ui_rect_t* second) {
+ uint32_t ret;
+ if (UI_RECT_contains_rect(first, second)) {
+ output[0] = UI_RECT_new_xyxy(first->x1, first->y1, first->x2, second->y1-1); // Top
+ output[1] = UI_RECT_new_xyxy(first->x1, second->y1, second->x1-1, second->y2); // Left
+ output[2] = UI_RECT_new_xyxy(second->x2+1, second->y1, first->x2, second->y2); // Right
+ output[3] = UI_RECT_new_xyxy(first->x1, second->y2+1, first->x2, first->y2); // Bottom
+ ret = 4u;
+ } else if (UI_RECT_contains_rect(second, first)) {
+ UI_RECT_mark_empty(&output[0]);
+ UI_RECT_mark_empty(&output[1]);
+ UI_RECT_mark_empty(&output[2]);
+ UI_RECT_mark_empty(&output[3]);
+ ret = 0u;
+ } else if (!UI_RECT_intersects_rect(first, second)) {
+ output[0] = *first;
+ UI_RECT_mark_empty(&output[1]);
+ UI_RECT_mark_empty(&output[2]);
+ UI_RECT_mark_empty(&output[3]);
+ ret = 1u;
+ } else {
+ output[0] = UI_RECT_new_xyxy(first->x1, first->y1, first->x2, second->y1-1); // Top
+ output[1] = UI_RECT_new_xyxy(first->x1, MAX(first->y1, second->y1), second->x1-1, MIN(first->y2, second->y2)); // Left
+ output[2] = UI_RECT_new_xyxy(second->x2+1, MAX(first->y1, second->y1), first->x2, MIN(first->y2, second->y2)); // Right
+ output[3] = UI_RECT_new_xyxy(first->x1, second->y2+1, first->x2, first->y2); // Bottom
+ ret = 4u;
+ }
+ return ret;
+}
diff --git a/bsp/projects/microej/ui/src/ui_vglite.c b/bsp/projects/microej/ui/src/ui_vglite.c
new file mode 100644
index 0000000..8b56960
--- /dev/null
+++ b/bsp/projects/microej/ui/src/ui_vglite.c
@@ -0,0 +1,753 @@
+/*
+ * C
+ *
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation of ui_vglite.h.
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "ui_vglite.h"
+#include "color.h"
+#include "mej_math.h"
+#include "bsp_util.h"
+#include "interrupts.h"
+
+#include "vg_lite_hal.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Unknown display format
+ */
+#define DISPLAY_UNKNOWN_FORMAT -1
+
+/*
+ * @brief To check if the image format is known
+ */
+#define VG_LITE_UNKNOWN_FORMAT ((vg_lite_buffer_format_t) (DISPLAY_UNKNOWN_FORMAT))
+
+/*
+ * @brief Macro to align data
+ */
+#define ALIGN(value, align) (((value) + (align) - 1) & ~((align) - 1))
+
+// -----------------------------------------------------------------------------
+// Typedef
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Action to perform during the GPU interrupt.
+ */
+typedef enum {
+
+ /*
+ * @brief Nothing to do, the interrupt occurs during a drawing
+ */
+ IRQ_BYPASS,
+
+ /*
+ * @brief Wakes-up the drawer to continue the drawing
+ */
+ IRQ_WAKEUP_TASK,
+
+ /*
+ * @brief Wakes-up the MicroUI Graphics Engine
+ */
+ IRQ_WAKEUP_GRAPHICS_ENGINE,
+
+} vglite_irq_post_operation_t;
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief VGLite destination buffer (there is only one destination at any time)
+ */
+static vg_lite_buffer_t destination_buffer;
+
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+/*
+ * @brief flag to enable/disable hardware rendering
+ */
+static bool hardware_rendering;
+#endif
+
+/*
+ * @brief IRQ operation
+ */
+static volatile vglite_irq_post_operation_t vg_lite_irq_operation;
+
+/*
+ * @brief vglite operation semaphore
+ */
+static void* vg_lite_operation_semaphore;
+
+// -----------------------------------------------------------------------------
+// Static Constants
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief LUT to convert MicroUI image format to VGLite image format
+ */
+const vg_lite_buffer_format_t __microui_to_vg_lite_format[] = {
+ VG_LITE_RGB565, // MICROUI_IMAGE_FORMAT_LCD = 0,
+ VG_LITE_UNKNOWN_FORMAT, // UNKNOWN = 1,
+ VG_LITE_RGBA8888, // MICROUI_IMAGE_FORMAT_ARGB8888 = 2,
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_RGB888 = 3, unsupported
+ VG_LITE_RGB565, // MICROUI_IMAGE_FORMAT_RGB565 = 4,
+ VG_LITE_RGBA5551, // MICROUI_IMAGE_FORMAT_ARGB1555 = 5
+ VG_LITE_RGBA4444, // MICROUI_IMAGE_FORMAT_ARGB4444 = 6,
+ VG_LITE_A4, // MICROUI_IMAGE_FORMAT_A4 = 7,
+ VG_LITE_A8, // MICROUI_IMAGE_FORMAT_A8 = 8,
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_LRGB888
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_LARGB8888
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A2
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A1
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C4
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C2
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C1
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC44
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC22
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC11
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F8
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F4
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F2
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F1
+ VG_LITE_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A8_RLE
+ VG_LITE_RGBA8888, // MICROUI_IMAGE_FORMAT_ARGB8888_PRE
+ VG_LITE_RGBA5551, // MICROUI_IMAGE_FORMAT_ARGB1555_PRE
+ VG_LITE_RGBA4444, // MICROUI_IMAGE_FORMAT_ARGB4444_PRE
+ // outside of the table ... MICROUI_IMAGE_FORMAT_CUSTOM = 255,
+};
+
+/*
+ * @brief Look Up Table to translate MicroUI image to BPP
+ */
+static const int __microui_to_bpp[] = {
+ (5+6+5), // MICROUI_IMAGE_FORMAT_LCD = 0 = RGB565,
+ DISPLAY_UNKNOWN_FORMAT, // UNKNOWN = 1,
+ (4*8), // MICROUI_IMAGE_FORMAT_ARGB8888 = 2,
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_RGB888 = 3, unsupported
+ (5+6+5), // MICROUI_IMAGE_FORMAT_RGB565 = 4,
+ (1+(3*5)), // MICROUI_IMAGE_FORMAT_ARGB1555 = 5,
+ (4*4), // MICROUI_IMAGE_FORMAT_ARGB4444 = 6,
+ 4, // MICROUI_IMAGE_FORMAT_A4 = 7,
+ 8, // MICROUI_IMAGE_FORMAT_A8 = 8,
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_LRGB888
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_LARGB8888
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A2
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A1
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C4
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C2
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_C1
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC44
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC22
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_AC11
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F8
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F4
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F2
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_F1
+ DISPLAY_UNKNOWN_FORMAT, // MICROUI_IMAGE_FORMAT_A8_RLE
+ (4*8), // MICROUI_IMAGE_FORMAT_ARGB8888_PRE
+ (1+(3*5)), // MICROUI_IMAGE_FORMAT_ARGB1555_PRE
+ (4*4), // MICROUI_IMAGE_FORMAT_ARGB4444_PRE
+ // outside of the table ... MICROUI_IMAGE_FORMAT_CUSTOM = 255,
+};
+
+/*
+ * @brief Look Up Table to enable the premultiplication according to MicroUI image format
+ */
+static const bool __microui_to_premul[] = {
+ false, // MICROUI_IMAGE_FORMAT_LCD = 0 = RGB565,
+ false, // UNKNOWN = 1,
+ true, // MICROUI_IMAGE_FORMAT_ARGB8888 = 2,
+ false, // MICROUI_IMAGE_FORMAT_RGB888 = 3, unsupported
+ false, // MICROUI_IMAGE_FORMAT_RGB565 = 4,
+ true, // MICROUI_IMAGE_FORMAT_ARGB1555 = 5,
+ true, // MICROUI_IMAGE_FORMAT_ARGB4444 = 6,
+ // outside of the table ... false,
+};
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Configures a vg_lite buffer for a RGB565 image
+ *
+ * @param[in] b: buffer to configure
+ */
+static void __buffer_default_configuration(vg_lite_buffer_t* b) {
+ /* Reset planar. */
+ b->yuv.uv_planar = 0;
+ b->yuv.v_planar = 0;
+ b->yuv.alpha_planar = 0;
+
+ b->tiled = VG_LITE_LINEAR;
+ b->format = VG_LITE_RGB565;
+ b->handle = NULL;
+ b->memory = NULL;
+ b->address = 0;
+ b->yuv.swizzle = VG_LITE_SWIZZLE_UV;
+ b->image_mode = VG_LITE_NORMAL_IMAGE_MODE;
+ b->transparency_mode = VG_LITE_IMAGE_OPAQUE;
+}
+
+/*
+ * @brief Configures and return current vg_lite buffer for the given image (address and size)
+ *
+ * @param[in] image: image from which buffer should be configured
+ * @param[in] b: buffer to configure
+ */
+static void __buffer_set_address_and_size(MICROUI_Image* image, vg_lite_buffer_t* b) {
+ b->width = image->width;
+ b->height = image->height;
+ b->stride = LLUI_DISPLAY_getStrideInBytes(image);
+ b->memory = (void*)LLUI_DISPLAY_getBufferAddress(image);
+ b->address = (uint32_t)LLUI_DISPLAY_getBufferAddress(image);
+}
+
+/*
+ * @brief Convert MICROUI_ImageFormat to vg_lite_buffer_format_t
+ *
+ * @param[in] microui_format: MicroUI image format
+ */
+static vg_lite_buffer_format_t __convert_format(MICROUI_ImageFormat microui_format) {
+ vg_lite_buffer_format_t vg_lite_format = VG_LITE_UNKNOWN_FORMAT;
+ if (microui_format < (sizeof(__microui_to_vg_lite_format) / sizeof(__microui_to_vg_lite_format[0]))) {
+ vg_lite_format = __microui_to_vg_lite_format[microui_format];
+ }
+
+ return vg_lite_format;
+}
+
+static vg_lite_buffer_format_t __convert_input_format(MICROUI_Image* image) {
+ MICROUI_ImageFormat microui_format = (MICROUI_ImageFormat)image->format;
+ vg_lite_buffer_format_t vg_lite_format = __convert_format(microui_format);
+
+ if (VG_LITE_UNKNOWN_FORMAT != vg_lite_format) {
+
+ // check if the image pixels must be pre-multiplied with the opacity
+ bool premul_required;
+ if (LLUI_DISPLAY_isTransparent(image) && (microui_format < (sizeof(__microui_to_premul) / sizeof(__microui_to_premul[0])))) {
+ premul_required = __microui_to_premul[microui_format];
+ }
+ else {
+ premul_required = false;
+ }
+
+ if (premul_required) {
+ if (VG_LITE_SUCCESS != vg_lite_enable_premultiply()) {
+ // pre-multiplication cannot be enabled or unsupported
+#ifndef VGLITE_USE_GPU_FOR_TRANSPARENT_IMAGES
+ // cannot draw a transparent image without applying a pre-multiplication
+ vg_lite_format = VG_LITE_UNKNOWN_FORMAT;
+#endif // VGLITE_USE_GPU_FOR_TRANSPARENT_IMAGES
+ }
+ }
+ else if (!UI_VGLITE_need_to_premultiply() && (VG_LITE_SUCCESS != vg_lite_disable_premultiply())) {
+ // have to disable the premultiplication but cannot
+ UI_VGLITE_IMPL_error(false, "vg_lite engine premultiply error: cannot disable the pre multiplication");
+ }
+ else {
+ // premultiplication useless and nothing to disable
+ // -> nothing to do
+ }
+ }
+
+ return vg_lite_format;
+}
+
+// -----------------------------------------------------------------------------
+// Low Level API [optional]: weak functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_VGLITE_IMPL_notify_gpu_start(void) {
+ // does nothing by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_VGLITE_IMPL_notify_gpu_stop(void) {
+ // does nothing by default
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void UI_VGLITE_IMPL_error(bool critical, const char* format, ...) {
+ (void)format;
+ while (critical){}
+}
+
+// -----------------------------------------------------------------------------
+// ui_vglite.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void UI_VGLITE_init(void* binary_semaphore) {
+ vg_lite_error_t ret = VG_LITE_SUCCESS;
+
+ // Initialize the VGLite library and it's tesselation buffer.
+ ret = vg_lite_init(VGLITE_TESSELATION_WIDTH, VGLITE_TESSELATION_HEIGHT);
+ if (VG_LITE_SUCCESS != ret) {
+ UI_VGLITE_IMPL_error(true, "vg_lite engine init failed: vg_lite_init() returned error %d", ret);
+ }
+
+ // Configures the vg_lite destination buffer for a RGB565 image
+ __buffer_default_configuration(&destination_buffer);
+
+ // Enable by default hardware rendering
+ UI_VGLITE_enable_hardware_rendering();
+
+ vg_lite_operation_semaphore = binary_semaphore;
+}
+
+void UI_VGLITE_enable_hardware_rendering(void) {
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ hardware_rendering = true;
+#endif
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_disable_hardware_rendering(void) {
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ hardware_rendering = false;
+#endif
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_toggle_hardware_rendering(void) {
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ hardware_rendering = !hardware_rendering;
+#endif
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_is_hardware_rendering_enabled(void) {
+#ifdef VGLITE_OPTION_TOGGLE_GPU
+ return hardware_rendering;
+#else
+ return true;
+#endif
+}
+
+// See the header file for the function documentation
+vg_lite_buffer_t* UI_VGLITE_configure_destination(MICROUI_GraphicsContext* gc) {
+ MICROUI_Image* image = &gc->image;
+
+ if (!LLUI_DISPLAY_isLCD(image) || ((uint32_t)LLUI_DISPLAY_getBufferAddress(image) != destination_buffer.address)) {
+ // we target an image or the previous destination was not the display
+ // -> have to use another context to force vg_lite to reload the new context
+ __buffer_set_address_and_size(image, &destination_buffer);
+ destination_buffer.format = __convert_format((MICROUI_ImageFormat)image->format);
+ }
+ // else: we target the display which is the same destination as for the previous drawing: nothing to do
+
+ vg_lite_irq_operation = IRQ_BYPASS; // do nothing in the IRQ routine
+ UI_VGLITE_IMPL_notify_gpu_start();
+
+ return &destination_buffer;
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_configure_source(vg_lite_buffer_t *buffer, MICROUI_Image* image) {
+
+ bool ret = false;
+
+ uint32_t stride = LLUI_DISPLAY_getStrideInBytes(image);
+
+ if (LLUI_DISPLAY_IMPL_getNewImageStrideInBytes(image->format, image->width, image->height, stride) == stride){
+ vg_lite_buffer_format_t format = __convert_input_format(image);
+
+ if (VG_LITE_UNKNOWN_FORMAT != format) {
+
+ __buffer_default_configuration(buffer);
+ __buffer_set_address_and_size(image, buffer);
+
+ buffer->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; // image only
+ buffer->transparency_mode = VG_LITE_IMAGE_TRANSPARENT;
+ buffer->format = format;
+ buffer->stride = stride;
+ ret = true;
+ }
+ }
+ // else: frame buffer does not respect VGLite alignment
+
+ return ret;
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_start_operation(bool wakeup_graphics_engine) {
+ vg_lite_irq_operation = wakeup_graphics_engine ? IRQ_WAKEUP_GRAPHICS_ENGINE : IRQ_WAKEUP_TASK;
+
+ // VG drawing has been added to the GPU commands list: ask to submit VG operation
+ vg_lite_flush();
+
+ if (!wakeup_graphics_engine) {
+ // active waiting until the GPU interrupt is thrown
+ LLUI_DISPLAY_IMPL_binarySemaphoreTake(vg_lite_operation_semaphore);
+ }
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_VGLITE_post_operation(MICROUI_GraphicsContext* gc, vg_lite_error_t vg_lite_error) {
+ DRAWING_Status ret;
+ if (VG_LITE_SUCCESS != vg_lite_error) {
+ // GPU is useless now, can be disabled. No GPU access should be done after this line
+ UI_VGLITE_IMPL_notify_gpu_stop();
+ ret = UI_VGLITE_report_vglite_error(gc, vg_lite_error);
+ } else {
+ // start GPU operation and do not wait for it to end
+ UI_VGLITE_start_operation(true);
+ ret = DRAWING_RUNNING;
+ }
+
+ if (!UI_VGLITE_need_to_premultiply() && (VG_LITE_SUCCESS != vg_lite_enable_premultiply())) {
+ // cannot restore premultiplication
+ UI_VGLITE_IMPL_error(false, "vg_lite engine premultiply error: cannot restore the pre multiplication");
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+uint32_t UI_VGLITE_premultiply_alpha(uint32_t color, uint8_t alpha) {
+ uint32_t ret;
+
+ if (alpha == (uint8_t)0) {
+ ret = 0;
+ }
+ else if(alpha == (uint8_t)0xff) {
+ ret = color;
+ }
+ else {
+ uint8_t red = (uint8_t)(
+ (uint32_t)(alpha * COLOR_GET_CHANNEL(color, ARGB8888, RED))
+ / (uint32_t)0xff);
+ uint8_t green = (uint8_t)(
+ (uint32_t)(alpha * COLOR_GET_CHANNEL(color, ARGB8888, GREEN))
+ / (uint32_t)0xff);
+ uint8_t blue = (uint8_t)(
+ (uint32_t)(alpha * COLOR_GET_CHANNEL(color, ARGB8888, BLUE))
+ / (uint32_t)0xff);
+ ret = COLOR_SET_COLOR(alpha, red, green, blue, ARGB8888);
+ }
+ return ret;
+}
+
+// See the header file for the function documentation
+uint32_t UI_VGLITE_premultiply(uint32_t color) {
+ uint8_t alpha = COLOR_GET_CHANNEL(color, ARGB8888, ALPHA);
+ return UI_VGLITE_premultiply_alpha(color, alpha);
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_need_to_premultiply(void) {
+ return !vg_lite_query_feature(gcFEATURE_BIT_VG_PE_PREMULTIPLY);
+}
+
+// See the header file for the function documentation
+vg_lite_color_t UI_VGLITE_get_vglite_color(MICROUI_GraphicsContext* gc, MICROUI_Image* img, jint alpha) {
+ jint fc;
+
+ switch(img->format) {
+ case MICROUI_IMAGE_FORMAT_A4:
+ case MICROUI_IMAGE_FORMAT_A8:
+ if (UI_VGLITE_need_to_premultiply()) {
+ // hardware does not manage the pre-multiplication: the src color must be pre-multiplied
+ fc = UI_VGLITE_premultiply_alpha(gc->foreground_color, alpha);
+ }
+ else {
+ // hardware manages the pre-multiplication (even if it has been disabled because not applicable
+ // for the "picto" images): the src color must stay as is
+ fc = (alpha << 24) | (gc->foreground_color & 0xFFFFFF);
+ }
+ break;
+ default:
+ if (UI_VGLITE_need_to_premultiply()) {
+ // hardware does not manage the pre-multiplication: the color is used as "pre-multiplied" factor
+ // for all pixel components (A-R-G-B)
+ fc = alpha * 0x01010101;
+ }
+ else {
+ // hardware manages the pre-multiplication
+ // - pre-multiplication enabled: keep the image pixels values and use the opacity as
+ // "pre-multiplied" factor
+ // - pre-multiplication disabled: the image pixels are already pre-multiplied: keep the image
+ // pixels values and use the opacity as "pre-multiplied" factor
+ fc = (alpha << 24) | 0xFFFFFF;
+ }
+ break;
+ }
+
+ return (vg_lite_color_t)fc;
+}
+
+// See the header file for the function documentation
+void UI_VGLITE_IRQHandler(void) {
+
+ // retrieve the post operation to perform and reset it
+ vglite_irq_post_operation_t operation = vg_lite_irq_operation;
+ vg_lite_irq_operation = IRQ_BYPASS;
+
+ switch(operation) {
+
+ default: // should not occur
+ case IRQ_BYPASS: {
+ // Nothing to do: an automatic flush() has been made by the vg_lite engine to free the command buffer.
+ // After this interrupt, the vg_lite engine is waked-up (see vg_lite_os_wait_interrupt()) and fills the
+ // command buffer with the new pending command (command added by a VEE drawing).
+ break;
+ }
+
+ case IRQ_WAKEUP_TASK :{
+ // The intermediate drawing of a "big" drawing is performed: wakes-up the drawer (the caller of
+ // UI_VGLITE_start_operation()) to draw the next steps of this "big" drawing (text, raw image,
+ // bvi, etc.).
+ LLUI_DISPLAY_IMPL_binarySemaphoreGive(vg_lite_operation_semaphore, true);
+ break;
+ }
+
+ case IRQ_WAKEUP_GRAPHICS_ENGINE :{
+ uint8_t it = interrupt_enter();
+
+ // The "simple" drawing or the last step of the "big" drawing is made: wakes-up the Graphics Engine to
+ // notify the end of the drawing and unlock the next application drawing.
+ LLUI_DISPLAY_notifyAsynchronousDrawingEnd(true);
+
+ // GPU is useless now, can be disabled. No GPU access should be done after this line
+ UI_VGLITE_IMPL_notify_gpu_stop();
+
+ interrupt_leave(it);
+
+ break;
+ }
+ }
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_enable_vg_lite_scissor(MICROUI_GraphicsContext* gc) {
+
+ bool ret;
+ int32_t width = UI_RECT_get_width(&gc->clip);
+ int32_t height = UI_RECT_get_height(&gc->clip);
+
+ if (LLUI_DISPLAY_isClipEnabled(gc)) {
+
+ if ((width > 0) && (height > 0)) {
+ // not "empty" clip
+
+ // enable scissor for next vglite drawing
+ vg_lite_enable_scissor();
+ vg_lite_set_scissor(gc->clip.x1, gc->clip.y1, width, height);
+
+ // perform drawing
+ ret = true;
+ }
+ else {
+ // empty clip: nothing to draw
+ ret = false;
+ }
+ }
+ else {
+ // clip is disabled :
+
+ // disable scissor (vglite lib already crops to the buffer bounds)
+ vg_lite_disable_scissor();
+
+ // perform drawing
+ ret = true;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_enable_vg_lite_scissor_region(MICROUI_GraphicsContext* gc, int x1, int y1, int x2, int y2) {
+
+ bool ret;
+
+ if (LLUI_DISPLAY_isClipEnabled(gc)) {
+
+ if (LLUI_DISPLAY_clipRectangle(gc, (jint*)&x1, (jint*)&y1, (jint*)&x2, (jint*)&y2)) {
+ // drawing fully or partially fits the clip:
+
+ // enable scissor for next vglite drawing
+ vg_lite_enable_scissor();
+ vg_lite_set_scissor(gc->clip.x1, gc->clip.y1, gc->clip.x2 - gc->clip.x1 + 1, gc->clip.y2 - gc->clip.y1 + 1);
+
+ // perform drawing
+ ret = true;
+ }
+ else {
+ // drawing is fully outside the clip, nothing to draw
+ ret = false;
+ }
+ }
+ else {
+ // clip is disabled :
+
+ // disable scissor (vglite lib already crops to the buffer bounds)
+ vg_lite_disable_scissor();
+
+ // perform drawing
+ ret = true;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+bool UI_VGLITE_enable_vg_lite_scissor_area(MICROUI_GraphicsContext* gc, jfloat width, jfloat height, jfloat* matrix) {
+
+ bool ret;
+
+ if (LLUI_DISPLAY_isClipEnabled(gc)) {
+
+ // Transform each corners points of the image viewbox
+ // top/left, not impacted by scale and rotate
+ int x0 = (int) matrix[2];
+ int y0 = (int) matrix[5];
+
+ // top/right
+ int x1 = (int) ((width * matrix[0]) + x0);
+ int y1 = (int) ((width * matrix[3]) + y0);
+
+ // bottom/Left
+ int x2 = (int) ((height * matrix[1]) + x0);
+ int y2 = (int) ((height * matrix[4]) + y0);
+
+ // bottom/right
+ int x3 = (int) (x2 + x1 - x0);
+ int y3 = (int) (y2 + y1 - y0);
+
+ // Compute the clipping area from all points
+ int render_area_x = MEJ_MIN(x0, MEJ_MIN(x1, MEJ_MIN(x2, x3)));
+ int render_area_y = MEJ_MIN(y0, MEJ_MIN(y1, MEJ_MIN(y2, y3)));
+ int render_area_width = MEJ_MAX(x0, MEJ_MAX(x1, MEJ_MAX(x2, x3))) - render_area_x ;
+ int render_area_height = MEJ_MAX(y0, MEJ_MAX(y1, MEJ_MAX(y2, y3))) - render_area_y;
+
+ // get GC clip
+ int master_clip_x = gc->clip.x1;
+ int master_clip_y = gc->clip.y1;
+ int master_clip_width = UI_RECT_get_width(&gc->clip);
+ int master_clip_height = UI_RECT_get_height(&gc->clip);
+
+ // crop x
+ if (render_area_x < master_clip_x) {
+ //-> decrease width and set x to the minimum coordinate
+ render_area_width -= master_clip_x - render_area_x;
+ render_area_x = master_clip_x;
+ }
+
+ // crop y
+ if (render_area_y < master_clip_y) {
+ //-> decrease height and set y to the minimum coordinate
+ render_area_height -= master_clip_y - render_area_y;
+ render_area_y = master_clip_y;
+ }
+
+ int master_clip_outside_x = master_clip_x + master_clip_width;
+ int master_clip_outside_y = master_clip_y + master_clip_height;
+
+ if (render_area_x >= master_clip_outside_x) {
+ // expected X is out of clip on the right: set an empty clip
+ render_area_width = 0;
+ } else {
+ // crop x+width, width is set to 0 if negative (empty clip)
+ render_area_width = MEJ_MAX(0, MEJ_MIN(render_area_width, master_clip_outside_x - render_area_x));
+ }
+
+ if (render_area_y >= master_clip_outside_y) {
+ // expected Y is out of clip on the bottom: set an empty clip
+ render_area_height = 0;
+ } else {
+ // crop y+height, height is set to 0 if negative (empty clip)
+ render_area_height = MEJ_MAX(0, MEJ_MIN(render_area_height, master_clip_outside_y - render_area_y));
+ }
+
+ if ((0 < render_area_width) && (0 < render_area_height)) {
+ vg_lite_enable_scissor();
+ vg_lite_set_scissor(render_area_x, render_area_y, render_area_width, render_area_height);
+
+ // perform drawing
+ ret = true;
+ }
+ else {
+ // drawing is fully outside the clip, nothing to draw
+ ret = false;
+ }
+ }
+ else {
+ // clip is disabled :
+
+ // disable scissor (vglite lib already crops to the buffer bounds)
+ vg_lite_disable_scissor();
+
+ // perform drawing
+ ret = true;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+int32_t UI_VGLITE_get_bpp(MICROUI_ImageFormat image_format) {
+ int bpp = DISPLAY_UNKNOWN_FORMAT;
+
+ if ((int) image_format < (int)(sizeof(__microui_to_bpp) / sizeof(__microui_to_bpp[0]))) {
+ bpp = __microui_to_bpp[image_format];
+ }
+
+ return (DISPLAY_UNKNOWN_FORMAT == bpp) ? -1 : bpp;
+}
+
+// See the header file for the function documentation
+DRAWING_Status UI_VGLITE_report_vglite_error(MICROUI_GraphicsContext* gc, vg_lite_error_t vg_lite_error) {
+ UI_VGLITE_IMPL_error(false, "vg_lite operation failed with error: %d\n", vg_lite_error);
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT | ((VG_LITE_OUT_OF_MEMORY == vg_lite_error) ? DRAWING_LOG_OUT_OF_MEMORY : 0));
+ return DRAWING_DONE;
+}
+
+// -----------------------------------------------------------------------------
+// ui_drawing.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+uint32_t UI_DRAWING_getNewImageStrideInBytes(jbyte image_format, uint32_t image_width, uint32_t image_height, uint32_t default_stride) {
+
+ (void)image_height;
+
+ uint32_t bpp = UI_VGLITE_get_bpp((MICROUI_ImageFormat)image_format);
+ uint32_t ret;
+
+ if (-1 != bpp) {
+ // VGLite library requires a stride on 16 pixels
+ uint32_t stride = ALIGN(image_width, 16u);
+ ret = (stride * bpp) / 8u;
+ }
+ else {
+ // unsupported format
+ ret = default_stride;
+ }
+
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_debug.h b/bsp/projects/microej/util/inc/mej_debug.h
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_debug.h
rename to bsp/projects/microej/util/inc/mej_debug.h
index e46b270..c6aae13 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_debug.h
+++ b/bsp/projects/microej/util/inc/mej_debug.h
@@ -2,7 +2,8 @@
* C
*
* Copyright 2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#if !defined __MEJ_DEBUG_H__
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_disable.h b/bsp/projects/microej/util/inc/mej_disable.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_disable.h
rename to bsp/projects/microej/util/inc/mej_disable.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_log.h b/bsp/projects/microej/util/inc/mej_log.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_log.h
rename to bsp/projects/microej/util/inc/mej_log.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_math.h b/bsp/projects/microej/util/inc/mej_math.h
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_math.h
rename to bsp/projects/microej/util/inc/mej_math.h
index 133b941..c2cf54a 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/mej_math.h
+++ b/bsp/projects/microej/util/inc/mej_math.h
@@ -1,15 +1,15 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
/*
* @file
- * @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 8.0.1
*/
#if !defined MEJ_MATH_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/pool.h b/bsp/projects/microej/util/inc/pool.h
similarity index 85%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/pool.h
rename to bsp/projects/microej/util/inc/pool.h
index fc65217..060af3e 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/inc/pool.h
+++ b/bsp/projects/microej/util/inc/pool.h
@@ -1,10 +1,13 @@
+
/*
* C
*
* Copyright 2014-2021 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
+
/*
* The module provide function to simply manage a
* Fixed memory pool size.
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/mej_debug.c b/bsp/projects/microej/util/src/mej_debug.c
similarity index 78%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/mej_debug.c
rename to bsp/projects/microej/util/src/mej_debug.c
index 7dad098..2a1b80a 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/mej_debug.c
+++ b/bsp/projects/microej/util/src/mej_debug.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2020 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
// -----------------------------------------------------------------------------
@@ -31,4 +32,4 @@ void MEJ_DEBUG_enable(int level) {
void MEJ_DEBUG_disable(int level) {
__mej_debug_lvls &= ~(level);
-}
+}
\ No newline at end of file
diff --git a/bsp/projects/microej/util/src/mej_math.c b/bsp/projects/microej/util/src/mej_math.c
new file mode 100644
index 0000000..6bcb030
--- /dev/null
+++ b/bsp/projects/microej/util/src/mej_math.c
@@ -0,0 +1,70 @@
+/*
+ * C
+ *
+ * Copyright 2019-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief MicroEJ MicroUI library low level API: implementation over VGLite
+ * @author MicroEJ Developer Team
+ * @version 8.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "mej_math.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Enables the use of power quad (if available).
+ *
+ * If this feature is enabled, mathematic operations use the power quad.
+ * If this feature is disabled, mathematic operations use the compiler C library.
+ */
+#ifndef VG_FEATURE_POWERQUAD
+#define VG_FEATURE_POWERQUAD __has_include("fsl_powerquad.h")
+#if defined VG_FEATURE_POWERQUAD && VG_FEATURE_POWERQUAD
+#include "fsl_powerquad.h"
+#else
+#include
+#endif
+#endif
+
+// -----------------------------------------------------------------------------
+// mej_math.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+float32_t mej_tan_f32(float32_t value) {
+#if defined VG_FEATURE_POWERQUAD && VG_FEATURE_POWERQUAD
+ float32_t cos;
+ float32_t sin;
+ PQ_CosF32(&value, &cos);
+ PQ_SinF32(&value, &sin);
+ PQ_DivF32(&sin, &cos, &value);
+ return value;
+#else
+ return tanf(value);
+#endif
+}
+
+// See the header file for the function documentation
+float32_t mej_sqrt_f32(float32_t value) {
+#if defined VG_FEATURE_POWERQUAD && VG_FEATURE_POWERQUAD
+ PQ_SqrtF32(&value, &value);
+ return value;
+#else
+ return sqrtf(value);
+#endif
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/pool.c b/bsp/projects/microej/util/src/pool.c
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/pool.c
rename to bsp/projects/microej/util/src/pool.c
index dfd9674..5fe4e7b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/util/src/pool.c
+++ b/bsp/projects/microej/util/src/pool.c
@@ -2,7 +2,8 @@
* C
*
* Copyright 2014-2021 MicroEJ Corp. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be found with this software.
+ * This library is provided in source code for use, modification and test, subject to license terms.
+ * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
*/
#include
diff --git a/bsp/projects/microej/vg/inc/bvi_vglite.h b/bsp/projects/microej/vg/inc/bvi_vglite.h
new file mode 100644
index 0000000..dba4150
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/bvi_vglite.h
@@ -0,0 +1,122 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Provides some functions to draw VGLite elements on a BufferedVectorImage
+ * (in VGLite internal format).
+ *
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ */
+
+#if !defined BVI_VGLITE_H
+#define BVI_VGLITE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+#include "microvg_configuration.h"
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include "vg_lite.h"
+
+// --------------------------------------------------------------------------------
+// Public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Adjusts the image data size to store the implementation of the BufferedVectorImage.
+ *
+ * @see See ui_drawing.h
+ */
+void BVI_VGLITE_adjust_new_image_characteristics(uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) ;
+
+/*
+ * @brief Initializes the BufferedVectorImage.
+ *
+ * @see See ui_drawing.h
+ */
+void BVI_VGLITE_initialize_new_image(MICROUI_Image* image);
+
+/*
+ * @brief Closes the BufferedVectorImage's resources.
+ *
+ * @see See ui_drawing.h
+ */
+void BVI_VGLITE_free_resources(MICROUI_Image* image);
+
+/*
+ * @brief Adds an operation "draw path with a color" in the BufferedVectorImage.
+ *
+ * @param[in] target: the BufferedVectorImage.
+ *
+ * @return MicroVG error code
+ *
+ * @see vg_lite_draw()
+ */
+jint BVI_VGLITE_add_draw_path(
+ void* target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color);
+
+/*
+ * @brief Adds an operation "draw path with a gradient" in the BufferedVectorImage.
+ *
+ * @param[in] target: the BufferedVectorImage.
+ *
+ * @return MicroVG error code
+ *
+ * @see vg_lite_draw_gradient()
+ */
+jint BVI_VGLITE_add_draw_gradient(
+ void* target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_linear_gradient_t * grad,
+ vg_lite_blend_t blend) ;
+
+/*
+ * @brief Adds an operation "draw VG image" in the BufferedVectorImage. If the image
+ * is a BufferedVectorImage, the all its operations are copied into the destination.
+ * If the image is an image in flash, an operation that points on the image is added.
+ *
+ * @param[in] target: the BufferedVectorImage.
+ *
+ * @return MicroVG error code
+ *
+ * @see vg_drawing.h
+ */
+jint BVI_VGLITE_add_draw_image(
+ void* target,
+ void* image,
+ jfloat* drawing_matrix,
+ jint alpha,
+ jlong elapsed,
+ const float color_matrix[]);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+#ifdef __cplusplus
+}
+#endif
+#endif // !defined BVI_VGLITE_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_configuration.h b/bsp/projects/microej/vg/inc/microvg_configuration.h
similarity index 81%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_configuration.h
rename to bsp/projects/microej/vg/inc/microvg_configuration.h
index a9c59b7..646848f 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_configuration.h
+++ b/bsp/projects/microej/vg/inc/microvg_configuration.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -10,7 +10,6 @@
* @brief MicroEJ MicroVG library low level API: enable some features according to
* the hardware capacities.
* @author MicroEJ Developer Team
-* @version 1.0.0
*/
#if !defined MICROVG_CONFIGURATION_H
@@ -30,7 +29,7 @@ extern "C" {
* This value must not be changed by the user of the CCO.
* This value must be incremented by the implementor of the CCO when a configuration define is added, deleted or modified.
*/
-#define MICROVG_CONFIGURATION_VERSION (1)
+#define MICROVG_CONFIGURATION_VERSION (2)
// -----------------------------------------------------------------------------
// MicroVG's LinearGradient Options
@@ -182,6 +181,36 @@ extern "C" {
#define VG_FEATURE_FONT_COMPLEX_LAYOUT_HEAP_SIZE ( 80 * 1024 )
#endif
+/*
+ * @brief Set this define to enable the support of MicroVG BufferedVectorImage.
+ * This feature requires the available number of supported GraphicsContext formats
+ * is higher than 1.
+ *
+ * Comment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to remove the support of
+ * BufferedVectorImage (even if the available number of supported GraphicsContext
+ * formats is higher than 1).
+ */
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Comment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to remove the support
+ * of BufferedVectorImage (even if the available number of supported GraphicsContext
+ * formats is higher than 1).
+ */
+#define VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+/*
+ * @brief The drawing functions to target the BufferedVectorImage have by default the
+ * identifier 1.
+ */
+#ifndef UI_DRAWING_IDENTIFIER_BVI_FORMAT
+#define UI_DRAWING_IDENTIFIER_BVI_FORMAT 1
+#endif
+
+#elif defined(VG_FEATURE_BUFFERED_VECTOR_IMAGE)
+#error "The BufferedVectorImage feature requires the support of several Graphics Context formats".
+#endif
+
// -----------------------------------------------------------------------------
// EOF
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_font_freetype.h b/bsp/projects/microej/vg/inc/microvg_font_freetype.h
similarity index 92%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_font_freetype.h
rename to bsp/projects/microej/vg/inc/microvg_font_freetype.h
index d16b3e7..36d25c2 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_font_freetype.h
+++ b/bsp/projects/microej/vg/inc/microvg_font_freetype.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief MicroEJ MicroVG library low level API: implementation over FreeType.
* @author MicroEJ Developer Team
-* @version 2.0.0
+* @version 5.0.0
*/
#if !defined MICROVG_FONT_FREETYPE_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_gradient.h b/bsp/projects/microej/vg/inc/microvg_gradient.h
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_gradient.h
rename to bsp/projects/microej/vg/inc/microvg_gradient.h
index d51b698..69570e0 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_gradient.h
+++ b/bsp/projects/microej/vg/inc/microvg_gradient.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief MicroEJ MicroVG library low level API: implementation of LinearGradient.
* @author MicroEJ Developer Team
- * @version 2.0.0
+ * @version 5.0.0
*/
#if !defined MICROVG_GRADIENT_H
@@ -37,13 +37,12 @@ extern "C" {
// Structs
// -----------------------------------------------------------------------------
+#if (VG_FEATURE_GRADIENT == VG_FEATURE_GRADIENT_FULL)
+
/*
* @brief Map a jint array that represents a linear gradient
*/
-typedef struct MICROVG_GRADIENT_HEADER
-{
-
-#if (VG_FEATURE_GRADIENT == VG_FEATURE_GRADIENT_FULL)
+typedef struct {
jint count; // number of colors and positions
jfloat x;
jfloat y;
@@ -51,13 +50,8 @@ typedef struct MICROVG_GRADIENT_HEADER
jfloat length;
jint colors_offset;
jint positions_offset;
-#else
- jint color; // only one color
-#endif
} MICROVG_GRADIENT_HEADER_t;
-#if (VG_FEATURE_GRADIENT == VG_FEATURE_GRADIENT_FULL)
-
// -----------------------------------------------------------------------------
// Specific gradient formatting functions [mandatory]
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_helper.h b/bsp/projects/microej/vg/inc/microvg_helper.h
similarity index 84%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_helper.h
rename to bsp/projects/microej/vg/inc/microvg_helper.h
index 70b0412..383b059 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_helper.h
+++ b/bsp/projects/microej/vg/inc/microvg_helper.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -10,7 +10,7 @@
* @brief MicroEJ MicroVG library low level API: helper to implement library natives
* methods.
* @author MicroEJ Developer Team
-* @version 2.0.0
+* @version 5.0.0
*/
#if !defined MICROVG_HELPER_H
@@ -86,7 +86,16 @@ extern "C" {
void MICROVG_HELPER_initialize(void);
/**
- * @brief Gets the next UTF character from a text buffer.
+ * @brief Gets the UTF character from a text buffer at the given offset and updates
+ * the offset to point to the next character.
+ *
+ * Some characters have some special values; they are made up of two Unicode characters
+ * in two specific ranges such that the first Unicode character is in one range (for
+ * example 0xD800-0xD8FF) and the second Unicode character is in the second range (for
+ * example 0xDC00-0xDCFF). This is called a surrogate pair.
+ *
+ * If a surrogate pair is incomplete (missing second character), this function returns
+ * "0" (error) and does not update the offset.
*
* @param[in] text: text buffer encoded in UTF16 where to read UTF character.
* @param[in] length: lenght of the text buffer.
@@ -97,7 +106,6 @@ void MICROVG_HELPER_initialize(void);
*/
int MICROVG_HELPER_get_utf(unsigned short *text, int length, int *offset);
-
/*
* @brief Configures the font layouter with a font and a text
*
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_path.h b/bsp/projects/microej/vg/inc/microvg_path.h
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_path.h
rename to bsp/projects/microej/vg/inc/microvg_path.h
index 387ae7e..b69d895 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/inc/microvg_path.h
+++ b/bsp/projects/microej/vg/inc/microvg_path.h
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief MicroEJ MicroVG library low level API: implementation of Path.
* @author MicroEJ Developer Team
-* @version 2.0.0
+* @version 5.0.0
*/
#if !defined MICROVG_PATH_H
@@ -36,10 +36,8 @@ extern "C" {
/*
* @brief Map a jbyte array that represents a path
*/
-typedef struct MICROVG_PATH_HEADER
-{
- uint16_t data_size; /* data size (without header) */
- uint16_t data_offset;
+typedef struct MICROVG_PATH_HEADER {
+ uint32_t data_size; /* data size (without header) */
uint8_t format;
uint8_t padding1;
uint8_t padding2;
@@ -75,6 +73,13 @@ uint32_t MICROVG_PATH_convert_path_command(jint command);
// Specific path formatting functions [optional]
// -----------------------------------------------------------------------------
+/*
+ * @brief Initializes the path builder.
+ *
+ * The default implementation does nothing.
+ */
+void MICROVG_PATH_initialize(void);
+
/*
* @brief Gets the path's array header size.
*
diff --git a/bsp/projects/microej/vg/inc/microvg_trace.h b/bsp/projects/microej/vg/inc/microvg_trace.h
new file mode 100644
index 0000000..9319bf1
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/microvg_trace.h
@@ -0,0 +1,132 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+
+#if !defined MICROVG_TRACE_H
+#define MICROVG_TRACE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Provides the logs of the CCO MicroVG.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "LLTRACE_impl.h"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Available number of events: IMAGE, FONT and DRAWING
+ */
+#define LOG_MICROVG_EVENTS 3
+
+/*
+ * Events identifiers
+ */
+#define LOG_MICROVG_IMAGE_ID 0
+#define LOG_MICROVG_FONT_ID 1
+#define LOG_MICROVG_DRAWING_ID 2
+
+/*
+ * @brief Types of Image events
+ */
+#define LOG_MICROVG_IMAGE_load 0
+#define LOG_MICROVG_IMAGE_create 1
+#define LOG_MICROVG_IMAGE_close 2
+
+/*
+ * @brief Types of Font events
+ */
+#define LOG_MICROVG_FONT_load 0
+#define LOG_MICROVG_FONT_baseline 1
+#define LOG_MICROVG_FONT_height 2
+#define LOG_MICROVG_FONT_stringWidth 3
+#define LOG_MICROVG_FONT_stringHeight 4
+
+/*
+ * @brief Types of Drawing events
+ */
+#define LOG_MICROVG_DRAW_path 0
+#define LOG_MICROVG_DRAW_pathGradient 1
+#define LOG_MICROVG_DRAW_string 2
+#define LOG_MICROVG_DRAW_stringGradient 3
+#define LOG_MICROVG_DRAW_stringOnCircle 4
+#define LOG_MICROVG_DRAW_stringOnCircleGradient 5
+#define LOG_MICROVG_DRAW_image 6
+
+/*
+ * @brief Useful macros to concatenate easily some strings and defines.
+ */
+#define CONCAT_STRINGS(p, s) p ## s
+#define CONCAT_DEFINES(p, s) CONCAT_STRINGS(p,s)
+
+/*
+ * @brief Macro to add an event and its type.
+ */
+#define LOG_MICROVG_START(event, type) LLTRACE_IMPL_record_event_u32(vg_trace_group_id, event, type);
+
+/*
+ * @brief Macro to notify the end of an event and its type.
+ */
+#define LOG_MICROVG_END(event, type) LLTRACE_IMPL_record_event_end_u32(vg_trace_group_id, event, type);
+
+/* The following lines must be added to a SYSVIEW_MicroVG.txt file
+ in the /Description folder
+
+NamedType VGImage 0=LOAD_IMAGE
+NamedType VGImage 1=CREATE_IMAGE
+NamedType VGImage 2=CLOSE_IMAGE
+
+NamedType VGFont 0=LOAD_FONT
+NamedType VGFont 1=FONT_BASELINE
+NamedType VGFont 2=FONT_HEIGHT
+NamedType VGFont 3=STRING_WIDTH
+NamedType VGFont 4=STRING_HEIGHT
+
+NamedType VGDraw 0=DRAW_PATH
+NamedType VGDraw 1=DRAW_PATH_GRADIENT
+NamedType VGDraw 2=DRAW_STRING
+NamedType VGDraw 3=DRAW_STRING_GRADIENT
+NamedType VGDraw 4=DRAW_STRING_ON_CIRCLE
+NamedType VGDraw 5=DRAW_STRING_ON_CIRCLE_GRADIENT
+NamedType VGDraw 6=DRAW_IMAGE
+
+0 VG_ImageEvent (MicroVG) Execute image event %VGImage | (MicroVG) Image event %VGImage done
+1 VG_FontEvent (MicroVG) Execute font event %VGFont | (MicroVG) Font event %VGFont done
+2 VG_DrawingEvent (MicroVG) Execute drawing event %VGDraw | (MicroVG) Drawing event %VGDraw done
+
+ */
+
+// -----------------------------------------------------------------------------
+// Extern symbols
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief External variable that contains the id for each trace group.
+ */
+extern int32_t vg_trace_group_id;
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined MICROVG_TRACE_H
diff --git a/bsp/projects/microej/vg/inc/microvg_vglite_helper.h b/bsp/projects/microej/vg/inc/microvg_vglite_helper.h
new file mode 100644
index 0000000..5576f9e
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/microvg_vglite_helper.h
@@ -0,0 +1,120 @@
+/*
+ * C
+ *
+ * Copyright 2022-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined MICROVG_VGLITE_HELPER_H
+#define MICROVG_VGLITE_HELPER_H
+
+/**
+* @file
+* @brief MicroVG library low level API. Provides helper defines and functions to
+* manipulates the VGLite objects.
+* @author MicroEJ Developer Team
+* @version 7.0.1
+*/
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "vg_lite.h"
+
+/*
+ * @brief Sets the drawing log flags matching a MicroVG error code.
+ *
+ * @see LLUI_DISPLAY_reportError
+ *
+ * @param[in] gc: the graphics context holding the drawing log flags.
+ * @param[in] error: the MicroVG error code.
+ *
+ * @return the drawing status that should be return by the calling drawing function.
+ */
+static inline DRAWING_Status MICROVG_VGLITE_report_error(MICROUI_GraphicsContext* gc, jint error) {
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_LIBRARY_INCIDENT | ((LLVG_OUT_OF_MEMORY == error) ? DRAWING_LOG_OUT_OF_MEMORY : 0));
+ return DRAWING_DONE;
+}
+
+/*
+ * @brief Processes a MicroVG status code and reports the error if needed.
+ *
+ * @see MICROVG_VGLITE_report_error
+ *
+ * @param[in] gc: the graphics context holding the drawing log flags.
+ * @param[in] vg_lite_error: the MicroVG status code.
+ */
+static inline void MICROVG_VGLITE_handle_error(MICROUI_GraphicsContext* gc, jint status) {
+ if (LLVG_SUCCESS != status) {
+ (void) MICROVG_VGLITE_report_error(gc, status);
+ }
+}
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief The vglite matrix can be mapped on a float array
+ */
+#define MAP_VGLITE_MATRIX(h) ((float*)(((vg_lite_matrix_t*)(h))->m))
+
+/*
+ * @brief The vglite gradient matrix can be mapped on a float array
+ */
+#define MAP_VGLITE_GRADIENT_MATRIX(h) MAP_VGLITE_MATRIX(&(((vg_lite_linear_gradient_t*)(h))->matrix))
+
+// -----------------------------------------------------------------------------
+// API
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Converts the MicroVG blend in a VGLite blend.
+ *
+ * @param[in] blend: the drawing's blending
+ *
+ * @return the VGLite blend
+ */
+vg_lite_blend_t MICROVG_VGLITE_HELPER_get_blend(jint blend);
+
+/*
+ * @brief Converts the MicroVG fill rule in a VGLite rule.
+ *
+ * @param[in] blend: the drawing's fill rule
+ *
+ * @return the VGLite fill rule
+ */
+vg_lite_fill_t MICROVG_VGLITE_HELPER_get_fill_rule(jint fill_type);
+
+/*
+ * @brief Converts a MicroVG LinearGradient in a VGLite gradient according to
+ * the drawing parameters. After this call, the gradient is ready to be updated
+ * by calling vg_lite_update_grad()
+ *
+ * @param[in] gradient: the gradient destination (VGLite gradient)
+ * @param[in] gradientData: the gradient source
+ * @param[in] matrix: the gradient source's matrix
+ * @param[in] globalMatrix: the drawing's matrix
+ * @param[in] globalAlpha: the drawing's opacity
+ *
+ * @return a VGLite error code
+ */
+vg_lite_error_t MICROVG_VGLITE_HELPER_to_vg_lite_gradient(vg_lite_linear_gradient_t* gradient, jint* gradientData, jfloat* matrix, jfloat* globalMatrix, jint globalAlpha);
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !defined MICROVG_VGLITE_HELPER_H
diff --git a/bsp/projects/microej/vg/inc/vg_drawing.h b/bsp/projects/microej/vg/inc/vg_drawing.h
new file mode 100644
index 0000000..e5c8b79
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/vg_drawing.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined VG_DRAWING_H
+#define VG_DRAWING_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ * @brief Provides drawing functions called by MicroVG native drawing functions.
+ *
+ * This header file follows strictly the same concept as ui_drawing.h but for MicroVG
+ * library.
+ *
+ * @see ui_drawing.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Gets the image size. The image structure format is VEE Port specific.
+ *
+ * @param[in] image: the image
+ * @param[out] width: the image width
+ * @param[out] height: the image height
+ */
+void VG_DRAWING_get_image_size(void* image, float* width, float* height);
+
+/*
+ * @brief Draws a path filled with the specified color (not the one of the Graphics Context).
+ *
+ * @param[in] gc: the destination
+ * @param[in] path: the path's data
+ * @param[in] x: the destination X coordinate
+ * @param[in] y: the destination Y coordinate
+ * @param[in] matrix: the deformation to apply
+ * @param[in] fillRule: the fill type
+ * @param[in] blend: the blend mode
+ * @param[in] color: the color to apply (with an opacity)
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+
+/*
+ * @brief Draws a path filled with a linear gradient.
+ *
+ * @param[in] gc: the destination
+ * @param[in] path: the path's data
+ * @param[in] x: the destination X coordinate
+ * @param[in] y: the destination Y coordinate
+ * @param[in] matrix: the deformation to apply
+ * @param[in] fillRule: the fill type
+ * @param[in] alpha: the global opacity to apply
+ * @param[in] blend: the blend mode
+ * @param[in] gradient: the gradient to apply
+ * @param[in] gradientMatrix: the gradient deformation, may be null (means identity)
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+
+/*
+ * @brief Draws a string with the color of the Graphics Context.
+ *
+ * The top/left position of the first drawn character is placed at
+ * coordinate x/y.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] text the array of characters to draw.
+ * @param[in] faceHandle the font reference handle.
+ * @param[in] size the height of the font in pixels.
+ * @param[in] x the horizontal coordinate of the top/left of the first drawn character.
+ * @param[in] y the vertical coordinate of the top/left of the first drawn character.
+ * @param[in] matrix: deformation matrix, may be null (means identity)
+ * @param[in] alpha the opacity level to apply to the character.
+ * @param[in] blend the blend mode to use
+ * @param[in] letterSpacing the extra letter spacing to use
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+
+/*
+ * @brief Draws a string with a linear gradient.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] text the array of characters to draw.
+ * @param[in] faceHandle the font reference handle.
+ * @param[in] size the height of the font in pixels.
+ * @param[in] x the horizontal coordinate of the top/left of the first drawn character.
+ * @param[in] y the vertical coordinate of the top/left of the first drawn character.
+ * @param[in] matrix: deformation matrix, may be null (means identity)
+ * @param[in] alpha the opacity level to apply to the character.
+ * @param[in] blend the blend mode to use
+ * @param[in] letterSpacing the extra letter spacing to use
+ * @param[in] gradientData the gradient to apply
+ * @param[in] gradientMatrix the gradient deformation, may be null (means identity)
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Draws a string along a circle, with the color of the Graphics Context.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] text the array of characters to draw.
+ * @param[in] faceHandle the font reference handle.
+ * @param[in] size the height of the font in pixels.
+ * @param[in] x the horizontal coordinate of the top/left of the first drawn character.
+ * @param[in] y the vertical coordinate of the top/left of the first drawn character.
+ * @param[in] matrix: deformation matrix, may be null (means identity)
+ * @param[in] alpha the opacity level to apply to the character.
+ * @param[in] blend the blend mode to use
+ * @param[in] letterSpacing the extra letter spacing to use
+ * @param[in] radius the radius of the circle
+ * @param[in] direction the direction of the text along the circle
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+
+/*
+ * @brief Draws a string along a circle, with a linear gradient.
+ *
+ * @param[in] gc the MicroUI GraphicsContext target.
+ * @param[in] text the array of characters to draw.
+ * @param[in] faceHandle the font reference handle.
+ * @param[in] size the height of the font in pixels.
+ * @param[in] x the horizontal coordinate of the top/left of the first drawn character.
+ * @param[in] y the vertical coordinate of the top/left of the first drawn character.
+ * @param[in] matrix: deformation matrix, may be null (means identity)
+ * @param[in] alpha the opacity level to apply to the character.
+ * @param[in] blend the blend mode to use
+ * @param[in] letterSpacing the extra letter spacing to use
+ * @param[in] radius the radius of the circle
+ * @param[in] direction the direction of the text along the circle
+ * @param[in] gradientData the gradient to apply
+ * @param[in] gradientMatrix the gradient deformation, may be null (means identity)
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Draws an image with transformation and opacity. Optionally apply an animation and / or a color filtering.
+ *
+ * @param[in] gc the graphics context to draw on
+ * @param[in] image the image to draw
+ * @param[in] matrix the transformation matrix to apply
+ * @param[in] alpha the global opacity rendering value
+ * @param[in] elapsedTime the elapsed time since the beginning of the animation, in milliseconds
+ * @param[in] colorMatrix the color matrix used to transform colors, may be null (means no color deformation)
+ * @param[out] errno the error code to return to MicroVG.
+ *
+ * @return the drawing status.
+ */
+DRAWING_Status VG_DRAWING_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno) ;
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // VG_DRAWING_H
diff --git a/bsp/projects/microej/vg/inc/vg_drawing_bvi.h b/bsp/projects/microej/vg/inc/vg_drawing_bvi.h
new file mode 100644
index 0000000..e5a5b99
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/vg_drawing_bvi.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined VG_DRAWING_BVI_H
+#define VG_DRAWING_BVI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of a set of vg_drawing.h drawing functions (library MicroVG).
+ * These are implementations over a BufferedVectorImage and the destination buffer format
+ * is the BufferedVectorImage format. When the drawing cannot be performed for any reason,
+ * the stub implementation is used insted.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ * @see ui_drawing_bvi.h
+ */
+
+#include "microvg_configuration.h"
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include
+
+#include "vg_drawing.h"
+#include "ui_drawing.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Redirects all vg_drawing.h functions to the BufferedVectorImage functions
+ */
+#define VG_DRAWING_BVI_drawPath CONCAT(VG_DRAWING_drawPath_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawGradient CONCAT(VG_DRAWING_drawGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawString CONCAT(VG_DRAWING_drawString_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawStringGradient CONCAT(VG_DRAWING_drawStringGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawStringOnCircle CONCAT(VG_DRAWING_drawStringOnCircle_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawStringOnCircleGradient CONCAT(VG_DRAWING_drawStringOnCircleGradient_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+#define VG_DRAWING_BVI_drawImage CONCAT(VG_DRAWING_drawImage_, UI_DRAWING_IDENTIFIER_BVI_FORMAT)
+
+// --------------------------------------------------------------------------------
+// vg_drawing.h API
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Implementation of drawPath over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+
+/*
+ * @brief Implementation of drawGradient over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+
+/*
+ * @brief Implementation of drawString over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+
+/*
+ * @brief Implementation of drawStringGradient over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Implementation of drawStringOnCircle over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+
+/*
+ * @brief Implementation of drawStringOnCircleGradient over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Implementation of drawImage over a BufferedVectorImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_BVI_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+#ifdef __cplusplus
+}
+#endif
+#endif // VG_DRAWING_BVI_H
diff --git a/bsp/projects/microej/vg/inc/vg_drawing_stub.h b/bsp/projects/microej/vg/inc/vg_drawing_stub.h
new file mode 100644
index 0000000..655802d
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/vg_drawing_stub.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined VG_DRAWING_STUB_H
+#define VG_DRAWING_STUB_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of all drawing functions of vg_drawing.h (library MicroVG).
+ * These are stubbed implementations, there is no error but the drawings are not
+ * performed. Useful to stub a drawing on a custom destination (custom GraphicsContext
+ * format not supported by the Graphics Engine).
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ * @see ui_drawing_stub.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "vg_drawing.h"
+
+// --------------------------------------------------------------------------------
+// Public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Stubbed implementation of drawPath. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+
+/*
+ * @brief Stubbed implementation of drawGradient. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+
+/*
+ * @brief Stubbed implementation of drawString. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+
+/*
+ * @brief Stubbed implementation of drawStringGradient. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Stubbed implementation of drawStringOnCircle. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+
+/*
+ * @brief Stubbed implementation of drawStringOnCircleGradient. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Stubbed implementation of drawImage. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_STUB_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // VG_DRAWING_STUB_H
diff --git a/bsp/projects/microej/vg/inc/vg_drawing_vglite.h b/bsp/projects/microej/vg/inc/vg_drawing_vglite.h
new file mode 100644
index 0000000..0aaf419
--- /dev/null
+++ b/bsp/projects/microej/vg/inc/vg_drawing_vglite.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+#if !defined VG_DRAWING_VGLITE_H
+#define VG_DRAWING_VGLITE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @file
+ * @brief Implementation of a set of vg_drawing.h drawing functions (library MicroVG).
+ * These are implementations over VGLite and the destination buffer format is the
+ * format specified in the VEE port. When the drawing cannot be performed by the GPU,
+ * the software implementation is used insted.
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ * @see ui_drawing_vglite.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "vg_drawing.h"
+#include "microvg_path.h"
+
+#include "vg_lite.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+#if !defined VG_FEATURE_FONT || (VG_FEATURE_FONT != VG_FEATURE_FONT_FREETYPE_VECTOR)
+#error "This drawer requires Freetype".
+#endif
+
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The fonction VG_DRAWING_VGLITE_xxx() are directly called by LLVG_PAINTER_impl.c
+ * This file overrides each function independently to use the VGLite GPU.
+ */
+
+#define VG_DRAWING_VGLITE_drawPath VG_DRAWING_drawPath
+#define VG_DRAWING_VGLITE_drawGradient VG_DRAWING_drawGradient
+#define VG_DRAWING_VGLITE_drawString VG_DRAWING_drawString
+#define VG_DRAWING_VGLITE_drawStringGradient VG_DRAWING_drawStringGradient
+#define VG_DRAWING_VGLITE_drawStringOnCircle VG_DRAWING_drawStringOnCircle
+#define VG_DRAWING_VGLITE_drawStringOnCircleGradient VG_DRAWING_drawStringOnCircleGradient
+#define VG_DRAWING_VGLITE_drawImage VG_DRAWING_drawImage
+
+#else // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions VG_DRAWING_VGLITE_xxx() are indirectly called through some tables.
+ * The functions have got the identifier "0" as suffix. This file overrides each
+ * function independently to use the VGLite GPU.
+ */
+
+#define VG_DRAWING_VGLITE_drawPath VG_DRAWING_drawPath_0
+#define VG_DRAWING_VGLITE_drawGradient VG_DRAWING_drawGradient_0
+#define VG_DRAWING_VGLITE_drawString VG_DRAWING_drawString_0
+#define VG_DRAWING_VGLITE_drawStringGradient VG_DRAWING_drawStringGradient_0
+#define VG_DRAWING_VGLITE_drawStringOnCircle VG_DRAWING_drawStringOnCircle_0
+#define VG_DRAWING_VGLITE_drawStringOnCircleGradient VG_DRAWING_drawStringOnCircleGradient_0
+#define VG_DRAWING_VGLITE_drawImage VG_DRAWING_drawImage_0
+
+#endif // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+// --------------------------------------------------------------------------------
+// Typedef
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Function to draw a character element: a glyph. A glyph is a vectorial path
+ * and the function parameters are similar to vg_lite_draw() and vg_lite_draw_gradient().
+ *
+ * @param[in] color the color to apply if gradient is NULL
+ * @param[in] gradient the gradient to apply or NULL
+ *
+ * @see vg_lite_draw()
+ * @see vg_lite_draw_gradient()
+ *
+ * @return: the MicroVG error code
+ */
+typedef jint (* VG_DRAWING_VGLITE_draw_glyph_t) (
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color,
+ vg_lite_linear_gradient_t* grad);
+
+/*
+ * @brief Function to draw an image element. An image element is a vectorial path
+ * and the function parameters are similar to vg_lite_draw() and vg_lite_draw_gradient().
+ *
+ * @param[in] color the color to apply if gradient is NULL
+ * @param[in] gradient the gradient to apply or NULL
+ * @param[in] is_new_gradient is true when the given gradient is different than the one
+ * of the previous call (with a non-null gradient).
+ *
+ * @see vg_lite_draw()
+ *
+ * @return: the MicroVG error code
+ */
+typedef jint (* VG_DRAWING_VGLITE_draw_image_element_t) (
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color,
+ vg_lite_linear_gradient_t* grad,
+ bool is_new_gradient);
+
+// --------------------------------------------------------------------------------
+// Public API
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Converts a MicroVG matrix in a VGLite matrix applying a translation.
+ *
+ * @param[out] vg_lite_matrix the VGLite matrix to set
+ * @param[in] x the X translation to apply
+ * @param[in] y the Y translation to apply
+ * @param[in] matrix the MicroVG transformation to apply
+ */
+void VG_DRAWING_VGLITE_prepare_matrix(vg_lite_matrix_t* vg_lite_matrix, jfloat x, jfloat y, jfloat* matrix) ;
+
+/*
+ * @brief Converts a MicroVG LinearGradient in a VGLite gradient according to
+ * the drawing parameters. After this call, the gradient is ready to be updated
+ * by calling vg_lite_update_grad().
+ *
+ * This function is similar to MICROVG_VGLITE_HELPER_to_vg_lite_gradient() but
+ * the gradientMatrix may be NULL (identity matrix is used instead).
+ *
+ * @see MICROVG_VGLITE_HELPER_to_vg_lite_gradient()
+ */
+vg_lite_error_t VG_DRAWING_VGLITE_prepare_gradient(vg_lite_linear_gradient_t* vg_lite_gradient, jint* gradientData, jfloat* gradientMatrix, vg_lite_matrix_t* vg_lite_matrix, int alpha) ;
+
+/*
+ * @brief Clears the VGLite gradient data: vg_lite_init_grad() allocates a buffer
+ * in VGLite buffer, this function frees it.
+ *
+ * @param[in] gradient the VGLite gradient to clear
+ */
+void VG_DRAWING_VGLITE_clear_gradient(vg_lite_linear_gradient_t* gradient) ;
+
+/*
+ * @brief Converts a MicroVG path in a VGLite path. The same VGLite path is returned, by
+ * consequence only one path can be converted at any time.
+ *
+ * @param[in] path the MicroVG path to convert
+ *
+ * @return the VGLite path
+ */
+vg_lite_path_t* VG_DRAWING_VGLITE_to_vglite_path(MICROVG_PATH_HEADER_t* path);
+
+/*
+ * @brief Generic function to prepare the drawing of a string along a line or a circle,
+ * with a color or a linear gradient. The implementation does not draw, it calls the
+ * drawer function for each glyph.
+ *
+ * @param[in] drawer the function to draw a glyph.
+ * @param[in] text the array of characters to draw.
+ * @param[in] faceHandle the font reference handle.
+ * @param[in] size the height of the font in pixels.
+ * @param[in] vgGlobalMatrix: deformation matrix
+ * @param[in] blend the blend mode to use
+ * @param[in] color the color to apply if gradient is NULL
+ * @param[in] gradient the gradient to apply or NULL
+ * @param[in] letterSpacing the extra letter spacing to use
+ * @param[in] radius the radius of the circle (0 to draw along a line)
+ * @param[in] direction the direction of the text along the circle (0 to draw along a line)
+ * @param[out] rendered true if something has been drawn
+ *
+ * @return LLVG_SUCCESS if something has been drawn, an different value otherwise
+ */
+jint VG_DRAWING_VGLITE_draw_string(VG_DRAWING_VGLITE_draw_glyph_t drawer, jchar* text, jint faceHandle, jfloat size, vg_lite_matrix_t* vgGlobalMatrix, vg_lite_blend_t blend, int color, vg_lite_linear_gradient_t *gradient, jfloat letterSpacing, jfloat radius, jint direction, bool* rendered);
+
+/*
+ * @brief Generic function to prepare the drawing of an image. The implementation does
+ * not draw, it calls the drawer function for each image element.
+ *
+ * @param[in] drawer the function to draw an image element.
+ * @param[in] image the destination.
+ * @param[in] matrix the transformation matrix to apply
+ * @param[in] alpha the global opacity rendering value
+ * @param[in] elapsedTime the elapsed time since the beginning of the animation, in milliseconds
+ * @param[in] colorMatrix the color matrix used to transform colors, may be null (means no color deformation)
+ * @param[out] rendered true if something has been drawn
+ *
+ * @return LLVG_SUCCESS on a success, a different value otherwise
+ */
+jint VG_DRAWING_VGLITE_draw_image(VG_DRAWING_VGLITE_draw_image_element_t drawer, void* image, jfloat* drawing_matrix, jint alpha, jlong elapsed, const float color_matrix[], bool* rendered);
+
+// --------------------------------------------------------------------------------
+// vg_drawing.h API
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+/*
+ * @brief Implementation of drawPath over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+
+/*
+ * @brief Implementation of drawGradient over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+
+/*
+ * @brief Implementation of drawString over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+
+/*
+ * @brief Implementation of drawStringGradient over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Implementation of drawStringOnCircle over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+
+/*
+ * @brief Implementation of drawStringOnCircleGradient over VGLite. See vg_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+
+/*
+ * @brief Implementation of drawImage over VGLite. See ui_drawing.h
+ */
+DRAWING_Status VG_DRAWING_VGLITE_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+#endif // VG_DRAWING_VGLITE_H
diff --git a/bsp/projects/microej/vg/src/LLVG_BVI_stub.c b/bsp/projects/microej/vg/src/LLVG_BVI_stub.c
new file mode 100644
index 0000000..7bab108
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_BVI_stub.c
@@ -0,0 +1,47 @@
+/*
+ * C
+ *
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroVG library low level API: stubbed implementation of LLVG_BVI_impl.h.
+ *
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+#include "microvg_configuration.h"
+
+#ifndef VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+// -----------------------------------------------------------------------------
+// LLVG_BVI_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void LLVG_BVI_IMPL_map_context(MICROUI_Image* ui, void* vg) {
+ (void)ui;
+ (void)vg;
+ // nothing to do
+}
+
+// See the header file for the function documentation
+void LLVG_BVI_IMPL_clear(MICROUI_GraphicsContext* gc) {
+ (void)gc;
+ // nothing to do
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // VG_FEATURE_BUFFERED_VECTOR_IMAGE
diff --git a/bsp/projects/microej/vg/src/LLVG_FONT_PAINTER_freetype_vglite.c b/bsp/projects/microej/vg/src/LLVG_FONT_PAINTER_freetype_vglite.c
new file mode 100644
index 0000000..838e27e
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_FONT_PAINTER_freetype_vglite.c
@@ -0,0 +1,316 @@
+/*
+ * C
+ *
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+* @file
+* @brief MicroEJ MicroVG library low level API: implementation over Freetype and VGLite.
+* @author MicroEJ Developer Team
+* @version 7.0.1
+*/
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "microvg_configuration.h"
+
+#if defined VG_FEATURE_FONT && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_VECTOR)
+
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "microvg_helper.h"
+#include "microvg_font_freetype.h"
+#include "microvg_vglite_helper.h"
+#include "vg_lite.h"
+#include "ftvector/ftvector.h"
+#include "vg_drawing_vglite.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+#define FT_COLOR_TO_INT(x) (*((int*) &(x)))
+#define INT_TO_FT_COLOR(x) (*((FT_Color*) &(x)))
+
+#define DIRECTION_CLOCK_WISE 0
+
+// -----------------------------------------------------------------------------
+// Extern Variables
+// -----------------------------------------------------------------------------
+
+extern FT_Library library;
+extern FT_Renderer renderer;
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+static FT_Color *palette;
+
+// -----------------------------------------------------------------------------
+// Internal function definitions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Computes the scale to apply to the font.
+ *
+ * @param[in] size: the font size
+ * @param[in] face: the face of the font
+ */
+static inline float __get_scale(jfloat size, FT_Face face);
+
+/*
+ * @brief Sets renderer parameters.
+ *
+ * @param[in] gc: the graphic context
+ * @param[in] matrix: the transformation matrix
+ * @param[in] alpha: the opacity of the string (from 0 to 255)
+ * @param[in] gradient: the gradient to apply
+ */
+static void __set_renderer(VG_DRAWING_VGLITE_draw_glyph_t drawer, vg_lite_matrix_t* matrix, int color, vg_lite_linear_gradient_t* gradient, vg_lite_blend_t blend);
+
+/*
+ * @brief Sets renderer color parameter.
+ *
+ * @param[in] color: the color to use to render the glyph
+ */
+static void __set_color(int color);
+
+/*
+ * @brief Updates the angle to use for the next glyph when drawn on an arc.
+ * When drawing on an arc, the glyph position is defined by its angle. We thus
+ * convert the advance (distance to the next glyph) to an angle.
+ */
+static float __get_angle(float advance, float radius);
+
+/**
+ * @brief load and render the selected glyph. If the glyph is a multilayer glyph,
+ * this function will retrieve the different layers glyphs with theirs colors and
+ * update the renderer to draw the glyph with the correct color.
+ *
+ * @param[in] face: the face of the font.
+ * @param[in] glyph: the glyph index.
+ * @param[in] glyph: the original color of the string index.
+ * @param[in,out] matrix: the transformation matrix.
+ *
+ * @return FT_ERR( Ok ) on a success, a different value otherwise.
+ */
+static FT_Error __render_glyph(FT_Face face, FT_UInt glyph_index, FT_Color color);
+
+// -----------------------------------------------------------------------------
+// Internal functions
+// -----------------------------------------------------------------------------
+
+static inline float __get_scale(jfloat size, FT_Face face){
+ return size / face->units_per_EM;
+}
+
+static void __set_renderer(VG_DRAWING_VGLITE_draw_glyph_t drawer, vg_lite_matrix_t* matrix, int color, vg_lite_linear_gradient_t* gradient, vg_lite_blend_t blend){
+ FT_Parameter vglite_params[5];
+
+ vglite_params[0].tag = FT_PARAM_TAG_VGLITE_DESTINATION;
+ // cppcheck-suppress [misra-c2012-11.1] pointer conversion to store the drawer
+ vglite_params[0].data = (void *) drawer;
+
+ vglite_params[1].tag = FT_PARAM_TAG_VGLITE_MATRIX;
+ vglite_params[1].data = matrix;
+
+ vglite_params[2].tag = FT_PARAM_TAG_VGLITE_BLEND;
+ vglite_params[2].data = (void *) blend;
+
+ vglite_params[3].tag = FT_PARAM_TAG_VGLITE_COLOR;
+ // cppcheck-suppress [misra-c2012-11.6] pointer conversion to store the color
+ vglite_params[3].data = (void *) color;
+
+ vglite_params[4].tag = FT_PARAM_TAG_VGLITE_GRADIENT;
+ vglite_params[4].data = (void *) gradient;
+
+ FT_Set_Renderer(library, renderer, 5, &vglite_params[0]);
+}
+
+static void __set_color(int color) {
+
+ FT_Renderer renderer = FT_Get_Renderer(library, FT_GLYPH_FORMAT_OUTLINE);
+ FT_Renderer_SetModeFunc set_mode = renderer->clazz->set_mode;
+
+ // cppcheck-suppress [misra-c2012-11.6] pointer conversion to pass color
+ set_mode(renderer, FT_PARAM_TAG_VGLITE_COLOR, (void *)color);
+}
+
+static float __get_angle(float advance, float radius){
+ return (advance/radius) * 180.0f / M_PI;
+}
+
+static FT_Error __render_glyph(FT_Face face, FT_UInt glyph_index, FT_Color color) {
+ FT_LayerIterator iterator;
+
+ FT_Bool have_layers;
+ FT_UInt layer_glyph_index;
+ FT_UInt layer_color_index;
+
+ FT_Error error = FT_ERR( Ok );
+ bool color_updated = false;
+
+ iterator.p = NULL;
+ have_layers = FT_Get_Color_Glyph_Layer(face, glyph_index,
+ &layer_glyph_index, &layer_color_index, &iterator);
+
+ do {
+ if (palette && have_layers) {
+ // Update renderer color with layer_color
+ if (layer_color_index == 0xFFFF){
+ __set_color(FT_COLOR_TO_INT(color));
+ }
+ else {
+ __set_color(FT_COLOR_TO_INT(palette[layer_color_index]));
+ color_updated = true;
+ }
+ }
+ else {
+ // Use main glyph_index as layer_glyph_index
+ layer_glyph_index = glyph_index;
+ }
+
+ if(layer_glyph_index != glyph_index){
+ error = FT_Load_Glyph(face, layer_glyph_index, FT_LOAD_NO_SCALE);
+ }
+
+ if (FT_ERR( Ok ) == error) {
+ // convert to an anti-aliased bitmap
+ error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
+ }
+ else {
+ MEJ_LOG_ERROR_MICROVG("Error while loading glyphid %d: 0x%x, refer to fterrdef.h\n",layer_glyph_index, error);
+ }
+ }
+ while ((layer_glyph_index != glyph_index) && (FT_ERR( Ok ) == error) && (FT_ERR( Ok ) != FT_Get_Color_Glyph_Layer(face, glyph_index,
+ &layer_glyph_index, &layer_color_index, &iterator)));
+
+ if ((FT_ERR( Ok ) == error) && color_updated) {
+ // Revert renderer color to original color in case it has been modified.
+ __set_color(FT_COLOR_TO_INT(color));
+ }
+
+ return error;
+}
+
+// -----------------------------------------------------------------------------
+// vg_drawing_vglite.h painter functions
+// -----------------------------------------------------------------------------
+
+jint VG_DRAWING_VGLITE_draw_string(VG_DRAWING_VGLITE_draw_glyph_t drawer, jchar* text, jint faceHandle, jfloat size, vg_lite_matrix_t* vgGlobalMatrix, vg_lite_blend_t blend, int color, vg_lite_linear_gradient_t *gradient, jfloat letterSpacing, jfloat radius, jint direction, bool* rendered){
+ FT_Face face = (FT_Face) faceHandle;
+ jint result = LLVG_SUCCESS;
+ *rendered = false;
+
+ // Select palette
+ if (0 != FT_Palette_Select(face, 0, &palette)){
+ palette = NULL;
+ }
+
+ float scale = __get_scale(size, face);
+ float letterSpacingScaled = letterSpacing / scale;
+ float radiusScaled = radius / scale;
+
+ // baselineposition
+ short baselineposition = face->ascender;
+
+ jfloat* vgLocalMatrix = MAP_VGLITE_MATRIX(vgGlobalMatrix);
+ LLVG_MATRIX_IMPL_scale(vgLocalMatrix, scale, scale);
+
+ vg_lite_matrix_t localGlyphMatrix;
+ jfloat* vglocalGlyphMatrix = MAP_VGLITE_MATRIX(&localGlyphMatrix);
+
+ __set_renderer(drawer, &localGlyphMatrix, color, gradient, blend);
+
+ // Layout variables
+ int glyph_index ; // current glyph index
+
+ int length = (int)SNI_getArrayLength(text);
+
+ if (0 < length) {
+
+ int glyph_offset_y;
+ int glyph_advance_x;
+ int glyph_advance_y;
+ int glyph_offset_x;
+ int advance_x = 0;
+ int advance_Y = 0;
+ int previous_glyph_index = 0; // previous glyph index for kerning
+
+ MICROVG_HELPER_layout_configure(faceHandle, text, length);
+
+ while((LLVG_SUCCESS == result) && (MICROVG_HELPER_layout_load_glyph(&glyph_index, &glyph_advance_x, &glyph_advance_y, &glyph_offset_x, &glyph_offset_y))) {
+ // At that point the current glyph has been loaded by Freetype
+
+ int charWidth = glyph_advance_x;
+
+ if (0 == previous_glyph_index){
+ // first glyph: remove the first blank line
+ if( 0 == face->glyph->metrics.width) {
+ advance_x -= charWidth;
+ }
+ else {
+ advance_x -= face->glyph->metrics.horiBearingX;
+ }
+ }
+
+ LLVG_MATRIX_IMPL_copy(vglocalGlyphMatrix, vgLocalMatrix);
+
+ if(0.f == radius) {
+ LLVG_MATRIX_IMPL_translate(vglocalGlyphMatrix, advance_x + glyph_offset_x, baselineposition + advance_Y + glyph_offset_y);
+ } else {
+ float sign = (DIRECTION_CLOCK_WISE != direction) ? -1.f : 1.f;
+
+ // Space characters joining bboxes at baseline
+ float angleDegrees = 90 + __get_angle(advance_x + glyph_offset_x, radiusScaled) + __get_angle(charWidth / 2, radiusScaled);
+
+ // Rotate to angle
+ LLVG_MATRIX_IMPL_rotate(vglocalGlyphMatrix, sign * angleDegrees);
+
+ // Translate left to center of bbox
+ // Translate baseline over circle
+ LLVG_MATRIX_IMPL_translate(vglocalGlyphMatrix, -charWidth / 2, -sign * radiusScaled);
+ }
+
+ // Draw the glyph
+ FT_Error error = __render_glyph(face, glyph_index, INT_TO_FT_COLOR(color));
+ if (FT_ERR( Ok ) != error) {
+ MEJ_LOG_ERROR_MICROVG("Error while rendering glyphid %d: 0x%x, refer to fterrdef.h\n",glyph_index, error);
+ result = (FT_ERR( Out_Of_Memory ) == error) ? LLVG_OUT_OF_MEMORY : LLVG_DATA_INVALID;
+ continue;
+ }
+
+ // at least one glyph has been drawn
+ *rendered = true;
+
+ // Compute advance to next glyph
+ advance_x += charWidth;
+ advance_x += (int)letterSpacingScaled;
+
+ advance_Y += glyph_advance_y;
+
+ previous_glyph_index = glyph_index;
+ }
+ }
+
+ return result;
+}
+
+#endif // defined VG_FEATURE_FONT && (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_VECTOR)
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_FONT_freetype.c b/bsp/projects/microej/vg/src/LLVG_FONT_freetype.c
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_FONT_freetype.c
rename to bsp/projects/microej/vg/src/LLVG_FONT_freetype.c
index 855b32f..e935f0d 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_FONT_freetype.c
+++ b/bsp/projects/microej/vg/src/LLVG_FONT_freetype.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -9,7 +9,7 @@
* @file
* @brief MicroEJ MicroVG library low level API: implementation over FreeType
* @author MicroEJ Developer Team
- * @version 2.0.0
+ * @version 5.0.0
*/
#include "microvg_configuration.h"
@@ -23,7 +23,7 @@
// -----------------------------------------------------------------------------
#include
-
+#include
#include
#include
@@ -36,6 +36,7 @@
#include "microvg_font_freetype.h"
#include "microvg_helper.h"
+#include "microvg_trace.h"
#include "mej_math.h"
// -----------------------------------------------------------------------------
@@ -47,6 +48,13 @@
*/
#define GET_SCALE(s,f) ((s) / (f)->units_per_EM)
+
+/*
+ * @brief Macro to add a FONT event and its type.
+ */
+#define LOG_MICROVG_FONT_START(fn) LOG_MICROVG_START(LOG_MICROVG_FONT_ID, CONCAT_DEFINES(LOG_MICROVG_FONT_, fn))
+#define LOG_MICROVG_FONT_END(fn) LOG_MICROVG_END(LOG_MICROVG_FONT_ID, CONCAT_DEFINES(LOG_MICROVG_FONT_, fn))
+
// -----------------------------------------------------------------------------
// Types
// -----------------------------------------------------------------------------
@@ -103,8 +111,14 @@ static FT_Error __load_memory_font(FT_Face* face, void* data, int length);
*/
static FT_Error __load_internal_font(FT_Face* face, jchar* font_name);
+/*
+ * @brief Gets the description of the given native resource: a vector font.
+ * @see SNI_getDescriptionFunction
+ */
+static void __register_font_description(void* resource, char* buffer, uint32_t bufferLength);
#if defined (VG_FEATURE_FONT_EXTERNAL)
+
/*
* @brief Opens a font that has not been compiled with the application.
*
@@ -117,8 +131,6 @@ static FT_Error __load_internal_font(FT_Face* face, jchar* font_name);
*/
static FT_Error __load_external_font(FT_Face* face, jchar* font_name);
-
-
/*
* @brief Reads a chunk from an external resource.
*
@@ -187,6 +199,8 @@ void MICROVG_FONT_FREETYPE_initialize(void) {
// See the header file for the function documentation
jint LLVG_FONT_IMPL_load_font(jchar* font_name, jboolean complex_layout) {
+ LOG_MICROVG_FONT_START(load);
+
FT_Face face = 0;
jint ret = LLVG_FONT_UNLOADED;
@@ -210,7 +224,7 @@ jint LLVG_FONT_IMPL_load_font(jchar* font_name, jboolean complex_layout) {
FT_Select_Charmap(face , ft_encoding_unicode);
MEJ_LOG_INFO_MICROVG("Freetype font loaded: %s\n", (const char*)font_name);
- SNI_registerResource((void*)face, (SNI_closeFunction)&_dispose_registered_font, JNULL);
+ SNI_registerResource((void*)face, (SNI_closeFunction)&_dispose_registered_font, &__register_font_description);
#if defined (VG_FEATURE_FONT_COMPLEX_LAYOUT)
if(JTRUE == complex_layout){
@@ -228,12 +242,15 @@ jint LLVG_FONT_IMPL_load_font(jchar* font_name, jboolean complex_layout) {
}
}
+
+ LOG_MICROVG_FONT_END(load);
return ret;
}
// See the header file for the function documentation
jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jfloat letterSpacing) {
+ LOG_MICROVG_FONT_START(stringWidth);
jfloat ret;
if (LLVG_FONT_UNLOADED == faceHandle) {
@@ -255,7 +272,8 @@ jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jf
int previous_glyph_index = 0; // previous glyph index for kerning
int advance_x;
- int previous_advance_x;
+ int previous_advance_x = 0;
+ int previous_offset_x = 0;
int advance_y;
int offset_x;
int offset_y;
@@ -263,7 +281,7 @@ jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jf
int length = (int)SNI_getArrayLength(text);
MICROVG_HELPER_layout_configure(faceHandle, text, length);
- while(0 != MICROVG_HELPER_layout_load_glyph(&glyph_index, &advance_x, &advance_y, &offset_x, &offset_y)) {
+ while(MICROVG_HELPER_layout_load_glyph(&glyph_index, &advance_x, &advance_y, &offset_x, &offset_y)) {
// At that point the current glyph has been loaded by Freetype
if (0 == previous_glyph_index){
// first glyph: remove the first blank line
@@ -278,8 +296,10 @@ jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jf
unscaled_width += advance_x;
previous_glyph_index = glyph_index;
nb_chars ++;
- // Last call to MICROVG_HELPER_layout_load_glyph clear advance_x, we need to keep.
+ // Last call to MICROVG_HELPER_layout_load_glyph clear advance_x and offset_x.
+ // We need to keep them for last glyph measurement
previous_advance_x = advance_x;
+ previous_offset_x = offset_x;
}
// last glyph: remove the last blank line
@@ -287,6 +307,7 @@ jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jf
unscaled_width -= previous_advance_x;
unscaled_width += face->glyph->metrics.horiBearingX; // glyph's left blank line
unscaled_width += face->glyph->metrics.width; // glyph's width
+ unscaled_width += previous_offset_x; // glyph's offset_x
}
else {
if(0 != unscaled_width){
@@ -299,12 +320,14 @@ jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jf
ret = scaled_width;
}
+ LOG_MICROVG_FONT_END(stringWidth);
return ret;
}
// See the header file for the function documentation
jfloat LLVG_FONT_IMPL_string_height(jchar* text, jint faceHandle, jfloat size) {
+ LOG_MICROVG_FONT_START(stringHeight);
jfloat ret;
if (LLVG_FONT_UNLOADED == faceHandle) {
@@ -333,7 +356,7 @@ jfloat LLVG_FONT_IMPL_string_height(jchar* text, jint faceHandle, jfloat size) {
int length = (int)SNI_getArrayLength(text);
MICROVG_HELPER_layout_configure(faceHandle, text, length);
- while(0 != MICROVG_HELPER_layout_load_glyph(&glyph_index, &advance_x, &advance_y, &offset_x, &offset_y)) {
+ while(MICROVG_HELPER_layout_load_glyph(&glyph_index, &advance_x, &advance_y, &offset_x, &offset_y)) {
// At that point the current glyph has been loaded by Freetype
FT_Pos yBottom = face->glyph->metrics.horiBearingY - face->glyph->metrics.height;
@@ -349,12 +372,14 @@ jfloat LLVG_FONT_IMPL_string_height(jchar* text, jint faceHandle, jfloat size) {
ret = scaled_height;
}
+ LOG_MICROVG_FONT_END(stringHeight);
return ret;
}
// See the header file for the function documentation
jfloat LLVG_FONT_IMPL_get_baseline_position(jint faceHandle, jfloat size) {
+ LOG_MICROVG_FONT_START(baseline);
jfloat ret;
if (LLVG_FONT_UNLOADED == faceHandle) {
@@ -372,12 +397,14 @@ jfloat LLVG_FONT_IMPL_get_baseline_position(jint faceHandle, jfloat size) {
ret = advance_y;
}
+ LOG_MICROVG_FONT_END(baseline);
return ret;
}
// See the header file for the function documentation
jfloat LLVG_FONT_IMPL_get_height(jint faceHandle, jfloat size) {
+ LOG_MICROVG_FONT_START(height);
jfloat ret;
if (LLVG_FONT_UNLOADED == faceHandle) {
@@ -389,6 +416,7 @@ jfloat LLVG_FONT_IMPL_get_height(jint faceHandle, jfloat size) {
ret = face->height * scale;
}
+ LOG_MICROVG_FONT_END(height);
return ret;
}
@@ -413,6 +441,9 @@ bool LLVG_FONT_IMPL_has_complex_layouter(void){
static void _dispose_registered_font(void* faceHandle) {
FT_Face face = (FT_Face) faceHandle;
+ // unregister the resource since the VEE does not need to call it anymore
+ SNI_unregisterResource((void*)face, (SNI_closeFunction)&_dispose_registered_font);
+
#if defined (VG_FEATURE_FONT_EXTERNAL)
// FT_Done_Face() sets the stream to NULL: have to save it to close the
// external resource
@@ -519,6 +550,15 @@ static void __close_external_resource(FT_Stream stream) {
}
#endif // VG_FEATURE_FONT_EXTERNAL
+
+static void __register_font_description(void* resource, char* buffer, uint32_t bufferLength) {
+ (void)resource;
+ const char descEF[] = "Vector Font";
+ if (bufferLength >= sizeof(descEF)) {
+ memcpy(buffer, descEF, sizeof(descEF));
+ }
+}
+
// cppcheck-suppress [misra-c2012-3.2]
#endif // defined VG_FEATURE_FONT && \
// (defined VG_FEATURE_FONT_FREETYPE_VECTOR || defined VG_FEATURE_FONT_FREETYPE_BITMAP) && \
diff --git a/bsp/projects/microej/vg/src/LLVG_FONT_stub.c b/bsp/projects/microej/vg/src/LLVG_FONT_stub.c
new file mode 100644
index 0000000..bff2bc9
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_FONT_stub.c
@@ -0,0 +1,82 @@
+/*
+ * C
+ *
+ * Copyright 2020-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroEJ MicroVG library low level API: implementation over FreeType
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+#include "microvg_configuration.h"
+
+#ifndef VG_FEATURE_FONT
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+// -----------------------------------------------------------------------------
+// LLVG_FONT_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+jint LLVG_FONT_IMPL_load_font(jchar* font_name, jboolean complex_layout) {
+ (void)font_name;
+ (void)complex_layout;
+ return 0;
+}
+
+// See the header file for the function documentation
+jfloat LLVG_FONT_IMPL_string_width(jchar* text, jint faceHandle, jfloat size, jfloat letterSpacing) {
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ (void)letterSpacing;
+ return 0;
+}
+
+// See the header file for the function documentation
+jfloat LLVG_FONT_IMPL_string_height(jchar* text, jint faceHandle, jfloat size) {
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ return 0;
+}
+
+// See the header file for the function documentation
+jfloat LLVG_FONT_IMPL_get_baseline_position(jint faceHandle, jfloat size) {
+ (void)faceHandle;
+ (void)size;
+ return 0;
+}
+
+// See the header file for the function documentation
+jfloat LLVG_FONT_IMPL_get_height(jint faceHandle, jfloat size) {
+ (void)faceHandle;
+ (void)size;
+ return 0;
+}
+
+// See the header file for the function documentation
+void LLVG_FONT_IMPL_dispose(jint faceHandle) {
+ (void)faceHandle;
+}
+
+// See the header file for the function documentation
+bool LLVG_FONT_IMPL_has_complex_layouter(void){
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // VG_FEATURE_FONT
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c b/bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c
rename to bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c
index f783a37..8a8e022 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c
+++ b/bsp/projects/microej/vg/src/LLVG_GRADIENT_impl.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -13,7 +13,7 @@
* positions.
*
* @author MicroEJ Developer Team
- * @version 2.0.0
+ * @version 5.0.0
*/
#include "microvg_configuration.h"
diff --git a/bsp/projects/microej/vg/src/LLVG_MATRIX_impl.c b/bsp/projects/microej/vg/src/LLVG_MATRIX_impl.c
new file mode 100644
index 0000000..3706720
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_MATRIX_impl.c
@@ -0,0 +1,195 @@
+/*
+ * C
+ *
+ * Copyright 2021-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroEJ MicroVG library low level API: basic implementation
+ * of matrix APIs.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include
+
+#include "microvg_helper.h"
+
+// -----------------------------------------------------------------------------
+// LLVG_MATRIX_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_identity(jfloat* matrix) {
+ LLVG_MATRIX_IMPL_setTranslate(matrix, 0, 0);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_copy(jfloat* dest, jfloat* src) {
+ (void)memcpy((void*)dest, (void*)src, sizeof(float) * LLVG_MATRIX_SIZE);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_multiply(jfloat* dest, jfloat* a, jfloat* b) {
+
+ dest[0] = (a[0] * b[0]) + (a[1] * b[3]) + (a[2] * b[6]);
+ dest[1] = (a[0] * b[1]) + (a[1] * b[4]) + (a[2] * b[7]);
+ dest[2] = (a[0] * b[2]) + (a[1] * b[5]) + (a[2] * b[8]);
+
+ dest[3] = (a[3] * b[0]) + (a[4] * b[3]) + (a[5] * b[6]);
+ dest[4] = (a[3] * b[1]) + (a[4] * b[4]) + (a[5] * b[7]);
+ dest[5] = (a[3] * b[2]) + (a[4] * b[5]) + (a[5] * b[8]);
+
+ dest[6] = (a[6] * b[0]) + (a[7] * b[3]) + (a[8] * b[6]);
+ dest[7] = (a[6] * b[1]) + (a[7] * b[4]) + (a[8] * b[7]);
+ dest[8] = (a[6] * b[2]) + (a[7] * b[5]) + (a[8] * b[8]);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_setTranslate(jfloat* matrix, jfloat x, jfloat y) {
+ matrix[0] = 1.0f;
+ matrix[1] = 0.0f;
+ matrix[2] = x;
+ matrix[3] = 0.0f;
+ matrix[4] = 1.0f;
+ matrix[5] = y;
+ matrix[6] = 0.0f;
+ matrix[7] = 0.0f;
+ matrix[8] = 1.0f;
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_setScale(jfloat* matrix, jfloat sx, jfloat sy) {
+ LLVG_MATRIX_IMPL_identity(matrix);
+ LLVG_MATRIX_IMPL_scale(matrix, sx, sy);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_setRotate(jfloat* matrix, jfloat degrees) {
+ LLVG_MATRIX_IMPL_identity(matrix);
+ LLVG_MATRIX_IMPL_rotate(matrix, degrees);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_setConcat(jfloat* dest, jfloat* a, jfloat* b) {
+ if(dest == a) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float temp[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_copy(temp, a);
+ LLVG_MATRIX_IMPL_multiply(dest, temp, b);
+ }
+ else if (dest == b) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float temp[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_copy(temp, b);
+ LLVG_MATRIX_IMPL_multiply(dest, a, temp);
+ }
+ else {
+ LLVG_MATRIX_IMPL_multiply(dest, a, b);
+ }
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_translate(jfloat* matrix, jfloat x, jfloat y) {
+ matrix[2] = (matrix[0] * x) + (matrix[1] * y) + matrix[2];
+ matrix[5] = (matrix[3] * x) + (matrix[4] * y) + matrix[5];
+ matrix[8] = (matrix[6] * x) + (matrix[7] * y) + matrix[8];
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_scale(jfloat* matrix, jfloat scaleX, jfloat scaleY) {
+ matrix[0] *= scaleX;
+ matrix[1] *= scaleY;
+ matrix[3] *= scaleX;
+ matrix[4] *= scaleY;
+ matrix[6] *= scaleX;
+ matrix[7] *= scaleY;
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_rotate(jfloat* matrix, jfloat angleDegrees) {
+
+ float angleRadians = DEG_TO_RAD(angleDegrees);
+
+ // computes cosine and sine values.
+ float cosAngle = cosf(angleRadians);
+ float sinAngle = sinf(angleRadians);
+
+ float tmp;
+
+ tmp = (cosAngle * matrix[0]) + (sinAngle * matrix[1]);
+ matrix[1] = (cosAngle * matrix[1]) - (sinAngle * matrix[0]);
+ matrix[0] = tmp;
+
+ tmp = (cosAngle * matrix[3]) + (sinAngle * matrix[4]);
+ matrix[4] = (cosAngle * matrix[4]) - (sinAngle * matrix[3]);
+ matrix[3] = tmp;
+
+ tmp = (cosAngle * matrix[6]) + (sinAngle * matrix[7]);
+ matrix[7] = (cosAngle * matrix[7]) - (sinAngle * matrix[6]);
+ matrix[6] = tmp;
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_concatenate(jfloat* matrix, jfloat* other) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float temp[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_copy(temp, matrix);
+ LLVG_MATRIX_IMPL_multiply(matrix, temp, other);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_postTranslate(jfloat* matrix, jfloat dx, jfloat dy) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float a[LLVG_MATRIX_SIZE];
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float b[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_setTranslate(a, dx, dy);
+ LLVG_MATRIX_IMPL_copy(b, matrix);
+ LLVG_MATRIX_IMPL_multiply(matrix, a, b);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_postScale(jfloat* matrix, jfloat sx, jfloat sy) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float a[LLVG_MATRIX_SIZE];
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float b[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_identity(a);
+ LLVG_MATRIX_IMPL_scale(a, sx, sy);
+ LLVG_MATRIX_IMPL_copy(b, matrix);
+ LLVG_MATRIX_IMPL_multiply(matrix, a, b);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_postRotate(jfloat* matrix, jfloat degrees) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float a[LLVG_MATRIX_SIZE];
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float b[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_identity(a);
+ LLVG_MATRIX_IMPL_rotate(a, degrees);
+ LLVG_MATRIX_IMPL_copy(b, matrix);
+ LLVG_MATRIX_IMPL_multiply(matrix, a, b);
+}
+
+// See the header file for the function documentation
+void LLVG_MATRIX_IMPL_postConcat(jfloat* matrix, jfloat* other) {
+ // cppcheck-suppress [misra-c2012-18.8] the size is a define
+ float a[LLVG_MATRIX_SIZE];
+ LLVG_MATRIX_IMPL_copy(a, matrix);
+ LLVG_MATRIX_IMPL_multiply(matrix, other, a);
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/vg/src/LLVG_PAINTER_impl.c b/bsp/projects/microej/vg/src/LLVG_PAINTER_impl.c
new file mode 100644
index 0000000..b7222fc
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_PAINTER_impl.c
@@ -0,0 +1,192 @@
+/*
+ * C
+ *
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief This file implements all MicroVG drawing native functions.
+ * @see LLVG_PAINTER_impl.h file comment
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+// implements LLVG_PAINTER_impl functions
+#include
+
+// use graphical engine functions to synchronize drawings
+#include
+
+#include
+#include
+
+// calls vg_drawing functions
+#include "vg_drawing.h"
+#include "microvg_trace.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Macro to add a DRAWING event and its type.
+ */
+#define LOG_MICROVG_DRAWING_START(fn) LOG_MICROVG_START(LOG_MICROVG_DRAWING_ID, CONCAT_DEFINES(LOG_MICROVG_DRAW_, fn))
+#define LOG_MICROVG_DRAWING_END(fn) LOG_MICROVG_END(LOG_MICROVG_DRAWING_ID, CONCAT_DEFINES(LOG_MICROVG_DRAW_, fn))
+
+// -----------------------------------------------------------------------------
+// LLVG_PAINTER_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawPath(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color) {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLVG_PAINTER_IMPL_drawPath)) {
+ LOG_MICROVG_DRAWING_START(path);
+ DRAWING_Status status = VG_DRAWING_drawPath(gc, pathData, x, y, matrix, fillRule, blend, color);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_MICROVG_DRAWING_END(path);
+ }
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawGradient(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradientData, jfloat* gradientMatrix) {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLVG_PAINTER_IMPL_drawGradient)) {
+ LOG_MICROVG_DRAWING_START(pathGradient);
+ DRAWING_Status status = VG_DRAWING_drawGradient(gc, pathData, x, y, matrix, fillRule, alpha, blend, gradientData, gradientMatrix);
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_MICROVG_DRAWING_END(pathGradient);
+ }
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+
+ jint ret;
+ if (LLVG_FONT_UNLOADED == faceHandle) {
+ ret = (jint)LLVG_RESOURCE_CLOSED;
+ }
+ else {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&(LLVG_PAINTER_IMPL_drawString))){
+ LOG_MICROVG_DRAWING_START(string);
+ LLUI_DISPLAY_setDrawingStatus(VG_DRAWING_drawString(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing));
+ LOG_MICROVG_DRAWING_END(string);
+ }
+ ret = (jint)LLVG_SUCCESS;
+ }
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+
+ jint ret;
+
+ if (LLVG_FONT_UNLOADED == faceHandle) {
+ ret = (jint)LLVG_RESOURCE_CLOSED;
+ }
+ else {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&(LLVG_PAINTER_IMPL_drawStringGradient))){
+ LOG_MICROVG_DRAWING_START(stringGradient);
+ LLUI_DISPLAY_setDrawingStatus(VG_DRAWING_drawStringGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, gradientData, gradientMatrix));
+ LOG_MICROVG_DRAWING_END(stringGradient);
+ }
+ ret = (jint)LLVG_SUCCESS;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+
+ jint ret;
+
+ if (LLVG_FONT_UNLOADED == faceHandle) {
+ ret = (jint)LLVG_RESOURCE_CLOSED;
+ }
+ else {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&(LLVG_PAINTER_IMPL_drawStringOnCircle))){
+ LOG_MICROVG_DRAWING_START(stringOnCircle);
+ LLUI_DISPLAY_setDrawingStatus(VG_DRAWING_drawStringOnCircle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction));
+ LOG_MICROVG_DRAWING_END(stringOnCircle);
+ }
+ ret = (jint)LLVG_SUCCESS;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+
+ jint ret;
+
+ if (LLVG_FONT_UNLOADED == faceHandle) {
+ ret = (jint)LLVG_RESOURCE_CLOSED;
+ }
+ else {
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&(LLVG_PAINTER_IMPL_drawStringOnCircleGradient))){
+ LOG_MICROVG_DRAWING_START(stringOnCircleGradient);
+ LLUI_DISPLAY_setDrawingStatus(VG_DRAWING_drawStringOnCircleGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix));
+ LOG_MICROVG_DRAWING_END(stringOnCircleGradient);
+ }
+ ret = (jint)LLVG_SUCCESS;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PAINTER_IMPL_drawImage(MICROUI_GraphicsContext* gc, void* image, jint x, jint y, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[]){
+
+ jint error = LLVG_SUCCESS;
+
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLVG_PAINTER_IMPL_drawImage)) {
+ DRAWING_Status status;
+ LOG_MICROVG_DRAWING_START(image);
+ if (alpha > (uint32_t)0){
+
+ // cppcheck-suppress [misra-c2012-18.8] LLVG_MATRIX_SIZE is a fixed size
+ jfloat local_matrix[LLVG_MATRIX_SIZE];
+ jfloat* drawing_matrix;
+
+ if((0 != x) || (0 != y)) {
+ // Create translate matrix for initial x,y translation from graphicscontext.
+ LLVG_MATRIX_IMPL_setTranslate(local_matrix, x, y);
+ LLVG_MATRIX_IMPL_concatenate(local_matrix, matrix);
+ drawing_matrix = local_matrix;
+ }
+ else {
+ // use original matrix
+ drawing_matrix = matrix;
+ }
+
+ status = VG_DRAWING_drawImage(gc, image, drawing_matrix, alpha, elapsed, color_matrix, &error);
+
+ /* FIXME LLVG_OUT_OF_MEMORY errors are not returned as they are reported with error flags.
+ * See M0092MEJAUI-2908.
+ */
+ if (LLVG_OUT_OF_MEMORY == error) {
+ error = LLVG_SUCCESS;
+ }
+ }
+ else {
+ status = DRAWING_DONE;
+ }
+ LLUI_DISPLAY_setDrawingStatus(status);
+ LOG_MICROVG_DRAWING_END(image);
+ }
+ return error;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/vg/src/LLVG_PATH_impl.c b/bsp/projects/microej/vg/src/LLVG_PATH_impl.c
new file mode 100644
index 0000000..134d7d3
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_PATH_impl.c
@@ -0,0 +1,255 @@
+/*
+ * C
+ *
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroVG library low level API: implementation of path.
+ *
+ * This implementation uses a 32-bit "integer" value to store a path command and
+ * a 32-bit "float" value to store each command parameter.
+ *
+ * The encoding can be overridden, see "[optional]: weak functions" in "microvg_path.h"
+ *
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+#include "microvg_configuration.h"
+
+#ifdef VG_FEATURE_PATH
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include
+
+#include "microvg_path.h"
+#include "microvg_helper.h"
+#include "bsp_util.h"
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Extends the path to be able to store the command and its parameters.
+ *
+ * @return the offset in path buffer where the command will be stored. If the path
+ * buffer is not large enough to contain the requested command, returns a negative
+ * number corresponding to size the buffer must be enlarged for this command.
+ */
+static int32_t _extend_path(MICROVG_PATH_HEADER_t* path, jint length, jint cmd, uint32_t nb_fields) {
+ uint32_t index = MICROVG_PATH_get_path_header_size() + path->data_size;
+ uint32_t extra_size = MICROVG_PATH_get_path_command_size(cmd, nb_fields);
+ int32_t ret;
+
+ if (length >= (index + extra_size)) {
+ path->data_size += extra_size;
+
+ // return next free space (return a positive value)
+ ret = index;
+ }
+ else {
+ // too small buffer, ret is the required extra size
+ // (return a negative value)
+ ret = -extra_size;
+ }
+
+ return ret;
+}
+
+static int32_t _close_path(MICROVG_PATH_HEADER_t* path, jint length, jfloat x1, jfloat y1, jfloat x2, jfloat y2) {
+ int32_t index = _extend_path(path, length, LLVG_PATH_CMD_CLOSE, 0);
+ int32_t ret = LLVG_SUCCESS;
+ if (index > 0) {
+ // finalizes the path by storing the path's bounds
+ path->bounds_xmin = x1;
+ path->bounds_xmax = x2;
+ path->bounds_ymin = y1;
+ path->bounds_ymax = y2;
+ (void)MICROVG_PATH_append_path_command0((jbyte*)path, (uint32_t)index, LLVG_PATH_CMD_CLOSE);
+ }
+ else {
+ // too small buffer, ret is the required extra size * -1
+ ret = -index;
+ }
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// Specific path format functions [optional]: weak functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT void MICROVG_PATH_initialize(void) {
+ // nothing to do
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_get_path_header_size(void) {
+ return sizeof(MICROVG_PATH_HEADER_t);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_get_path_command_size(jint command, uint32_t nbParams) {
+ (void)command;
+ return (nbParams + (uint32_t)1 /* command */) * sizeof(uint32_t);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_append_path_command0(jbyte* path, uint32_t offset, jint cmd) {
+ uint32_t* data = (uint32_t*)(path + offset);
+ *data = MICROVG_PATH_convert_path_command(cmd);
+ return sizeof(uint32_t);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_append_path_command1(jbyte* path, uint32_t offset, jint cmd, jfloat x, jfloat y) {
+ uint32_t* data = (uint32_t*)(path + offset);
+ *data = MICROVG_PATH_convert_path_command(cmd);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y);
+ return (uint32_t)3 * sizeof(uint32_t);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_append_path_command2(jbyte* path, uint32_t offset, jint cmd, jfloat x1, jfloat y1, jfloat x2, jfloat y2) {
+ uint32_t* data = (uint32_t*)(path + offset);
+ *data = MICROVG_PATH_convert_path_command(cmd);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x1);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y1);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x2);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y2);
+ return (uint32_t)5 * sizeof(uint32_t);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT uint32_t MICROVG_PATH_append_path_command3(jbyte* path, uint32_t offset, jint cmd, jfloat x1, jfloat y1, jfloat x2, jfloat y2,
+ jfloat x3, jfloat y3) {
+ uint32_t* data = (uint32_t*)(path + offset);
+ *data = MICROVG_PATH_convert_path_command(cmd);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x1);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y1);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x2);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y2);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(x3);
+ ++data;
+ *data = JFLOAT_TO_UINT32_t(y3);
+ return (uint32_t)7 * sizeof(uint32_t);
+}
+
+// -----------------------------------------------------------------------------
+// LLVG_PATH_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_initializePath(jbyte* jpath, jint length) {
+
+ MICROVG_PATH_HEADER_t* path = (MICROVG_PATH_HEADER_t*)jpath;
+ uint32_t header_size = MICROVG_PATH_get_path_header_size();
+ jint ret = LLVG_SUCCESS;
+
+ if (length >= header_size) {
+ path->data_size = 0;
+ path->format = MICROVG_PATH_get_path_encoder_format();
+ }
+ else {
+ // the given byte array is too small
+ ret = header_size;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand1(jbyte* jpath, jint length, jint cmd, jfloat x, jfloat y) {
+
+ MICROVG_PATH_HEADER_t* path = (MICROVG_PATH_HEADER_t*)jpath;
+ jint ret = LLVG_SUCCESS;
+
+ int32_t index = _extend_path(path, length, cmd, 2);
+ if (index > 0) {
+ (void)MICROVG_PATH_append_path_command1((jbyte*)path, (uint32_t)index, cmd, x, y);
+ }
+ else {
+ // too small buffer, ret is the required extra size * -1
+ ret = -index;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand2(jbyte* jpath, jint length, jint cmd, jfloat x1, jfloat y1, jfloat x2,
+ jfloat y2) {
+
+ MICROVG_PATH_HEADER_t* path = (MICROVG_PATH_HEADER_t*)jpath;
+ jint ret = LLVG_SUCCESS;
+
+ if (LLVG_PATH_CMD_CLOSE == cmd) {
+ // parameters are path's bounds
+ ret = _close_path(path, length, x1, y1, x2, y2);
+ }
+ else {
+ int32_t index = _extend_path(path, length, cmd, 4);
+ if (index > 0) {
+ (void)MICROVG_PATH_append_path_command2((jbyte*)path, (uint32_t)index, cmd, x1, y1, x2, y2);
+ }
+ else {
+ // too small buffer, ret is the required extra size * -1
+ ret = -index;
+ }
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand3(jbyte* jpath, jint length, jint cmd, jfloat x1, jfloat y1, jfloat x2,
+ jfloat y2, jfloat x3, jfloat y3) {
+
+ MICROVG_PATH_HEADER_t* path = (MICROVG_PATH_HEADER_t*)jpath;
+ jint ret = LLVG_SUCCESS;
+
+ int32_t index = _extend_path(path, length, cmd, 6);
+ if (index > 0) {
+ (void)MICROVG_PATH_append_path_command3((jbyte*)path, (uint32_t)index, cmd, x1, y1, x2, y2, x3, y3);
+ }
+ else {
+ // too small buffer, ret is the required extra size * -1
+ ret = -index;
+ }
+
+ return ret;
+}
+
+// See the header file for the function documentation
+void LLVG_PATH_IMPL_reopenPath(jbyte* jpath) {
+ MICROVG_PATH_HEADER_t* path = (MICROVG_PATH_HEADER_t*)jpath;
+ path->data_size -= MICROVG_PATH_get_path_command_size(LLVG_PATH_CMD_CLOSE, 0);
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // VG_FEATURE_PATH
diff --git a/bsp/projects/microej/vg/src/LLVG_PATH_stub.c b/bsp/projects/microej/vg/src/LLVG_PATH_stub.c
new file mode 100644
index 0000000..469036b
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_PATH_stub.c
@@ -0,0 +1,86 @@
+/*
+ * C
+ *
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroVG library low level API: stubbed implementation of LLVG_PATH_impl.h
+ * and LLVG_PATH_PAINTER_impl.h.
+ *
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+#include "microvg_configuration.h"
+
+#ifndef VG_FEATURE_PATH
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+// -----------------------------------------------------------------------------
+// LLVG_PATH_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_initializePath(jbyte* jpath, jint length) {
+ (void)jpath;
+ (void)length;
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand1(jbyte* jpath, jint length, jint cmd, jfloat x, jfloat y) {
+ (void)jpath;
+ (void)length;
+ (void)cmd;
+ (void)x;
+ (void)y;
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand2(jbyte* jpath, jint length, jint cmd, jfloat x1, jfloat y1, jfloat x2,
+ jfloat y2) {
+ (void)jpath;
+ (void)length;
+ (void)cmd;
+ (void)x1;
+ (void)y1;
+ (void)x2;
+ (void)y2;
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+jint LLVG_PATH_IMPL_appendPathCommand3(jbyte* jpath, jint length, jint cmd, jfloat x1, jfloat y1, jfloat x2,
+ jfloat y2, jfloat x3, jfloat y3) {
+ (void)jpath;
+ (void)length;
+ (void)cmd;
+ (void)x1;
+ (void)y1;
+ (void)x2;
+ (void)y2;
+ (void)x3;
+ (void)y3;
+ return LLVG_SUCCESS;
+}
+
+// See the header file for the function documentation
+void LLVG_PATH_IMPL_reopenPath(jbyte* jpath) {
+ // nothing to do
+ (void)jpath;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // VG_FEATURE_PATH
diff --git a/bsp/projects/microej/vg/src/LLVG_RAW_impl.c b/bsp/projects/microej/vg/src/LLVG_RAW_impl.c
new file mode 100644
index 0000000..0b5449e
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_RAW_impl.c
@@ -0,0 +1,2745 @@
+/*
+ * C
+ *
+ * Copyright 2022-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief MicroEJ MicroVG library low level API: image management.This file draws an
+ * image and can fill a BufferedVectorImage.
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "bsp_util.h"
+#include "color.h"
+#include "vg_lite.h"
+#include "vg_lite_kernel.h"
+#include "microvg_configuration.h"
+#include "microvg_path.h"
+#include "microvg_vglite_helper.h"
+#include "microvg_helper.h"
+#include "microvg_trace.h"
+#include "mej_math.h"
+#include "vg_drawing_vglite.h"
+#include "ui_drawing_bvi.h"
+#include "bvi_vglite.h"
+
+#include "fsl_debug_console.h"
+
+// -----------------------------------------------------------------------------
+// Macros and Defines
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Enables loading of vector image files from an external resource system.
+ *
+ * If this feature is enabled, when an image file is not available in the application classpath, the implementation tries to load it from an external resource system.
+ * If this feature is disabled, only the resources compiled with the application are used.
+ *
+ * This feature will be enabled if the Platform embeds the module "External Resource" and the BSP implements the functions declared in "LLEXT_RES_impl.h".
+ */
+#ifndef VG_FEATURE_RAW_EXTERNAL
+#define VG_FEATURE_RAW_EXTERNAL __has_include("LLEXT_RES_impl.h")
+#if VG_FEATURE_RAW_EXTERNAL
+#include "LLEXT_RES_impl.h"
+#endif
+#endif
+
+/*
+ * @brief RAW format
+ */
+#define LLVG_RAW_VERSION (1)
+
+/*
+ * @brief Allocator management
+ */
+#define MALLOC(s) (LLUI_DISPLAY_IMPL_imageHeapAllocate(VG_LITE_ALIGN((s), 4)))
+#define FREE(s) (LLUI_DISPLAY_IMPL_imageHeapFree(s))
+//#define DEBUG_ALLOCATOR
+
+#define TIMERATIO_RANGE 65535
+#define TIMERATIO_OFFSET ((TIMERATIO_RANGE / 2) + 1)
+
+/*
+ * @brief Gamma value typically lies between 2.2 and 2.5 for CRT monitors, Android chose 2.2.
+ */
+#define GAMMA_VALUE 2.2f
+
+#define COLOR_MATRIX_WIDTH (5)
+#define COLOR_MATRIX_HEIGHT (4)
+#define COLOR_MATRIX_SIZE ((COLOR_MATRIX_WIDTH) * (COLOR_MATRIX_HEIGHT))
+#define RED_OFFSET (0)
+#define GREEN_OFFSET (1)
+#define BLUE_OFFSET (2)
+#define ALPHA_OFFSET (3)
+#define CONSTANT_OFFSET (4)
+#define RED_LINE (COLOR_MATRIX_WIDTH * RED_OFFSET)
+#define GREEN_LINE (COLOR_MATRIX_WIDTH * GREEN_OFFSET)
+#define BLUE_LINE (COLOR_MATRIX_WIDTH * BLUE_OFFSET)
+#define ALPHA_LINE (COLOR_MATRIX_WIDTH * ALPHA_OFFSET)
+
+/*
+ * @brief Copy the gradient content but not the image that renders the gradient
+ *
+ * /!\ the VGLite gradient is constitued of the gradient header (colors and positions) and a VGLite image.
+ * A VGLite image is a header + a pixel buffer. This image is made at runtime by VGLite library according
+ * to the gradient data. The RAW format only embbeds the gradient header, not the "image" part to win some
+ * footprint. By consequence the gradient data to copy from ROM to RAM is:
+ * sizeof(gradient) == sizeof(vg_lite_linear_gradient_t) - sizeof(vg_lite_buffer_t)
+ */
+#define GRADIENT_COPY_SIZE (sizeof(vg_lite_linear_gradient_t) - sizeof(vg_lite_buffer_t))
+#define GRADIENT_CMP_SIZE (GRADIENT_COPY_SIZE - sizeof(vg_lite_matrix_t))
+
+/*
+ * @brief Macro to add an IMAGE event and its type.
+ */
+#define LOG_MICROVG_IMAGE_START(fn) LOG_MICROVG_START(LOG_MICROVG_IMAGE_ID, CONCAT_DEFINES(LOG_MICROVG_IMAGE_, fn))
+#define LOG_MICROVG_IMAGE_END(fn) LOG_MICROVG_END(LOG_MICROVG_IMAGE_ID, CONCAT_DEFINES(LOG_MICROVG_IMAGE_, fn))
+
+
+// -----------------------------------------------------------------------------
+// Java library constants (static final)
+// -----------------------------------------------------------------------------
+
+#define RAW_OFFSET_F32_WIDTH (0)
+#define RAW_OFFSET_F32_HEIGHT (1)
+#define RAW_OFFSET_U32_DURATION (2)
+#define RAW_OFFSET_U32_FLAGS (3)
+
+#define RAW_FLAG_OVERLAP_PATH (0x01)
+#define RAW_FLAG_FREE_MEMORY_ON_CLOSE (0x02)
+
+// -----------------------------------------------------------------------------
+// Typedef
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief RAW and BVI
+ */
+typedef struct vector_image vector_image_t;
+typedef struct vector_buffered_image vector_buffered_image_t;
+
+/*
+ * @brief Image blocks
+ */
+typedef enum vg_block_kind vg_block_kind_t;
+typedef struct vg_flags vg_flags_t;
+typedef struct vg_block vg_block_t;
+typedef struct vg_path_desc vg_path_desc_t;
+typedef struct vg_block_path vg_block_path_t;
+typedef struct vg_block_group_transform vg_block_group_transform_t;
+typedef struct vg_block_group_animation vg_block_group_animation_t;
+typedef struct vg_block_group_end vg_block_group_end_t;
+typedef struct vg_block_color vg_block_color_t;
+typedef struct vg_block_gradient vg_block_gradient_t;
+typedef struct vg_block_bvi_color vg_block_bvi_color_t;
+typedef struct vg_block_bvi_gradient vg_block_bvi_gradient_t;
+typedef struct vg_block_bvi_image vg_block_bvi_image_t;
+typedef struct vg_block_animate_color vg_block_animate_color_t;
+typedef struct vg_block_animate_gradient vg_block_animate_gradient_t;
+
+/*
+ * @brief Image animations
+ */
+typedef struct vg_path_interpolator vg_path_interpolator_t;
+typedef struct vg_animation_header vg_animation_header_t;
+typedef struct vg_animation_translate vg_animation_translate_t;
+typedef struct vg_animation_translate_xy vg_animation_translate_xy_t;
+typedef struct vg_animation_rotate vg_animation_rotate_t;
+typedef struct vg_animation_scale vg_animation_scale_t;
+typedef struct vg_animation_color vg_animation_color_t;
+typedef struct vg_animation_alpha vg_animation_alpha_t;
+typedef struct vg_animation_path_data vg_animation_path_data_t;
+
+/*
+ * @brief Image drawing data
+ */
+typedef struct vg_transformation vg_transformation_t;
+typedef struct vg_drawing vg_drawing_t;
+
+/*
+ * @brief Internal MicroJVM element to retrieve a resource in the microejapp.o.
+ */
+typedef struct {
+ void* data;
+ uint32_t size;
+} SNIX_resource;
+
+/*
+ * @brief Function to update a matrix according to an animation
+ *
+ * @param[in/out]: inout: the data to update
+ * @param[in]: elapsed_time: the time elapsed within this animation.
+ * @param[in]: last: true when the final frame is reached
+ *
+ * @return: nothing
+ */
+typedef void (* VG_RAW_apply_animation_t) (
+ vg_animation_header_t* animation,
+ void* inout,
+ jlong elapsed_time,
+ size_t memory_offset,
+ bool last
+);
+
+// -----------------------------------------------------------------------------
+// Enum
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Types of image's blocks.
+ */
+enum vg_block_kind {
+
+ // respect the order (hardcoded in VectorImage converter)
+
+ // RAW & BVI
+ VG_BLOCK_LAST,
+
+ // RAW only
+ VG_BLOCK_PATH_COLOR,
+ VG_BLOCK_RAW_GRADIENT,
+ VG_BLOCK_GROUP_TRANSFORM,
+ VG_BLOCK_GROUP_ANIMATE,
+ VG_BLOCK_GROUP_END,
+ VG_BLOCK_PATH_COLOR_ANIMATE,
+ VG_BLOCK_PATH_GRADIENT_ANIMATE,
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+ // BVI only
+ VG_BLOCK_BVI_COLOR,
+ VG_BLOCK_BVI_GRADIENT,
+ VG_BLOCK_BVI_IMAGE,
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+};
+
+// -----------------------------------------------------------------------------
+// Struct
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Flags of RAW image
+ *
+ * (u1) overlapping
+ * (u1) rom | ram (resp. 0 | 1)
+ * (u1) relative | absolute (resp. 0 | 1)
+ * (u5) padding
+ * (u24) duration
+ */
+struct vg_flags {
+ uint32_t duration : 24;
+ // cppcheck-suppress [unusedStructMember] padding is not used
+ uint32_t : 5; // padding
+ uint32_t absolute : 1; // 0: addresses are relative (blocks, paths, etc.); 1: absolute
+ uint32_t ram : 1; // 0: image in RAM; 1: image in ROM
+ uint32_t overlapping : 1;
+};
+
+/*
+ * @brief Defines an image block. A block is identified by its kind.
+ */
+struct vg_block {
+
+ // block's kind (see vg_block_xxx)
+ vg_block_kind_t kind;
+
+ // warning: aligned on 1 byte is known by "sub" struct
+
+} __attribute__((packed));
+
+/*
+ * @brief Defines the description of a path. In a RAW image, the same path can
+ * be shared between several operation "draw path".
+ */
+struct vg_path_desc {
+ float bounding_box[4]; // left, top, right, bottom
+ uint32_t length;
+ vg_lite_format_t format;
+ uint8_t padding0;
+ uint8_t padding1;
+ uint8_t padding2;
+
+ // + array of data of path
+
+};
+
+/*
+ * @brief Defines a block "path"; useful for all operations that draw a path.
+ */
+struct vg_block_path {
+
+ vg_block_t block;
+
+ // common block's data for all VG drawings
+ vg_lite_fill_t fill_rule;
+ vg_lite_blend_t blend; // useless for static RAW images
+ uint8_t padding0;
+
+ vg_path_desc_t* desc;
+
+};
+
+/*
+ * @brief Defines a block "group with transformation"
+ */
+struct vg_block_group_transform {
+
+ vg_block_t block;
+
+ uint8_t padding0;
+ uint8_t padding1;
+ uint8_t padding2;
+ vg_lite_matrix_t matrix;
+
+};
+
+/*
+ * @brief Defines a block "group with animation"
+ */
+struct vg_block_group_animation {
+
+ vg_block_t block;
+
+ uint8_t padding;
+ uint16_t block_size;
+
+ uint8_t nb_translates;
+ uint8_t nb_translates_xy;
+ uint8_t nb_rotates;
+ uint8_t nb_scales;
+
+ float scale_x;
+ float scale_y;
+ float translate_x;
+ float translate_y;
+ float pivot_x;
+ float pivot_y;
+ float rotation;
+
+ // + array of vg_animation_translate_t
+ // + array of vg_animation_rotate_t
+ // + array of vg_animation_scale_t
+
+};
+
+/*
+ * @brief Defines a block "end of current group"
+ */
+struct vg_block_group_end {
+
+ vg_block_t block;
+
+ uint8_t padding0;
+ uint8_t padding1;
+ uint8_t padding2;
+
+};
+
+/*
+ * @brief Defines a block "path with a color".
+ */
+struct vg_block_color {
+
+ vg_block_path_t path;
+ uint32_t color;
+
+};
+
+/*
+ * @brief Defines a block "path with a gradient".
+ */
+struct vg_block_gradient {
+
+ vg_block_path_t path;
+
+ // /!\ the VGLite gradient is only constitued of the gradient header (colors and positions)
+ // see GRADIENT_COPY_SIZE
+ vg_lite_linear_gradient_t* gradient;
+
+};
+
+/*
+ * @brief Defines a block "path with a color in a buffered image"
+ */
+struct vg_block_bvi_color {
+ vg_block_color_t header;
+ vg_lite_matrix_t path_deformation;
+ int32_t scissor[4];
+ vg_block_t* next;
+};
+
+/*
+ * @brief Defines a block "path with a gradient in a buffered image"
+ */
+struct vg_block_bvi_gradient {
+ vg_block_gradient_t header;
+ vg_lite_matrix_t path_deformation;
+ int32_t scissor[4];
+ vg_block_t* next;
+ bool shared_gradient; // if true, means the gradient is shared with another block (must not free it)
+};
+
+/*
+ * @brief Defines a block "raw image in a buffered image"
+ */
+struct vg_block_bvi_image {
+
+ vg_block_t block;
+
+ uint8_t flags; // 0 == color_matrix is null
+ jchar alpha; // prevent to use the mask "& 0xff"
+
+ vector_image_t* image;
+ jfloat matrix[9];
+ int32_t scissor[4];
+ jfloat color_matrix[COLOR_MATRIX_SIZE];
+ jint elapsed_msb; // prevent unalignment access
+ jint elapsed_lsb;
+
+ vg_block_t* next;
+
+};
+
+/*
+ * @brief Defines a block "animate color of a path".
+ */
+struct vg_block_animate_color {
+
+ vg_block_color_t header;
+
+ uint8_t nb_colors;
+ uint8_t nb_alphas;
+ uint8_t nb_path_datas;
+ uint8_t padding0;
+
+ uint16_t block_size;
+ uint16_t padding1;
+
+ // + array of vg_animation_color_t
+ // + array of vg_animation_alpha_t
+ // + array of vg_animation_path_data_t
+
+};
+
+/*
+ * @brief Defines a block "animate gradient of a path".
+ */
+struct vg_block_animate_gradient {
+
+ vg_block_gradient_t header;
+
+ uint8_t nb_alphas;
+ uint8_t nb_path_datas;
+ uint16_t block_size;
+
+ // + array of vg_animation_alpha_t
+ // + array of vg_animation_path_data_t
+
+};
+
+/*
+ * @brief Defines a "path interpolator"
+ */
+struct vg_path_interpolator {
+
+ uint32_t size;
+
+ // + array of end_time_ratio (short)
+ // + optional padding
+ // + array of start_x (float)
+ // + array of start_y (float)
+
+};
+
+/*
+ * @brief Defines the header of an animation.
+ */
+struct vg_animation_header {
+
+ int32_t duration;
+ int32_t begin;
+ int32_t keep_duration;
+ vg_path_interpolator_t* offset_path_interpolator;
+
+};
+
+/*
+ * @brief Defines an animation "Translate"
+ */
+struct vg_animation_translate {
+
+ vg_animation_header_t header;
+ float start_x;
+ float start_y;
+ float translation_x;
+ float translation_y;
+
+};
+
+/*
+ * @brief Defines an animation "Translate XY"
+ */
+struct vg_animation_translate_xy {
+
+ vg_animation_header_t header;
+ vg_path_interpolator_t* offset_path_interpolator;
+
+};
+
+/*
+ * @brief Defines an animation "Rotate"
+ */
+struct vg_animation_rotate {
+
+ vg_animation_header_t header;
+ float start_angle;
+ float rotation_angle;
+ float start_rotation_center_x;
+ float start_rotation_center_y;
+ float rotation_translation_center_x;
+ float rotation_translation_center_y;
+
+};
+
+/*
+ * @brief Defines an animation "Scale"
+ */
+struct vg_animation_scale {
+
+ vg_animation_header_t header;
+ float scale_x_from;
+ float scale_x_to;
+ float scale_y_from;
+ float scale_y_to;
+ float pivot_x;
+ float pivot_y;
+
+};
+
+/*
+ * @brief Defines an animation "Color"
+ */
+struct vg_animation_color {
+
+ vg_animation_header_t header;
+ uint32_t start_color;
+ uint32_t end_color;
+
+};
+
+/*
+ * @brief Defines an animation "Alpha"
+ */
+struct vg_animation_alpha {
+
+ vg_animation_header_t header;
+ uint8_t start_alpha;
+ uint8_t end_alpha;
+
+};
+
+/*
+ * @brief Defines an animation "Path data"
+ */
+struct vg_animation_path_data {
+
+ vg_animation_header_t header;
+ vg_path_desc_t* from;
+ vg_path_desc_t* to;
+
+};
+
+/*
+ * @brief Defines a RAW image
+ */
+struct vector_image {
+
+ uint32_t signature_msb;
+ uint32_t signature_lsb;
+
+ float width;
+ float height;
+
+ vg_flags_t flags;
+ vg_block_t* first_block;
+
+};
+
+/*
+ * @brief Defines a buffered image
+ */
+struct vector_buffered_image {
+
+ /*
+ * @brief RAW image header
+ */
+ vector_image_t header;
+
+ /*
+ * @brief Pointer to vg_block_t* of last stored block.
+ */
+ vg_block_t** latest_data;
+
+ /*
+ * @brief Last block of image.
+ */
+ vg_block_t last_block;
+
+ /*
+ * @brief Pointer to last stored gradient in the bvi; to share same gradient
+ * between several consecutive drawings (very useful when drawing a string).
+ */
+ vg_lite_linear_gradient_t* last_stored_gradient;
+
+};
+
+/*
+ * @brief Element of a chained list: a transformation
+ */
+struct vg_transformation {
+
+ struct vg_transformation* parent;
+ vg_lite_matrix_t matrix;
+
+};
+
+/*
+ * @brief
+ */
+struct vg_drawing {
+
+ /*
+ * @brief First image block to render.
+ */
+ vg_block_t* first_block;
+
+ /*
+ * @brief Offset to apply on each block data address.
+ */
+ size_t memory_offset;
+
+ /*
+ * @brief First transformation to apply when rendering an image. This
+ * transformation only holds the image transformation: it does not hold
+ * the final transformation: the image translation.
+ *
+ * This transformation is not stored in the heap to be sure to apply at
+ * least this transformation when drawing an image even if the heap is
+ * full.
+ */
+ vg_transformation_t first_transformation;
+
+ /*
+ * @brief At the end of the image drawing, tells if something has been
+ * drawn or not (empty or cleared image).
+ */
+ bool drawing_running;
+
+};
+
+// -----------------------------------------------------------------------------
+// Extern functions & fields
+// -----------------------------------------------------------------------------
+
+/*
+ * @brief Internal MicroJVM function to retrieve a resource in the microejapp.o.
+ *
+ * @param[in] path: the path of the resource to retrieve
+ * @param[out] resource: the resource metadata
+ */
+extern int32_t SNIX_get_resource(char* path, SNIX_resource* resource);
+
+/*
+ * @brief Function to retrieve the current scissor.
+ */
+extern uint32_t vg_lite_get_scissor(int32_t** scissor);
+
+// -----------------------------------------------------------------------------
+// Global Variables
+// -----------------------------------------------------------------------------
+
+const uint8_t signature[] = {(uint8_t)'M', (uint8_t)'E', (uint8_t)'J', (uint8_t)'_', (uint8_t)'M', (uint8_t)'V', (uint8_t)'G', (uint8_t)LLVG_RAW_VERSION};
+
+static bool initialiazed = false;
+
+/*
+ * @brief Gradient used for all drawings with gradient (only one image allocation,
+ * does not alterate the original gradient's matrix and colors, etc.).
+ */
+static vg_lite_linear_gradient_t render_gradient;
+
+/*
+ * @brief Path used for all drawings.
+ */
+static vg_lite_path_t render_path;
+
+/*
+ * @brief Working data to draw an image (RAW or BVI)
+ */
+static vg_drawing_t drawing_data;
+
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+/*
+ * @brief Working data to draw a RAW image stored in a BVI.
+ */
+static vg_drawing_t raw_in_bvi_drawing_data;
+
+/*
+ * @brief BVI destination when rendering an image in a BVI
+ */
+static void* bvi_target;
+
+/*
+ * @brief Color matrix used to combine user matrix and RAW image matrix inside the BVI.
+ */
+static const float CONSTANT_ROW[5] = { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f };
+static float combined_color_matrices[COLOR_MATRIX_SIZE];
+
+#endif
+
+#ifdef DEBUG_ALLOCATOR
+static uint32_t cumul = 0;
+static uint32_t max = 0;
+#endif
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+static inline void* get_addr(void* addr, size_t memory_offset){
+ assert(NULL != addr);
+ // cppcheck-suppress [misra-c2012-11.5,misra-c2012-18.4] go to the expected address
+ return (void*)(((uint8_t*)addr) + memory_offset);
+}
+
+static inline void* get_path_data_addr(vg_path_desc_t* path){
+ return get_addr(path, sizeof(vg_path_desc_t));
+}
+
+static inline vg_path_desc_t* get_path_addr(vg_path_desc_t* path, size_t memory_offset){
+ // cppcheck-suppress [misra-c2012-11.5] cast to vg_path_desc_t* is valid for sure
+ return (vg_path_desc_t*)get_addr(path, memory_offset);
+}
+
+static inline vg_lite_linear_gradient_t* get_gradient_addr(vg_lite_linear_gradient_t* gradient, size_t memory_offset){
+ return (vg_lite_linear_gradient_t*)get_addr(gradient, memory_offset);
+}
+
+static inline vg_path_interpolator_t* get_path_interpolator_addr(vg_path_interpolator_t* interpolator, size_t memory_offset){
+ // cppcheck-suppress [misra-c2012-11.5] cast to vg_path_interpolator_t* is valid for sure
+ return (vg_path_interpolator_t*)get_addr(interpolator, memory_offset);
+}
+
+/*
+ * @brief Frees the given data from the heap or does nothing
+ * when targets RO memory.
+ *
+ * @param[in] data: pointer on the data to free.
+ */
+static void _free_data(void* data) {
+ if (NULL != data) {
+#ifdef DEBUG_ALLOCATOR
+ // cppcheck-suppress [misra-c2012-11.5] data is aligned on 32-bit for sure
+ uint32_t* addr = (uint32_t*)data;
+ --addr;
+ uint32_t size = *addr;
+ cumul -= size;
+ PRINTF("free %u\t0x%x\t(%u/%u)\n", size, addr, cumul, max);
+ FREE((uint8_t*)addr);
+#else
+ FREE(data);
+#endif
+ }
+}
+
+/*
+ * @brief Allocates the given size in the heap.
+ *
+ * @param[in] size: the data's size (in bytes).
+ *
+ * @return the pointer to the stored data.
+ */
+static inline uint8_t* _alloc_data(uint32_t size) {
+
+#ifdef DEBUG_ALLOCATOR
+ size += 4;
+ cumul += size;
+ max = (cumul > max) ? cumul : max;
+#endif
+
+ uint8_t* ret = MALLOC(size);
+ if (NULL == ret) {
+ MEJ_LOG_ERROR_MICROVG("OOM\n");
+ }
+
+#ifdef DEBUG_ALLOCATOR
+ PRINTF("alloc %u\t0x%x\t(%u/%u)\n", size, ret, cumul, max);
+ *((uint32_t*)ret) = size;
+ ret += 4;
+#endif
+
+ return ret;
+}
+
+/*
+ * @brief Stores the given data in the heap.
+ *
+ * @param[in] data: pointer on the data to store.
+ * @param[in] size: the data's size.
+ *
+ * @return the pointer to the stored data or NULL (OOM).
+ */
+static uint8_t* _store_data(void* data, size_t size) {
+ uint8_t* ret = _alloc_data(size);
+ if (NULL != ret){
+ (void)memcpy((void*)ret, data, size);
+ }
+ return ret;
+}
+
+static inline void _tag_image_in_ram(vector_image_t* image) {
+ image->flags.ram = (uint32_t)1;
+}
+
+/*
+ * @brief Tells if the image addresses (blocks, paths, etc.) are relative
+ */
+static inline bool _is_image_address_relative(vector_image_t* image) {
+ return ((uint32_t)0) == image->flags.absolute;
+}
+
+/*
+ * @brief Tells if the image is a buffered vector image.
+ * We use the flag "absolute" which is only true for the BVI.
+ */
+static inline bool _is_image_bvi(vector_image_t* image) {
+ return !_is_image_address_relative(image);
+}
+
+/*
+ * @brief Stores the given transformation in the heap.
+ *
+ * @param[in] transformation: pointer on the transformation to store.
+ *
+ * @return the pointer to the stored transformation or NULL (OOM).
+ */
+static vg_transformation_t* _store_vg_transformation(vg_transformation_t * transformation) {
+ // cppcheck-suppress [misra-c2012-11.3] the stored data is a vg_transformation_t for sure
+ return (vg_transformation_t*)_store_data(transformation, sizeof(vg_transformation_t));
+}
+
+static void _free_vg_transformation(vg_transformation_t * transformation) {
+ _free_data(transformation);
+}
+
+/**
+ * @brief Gets a filter color by applying a color transformation.
+ *
+ * @param[in] red, green, blue, alpha: the color to transform
+ * @param[in] color_matrix: the transformation to apply
+ * @param[in] start_index: the transformation index in the matrix
+ *
+ * @return the filtered color
+ */
+static uint32_t _filter_color_component(uint32_t red, uint32_t green, uint32_t blue, uint32_t alpha, const float color_matrix[], uint32_t start_index) {
+ float redFactor = color_matrix[start_index + (uint32_t)RED_OFFSET] * (float)red;
+ float greenFactor = color_matrix[start_index + (uint32_t)GREEN_OFFSET] * (float)green;
+ float blueFactor = color_matrix[start_index + (uint32_t)BLUE_OFFSET] * (float)blue;
+ float alphaFactor = color_matrix[start_index + (uint32_t)ALPHA_OFFSET] * (float)alpha;
+ float hardcodedColor = color_matrix[start_index + (uint32_t)CONSTANT_OFFSET];
+ float factors = redFactor + greenFactor + blueFactor + alphaFactor + hardcodedColor;
+ int32_t ret = (int32_t) factors;
+ return (uint32_t)((ret < 0x0) ? 0x0 : ((ret > 0xff) ? 0xff : ret));
+}
+
+static uint32_t _filter_color(uint32_t color, const float color_matrix[]) {
+
+ uint32_t red = COLOR_GET_CHANNEL(color, ARGB8888, RED);
+ uint32_t green = COLOR_GET_CHANNEL(color, ARGB8888, GREEN);
+ uint32_t blue = COLOR_GET_CHANNEL(color, ARGB8888, BLUE);
+ uint32_t alpha = COLOR_GET_CHANNEL(color, ARGB8888, ALPHA);
+
+ uint32_t resultRed = _filter_color_component(red, green, blue, alpha, color_matrix, RED_LINE);
+ uint32_t resultGreen = _filter_color_component(red, green, blue, alpha, color_matrix, GREEN_LINE);
+ uint32_t resultBlue = _filter_color_component(red, green, blue, alpha, color_matrix, BLUE_LINE);
+ uint32_t resultAlpha = _filter_color_component(red, green, blue, alpha, color_matrix, ALPHA_LINE);
+
+ return COLOR_SET_COLOR(resultAlpha, resultRed, resultGreen, resultBlue, ARGB8888);
+}
+
+static void _filter_gradient(vg_lite_linear_gradient_t* gradient, const float color_matrix[]) {
+ uint32_t* colors = (uint32_t*)gradient->colors;
+ for(int i = 0; i < gradient->count; i++) {
+ colors[i] = _filter_color(colors[i], color_matrix);
+ }
+}
+
+static uint8_t _filter_alpha(uint8_t alpha, const float color_matrix[]) {
+ uint32_t color = alpha;
+ color <<= 24;
+ color = _filter_color(color, color_matrix);
+ return (uint8_t)(color >> 24);
+}
+
+static uint32_t _prepare_render_color(uint32_t color, uint32_t alpha, const float color_matrix[]) {
+ uint32_t ret = color;
+ if (NULL != color_matrix) {
+ assert((uint32_t)0xff == alpha); // filter mode does not use global alpha (see MicroVG spec)
+ ret = _filter_color(color, color_matrix);
+ }
+ else if (alpha != (uint32_t)0xff) {
+ ret = MICROVG_HELPER_apply_alpha(color, alpha);
+ }
+ else {
+ // nothing to change
+ }
+ return ret;
+}
+
+static void _prepare_gradient_colors(vg_lite_linear_gradient_t* gradient, uint32_t alpha, const float color_matrix[]) {
+
+ if (NULL != color_matrix) {
+ assert((uint32_t)0xff == alpha); // filter mode does not use global alpha
+ _filter_gradient(gradient, color_matrix);
+ }
+ else if (alpha != (uint32_t)0xff) {
+ uint32_t* colors = (uint32_t*)gradient->colors;
+ for(int i = 0; i < gradient->count; i++) {
+ colors[i] = MICROVG_HELPER_apply_alpha(colors[i], alpha);
+ }
+ }
+ else {
+ // nothing to change
+ }
+}
+
+static float _get_path_interpolator_at_time(vg_path_interpolator_t* interpolator, float time, bool apply_x_transformation) {
+
+ // retrieve arrays addresses
+ uint8_t* data_offset = (uint8_t*)interpolator;
+ // cppcheck-suppress [misra-c2012-18.4] points after the interpolator
+ data_offset += sizeof(vg_path_interpolator_t);
+ // cppcheck-suppress [misra-c2012-11.3] data_offset points on a 16-bit array for sure
+ int16_t* end_time_ratio = (int16_t*)data_offset;
+ uint32_t ratio_array_length = interpolator->size + (uint32_t)1;
+ ratio_array_length &= ~1;
+ // cppcheck-suppress [misra-c2012-18.4] points after the ratio array
+ data_offset += ratio_array_length * sizeof(int16_t);
+ // cppcheck-suppress [misra-c2012-11.3,invalidPointerCast] data_offset points on a float array for sure
+ float* start_x = (float*)data_offset;
+ // cppcheck-suppress [misra-c2012-18.4] points after the start X array
+ data_offset += interpolator->size * sizeof(float);
+ // cppcheck-suppress [misra-c2012-11.3,invalidPointerCast] data_offset points on a float array for sure
+ float* start_y = (float*)data_offset;
+
+ // get the values to apply
+ float* values = apply_x_transformation ? start_x : start_y;
+
+ // get a ratio between 0x0000 and 0xffff (TIMERATIO_RANGE)
+ int32_t time_ratio = (int32_t) (MEJ_MIN(MEJ_MAX(time, 0.f), 1.f) * (float)TIMERATIO_RANGE);
+
+ int32_t origin = 0;
+ float ret = 0.f;
+ bool done = false;
+
+ // Last cells of arrays store the ending positions of last segment
+ for (uint32_t i = 0; !done && (i < (interpolator->size - (uint32_t)1)); i++) {
+
+ int32_t end = end_time_ratio[i] + TIMERATIO_OFFSET;
+
+ if (time_ratio <= end) {
+ float segPosition = ((float)time_ratio - (float)origin) / ((float)end - (float)origin);
+ float segStartValue = values[i];
+ float segEndValue = values[i + (uint32_t)1];
+ ret = ((segStartValue * (1.f - segPosition)) + (segEndValue * segPosition));
+ done = true;
+ }
+ origin = end;
+ }
+
+ return ret;
+}
+
+static float _get_transformation_ratio_at_time(vg_animation_header_t* animation, vg_path_interpolator_t* interpolator, jlong time) {
+ float time_ratio;
+
+ if (0 == animation->duration) {
+ time_ratio = 1.f;
+ } else {
+ time_ratio = (float) time / animation->duration;
+ }
+
+ return _get_path_interpolator_at_time(interpolator, time_ratio, true);
+}
+
+static void _apply_group_animation_translate(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ (void)last;
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_translate_t for sure
+ vg_animation_translate_t* animation_translate = (vg_animation_translate_t*)animation;
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] data is a float array for sure
+ float* matrix = (float*)data;
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ LLVG_MATRIX_IMPL_translate(matrix, animation_translate->start_x + (animation_translate->translation_x * transformRatio),
+ animation_translate->start_y + (animation_translate->translation_y * transformRatio));
+}
+
+static void _apply_group_animation_translate_xy(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ (void)last;
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_translate_xy_t for sure
+ vg_animation_translate_xy_t* animation_translate = (vg_animation_translate_xy_t*)animation;
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] data is a float array for sure
+ float* matrix = (float*)data;
+ vg_path_interpolator_t* translation = get_path_interpolator_addr(animation_translate->offset_path_interpolator, memory_offset);
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ float translateX = _get_path_interpolator_at_time(translation, transformRatio, true);
+ float translateY = _get_path_interpolator_at_time(translation, transformRatio, false);
+ LLVG_MATRIX_IMPL_translate(matrix, translateX, translateY);
+}
+
+static void _apply_group_animation_rotate(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ (void)last;
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_rotate_t for sure
+ vg_animation_rotate_t* animation_rotate = (vg_animation_rotate_t*)animation;
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] data is a float array for sure
+ float* matrix = (float*)data;
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ LLVG_MATRIX_IMPL_translate(matrix, animation_rotate->start_rotation_center_x + (animation_rotate->rotation_translation_center_x * transformRatio),
+ animation_rotate->start_rotation_center_y + (animation_rotate->rotation_translation_center_y * transformRatio));
+ LLVG_MATRIX_IMPL_rotate(matrix, animation_rotate->start_angle + (animation_rotate->rotation_angle * transformRatio));
+ LLVG_MATRIX_IMPL_translate(matrix, -animation_rotate->start_rotation_center_x - (animation_rotate->rotation_translation_center_x * transformRatio),
+ -animation_rotate->start_rotation_center_y - (animation_rotate->rotation_translation_center_y * transformRatio));
+}
+
+static inline float _get_scale(float from, float to, float transformRatio) {
+ float ret;
+ if (from < to) {
+ ret = (float) (from * powf(to / from, transformRatio));
+ } else {
+ ret = (float) (to * powf(from / to, 1.f - transformRatio));
+ }
+ return ret;
+}
+
+static void _apply_group_animation_scale(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ (void)last;
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_scale_t for sure
+ vg_animation_scale_t* animation_scale = (vg_animation_scale_t*)animation;
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] data is a float array for sure
+ float* matrix = (float*)data;
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ float scaleX = _get_scale(animation_scale->scale_x_from, animation_scale->scale_x_to, transformRatio);
+ float scaleY = _get_scale(animation_scale->scale_y_from, animation_scale->scale_y_to, transformRatio);
+ LLVG_MATRIX_IMPL_translate(matrix, animation_scale->pivot_x, animation_scale->pivot_y);
+ LLVG_MATRIX_IMPL_scale(matrix, scaleX, scaleY);
+ LLVG_MATRIX_IMPL_translate(matrix, -animation_scale->pivot_x, -animation_scale->pivot_y);
+}
+
+/*
+ * This function returns the calculated in-between value for a color given integers that represent the start and end
+ * values in the four bytes of the 32-bit int. Each channel is separately linearly interpolated and the resulting
+ * calculated values are recombined into the return value.
+ *
+ * @param fraction
+ * The fraction from the starting to the ending values
+ * @param start_color
+ * A 32-bit int value representing colors in the separate bytes of the parameter
+ * @param end_color
+ * A 32-bit int value representing colors in the separate bytes of the parameter
+ * @return A value that is calculated to be the linearly interpolated result, derived by separating the start and
+ * end values into separate color channels and interpolating each one separately, recombining the resulting
+ * values in the same way.
+ */
+static uint32_t _interpolate_color(float fraction, uint32_t start_color, uint32_t end_color) {
+
+ float startA = ((float) (COLOR_GET_CHANNEL(start_color, ARGB8888, ALPHA))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float startR = ((float) (COLOR_GET_CHANNEL(start_color, ARGB8888, RED))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float startG = ((float) (COLOR_GET_CHANNEL(start_color, ARGB8888, GREEN))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float startB = ((float) (COLOR_GET_CHANNEL(start_color, ARGB8888, BLUE))) / COLOR_ARGB8888_CHANNEL_MASK;
+
+ float endA = ((float) (COLOR_GET_CHANNEL(end_color, ARGB8888, ALPHA))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float endR = ((float) (COLOR_GET_CHANNEL(end_color, ARGB8888, RED))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float endG = ((float) (COLOR_GET_CHANNEL(end_color, ARGB8888, GREEN))) / COLOR_ARGB8888_CHANNEL_MASK;
+ float endB = ((float) (COLOR_GET_CHANNEL(end_color, ARGB8888, BLUE))) / COLOR_ARGB8888_CHANNEL_MASK;
+
+ // convert from sRGB to linear
+ startR = (float) powf(startR, GAMMA_VALUE);
+ startG = (float) powf(startG, GAMMA_VALUE);
+ startB = (float) powf(startB, GAMMA_VALUE);
+
+ endR = (float) powf(endR, GAMMA_VALUE);
+ endG = (float) powf(endG, GAMMA_VALUE);
+ endB = (float) powf(endB, GAMMA_VALUE);
+
+ // compute the interpolated color in linear space
+ float a = startA + (fraction * (endA - startA));
+ float r = startR + (fraction * (endR - startR));
+ float g = startG + (fraction * (endG - startG));
+ float b = startB + (fraction * (endB - startB));
+
+ // convert back to sRGB in the [0..255] range
+ a = a * COLOR_ARGB8888_CHANNEL_MASK;
+ r = (float) powf(r, 1.0 / GAMMA_VALUE) * COLOR_ARGB8888_CHANNEL_MASK;
+ g = (float) powf(g, 1.0 / GAMMA_VALUE) * COLOR_ARGB8888_CHANNEL_MASK;
+ b = (float) powf(b, 1.0 / GAMMA_VALUE) * COLOR_ARGB8888_CHANNEL_MASK;
+
+ return COLOR_SET_COLOR((uint32_t)roundf(a), (uint32_t)roundf(r), (uint32_t)roundf(g), (uint32_t)roundf(b), ARGB8888);
+}
+
+static void _apply_path_animation_color(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_color_t for sure
+ vg_animation_color_t* animation_color = (vg_animation_color_t*)animation;
+
+ // cppcheck-suppress [misra-c2012-11.5] data is a 32-bit array for sure
+ uint32_t* color = (uint32_t*)data;
+ if (!last){
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ *color = _interpolate_color(transformRatio, animation_color->start_color, animation_color->end_color);
+ }
+ else {
+ *color = animation_color->end_color;
+ }
+}
+
+static void _apply_path_animation_alpha(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_alpha_t for sure
+ vg_animation_alpha_t* animation_alpha = (vg_animation_alpha_t*)animation;
+
+ // cppcheck-suppress [misra-c2012-11.5] data is a 8-bit array for sure
+ uint8_t* alpha = (uint8_t*)data;
+ if (!last){
+ vg_path_interpolator_t* interpolator = get_path_interpolator_addr(animation->offset_path_interpolator, memory_offset);
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ float end_alpha = ((uint8_t)0xff & animation_alpha->end_alpha);
+ float start_alpha = ((uint8_t)0xff & animation_alpha->start_alpha);
+ float result = (end_alpha * transformRatio) + (start_alpha * (1.0f - transformRatio));
+ *alpha = (uint8_t)result;
+ }
+ else {
+ *alpha = animation_alpha->end_alpha;
+ }
+}
+
+/*
+ * @brief Merges 2 paths with same commands.
+ *
+ * For each source path points a new point is calculated based on the source paths points
+ * coordinates and a ratio.
+ * If ratio = 0, resulting point will equal the first path point.
+ * If ratio = 1, resulting point will equal the second path point.
+ *
+ * @param[out] pathDest: the path array to update.
+ * @param[in] pathSrc1: the first path array to merge.
+ * @param[in] pathSrc2: the second path array to merge.
+ * @param[in] ratio: the merge ratio between paths points.
+ */
+static void _interpolate_paths(vg_lite_path_t* pathDest, vg_path_desc_t* pathSrc1, vg_path_desc_t* pathSrc2, float ratio) {
+
+ float remaining = (1.f - ratio);
+
+ // Compute bounds
+ float fSrc1 = pathSrc1->bounding_box[0];
+ float fSrc2 = pathSrc2->bounding_box[0];
+ float fDest = MEJ_MIN(fSrc1, fSrc2);
+ pathDest->bounding_box[0] = fDest;
+
+ fSrc1 = pathSrc1->bounding_box[1];
+ fSrc2 = pathSrc2->bounding_box[1];
+ fDest = MEJ_MIN(fSrc1, fSrc2);
+ pathDest->bounding_box[1] = fDest;
+
+ fSrc1 = pathSrc1->bounding_box[2];
+ fSrc2 = pathSrc2->bounding_box[2];
+ fDest = MEJ_MAX(fSrc1, fSrc2);
+ pathDest->bounding_box[2] = fDest;
+
+ fSrc1 = pathSrc1->bounding_box[3];
+ fSrc2 = pathSrc2->bounding_box[3];
+ fDest = MEJ_MAX(fSrc1, fSrc2);
+ pathDest->bounding_box[3] = fDest;
+
+ // Compute commands
+ uint32_t* dataDest = (uint32_t*)pathDest->path;
+ // cppcheck-suppress [misra-c2012-11.5] path is a 32-bit array for sure
+ uint32_t* dataSrc1 = (uint32_t*)get_path_data_addr(pathSrc1);
+ // cppcheck-suppress [misra-c2012-11.5] path is a 32-bit array for sure
+ uint32_t* dataSrc2 = (uint32_t*)get_path_data_addr(pathSrc2);
+
+ // cppcheck-suppress [misra-c2012-11.4] path is a 32-bit array for sure
+ uint32_t* dataDestEnd = (uint32_t*)(((uint32_t)pathDest->path) + pathSrc1->length);
+
+ while (dataDest < dataDestEnd) {
+
+ uint32_t cmdSrc1 = *dataSrc1;
+
+ uint32_t nb_parameters = MICROVG_PATH_get_command_parameter_number(cmdSrc1);
+
+ *dataDest = cmdSrc1;
+ dataSrc1++;
+ dataSrc2++;
+ dataDest++;
+
+ for(uint32_t j=0; joffset_path_interpolator, memory_offset);
+ float transformRatio = _get_transformation_ratio_at_time(animation, interpolator, atTime);
+ _interpolate_paths(
+ dest,
+ get_path_addr(animation_path_data->from, memory_offset),
+ get_path_addr(animation_path_data->to, memory_offset),
+ transformRatio
+ );
+ }
+ else {
+ // last path (== path "to")
+ vg_path_desc_t* to = get_path_addr(animation_path_data->to, memory_offset);
+ dest->path = get_path_data_addr(to);
+ (void)memcpy((void*)&(dest->bounding_box), (void*)&(to->bounding_box), (size_t)4 * sizeof(float));
+ }
+
+ // the command buffer length is now equal to the animation path length
+ dest->path_length = get_path_addr(animation_path_data->from, memory_offset)->length;
+}
+
+static void _apply_get_path_animation_path_length(vg_animation_header_t* animation, void* data, jlong atTime, size_t memory_offset, bool last) {
+ (void)atTime;
+ (void)last;
+ // cppcheck-suppress [misra-c2012-11.3] animations is a vg_animation_path_data_t for sure
+ vg_animation_path_data_t* animation_path_data = (vg_animation_path_data_t*)animation;
+ // cppcheck-suppress [misra-c2012-11.5] data is a uint32_t* for sure
+ uint32_t* path_length = (uint32_t*)data;
+ *path_length = MEJ_MAX(*path_length, get_path_addr(animation_path_data->from, memory_offset)->length);
+}
+
+static void _apply_animation(vg_animation_header_t* animation, void* data, jlong atTime, VG_RAW_apply_animation_t _animation_fct, size_t memory_offset) {
+ int32_t begin = animation->begin;
+ int32_t duration = animation->duration;
+ int32_t keep_duration = animation->keep_duration;
+
+ if (atTime >= begin) {
+ if (atTime < (begin + duration)) {
+ // the current frame isn't the last one
+ _animation_fct(animation, data, (atTime - begin), memory_offset, false);
+ } else if (atTime < (begin + duration + keep_duration) || (-1 == keep_duration)) {
+ // the final frame reached
+ _animation_fct(animation, data, duration, memory_offset, true);
+ } else {
+ // nothing to animate
+ }
+ }
+}
+
+static void* _apply_group_animations_translate(float* matrix, jlong elapsed_time, vg_animation_translate_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_translate_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)matrix, elapsed_time, &_apply_group_animation_translate, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_group_animations_translate_xy(float* matrix, jlong elapsed_time, vg_animation_translate_xy_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_translate_xy_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)matrix, elapsed_time, &_apply_group_animation_translate_xy, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_group_animations_rotate(float* matrix, jlong elapsed_time, vg_animation_rotate_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_rotate_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)matrix, elapsed_time, &_apply_group_animation_rotate, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_group_animations_scale(float* matrix, jlong elapsed_time, vg_animation_scale_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_scale_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)matrix, elapsed_time, &_apply_group_animation_scale, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_path_animations_color(uint32_t* color, jlong elapsed_time, vg_animation_color_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_color_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)color, elapsed_time, &_apply_path_animation_color, memory_offset);
+ anims++; // go to next animation
+ }
+ *color &= 0xffffff;
+ return (void*)anims;
+}
+
+static void* _derive_path_animations_color(vg_animation_color_t* animations, uint32_t size, const float color_matrix[]) {
+ vg_animation_color_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ anims->start_color = _filter_color(anims->start_color, color_matrix);
+ anims->end_color = _filter_color(anims->end_color, color_matrix);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_path_animations_alpha(uint8_t* alpha, jlong elapsed_time, vg_animation_alpha_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_alpha_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)alpha, elapsed_time, &_apply_path_animation_alpha, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _derive_path_animations_alpha(vg_animation_alpha_t* animations, uint32_t size, const float color_matrix[]) {
+ vg_animation_alpha_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ anims->start_alpha = _filter_alpha(anims->start_alpha, color_matrix);
+ anims->end_alpha = _filter_alpha(anims->end_alpha, color_matrix);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static void* _apply_path_animations_path_data(vg_lite_path_t* path, jlong elapsed_time, vg_animation_path_data_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_path_data_t* anims = animations;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)path, elapsed_time, &_apply_path_animation_path_data, memory_offset);
+ anims++; // go to next animation
+ }
+ return (void*)anims;
+}
+
+static uint32_t _get_path_animations_path_max_length(vg_lite_path_t* path, jlong elapsed_time, vg_animation_path_data_t* animations, uint32_t size, size_t memory_offset) {
+ vg_animation_path_data_t* anims = animations;
+ uint32_t length = path->path_length;
+ for(uint32_t i = 0; i < size; i++) {
+ // cppcheck-suppress [misra-c2012-11.3] animations can be casted as vg_animation_header_t
+ _apply_animation((vg_animation_header_t*)anims, (void*)&length, elapsed_time, &_apply_get_path_animation_path_length, memory_offset);
+ anims++; // go to next animation
+ }
+ return length;
+}
+/*
+ * @brief path is in ROM (RAW): have to copy the path in a local structure and update the address
+ * (replace the path data offset by the absolute address in ROM).
+ */
+static void _prepare_render_path(vg_drawing_t* drawing_data, vg_path_desc_t* image_path) {
+ vg_path_desc_t* path = get_path_addr(image_path, drawing_data->memory_offset);
+ vg_lite_init_path(
+ &render_path,
+ path->format,
+ VG_LITE_HIGH,
+ path->length,
+ get_path_data_addr(path),
+ path->bounding_box[0],
+ path->bounding_box[1],
+ path->bounding_box[2],
+ path->bounding_box[3]
+ );
+ render_path.path_type = VG_LITE_DRAW_FILL_PATH;
+}
+
+static inline jint _draw_render_path(VG_DRAWING_VGLITE_draw_image_element_t drawer, vg_lite_matrix_t* matrix, vg_block_path_t* op, uint32_t color) {
+ return (*drawer)(&render_path, op->fill_rule, matrix, VG_LITE_BLEND_SRC_OVER, color, NULL, false);
+}
+
+static inline jint _draw_render_gradient(VG_DRAWING_VGLITE_draw_image_element_t drawer, vg_lite_matrix_t* matrix, vg_lite_fill_t fill_rule, bool is_new_gradient) {
+ return (*drawer)(&render_path, fill_rule, matrix, VG_LITE_BLEND_SRC_OVER, 0, &render_gradient, is_new_gradient);
+}
+
+static bool _prepare_render_gradient(vg_drawing_t* drawing_data, vg_block_gradient_t* op, uint8_t alpha, const float color_matrix[], vg_lite_matrix_t* transformation) {
+
+ // copy op's gradient in a local gradient to apply the opacity
+ vg_lite_linear_gradient_t local_gradient;
+ vg_lite_linear_gradient_t* op_gradient = get_gradient_addr(op->gradient, drawing_data->memory_offset);
+ (void)memcpy(&local_gradient, op_gradient, GRADIENT_COPY_SIZE);
+ _prepare_gradient_colors(&local_gradient, alpha, color_matrix);
+
+ vg_lite_linear_gradient_t* p_render_gradient = &render_gradient;
+ bool is_new_gradient = (0 != memcmp(p_render_gradient, &local_gradient, GRADIENT_CMP_SIZE));
+
+ if (is_new_gradient) {
+ // copy the new gradient data in shared gradient
+ (void)memcpy(p_render_gradient, &local_gradient, GRADIENT_COPY_SIZE);
+ }
+
+ // update the gradient's matrix
+ LLVG_MATRIX_IMPL_multiply(
+ MAP_VGLITE_MATRIX(&(p_render_gradient->matrix)),
+ MAP_VGLITE_MATRIX(transformation),
+ MAP_VGLITE_MATRIX(&op_gradient->matrix)
+ );
+
+ return is_new_gradient;
+}
+
+static uint8_t* _animate_render_path(jlong elapsed_time, vg_animation_path_data_t* first_animation, uint32_t nb_animations, size_t memory_offset, jint* error) {
+
+ uint8_t* command_buffer;
+
+ *error = LLVG_SUCCESS;
+
+ if ((uint8_t)0 < nb_animations) {
+
+ // allocate a command buffer where "from" and "to" will be merged
+ uint32_t size = _get_path_animations_path_max_length(&render_path, elapsed_time, first_animation, nb_animations, memory_offset);
+ command_buffer = _alloc_data(size);
+
+ if (NULL != command_buffer) {
+
+ void* original_commands = render_path.path;
+ int32_t original_commands_length = render_path.path_length;
+
+ // update the destination commands buffer address
+ render_path.path = (void*)command_buffer;
+ render_path.path_length = 0;
+
+ // update path commands, the path length and the bounding box
+ (void)_apply_path_animations_path_data(&render_path, elapsed_time, first_animation, nb_animations, memory_offset);
+
+ if (0 == render_path.path_length) {
+
+ // no animation has been applied: restore the original path
+ render_path.path = original_commands;
+ render_path.path_length = original_commands_length;
+
+ // free the useless command buffer
+ _free_data(command_buffer);
+ command_buffer = NULL;
+ }
+ }
+ else {
+ *error = LLVG_OUT_OF_MEMORY;
+ }
+ // else not enough memory in heap: use original path
+ }
+ else {
+ // nothing to do: use path asis
+ command_buffer = NULL;
+ }
+
+ return command_buffer;
+}
+
+static inline void _animation_path_end(uint8_t* command_buffer) {
+ if (NULL != command_buffer) {
+ _free_data(command_buffer);
+ }
+}
+
+static inline vg_block_t* _go_to_next_block(vg_block_t* block, size_t size) {
+ // cppcheck-suppress [misra-c2012-11.3,misra-c2012-18.4] cast the block in a u8 address and points to the next block
+ return (vg_block_t*)(((uint8_t*)block) + size);
+}
+
+static jint _manage_block_gradient(vg_drawing_t* drawing_data, VG_DRAWING_VGLITE_draw_image_element_t target, vg_block_t* block, vg_lite_matrix_t* matrix, uint32_t alpha, const float color_matrix[], vg_lite_matrix_t* gradient_deformation) {
+
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_gradient_t for sure
+ vg_block_gradient_t* op = (vg_block_gradient_t*)block;
+
+ // prepare the gradient
+ _prepare_render_path(drawing_data, op->path.desc);
+ bool is_new_gradient = _prepare_render_gradient(drawing_data, op, alpha, color_matrix, gradient_deformation);
+
+ return _draw_render_gradient(target, matrix, op->path.fill_rule, is_new_gradient);
+}
+
+static void _get_image_parameters(vector_image_t* image, vg_drawing_t* drawing_data) {
+
+ if (!_is_image_address_relative(image)) {
+ // the addresses are absolute: no memory offset
+ drawing_data->memory_offset = 0;
+ }
+ else {
+ // the addresses are relative: the memory offset is tehe image address
+ // cppcheck-suppress [misra-c2012-11.4] save the image address as the memory offset to apply on each address
+ drawing_data->memory_offset = (size_t)image;
+ }
+
+ uint8_t* first_block_addr = (uint8_t*)image->first_block;
+
+ // cppcheck-suppress [misra-c2012-18.4] adds the absolute memory offset
+ first_block_addr += drawing_data->memory_offset;
+
+ // cppcheck-suppress [misra-c2012-11.3] address points to the first block for sure
+ drawing_data->first_block = (vg_block_t*)first_block_addr;
+
+ drawing_data->drawing_running = false;
+}
+
+// -----------------------------------------------------------------------------
+// BufferedVectorImage (BVI) Management
+// -----------------------------------------------------------------------------
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+/*
+ * @brief Tells if the image is in ROM.
+ */
+static inline bool _bvi_is_image_in_rom(vector_image_t* image) {
+ return 0u == image->flags.ram;
+}
+
+static inline void _bvi_tag_image_as_absolute(vector_image_t* image) {
+ image->flags.absolute = 1u;
+}
+
+static vg_path_desc_t* _bvi_store_vglite_path(vg_lite_path_t* path) {
+ // cppcheck-suppress [misra-c2012-11.3] the allocated data is a vg_path_desc_t for sure
+ vg_path_desc_t* data = (vg_path_desc_t*)_alloc_data(sizeof(vg_path_desc_t) + path->path_length);
+
+ if (NULL != data) {
+ uint8_t* cmd_addr = (uint8_t*)data;
+
+ // cppcheck-suppress [misra-c2012-18.4] points after the path description
+ cmd_addr += sizeof(vg_path_desc_t);
+
+ (void)memcpy((void*)&(data->bounding_box), (void*)&(path->bounding_box), (size_t)4 * sizeof(float));
+ (void)memcpy((void*)cmd_addr, path->path, path->path_length);
+ data->format = path->format;
+ data->length = path->path_length;
+ }
+
+ return data;
+}
+
+static inline vg_lite_linear_gradient_t* _bvi_store_vglite_gradient(vg_lite_linear_gradient_t * grad) {
+ return (vg_lite_linear_gradient_t*)_store_data(grad, GRADIENT_COPY_SIZE);
+}
+
+static inline vg_block_t* _bvi_free_operation_color(vg_block_bvi_color_t* op) {
+ vg_block_t* ret = op->next;
+ _free_data(op->header.path.desc);
+ _free_data(op);
+ return ret;
+}
+
+static inline vg_block_t* _bvi_free_operation_gradient(vg_block_bvi_gradient_t* op) {
+ vg_block_t* ret = op->next;
+ _free_data(op->header.path.desc);
+ if (!op->shared_gradient) {
+ _free_data(op->header.gradient);
+ }
+ _free_data(op);
+ return ret;
+}
+
+static inline vg_block_t* _bvi_free_operation_image(vg_block_bvi_image_t* op) {
+ vg_block_t* ret = op->next;
+ _free_data(op);
+ return ret;
+}
+
+static vg_block_t* _bvi_free_block(vg_block_t* block) {
+ vg_block_t* ret;
+ switch(block->kind) {
+ case VG_BLOCK_BVI_COLOR:
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_color_t for sure
+ ret = _bvi_free_operation_color((vg_block_bvi_color_t*)block);
+ break;
+ case VG_BLOCK_BVI_GRADIENT:
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_gradient_t for sure
+ ret = _bvi_free_operation_gradient((vg_block_bvi_gradient_t*)block);
+ break;
+ case VG_BLOCK_BVI_IMAGE:
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_image_t for sure
+ ret = _bvi_free_operation_image((vg_block_bvi_image_t*)block);
+ break;
+ case VG_BLOCK_GROUP_TRANSFORM:
+ case VG_BLOCK_GROUP_END:
+ case VG_BLOCK_LAST:
+ case VG_BLOCK_GROUP_ANIMATE:
+ case VG_BLOCK_RAW_GRADIENT:
+ case VG_BLOCK_PATH_COLOR_ANIMATE:
+ case VG_BLOCK_PATH_GRADIENT_ANIMATE:
+ default:
+ // a BVI cannot free this kind of block: never here
+ ret = block;
+ break;
+ }
+ return ret;
+}
+
+static inline jint _bvi_link_operations(vector_buffered_image_t* raw, vg_block_t* op, vg_block_t** op_next_block, bool oom) {
+
+ jint ret;
+
+ if (!oom) {
+ if (NULL == raw->latest_data) {
+ // very first block
+ raw->header.first_block = op;
+ }
+ else {
+ *(raw->latest_data) = op;
+ }
+ raw->latest_data = op_next_block;
+ *(op_next_block) = &(raw->last_block);
+
+ ret = LLVG_SUCCESS;
+ }
+ else {
+ (void)_bvi_free_block(op);
+ ret = LLVG_OUT_OF_MEMORY;
+ }
+
+ return ret;
+}
+
+static void _bvi_save_current_vglite_scissor(int32_t* dest) {
+ int32_t* scissor;
+ if (0u != vg_lite_get_scissor(&scissor)) {
+ (void)memcpy((void*)dest, (void*)scissor, 4u * sizeof(int32_t));
+ }
+ else {
+ // no clip: -1 is not a valid X clip value
+ dest[0] = -1;
+ }
+}
+
+static inline vector_buffered_image_t* _bvi_get_bvi_from_target(void* target) {
+ // cppcheck-suppress [misra-c2012-11.5] cast is possible (the target stored in drawer is a vector_buffered_image_t* for sure)
+ return (vector_buffered_image_t*)target;
+}
+
+static jint _bvi_add_draw_raw_image(
+ vector_buffered_image_t* dest,
+ vector_image_t* source,
+ jfloat *matrix,
+ jint alpha,
+ jlong elapsed,
+ const float color_matrix[]
+) {
+
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_image_t for sure
+ vg_block_bvi_image_t* op = (vg_block_bvi_image_t*)_alloc_data(sizeof(vg_block_bvi_image_t));
+ jint ret = LLVG_OUT_OF_MEMORY;
+
+ if (NULL != op) {
+
+ op->block.kind = VG_BLOCK_BVI_IMAGE;
+ op->alpha = (jchar)alpha;
+ op->image = source;
+ (void)memcpy((void*)&(op->matrix), (void*)matrix, (size_t)LLVG_MATRIX_SIZE * sizeof(jfloat));
+ _bvi_save_current_vglite_scissor(op->scissor);
+ if (NULL != color_matrix) {
+ // required size is checked by Java library
+ (void)memcpy((void*)&(op->color_matrix), color_matrix, (size_t)COLOR_MATRIX_SIZE * sizeof(jfloat));
+ op->flags = 1u;
+ }
+ else {
+ op->flags = 0u;
+ }
+ op->elapsed_msb = (jint)elapsed;
+ op->elapsed_lsb = (jint)(elapsed >> 32);
+
+ // cppcheck-suppress [misra-c2012-11.3] operation is a vg_block_t
+ ret = _bvi_link_operations(dest, (vg_block_t*)op, &(op->next), false);
+ }
+
+ return ret;
+}
+
+/*
+ * @brief Function type is "VG_DRAWING_VGLITE_draw_image_element_t" (called by _draw_raw_image()).
+ */
+static jint _bvi_add_image_element(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad, bool is_new_gradient) {
+ (void)is_new_gradient;
+ jint ret;
+ if (NULL == grad) {
+ ret = BVI_VGLITE_add_draw_path(bvi_target, path, fill_rule, matrix, blend, color);
+ }
+ else {
+ ret = BVI_VGLITE_add_draw_gradient(bvi_target, path, fill_rule, matrix, grad, blend);
+ }
+ return ret;
+}
+
+/*
+ * @brief Transform a 2D point by a given matrix.
+ *
+ * Copy from vg_lite.c
+ */
+static void _bvi_transform_point(vg_lite_point_t * result, vg_lite_float_t x, vg_lite_float_t y, vg_lite_matrix_t * matrix) {
+
+ /* Transform w. */
+ vg_lite_float_t pt_w = (x * matrix->m[2][0]) + (y * matrix->m[2][1]) + matrix->m[2][2];
+ if (pt_w <= 0.0f) {
+ result->x = 0;
+ result->y = 0;
+ }
+ else {
+ /* Transform x and y. */
+ vg_lite_float_t pt_x = (x * matrix->m[0][0]) + (y * matrix->m[0][1]) + matrix->m[0][2];
+ vg_lite_float_t pt_y = (x * matrix->m[1][0]) + (y * matrix->m[1][1]) + matrix->m[1][2];
+
+ /* Compute projected x and y. */
+ result->x = (int)(pt_x / pt_w);
+ result->y = (int)(pt_y / pt_w);
+ }
+}
+
+/*
+ * @brief Applies the scissor. The scissor is adjusted with the given matrix (image's matrix)
+ * and the current scissor (master scissor).
+ *
+ * @param[in] scissor: pointer to the scissor to apply or NULL.
+ * @param[in] matrix: pointer to the matrix to apply to the scissor.
+ * @param[in/out] current_scissor: pointer to the current scissor, set to NULL when the scissor is modified and has to be restored after the drawing.
+ *
+ * @return false when no drawing should be performed (empty scissor), true otherise.
+ */
+static bool _bvi_apply_scissor(int32_t* scissor, vg_lite_matrix_t *matrix, int32_t** current_scissor) {
+
+ bool draw = true;
+
+ if (scissor[0] >= 0) {
+ vg_lite_point_t top_left;
+ vg_lite_point_t bottom_right;
+
+ // get the top-left and bottom-right scissor points adjusted with the given matrix.
+ _bvi_transform_point(&top_left, (vg_lite_float_t)scissor[0], (vg_lite_float_t)scissor[1], matrix);
+ _bvi_transform_point(&bottom_right, (vg_lite_float_t)(scissor[0] + scissor[2] - 1), (vg_lite_float_t)(scissor[1] + scissor[3] - 1), matrix);
+
+ if ((*current_scissor) != NULL) {
+
+ int32_t cx1 = (*current_scissor)[0];
+ int32_t cy1 = (*current_scissor)[1];
+ int32_t cx2 = cx1 + (*current_scissor)[2] - 1;
+ int32_t cy2 = cy1 + (*current_scissor)[3] - 1;
+
+ if (top_left.x < cx1) {
+ top_left.x = cx1;
+ }
+ if (top_left.y < cy1) {
+ top_left.y = cy1;
+ }
+ if (bottom_right.x >= cx2) {
+ bottom_right.x = cx2;
+ }
+ if (bottom_right.y >= cy2) {
+ bottom_right.y = cy2;
+ }
+ }
+
+ if ((top_left.x <= bottom_right.x) && (top_left.y <= bottom_right.y)) {
+ vg_lite_enable_scissor();
+ vg_lite_set_scissor(top_left.x, top_left.y, bottom_right.x - top_left.x + 1, bottom_right.y - top_left.y + 1);
+ *current_scissor = NULL; // have to restore the clip
+ }
+ else {
+ // empty clip: nothing to restore and nothing to draw
+ draw = false;
+ }
+
+ }
+ // else: no local clip: nothing to restore
+
+ return draw;
+}
+
+static int32_t* _bvi_restore_scissor(int32_t* original_scissor, int32_t* current_scissor) {
+ if (original_scissor != current_scissor) {
+ // the scissor has been modified: restore the original one
+ if (NULL != original_scissor) {
+ vg_lite_enable_scissor();
+ vg_lite_set_scissor(original_scissor[0], original_scissor[1], original_scissor[2], original_scissor[3]);
+ }
+ else {
+ vg_lite_disable_scissor();
+ }
+ }
+ return original_scissor;
+}
+
+static vg_block_t* _bvi_clear_blocks(vector_buffered_image_t* image) {
+ vg_block_t* block = image->header.first_block;
+ while(VG_BLOCK_LAST != block->kind) {
+ block = _bvi_free_block(block);
+ }
+ return block;
+}
+
+/*
+ * @brief Combines two color matrices into a single one.
+ *
+ * The application of the returned matrix is equivalent to the successive application of the two given matrices.
+ *
+ * The algorithm used in this method is based on to the computation of the matrix multiplication B x A
+ * where a 5th row of values (0, 0, 0, 0, 1) would be appended to the matrix A.
+ *
+ * - Matrix a can be null, in such case, matrix b is returned,
+ * - Matrix b can be null, in such case, matrix a is returned,
+ * - Both matrices can be null, in such case, NULL is returned,
+ * - if not null, the result is stored in the global matrix "combined_color_matrices" (old content is overwritten)
+ * and returned
+ *
+ * @param a
+ * the operation matrix.
+ * @param b
+ * the transformation to apply.
+ * @return the combined matrix.
+ */
+static float* _combine_color_matrices(float* a, float* b) {
+
+ float* dest;
+
+ if (NULL != a) {
+ // operation holds a color matrix (image matrix)
+ if (NULL != b) {
+ // draw with another matrix
+
+ // -> need to combine user matrix and operation matrix
+ // use the shared array
+ dest = combined_color_matrices;
+ (void)memset(dest, 0, (size_t)COLOR_MATRIX_SIZE * sizeof(float));
+
+ for (int y = 0; y < COLOR_MATRIX_HEIGHT; y++) {
+ int y5 = y * COLOR_MATRIX_WIDTH;
+ for (int x = 0; x < COLOR_MATRIX_WIDTH; x++) {
+ // here (x,y) is the cell to compute
+ for (int i = 0; i < COLOR_MATRIX_WIDTH; i++) {
+ if (i < COLOR_MATRIX_HEIGHT) {
+ int i5 = i * COLOR_MATRIX_WIDTH;
+ dest[y5 + x] += b[y5 + i] * a[i5 + x];
+ } else {
+ dest[y5 + x] += b[y5 + i] * CONSTANT_ROW[x];
+ }
+ }
+ }
+ }
+ }
+ else {
+ // use the operation matrix
+ dest = a;
+ }
+ }
+ else if (NULL != b){
+ // use the user matrix
+ dest = b;
+ }
+ else {
+ // no color matrix to apply
+ dest = NULL;
+ }
+
+ return dest;
+}
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+static jint _draw_raw_image(vg_drawing_t* drawing_data, VG_DRAWING_VGLITE_draw_image_element_t target, jfloat* matrix, uint32_t alpha, jlong elapsedTime, const float color_matrix[]) {
+
+ vg_block_t* block = drawing_data->first_block;
+ bool animate = elapsedTime >= 0;
+ jlong elapsed_time = animate ? elapsedTime : 0; // default time when there is no animation
+
+ // create initial transformation with application's matrix
+ drawing_data->first_transformation.parent = NULL;
+ (void)memcpy((void*)&(drawing_data->first_transformation.matrix), (void*)matrix, sizeof(vg_lite_matrix_t));
+ vg_transformation_t* p_render_transformation = &(drawing_data->first_transformation);
+
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ int32_t original_scissor[4];
+ int32_t* p_original_scissor;
+ int32_t* p_current_scissor;
+ if (0u != vg_lite_get_scissor(&p_original_scissor)) {
+ // p_original_scissor points to vglite scissor
+
+ // save vglite scissor in "original scissor"
+ original_scissor[0] = p_original_scissor[0];
+ original_scissor[1] = p_original_scissor[1];
+ original_scissor[2] = p_original_scissor[2];
+ original_scissor[3] = p_original_scissor[3];
+
+ // now p_original_scissor points to the local array
+ p_original_scissor = original_scissor;
+ p_current_scissor = original_scissor;
+ }
+ else {
+ // no current scissor
+ p_original_scissor = NULL;
+ p_current_scissor = NULL;
+ }
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ jint ret = LLVG_SUCCESS;
+ bool done = false;
+ while(!done) {
+
+ switch(block->kind) {
+
+ case VG_BLOCK_LAST:{
+ done = true;
+ }
+ break;
+
+ case VG_BLOCK_GROUP_TRANSFORM:{
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_group_transform_t for sure
+ vg_block_group_transform_t* op = (vg_block_group_transform_t*)block;
+
+ // copy current transformation
+ vg_transformation_t* parent_transformation = p_render_transformation;
+ p_render_transformation = _store_vg_transformation(parent_transformation);
+
+ if (NULL != p_render_transformation){
+ p_render_transformation->parent = parent_transformation;
+
+ // concatenate first transformation with new operation transformation
+ LLVG_MATRIX_IMPL_concatenate(MAP_VGLITE_MATRIX(&(p_render_transformation->matrix)), MAP_VGLITE_MATRIX(&(op->matrix)));
+ }
+ else {
+ ret = LLVG_OUT_OF_MEMORY;
+ // Cannot apply a new transformation: keep the current one.
+ }
+
+ block = _go_to_next_block(block, sizeof(vg_block_group_transform_t));
+ }
+ break;
+
+ case VG_BLOCK_GROUP_END:{
+ if (NULL != p_render_transformation->parent){
+
+ // back to parent transformation
+ vg_transformation_t* transformation_to_remove = p_render_transformation;
+ p_render_transformation = transformation_to_remove->parent;
+ _free_vg_transformation(transformation_to_remove);
+ }
+
+ block = _go_to_next_block(block, sizeof(vg_block_group_end_t));
+ }
+ break;
+
+ case VG_BLOCK_GROUP_ANIMATE:{
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_group_animation_t for sure
+ vg_block_group_animation_t* op = (vg_block_group_animation_t*)block;
+
+ // copy current transformation
+ vg_transformation_t* parent_transformation = p_render_transformation;
+ p_render_transformation = _store_vg_transformation(parent_transformation);
+
+ if (NULL != p_render_transformation){
+ p_render_transformation->parent = parent_transformation;
+
+ float* mapped_matrix = MAP_VGLITE_MATRIX(&(p_render_transformation->matrix));
+ // cppcheck-suppress [misra-c2012-18.4] points after the operation
+ void* animations_offset = ((uint8_t*)op) + sizeof(vg_block_group_animation_t);
+
+ if (animate) {
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_translate_t for sure
+ animations_offset = _apply_group_animations_translate(mapped_matrix, elapsed_time, (vg_animation_translate_t*)animations_offset, op->nb_translates, drawing_data->memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_translate_xy_t for sure
+ animations_offset = _apply_group_animations_translate_xy(mapped_matrix, elapsed_time, (vg_animation_translate_xy_t*)animations_offset, op->nb_translates_xy, drawing_data->memory_offset);
+ }
+
+ LLVG_MATRIX_IMPL_translate(mapped_matrix, op->translate_x, op->translate_y);
+
+ if (animate) {
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_rotate_t for sure
+ animations_offset = _apply_group_animations_rotate(mapped_matrix, elapsed_time, (vg_animation_rotate_t*)animations_offset, op->nb_rotates, drawing_data->memory_offset);
+ }
+
+ LLVG_MATRIX_IMPL_translate(mapped_matrix, op->pivot_x, op->pivot_y);
+ LLVG_MATRIX_IMPL_rotate(mapped_matrix, op->rotation);
+ LLVG_MATRIX_IMPL_translate(mapped_matrix, -op->pivot_x, -op->pivot_y);
+
+ if (animate) {
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_scale_t for sure
+ /*animations_offset =*/ (void)_apply_group_animations_scale(mapped_matrix, elapsed_time, (vg_animation_scale_t*)animations_offset, op->nb_scales, drawing_data->memory_offset);
+ }
+
+ LLVG_MATRIX_IMPL_translate(mapped_matrix, op->pivot_x, op->pivot_y);
+ LLVG_MATRIX_IMPL_scale(mapped_matrix, op->scale_x, op->scale_y);
+ LLVG_MATRIX_IMPL_translate(mapped_matrix, -op->pivot_x, -op->pivot_y);
+ }
+ else {
+ ret = LLVG_OUT_OF_MEMORY;
+ // Cannot apply a new transformation: keep the current one.
+ }
+
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_COLOR_ANIMATE: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_animate_color_t for sure
+ vg_block_animate_color_t* op = (vg_block_animate_color_t*)block;
+ // cppcheck-suppress [misra-c2012-18.4] points after the operation
+ void* animations_offset = ((uint8_t*)op) + sizeof(vg_block_animate_color_t);
+
+ // update color & alpha
+ uint32_t color = op->header.color;
+ uint8_t color_alpha = COLOR_GET_CHANNEL(color, ARGB8888, ALPHA);
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_color_t for sure
+ animations_offset = _apply_path_animations_color(&color, elapsed_time, (vg_animation_color_t*)animations_offset, op->nb_colors, drawing_data->memory_offset);
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_alpha_t for sure
+ animations_offset = _apply_path_animations_alpha(&color_alpha, elapsed_time, (vg_animation_alpha_t*)animations_offset, op->nb_alphas, drawing_data->memory_offset);
+ color |= (color_alpha << COLOR_ARGB8888_ALPHA_OFFSET);
+ color = _prepare_render_color(color, alpha, color_matrix);
+
+ // prepare & animate the path
+ _prepare_render_path(drawing_data, op->header.path.desc);
+ jint error;
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_path_data_t for sure
+ uint8_t* command_buffer = _animate_render_path(elapsed_time, (vg_animation_path_data_t*)animations_offset, op->nb_path_datas, drawing_data->memory_offset, &error);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+
+ error = _draw_render_path(target, &(p_render_transformation->matrix), &(op->header.path), color);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+
+ _animation_path_end(command_buffer);
+
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_GRADIENT_ANIMATE: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_animate_gradient_t for sure
+ vg_block_animate_gradient_t* op = (vg_block_animate_gradient_t*)block;
+ // cppcheck-suppress [misra-c2012-18.4] points after the operation
+ void* animations_offset = ((uint8_t*)op) + sizeof(vg_block_animate_gradient_t);
+
+ uint32_t alpha_to_apply = alpha;
+ if ((uint8_t)0 < op->nb_alphas) {
+ // update alpha
+ uint8_t alpha_anim = (uint8_t)0xff;
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_alpha_t for sure
+ animations_offset = _apply_path_animations_alpha(&alpha_anim, elapsed_time, (vg_animation_alpha_t*)animations_offset, op->nb_alphas, drawing_data->memory_offset);
+ alpha_to_apply *= alpha_anim;
+ alpha_to_apply /= 255;
+ }
+
+ // prepare & animate the path
+ _prepare_render_path(drawing_data, op->header.path.desc);
+ jint error;
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_path_data_t for sure
+ uint8_t* command_buffer = _animate_render_path(elapsed_time, (vg_animation_path_data_t*)animations_offset, op->nb_path_datas, drawing_data->memory_offset, &error);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+
+ // prepare the gradient
+ bool is_new_gradient = _prepare_render_gradient(drawing_data, &(op->header), alpha_to_apply, color_matrix, &(p_render_transformation->matrix));
+
+ error = _draw_render_gradient(target, &(p_render_transformation->matrix), op->header.path.fill_rule, is_new_gradient);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+
+ _animation_path_end(command_buffer);
+
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_COLOR: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_color_t for sure
+ vg_block_color_t* op = (vg_block_color_t*)block;
+ _prepare_render_path(drawing_data, op->path.desc);
+ uint32_t color = _prepare_render_color(op->color, alpha, color_matrix);
+ jint error = _draw_render_path(target, &(p_render_transformation->matrix), &(op->path), color);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+ block = _go_to_next_block(block, sizeof(vg_block_color_t));
+ }
+ break;
+
+ case VG_BLOCK_RAW_GRADIENT: {
+ // apply same deformation on path and gradient
+ jint error = _manage_block_gradient(drawing_data, target, block, &(p_render_transformation->matrix), alpha, color_matrix, &(p_render_transformation->matrix));
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+ block = _go_to_next_block(block, sizeof(vg_block_gradient_t));
+ }
+ break;
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ case VG_BLOCK_BVI_COLOR: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_color_t for sure
+ vg_block_bvi_color_t* op = (vg_block_bvi_color_t*)block;
+
+ if (_bvi_apply_scissor(op->scissor, &(p_render_transformation->matrix), &p_current_scissor)) {
+
+ // concatenate first transformation with new operation transformation
+ vg_lite_matrix_t temp;
+ LLVG_MATRIX_IMPL_multiply(MAP_VGLITE_MATRIX(&temp), MAP_VGLITE_MATRIX(&(p_render_transformation->matrix)), MAP_VGLITE_MATRIX(&(op->path_deformation)));
+
+ _prepare_render_path(drawing_data, op->header.path.desc);
+ uint32_t color = _prepare_render_color(op->header.color, alpha, color_matrix);
+ jint error = _draw_render_path(target, &temp, &(op->header.path), color);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+
+ // the clip may have been modified: restore the original one
+ p_current_scissor = _bvi_restore_scissor(p_original_scissor, p_current_scissor);
+ }
+ block = op->next;
+ }
+ break;
+
+ case VG_BLOCK_BVI_GRADIENT: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_gradient_t for sure
+ vg_block_bvi_gradient_t* op = (vg_block_bvi_gradient_t*)block;
+
+ if (_bvi_apply_scissor(op->scissor, &(p_render_transformation->matrix), &p_current_scissor)) {
+
+ // concatenate first transformation with new operation transformation
+ vg_lite_matrix_t temp;
+ LLVG_MATRIX_IMPL_multiply(MAP_VGLITE_MATRIX(&temp), MAP_VGLITE_MATRIX(&(p_render_transformation->matrix)), MAP_VGLITE_MATRIX(&(op->path_deformation)));
+
+ // do not apply same deformation on path and gradient (gradient already "has" the path's deformation)
+ jint error = _manage_block_gradient(drawing_data, target, block, &temp, alpha, color_matrix, &(p_render_transformation->matrix));
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running = true;
+
+ // the clip may have been modified: restore the original one
+ p_current_scissor = _bvi_restore_scissor(p_original_scissor, p_current_scissor);
+ }
+ block = op->next;
+ }
+ break;
+
+ case VG_BLOCK_BVI_IMAGE: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_image_t for sure
+ vg_block_bvi_image_t* op = (vg_block_bvi_image_t*)block;
+
+ if (_bvi_apply_scissor(op->scissor, &(p_render_transformation->matrix), &p_current_scissor)) {
+
+ _get_image_parameters(op->image, &raw_in_bvi_drawing_data);
+
+ // retrieve elapsed time
+ jlong elapsedTime_msb = op->elapsed_msb;
+ jlong elapsedTime_lsb = op->elapsed_lsb;
+ elapsedTime_msb <<= 32;
+ elapsedTime_lsb &= 0xfffffffful;
+ jlong raw_elapsed_time = (elapsedTime_msb | elapsedTime_lsb);
+
+ // merge operation's color matrix with global color matrix
+ float* image_color_matrix = (1u == op->flags) ? (float*)op->color_matrix : NULL;
+ // cppcheck-suppress [misra-c2012-11.8] allow cast to float*
+ image_color_matrix = _combine_color_matrices(image_color_matrix, (float*)color_matrix);
+
+ // merge operation's alpha with global alpha
+ uint32_t image_alpha = op->alpha;
+ image_alpha *= alpha;
+ image_alpha /= 255;
+
+ // concatenate first transformation with new operation transformation
+ vg_lite_matrix_t temp;
+ LLVG_MATRIX_IMPL_multiply(MAP_VGLITE_MATRIX(&temp), MAP_VGLITE_MATRIX(&(p_render_transformation->matrix)), MAP_VGLITE_MATRIX(&(op->matrix)));
+
+ // cppcheck-suppress [misra-c2012-17.2] only one level of recursion
+ jint error = _draw_raw_image(&raw_in_bvi_drawing_data, target, MAP_VGLITE_MATRIX(&temp), image_alpha, raw_elapsed_time, image_color_matrix);
+ if (LLVG_SUCCESS != error) {
+ ret = error;
+ }
+ drawing_data->drawing_running |= raw_in_bvi_drawing_data.drawing_running;
+ }
+
+ block = op->next;
+ }
+ break;
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ default:
+ MEJ_LOG_ERROR_MICROVG("unknown operation: %u\n", block->kind);
+ ret = LLVG_DATA_INVALID;
+ done = true;
+ break;
+ }
+ }
+
+ return ret;
+}
+
+static void _derive_raw_image(vg_drawing_t* drawing_data, const float color_matrix[]) {
+
+ bool done = false;
+ vg_block_t* block = drawing_data->first_block;
+
+ while(!done) {
+
+ switch(block->kind) {
+
+ case VG_BLOCK_LAST:{
+ done = true;
+ }
+ break;
+
+ case VG_BLOCK_GROUP_TRANSFORM: {
+ // nothing to do
+ block = _go_to_next_block(block, sizeof(vg_block_group_transform_t));
+ }
+ break;
+
+ case VG_BLOCK_GROUP_END: {
+ // nothing to do
+ block = _go_to_next_block(block, sizeof(vg_block_group_end_t));
+ }
+ break;
+
+ case VG_BLOCK_GROUP_ANIMATE: {
+ // nothing to do
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_group_animation_t for sure
+ vg_block_group_animation_t* op = (vg_block_group_animation_t*)block;
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_COLOR_ANIMATE: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_animate_color_t for sure
+ vg_block_animate_color_t* op = (vg_block_animate_color_t*)block;
+ // cppcheck-suppress [misra-c2012-18.4] points after the operation
+ void* animations_offset = ((uint8_t*)op) + sizeof(vg_block_animate_color_t);
+ op->header.color = _filter_color(op->header.color, color_matrix);
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_color_t for sure
+ animations_offset = _derive_path_animations_color((vg_animation_color_t*)animations_offset, op->nb_colors, color_matrix);
+ // cppcheck-suppress [misra-c2012-11.5] animations_offset points on a vg_animation_alpha_t for sure
+ /*animations_offset =*/ (void)_derive_path_animations_alpha((vg_animation_alpha_t*)animations_offset, op->nb_alphas, color_matrix);
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_GRADIENT_ANIMATE: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_animate_gradient_t for sure
+ vg_block_animate_gradient_t* op = (vg_block_animate_gradient_t*)block;
+ vg_lite_linear_gradient_t* gradient = get_gradient_addr(op->header.gradient, drawing_data->memory_offset);
+ _filter_gradient(gradient, color_matrix);
+ block = _go_to_next_block(block, op->block_size);
+ }
+ break;
+
+ case VG_BLOCK_PATH_COLOR: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_color_t for sure
+ vg_block_color_t* op = (vg_block_color_t*)block;
+ op->color = _filter_color(op->color, color_matrix);
+ block = _go_to_next_block(block, sizeof(vg_block_color_t));
+ }
+ break;
+
+ case VG_BLOCK_RAW_GRADIENT: {
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_gradient_t for sure
+ vg_block_gradient_t* op = (vg_block_gradient_t*)block;
+ vg_lite_linear_gradient_t* gradient = get_gradient_addr(op->gradient, drawing_data->memory_offset);
+ _filter_gradient(gradient, color_matrix);
+ block = _go_to_next_block(block, sizeof(vg_block_gradient_t));
+ }
+ break;
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ case VG_BLOCK_BVI_COLOR:
+ case VG_BLOCK_BVI_GRADIENT:
+ case VG_BLOCK_BVI_IMAGE:
+ // must not occur: can only derive from a RAW image (see BufferedVectorImage.filterImage())
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+ default:
+ MEJ_LOG_ERROR_MICROVG("unknown operation: %u\n", block->kind);
+ done = true;
+ break;
+ }
+ }
+}
+
+static void _initialize(void) {
+ if (!initialiazed) {
+
+ // prepare the gradient used by all draw_gradient
+ (void)memset(&(render_gradient), 0, sizeof(vg_lite_linear_gradient_t));
+ (void)vg_lite_init_grad(&(render_gradient)); // always success
+ render_gradient.image.format = VG_LITE_RGBA8888; // fix color format
+
+ initialiazed = true;
+ }
+}
+
+/*
+ * @brief Tells if the byte array denotes a RAW image. A RAW image is identified
+ * by its signature.
+ */
+static inline bool _is_raw_image(uint8_t* image) {
+ return 0 == memcmp(image, signature, sizeof(signature));
+}
+
+static inline void _store_image_metadata(const vector_image_t* image, jint extra_flags, jint* metadata) {
+ metadata[RAW_OFFSET_F32_WIDTH] = JFLOAT_TO_UINT32_t(image->width);
+ metadata[RAW_OFFSET_F32_HEIGHT] = JFLOAT_TO_UINT32_t(image->height);
+ metadata[RAW_OFFSET_U32_DURATION] = image->flags.duration;
+ metadata[RAW_OFFSET_U32_FLAGS] = (image->flags.overlapping ? RAW_FLAG_OVERLAP_PATH : 0) | extra_flags;
+}
+
+#if VG_FEATURE_RAW_EXTERNAL
+
+static inline void _store_image_resource(vector_image_t* image, int32_t resource_size, SNIX_resource* resource) {
+ resource->data = (void*) image;
+ resource->size = resource_size;
+}
+
+/*
+ * @brief Loads a RAW vector image from external memory
+ *
+ * The resource is opened from external memory if it exists. Its address, size and metadata are stored in the output parameters.
+ * If the resource exists in a byte-addressable area, the output address will be that of this memory area.
+ * Otherwise, a RAM area will be allocated on the MicroUI image heap, the resource will be copied into that area, and the output address will be that of the newly allocated memory area.
+ * In the latter case, metadata will contain a RAW_FLAG_FREE_MEMORY_ON_CLOSE. The caller is responsible for properly deallocating the memory.
+ *
+ * @param[in] image_name: name of the image to be opened
+ * @param[in] allocation_allowed: true to allow an allocation in the images heap, false when forbidden
+ * @param[out] resource: structure to save the address and size of the image
+ * @param[out] metadata: integer array to save the width, height, animation duration and flags of the image
+ *
+ * @return LLVG_SUCCESS on a successful loading, any other value on a failure.
+ */
+static int _load_external_image(char const* image_name, bool allocation_allowed, SNIX_resource* resource, jint* metadata) {
+ int result = LLVG_SUCCESS;
+
+ // Ignore the leading '/' in the path.
+ char const* image_external_path = image_name;
+ image_external_path ++;
+
+ // Open the resource matching the provided path.
+ RES_ID resource_id = LLEXT_RES_open(image_external_path);
+ if (0 > resource_id) {
+ result = LLVG_DATA_INVALID_PATH;
+ }
+ else {
+ // Retrieve the address and size of the resource.
+ int32_t resource_size = LLEXT_RES_available(resource_id);
+ int32_t base_address = LLEXT_RES_getBaseAddress(resource_id);
+
+ vector_image_t* image = NULL;
+
+ // Initialize the library (if needed)
+ _initialize();
+
+ if (-1 != base_address) {
+ // The resource is located in a byte-addressable memory area. This will be the output address.
+ // cppcheck-suppress [misra-c2012-11.4] base_address is a vector_image_t for sure
+ image = (vector_image_t*) base_address;
+
+ // Put the address, size and metadata in the ouptut parameters.
+ _store_image_resource(image, resource_size, resource);
+
+ result = LLVG_SUCCESS;
+ }
+ else if (!allocation_allowed) {
+ // image is available but required a copy in the images heap
+ result = LLVG_DATA_INVALID_PATH;
+ }
+ else {
+ // The resource is located in a memory area that cannot be byte-addressed.
+
+ // Allocate memory on the MicroUI image heap to store the image. Its address will be the output address.
+ image = (vector_image_t*) LLUI_DISPLAY_IMPL_imageHeapAllocate(resource_size);
+ if (NULL == image) {
+ // Out of memory.
+ result = LLVG_OUT_OF_MEMORY;
+ }
+ else {
+ // Copy the image from the external memory into the allocated area.
+ if (LLEXT_RES_OK != LLEXT_RES_read(resource_id, (void*) image, &resource_size)) {
+ result = LLVG_DATA_INVALID;
+ }
+ else if (!_is_raw_image((uint8_t*)image)){
+ // it is not a RAW image -> free it
+ LLUI_DISPLAY_IMPL_imageHeapFree((uint8_t* )image);
+ result = LLVG_DATA_INVALID;
+ }
+ else {
+ /* Put the address, size and metadata in the ouptut parameters.
+ * RAW_FLAG_FREE_MEMORY_ON_CLOSE flags the image as requiring to be deallocated.
+ */
+ _store_image_resource(image, resource_size, resource);
+ _store_image_metadata(image, RAW_FLAG_FREE_MEMORY_ON_CLOSE, metadata);
+ _tag_image_in_ram(image);
+
+ result = LLVG_SUCCESS;
+ }
+ }
+ }
+
+ // Close the resource.
+ LLEXT_RES_close(resource_id);
+ }
+
+ return result;
+}
+
+#endif // VG_FEATURE_RAW_EXTERNAL
+
+// -----------------------------------------------------------------------------
+// BufferedVectorImage (BVI) Management
+// -----------------------------------------------------------------------------
+
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+void BVI_VGLITE_adjust_new_image_characteristics(uint32_t width, uint32_t height, uint32_t* data_size, uint32_t* data_alignment) {
+ (void)width;
+ (void)height;
+ (void)data_alignment;
+ *data_size += sizeof(vector_buffered_image_t);
+}
+
+void BVI_VGLITE_initialize_new_image(MICROUI_Image* image) {
+
+ _initialize();
+
+ vector_buffered_image_t* bvi = MAP_BVI_ON_IMAGE(image);
+
+ bvi->header.width = (float)image->width;
+ bvi->header.height = (float)image->height;
+ bvi->header.flags.duration = 0;
+ bvi->header.flags.overlapping = 0;
+ bvi->header.first_block = &(bvi->last_block);
+
+ bvi->last_block.kind = VG_BLOCK_LAST;
+ bvi->latest_data = NULL; // very first block
+ bvi->last_stored_gradient = NULL;
+
+ // cppcheck-suppress [misra-c2012-11.3] bvi is a vector_image_t for sure
+ vector_image_t* raw = (vector_image_t*)bvi;
+ _tag_image_in_ram(raw);
+ _bvi_tag_image_as_absolute(raw);
+}
+
+void BVI_VGLITE_free_resources(MICROUI_Image* image) {
+ (void)_bvi_clear_blocks(MAP_BVI_ON_IMAGE(image));
+}
+
+jint BVI_VGLITE_add_draw_path(
+ void* target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color) {
+
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_color_t for sure
+ vg_block_bvi_color_t* op = (vg_block_bvi_color_t*)_alloc_data(sizeof(vg_block_bvi_color_t));
+ jint ret = LLVG_OUT_OF_MEMORY;
+
+ if (NULL != op) {
+ vector_buffered_image_t* image = _bvi_get_bvi_from_target(target);
+
+ op->header.path.block.kind = VG_BLOCK_BVI_COLOR;
+ op->header.path.fill_rule = fill_rule;
+ op->header.path.blend = blend;
+ op->header.path.desc = _bvi_store_vglite_path(path);
+ op->header.color = (uint32_t)color;
+ _bvi_save_current_vglite_scissor(op->scissor);
+ (void)memcpy((void*)&(op->path_deformation), (void*)matrix, sizeof(vg_lite_matrix_t));
+
+ // cppcheck-suppress [misra-c2012-11.3] operation is a vg_block_t
+ ret = _bvi_link_operations(image, (vg_block_t*)op, &(op->next), (NULL == op->header.path.desc));
+ }
+
+ return ret;
+}
+
+jint BVI_VGLITE_add_draw_gradient(
+ void* target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_linear_gradient_t * grad,
+ vg_lite_blend_t blend) {
+
+ // cppcheck-suppress [misra-c2012-11.3] block is a vg_block_bvi_gradient_t for sure
+ vg_block_bvi_gradient_t* op = (vg_block_bvi_gradient_t*)_alloc_data(sizeof(vg_block_bvi_gradient_t));
+ jint ret = LLVG_OUT_OF_MEMORY;
+
+ if (NULL != op) {
+ vector_buffered_image_t* image = _bvi_get_bvi_from_target(target);
+
+ op->header.path.block.kind = VG_BLOCK_BVI_GRADIENT;
+ op->header.path.fill_rule = fill_rule;
+ op->header.path.blend = blend;
+ op->header.path.desc = _bvi_store_vglite_path(path);
+
+ if ((NULL != image->last_stored_gradient) && (0 == memcmp(grad, image->last_stored_gradient, GRADIENT_COPY_SIZE))) {
+ // the both gradient operations use the same gradient
+ // -> second operation can link the gradient of first operation
+ op->header.gradient = image->last_stored_gradient;
+ op->shared_gradient = true; // do not free it!
+ }
+ else {
+ op->header.gradient = _bvi_store_vglite_gradient(grad);
+ op->shared_gradient = false; // have to free it
+ image->last_stored_gradient = op->header.gradient;
+ }
+
+ _bvi_save_current_vglite_scissor(op->scissor);
+ (void)memcpy((void*)&(op->path_deformation), (void*)matrix, sizeof(vg_lite_matrix_t));
+
+ // cppcheck-suppress [misra-c2012-11.3] operation is a vg_block_t
+ ret = _bvi_link_operations(image, (vg_block_t*)op, &(op->next), ((NULL == op->header.path.desc) || (NULL == op->header.gradient)));
+ }
+
+ return ret;
+}
+
+jint BVI_VGLITE_add_draw_image(void* target, void* sni_context, jfloat* drawing_matrix, jint alpha, jlong elapsed, const float color_matrix[]){
+
+ // cppcheck-suppress [misra-c2012-11.5] sni_context is a vector image for sure
+ vector_image_t* image = (vector_image_t*)((SNIX_resource*)sni_context)->data;
+ jint ret;
+
+ if (_bvi_is_image_in_rom(image)) {
+ // no need to parse the image: just add a block in the BVI
+ vector_buffered_image_t* dest = _bvi_get_bvi_from_target(target);
+ ret = _bvi_add_draw_raw_image(dest, image, drawing_matrix, alpha, elapsed, color_matrix);
+ }
+ else {
+ // have to copy all image elements in the destination (== a bvi)
+ // if the source image holds a RAW image block (points to a RAW image), each element of this
+ // RAW image is drawn in the destination.
+
+ _get_image_parameters(image, &drawing_data);
+ bvi_target = target;
+ ret = _draw_raw_image(&drawing_data, &_bvi_add_image_element, drawing_matrix, alpha, elapsed, color_matrix);
+
+ /*
+ * When the target is a BufferedVectorImage, the data of render_gradient has been updated but not the VGLite image
+ * (it is useless and time consuming). However the image may be required later (if the new drawing's gradient data
+ * is equal to the stored gradient data). In this case, the VGLite image will be out of date (not synchronized with
+ * the gradient data) but will not be updated.
+ * A simple solution consists to ensure that next gradient comparison will fail.
+ */
+ (void)memset(&render_gradient, 0, GRADIENT_CMP_SIZE);
+ }
+
+ return ret;
+}
+
+void LLVG_BVI_IMPL_map_context(MICROUI_Image* ui, void* sni_context) {
+ // cppcheck-suppress [misra-c2012-11.5] sni_context is a SNIX_resource for sure
+ SNIX_resource* vg = (SNIX_resource*)sni_context;
+ vg->data = (void*)MAP_BVI_ON_IMAGE(ui);
+ vg->size = sizeof(vector_buffered_image_t);
+}
+
+void LLVG_BVI_IMPL_clear(MICROUI_GraphicsContext* gc) {
+
+ if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)&LLVG_BVI_IMPL_clear)) {
+
+ // map a struct on graphics context's pixel area
+ vector_buffered_image_t* image = MAP_BVI_ON_GC(gc);
+
+ image->header.first_block = _bvi_clear_blocks(image); // reset first block
+ image->latest_data = NULL; // reset to identify the very first block
+
+ LLUI_DISPLAY_setDrawingStatus(DRAWING_DONE);
+ }
+}
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// -----------------------------------------------------------------------------
+// Java library natives
+// -----------------------------------------------------------------------------
+
+void VG_DRAWING_get_image_size(void* sni_context, float* width, float* height) {
+ // cppcheck-suppress [misra-c2012-11.5] data is a vector image for sure
+ vector_image_t* image = (vector_image_t*)((SNIX_resource*)sni_context)->data;
+ *width = image->width;
+ *height = image->height;
+}
+
+jint Java_ej_microvg_VectorGraphicsNatives_getImage(char* path, jint path_length, SNIX_resource* res, jint* metadata) {
+
+ LOG_MICROVG_IMAGE_START(load);
+
+ (void)path_length;
+
+ _initialize();
+
+ jint ret;
+ int32_t sni_ret = SNIX_get_resource(path, res);
+
+#if VG_FEATURE_RAW_EXTERNAL
+ // image not found in the application resource list
+ if ((sni_ret < 0) && (LLVG_SUCCESS == _load_external_image(path, false, res, metadata))) {
+ // image found available in external memory which is byte addressable
+ sni_ret = 0;
+ }
+#endif // VG_FEATURE_RAW_EXTERNAL
+
+ if (sni_ret < 0) {
+ ret = LLVG_DATA_INVALID_PATH;
+ }
+ // cppcheck-suppress [misra-c2012-11.5] cast the resource in a u8 address
+ else if (!_is_raw_image((uint8_t*)res->data)) {
+ ret = LLVG_DATA_INVALID;
+ }
+ else {
+
+ // cppcheck-suppress [misra-c2012-11.5] resource is a vector image for sure
+ vector_image_t* image = (vector_image_t*)res->data;
+
+ // metadata used by the Java library during image opening
+ _store_image_metadata(image, 0, metadata);
+
+ ret = LLVG_SUCCESS;
+ }
+
+ LOG_MICROVG_IMAGE_END(load);
+ return ret;
+}
+
+jint Java_ej_microvg_VectorGraphicsNatives_loadImage(char* path, jint path_length, SNIX_resource* res, jint* metadata) {
+ jint result = Java_ej_microvg_VectorGraphicsNatives_getImage(path, path_length, res, metadata);
+
+#if VG_FEATURE_RAW_EXTERNAL
+ if (LLVG_DATA_INVALID_PATH == result) {
+ // try to load a non-byte addressable image (copy in ui heap)
+ result = _load_external_image(path, true, res, metadata);
+ }
+#endif
+
+ return result;
+}
+
+jint VG_DRAWING_VGLITE_draw_image(VG_DRAWING_VGLITE_draw_image_element_t drawer, void* sni_context, jfloat* drawing_matrix, jint alpha, jlong elapsed, const float color_matrix[], bool* rendered){
+ // cppcheck-suppress [misra-c2012-11.5] sni_context is a vector image for sure
+ vector_image_t* image = (vector_image_t*)((SNIX_resource*)sni_context)->data;
+ _get_image_parameters(image, &drawing_data);
+ jint error = _draw_raw_image(&drawing_data, drawer, drawing_matrix, alpha, elapsed, color_matrix);
+ *rendered = (LLVG_SUCCESS == error) && drawing_data.drawing_running;
+ return error;
+}
+
+jint Java_ej_microvg_VectorGraphicsNatives_createImage(SNIX_resource* source, SNIX_resource* dest, const float color_matrix[]) {
+
+ LOG_MICROVG_IMAGE_START(create);
+
+ // cppcheck-suppress [misra-c2012-11.5] source is a vector image for sure
+ vector_image_t* image = (vector_image_t*)source->data;
+
+ // the source is a RAW image (in ROM or RAM) but not a BVI (see BufferedVectorImage.filterImage())
+ assert(!_is_image_bvi(image));
+
+ dest->data = (void*)LLUI_DISPLAY_IMPL_imageHeapAllocate(source->size);
+ jint ret;
+
+ if (NULL != dest->data){
+ (void)memcpy(dest->data, source->data, source->size);
+ dest->size = source->size;
+
+ // cppcheck-suppress [misra-c2012-11.5] destination is a vector image for sure
+ image = (vector_image_t*)dest->data;
+ _tag_image_in_ram(image);
+
+ _get_image_parameters(image, &drawing_data);
+ _derive_raw_image(&drawing_data, color_matrix);
+
+ ret = LLVG_SUCCESS;
+ }
+ else {
+ ret = LLVG_OUT_OF_MEMORY;
+ }
+
+ LOG_MICROVG_IMAGE_END(create);
+ return ret;
+}
+
+void Java_ej_microvg_VectorGraphicsNatives_closeImage(SNIX_resource* res) {
+ if ((NULL != res) && (NULL != res->data) && ((uint32_t)0 < res->size)) {
+
+ LOG_MICROVG_IMAGE_START(close);
+
+ // cppcheck-suppress [misra-c2012-11.5] cast res->data as uint8_t* is allowed
+ if (_is_raw_image((uint8_t*)res->data)) {
+ // have to free to vector resource image data
+ // cppcheck-suppress [misra-c2012-11.5] cast the resource in a u8 address
+ LLUI_DISPLAY_IMPL_imageHeapFree((uint8_t* )res->data);
+ }
+ // else: it is an image allocated on the Java heap or in a BVI: nothing to free
+
+ LOG_MICROVG_IMAGE_END(close);
+
+ res->data = NULL;
+ res->size = 0;
+ }
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
diff --git a/bsp/projects/microej/vg/src/LLVG_impl.c b/bsp/projects/microej/vg/src/LLVG_impl.c
new file mode 100644
index 0000000..3082ac4
--- /dev/null
+++ b/bsp/projects/microej/vg/src/LLVG_impl.c
@@ -0,0 +1,67 @@
+/*
+ * C
+ *
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief Initializes the MicroVG implementation.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+#include
+
+#include "microvg_configuration.h"
+#include "microvg_helper.h"
+#include "microvg_font_freetype.h"
+#include "microvg_path.h"
+#include "microvg_trace.h"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -----------------------------------------------------------------------------
+
+#if (defined(LLVG_MAJOR_VERSION) && (LLVG_MAJOR_VERSION != 1)) || (defined(LLVG_MINOR_VERSION) && (LLVG_MINOR_VERSION < 3))
+#error "This CCO is only compatible with VG Pack [1.3.0,2.0.0["
+#endif
+
+// -----------------------------------------------------------------------------
+// Globals
+// -----------------------------------------------------------------------------
+
+/*
+ * microvg_trace.h logs group identifier
+ */
+int32_t vg_trace_group_id;
+
+// -----------------------------------------------------------------------------
+// LLVG_impl.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void LLVG_IMPL_initialize(void) {
+
+ vg_trace_group_id = LLTRACE_IMPL_declare_event_group("MicroVG", LOG_MICROVG_EVENTS);
+
+ MICROVG_HELPER_initialize();
+
+#if defined VG_FEATURE_FONT && \
+ (defined VG_FEATURE_FONT_FREETYPE_VECTOR || defined VG_FEATURE_FONT_FREETYPE_BITMAP) && \
+ (VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_VECTOR || VG_FEATURE_FONT == VG_FEATURE_FONT_FREETYPE_BITMAP)
+
+ MICROVG_FONT_FREETYPE_initialize();
+#endif
+
+#ifdef VG_FEATURE_PATH
+ MICROVG_PATH_initialize();
+#endif
+}
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_vglite.c b/bsp/projects/microej/vg/src/LLVG_vglite.c
similarity index 83%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_vglite.c
rename to bsp/projects/microej/vg/src/LLVG_vglite.c
index cbb5fe7..67a507b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/LLVG_vglite.c
+++ b/bsp/projects/microej/vg/src/LLVG_vglite.c
@@ -1,15 +1,15 @@
/*
* C
*
- * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2022-2024 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
/**
* @file
- * @brief MicroVG library low level API over VG-Lite.
+ * @brief MicroVG library low level API over VGLite.
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 7.0.1
*/
// -----------------------------------------------------------------------------
@@ -28,7 +28,6 @@
#include "microvg_vglite_helper.h"
#include "vg_lite.h"
#include "color.h"
-#include "display_vglite.h"
#include "bsp_util.h"
// -----------------------------------------------------------------------------
@@ -39,7 +38,6 @@
#error "This implementation is only compatible with VG_FEATURE_GRADIENT_FULL"
#endif
-#define ALPHA_SHIFT 24
#define VGLITE_GRADIENT_SIZE 256
// -----------------------------------------------------------------------------
@@ -135,6 +133,12 @@ vg_lite_blend_t MICROVG_VGLITE_HELPER_get_blend(jint blend) {
case LLVG_BLEND_DST_IN:
ret = VG_LITE_BLEND_DST_IN;
break;
+ case LLVG_BLEND_DST_OUT:
+ ret = VG_LITE_BLEND_SUBTRACT;
+ break;
+ case LLVG_BLEND_PLUS:
+ ret = VG_LITE_BLEND_ADDITIVE;
+ break;
case LLVG_BLEND_SCREEN:
ret = VG_LITE_BLEND_SCREEN;
break;
@@ -145,27 +149,6 @@ vg_lite_blend_t MICROVG_VGLITE_HELPER_get_blend(jint blend) {
return ret;
}
-// See the header file for the function documentation
-bool MICROVG_VGLITE_HELPER_enable_vg_lite_scissor(MICROUI_GraphicsContext* gc)
-{
- int32_t width = gc->clip_x2 - gc->clip_x1 + 1;
- int32_t height = gc->clip_y2 - gc->clip_y1 + 1;
-
- bool ret;
- if ((width > 0) && (height > 0))
- {
- vg_lite_enable_scissor();
- vg_lite_set_scissor(gc->clip_x1, gc->clip_y1, width, height);
- ret = true;
- }
- else {
- // drawing is useless
- LLUI_DISPLAY_setDrawingStatus(DRAWING_DONE);
- ret = false;
- }
- return ret;
-}
-
// -----------------------------------------------------------------------------
// microvg_gradient.h functions
// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/microvg_helper.c b/bsp/projects/microej/vg/src/microvg_helper.c
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/microvg_helper.c
rename to bsp/projects/microej/vg/src/microvg_helper.c
index 663e207..4b3c4a9 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vg/src/microvg_helper.c
+++ b/bsp/projects/microej/vg/src/microvg_helper.c
@@ -1,7 +1,7 @@
/*
* C
*
- * Copyright 2022 MicroEJ Corp. All rights reserved.
+ * Copyright 2022-2023 MicroEJ Corp. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be found with this software.
*/
@@ -10,7 +10,7 @@
* @brief MicroEJ MicroVG library low level API: helper to implement library natives
* methods.
* @author MicroEJ Developer Team
-* @version 2.0.0
+* @version 5.0.0
*/
// -----------------------------------------------------------------------------
@@ -18,11 +18,14 @@
// -----------------------------------------------------------------------------
#include
-#include
#include "microvg_helper.h"
#include "microvg_configuration.h"
+#if defined VG_FEATURE_FONT
+#include
+#endif
+
// -----------------------------------------------------------------------------
// Configuration Sanity Check
// -----------------------------------------------------------------------------
@@ -39,7 +42,7 @@
#error "Undefined MICROVG_CONFIGURATION_VERSION, it must be defined in microvg_configuration.h"
#endif
-#if defined MICROVG_CONFIGURATION_VERSION && MICROVG_CONFIGURATION_VERSION != 1
+#if defined MICROVG_CONFIGURATION_VERSION && MICROVG_CONFIGURATION_VERSION != 2
#error "Version of the configuration file microvg_configuration.h is not compatible with this implementation."
#endif
@@ -72,6 +75,7 @@
static jfloat g_identity_matrix[LLVG_MATRIX_SIZE];
+#if defined VG_FEATURE_FONT
static FT_Face face;
// Freetype layout variables
@@ -79,6 +83,7 @@ static unsigned short *current_text;
static unsigned int current_length;
static int current_offset;
static FT_UInt previous_glyph_index; // previous glyph index for kerning
+#endif
#if defined VG_FEATURE_FONT_COMPLEX_LAYOUT
// Harfbuzz layout variables
@@ -87,7 +92,7 @@ static hb_glyph_position_t *glyph_pos;
static unsigned int glyph_count;
static int current_glyph;
static hb_buffer_t *buf;
-#endif
+#endif
// -----------------------------------------------------------------------------
// Public functions
// -----------------------------------------------------------------------------
@@ -101,34 +106,38 @@ void MICROVG_HELPER_initialize(void) {
int MICROVG_HELPER_get_utf(unsigned short *textCharRam, int length, int *offset) {
unsigned short highPart = GET_NEXT_CHARACTER(textCharRam, length, *offset);
- int ret = 0;
+ int ret = 0; // means "error" (see doc)
- if (((highPart >= MIN_HIGH_SURROGATE) && (highPart <= MAX_HIGH_SURROGATE))
- && (*offset < (length - 1))) {
+ if ((highPart >= MIN_HIGH_SURROGATE) && (highPart <= MAX_HIGH_SURROGATE)) {
- unsigned short lowPart = GET_NEXT_CHARACTER(textCharRam, length, *(offset) + 1);
+ if (*offset < (length - 1)) {
- if ((lowPart >= MIN_LOW_SURROGATE) && (lowPart <= MAX_LOW_SURROGATE)) {
- *offset += 2;
+ unsigned short lowPart = GET_NEXT_CHARACTER(textCharRam, length, *(offset) + 1);
- ret = 0;
- ret += ((int)highPart - (int)MIN_HIGH_SURROGATE);
- ret <<= (int)10;
- ret += ((int)lowPart - (int)MIN_LOW_SURROGATE);
- ret += (int)MIN_SUPPLEMENTARY_CODE_POINT;
+ if ((lowPart >= MIN_LOW_SURROGATE) && (lowPart <= MAX_LOW_SURROGATE)) {
+ *offset += 2;
+
+ ret = 0;
+ ret += ((int)highPart - (int)MIN_HIGH_SURROGATE);
+ ret <<= (int)10;
+ ret += ((int)lowPart - (int)MIN_LOW_SURROGATE);
+ ret += (int)MIN_SUPPLEMENTARY_CODE_POINT;
+ }
+ // else: invalid surrogate pair
}
+ // else: missing second part of surrogate pair
}
else {
*offset += 1;
- // standard character or missing low part
+ // standard character
ret = 0x0000FFFF & (int)highPart;
}
return ret;
}
-
+#if defined VG_FEATURE_FONT
// See the header file for the function documentation
void MICROVG_HELPER_layout_configure(int faceHandle, unsigned short *text, int length){
face = (FT_Face) faceHandle;
@@ -172,7 +181,9 @@ void MICROVG_HELPER_layout_configure(int faceHandle, unsigned short *text, int l
#endif // VG_FEATURE_FONT_COMPLEX_LAYOUT
}
}
+#endif
+#if defined VG_FEATURE_FONT
// See the header file for the function documentation
bool MICROVG_HELPER_layout_load_glyph(int *glyph_idx, int *x_advance, int *y_advance, int *x_offset, int *y_offset){
// Initiate return value with default values
@@ -244,6 +255,7 @@ bool MICROVG_HELPER_layout_load_glyph(int *glyph_idx, int *x_advance, int *y_adv
return ret;
}
+#endif
// See the header file for the function documentation
jfloat* MICROVG_HELPER_check_matrix(jfloat* matrix) {
diff --git a/bsp/projects/microej/vg/src/vg_drawing.c b/bsp/projects/microej/vg/src/vg_drawing.c
new file mode 100644
index 0000000..d6ca4bf
--- /dev/null
+++ b/bsp/projects/microej/vg/src/vg_drawing.c
@@ -0,0 +1,363 @@
+/*
+ * C
+ *
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief Redirection of all MicroVG library drawing functions. This file is required
+ * (must be compiled in the C project) but should not be modified (except when the VEE
+ * port uses more than 3 destination formats, see below).
+ *
+ * This file follows strictly the same concept as ui_drawing.c but for MicroVG
+ * library.
+ *
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ * @see ui_drawing.c
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "vg_drawing.h"
+#include "vg_drawing_stub.h"
+#include "bsp_util.h"
+
+// --------------------------------------------------------------------------------
+// Defines
+// --------------------------------------------------------------------------------
+
+#if !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The function VG_DRAWING_DEFAULT_xxx() are directly called by LLVG_PAINTER_impl.c
+ * Another file can override each weak function independently to use a GPU.
+ */
+
+#define VG_DRAWING_DEFAULT_drawPath VG_DRAWING_drawPath
+#define VG_DRAWING_DEFAULT_drawGradient VG_DRAWING_drawGradient
+#define VG_DRAWING_DEFAULT_drawString VG_DRAWING_drawString
+#define VG_DRAWING_DEFAULT_drawStringGradient VG_DRAWING_drawStringGradient
+#define VG_DRAWING_DEFAULT_drawStringOnCircle VG_DRAWING_drawStringOnCircle
+#define VG_DRAWING_DEFAULT_drawStringOnCircleGradient VG_DRAWING_drawStringOnCircleGradient
+#define VG_DRAWING_DEFAULT_drawImage VG_DRAWING_drawImage
+
+#else // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+/*
+ * The functions VG_DRAWING_DEFAULT_xxx() are indirectly called through some tables.
+ * The functions have got the identifier "0" as suffix. Another file can override
+ * each weak function independently to use a GPU.
+ */
+
+#define VG_DRAWING_DEFAULT_drawPath VG_DRAWING_drawPath_0
+#define VG_DRAWING_DEFAULT_drawGradient VG_DRAWING_drawGradient_0
+#define VG_DRAWING_DEFAULT_drawString VG_DRAWING_drawString_0
+#define VG_DRAWING_DEFAULT_drawStringGradient VG_DRAWING_drawStringGradient_0
+#define VG_DRAWING_DEFAULT_drawStringOnCircle VG_DRAWING_drawStringOnCircle_0
+#define VG_DRAWING_DEFAULT_drawStringOnCircleGradient VG_DRAWING_drawStringOnCircleGradient_0
+#define VG_DRAWING_DEFAULT_drawImage VG_DRAWING_drawImage_0
+
+#endif // !defined(LLUI_GC_SUPPORTED_FORMATS) || (LLUI_GC_SUPPORTED_FORMATS <= 1)
+
+// --------------------------------------------------------------------------------
+// Extern functions
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Set of drawing functions according to the index of the destination format in
+ * the drawing tables ("0", "1" or "2").
+ *
+ * These functions must be declared in other H files.
+ */
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 3)
+#error "Increase the number of following functions and update the next tables"
+#endif
+
+extern DRAWING_Status VG_DRAWING_drawPath_0(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+extern DRAWING_Status VG_DRAWING_drawGradient_0(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawString_0(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+extern DRAWING_Status VG_DRAWING_drawStringGradient_0(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircle_0(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircleGradient_0(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawImage_0(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+extern DRAWING_Status VG_DRAWING_drawPath_1(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+extern DRAWING_Status VG_DRAWING_drawGradient_1(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawString_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+extern DRAWING_Status VG_DRAWING_drawStringGradient_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircle_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircleGradient_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+extern DRAWING_Status VG_DRAWING_drawPath_2(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+extern DRAWING_Status VG_DRAWING_drawGradient_2(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawString_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+extern DRAWING_Status VG_DRAWING_drawStringGradient_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircle_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+extern DRAWING_Status VG_DRAWING_drawStringOnCircleGradient_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+extern DRAWING_Status VG_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+#endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+#endif // defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// --------------------------------------------------------------------------------
+// Typedef of drawing functions
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * @brief Typedef used by next tables. See the functions comments in vg_drawing.h
+ */
+
+typedef DRAWING_Status (* VG_DRAWING_drawPath_t) (MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color);
+typedef DRAWING_Status (* VG_DRAWING_drawGradient_t) (MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix);
+typedef DRAWING_Status (* VG_DRAWING_drawString_t) (MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing);
+typedef DRAWING_Status (* VG_DRAWING_drawStringGradient_t) (MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix);
+typedef DRAWING_Status (* VG_DRAWING_drawStringOnCircle_t) (MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction);
+typedef DRAWING_Status (* VG_DRAWING_drawStringOnCircleGradient_t) (MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix);
+typedef DRAWING_Status (* VG_DRAWING_drawImage_t) (MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno);
+
+#endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+
+// --------------------------------------------------------------------------------
+// Tables according to the destination format.
+// --------------------------------------------------------------------------------
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+static const VG_DRAWING_drawPath_t VG_DRAWER_drawPath[] = {
+ &VG_DRAWING_drawPath_0,
+ &VG_DRAWING_drawPath_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawPath_2,
+#endif
+};
+
+static const VG_DRAWING_drawGradient_t VG_DRAWER_drawGradient[] = {
+ &VG_DRAWING_drawGradient_0,
+ &VG_DRAWING_drawGradient_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawGradient_2,
+#endif
+};
+
+static const VG_DRAWING_drawString_t VG_DRAWER_drawString[] = {
+ &VG_DRAWING_drawString_0,
+ &VG_DRAWING_drawString_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawString_2,
+#endif
+};
+
+static const VG_DRAWING_drawStringGradient_t VG_DRAWER_drawStringGradient[] = {
+ &VG_DRAWING_drawStringGradient_0,
+ &VG_DRAWING_drawStringGradient_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawStringGradient_2,
+#endif
+};
+
+static const VG_DRAWING_drawStringOnCircle_t VG_DRAWER_drawStringOnCircle[] = {
+ &VG_DRAWING_drawStringOnCircle_0,
+ &VG_DRAWING_drawStringOnCircle_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawStringOnCircle_2,
+#endif
+};
+
+static const VG_DRAWING_drawStringOnCircleGradient_t VG_DRAWER_drawStringOnCircleGradient[] = {
+ &VG_DRAWING_drawStringOnCircleGradient_0,
+ &VG_DRAWING_drawStringOnCircleGradient_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawStringOnCircleGradient_2,
+#endif
+};
+
+static const VG_DRAWING_drawImage_t VG_DRAWER_drawImage[] = {
+ &VG_DRAWING_drawImage_0,
+ &VG_DRAWING_drawImage_1,
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+ &VG_DRAWING_drawImage_2,
+#endif
+};
+
+#endif
+
+// --------------------------------------------------------------------------------
+// vg_drawing.h functions
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color){
+ return VG_DRAWING_STUB_drawPath(gc, path, x, y, matrix, fillRule, blend, color);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix){
+ return VG_DRAWING_STUB_drawGradient(gc, path, x, y, matrix, fillRule, alpha, blend, gradient, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return VG_DRAWING_STUB_drawString(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, gradientData, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return VG_DRAWING_STUB_drawStringOnCircle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringOnCircleGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_DEFAULT_drawImage(MICROUI_GraphicsContext* gc, void* sni_context, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno) {
+ return VG_DRAWING_STUB_drawImage(gc, sni_context, matrix, alpha, elapsed, color_matrix, errno);
+}
+
+#if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * The VEE port supports several destination formats. All drawing functions use a
+ * dedicated table to redirect to the right implementation.
+ *
+ * The "DEFAULT" functions (see upper) are used as element "0" of the tables (== display
+ * buffer format).
+ */
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT inline DRAWING_Status VG_DRAWING_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color){
+ return (*VG_DRAWER_drawPath[gc->drawer])(gc, path, x, y, matrix, fillRule, blend, color);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT inline DRAWING_Status VG_DRAWING_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix){
+ return (*VG_DRAWER_drawGradient[gc->drawer])(gc, path, x, y, matrix, fillRule, alpha, blend, gradient, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return (*VG_DRAWER_drawString[gc->drawer])(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return (*VG_DRAWER_drawStringGradient[gc->drawer])(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, gradientData, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return (*VG_DRAWER_drawStringOnCircle[gc->drawer])(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return (*VG_DRAWER_drawStringOnCircleGradient[gc->drawer])(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT inline DRAWING_Status VG_DRAWING_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno) {
+ return (*VG_DRAWER_drawImage[gc->drawer])(gc, image, matrix, alpha, elapsed, color_matrix, errno);
+}
+
+/*
+ * The next functions are used as elements "1" of the tables. They call STUB functions and should be
+ * overridden by the drawer that manages the format "1".
+ */
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawPath_1(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color){
+ return VG_DRAWING_STUB_drawPath(gc, path, x, y, matrix, fillRule, blend, color);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawGradient_1(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix){
+ return VG_DRAWING_STUB_drawGradient(gc, path, x, y, matrix, fillRule, alpha, blend, gradient, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawString_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return VG_DRAWING_STUB_drawString(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringGradient_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, gradientData, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircle_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return VG_DRAWING_STUB_drawStringOnCircle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircleGradient_1(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringOnCircleGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawImage_1(MICROUI_GraphicsContext* gc, void* sni_context, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno) {
+ return VG_DRAWING_STUB_drawImage(gc, sni_context, matrix, alpha, elapsed, color_matrix, errno);
+}
+
+
+#if (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+/*
+ * The next functions are used as elements "2" of the tables. They call STUB functions and should be
+ * overridden by the drawer that manages the format "2".
+ */
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawPath_2(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color){
+ return VG_DRAWING_STUB_drawPath(gc, path, x, y, matrix, fillRule, blend, color);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawGradient_2(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix){
+ return VG_DRAWING_STUB_drawGradient(gc, path, x, y, matrix, fillRule, alpha, blend, gradient, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawString_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return VG_DRAWING_STUB_drawString(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringGradient_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, gradientData, gradientMatrix);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircle_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return VG_DRAWING_STUB_drawStringOnCircle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawStringOnCircleGradient_2(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return VG_DRAWING_STUB_drawStringOnCircleGradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+// See the header file for the function documentation
+BSP_DECLARE_WEAK_FCNT DRAWING_Status VG_DRAWING_drawImage_2(MICROUI_GraphicsContext* gc, void* sni_context, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno) {
+ return VG_DRAWING_STUB_drawImage(gc, sni_context, matrix, alpha, elapsed, color_matrix, errno);
+}
+
+#endif // (LLUI_GC_SUPPORTED_FORMATS > 2)
+
+#else // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+/*
+ * The VEE port supports only one destination format: the display buffer format. All
+ * drawing functions are redirected to the stub implementation by default. A
+ * third party implementation (often on a GPU) should replace each weak function independently.
+ */
+
+#endif // #if defined(LLUI_GC_SUPPORTED_FORMATS) && (LLUI_GC_SUPPORTED_FORMATS > 1)
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/bsp/projects/microej/vg/src/vg_drawing_bvi.c b/bsp/projects/microej/vg/src/vg_drawing_bvi.c
new file mode 100644
index 0000000..e96fe8f
--- /dev/null
+++ b/bsp/projects/microej/vg/src/vg_drawing_bvi.c
@@ -0,0 +1,222 @@
+/*
+ * C
+ *
+ * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief Implementation of a set of vg_drawing.h drawing functions (library MicroVG).
+ * These are implementations over VGLite and the destination buffer format is the BufferedVectorImage
+ * format (VEE Port specific). When the drawing cannot be performed by the GPU, the stub implementation
+ * is used insted.
+ *
+ * Like vg_drawing_vglite.c, this file redirects the drawings of the strings and the images to some
+ * third-party files. These files don't perform the drawing themselves and let the caller do it. The
+ * drawing function is specified by vg_drawing_bvi.c to target BufferedVectorImage buffer.
+ *
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ * @see vg_drawing_vglite.c
+ * @see ui_drawing_bvi.c
+ */
+
+#include "microvg_configuration.h"
+#if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include "vg_drawing_bvi.h"
+#include "bvi_vglite.h"
+#include "ui_vglite.h"
+#include "vg_drawing_vglite.h"
+#include "microvg_helper.h"
+#include "microvg_vglite_helper.h"
+
+// -----------------------------------------------------------------------------
+// Private globals
+// -----------------------------------------------------------------------------
+
+/**
+ * @brief Current BufferedVectorImage to update
+ */
+static void* target;
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+// VG_DRAWING_VGLITE_draw_glyph_t
+static jint _add_glyph_color(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad) {
+ (void)grad;
+ return BVI_VGLITE_add_draw_path(target, path, fill_rule, matrix, blend, color);
+}
+
+// VG_DRAWING_VGLITE_draw_glyph_t
+static jint _add_glyph_gradient(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad) {
+ (void)color;
+ return BVI_VGLITE_add_draw_gradient(target, path, fill_rule, matrix, grad, blend);
+}
+
+static DRAWING_Status _draw_string_on_circle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // prepare color
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_color_t vglite_color = (vg_lite_color_t)((gc->foreground_color & 0x00FFFFFF) + (int)(((unsigned int) alpha) << 24));
+
+ // add operation
+ bool rendered;
+ target = MAP_BVI_ON_GC(gc);
+ jint error = VG_DRAWING_VGLITE_draw_string(&_add_glyph_color, text, faceHandle, size, &vglite_matrix, vglite_blend, vglite_color, MICROVG_HELPER_NULL_GRADIENT, letterSpacing, radius, direction, &rendered);
+ MICROVG_VGLITE_handle_error(gc, error);
+ }
+ // else no error: the drawing is just "not performed"
+
+ return DRAWING_DONE;
+}
+
+static DRAWING_Status _draw_string_on_circle_gradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // parepare gradient
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_linear_gradient_t vglite_gradient;
+ vg_lite_error_t vglite_error = VG_DRAWING_VGLITE_prepare_gradient(&vglite_gradient, gradientData, gradientMatrix, &vglite_matrix, alpha);
+
+ if (VG_LITE_SUCCESS == vglite_error) {
+
+ // add operation
+ bool rendered;
+ target = MAP_BVI_ON_GC(gc);
+ jint error = VG_DRAWING_VGLITE_draw_string(&_add_glyph_gradient, text, faceHandle, size, &vglite_matrix, vglite_blend, 0, &vglite_gradient, letterSpacing, radius, direction, &rendered);
+ MICROVG_VGLITE_handle_error(gc, error);
+
+ // post operation
+ VG_DRAWING_VGLITE_clear_gradient(&vglite_gradient);
+ }
+ else {
+ ret = UI_VGLITE_report_vglite_error(gc, vglite_error);
+ }
+ }
+ // else no error: the drawing is just "not performed"
+
+ return ret;
+}
+
+// --------------------------------------------------------------------------------
+// vg_drawing_bvi.h functions
+// (the function names differ according to the index of destination format)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status VG_DRAWING_BVI_drawPath(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color) {
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare path
+ vg_lite_path_t* vglite_path = VG_DRAWING_VGLITE_to_vglite_path((MICROVG_PATH_HEADER_t*)pathData);
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_fill_t vglite_fill = MICROVG_VGLITE_HELPER_get_fill_rule(fillRule);
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // add operation
+ jint ret = BVI_VGLITE_add_draw_path(MAP_BVI_ON_GC(gc), vglite_path, vglite_fill, &vglite_matrix, vglite_blend, (vg_lite_color_t)color);
+ MICROVG_VGLITE_handle_error(gc, ret);
+ }
+ // else no error: the drawing is just "not performed"
+
+ return DRAWING_DONE;
+}
+
+// See the header file for the function documentation
+DRAWING_Status VG_DRAWING_BVI_drawGradient(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradientData, jfloat* gradientMatrix){
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare path
+ vg_lite_path_t* vglite_path = VG_DRAWING_VGLITE_to_vglite_path((MICROVG_PATH_HEADER_t*)pathData);
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_fill_t vglite_fill = MICROVG_VGLITE_HELPER_get_fill_rule(fillRule);
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // parepare gradient
+ vg_lite_linear_gradient_t vglite_gradient;
+ vg_lite_error_t vglite_error = VG_DRAWING_VGLITE_prepare_gradient(&vglite_gradient, gradientData, gradientMatrix, &vglite_matrix, alpha);
+
+ if (VG_LITE_SUCCESS == vglite_error) {
+
+ // add operation
+ jint ret = BVI_VGLITE_add_draw_gradient(MAP_BVI_ON_GC(gc), vglite_path, vglite_fill, &vglite_matrix, &vglite_gradient, vglite_blend);
+ MICROVG_VGLITE_handle_error(gc, ret);
+
+ // post operation
+ VG_DRAWING_VGLITE_clear_gradient(&vglite_gradient);
+ }
+ else {
+ UI_VGLITE_report_vglite_error(gc, vglite_error);
+ }
+
+ }
+ // else no error: the drawing is just "not performed"
+
+ return DRAWING_DONE;
+}
+
+DRAWING_Status VG_DRAWING_BVI_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return _draw_string_on_circle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, (jfloat)0, (jint)0);
+}
+
+DRAWING_Status VG_DRAWING_BVI_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return _draw_string_on_circle_gradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, (jfloat)0, (jint)0, gradientData, gradientMatrix);
+}
+
+DRAWING_Status VG_DRAWING_BVI_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return _draw_string_on_circle(gc, text, faceHandle, size, (jfloat)x, (jfloat)y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+DRAWING_Status VG_DRAWING_BVI_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return _draw_string_on_circle_gradient(gc, text, faceHandle, size, (jfloat)x, (jfloat)y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+DRAWING_Status VG_DRAWING_BVI_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno){
+
+ float width;
+ float height;
+ VG_DRAWING_get_image_size(image, &width, &height);
+
+ if (UI_VGLITE_enable_vg_lite_scissor_area(gc, width, height, matrix)) {
+ *errno = BVI_VGLITE_add_draw_image(MAP_BVI_ON_GC(gc), image, matrix, alpha, elapsed, color_matrix);
+ MICROVG_VGLITE_handle_error(gc, *errno);
+ }
+ // nothing to draw
+
+ return DRAWING_DONE;
+}
+
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
+
+#endif // #if defined VG_FEATURE_BUFFERED_VECTOR_IMAGE
diff --git a/bsp/projects/microej/vg/src/vg_drawing_stub.c b/bsp/projects/microej/vg/src/vg_drawing_stub.c
new file mode 100644
index 0000000..4e619c8
--- /dev/null
+++ b/bsp/projects/microej/vg/src/vg_drawing_stub.c
@@ -0,0 +1,140 @@
+/*
+ * C
+ *
+ * Copyright 2023 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * @file
+ * @brief
+ * @brief Implementation of all drawing functions of vg_drawing_stub.h.
+ * @author MicroEJ Developer Team
+ * @version 5.0.0
+ * @see vg_drawing_stub.h
+ */
+
+// --------------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------------
+
+#include "vg_drawing_stub.h"
+
+// --------------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------------
+
+static inline DRAWING_Status not_implemented(MICROUI_GraphicsContext* gc){
+ LLUI_DISPLAY_reportError(gc, DRAWING_LOG_NOT_IMPLEMENTED);
+ return DRAWING_DONE;
+}
+
+// --------------------------------------------------------------------------------
+// vg_drawing_stub.h functions
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status VG_DRAWING_STUB_drawPath(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color){
+ (void)gc;
+ (void)path;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)fillRule;
+ (void)blend;
+ (void)color;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawGradient(MICROUI_GraphicsContext* gc, jbyte* path, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradient, jfloat* gradientMatrix){
+ (void)gc;
+ (void)path;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)fillRule;
+ (void)alpha;
+ (void)blend;
+ (void)gradient;
+ (void)gradientMatrix;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ (void)gc;
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)alpha;
+ (void)blend;
+ (void)letterSpacing;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ (void)gc;
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)alpha;
+ (void)blend;
+ (void)letterSpacing;
+ (void)*gradientData;
+ (void)*gradientMatrix;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ (void)gc;
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)alpha;
+ (void)blend;
+ (void)letterSpacing;
+ (void)radius;
+ (void)direction;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ (void)gc;
+ (void)text;
+ (void)faceHandle;
+ (void)size;
+ (void)x;
+ (void)y;
+ (void)matrix;
+ (void)alpha;
+ (void)blend;
+ (void)letterSpacing;
+ (void)radius;
+ (void)direction;
+ (void)*gradientData;
+ (void)*gradientMatrix;
+ return not_implemented(gc);
+}
+
+DRAWING_Status VG_DRAWING_STUB_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno){
+ (void)gc;
+ (void)image;
+ (void)*matrix;
+ (void)alpha;
+ (void)elapsed;
+ (void)color_matrix;
+ (void)errno;
+ return not_implemented(gc);
+}
+
+// --------------------------------------------------------------------------------
+// EOF
+// --------------------------------------------------------------------------------
diff --git a/bsp/projects/microej/vg/src/vg_drawing_vglite.c b/bsp/projects/microej/vg/src/vg_drawing_vglite.c
new file mode 100644
index 0000000..7ae8ba3
--- /dev/null
+++ b/bsp/projects/microej/vg/src/vg_drawing_vglite.c
@@ -0,0 +1,507 @@
+/*
+ * C
+ *
+ * Copyright 2021-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/**
+ * @file
+ * @brief Implementation of a set of vg_drawing.h drawing functions (library MicroVG).
+ * These are implementations over VGLite and the destination buffer format is the format specified
+ * in the VEE port.
+ *
+ * This file redirects the drawings of the strings and the images to some third-party files.
+ * These files don't perform the drawing themselves and let the caller do it. The drawing function
+ * is specified by vg_drawing_vglite.c to target standard destination buffers (display buffer and all
+ * MicroUI BufferedImage).
+ *
+ * @author MicroEJ Developer Team
+ * @version 7.0.1
+ */
+
+// -----------------------------------------------------------------------------
+// Includes
+// -----------------------------------------------------------------------------
+
+#include
+
+#include
+#include
+
+#include "vg_drawing_vglite.h"
+#include "ui_drawing_vglite.h"
+#include "microvg_helper.h"
+#include "microvg_vglite_helper.h"
+#include "color.h"
+#include "ui_vglite.h"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -----------------------------------------------------------------------------
+
+#ifndef VG_FEATURE_PATH
+#error "This implementation is only compatible when VG_FEATURE_PATH is set"
+#endif
+
+/*
+ * @brief Specific error code when VGLite library throws an error.
+ */
+#define RET_ERROR_VGLITE -1
+
+/*
+ * @brief Specific error code when gradient data is invalid.
+ */
+#define RET_ERROR_GRADIENT -2
+
+// -----------------------------------------------------------------------------
+// Private globals
+// -----------------------------------------------------------------------------
+
+static vg_lite_path_t render_path;
+static vg_lite_buffer_t* render_buffer;
+static bool draw_gradient_flushed;
+
+// -----------------------------------------------------------------------------
+// Private functions
+// -----------------------------------------------------------------------------
+
+static inline DRAWING_Status _post_operation(MICROUI_GraphicsContext* gc, jint error, bool rendered) {
+ DRAWING_Status ret;
+ if (LLVG_SUCCESS != error) {
+ ret = MICROVG_VGLITE_report_error(gc, error);
+ }
+ else if (rendered) {
+ // start GPU operation and do not wait for it to end
+ UI_VGLITE_start_operation(true);
+ ret = DRAWING_RUNNING;
+ }
+ else {
+ // else: nothing has been drawn (empty drawing, out of clip, etc.): not an error
+ ret = DRAWING_DONE;
+ }
+ if (DRAWING_RUNNING != ret) {
+ // GPU is useless now, can be disabled. No GPU access should be done after this line
+ UI_VGLITE_IMPL_notify_gpu_stop();
+ }
+ if (!UI_VGLITE_need_to_premultiply() && (VG_LITE_SUCCESS != vg_lite_enable_premultiply())) {
+ // cannot restore premultiplication
+ UI_VGLITE_IMPL_error(false, "vg_lite engine premultiply error: cannot restore the pre multiplication");
+ }
+ return ret;
+}
+
+inline static bool _need_to_premultiply(vg_lite_blend_t blend) {
+ bool need_to_premultiply = UI_VGLITE_need_to_premultiply();
+ if (!need_to_premultiply) {
+ switch (blend) {
+ case VG_LITE_BLEND_NONE:
+ case VG_LITE_BLEND_SRC_IN:
+ case VG_LITE_BLEND_DST_IN:
+ case VG_LITE_BLEND_SUBTRACT:
+ if (VG_LITE_SUCCESS != vg_lite_disable_premultiply()) {
+ // have to disable the premultiplication but cannot
+ UI_VGLITE_IMPL_error(false, "vg_lite engine premultiply error: cannot disable the pre multiplication");
+ }
+ else {
+ need_to_premultiply = true;
+ }
+ break;
+ default:
+ // use the GPU premultiplication
+ break;
+ }
+ }
+ return need_to_premultiply;
+}
+
+inline static void _update_color(vg_lite_color_t* color, vg_lite_blend_t blend) {
+ if (_need_to_premultiply(blend)) {
+ // premultiply color
+ *color = UI_VGLITE_premultiply(*color);
+ }
+}
+
+static void _update_gradient(vg_lite_linear_gradient_t* gradient, vg_lite_blend_t blend) {
+ if (_need_to_premultiply(blend)) {
+ // premultiply each color
+ uint32_t count = gradient->count;
+ uint32_t* colors = gradient->colors;
+ for (uint32_t i = 0; i < count; i++) {
+ colors[i] = UI_VGLITE_premultiply(colors[i]);
+ }
+ }
+
+ // update the VGLite internal image that represents the gradient
+ (void)vg_lite_update_grad(gradient); // always success
+}
+
+static inline jint _convert_vglite_error_to_llvg_error(vg_lite_error_t vg_lite_error) {
+ jint ret;
+ switch (vg_lite_error) {
+ case VG_LITE_SUCCESS:
+ ret = LLVG_SUCCESS;
+ break;
+ case VG_LITE_OUT_OF_MEMORY:
+ ret = LLVG_OUT_OF_MEMORY;
+ break;
+ default:
+ ret = LLVG_DATA_INVALID;
+ break;
+ }
+ return ret;
+}
+
+// VG_DRAWING_VGLITE_draw_image_element_t
+static jint _draw_image_element(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad, bool is_new_gradient) {
+ vg_lite_error_t ret;
+ if (NULL == grad) {
+ _update_color(&color, blend);
+ ret = vg_lite_draw(render_buffer, path, fill_rule, matrix, blend, color);
+ }
+ else {
+
+ if (is_new_gradient) {
+ // not same gradient than previous: have to:
+
+ // 1- flush the previous gradient drawings because we will update the shared gradient's image
+ if (!draw_gradient_flushed) {
+ UI_VGLITE_start_operation(false);
+ }
+
+ // 2- update the shared gradient's image.
+ _update_gradient(grad, blend);
+ }
+ // else: same gradient than previous: no need to update gradient's image again
+
+ ret = vg_lite_draw_gradient(render_buffer, path, fill_rule, matrix, grad, blend);
+ draw_gradient_flushed = false;
+ }
+ return _convert_vglite_error_to_llvg_error(ret);
+}
+
+// VG_DRAWING_VGLITE_draw_glyph_t
+static jint _draw_glyph_color(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad) {
+ (void)grad;
+ return _convert_vglite_error_to_llvg_error(vg_lite_draw(render_buffer, path, fill_rule, matrix, blend, color));
+}
+
+// VG_DRAWING_VGLITE_draw_glyph_t
+static jint _draw_glyph_gradient(vg_lite_path_t * path, vg_lite_fill_t fill_rule, vg_lite_matrix_t * matrix, vg_lite_blend_t blend, vg_lite_color_t color, vg_lite_linear_gradient_t * grad) {
+ (void)color;
+ return _convert_vglite_error_to_llvg_error(vg_lite_draw_gradient(render_buffer, path, fill_rule, matrix, grad, blend));
+}
+
+static DRAWING_Status _draw_string_on_circle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // prepare color
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_color_t vglite_color = (vg_lite_color_t)((gc->foreground_color & 0x00FFFFFF) + (int)(((unsigned int) alpha) << 24));
+ _update_color(&vglite_color, vglite_blend);
+
+ // draw
+ bool rendered;
+ render_buffer = UI_VGLITE_configure_destination(gc);
+ jint error = VG_DRAWING_VGLITE_draw_string(&_draw_glyph_color, text, faceHandle, size, &vglite_matrix, vglite_blend, vglite_color, MICROVG_HELPER_NULL_GRADIENT, letterSpacing, radius, direction, &rendered);
+ ret = _post_operation(gc, error, rendered);
+ }
+ // else no error: the drawing is just "not performed"
+
+ return ret;
+}
+
+static DRAWING_Status _draw_string_on_circle_gradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // parepare gradient
+ vg_lite_linear_gradient_t vglite_gradient;
+ vg_lite_error_t vglite_error = VG_DRAWING_VGLITE_prepare_gradient(&vglite_gradient, gradientData, gradientMatrix, &vglite_matrix, alpha);
+
+ if (VG_LITE_SUCCESS == vglite_error) {
+
+ // create the gradient image
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ _update_gradient(&vglite_gradient, vglite_blend);
+
+ // draw
+ bool rendered;
+ render_buffer = UI_VGLITE_configure_destination(gc);
+ jint error = VG_DRAWING_VGLITE_draw_string(&_draw_glyph_gradient, text, faceHandle, size, &vglite_matrix, vglite_blend, 0, &vglite_gradient, letterSpacing, radius, direction, &rendered);
+ ret = _post_operation(gc, error, rendered);
+
+ VG_DRAWING_VGLITE_clear_gradient(&vglite_gradient);
+ }
+ else {
+ ret = UI_VGLITE_report_vglite_error(gc, vglite_error);
+ }
+ }
+ // else no error: the drawing is just "not performed"
+
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// microvg_path.h functions
+// -----------------------------------------------------------------------------
+
+// See the header file for the function documentation
+void MICROVG_PATH_initialize(void) {
+ vg_lite_init_path(
+ &render_path,
+ (vg_lite_format_t)MICROVG_PATH_get_path_encoder_format(), // default value
+ VG_LITE_HIGH,
+ 0,
+ NULL,
+ -4000, // Left
+ -4000, // Top
+ 4000, // Right
+ 4000 // Bottom
+ );
+ render_path.path_type = VG_LITE_DRAW_FILL_PATH;
+}
+
+// See the header file for the function documentation
+uint8_t MICROVG_PATH_get_path_encoder_format(void) {
+ return VG_LITE_FP32;
+}
+
+// See the header file for the function documentation
+uint32_t MICROVG_PATH_convert_path_command(jint command) {
+ uint32_t ret;
+ switch (command) {
+ default: // unknown -> close (should not occur)
+ case LLVG_PATH_CMD_CLOSE:
+ ret = VLC_OP_END;
+ break;
+ case LLVG_PATH_CMD_MOVE:
+ ret = VLC_OP_MOVE;
+ break;
+ case LLVG_PATH_CMD_MOVE_REL:
+ ret = VLC_OP_MOVE_REL;
+ break;
+ case LLVG_PATH_CMD_LINE:
+ ret = VLC_OP_LINE;
+ break;
+ case LLVG_PATH_CMD_LINE_REL:
+ ret = VLC_OP_LINE_REL;
+ break;
+ case LLVG_PATH_CMD_QUAD:
+ ret = VLC_OP_QUAD;
+ break;
+ case LLVG_PATH_CMD_QUAD_REL:
+ ret = VLC_OP_QUAD_REL;
+ break;
+ case LLVG_PATH_CMD_CUBIC:
+ ret = VLC_OP_CUBIC;
+ break;
+ case LLVG_PATH_CMD_CUBIC_REL:
+ ret = VLC_OP_CUBIC_REL;
+ break;
+ }
+ return ret;
+}
+
+// See the header file for the function documentation
+uint32_t MICROVG_PATH_get_command_parameter_number(jint command) {
+ uint32_t ret;
+ switch (command) {
+ default: // unknown -> close (should not occur)
+ case VLC_OP_END:
+ case VLC_OP_CLOSE:
+ ret = 0;
+ break;
+ case VLC_OP_MOVE:
+ case VLC_OP_MOVE_REL:
+ case VLC_OP_LINE:
+ case VLC_OP_LINE_REL:
+ ret = 2;
+ break;
+ case VLC_OP_QUAD:
+ case VLC_OP_QUAD_REL:
+ ret = 4;
+ break;
+ case VLC_OP_CUBIC:
+ case VLC_OP_CUBIC_REL:
+ ret = 6;
+ break;
+ }
+ return ret;
+}
+
+// --------------------------------------------------------------------------------
+// vg_drawing_vglite.h functions
+// --------------------------------------------------------------------------------
+
+void VG_DRAWING_VGLITE_prepare_matrix(vg_lite_matrix_t* vg_lite_matrix, jfloat x, jfloat y, jfloat* matrix) {
+ jfloat* local_matrix = MICROVG_HELPER_check_matrix(matrix);
+ jfloat* mapped_matrix = MAP_VGLITE_MATRIX(vg_lite_matrix);
+
+ if((0 != x) || (0 != y)) {
+ // Create translate matrix for initial x,y translation from graphicscontext.
+ LLVG_MATRIX_IMPL_setTranslate(mapped_matrix, x, y);
+ LLVG_MATRIX_IMPL_concatenate(mapped_matrix, local_matrix);
+ }
+ else {
+ // use original matrix
+ LLVG_MATRIX_IMPL_copy(mapped_matrix, local_matrix);
+ }
+}
+
+vg_lite_error_t VG_DRAWING_VGLITE_prepare_gradient(vg_lite_linear_gradient_t* gradient, jint* gradientData, jfloat* gradientMatrix, vg_lite_matrix_t* vg_lite_matrix, int alpha) {
+ jfloat* local_gradient_matrix = MICROVG_HELPER_check_matrix(gradientMatrix);
+ return MICROVG_VGLITE_HELPER_to_vg_lite_gradient(gradient, gradientData, local_gradient_matrix, MAP_VGLITE_MATRIX(vg_lite_matrix), alpha);
+}
+
+/*
+ * @brief vg_lite_init_grad allocates a buffer in VGLite buffer, we must free it.
+ * No error even if init_grad is never called because vg_lite_clear_grad
+ * checks the allocation.
+ */
+void VG_DRAWING_VGLITE_clear_gradient(vg_lite_linear_gradient_t* gradient) {
+ vg_lite_clear_grad(gradient);
+}
+
+/*
+ * @brief Fills a VGLite path with RAW path data
+ */
+vg_lite_path_t* VG_DRAWING_VGLITE_to_vglite_path(MICROVG_PATH_HEADER_t* p){
+ render_path.bounding_box[0] = (vg_lite_float_t)(p->bounds_xmin);
+ render_path.bounding_box[1] = (vg_lite_float_t)(p->bounds_ymin);
+ render_path.bounding_box[2] = (vg_lite_float_t)(p->bounds_xmax);
+ render_path.bounding_box[3] = (vg_lite_float_t)(p->bounds_ymax);
+ render_path.format = (vg_lite_format_t)(p->format);
+ render_path.path_length = (int32_t)(p->data_size);
+ render_path.path = (void*)&(((uint8_t*)p)[MICROVG_PATH_get_path_header_size()]);
+ render_path.path_changed = 1;
+ return &render_path;
+}
+
+// --------------------------------------------------------------------------------
+// vg_drawing_vglite.h functions
+// (the function names differ according to the available number of destination formats)
+// --------------------------------------------------------------------------------
+
+// See the header file for the function documentation
+DRAWING_Status VG_DRAWING_VGLITE_drawPath(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint blend, jint color) {
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare path
+ vg_lite_path_t* vglite_path = VG_DRAWING_VGLITE_to_vglite_path((MICROVG_PATH_HEADER_t*)pathData);
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_fill_t vglite_fill = MICROVG_VGLITE_HELPER_get_fill_rule(fillRule);
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // prepare color
+ vg_lite_color_t vglite_color = (vg_lite_color_t)color;
+ _update_color(&vglite_color, vglite_blend);
+
+ // draw
+ render_buffer = UI_VGLITE_configure_destination(gc);
+ vg_lite_error_t vglite_error = vg_lite_draw(render_buffer, vglite_path, vglite_fill, &vglite_matrix, vglite_blend, vglite_color);
+
+ // post operation
+ ret = UI_VGLITE_post_operation(gc, vglite_error);
+ }
+ // else no error: the drawing is just "not performed"
+
+ return ret;
+}
+
+// See the header file for the function documentation
+DRAWING_Status VG_DRAWING_VGLITE_drawGradient(MICROUI_GraphicsContext* gc, jbyte* pathData, jint x, jint y, jfloat* matrix, jint fillRule, jint alpha, jint blend, jint* gradientData, jfloat* gradientMatrix){
+ DRAWING_Status ret = DRAWING_DONE;
+
+ if (UI_VGLITE_enable_vg_lite_scissor(gc)) {
+
+ // prepare path
+ vg_lite_path_t* vglite_path = VG_DRAWING_VGLITE_to_vglite_path((MICROVG_PATH_HEADER_t*)pathData);
+ vg_lite_blend_t vglite_blend = MICROVG_VGLITE_HELPER_get_blend(blend);
+ vg_lite_fill_t vglite_fill = MICROVG_VGLITE_HELPER_get_fill_rule(fillRule);
+
+ // prepare matrix
+ vg_lite_matrix_t vglite_matrix;
+ VG_DRAWING_VGLITE_prepare_matrix(&vglite_matrix, x, y, matrix);
+
+ // parepare gradient
+ vg_lite_linear_gradient_t vglite_gradient;
+ vg_lite_error_t vglite_error = VG_DRAWING_VGLITE_prepare_gradient(&vglite_gradient, gradientData, gradientMatrix, &vglite_matrix, alpha);
+
+ if (VG_LITE_SUCCESS == vglite_error) {
+
+ // create the gradient image
+ _update_gradient(&vglite_gradient, vglite_blend);
+
+ // draw
+ render_buffer = UI_VGLITE_configure_destination(gc);
+ vglite_error = vg_lite_draw_gradient(render_buffer, vglite_path, vglite_fill, &vglite_matrix, &vglite_gradient, vglite_blend);
+
+ // post operation
+ ret = UI_VGLITE_post_operation(gc, vglite_error);
+ VG_DRAWING_VGLITE_clear_gradient(&vglite_gradient);
+ }
+ else {
+ ret = UI_VGLITE_report_vglite_error(gc, vglite_error);
+ }
+
+ }
+ // else no error: the drawing is just "not performed"
+
+ return ret;
+}
+
+DRAWING_Status VG_DRAWING_VGLITE_drawString(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing){
+ return _draw_string_on_circle(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, (jfloat)0, (jint)0);
+}
+
+DRAWING_Status VG_DRAWING_VGLITE_drawStringGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jfloat x, jfloat y, float* matrix, jint alpha, jint blend, jfloat letterSpacing, jint *gradientData, jfloat *gradientMatrix){
+ return _draw_string_on_circle_gradient(gc, text, faceHandle, size, x, y, matrix, alpha, blend, letterSpacing, (jfloat)0, (jint)0, gradientData, gradientMatrix);
+}
+
+DRAWING_Status VG_DRAWING_VGLITE_drawStringOnCircle(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction){
+ return _draw_string_on_circle(gc, text, faceHandle, size, (jfloat)x, (jfloat)y, matrix, alpha, blend, letterSpacing, radius, direction);
+}
+
+DRAWING_Status VG_DRAWING_VGLITE_drawStringOnCircleGradient(MICROUI_GraphicsContext* gc, jchar* text, jint faceHandle, jfloat size, jint x, jint y, jfloat* matrix, jint alpha, jint blend, jfloat letterSpacing, jfloat radius, jint direction, jint *gradientData, jfloat *gradientMatrix){
+ return _draw_string_on_circle_gradient(gc, text, faceHandle, size, (jfloat)x, (jfloat)y, matrix, alpha, blend, letterSpacing, radius, direction, gradientData, gradientMatrix);
+}
+
+DRAWING_Status VG_DRAWING_VGLITE_drawImage(MICROUI_GraphicsContext* gc, void* image, jfloat *matrix, jint alpha, jlong elapsed, const float color_matrix[], jint* errno){
+
+ DRAWING_Status ret = DRAWING_DONE;
+ float width;
+ float height;
+ VG_DRAWING_get_image_size(image, &width, &height);
+
+ if (UI_VGLITE_enable_vg_lite_scissor_area(gc, width, height, matrix)) {
+ render_buffer = UI_VGLITE_configure_destination(gc);
+ draw_gradient_flushed = true; // no drawing with gradient has been added yet
+ bool rendered;
+ *errno = VG_DRAWING_VGLITE_draw_image(&_draw_image_element, image, matrix, alpha, elapsed, color_matrix, &rendered);
+ ret = _post_operation(gc, *errno, rendered);
+ }
+ // nothing to draw
+
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// EOF
+// -----------------------------------------------------------------------------
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.c b/bsp/projects/microej/vglite_support/vglite_support.c
similarity index 85%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.c
rename to bsp/projects/microej/vglite_support/vglite_support.c
index cfb01c0..50c2c73 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.c
+++ b/bsp/projects/microej/vglite_support/vglite_support.c
@@ -4,16 +4,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright 2020-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
- */
-
-/*
- * @file
- * @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
- * @author MicroEJ Developer Team
- * @version 3.0.0
- *
- * see vglite_support.h
+ * Copyright 2020-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
#include "vglite_support.h"
@@ -21,6 +12,9 @@
#include "fsl_power.h"
#include "vg_lite.h"
#include "vg_lite_platform.h"
+#include "ui_vglite.h"
+#include "bsp_util.h"
+
/*******************************************************************************
* Definitions
******************************************************************************/
@@ -58,9 +52,19 @@ uint32_t vglite_cmd_buff_size = VG_LITE_COMMAND_BUFFER_SIZE;
/*******************************************************************************
* Code
******************************************************************************/
+
+/*
+ * @brief Notifies the CCO MicroUI-VGLite about the GPU interrupt. When this CCO
+ * is not installed / available, the default function is used and does nothing.
+ */
+BSP_DECLARE_WEAK_FCNT void UI_VGLITE_IRQHandler(void) {
+ // does nothing by default
+}
+
void GPU_DriverIRQHandler(void)
{
vg_lite_IRQHandler();
+ UI_VGLITE_IRQHandler();
}
// modified by MicroEJ
@@ -76,6 +80,7 @@ status_t BOARD_InitVGliteClock(void)
RESET_ClearPeripheralReset(kGPU_RST_SHIFT_RSTn);
RESET_ClearPeripheralReset(kAXI_SWITCH_RST_SHIFT_RSTn);
+ NVIC_SetPriority(GPU_IRQn, 3);
EnableIRQ((IRQn_Type)GPU_IRQn);
return kStatus_Success;
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.h b/bsp/projects/microej/vglite_support/vglite_support.h
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.h
rename to bsp/projects/microej/vglite_support/vglite_support.h
index b38cd4b..aab2870 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_support/vglite_support.h
+++ b/bsp/projects/microej/vglite_support/vglite_support.h
@@ -4,14 +4,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright 2020-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * Copyright 2020-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
/*
* @file
* @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 7.0.0
*
* 1- make BOARD_InitVGliteClock function as public
* 2- add BOARD_StopVGliteClock, BOARD_StartVGliteClock
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.c b/bsp/projects/microej/vglite_window/vglite_window.c
similarity index 90%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.c
rename to bsp/projects/microej/vglite_window/vglite_window.c
index ef82dc3..0f3f7e6 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.c
+++ b/bsp/projects/microej/vglite_window/vglite_window.c
@@ -4,14 +4,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright 2019-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * Copyright 2019-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
/*
* @file
* @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 7.0.0
*
* See vglite_windows.h
*/
@@ -170,3 +170,12 @@ void VGLITE_SwapBuffers(vg_lite_window_t *window)
void *b = FBDEV_GetFrameBuffer(&window->display->g_fbdev, 0);
#endif
}
+
+void VGLITE_CancelSwapBuffers(void)
+{
+ // does not work: (-1) % 2 = 1 and gives -1
+// fb_idx--;
+// fb_idx %= APP_BUFFER_COUNT;
+ fb_idx = fb_idx == 0 ? (APP_BUFFER_COUNT - 1) : (fb_idx ) - 1;
+}
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.h b/bsp/projects/microej/vglite_window/vglite_window.h
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.h
rename to bsp/projects/microej/vglite_window/vglite_window.h
index dc28fb5..430fff5 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/microej/vglite_window/vglite_window.h
+++ b/bsp/projects/microej/vglite_window/vglite_window.h
@@ -4,14 +4,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright 2019-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * Copyright 2019-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
*/
/*
* @file
* @brief MicroEJ MicroUI library low level API: implementation over VG-Lite
* @author MicroEJ Developer Team
- * @version 3.0.0
+ * @version 7.0.0
*
* 1. Add VGLITE_GetBuffers and VGLITE_GetNextBuffer functions.
* 2. Redirect APP_BUFFER_COUNT to FRAME_BUFFER_COUNT defined
@@ -78,6 +78,7 @@ vg_lite_buffer_t *VGLITE_GetNextBuffer(vg_lite_window_t *window);
void VGLITE_SwapBuffers(vg_lite_window_t *window);
+void VGLITE_CancelSwapBuffers(void);
#if defined(__cplusplus)
}
#endif /* __cplusplus */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/.gitignore b/bsp/projects/nxpvee-ui/armgcc/.gitignore
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/.gitignore
rename to bsp/projects/nxpvee-ui/armgcc/.gitignore
diff --git a/bsp/projects/nxpvee-ui/armgcc/CMakeLists.txt b/bsp/projects/nxpvee-ui/armgcc/CMakeLists.txt
new file mode 100644
index 0000000..c31c9f6
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/CMakeLists.txt
@@ -0,0 +1,328 @@
+# CROSS COMPILER SETTING
+SET(CMAKE_SYSTEM_NAME Generic)
+CMAKE_MINIMUM_REQUIRED (VERSION 3.27.0)
+
+# CURRENT DIRECTORY
+SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR})
+
+if (NOT DEFINED SdkOverlayRootDirPath)
+ SET(SdkOverlayRootDirPath ${ProjDirPath}/../../../sdk_overlay/)
+endif()
+
+if (NOT DEFINED VeeSdkRootDirPath)
+ SET(VeeSdkRootDirPath ${ProjDirPath}/../../../mcux-sdk/core/)
+endif()
+
+if (NOT DEFINED RtosRootDirPath)
+ SET(RtosRootDirPath ${ProjDirPath}/../../../mcux-sdk/rtos/)
+endif()
+
+if (NOT DEFINED MicroejDirPath)
+ SET(MicroejDirPath ${ProjDirPath}/../../microej/)
+endif()
+
+
+find_package(Git)
+
+# ENABLE ASM
+ENABLE_LANGUAGE(ASM)
+
+project(mimxrt595_freertos-bsp)
+
+file (STRINGS "${ProjDirPath}/../../../nvee_version.txt" VEE_VERSION)
+
+set(MCUX_DEVICE MIMXRT595S_cm33)
+set(PROJECT_NAME mimxrt595_freertos-bsp)
+set(MCUX_SDK_PROJECT_NAME ${PROJECT_NAME}.elf)
+cmake_path(GET MCUX_SDK_PROJECT_NAME STEM MCUX_SDK_PROJECT_NAME_NO_EXT)
+
+# config to select component, the format is CONFIG_USE_${component}
+set(CONFIG_USE_component_serial_manager_uart true)
+set(CONFIG_USE_driver_flexcomm_usart true)
+
+include (${ProjDirPath}/flags.cmake)
+
+execute_process(COMMAND
+ "${GIT_EXECUTABLE}" describe --always --abbrev=8 --dirty
+ WORKING_DIRECTORY "${ProjDirPath}"
+ OUTPUT_VARIABLE GIT_SHA_1
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+configure_file("${ProjDirPath}/../main/src/tree_version.c.in" "${CMAKE_CURRENT_BINARY_DIR}/tree_version.c" @ONLY)
+
+add_executable(${MCUX_SDK_PROJECT_NAME}
+ "${ProjDirPath}/../board/src/board.c"
+ "${ProjDirPath}/../board/src/clock_config.c"
+ "${ProjDirPath}/../board/src/display_support.c"
+ "${ProjDirPath}/../board/src/pin_mux.c"
+ "${ProjDirPath}/../freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c"
+ "${ProjDirPath}/../simple_gfx_app/src/simple_gfx_app_imp.c"
+ "${ProjDirPath}/../main/src/core_test_natives.c"
+ "${ProjDirPath}/../main/src/cpuload.c"
+ "${ProjDirPath}/../main/src/cpuload_impl_FreeRTOS.c"
+ "${ProjDirPath}/../main/src/fault_handlers.c"
+ "${ProjDirPath}/../main/src/interrupts.c"
+ "${ProjDirPath}/../main/src/LLBSP.c"
+ "${ProjDirPath}/../main/src/LLEXT_RES_impl.c"
+ "${ProjDirPath}/../main/src/LLMJVM_FreeRTOS.c"
+ "${ProjDirPath}/../main/src/main.c"
+ "${ProjDirPath}/../main/src/microjvm_main.c"
+ "${ProjDirPath}/../main/src/monitor.c"
+ "${ProjDirPath}/../main/src/os_support.c"
+ "${ProjDirPath}/../main/src/stack_overflow_impl_FreeRTOS.c"
+ "${ProjDirPath}/../main/src/time_hardware_timer.c"
+ "${ProjDirPath}/../main/src/trace_platform.c"
+ "${MicroejDirPath}/osal/src/osal_FreeRTOS.c"
+ "${MicroejDirPath}/lowpower/src/power_manager.c"
+ "${MicroejDirPath}/lowpower/src/fsl_tickless_rtc.c"
+ "${MicroejDirPath}/thirdparty/freetype/src/wrappers/ft_base_wrapper.c"
+ "${MicroejDirPath}/thirdparty/freetype/src/wrappers/ft_otf_wrapper.c"
+ "${MicroejDirPath}/thirdparty/freetype/src/wrappers/ft_ttf_wrapper.c"
+ "${MicroejDirPath}/thirdparty/freetype/src/wrappers/ft_vector_wrapper.c"
+ "${MicroejDirPath}/thirdparty/harfbuzz/src/hb-alloc.c"
+ "${MicroejDirPath}/thirdparty/systemview/src/SEGGER_RTT.c"
+ "${MicroejDirPath}/thirdparty/systemview/src/SEGGER_SYSVIEW.c"
+ "${MicroejDirPath}/thirdparty/systemview-freertos/src/SEGGER_SYSVIEW_FreeRTOS.c"
+ "${MicroejDirPath}/trace/src/LLMJVM_MONITOR_sysview.c"
+ "${MicroejDirPath}/trace/src/LLTRACE_sysview.c"
+ "${MicroejDirPath}/ui/src/buttons_helper.c"
+ "${MicroejDirPath}/ui/src/buttons_manager.c"
+ "${MicroejDirPath}/ui/src/display_dma.c"
+ "${MicroejDirPath}/ui/src/display_framebuffer.c"
+ "${MicroejDirPath}/ui/src/event_generator.c"
+ "${MicroejDirPath}/ui/src/framerate.c"
+ "${MicroejDirPath}/ui/src/framerate_impl_FreeRTOS.c"
+ "${MicroejDirPath}/ui/src/LLDW_PAINTER_impl.c"
+ "${MicroejDirPath}/ui/src/LLUI_DISPLAY_impl.c"
+ "${MicroejDirPath}/ui/src/LLUI_INPUT_impl.c"
+ "${MicroejDirPath}/ui/src/LLUI_PAINTER_impl.c"
+ "${MicroejDirPath}/ui/src/touch_helper.c"
+ "${MicroejDirPath}/ui/src/touch_manager.c"
+ "${MicroejDirPath}/ui/src/ui_display_brs.c"
+ "${MicroejDirPath}/ui/src/ui_display_brs_legacy.c"
+ "${MicroejDirPath}/ui/src/ui_display_brs_predraw.c"
+ "${MicroejDirPath}/ui/src/ui_display_brs_single.c"
+ "${MicroejDirPath}/ui/src/ui_drawing.c"
+ "${MicroejDirPath}/ui/src/ui_drawing_vglite.c"
+ "${MicroejDirPath}/ui/src/ui_drawing_vglite_path.c"
+ "${MicroejDirPath}/ui/src/ui_drawing_vglite_process.c"
+ "${MicroejDirPath}/ui/src/ui_rect_util.c"
+ "${MicroejDirPath}/ui/src/ui_vglite.c"
+ "${MicroejDirPath}/util/src/mej_debug.c"
+ "${MicroejDirPath}/util/src/mej_math.c"
+ "${MicroejDirPath}/util/src/pool.c"
+ "${MicroejDirPath}/vg/src/LLVG_PAINTER_impl.c"
+ "${MicroejDirPath}/vg/src/vg_drawing_bvi.c"
+ "${MicroejDirPath}/vg/src/vg_drawing_stub.c"
+ "${MicroejDirPath}/vg/src/vg_drawing_vglite.c"
+ "${MicroejDirPath}/vg/src/vg_drawing.c"
+ "${MicroejDirPath}/vg/src/LLVG_BVI_stub.c"
+ "${MicroejDirPath}/vg/src/LLVG_FONT_freetype.c"
+ "${MicroejDirPath}/vg/src/LLVG_FONT_PAINTER_freetype_vglite.c"
+ "${MicroejDirPath}/vg/src/LLVG_FONT_stub.c"
+ "${MicroejDirPath}/vg/src/LLVG_GRADIENT_impl.c"
+ "${MicroejDirPath}/vg/src/LLVG_impl.c"
+ "${MicroejDirPath}/vg/src/LLVG_MATRIX_impl.c"
+ "${MicroejDirPath}/vg/src/LLVG_PATH_impl.c"
+ "${MicroejDirPath}/vg/src/LLVG_PATH_stub.c"
+ "${MicroejDirPath}/vg/src/LLVG_RAW_impl.c"
+ "${MicroejDirPath}/vg/src/LLVG_vglite.c"
+ "${MicroejDirPath}/vg/src/microvg_helper.c"
+ "${MicroejDirPath}/vglite_support/vglite_support.c"
+ "${MicroejDirPath}/vglite_window/vglite_window.c"
+ "${MicroejDirPath}/stub/src/stub.c"
+ "${VeeSdkRootDirPath}/devices/MIMXRT595S/mcuxpresso/startup_mimxrt595s_cm33.c"
+ ${CMAKE_CURRENT_BINARY_DIR}/tree_version.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${ProjDirPath}/..
+ ${ProjDirPath}/../board/inc
+ ${ProjDirPath}/../freertos/inc
+ ${ProjDirPath}/../main/inc
+ ${MicroejDirPath}/lowpower/inc
+ ${MicroejDirPath}/trace/inc
+ ${MicroejDirPath}/ui/inc
+ ${MicroejDirPath}/util/inc
+ ${MicroejDirPath}/vg/inc
+ ${MicroejDirPath}/thirdparty/systemview/inc
+ ${MicroejDirPath}/thirdparty/systemview-freertos/inc
+ ${MicroejDirPath}/thirdparty/freetype/inc
+ ${MicroejDirPath}/thirdparty/harfbuzz/inc
+ ${MicroejDirPath}/osal/inc
+ ${MicroejDirPath}/platform/inc
+ ${MicroejDirPath}/vglite_support
+ ${MicroejDirPath}/vglite_window
+)
+
+add_definitions(
+ -D__USE_CMSIS
+ -DDEBUG
+ -DFSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1
+ -DBOOT_HEADER_ENABLE=1
+ -DCPU_MIMXRT595SFFOB_cm33
+ -DBOARD_ENABLE_PSRAM_CACHE=0
+ -DFLEXIO_MCULCD_DATA_BUS_WIDTH=8
+ -DDBI_FLEXIO_USE_SMARTDMA=1
+ -DCUSTOM_VGLITE_MEMORY_CONFIG=1
+ -DVG_RESOLVE_ENGINE=0
+ -DVG_PE_COLOR_KEY=0
+ -DVG_IM_INDEX_FORMAT=0
+ -DVG_AYUV_INPUT_OUTPUT=0
+ -DVG_DOUBLE_IMAGE=0
+ -DVG_RECTANGLE_STRIP_MODE=0
+ -DVG_MMU=0
+ -DVG_DRIVER_SINGLE_THREAD=1
+ -DVG_IM_FILTER=0
+ -DVG_IM_YUV_PACKET=1
+ -DVG_IM_YUV_PLANAR=0
+ -DVG_PE_YUV_PACKET=1
+ -DVG_TARGET_TILED=1
+ -DVG_COMMAND_CALL=1
+ -DVG_SHARE_BUFFER_IM_16K=0
+ -DVG_OFFLINE_MODE=0
+ -DVG_RESOLUTION_2880=0
+ -DVG_PE_PREMULTIPLY=0
+ -DVG_POST_CONVERTER=0
+ -DVG_PRE_CONVERTER=0
+ -DVG_RENDER_BY_MESH=0
+ -DVG_TARGET_FAST_CLEAR=0
+ -DVG_BUFFER_NUMBER_OF_TARGET=0
+ -DVG_VIDEO_CLEAR_CONTROL=0
+ -DVG_VIDEO_CONTROL=0
+ -DVGLITE_TST_FIRMWARE=0
+ -DVG_LITE_SYS_GPU_CTRL=0
+ -DSERIAL_PORT_TYPE_UART=1
+ -DFSL_RTOS_FREE_RTOS
+ -DPRINTF_FLOAT_ENABLE=1
+ -DPRINTF_ADVANCED_ENABLE=1
+ -DENABLE_SYSTEM_VIEW=1
+ -DSDK_I2C_BASED_COMPONENT_USED=1
+ -D_VG_LITE_IRQ_CALLBACK=1
+ -DSL_WFX_PROD_KEY=1
+ -DLWIP_2_1_2
+ -DSDK_DEBUGCONSOLE_UART
+ -DFT_CONFIG_MODULES_H=\"freetype/config/ftmodule.h\"
+ -DFT2_BUILD_LIBRARY
+ -DRTT_USE_ASM=0
+)
+
+SET(CMAKE_MODULE_PATH
+ ${MicroejDirPath}/gpio
+ ${VeeSdkRootDirPath}/boards/evkmimxrt595/flash_config/
+ ${VeeSdkRootDirPath}/components/ft3267
+ ${VeeSdkRootDirPath}/components/serial_manager
+ ${VeeSdkRootDirPath}/components/pca9420
+ ${VeeSdkRootDirPath}/components/lists
+ ${VeeSdkRootDirPath}/components/uart
+ ${VeeSdkRootDirPath}/components/video
+ ${VeeSdkRootDirPath}/components/video/display
+ ${VeeSdkRootDirPath}/components/video/display/dbi
+ ${VeeSdkRootDirPath}/components/video/display/dbi/flexio
+ ${VeeSdkRootDirPath}/components/video/display/dc
+ ${VeeSdkRootDirPath}/components/video/display/dc/ssd1963
+ ${VeeSdkRootDirPath}/components/video/display/dc/lcdif
+ ${VeeSdkRootDirPath}/components/video/display/dc/dsi_cmd
+ ${VeeSdkRootDirPath}/components/video/display/fbdev
+ ${VeeSdkRootDirPath}/components/video/display/mipi_dsi_cmd
+ ${VeeSdkRootDirPath}/components/video/display/rm67162
+ ${VeeSdkRootDirPath}/components/video/display/rm68191
+ ${VeeSdkRootDirPath}/components/video/display/rm68200
+ ${VeeSdkRootDirPath}/CMSIS/Core/Include
+ ${VeeSdkRootDirPath}/CMSIS/DSP
+ ${VeeSdkRootDirPath}/devices/MIMXRT595S
+ ${VeeSdkRootDirPath}/devices/MIMXRT595S/drivers/
+ ${VeeSdkRootDirPath}/devices/MIMXRT595S/utilities/
+ ${VeeSdkRootDirPath}/devices/MIMXRT595S/utilities/debug_console/
+ ${VeeSdkRootDirPath}/drivers/common/
+ ${VeeSdkRootDirPath}/drivers/flexcomm/
+ ${VeeSdkRootDirPath}/drivers/mipi_dsi/
+ ${VeeSdkRootDirPath}/drivers/lpc_dma/
+ ${VeeSdkRootDirPath}/drivers/flexio/
+ ${VeeSdkRootDirPath}/drivers/flexspi/
+ ${VeeSdkRootDirPath}/drivers/inputmux/
+ ${VeeSdkRootDirPath}/drivers/lpc_gpio/
+ ${VeeSdkRootDirPath}/drivers/powerquad/
+ ${VeeSdkRootDirPath}/drivers/lpc_rtc/
+ ${VeeSdkRootDirPath}/drivers/smartdma/
+ ${VeeSdkRootDirPath}/drivers/trng/
+ ${VeeSdkRootDirPath}/drivers/
+ ${VeeSdkRootDirPath}/utilities/debug_console/
+ ${VeeSdkRootDirPath}/utilities/misc_utilities/
+ ${VeeSdkRootDirPath}/utilities/assert/
+ ${VeeSdkRootDirPath}/utilities/
+ ${VeeSdkRootDirPath}/drivers/cache/cache64/
+ ${VeeSdkRootDirPath}/drivers/ctimer/
+ ${VeeSdkRootDirPath}/drivers/lpc_iopctl/
+ ${VeeSdkRootDirPath}/drivers/pint/
+ ${SdkOverlayRootDirPath}/rtos/freertos/freertos-kernel/
+ ${SdkOverlayRootDirPath}/middleware/vglite/
+ ${MicroejDirPath}/thirdparty/freetype/
+ ${MicroejDirPath}/thirdparty/harfbuzz/
+)
+
+# include modules
+include(driver_pca9420)
+include(component_usart_adapter)
+include(component_lists)
+include(component_serial_manager)
+include(component_serial_manager_uart)
+include(device_CMSIS)
+include(driver_cache_cache64)
+include(driver_clock)
+include(driver_common)
+include(driver_ctimer)
+include(driver_dbi_flexio_smartdma)
+include(driver_dc-fb-dsi-cmd)
+include(driver_display-rm67162)
+include(driver_display-rm68191)
+include(driver_display-rm68200)
+include(driver_fbdev)
+include(driver_flash_config_evkmimxrt595)
+include(driver_flexcomm_i2c)
+include(driver_flexcomm)
+include(driver_flexcomm_usart_dma)
+include(driver_flexcomm_usart)
+include(driver_flexio)
+include(driver_flexio_spi)
+include(driver_flexspi)
+include(driver_ft3267)
+include(driver_iap)
+include(driver_inputmux)
+include(driver_lpc_dma)
+include(driver_lpc_gpio)
+include(driver_lpc_rtc)
+include(driver_lpc_smartdma)
+include(driver_mipi_dsi)
+include(driver_mipi_dsi_smartdma)
+include(driver_power)
+include(driver_powerquad_cmsis)
+include(driver_powerquad)
+include(driver_reset)
+include(driver_trng)
+include(driver_video-common)
+include(middleware_freertos-kernel_cm33_nonsecure_port)
+include(middleware_freertos-kernel_heap_4)
+include(middleware_freertos-kernel_MIMXRT595S_cm33)
+include(middleware_vglite)
+include(nxp_gpio)
+include(utilities_misc_utilities_MIMXRT595S_cm33)
+include(utility_assert)
+include(utility_debug_console)
+include(driver_lpc_iopctl)
+include(driver_pint)
+include(thirdparty_freetype)
+include(thirdparty_harfbuzz)
+
+TARGET_LINK_LIBRARIES(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${MicroejDirPath}/platform/lib/microejapp.o
+ ${MicroejDirPath}/platform/lib/microejruntime.a
+)
+
+ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_OBJCOPY}
+-Obinary ./${MCUX_SDK_PROJECT_NAME} ./${MCUX_SDK_PROJECT_NAME_NO_EXT}.bin)
+ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_OBJCOPY}
+-Oihex ./${MCUX_SDK_PROJECT_NAME} ./${MCUX_SDK_PROJECT_NAME_NO_EXT}.hex)
+
+SET_TARGET_PROPERTIES(${MCUX_SDK_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ./${MCUX_SDK_PROJECT_NAME_NO_EXT}.bin)
+SET_TARGET_PROPERTIES(${MCUX_SDK_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ./${MCUX_SDK_PROJECT_NAME_NO_EXT}.hex)
diff --git a/bsp/projects/nxpvee-ui/armgcc/CMakePresets.json b/bsp/projects/nxpvee-ui/armgcc/CMakePresets.json
new file mode 100644
index 0000000..0302e38
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/CMakePresets.json
@@ -0,0 +1,54 @@
+{
+ "version": 7,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 27
+ },
+ "configurePresets": [
+ {
+ "name": "preset-env",
+ "displayName": "present-env",
+ "hidden": true,
+ "toolchainFile": "../../../../mcux-sdk/core/tools/cmake_toolchain_files/armgcc.cmake",
+ "environment": {
+ "ARMGCC_DIR": "$penv{ARMGCC_DIR}",
+ "SdkRootDirPath": "${sourceDir}/../../../mcux-sdk/"
+ },
+ "generator": "Ninja",
+ "binaryDir": "${sourceDir}/${presetName}",
+ "cacheVariables": {
+ "DEBUG_CONSOLE": "UART",
+ "LANGUAGE": "C",
+ "LIBRARY_TYPE": "NOLIB"
+ }
+ },
+ {
+ "name": "debug",
+ "displayName": "debug",
+ "inherits": "preset-env",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "debug"
+ }
+ },
+ {
+ "name": "release",
+ "displayName": "release",
+ "inherits": "preset-env",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "release"
+ }
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "debug",
+ "displayName": "debug",
+ "configurePreset": "debug"
+ },
+ {
+ "name": "release",
+ "displayName": "release",
+ "configurePreset": "release"
+ }
+ ]
+}
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_all.bat b/bsp/projects/nxpvee-ui/armgcc/build_all.bat
new file mode 100644
index 0000000..a03d9c3
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_all.bat
@@ -0,0 +1,11 @@
+SET CMD=ninja
+
+if not exist debug mkdir debug
+cd debug
+cmake --preset debug ..
+%CMD%
+
+if not exist release mkdir release
+cd release
+cmake --preset release ..
+%CMD%
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_all.sh b/bsp/projects/nxpvee-ui/armgcc/build_all.sh
new file mode 100755
index 0000000..05bf434
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_all.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+CMD='ninja'
+
+mkdir -p debug && cd debug
+cmake --preset debug ..
+${CMD}
+
+mkdir -p release && cd release
+cmake --preset release ..
+${CMD}
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_debug.bat b/bsp/projects/nxpvee-ui/armgcc/build_debug.bat
new file mode 100644
index 0000000..e48595a
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_debug.bat
@@ -0,0 +1,6 @@
+SET CMD=ninja
+
+if not exist debug mkdir debug
+cd debug
+cmake -DCMAKE_TOOLCHAIN_FILE="../../../mcux-sdk/core/tools/cmake_toolchain_files/armgcc.cmake" -G "%FLAVOUR%" -DCMAKE_BUILD_TYPE=debug ..
+%CMD%
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_debug.sh b/bsp/projects/nxpvee-ui/armgcc/build_debug.sh
new file mode 100755
index 0000000..c8eb303
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_debug.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+CMD='ninja'
+
+mkdir -p debug && cd debug
+cmake --preset debug ..
+${CMD}
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_release.bat b/bsp/projects/nxpvee-ui/armgcc/build_release.bat
new file mode 100644
index 0000000..bb8e96e
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_release.bat
@@ -0,0 +1,6 @@
+SET CMD=ninja
+
+if not exist release mkdir release
+cd release
+cmake -DCMAKE_TOOLCHAIN_FILE="../../../mcux-sdk/core/tools/cmake_toolchain_files/armgcc.cmake" -G "%FLAVOUR%" -DCMAKE_BUILD_TYPE=release ..
+%CMD%
diff --git a/bsp/projects/nxpvee-ui/armgcc/build_release.sh b/bsp/projects/nxpvee-ui/armgcc/build_release.sh
new file mode 100755
index 0000000..2effebc
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/build_release.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+CMD='ninja'
+
+mkdir -p release && cd release
+cmake --preset release ..
+${CMD}
diff --git a/bsp/projects/nxpvee-ui/armgcc/clean.bat b/bsp/projects/nxpvee-ui/armgcc/clean.bat
new file mode 100644
index 0000000..e9ed2a4
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/clean.bat
@@ -0,0 +1,2 @@
+IF EXIST debug RD /s /Q debug
+IF EXIST release RD /s /Q release
diff --git a/bsp/projects/nxpvee-ui/armgcc/clean.sh b/bsp/projects/nxpvee-ui/armgcc/clean.sh
new file mode 100755
index 0000000..d5e1c12
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/clean.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm -rf debug release
diff --git a/bsp/projects/nxpvee-ui/armgcc/flags.cmake b/bsp/projects/nxpvee-ui/armgcc/flags.cmake
new file mode 100644
index 0000000..dd7fb68
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/armgcc/flags.cmake
@@ -0,0 +1,100 @@
+IF(NOT DEFINED FPU)
+ SET(FPU "-mfloat-abi=hard -mfpu=fpv5-sp-d16")
+ENDIF()
+
+SET(ASM_COMMON_FLAGS " \
+ -D__STARTUP_CLEAR_BSS \
+ -mcpu=cortex-m33 \
+ -mthumb \
+ ${FPU} \
+")
+
+SET(C_COMMON_FLAGS " \
+ -DCPU_MIMXRT595SFFOC_cm33 \
+ -mcpu=cortex-m33 \
+ -mthumb -nostdlib \
+ -fno-common \
+ -g3 \
+ -Wall \
+ -ffunction-sections \
+ -fdata-sections \
+ -fno-builtin-specs=nano.specs \
+ -MMD \
+ -MP \
+ ${FPU} \
+ -DVG_BLIT_WORKAROUND=0 \
+")
+
+SET(CXX_COMMON_FLAGS " \
+ -DCPU_MIMXRT595SFFOC_cm33 \
+ -mcpu=cortex-m33 \
+ -mthumb -nostdlib \
+ -fno-common \
+ -g3 \
+ -Wall \
+ -ffunction-sections \
+ -fdata-sections \
+ -fno-builtin-specs=nano.specs \
+ -MMD \
+ -MP \
+ ${FPU} \
+ -DVG_BLIT_WORKAROUND=0 \
+")
+
+SET(EXE_LINKER_COMMON_FLAGS " \
+ -Xlinker --gc-sections \
+ -Xlinker -print-memory-usage \
+ -Xlinker --sort-section=alignment \
+ -Xlinker -Map=${ProjDirPath}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.map \
+ -u _printf_float \
+ -L${ProjDirPath} \
+ -T${ProjDirPath}/mimxrt595_freertos-bsp_Debug.ld \
+")
+
+SET(CMAKE_ASM_FLAGS_DEBUG " \
+ ${CMAKE_ASM_FLAGS_DEBUG} \
+ ${ASM_COMMON_FLAGS} \
+ -DDEBUG \
+")
+
+SET(CMAKE_C_FLAGS_DEBUG " \
+ ${CMAKE_C_FLAGS_DEBUG} \
+ ${C_COMMON_FLAGS} \
+ -DDEBUG \
+ -O0 \
+")
+
+SET(CMAKE_CXX_FLAGS_DEBUG " \
+ ${CMAKE_CXX_FLAGS_DEBUG} \
+ ${CXX_COMMON_FLAGS} \
+ -DDEBUG \
+ -O0 \
+")
+
+SET(CMAKE_EXE_LINKER_FLAGS_DEBUG " \
+ ${CMAKE_EXE_LINKER_FLAGS_DEBUG} \
+ ${EXE_LINKER_COMMON_FLAGS} \
+")
+
+SET(CMAKE_ASM_FLAGS_RELEASE " \
+ ${CMAKE_ASM_FLAGS_RELEASE} \
+ ${ASM_COMMON_FLAGS} \
+ -DNDEBUG \
+")
+
+SET(CMAKE_C_FLAGS_RELEASE " \
+ ${CMAKE_C_FLAGS_RELEASE} \
+ ${C_COMMON_FLAGS} \
+ -O3 \
+")
+
+SET(CMAKE_CXX_FLAGS_RELEASE " \
+ ${CMAKE_CXX_FLAGS_RELEASE} \
+ ${CXX_COMMON_FLAGS} \
+ -O3 \
+")
+
+SET(CMAKE_EXE_LINKER_FLAGS_RELEASE " \
+ ${CMAKE_EXE_LINKER_FLAGS_RELEASE} \
+ ${EXE_LINKER_COMMON_FLAGS} \
+")
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld b/bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld
rename to bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld
index ba36c25..900b870 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld
+++ b/bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug.ld
@@ -142,10 +142,10 @@ SECTIONS
*(.bss*)
*(COMMON)
. = ALIGN(8) ;
- *(ICETEA_HEAP)
+ *(.bss.microej.runtime)
. = ALIGN(4) ;
- *(_java_heap)
- *(_java_immortals)
+ *(.bss.microej.heap)
+ *(.bss.microej.immortals)
_ebss = .;
PROVIDE(__end_bss_RAM = .) ;
@@ -184,11 +184,7 @@ SECTIONS
} > SRAM
_StackSize = 0x1000;
- /* Reserve space in memory for Stack */
- .heap2stackfill :
- {
- . += _StackSize;
- } > SRAM
+
/* Locate actual Stack in memory map */
.stack : ALIGN(4)
{
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_library.ld b/bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_library.ld
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_library.ld
rename to bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_library.ld
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld b/bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld
rename to bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld
index 10fff98..fbe01e0 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld
+++ b/bsp/projects/nxpvee-ui/armgcc/mimxrt595_freertos-bsp_Debug_memory.ld
@@ -19,7 +19,7 @@ MEMORY
__top_Flash = 0x8000000 + 0x800000 ; /* 8M bytes */
__base_SRAM = 0x20000000 ; /* SRAM */
__base_RAM = 0x20000000 ; /* RAM */
- __top_SRAM = 0x20000000 + 0x300000 ; /* 3M bytes */
- __top_RAM = 0x20000000 + 0x300000 ; /* 3M bytes */
+ __top_SRAM = 0x20000000 + 0x500000 ; /* 5M bytes */
+ __top_RAM = 0x20000000 + 0x500000 ; /* 5M bytes */
__base_EXTRAM = 0x28000000 ; /* EXTRAM */
__top_EXTRAM = 0x28800000 ;
diff --git a/nxpvee-mimxrt595-evk-round-apps/src/main/java/.gitkeep b/bsp/projects/nxpvee-ui/armgcc/obj/.gitkeep
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-apps/src/main/java/.gitkeep
rename to bsp/projects/nxpvee-ui/armgcc/obj/.gitkeep
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/board.h b/bsp/projects/nxpvee-ui/board/inc/board.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/board.h
rename to bsp/projects/nxpvee-ui/board/inc/board.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/clock_config.h b/bsp/projects/nxpvee-ui/board/inc/clock_config.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/clock_config.h
rename to bsp/projects/nxpvee-ui/board/inc/clock_config.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/display_support.h b/bsp/projects/nxpvee-ui/board/inc/display_support.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/display_support.h
rename to bsp/projects/nxpvee-ui/board/inc/display_support.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/pin_mux.h b/bsp/projects/nxpvee-ui/board/inc/pin_mux.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/pin_mux.h
rename to bsp/projects/nxpvee-ui/board/inc/pin_mux.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/probe.h b/bsp/projects/nxpvee-ui/board/inc/probe.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/inc/probe.h
rename to bsp/projects/nxpvee-ui/board/inc/probe.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/board.c b/bsp/projects/nxpvee-ui/board/src/board.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/board.c
rename to bsp/projects/nxpvee-ui/board/src/board.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/clock_config.c b/bsp/projects/nxpvee-ui/board/src/clock_config.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/clock_config.c
rename to bsp/projects/nxpvee-ui/board/src/clock_config.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/display_support.c b/bsp/projects/nxpvee-ui/board/src/display_support.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/display_support.c
rename to bsp/projects/nxpvee-ui/board/src/display_support.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/pin_mux.c b/bsp/projects/nxpvee-ui/board/src/pin_mux.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/board/src/pin_mux.c
rename to bsp/projects/nxpvee-ui/board/src/pin_mux.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/freertos/inc/FreeRTOSConfig.h b/bsp/projects/nxpvee-ui/freertos/inc/FreeRTOSConfig.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/freertos/inc/FreeRTOSConfig.h
rename to bsp/projects/nxpvee-ui/freertos/inc/FreeRTOSConfig.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c b/bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c
rename to bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c
index ad0372d..fb8fb20 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c
+++ b/bsp/projects/nxpvee-ui/freertos/src/SEGGER_SYSVIEW_Config_FreeRTOS.c
@@ -102,7 +102,7 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
* Function description
* Sends SystemView description strings.
*/
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
static void _cbSendSystemDesc(void) {
SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=FreeRTOS");
SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=MicroEJ");
@@ -118,7 +118,7 @@ static void _cbSendSystemDesc(void) {
**********************************************************************
*/
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SEGGER_SYSVIEW_OS_API SYSVIEW_MICROEJ_X_OS_TraceAPI;
static void SYSVIEW_MICROEJ_X_OS_SendTaskList(void){
SYSVIEW_X_OS_TraceAPI.pfSendTaskList();
@@ -129,7 +129,7 @@ static void SYSVIEW_MICROEJ_X_OS_SendTaskList(void){
void SEGGER_SYSVIEW_Conf(void) {
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SYSVIEW_MICROEJ_X_OS_TraceAPI.pfGetTime = SYSVIEW_X_OS_TraceAPI.pfGetTime;
SYSVIEW_MICROEJ_X_OS_TraceAPI.pfSendTaskList = SYSVIEW_MICROEJ_X_OS_SendTaskList;
SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/bsp_util.h b/bsp/projects/nxpvee-ui/main/inc/bsp_util.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/bsp_util.h
rename to bsp/projects/nxpvee-ui/main/inc/bsp_util.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload.h b/bsp/projects/nxpvee-ui/main/inc/cpuload.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload.h
rename to bsp/projects/nxpvee-ui/main/inc/cpuload.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload_conf.h b/bsp/projects/nxpvee-ui/main/inc/cpuload_conf.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload_conf.h
rename to bsp/projects/nxpvee-ui/main/inc/cpuload_conf.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload_impl.h b/bsp/projects/nxpvee-ui/main/inc/cpuload_impl.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/cpuload_impl.h
rename to bsp/projects/nxpvee-ui/main/inc/cpuload_impl.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/fault_handlers.h b/bsp/projects/nxpvee-ui/main/inc/fault_handlers.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/fault_handlers.h
rename to bsp/projects/nxpvee-ui/main/inc/fault_handlers.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/interrupts.h b/bsp/projects/nxpvee-ui/main/inc/interrupts.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/interrupts.h
rename to bsp/projects/nxpvee-ui/main/inc/interrupts.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/microej.h b/bsp/projects/nxpvee-ui/main/inc/microej.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/microej.h
rename to bsp/projects/nxpvee-ui/main/inc/microej.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/microjvm_main.h b/bsp/projects/nxpvee-ui/main/inc/microjvm_main.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/microjvm_main.h
rename to bsp/projects/nxpvee-ui/main/inc/microjvm_main.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/monitor.h b/bsp/projects/nxpvee-ui/main/inc/monitor.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/monitor.h
rename to bsp/projects/nxpvee-ui/main/inc/monitor.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/os_support.h b/bsp/projects/nxpvee-ui/main/inc/os_support.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/os_support.h
rename to bsp/projects/nxpvee-ui/main/inc/os_support.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/time_hardware_timer.h b/bsp/projects/nxpvee-ui/main/inc/time_hardware_timer.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/time_hardware_timer.h
rename to bsp/projects/nxpvee-ui/main/inc/time_hardware_timer.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/trace_platform.h b/bsp/projects/nxpvee-ui/main/inc/trace_platform.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/inc/trace_platform.h
rename to bsp/projects/nxpvee-ui/main/inc/trace_platform.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLBSP.c b/bsp/projects/nxpvee-ui/main/src/LLBSP.c
similarity index 87%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLBSP.c
rename to bsp/projects/nxpvee-ui/main/src/LLBSP.c
index 3a8a582..f92b531 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLBSP.c
+++ b/bsp/projects/nxpvee-ui/main/src/LLBSP.c
@@ -57,15 +57,6 @@ extern uint32_t __top_EXTRAM; // defined in linker script
// Java Low Level APIs
// -----------------------------------------------------------------------------
-// See the header file for the function documentation
-uint8_t LLBSP_IMPL_isInReadOnlyMemory(void* ptr) {
- if (LLBSP_IS_PTR_IN_RAM(ptr)) {
- return MICROEJ_FALSE;
- } else {
- return MICROEJ_TRUE;
- }
-}
-
// See the header file for the function documentation
void LLBSP_IMPL_putchar(int32_t c) {
PUTCHAR(c);
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLEXT_RES_impl.c b/bsp/projects/nxpvee-ui/main/src/LLEXT_RES_impl.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLEXT_RES_impl.c
rename to bsp/projects/nxpvee-ui/main/src/LLEXT_RES_impl.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLMJVM_FreeRTOS.c b/bsp/projects/nxpvee-ui/main/src/LLMJVM_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLMJVM_FreeRTOS.c
rename to bsp/projects/nxpvee-ui/main/src/LLMJVM_FreeRTOS.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLSP_FreeRTOS.c b/bsp/projects/nxpvee-ui/main/src/LLSP_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/LLSP_FreeRTOS.c
rename to bsp/projects/nxpvee-ui/main/src/LLSP_FreeRTOS.c
diff --git a/bsp/projects/nxpvee-ui/main/src/core_test_natives.c b/bsp/projects/nxpvee-ui/main/src/core_test_natives.c
new file mode 100644
index 0000000..289a181
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/main/src/core_test_natives.c
@@ -0,0 +1,127 @@
+/*
+ * C
+ *
+ * Copyright 2018-2024 MicroEJ Corp. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be found with this software.
+ */
+
+/*
+ * Copyright 2024 NXP
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#include "sni.h"
+
+jfloat Java_com_microej_core_tests_MicroejCoreValidation_testFloat (jfloat a, jfloat b) {
+ return a * b;
+}
+jdouble Java_com_microej_core_tests_MicroejCoreValidation_testDouble (jdouble a, jdouble b) {
+ return a * b;
+}
+jint Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments01(jint i1, jint i2, jint i3, jint i4, jint i5, jint i6, jint i7, jint i8, jint i9, jint i10){
+ if(i1==0x01020304 &&
+ i2==0x05060708 &&
+ i3==0x090A0B0C &&
+ i4==0x0D0E0F10 &&
+ i5==0x11121314 &&
+ i6==0x15161718 &&
+ i7==0x191A1B1C &&
+ i8==0x1D1E1F20 &&
+ i9==0x21222324 &&
+ i10==0x25262728){
+ return 0x292A2B2C;
+ }
+ else {
+ return 0;
+ }
+ }
+
+jlong Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments02(jlong l1, jlong l2, jlong l3, jlong l4, jlong l5, jlong l6, jlong l7, jlong l8, jlong l9, jlong l10){
+ if(l1==0x2D2E2F3031323334ll &&
+ l2==0x35363738393A3B3Cll &&
+ l3==0x3D3E3F4041424344ll &&
+ l4==0x45464748494A4B4Cll &&
+ l5==0x4D4E4F5051525354ll &&
+ l6==0x55565758595A5B5Cll &&
+ l7==0x5D5E5F6061626364ll &&
+ l8==0x65666768696A6B6Cll &&
+ l9==0x6D6E6F7071727374ll &&
+ l10==0x75767778797A7B7Cll){
+ return 0x7D7E7F8081828384ll;
+ }
+ else {
+ return 0ll;
+ }
+ }
+
+jlong Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments03(jint i1, jlong l2, jint i3, jlong l4, jint i5, jlong l6, jint i7, jlong l8, jint i9, jlong l10){
+ if(i1==0x85868788 &&
+ l2==0x898A8B8C8D8E8F90ll &&
+ i3==0x91929394 &&
+ l4==0x95969798999A9B9Cll &&
+ i5==0x9D9E9FA0 &&
+ l6==0xA1A2A3A4A5A6A7A8ll &&
+ i7==0xA9AAABAC &&
+ l8==0xADAEAFB0B1B2B3B4ll &&
+ i9==0xB5B6B7B8 &&
+ l10==0xB9BABBBCBDBEBFC0ll){
+ return 0xC1C2C3C4C5C6C7C8ll;
+ }
+ else {
+ return 0ll;
+ }
+ }
+
+jfloat Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments04(jfloat f1, jfloat f2, jfloat f3, jfloat f4, jfloat f5, jfloat f6, jfloat f7, jfloat f8, jfloat f9, jfloat f10){
+ if(f1==1.0f &&
+ f2==1.1f &&
+ f3==1.2f &&
+ f4==1.3f &&
+ f5==1.4f &&
+ f6==1.5f &&
+ f7==1.6f &&
+ f8==1.7f &&
+ f9==1.8f &&
+ f10==1.9f){
+ return 2.0f;
+ }
+ else {
+ return 0.0f;
+ }
+ }
+
+jdouble Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments05(jdouble d1, jdouble d2, jdouble d3, jdouble d4, jdouble d5, jdouble d6, jdouble d7, jdouble d8, jdouble d9, jdouble d10){
+ if(d1==2.0 &&
+ d2==2.1 &&
+ d3==2.2 &&
+ d4==2.3 &&
+ d5==2.4 &&
+ d6==2.5 &&
+ d7==2.6 &&
+ d8==2.7 &&
+ d9==2.8 &&
+ d10==2.9){
+ return 3.0;
+ }
+ else {
+ return 0.0;
+ }
+ }
+
+jdouble Java_com_microej_core_tests_MicroejCoreValidation_testNativeArguments06(jfloat f1, jdouble d2, jfloat f3, jdouble d4, jfloat f5, jdouble d6, jfloat f7, jdouble d8, jfloat f9, jdouble d10){
+ if(f1==3.0f &&
+ d2==3.1 &&
+ f3==3.2f &&
+ d4==3.3 &&
+ f5==3.4f &&
+ d6==3.5 &&
+ f7==3.6f &&
+ d8==3.7 &&
+ f9==3.8f &&
+ d10==3.9){
+ return 4.0;
+ }
+ else {
+ return 0.0;
+ }
+ }
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/cpuload.c b/bsp/projects/nxpvee-ui/main/src/cpuload.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/cpuload.c
rename to bsp/projects/nxpvee-ui/main/src/cpuload.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/cpuload_impl_FreeRTOS.c b/bsp/projects/nxpvee-ui/main/src/cpuload_impl_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/cpuload_impl_FreeRTOS.c
rename to bsp/projects/nxpvee-ui/main/src/cpuload_impl_FreeRTOS.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/fault_handlers.c b/bsp/projects/nxpvee-ui/main/src/fault_handlers.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/fault_handlers.c
rename to bsp/projects/nxpvee-ui/main/src/fault_handlers.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/fault_handlers_asm.s b/bsp/projects/nxpvee-ui/main/src/fault_handlers_asm.s
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/fault_handlers_asm.s
rename to bsp/projects/nxpvee-ui/main/src/fault_handlers_asm.s
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/interrupts.c b/bsp/projects/nxpvee-ui/main/src/interrupts.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/interrupts.c
rename to bsp/projects/nxpvee-ui/main/src/interrupts.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/main.c b/bsp/projects/nxpvee-ui/main/src/main.c
similarity index 87%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/main.c
rename to bsp/projects/nxpvee-ui/main/src/main.c
index 3001ffc..86f3288 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/main.c
+++ b/bsp/projects/nxpvee-ui/main/src/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 NXP
+ * Copyright 2023-2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -32,7 +32,7 @@
#include "power_manager.h"
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
#include "SEGGER_SYSVIEW.h"
#endif
@@ -126,7 +126,7 @@ int main(void) {
MEJ_LOG_MODULE_INFO(MAIN, "Silicon revision: %X.%X\n", silicon_rev_major, silicon_rev_minor);
/* Enable Trace */
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SEGGER_SYSVIEW_Conf();
trace_platform_initialize();
#endif
@@ -135,14 +135,10 @@ int main(void) {
TaskHandle_t pvCreatedTask;
BaseType_t ret = xTaskCreate(xJavaTaskFunction, "MEJ32 Core Engine", JAVA_TASK_STACK_SIZE, NULL, JAVA_TASK_PRIORITY, &pvCreatedTask);
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SEGGER_SYSVIEW_setMicroJVMTask((U32)pvCreatedTask);
#endif
vTaskStartScheduler();
}
-/* Functions used in Core Validation test */
-#include "sni.h"
-jfloat Java_com_microej_core_tests_MicroejCoreValidation_testFloat (jfloat a, jfloat b) {return a * b;}
-jdouble Java_com_microej_core_tests_MicroejCoreValidation_testDouble (jdouble a, jdouble b) {return a * b;}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/microjvm_main.c b/bsp/projects/nxpvee-ui/main/src/microjvm_main.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/microjvm_main.c
rename to bsp/projects/nxpvee-ui/main/src/microjvm_main.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/monitor.c b/bsp/projects/nxpvee-ui/main/src/monitor.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/monitor.c
rename to bsp/projects/nxpvee-ui/main/src/monitor.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/os_support.c b/bsp/projects/nxpvee-ui/main/src/os_support.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/os_support.c
rename to bsp/projects/nxpvee-ui/main/src/os_support.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/stack_overflow_impl_FreeRTOS.c b/bsp/projects/nxpvee-ui/main/src/stack_overflow_impl_FreeRTOS.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/stack_overflow_impl_FreeRTOS.c
rename to bsp/projects/nxpvee-ui/main/src/stack_overflow_impl_FreeRTOS.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/time_hardware_timer.c b/bsp/projects/nxpvee-ui/main/src/time_hardware_timer.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/time_hardware_timer.c
rename to bsp/projects/nxpvee-ui/main/src/time_hardware_timer.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/trace_platform.c b/bsp/projects/nxpvee-ui/main/src/trace_platform.c
similarity index 94%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/trace_platform.c
rename to bsp/projects/nxpvee-ui/main/src/trace_platform.c
index cf5d04e..ed218b1 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/trace_platform.c
+++ b/bsp/projects/nxpvee-ui/main/src/trace_platform.c
@@ -96,7 +96,7 @@ void trace_HW_tasks_send_task_list(void)
*/
void trace_HW_task_start(uint32_t HW_task_id)
{
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
SEGGER_SYSVIEW_OnTaskStartReady(HW_task_id);
#endif
}
@@ -106,7 +106,7 @@ void trace_HW_task_start(uint32_t HW_task_id)
*/
void trace_HW_task_stop(uint32_t HW_task_id)
{
-#if (ENABLE_SVIEW == 1)
+#if (ENABLE_SYSTEM_VIEW == 1)
U32 currentTaskId = SEGGER_SYSVIEW_currentTaskId;
SEGGER_SYSVIEW_OnTaskStartExec(HW_task_id);
SEGGER_SYSVIEW_OnTaskStopReady(HW_task_id, 0);
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/tree_version.c.in b/bsp/projects/nxpvee-ui/main/src/tree_version.c.in
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/tree_version.c.in
rename to bsp/projects/nxpvee-ui/main/src/tree_version.c.in
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/tree_version.h b/bsp/projects/nxpvee-ui/main/src/tree_version.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/main/src/tree_version.h
rename to bsp/projects/nxpvee-ui/main/src/tree_version.h
diff --git a/bsp/projects/nxpvee-ui/sdk_makefile/Makefile b/bsp/projects/nxpvee-ui/sdk_makefile/Makefile
new file mode 100644
index 0000000..498f8ac
--- /dev/null
+++ b/bsp/projects/nxpvee-ui/sdk_makefile/Makefile
@@ -0,0 +1,16 @@
+#
+# Copyright 2023 NXP
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+TARGET=mimxrt595_freertos-bsp
+DEVICE=MIMXRT595S_M33
+LS_DEVICE=MIMXRT595S:EVK-MIMXRT595
+ADDRESS=0x08000000
+FLAVOUR=debug
+
+ifeq ($(strip $(RELEASE)),1)
+FLAVOUR=release
+endif
+
+include ../../common/sdk_makefile/Makefile
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/sdk_makefile/jlink_flash.script b/bsp/projects/nxpvee-ui/sdk_makefile/jlink_flash.script
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/sdk_makefile/jlink_flash.script
rename to bsp/projects/nxpvee-ui/sdk_makefile/jlink_flash.script
diff --git a/nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/simple_gfx_app/src/simple_gfx_app_imp.c b/bsp/projects/nxpvee-ui/simple_gfx_app/src/simple_gfx_app_imp.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/projects/nxpvee-ui/simple_gfx_app/src/simple_gfx_app_imp.c
rename to bsp/projects/nxpvee-ui/simple_gfx_app/src/simple_gfx_app_imp.c
diff --git a/bsp/sdk_overlay/middleware/vglite/ChangeLogKSDK.txt b/bsp/sdk_overlay/middleware/vglite/ChangeLogKSDK.txt
new file mode 100644
index 0000000..c7a7554
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/ChangeLogKSDK.txt
@@ -0,0 +1,281 @@
+/*!
+@page middleware_log Middleware Change Log
+
+@section vglite VGLite GPU Driver
+ The current version of the VGLite GPU Driver is 3.0.15_rev7.
+ - version 3.0.15_rev7
+ - Fixed:
+ - (MCUX-54842) Fixed build warnings
+ - version 3.0.15_rev6
+ - Fixed:
+ - Fixed incorrect scissoring issue in single thread mode
+ - Optimized line stroking to reduce memory consumption
+ - Extended blit output quality workaround to "vg_lite_blit_rect"
+ - (IMX-3008) Fixed driver reporting incorrect version number
+ - (IMX-2848) Allocated path stroking parameters dynamically
+ - (IMX-3010) Fixed scissoring window check with large tessellation buffers
+ - Changed:
+ - (IMX-2907) Removed obsolete "vg_lite_perspective" API
+ - version 3.0.15_rev5
+ - Fixed:
+ - (IMX-2867) Fixed hang when processing vector paths with zero length
+ - (IMX-2959) Fixed GPU using garbage data during image filtering
+ - (IMX-2900) Restructured source code for better single thread & multithread modes maintenance
+ - Changed:
+ - (MCUX-52922) Disable GPU auto clock gating by default. Feature can be enabled from build config
+ - version 3.0.15_rev4
+ - Changed:
+ - (IMX-2900) Renamed build switch for disabling driver multithread support
+ - version 3.0.15_rev3
+ - Fixed:
+ - Relocated centerX/Y definitions in vg_lite.c
+ - (IMX-2918) Reduced vg_lite_finish() delay when it has nothing to do
+ - (IMX-2901) Fixed reversed red and blue channels in colour gradients fill colour
+ - (IMX-2901) Fixed linear gradient matrix transformation error
+ - (IMX-2901) Fixed radial gradient render error
+ - Changed:
+ - (IMX-2799) Enabled GPU auto clock gating by default
+ - (IMX-2799) Added build switch to disable GPU auto clock gating
+ - Added:
+ - (IMX-2900) Added initial support for single thread mode
+ - version 3.0.15_rev2
+ - Fixed:
+ - (IMX-2881) Fixed memory leaks in vector path stroking implementation
+ - (IMX-2863) Fixed stroked polygons rendering issue
+ - (IMX-2842) Fixed system hang when drawing circular arcs
+ - (MGG-897) Use OS heap instead of application heap for stroked vector polygons
+ - (MGG-897) Use OS heap instead of application heap for ciecular arc rendering
+ - Changed:
+ - (IMX-2863) Allow users to configure fill colour for stroked & filled vector paths
+ - version 3.0.15_rev1
+ - Fixed:
+ - (IMX-2844) Fixed missing path descriptor initialization in "vg_lite_init_arc_path"
+ - (IMX-2837) Fixed arc drawing direction
+ - (IMX-2811) Added VGPE flush after buffer clear
+ - Changed:
+ - (IMX-2835) Optimized storage of radial gradients params to allow memory saving
+ - Added:
+ - Added dithering support for RT11xx platforms
+ - Added color keying support for RT11xx platforms
+ - (IMX-2817) Added vector path stroking
+ - (IMX-2692) Added support for HW accelerated linear gradients on RT11xx platforms
+ - version 3.0.13_rev2
+ - Fixed:
+ - (MGG-793) Fixed clipping issue when using the RT500 blit output quality workaround
+ - (MGG-830) Disabled RT500 blit output quality workaround for non-affine graphic transformations
+ - (IMX-2701) Fixed memory leak in vector arc drawing API
+ - (IMX-2699) Fixed build warnings in vector arc drawing API
+ - (MGG-836) Fixed the font/text support via main VGLite driver API
+ - Changed:
+ - (IMX-1724) Changed image width 16 pixels alignment to stride 16 byte alignment
+ - (MCUX-46210) Dropped useless "const" qualifier for the "name" attribute of "vg_lite_font_params_t" data structure
+ - (MGG-836) Reordered "vg_lite_draw_text" API arguments
+ - version 3.0.13_rev1
+ - Fixed:
+ - (IMX-2577) Fixed support for colour palettes (CLUT) in multithread mode
+ - (MGG-735) Fixed Elementary library instability caused by using calloc/free in ElmWrapBuffer
+ - Changed:
+ - (IMX-2600) Updated "vg_lite_finish" to wait for all frames previously submitted with "vg_lite_flush"
+ - Aligned "vg_lite_radial_gradient_parameter" data struct with parameters in Elementary EVO object
+ - Added:
+ - Added support for drawing vector arcs/circles
+ - Added support for i.MXRT6Q GPU
+ - Added support for GCNanoliteV GPU Rev. 0x1322
+ - Added vector arcs support in Elementary library
+ - version 3.0.11_rev3
+ - Fixed:
+ - Fix async event reset after being initialized
+ - (IMX-2604) Fix polygon's rendering regression in multitasking scenarios
+ - Avoid "vg_lite_blit" modifying user's transformation matrix
+ - version 3.0.11_rev2
+ - Fixed:
+ - (MGG-685) Added workaround to improve "blit" output quality for RT500
+ - (MCUX-43004) Fixed clipping window regression issue introduced by VGLite 3.0.11.1
+ - (MGG-764) Fixed VGLite heap useless splitting of memory nodes
+ - (MGG-765) Fixed regression issue introduced by VGLite 3.0.11.1 when loading graphic resources using Elementary library
+ - (IMX-2506) Fixed "vg_lite_update_rad_grad" not checking the result of memory allocation
+ - (MCUX-42992) Fixed IAR toolchain not recognizing optimization directive
+ - (MGG-763) Remove risk of out-of-bounds read in "vg_lite_update_rad_grad" function
+ - Changed:
+ - (IMX-2527) Improved memory footprint by using a common tessellation buffer for all drawing tasks
+ - (MGG-712) Restructured OS abstraction layer to allow easier integration with popular OSes
+ - version 3.0.11_rev1
+ - Fixed:
+ - (IMX-2502) Fixed GPU command buffer overflow when copying context data
+ - (IMX-2503) Fixed additional colour ring incorrectly appearing at the edge of radial gradients
+ - (IMX-2487) Fixed risk of memory leak in "vg_lite_upload_path"
+ - (IMX-2429) Fixed incorrect blending of A4 and A8 images (regression since VGLite 3.0.4.x)
+ - (MGG-687) Fixed build warning when VG_RENDER_TEXT feature is disabled
+ - Changed:
+ - (IMX-2354) Added support for dynamic command buffer size management
+ - Added:
+ - (IMX-2435) Added new API function - vg_lite_get_transform_matrix - to calculate parameters for 2D perspective transformations
+ - (IMX-2411) Added support for radial gradients in Elementary library
+ - (IMX-2026) Added support for images embedded in EVO data in Elementary library
+ - (IMX-2026) Added support for patterns embedded in EVO data in Elementary library
+ - version 3.0.9_rev2
+ - Fixed:
+ - (MCUX-40557) Fixed build warnings
+ - version 3.0.9_rev1
+ - Fixed:
+ - (MGG-648) Fixed rendered text overlapping issue
+ - (MGG-650) Fixed memory leak caused by failure to unload RLE font data
+ - (IMX-2395) Fixed incorrect reporting of indexed images as "supported" for GC355 GPU (RT1170)
+ - Changed:
+ - (IMX-2370) Refactored GPU driver HAL and OS layers
+ - (MGG-646) Configured a vector font as default font
+ - version 3.0.9
+ - Fixed:
+ - (IMX-2361) Fixed tessellation bounds computation error
+ - Changed:
+ - (IMX-2367) Enabled alpha channel premultiplication by default for GC355 GPU (RT1170)
+ - (IMX-2261) Added Elementary library input data address alignment verification
+ - Added:
+ - (IMX-2323) Added support for radial colour gradients for GC355 GPU (RT1170)
+ - (IMX-2317) Upgraded the Elementary library to be thread safe
+ - version 3.0.6_rev4
+ - Fixed:
+ - (IMX-2357) Fixed rendering performance degradation since the implementation of the multithread/multicontext support
+ - (MGG-576) Elementary: Fixed hard fault when resetting translation of EVO object
+ - (MCUX-38672) Fixed font and text support build warnings
+ - (MGG-596) Fixed memory leak in raster font loading
+ - (MGG-596) Font and text support: Fixed out of range memory access in Elementary library
+ - Changed:
+ - (MGG-596) "VG_RENDER_TEXT=1" build symbol now required to enable font and text support
+ - (MGG-594) Updated font and text support to allow easy decoupling from GPU driver and Elementary when not needed
+ - (MGG-533) Removed "is_tspan" attribute from "vg_lite_font_attributes_t"
+ - (MGG-533) Added new attribute "tspan_has_dx_dy" to "vg_lite_font_attributes_t"
+ - (MGG-533) Added new argument "matrix" to "vg_lite_draw_text" API function
+ - (MGG-592) Renamed "eFontTypes_t" enum to "eFontType_t"
+ - (MGG-592) Renamed "eFontVectorType" identifier to "eFontTypeVector"
+ - (MGG-592) Renamed "eFontRasterType" identifier to "eFontTypeRaster"
+ - (MGG-596) Changed "vg_lite_draw_text" function return value from "int" to "vg_lite_error_t"
+ - Added:
+ - (MGG-596) Added "vg_lite_find_font" API function
+ - (MGG-596) Added 2 new error codes for "vg_lite_error_t": VG_LITE_ALREADY_EXISTS and VG_LITE_NOT_ALIGNED
+ - (IMX-2357) Allow users to override command queue task priority at build time using QUEUE_TASK_PRIO build symbol
+ - (MGG-551) Added text wrapping support for vector fonts
+ - (MGG-533) Added support for text right alignment
+ - version 3.0.6_rev3
+ - Added:
+ - (MGG-551) Added support for font and text rendering
+ - version 3.0.6_rev2
+ - Fixed:
+ - (IMX-2292) Fixed command buffer flushing after draw
+ - (IMX-2293) Fixed copy of register status when command buffer was not full
+ - (IMX-2305) Fixed scissor window taking no effect
+ - (IMX-2324) Fixed GPU feature table reset when calling "vg_lite_close"
+ - (IMX-2358) Fixed misuse of address operator in checking colour channel premultiplication flag
+ - (MGG-542) Cleaned up useless "memset" in "vg_lite_init"
+ - version 3.0.6_rev1
+ - Fixed:
+ - (IMX-2295) Initialize task context to zero in vg_lite_init()
+ - version 3.0.6
+ - Fixed:
+ - (MGG-525) Fixed "vg_lite_init_path" not properly initializating the "path" data structure
+ - Changed:
+ - (IMX-2255) Updated "vg_lite_set_scissor" arguments to (x, y, width, height) instead of (x0, y0, x1, y1)
+ - Added:
+ - (IMX-2104) Added API to enable/disable colour channel pre-multiplication at runtime on RT1170
+ - version 3.0.5
+ - Fixed:
+ - (IMX-2252) Reset global mutex when it is destroyed
+ - (IMX-2252) Fixed reset of task local context in vg_lite_close()
+ - Changed:
+ - (MGG-333) Enabled scissoring for GC255 GPU (i.MXRT500)
+ - Added:
+ - (IMX-1729) Added support for drawing from multiple threads
+ - version 3.0.4_rev5
+ - Changed:
+ - (IMX-2104) Disabled by default colour channel pre-multiplication on RT1170 platform
+ - (MGG-517) Updated "vg_lite_draw_pattern" function to return VG_LITE_NOT_SUPPORT for A4/A8 patterns
+ - Fixed:
+ - (IMX-2155) Fixed hard coded image mode in "vg_lite_draw_pattern"
+ - (IMX-2153) Updated "vg_lite_draw_pattern" to take into account pattern transparency
+ - (KPSDK-37093) Elementary library - Fixed bad free in "load_evo"
+ - (KPSDK-37093) Elementary library - Avoid resource leak in "ElmCreateBuffer"
+ - version 3.0.4_rev4
+ - Fixed:
+ - Fixed empty function argument lists definition for scissoring related API functions
+ - (IMX-1995) Extended RT500 image rotation fix to vg_lite_blit_rect, vg_lite_draw_pattern
+ - (IMX-1995) Isolated RT500 image rotation fix effects to RT500 platform only
+ - version 3.0.4_rev3
+ - Fixed:
+ - (IMX-1995) Compensated for RT500 image shift effect when rotation is approaching multiples of 90 dgs
+ - version 3.0.4_rev2
+ - Fixed:
+ - Fixed integration issue of "vg_lite_mem_avail" API
+ - version 3.0.4_rev1
+ - Changed:
+ - (IMX-1768) Enabled users to query, at runtime, the support for VG_LITE_UPPER draw quality
+ - Fixed:
+ - (IMX-2074) Fixed GPU exception handling issue
+ - Added:
+ - (IMX-2045) Added API to provide available heap memory
+ - version 3.0.4
+ - Changed:
+ - (IMX-1957) Enabled users to query, at runtime, the support for BORDER_CULLING and SCISSOR features
+ - Enable users to query, at runtime, the support for RGBA 2 bits-per-channel image formats
+ - Fixed:
+ - (IMX-1934) Fixed image stride alignment verification for TILED images
+ - Fix GC355 GPU (i.MXRT1170) draw error when tessellation window width is not aligned to 128
+ - Added:
+ - (MGG-333) Added support for GC355 GPU (i.MXRT1170) scissoring
+ - version 3.0.1_rev1
+ - Fixed:
+ - (MGG-250) Fixed GPU hang after a random time (mostly reproduced on RT1170 platforms)
+ - (KPSDK-33132) Fixed Elementary library memory leaks in case of failed EBO loading
+ - (MGG-336) Allow use of blend modes not affected by the border culling limitation
+ - (MGG-18) Fixed Elementary library memory leaks when loading EVO/EBO/EGO objects
+ - (MGG-353) Fixed linear colour gradient rendering error when loading EVOs using the Elementary library
+ - version 3.0.1
+ - Changed:
+ - Removed "vg_lite_blit2" API function due to lack of hardware support
+ - Removed "vg_lite_scanline" API function due to lack of harware support
+ - Aggregated "vg_lite_error.h" API header file content into "vg_lite.h"
+ - Aggregated "vg_lite_features.h" API header file content into "vg_lite.h"
+ - Aggregated "vg_lite_matrix.h" API header file content into "vg_lite.h"
+ - Aggregated "vg_lite_path.h" API header file content into "vg_lite.h"
+ - Aggregated "vg_lite_util.h" API header file content into "vg_lite.h"
+ - (IMX-1861) Added return code to the "vg_lite_flush" API function
+ - Changed VGLite GPU driver license from proprietary to MIT
+ - Fixed:
+ - Fixed definition of "elm_alloc" function in Elementary toolkit
+ - (IMX-1869) Fixed initialization of aligned bytes in the command buffer
+ - (IMX-1821) Fixed inverted background colours when using "vg_lite_draw_pattern"
+ - Fixed hang when calling "vg_lite_flush" repeatedly
+ - (IMX-1861) Fix propagation of return codes from "stall", "submit", "vg_lite_flush" function calls
+ - version 2.0.14_rev1
+ - Changed:
+ - (IMX-1809) Fixed misspelling of "vg_lite_buffer_transparency_mode"
+ - (IMX-1778) Added verification of colour gradients parameters
+ - (IMX-1813) Added return code to the "vg_lite_hal_allocate_contiguous" function
+ - (MGG-204) Added return code to "vg_lite_finish"
+ - Fixed:
+ - (IMX-1808) Fixed "vg_lite_blit" failure on dynamically allocated buffers
+ - (IMX-1773) Fixed failure to create 16 colours gradients
+ - (IMX-1790) Fixed driver incorrectly reporting available heap space
+ - (IMX-1810) Fixed verification of raster image stride alignment
+ - (IMX-1810) Fixed verification of raster image colour depth
+ - (IMX-1816) Fixed "vg_lite_close" not releasing memory allocated from OS heap
+ - (MGG-201) Fixed hard fault caused by command buffer management
+ - (MGG-202) Fixed "vg_lite_hal_wait_interrupt" function ignoring the timeout
+ - (MGG-203) Fixed "vg_lite_draw" function always returning success
+ - version 2.0.13_rev2
+ - Fixed:
+ - (MGG-102) Fixed incorrect colour gradient clipping issue when using "vg_lite_draw_gradient" API
+ - (MGG-140) Fixed "vg_lite_draw_gradient" error when gradient is not covering the entire shape
+ - version 2.0.13_rev1
+ - Added:
+ - (MGG-88) Support for operating with BGRA2222, ABGR2222, ARGB2222 type images
+ - (MGG-88) Support for operating with ABGR4444, ARGB4444 type images
+ - (MGG-88) Support for operating with ABGR8888, ARGB8888 type images
+ - (MGG-88) Support for operating with XBGR8888, XRGB8888 type images
+ - (MGG-52) Improved GPU bus error reporting by using weak functions
+ - Changed:
+ - (MGG-66) Restructured GPU driver by exposing the HAL source code for easier integration with operating systems
+ - Fixed:
+ - (MGG-72) Fixed rough edges of vector artefacts when using the "vg_lite_draw_pattern" API
+ - (MGG-58) Fixed "vg_lite_blit_rect" API not supporting a zero Y coordinate
+ - version 2.0.13_rev0
+*/
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/LICENSE.txt b/bsp/sdk_overlay/middleware/vglite/LICENSE.txt
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/LICENSE.txt
rename to bsp/sdk_overlay/middleware/vglite/LICENSE.txt
diff --git a/bsp/sdk_overlay/middleware/vglite/VGLite/nxp_support.c b/bsp/sdk_overlay/middleware/vglite/VGLite/nxp_support.c
new file mode 100644
index 0000000..d024b81
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/nxp_support.c
@@ -0,0 +1,35 @@
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2023 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to
+* deal in the Software without restriction, including without limitation the
+* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+* sell copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+* IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "nxp_support.h"
+
+#if (defined(__REDLIB__))
+float hypotf (float x, float y)
+{
+ return sqrtf(x*x + y*y);
+}
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c b/bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c
similarity index 91%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c
rename to bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c
index dbf3cbf..12882c5 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.c
@@ -1,16 +1,18 @@
#include "vg_lite_os.h"
#include "FreeRTOS.h"
-#if !defined(VG_DRIVER_SINGLE_THREAD)
#include "semphr.h"
+#if !defined(VG_DRIVER_SINGLE_THREAD)
#include "task.h"
#include "queue.h"
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
#include "vg_lite_hw.h"
#include "vg_lite_hal.h"
/* If bit31 is activated this indicates a bus error */
#define IS_AXI_BUS_ERR(x) ((x)&(1U << 31))
+#if !defined(VG_DRIVER_SINGLE_THREAD)
#define ISR_WAIT_TIME 0x1FFFF
#define MAX_MUTEX_TIME 100
#define TASK_WAIT_TIME 20
@@ -51,9 +53,10 @@ static vg_lite_os_t os_obj = {0};
SemaphoreHandle_t semaphore[TASK_LENGTH] = {NULL};
SemaphoreHandle_t command_semaphore = NULL;
+uint32_t curContext;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
SemaphoreHandle_t int_queue;
volatile uint32_t int_flags;
-uint32_t curContext;
void __attribute__((weak)) vg_lite_bus_error_handler()
{
@@ -65,6 +68,7 @@ void __attribute__((weak)) vg_lite_bus_error_handler()
return;
}
+#if !defined(VG_DRIVER_SINGLE_THREAD)
/* command queue function */
void command_queue(void * parameters)
{
@@ -181,6 +185,7 @@ void vg_lite_os_reset_tls()
{
vTaskSetThreadLocalStoragePointer(NULL, 0, NULL);
}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
void vg_lite_os_sleep(uint32_t msec)
{
@@ -189,12 +194,15 @@ void vg_lite_os_sleep(uint32_t msec)
int32_t vg_lite_os_initialize(void)
{
+#if !defined(VG_DRIVER_SINGLE_THREAD)
static int task_number = 0;
BaseType_t ret;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
int_queue = xSemaphoreCreateBinary();
int_flags = 0;
+#if !defined(VG_DRIVER_SINGLE_THREAD)
if(mutex == NULL)
{
mutex = xSemaphoreCreateMutex();
@@ -221,18 +229,22 @@ int32_t vg_lite_os_initialize(void)
return VG_LITE_SUCCESS;
}
}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
return VG_LITE_SUCCESS;
}
void vg_lite_os_deinitialize(void)
{
/* TODO: Remove clock. */
+#if !defined(VG_DRIVER_SINGLE_THREAD)
vSemaphoreDelete(mutex);
mutex = 0;
+#endif /* VG_DRIVER_SINGLE_THREAD */
vSemaphoreDelete(int_queue);
/* TODO: Remove power. */
}
+#if !defined(VG_DRIVER_SINGLE_THREAD)
int32_t vg_lite_os_lock()
{
if(mutex == NULL)
@@ -302,6 +314,7 @@ int32_t vg_lite_os_wait(uint32_t timeout, vg_lite_os_async_event_t *event)
}
return VG_LITE_TIMEOUT;
}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
void vg_lite_os_IRQHandler(void)
{
@@ -359,6 +372,7 @@ int32_t vg_lite_os_wait_interrupt(uint32_t timeout, uint32_t mask, uint32_t * va
#endif
}
+#if !defined(VG_DRIVER_SINGLE_THREAD)
int32_t vg_lite_os_init_event(vg_lite_os_async_event_t *event,
uint32_t semaphore_id,
int32_t state)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h b/bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h
similarity index 82%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h
rename to bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h
index d527b76..6b852f2 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/rtos/vg_lite_os.h
@@ -2,7 +2,8 @@
#define _VG_LITE_OS_H
#include
-#if !defined(SINGLE_THREAD_DRIVER)
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
#define vg_lite_os_set_event_state(event, state) (event)->signal = state
@@ -30,7 +31,8 @@ int32_t vg_lite_os_set_tls(void* tls);
@brief Get the current task’s thread local storage array.
*/
void * vg_lite_os_get_tls( );
-#endif /* not defined(SINGLE_THREAD_DRIVER) */
+
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
/*!
@brief Memory allocate.
@@ -42,12 +44,12 @@ void * vg_lite_os_malloc(uint32_t size);
*/
void vg_lite_os_free(void * memory);
-#if !defined(SINGLE_THREAD_DRIVER)
+#if !defined(VG_DRIVER_SINGLE_THREAD)
/*!
@brief Reset the value in a task’s thread local storage array.
*/
void vg_lite_os_reset_tls();
-
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
/*!
@brief sleep a number of milliseconds.
@@ -64,6 +66,7 @@ int32_t vg_lite_os_initialize();
*/
void vg_lite_os_deinitialize();
+#if !defined(VG_DRIVER_SINGLE_THREAD)
/*!
@brief Mutex semaphore take.
*/
@@ -83,17 +86,19 @@ int32_t vg_lite_os_submit(uint32_t context, uint32_t physical, uint32_t offset,
@brief Wait for the current command buffer to be executed.
*/
int32_t vg_lite_os_wait(uint32_t timeout, vg_lite_os_async_event_t *event);
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
/*!
@brief IRQ Handler.
*/
-void vg_lite_os_IRQHandler();
+void vg_lite_os_IRQHandler(void);
/*!
@brief Wait until an interrupt from the VGLite graphics hardware has been received.
*/
int32_t vg_lite_os_wait_interrupt(uint32_t timeout, uint32_t mask, uint32_t * value);
+#if !defined(VG_DRIVER_SINGLE_THREAD)
/*!
@brief
*/
@@ -121,5 +126,5 @@ int32_t vg_lite_os_signal_event(vg_lite_os_async_event_t *event);
*/
int8_t vg_lite_os_query_context_switch(uint32_t context);
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
#endif
-#endif /* not defined(SINGLE_THREAD_DRIVER) */
diff --git a/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite.c b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite.c
new file mode 100644
index 0000000..c563ff6
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite.c
@@ -0,0 +1,10924 @@
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+* Copyright 2020-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+* 1. Add a weak the function "vg_lite_draw_notify_render_area()"
+* 2. Add "vg_lite_get_scissor()"
+*
+*****************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "vg_lite.h"
+#include "vg_lite_kernel.h"
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+#include "vg_lite_os.h"
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+#if (VG_RENDER_TEXT==1)
+#include "vg_lite_text.h"
+#endif /* VG_RENDER_TEXT */
+#include "vg_lite_flat.h"
+
+/*
+ * Stop IAR compiler from warning about implicit conversions from float to
+ * double
+ */
+#if (defined(__ICCARM__))
+#pragma diag_suppress = Pa205
+#endif
+
+/* This is the function to call from the VGLite driver to interface with the GPU. */
+vg_lite_error_t vg_lite_kernel(vg_lite_kernel_command_t command, void * data);
+
+
+/*** Command buffer dump ***/
+#ifndef DUMP_COMMAND
+#define DUMP_COMMAND 0
+#endif
+
+#ifndef DUMP_IMAGE
+#define DUMP_IMAGE 0
+
+#else
+#ifndef DUMP_COMMAND
+#define DUMP_COMMAND 0
+#endif
+
+#ifndef DUMP_IMAGE
+#define DUMP_IMAGE 0
+#endif
+#endif
+
+#define VG_TARGET_FC_DUMP 0
+
+/* Fast clear is not used by default,if SOC should use this ,set this macro to 1. */
+#ifndef VG_TARGET_FAST_CLEAR
+ #define VG_TARGET_FAST_CLEAR 0
+#endif /* VG_TARGET_FAST_CLEAR */
+
+#if DUMP_COMMAND || DUMP_IMAGE
+#ifdef __linux__
+#include
+#endif
+#endif
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+/*** Global Context Access ***/
+#define GET_CONTEXT() &s_context
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+/*** Command buffer configurations, double buffer support ***/
+#define VG_LITE_COMMAND_BUFFER_SIZE (64 << 10)
+#define CMDBUF_BUFFER(context) (context).command_buffer[(context).command_buffer_current]
+#define CMDBUF_INDEX(context) (context).command_buffer_current
+#define CMDBUF_SIZE(context) (context).command_buffer_size
+#define CMDBUF_OFFSET(context) (context).command_offset[(context).command_buffer_current]
+#define CMDBUF_SWAP(context) (context).command_buffer_current = \
+ ((context).command_buffer_current + 1) % CMDBUF_COUNT
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+#ifndef CMDBUF_IN_QUEUE
+#define CMDBUF_IN_QUEUE(context, id) \
+ (vg_lite_os_event_state(&(context)->async_event[(id)]) == VG_LITE_IN_QUEUE)
+#endif
+
+#define RESERVE_BYTES_IN_CMDBUF(context) \
+ {\
+ ((uint32_t *) (CMDBUF_BUFFER((context)) + CMDBUF_OFFSET((context))))[0] = VG_LITE_STATE(0x0a00);\
+ ((uint32_t *) (CMDBUF_BUFFER((context)) + CMDBUF_OFFSET((context))))[1] = 0;\
+ CMDBUF_OFFSET((context)) += 8;\
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+#define VG_LITE_RETURN_ERROR(func) \
+if ((error = func) != VG_LITE_SUCCESS) \
+return error
+
+#define VG_LITE_BREAK_ERROR(func) \
+if ((error = func) != VG_LITE_SUCCESS) \
+break
+
+#define VG_LITE_ERROR_HANDLER(func) \
+if ((error = func) != VG_LITE_SUCCESS) \
+goto ErrorHandler
+
+/*** Command macros ***/
+
+#define VG_LITE_END(interrupt) (0x00000000 | interrupt)
+#define VG_LITE_SEMAPHORE(id) (0x10000000 | id)
+#define VG_LITE_STALL(id) (0x20000000 | id)
+#define VG_LITE_STATE(address) (0x30010000 | address)
+#define VG_LITE_STATES(count, address) (0x30000000 | ((count) << 16) | address)
+#define VG_LITE_DATA(count) (0x40000000 | count)
+#define VG_LITE_CALL(count) (0x60000000 | count)
+#define VG_LITE_RETURN() (0x70000000)
+#define VG_LITE_NOP() (0x80000000)
+
+/*** Shortcuts. ***/
+#define A(color) (color) >> 24
+#define R(color) ((color) & 0x00ff0000) >> 16
+#define G(color) ((color) & 0x0000ff00) >> 8
+#define B(color) ((color) & 0xff)
+#define ARGB(a, r, g, b) ((a) << 24) | ((r) << 16) | ((g) << 8 ) | (b)
+#define ARGB4(a, r, g, b) (((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | (((g) & 0xf0)) | ((b) >> 4)
+
+#define FC_BURST_BYTES 64
+#define FC_BIT_TO_BYTES 64
+
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
+static uint32_t command_buffer_size = VG_LITE_COMMAND_BUFFER_SIZE;
+
+#define FORMAT_ALIGNMENT(stride,align) \
+ { \
+ if((stride) % (align) != 0) \
+ return VG_LITE_INVALID_ARGUMENT; \
+ return VG_LITE_SUCCESS; \
+ }
+
+#define DEST_ALIGNMENT_LIMITATION 64 /* To match hardware alignment requirement */
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+#define TS_STATE_COUNT 20 /* Initial state count for tessellation buffer. */
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+#define MATRIX_ROWS 3
+#define GET_MATRIX_VALUES(Pointer) ((float *) (Pointer))
+#define MAT(Matrix, Row, Column) (GET_MATRIX_VALUES(Matrix)[Row * MATRIX_ROWS + Column])
+
+#define COLOR_FROM_RAMP(ColorRamp) (((vg_lite_float_t *) ColorRamp) + 1)
+#define CLAMP(x, min, max) (((x) < (min)) ? (min) : \
+ ((x) > (max)) ? (max) : (x))
+#define LERP(v1, v2, w) ((v1) * (w) + (v2) * (1.0f - (w)))
+
+#define PI 3.141592653589793238462643383279502f
+#define SINF(x) ((vg_lite_float_t) sin(x))
+#define COSF(x) ((vg_lite_float_t) cos(x))
+#define FABSF(x) ((vg_lite_float_t) fabs(x))
+#define SQRTF(x) ((vg_lite_float_t) sqrt(x))
+#define CLAMP(x, min, max) (((x) < (min)) ? (min) : \
+ ((x) > (max)) ? (max) : (x))
+#define ACOSF(x) ((vg_lite_float_t) acos(x))
+#define FMODF(x, y) ((vg_lite_float_t) fmod((x), (y)))
+#define CEILF(x) ((vg_lite_float_t) ceil(x))
+#define FALSE 0
+#define TURE 1
+#define SIZEOF(a) \
+( \
+ (size_t) (sizeof(a)) \
+)
+
+typedef uintptr_t UINTPTR_T;
+
+#define PTR2SIZE(p) \
+( \
+ (UINTPTR_T) (p) \
+)
+
+#define GETINCREMENT(pointer, datatype_size) \
+ (datatype_size - (PTR2SIZE(pointer) & (datatype_size - 1)))
+
+#define SKIPTODATA(pointer, datatype_size, SIZE) \
+ /* Determine the increment value. */ \
+ increment = GETINCREMENT(pointer, datatype_size); \
+ /* Skip to the data. */ \
+ pointer += increment; \
+ SIZE -= increment
+
+#define VGSL_GETVALUE(X) \
+ X = get_value(data_pointer); \
+ data_pointer += data_type_size; \
+ size -= data_type_size
+
+#define VGSL_GETCOORDXY(X, Y) \
+ VGSL_GETVALUE(X); \
+ VGSL_GETVALUE(Y); \
+ if (is_relative) { X += ox; Y += oy; }
+
+#define FLOAT_EPSILON 0.001f
+
+#define SWING_NO 0
+#define SWING_OUT 1
+#define SWING_IN 2
+
+/* Point curve type for generated stroke path. */
+#define CURVE_LINE 0
+#define CURVE_QUAD_CONTROL 1
+#define CURVE_QUAD_ANCHOR 2
+#define CURVE_ARC_SCCW 3
+#define CURVE_ARC_SCCW_HALF 4
+
+#define FLOAT_PI 3.141592654f
+#define FLOAT_PI_TWO 6.283185307f
+#define FLOAT_PI_THREE_QUARTER 2.356194490f
+#define FLOAT_PI_HALF 1.570796327f
+#define FLOAT_PI_QUARTER 0.7853981634f
+#define FLOAT_PI_EIGHTH 0.3926990817f
+/* cos(PI/8) */
+#define FLOAT_COS_PI_EIGHTH 0.9238795325f
+
+#define centerX tangentX
+#define centerY tangentY
+
+#define FLOAT_DIFF_EPSILON 0.125f
+#define FLOAT_SWING_CENTER_RANGE 0.125f
+#define FLOAT_ANGLE_EPSILON 0.0045f
+#define FLOAT_ANGLE_EPSILON_COS 0.99999f
+#define FLOAT_MIN_ARC_ANGLE 0.044f
+#define FLOAT_MIN_ARC_ANGLE_COS 0.999f
+/* Float constants. */
+#define gcvMAX_POS_FLOAT ((vg_lite_float_t) 3.4028235e+038)
+#define gcvMAX_NEG_FLOAT ((vg_lite_float_t) -3.4028235e+038)
+#define FLOAT_MIN gcvMAX_NEG_FLOAT
+#define FLOAT_MAX gcvMAX_POS_FLOAT
+
+#define FLOAT_FAT_LINE_WIDTH 2.5f
+
+/* Point flatten type for flattened line segments. */
+#define vgcFLATTEN_NO 0
+#define vgcFLATTEN_START 1
+#define vgcFLATTEN_MIDDLE 2
+#define vgcFLATTEN_END 3
+
+/* Command size calculation shortcuts. */
+#define COMMANDSIZE(CoordinateCount, CoordinateType) \
+ ((1+CoordinateCount) * SIZEOF(CoordinateType))
+
+#define ABS(x) (((x) < 0) ? -(x) : (x))
+#define EPS 2.2204460492503131e-14
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+/* VG:24 + TS:28 + IM:345 + PE:9 + RS:16 +Debug:2 */
+#define STATES_COUNT 424
+/* STATES_COUNT size + return command size */
+#define CONTEXT_BUFFER_SIZE STATES_COUNT * 2 * 4 + 8
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+#define UPDATE_BOUNDING_BOX(bbx, point) \
+ do { \
+ if ((point).x < (bbx).x) { \
+ (bbx).width += (bbx).x - (point).x; \
+ (bbx).x = (point).x; \
+ } \
+ if ((point).y < (bbx).y) { \
+ (bbx).height += (bbx).y - (point).y; \
+ (bbx).y = (point).y; \
+ } \
+ if ((point).x > (bbx).x + (bbx).width) \
+ (bbx).width = (point).x - (bbx).x; \
+ if ((point).y > (bbx).y + (bbx).height) \
+ (bbx).height = (point).y - (bbx).y; \
+ } while(0)
+
+typedef vg_lite_float_t FLOATVECTOR4[4];
+
+typedef struct vg_lite_ftable {
+ uint32_t ftable[gcFEATURE_COUNT];
+ uint32_t ftflag;
+} vg_lite_ftable_t;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+typedef struct vg_lite_states {
+ uint32_t state;
+ uint8_t init;
+}vg_lite_states_t;
+
+typedef struct vg_lite_hardware {
+ vg_lite_states_t hw_states[STATES_COUNT];
+} vg_lite_hardware_t;
+
+static vg_lite_hardware_t hw = {0};
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+typedef struct vg_lite_context {
+ vg_lite_kernel_context_t context;
+ vg_lite_capabilities_t capabilities;
+ uint8_t * command_buffer[CMDBUF_COUNT];
+ uint32_t command_buffer_size;
+ uint32_t command_offset[CMDBUF_COUNT];
+ uint32_t command_buffer_current;
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ uint8_t * context_buffer[CMDBUF_COUNT];
+ uint32_t context_buffer_size;
+ uint32_t context_buffer_offset[CMDBUF_COUNT];
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+ vg_lite_tsbuffer_info_t tsbuffer;
+ vg_lite_buffer_t * rtbuffer; /* DDRLess: this is used as composing buffer. */
+
+#if VG_TARGET_FAST_CLEAR
+ vg_lite_buffer_t fcBuffer; /* Buffer used for fast clear cache. */
+ uint32_t clearValue;
+#endif
+
+ uint32_t scissor_enabled;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ uint32_t scissor_dirty; /* Indicates whether scissor states are changed or not. e.g., scissors[4] or scissor_enabled. */
+#endif /* VG_DRIVER_SINGLE_THREAD */
+ int32_t scissor[4]; /* Scissor area: x, y, width, height. */
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ uint32_t start_offset;
+ uint32_t end_offset;
+ uint32_t ts_init; /* Indicates whether tessellation buffer states are initialized or not. */
+ uint32_t ts_record[TS_STATE_COUNT]; /* Tessellation buffer initial states record. */
+ uint32_t ts_init_used;
+ uint32_t ts_init_use;
+ uint32_t ts_dirty;
+
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ uint32_t chip_id;
+ uint32_t chip_rev;
+
+ uint32_t premultiply_enabled;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ uint32_t premultiply_dirty;
+ uint8_t init;
+#else
+ uint32_t semaphore_id;
+
+ uint32_t * colors[4]; /* index colors. */
+ uint32_t clut_dirty[4]; /* clut dirty flag. */
+ uint32_t index_format; /* check if use index. */
+ uint32_t clut_used[4]; /* check if used index. */
+#endif /* VG_DRIVER_SINGLE_THREAD */
+ vg_lite_ftable_t s_ftable;
+} vg_lite_context_t;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+typedef struct vg_lite_tls{
+ /* currently just contains struct vg_lite_context_t */
+ vg_lite_context_t t_context;
+}vg_lite_tls_t;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+typedef struct vg_lite_feature_database{
+ uint32_t chip_id;
+ uint32_t chip_version;
+ uint32_t cid;
+ uint32_t vg_im_index_format:1;
+ uint32_t vg_pe_premultiply:1;
+ uint32_t vg_border_culling:1;
+ uint32_t vg_rgba2_format:1;
+ uint32_t vg_quality_8x:1;
+ uint32_t vg_radial_gradient:1;
+ uint32_t vg_linear_gradient_ext:1;
+ uint32_t vg_dither:1;
+ uint32_t vg_color_key:1;
+} vg_lite_feature_database_t;
+
+static vg_lite_feature_database_t VGFeatureInfos[] = {
+ /* vg255 */
+ {
+ GPU_CHIP_ID_GCNanoliteV, /* ChipID */
+ 0x1311, /* ChipRevision */
+ 0x404, /* CID */
+ 0x0, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x0, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x1, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x1, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X0, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X0, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x0, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x0, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg255 */
+ {
+ GPU_CHIP_ID_GCNanoliteV, /* ChipID */
+ 0x1311, /* ChipRevision */
+ 0x40a, /* CID */
+ 0x1, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x0, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x1, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x1, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X1, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X0, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x0, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x0, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg255 */
+ {
+ GPU_CHIP_ID_GCNanoliteV, /* ChipID */
+ 0x1311, /* ChipRevision */
+ 0x40b, /* CID */
+ 0x1, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x0, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x1, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x1, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X1, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X0, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x0, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x0, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg255 */
+ {
+ GPU_CHIP_ID_GCNanoliteV, /* ChipID */
+ 0x1311, /* ChipRevision */
+ 0x40d, /* CID */
+ 0x1, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x0, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x1, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x1, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X1, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X0, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x0, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x0, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg255 */
+ {
+ GPU_CHIP_ID_GCNanoliteV, /* ChipID */
+ 0x1322, /* ChipRevision */
+ 0x403, /* CID */
+ 0x1, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x0, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x1, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x1, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X1, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X0, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x0, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x0, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg355 */
+ {
+ GPU_CHIP_ID_GC355, /* ChipID */
+ 0x1217, /* ChipRevision */
+ 0x408, /* CID */
+ 0x0, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x1, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x0, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x0, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X0, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X1, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x1, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x1, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg355 */
+ {
+ GPU_CHIP_ID_GC355, /* ChipID */
+ 0x1216, /* ChipRevision */
+ 0x0, /* CID */
+ 0x0, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x1, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x0, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x0, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X0, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X1, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x1, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x1, /* gcFEATURE_BIT_VG_DITHER */
+ 0x0, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ },
+ /* vg355 */
+ {
+ GPU_CHIP_ID_GC355, /* ChipID */
+ 0x1215, /* ChipRevision */
+ 0x0, /* CID */
+ 0x0, /* gcFEATURE_BIT_VG_IM_INDEX_FORMAT */
+ 0x1, /* gcFEATURE_BIT_VG_PE_PREMULTIPLY */
+ 0x0, /* gcFEATURE_BIT_VG_BORDER_CULLING */
+ 0x0, /* gcFEATURE_BIT_VG_RGBA2_FORMAT */
+ 0X0, /* gcFEATURE_BIT_VG_QUALITY_8X */
+ 0X1, /* gcFEATURE_BIT_VG_RADIAL_GRADIENT */
+ 0x1, /* gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT */
+ 0x1, /* gcFEATURE_BIT_VG_DITHER */
+ 0x1, /* gcFEATURE_BIT_VG_COLOR_KEY */
+ }
+};
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_context_t s_context = {0};
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+#if DUMP_COMMAND
+FILE * fp;
+char filename[30];
+#endif
+
+int submit_flag = 0;
+
+static vg_lite_float_t _GetS8_NS_NB(int8_t * Data)
+{
+ int8_t x0 = *((int8_t *) Data);
+ vg_lite_float_t x = (vg_lite_float_t) x0;
+
+ return x;
+}
+
+static vg_lite_float_t _GetS16_NS_NB(int8_t * Data)
+{
+ int16_t x0 = *((int16_t *) Data);
+ vg_lite_float_t x = (vg_lite_float_t) x0;
+
+ return x;
+}
+
+static vg_lite_float_t _GetS32_NS_NB(int8_t * Data)
+{
+ int32_t x0 = *((int32_t *) Data);
+ vg_lite_float_t x = (vg_lite_float_t) x0;
+
+ return x;
+}
+
+static vg_lite_float_t _GetF_NS_NB(int8_t * Data)
+{
+ vg_lite_float_t x = *((vg_lite_float_t *) Data);
+
+ return x;
+}
+
+typedef vg_lite_float_t (* vg_value_getter) (int8_t * Data);
+
+typedef struct vg_lite_control_coord
+{
+ vg_lite_float_t startX;
+ vg_lite_float_t startY;
+ vg_lite_float_t lastX;
+ vg_lite_float_t lastY;
+ vg_lite_float_t controlX;
+ vg_lite_float_t controlY;
+}
+vg_lite_control_coord_t;
+
+static uint32_t _commandSize_float[] =
+{
+ COMMANDSIZE(0, vg_lite_float_t), /* 0: END */
+ COMMANDSIZE(0, vg_lite_float_t), /* 1: CLOSE */
+ COMMANDSIZE(2, vg_lite_float_t), /* 2: MOVE */
+ COMMANDSIZE(2, vg_lite_float_t), /* 3: MOVE_REL */
+ COMMANDSIZE(2, vg_lite_float_t), /* 4: LINE */
+ COMMANDSIZE(2, vg_lite_float_t), /* 5: LINE_REL */
+ COMMANDSIZE(4, vg_lite_float_t), /* 6: QUAD */
+ COMMANDSIZE(4, vg_lite_float_t), /* 7: QUAD_REL */
+ COMMANDSIZE(6, vg_lite_float_t), /* 8: CUBIC */
+ COMMANDSIZE(6, vg_lite_float_t), /* 9: CUBIC_REL */
+ COMMANDSIZE(5, vg_lite_float_t), /* 10: SCCWARC */
+ COMMANDSIZE(5, vg_lite_float_t), /* 11: SCCWARC_REL */
+ COMMANDSIZE(5, vg_lite_float_t), /* 12: SCWARC */
+ COMMANDSIZE(5, vg_lite_float_t), /* 13: SCWARC_REL */
+ COMMANDSIZE(5, vg_lite_float_t), /* 14: LCCWARC */
+ COMMANDSIZE(5, vg_lite_float_t), /* 15: LCCWARC_REL */
+ COMMANDSIZE(5, vg_lite_float_t), /* 16: LCWARC */
+ COMMANDSIZE(5, vg_lite_float_t), /* 17: LCWARC_REL */
+};
+
+/* Special sqrt(1.0f + x) for quick calculation when 0 <= x <= 1. */
+static vg_lite_float_t _Sqrt(
+ vg_lite_float_t X
+ )
+{
+ vg_lite_float_t x = X;
+ vg_lite_float_t s = 1.0f;
+
+ s += x * 0.5f;
+ x *= X;
+ s -= x * 0.12445995211601257f;
+ x *= X;
+ s += x * 0.058032196015119553f;
+ x *= X;
+ s -= x * 0.025314478203654289f;
+ x *= X;
+ s += x * 0.0059584137052297592f;
+
+ return s;
+}
+
+static vg_lite_error_t _set_point_tangent(
+ vg_lite_path_point_ptr Point,
+ vg_lite_float_t Dx,
+ vg_lite_float_t Dy
+ )
+{
+ if(!Point)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if (Dx == 0.0f)
+ {
+ if (Dy == 0.0f)
+ {
+ if (Point->prev)
+ {
+ Point->length = 0.0f;
+ Point->tangentX = Point->prev->tangentX;
+ Point->tangentY = Point->prev->tangentY;
+ }
+ else
+ {
+ Point->length = 0.0f;
+ Point->tangentX = 0.0f;
+ Point->tangentY = 0.0f;
+ }
+ }
+ else
+ {
+ Point->tangentX = 0.0f;
+ if (Dy > 0.0f)
+ {
+ Point->length = Dy;
+ Point->tangentY = 1.0f;
+ }
+ else
+ {
+ Point->length = -Dy;
+ Point->tangentY = -1.0f;
+ }
+ }
+ }
+ else if (Dy == 0.0f)
+ {
+ Point->tangentY = 0.0f;
+ if (Dx > 0.0f)
+ {
+ Point->length = Dx;
+ Point->tangentX = 1.0f;
+ }
+ else
+ {
+ Point->length = -Dx;
+ Point->tangentX = -1.0f;
+ }
+ }
+ else
+ {
+ vg_lite_float_t l, tx, ty;
+
+ vg_lite_float_t dx, dy;
+ vg_lite_float_t t, t2;
+
+ dx = (Dx >= 0.0f ? Dx : -Dx);
+ dy = (Dy >= 0.0f ? Dy : -Dy);
+ if (dx >= dy)
+ {
+ t = dy / dx;
+ t2 = t * t;
+ l = _Sqrt(t2);
+ Point->length = l * dx;
+
+ tx = 1.0f / l;
+ ty = tx * t;
+ }
+ else
+ {
+ t = dx / dy;
+ t2 = t * t;
+ l = _Sqrt(t2);
+ Point->length = l * dy;
+
+ ty = 1.0f / l;
+ tx = ty * t;
+ }
+ if (Dx < 0.0f) tx = -tx;
+ if (Dy < 0.0f) ty = -ty;
+
+ tx = CLAMP(tx, -1.0f, 1.0f);
+ ty = CLAMP(ty, -1.0f, 1.0f);
+ Point->tangentX = tx;
+ Point->tangentY = ty;
+ }
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t _add_point_to_point_list_wdelta(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t DX,
+ vg_lite_float_t DY,
+ uint8_t flatten_flag
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr last_point;
+ vg_lite_path_point_ptr point;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ last_point = stroke_conversion->path_last_point;
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+
+ if(!point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(point, 0, sizeof(*point));
+
+ point->x = X;
+ point->y = Y;
+ point->flatten_flag = flatten_flag;
+
+ /* Calculate tangent for last_point. */
+ VG_LITE_ERROR_HANDLER(_set_point_tangent(last_point, DX, DY));
+
+ last_point->next = point;
+ stroke_conversion->path_last_point = point;
+ point->prev = last_point;
+ stroke_conversion->point_count++;
+
+ return error;
+ErrorHandler:
+
+ vg_lite_os_free(point);
+ point = NULL;
+ return error;
+}
+
+vg_lite_error_t _add_point_to_point_list(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ uint8_t flatten_flag
+ )
+{
+ vg_lite_error_t status = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr last_point;
+ vg_lite_path_point_ptr point;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ last_point = stroke_conversion->path_last_point;
+ if (last_point == NULL)
+ {
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+ if(!point)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(point, 0, sizeof(*point));
+
+ point->x = X;
+ point->y = Y;
+ point->flatten_flag = flatten_flag;
+ point->prev = NULL;
+ stroke_conversion->path_last_point = stroke_conversion->path_point_list = point;
+ stroke_conversion->point_count++;
+ status = VG_LITE_SUCCESS;
+ }
+ else
+ {
+ vg_lite_float_t dX = X - last_point->x;
+ vg_lite_float_t dY = Y - last_point->y;
+ vg_lite_float_t deltaX = (dX >= 0.0f ? dX : -dX);
+ vg_lite_float_t deltaY = (dY >= 0.0f ? dY : -dY);
+
+ /* Check for degenerated line. */
+ if (deltaX == 0.0f && deltaY == 0.0f)
+ {
+ /* Skip degenerated line. */
+ status = VG_LITE_SUCCESS;
+ goto ErrorHandler;
+ }
+ if (deltaX < FLOAT_EPSILON && deltaY < FLOAT_EPSILON)
+ {
+ vg_lite_float_t ratioX, ratioY;
+
+ if (deltaX == 0.0f)
+ {
+ ratioX = 0.0f;
+ }
+ else if (X == 0.0f)
+ {
+ ratioX = deltaX;
+ }
+ else
+ {
+ ratioX = deltaX / X;
+ if (ratioX < 0.0f) ratioX = -ratioX;
+ }
+ if (deltaY == 0.0f)
+ {
+ ratioY = 0.0f;
+ }
+ else if (Y == 0.0f)
+ {
+ ratioY = deltaY;
+ }
+ else
+ {
+ ratioY = deltaY / Y;
+ if (ratioY < 0.0f) ratioY = -ratioY;
+ }
+ if (ratioX < 1.0e-6f && ratioY < 1.0e-6f)
+ {
+ /* Skip degenerated line. */
+ status = VG_LITE_SUCCESS;
+ goto ErrorHandler;
+ }
+ }
+
+ status = _add_point_to_point_list_wdelta(stroke_conversion, X, Y, dX, dY, flatten_flag);
+ }
+
+ErrorHandler:
+ return status;
+}
+
+static vg_lite_error_t _flatten_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_path_t *path
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t increment;
+ uint8_t is_relative;
+ uint32_t size;
+ uint32_t path_command;
+ uint32_t prev_command;
+ uint8_t data_type_size;
+ int8_t* data_pointer = NULL;
+ vg_lite_float_t sx, sy;
+ vg_lite_float_t ox, oy;
+ vg_lite_float_t x0, y0, x1, y1, x2, y2;
+ vg_value_getter get_value = NULL;
+
+ if(!stroke_conversion || !path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ sx = sy = ox = oy = 0.0f;
+
+ prev_command = VLC_OP_MOVE;
+
+ /* Determine the data size. */
+ size = path->path_length;
+
+ /* Determine the beginning of the path data. */
+ data_pointer = (int8_t*)path->path;
+
+ /* Select the data picker. */
+ switch (path->format)
+ {
+ case VG_LITE_S8:
+ data_type_size = 1;
+ get_value = _GetS8_NS_NB;
+ break;
+
+ case VG_LITE_S16:
+ data_type_size = 2;
+ get_value = _GetS16_NS_NB;
+ break;
+
+ case VG_LITE_S32:
+ data_type_size = 4;
+ get_value = _GetS32_NS_NB;
+ break;
+
+ case VG_LITE_FP32:
+ data_type_size = 4;
+ get_value = _GetF_NS_NB;
+ break;
+
+ default:
+ error = VG_LITE_INVALID_ARGUMENT;
+ goto ErrorHandler;
+ }
+ /* Add an extra gcvVGCMD_MOVE 0.0 0.0 to handle the case the first command is not gcvVGCMD_MOVE. */
+ if (*data_pointer != VLC_OP_MOVE)
+ {
+ /* Add first point to subpath. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, sx, sy, vgcFLATTEN_NO));
+ }
+
+ while (size > 0)
+ {
+ /* Get the command. */
+ path_command = *data_pointer & 0x1F;
+
+ /* Assume absolute. */
+ is_relative = FALSE;
+
+ switch (path_command)
+ {
+ case VLC_OP_END:
+ /* Skip the command. */
+ size -= 1;
+
+ if (prev_command == VLC_OP_END)
+ {
+ /* Continuous gcvVGCMD_CLOSE - do nothing. */
+ break;
+ }
+
+ /* Check if subPath is already closed. */
+ if (ox != sx || oy != sy)
+ {
+ /* Add a line from current point to the first point of current subpath. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, sx, sy,vgcFLATTEN_NO));
+ }
+ if (stroke_conversion->path_point_list != stroke_conversion->path_last_point)
+ {
+ /* Copy tangent data from first point to last_point. */
+ vg_lite_path_point_ptr first_point = stroke_conversion->path_point_list;
+ vg_lite_path_point_ptr last_point = stroke_conversion->path_last_point;
+ last_point->length = first_point->length;
+ last_point->tangentX = first_point->tangentX;
+ last_point->tangentY = first_point->tangentY;
+ }
+ else
+ {
+ /* Single point path. */
+ vg_lite_path_point_ptr point = stroke_conversion->path_point_list;
+ point->tangentX = 0.0f;
+ point->tangentY = 0.0f;
+ point->length = 0.0f;
+ }
+ stroke_conversion->closed = 1;
+ stroke_conversion->path_last_point->next = NULL;
+ break;
+
+ case VLC_OP_MOVE_REL:
+ is_relative = 1;
+
+ case VLC_OP_MOVE: /* Indicate the beginning of a new sub-path. */
+ /* Skip to the data. */
+ SKIPTODATA(data_pointer, data_type_size, size);
+ VGSL_GETCOORDXY(x0, y0);
+
+ /* First command is gcvVGCMD_MOVE. */
+ /* Add first point to subpath. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, x0, y0, vgcFLATTEN_NO));
+
+ sx = ox = x0;
+ sy = oy = y0;
+ break;
+
+ case VLC_OP_LINE_REL:
+ is_relative = 1;
+
+ case VLC_OP_LINE:
+ /* Skip to the data. */
+ SKIPTODATA(data_pointer, data_type_size, size);
+ VGSL_GETCOORDXY(x0, y0);
+
+ /* Add a point to subpath. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, x0, y0, vgcFLATTEN_NO));
+
+ ox = x0;
+ oy = y0;
+ break;
+
+ case VLC_OP_QUAD_REL:
+ is_relative = 1;
+
+ case VLC_OP_QUAD:
+ /* Skip to the data. */
+ SKIPTODATA(data_pointer, data_type_size, size);
+ VGSL_GETCOORDXY(x0, y0);
+ VGSL_GETCOORDXY(x1, y1);
+
+ if ((ox == x0 && oy == y0) && (ox == x1 && oy == y1))
+ {
+ /* Degenerated Bezier curve. Becomes a point. */
+ /* Discard zero-length segments. */
+ }
+ else if ((ox == x0 && oy == y0) || (x0 == x1 && y0 == y1))
+ {
+ /* Degenerated Bezier curve. Becomes a line. */
+ /* Add a point to subpath. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list( stroke_conversion, x1, y1, vgcFLATTEN_NO));
+ }
+ else
+ {
+ VG_LITE_ERROR_HANDLER(_flatten_quad_bezier(stroke_conversion, ox, oy, x0, y0, x1, y1));
+ }
+
+ ox = x1;
+ oy = y1;
+ break;
+
+ case VLC_OP_CUBIC_REL:
+ is_relative = 1;
+
+ case VLC_OP_CUBIC:
+ /* Skip to the data. */
+ SKIPTODATA(data_pointer, data_type_size, size);
+ VGSL_GETCOORDXY(x0, y0);
+ VGSL_GETCOORDXY(x1, y1);
+ VGSL_GETCOORDXY(x2, y2);
+
+ if ((ox == x0 && oy == y0) && (ox == x1 && oy == y1) && (ox == x2 && oy == y2))
+ {
+ /* Degenerated Bezier curve. Becomes a point. */
+ /* Discard zero-length segments. */
+ }
+ else
+ {
+ VG_LITE_ERROR_HANDLER(_flatten_cubic_bezier(stroke_conversion, ox, oy, x0, y0, x1, y1, x2, y2));
+ }
+
+ ox = x2;
+ oy = y2;
+ break;
+
+ default:
+ error = VG_LITE_INVALID_ARGUMENT;
+ goto ErrorHandler;
+ }
+ prev_command = path_command;
+ }
+
+ if ((prev_command != VLC_OP_END))
+ {
+ stroke_conversion->path_last_point->next = NULL;
+ if (stroke_conversion->point_count == 1)
+ {
+ /* Single point path. */
+ vg_lite_path_point_ptr point = stroke_conversion->path_point_list;
+ point->tangentX = 0.0f;
+ point->tangentY = 0.0f;
+ point->length = 0.0f;
+ }
+ }
+
+ErrorHandler:
+ return error;
+}
+
+static vg_lite_error_t
+_add_point_to_right_stroke_point_list_tail(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr point;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+ if(!point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(point, 0, sizeof(*point));
+
+ point->x = X;
+ point->y = Y;
+ point->curve_type = CURVE_LINE;
+ point->prev = stroke_conversion->last_right_stroke_point;
+ point->next = NULL;
+ stroke_conversion->last_right_stroke_point->next = point;
+ stroke_conversion->last_right_stroke_point = point;
+ stroke_conversion->stroke_point_count++;
+
+ stroke_conversion->last_stroke_sub_path->point_count++;
+
+ return error;
+}
+
+static vg_lite_error_t
+_add_point_to_left_stroke_point_list_head(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr point;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+
+ if(!point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(point, 0, sizeof(*point));
+
+ point->x = X;
+ point->y = Y;
+ point->curve_type = CURVE_LINE;
+ point->next = stroke_conversion->left_stroke_point;
+ point->prev = NULL;
+ stroke_conversion->left_stroke_point->prev = point;
+ stroke_conversion->left_stroke_point = point;
+ stroke_conversion->stroke_point_count++;
+
+ stroke_conversion->last_stroke_sub_path->point_count++;
+
+ return error;
+}
+
+static vg_lite_error_t _add_stroke_sub_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_sub_path_ptr *sub_path
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ if(!stroke_conversion || !sub_path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ *sub_path = (vg_lite_sub_path_ptr)vg_lite_os_malloc(sizeof(**sub_path));
+
+ if(!*sub_path)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(*sub_path, 0, sizeof(**sub_path));
+
+ if (stroke_conversion->last_stroke_sub_path != NULL)
+ {
+ stroke_conversion->last_stroke_sub_path->next = *sub_path;
+ stroke_conversion->last_stroke_sub_path = *sub_path;
+ }
+ else
+ {
+ stroke_conversion->last_stroke_sub_path = stroke_conversion->stroke_sub_path_list = *sub_path;
+ }
+
+ return error;
+}
+
+static vg_lite_error_t
+_add_zero_length_stroke_sub_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_sub_path_ptr *stroke_subpath
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr new_point,Point;
+ vg_lite_sub_path_ptr stroke_sub_path;
+ vg_lite_float_t half_width;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ half_width = stroke_conversion->half_line_width;
+ Point = stroke_conversion->path_point_list;
+ if (stroke_conversion->stroke_cap_style == VG_LITE_CAP_BUTT)
+ {
+ /* No need to draw zero-length subPath for gcvCAP_BUTT. */
+ error = VG_LITE_SUCCESS;
+ goto ErrorHandler;
+ }
+
+ VG_LITE_ERROR_HANDLER(_add_stroke_sub_path(stroke_conversion, &stroke_sub_path));
+
+ if (stroke_conversion->stroke_cap_style == VG_LITE_CAP_SQUARE)
+ {
+ /* Draw a square along the point's direction. */
+ vg_lite_float_t dx, dy;
+
+ if (Point->tangentX == 0.0f || Point->tangentY == 0.0f)
+ {
+ dx = half_width;
+ dy = 0.0f;
+ }
+ else
+ {
+ dx = Point->tangentY * half_width;
+ dy = -Point->tangentX * half_width;
+ }
+
+ new_point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*new_point));
+
+ if(!new_point)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(new_point, 0, sizeof(*new_point));
+
+ new_point->x = Point->x + dx + dy;
+ new_point->y = Point->y - dx + dy;
+ new_point->curve_type = CURVE_LINE;
+ stroke_sub_path->point_list = stroke_conversion->last_right_stroke_point = new_point;
+ stroke_sub_path->point_count = 1;
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ Point->x + dx - dy, Point->y + dx + dy));
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ Point->x - dx - dy, Point->y + dx - dy));
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ Point->x - dx + dy, Point->y - dx - dy));
+ }
+ else
+ {
+ /* Draw a circle. */
+ new_point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*new_point));
+
+ if(!new_point)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(new_point, 0, sizeof(*new_point));
+
+ new_point->x = Point->x + half_width;
+ new_point->y = Point->y;
+ new_point->curve_type = CURVE_LINE;
+ stroke_sub_path->point_list = stroke_conversion->last_right_stroke_point = new_point;
+ stroke_sub_path->point_count = 1;
+
+ /* Add upper half circle. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ Point->x - half_width, Point->y));
+
+ stroke_conversion->last_right_stroke_point->curve_type = CURVE_ARC_SCCW_HALF;
+ stroke_conversion->last_right_stroke_point->centerX = Point->x;
+ stroke_conversion->last_right_stroke_point->centerY = Point->y;
+
+ /* Add lower half circle. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ Point->x + half_width, Point->y));
+
+ stroke_conversion->last_right_stroke_point->curve_type = CURVE_ARC_SCCW_HALF;
+ stroke_conversion->last_right_stroke_point->centerX = Point->x;
+ stroke_conversion->last_right_stroke_point->centerY = Point->y;
+ }
+
+ stroke_sub_path->last_point = stroke_conversion->last_right_stroke_point;
+ stroke_sub_path->last_point->next = NULL;
+
+ErrorHandler:
+ return error;
+}
+
+/* Special asin(x) for quick calculation when -sqrt(0.5) <= x <= sqrt(0.5). */
+static vg_lite_float_t _Asin(
+ vg_lite_float_t X
+ )
+{
+ vg_lite_float_t x = X;
+ vg_lite_float_t x2 = X * X;
+ vg_lite_float_t s = X;
+
+ x *= x2;
+ s += x * 0.1660510562575219f;
+ x *= x2;
+ s += x * 0.084044676143618186f;
+ x *= x2;
+ s += x * 0.0023776176698039313f;
+ x *= x2;
+ s += x * 0.10211922020091345f;
+
+ return s;
+}
+/* Special cos(x) for quick calculation when -PI <= x <= PI. */
+static vg_lite_float_t _Cos(
+ vg_lite_float_t X
+ )
+{
+ vg_lite_float_t x2 = X * X;
+ vg_lite_float_t x = x2;
+ vg_lite_float_t s = 1.0f;
+
+ s -= x * 0.49985163079668843f;
+ x *= x2;
+ s += x * 0.041518066216932693f;
+ x *= x2;
+ s -= x * 0.0013422997970712939f;
+ x *= x2;
+ s += x * 0.000018930111278021357f;
+
+ return s;
+}
+/* Special sin(x) for quick calculation when -PI <= x <= PI. */
+static vg_lite_float_t _Sine(
+ vg_lite_float_t X
+ )
+{
+ vg_lite_float_t x = X;
+ vg_lite_float_t x2 = X * X;
+ vg_lite_float_t s = X;
+
+ x *= x2;
+ s -= x * 0.16664527099620879f;
+ x *= x2;
+ s += x * 0.0083154803736487041f;
+ x *= x2;
+ s -= x * 0.00019344151251408578f;
+ x *= x2;
+ s += x * 0.0000021810214160988925f;
+
+ return s;
+}
+
+static vg_lite_float_t
+_Angle(
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t Length
+ )
+{
+ vg_lite_float_t angle;
+ vg_lite_float_t ux = (X >= 0.0f ? X : -X);
+ vg_lite_float_t uy = (Y >= 0.0f ? Y : -Y);
+
+ if (ux > uy)
+ {
+ angle = ((uy > 0.0f && ux < Length) ? _Asin(uy / Length) : 0.0f);
+ }
+ else
+ {
+ angle = ((ux > 0.0f && uy < Length) ? (FLOAT_PI_HALF - _Asin(ux / Length)) : FLOAT_PI_HALF);
+ }
+
+ if (X < 0.0f) angle = FLOAT_PI - angle;
+ if (Y < 0.0f) angle = -angle;
+
+ return angle;
+}
+
+/* The arc is always counter clockwise and less than half circle (small). */
+static vg_lite_error_t
+_convert_circle_arc(
+ vg_lite_stroke_conversion_t *stroke_conversion,
+ vg_lite_float_t Radius,
+ vg_lite_float_t CenterX,
+ vg_lite_float_t CenterY,
+ vg_lite_float_t StartX,
+ vg_lite_float_t StartY,
+ vg_lite_float_t EndX,
+ vg_lite_float_t EndY,
+ uint8_t Half_circle,
+ vg_lite_path_point_ptr *point_list
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ /*gceVGCMD segmentCommand;*/
+ vg_lite_float_t theta1, theta_span;
+ uint32_t segs;
+ vg_lite_float_t theta, theta_half, theta2;
+ vg_lite_float_t cos_theta_half;
+ vg_lite_float_t control_ratio;
+ vg_lite_float_t controlX, controlY, anchorX, anchorY;
+ /*gctFLOAT lastX, lastY;*/
+ vg_lite_path_point_ptr point, start_point, last_point;
+
+ if(!stroke_conversion || !point_list)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Converting. */
+ theta1 = _Angle(StartX - CenterX, StartY - CenterY, Radius);
+ if (Half_circle)
+ {
+ theta_span = FLOAT_PI;
+ segs = 4;
+ theta = FLOAT_PI_QUARTER;
+ theta_half = FLOAT_PI_EIGHTH;
+ cos_theta_half = FLOAT_COS_PI_EIGHTH;
+ }
+ else
+ {
+ theta_span = _Angle(EndX - CenterX, EndY - CenterY, Radius) - theta1;
+ if (theta_span == 0.0f)
+ {
+ /* Handle specail case for huge scaling. */
+ *point_list = NULL;
+ error = VG_LITE_SUCCESS;
+ return error;
+ }
+
+ if ((theta_span < 0))
+ {
+ theta_span += FLOAT_PI_TWO;
+ }
+
+ /* Calculate the number of quadratic Bezier curves. */
+ /* Assumption: most of angles are small angles. */
+ if (theta_span <= FLOAT_PI_QUARTER) segs = 1;
+ else if (theta_span <= FLOAT_PI_HALF) segs = 2;
+ else if (theta_span <= FLOAT_PI_THREE_QUARTER) segs = 3;
+ else segs = 4;
+
+ theta = theta_span / segs;
+ theta_half = theta / 2.0f;
+ cos_theta_half = _Cos(theta_half);
+ }
+
+ /* Determine the segment command. */
+ /*egmentCommand = gcvVGCMD_ARC_QUAD;*/
+
+ /* Generate quadratic Bezier curves. */
+ start_point = last_point = NULL;
+ control_ratio = Radius / cos_theta_half;
+ while (segs-- > 0)
+ {
+ theta1 += theta;
+
+ theta2 = theta1 - theta_half;
+ if (theta2 > FLOAT_PI) theta2 -= FLOAT_PI_TWO;
+ controlX = CenterX + _Cos(theta2) * control_ratio;
+ controlY = CenterY + _Sine(theta2) * control_ratio;
+
+ theta2 = theta1;
+ if (theta2 > FLOAT_PI) theta2 -= FLOAT_PI_TWO;
+ anchorX = CenterX + _Cos(theta2) * Radius;
+ anchorY = CenterY + _Sine(theta2) * Radius;
+
+ if (segs == 0)
+ {
+ /* Use end point directly to avoid accumulated errors. */
+ anchorX = EndX;
+ anchorY = EndY;
+ }
+
+ /* Add control point. */
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+
+ if(!point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(point, 0, sizeof(*point));
+
+ point->x = controlX;
+ point->y = controlY;
+ point->curve_type = CURVE_QUAD_CONTROL;
+ if (last_point)
+ {
+ last_point->next = point;
+ last_point = point;
+ }
+ else
+ {
+ start_point = last_point = point;
+ }
+
+ /* Add anchor point. */
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+
+ if(!point) {
+ error = VG_LITE_OUT_OF_RESOURCES;
+ goto ErrorHandler;
+ }
+
+ memset(point, 0, sizeof(*point));
+
+ point->x = anchorX;
+ point->y = anchorY;
+ point->curve_type = CURVE_QUAD_ANCHOR;
+ last_point->next = point;
+ last_point = point;
+ }
+
+ last_point->next = NULL;
+ *point_list = start_point;
+
+ return error;
+ErrorHandler:
+ /* Return status. */
+ while (start_point)
+ {
+ point = start_point;
+ start_point = start_point->next;
+ vg_lite_os_free(point);
+ }
+ start_point = last_point = point = NULL;
+ return error;
+}
+
+static vg_lite_error_t
+_start_new_stroke_sub_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t Dx,
+ vg_lite_float_t Dy,
+ uint8_t add_end_cap,
+ vg_lite_sub_path_ptr *stroke_subpath
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ vg_lite_sub_path_ptr stroke_sub_path;
+ vg_lite_path_point_ptr new_point;
+
+ if(!stroke_conversion || !stroke_subpath)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ VG_LITE_ERROR_HANDLER(_add_stroke_sub_path(stroke_conversion, &stroke_sub_path));
+
+ new_point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*new_point));
+ if(!new_point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(new_point, 0, sizeof(*new_point));
+ new_point->x = X + Dx;
+ new_point->y = Y + Dy;
+ new_point->prev = NULL;
+ new_point->curve_type = CURVE_LINE;
+ stroke_conversion->stroke_point_list = stroke_conversion->last_right_stroke_point = new_point;
+
+ stroke_sub_path->point_list = stroke_conversion->last_right_stroke_point = new_point;
+
+ new_point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*new_point));
+ if(!new_point)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ memset(new_point, 0, sizeof(*new_point));
+ new_point->x = X - Dx;
+ new_point->y = Y - Dy;
+ new_point->curve_type = CURVE_LINE;
+ new_point->next = NULL;
+ stroke_conversion->stroke_last_point = stroke_conversion->left_stroke_point = new_point;
+
+ stroke_conversion->stroke_point_count = 2;
+
+ stroke_sub_path->last_point = stroke_conversion->left_stroke_point = new_point;
+ stroke_sub_path->point_count = 2;
+
+ if (add_end_cap)
+ {
+ /* Add end cap if the subPath is not closed. */
+ switch (stroke_conversion->stroke_cap_style)
+ {
+ case VG_LITE_CAP_BUTT:
+ /* No adjustment needed. */
+ break;
+ case VG_LITE_CAP_ROUND:
+ /* Add curve. */
+ /* Add the starting point again as arc. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ stroke_sub_path->point_list->x, stroke_sub_path->point_list->y));
+ stroke_conversion->last_right_stroke_point->curve_type = CURVE_ARC_SCCW_HALF;
+ stroke_conversion->last_right_stroke_point->centerX = X;
+ stroke_conversion->last_right_stroke_point->centerY = Y;
+ /* Change the starting point to end point. */
+ stroke_sub_path->point_list->x = stroke_sub_path->last_point->x;
+ stroke_sub_path->point_list->y = stroke_sub_path->last_point->y;
+ break;
+ case VG_LITE_CAP_SQUARE:
+ stroke_conversion->last_right_stroke_point->x += Dy;
+ stroke_conversion->last_right_stroke_point->y -= Dx;
+ stroke_conversion->left_stroke_point->x += Dy;
+ stroke_conversion->left_stroke_point->y -= Dx;
+ break;
+ }
+ }
+
+ *stroke_subpath = stroke_sub_path;
+
+ErrorHandler:
+ return error;
+}
+
+static void
+_adjust_joint_point(
+ vg_lite_path_point_ptr Point,
+ vg_lite_path_point_ptr join_point,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t Ratio
+ )
+{
+ vg_lite_float_t mx = (join_point->x + X) / 2.0f;
+ vg_lite_float_t my = (join_point->y + Y) / 2.0f;
+ vg_lite_float_t dx = mx - Point->x;
+ vg_lite_float_t dy = my - Point->y;
+
+ dx = dx * Ratio;
+ dy = dy * Ratio;
+ join_point->x = Point->x + dx;
+ join_point->y = Point->y + dy;
+}
+
+static uint8_t
+_is_angle_span_acute(
+ vg_lite_float_t Ux,
+ vg_lite_float_t Uy,
+ vg_lite_float_t Vx,
+ vg_lite_float_t Vy
+ )
+{
+ return ((Ux * Vx + Uy * Vy) > 0.0f ? 1 : 0);
+}
+
+static vg_lite_error_t
+_draw_swing_pie_area(
+ vg_lite_stroke_conversion_t *stroke_conversion,
+ vg_lite_path_point_ptr center_point,
+ uint8_t end_at_prev_point
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if (stroke_conversion->swing_counter_clockwise)
+ {
+ vg_lite_path_point_ptr start_point = stroke_conversion->swing_start_stroke_point;
+ vg_lite_path_point_ptr end_point = NULL, real_end_point = NULL;
+ vg_lite_path_point_ptr point, prev_point;
+ uint32_t count = 0;
+
+ {
+ if (end_at_prev_point)
+ {
+ /* Detach the end point from leftStrokePoint. */
+ /* The end point will be added back later. */
+ real_end_point = stroke_conversion->left_stroke_point;
+ stroke_conversion->left_stroke_point = real_end_point->next;
+ stroke_conversion->left_stroke_point->prev = NULL;
+ }
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ center_point->x, center_point->y));
+ end_point = stroke_conversion->left_stroke_point;
+
+ /* Reverse the point list from startPoint to endPoint. */
+ for (point = start_point; point; point = prev_point)
+ {
+ prev_point = point->prev;
+ point->prev = point->next;
+ point->next = prev_point;
+ count++;
+ }
+ end_point->next = start_point->prev;
+ start_point->prev->prev = end_point;
+ start_point->prev = NULL;
+ stroke_conversion->left_stroke_point = start_point;
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ center_point->x, center_point->y));
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ stroke_conversion->swing_start_point->x,
+ stroke_conversion->swing_start_point->y));
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ end_point->prev->x, end_point->prev->y));
+
+ if (end_at_prev_point)
+ {
+ real_end_point->next = stroke_conversion->left_stroke_point;
+ stroke_conversion->left_stroke_point->prev = real_end_point;
+ stroke_conversion->left_stroke_point = real_end_point;
+ }
+ }
+ }
+ else
+ {
+ vg_lite_path_point_ptr start_point = stroke_conversion->swing_start_stroke_point;
+ vg_lite_path_point_ptr end_point = NULL, real_end_point = NULL;
+ vg_lite_path_point_ptr point, next_point;
+ uint32_t count = 0;
+
+ {
+ if (end_at_prev_point)
+ {
+ /* Detach the end point from leftStrokePoint. */
+ /* The end point will be added back later. */
+ real_end_point = stroke_conversion->last_right_stroke_point;
+ stroke_conversion->last_right_stroke_point = real_end_point->prev;
+ stroke_conversion->last_right_stroke_point->next = NULL;
+ }
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ center_point->x, center_point->y));
+ end_point = stroke_conversion->last_right_stroke_point;
+
+ /* Reverse the point list from startPoint to endPoint. */
+ for (point = start_point; point; point = next_point)
+ {
+ next_point = point->next;
+ point->next = point->prev;
+ point->prev = next_point;
+ count++;
+ }
+ end_point->prev = start_point->next;
+ start_point->next->next = end_point;
+ start_point->next = NULL;
+ stroke_conversion->last_right_stroke_point = start_point;
+
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ center_point->x, center_point->y));
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ stroke_conversion->swing_start_point->x,
+ stroke_conversion->swing_start_point->y));
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ end_point->next->x, end_point->next->y));
+
+ if (end_at_prev_point)
+ {
+ real_end_point->prev = stroke_conversion->last_right_stroke_point;
+ stroke_conversion->last_right_stroke_point->next = real_end_point;
+ stroke_conversion->last_right_stroke_point = real_end_point;
+ }
+ }
+ }
+
+ stroke_conversion->swing_handling = SWING_NO;
+
+ErrorHandler:
+
+ return error;
+}
+
+static vg_lite_error_t
+_process_line_joint(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_path_point_ptr Point,
+ vg_lite_float_t Length,
+ vg_lite_float_t prev_length,
+ uint32_t Swing_handling,
+ vg_lite_float_t X1,
+ vg_lite_float_t Y1,
+ vg_lite_float_t X2,
+ vg_lite_float_t Y2
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_join_style_t stroke_join_style = stroke_conversion->stroke_join_style;
+ vg_lite_float_t half_width = stroke_conversion->half_line_width;
+ vg_lite_float_t ratio;
+ vg_lite_float_t min_length_square;
+ vg_lite_float_t cos_theta;
+ uint8_t counter_clockwise;
+ uint8_t fat_line = stroke_conversion->is_fat;
+ uint32_t swing_handling = SWING_NO;
+ uint8_t handle_short_line = 0;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if (stroke_conversion->swing_accu_length < half_width)
+ {
+ if (stroke_conversion->swing_need_to_handle)
+ {
+ swing_handling = SWING_OUT;
+ }
+ else
+ {
+ handle_short_line = 1;
+ }
+ }
+ else if (stroke_conversion->stroke_path_length - stroke_conversion->swing_accu_length < half_width)
+ {
+ if (stroke_conversion->swing_need_to_handle)
+ {
+ swing_handling = SWING_IN;
+ }
+ else
+ {
+ handle_short_line = 1;
+ }
+ }
+
+ if (swing_handling != Swing_handling)
+ {
+ error = VG_LITE_INVALID_ARGUMENT;
+ goto ErrorHandler;
+ }
+
+ /* For flattened curves/arcs, the join style is always round. */
+ if ((Point->flatten_flag != vgcFLATTEN_NO) && fat_line)
+ {
+ stroke_join_style = VG_LITE_JOIN_ROUND;
+ }
+
+ /* First, determine the turn is clockwise or counter-clockwise. */
+ cos_theta = Point->prev->tangentX * Point->tangentX + Point->prev->tangentY * Point->tangentY;
+
+ if (cos_theta > FLOAT_ANGLE_EPSILON_COS)
+ {
+ /* Straight line or semi-straight line--no need to handle join. */
+ if (stroke_conversion->swing_handling !=SWING_NO)
+ {
+ /* Begin to swing to the opposite direction. */
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point->prev, 1));
+ }
+
+ /* Add the new stroke points. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ stroke_conversion->swing_count++;
+ }
+
+ goto endCheck;
+ }
+ else if (cos_theta < -FLOAT_ANGLE_EPSILON_COS)
+ {
+ /* Almost 180 degree turn. */
+ counter_clockwise = 1;
+ ratio = FLOAT_MAX;
+ min_length_square = FLOAT_MAX;
+ }
+ else
+ {
+ vg_lite_float_t angleSign = Point->prev->tangentX * Point->tangentY - Point->prev->tangentY * Point->tangentX;
+ counter_clockwise = (angleSign >= 0.0f ? 1 : 0);
+ ratio = 2.0f / (1.0f + cos_theta);
+ min_length_square = half_width * half_width * (1.0f - cos_theta) / (1.0f + cos_theta) + 0.02f;
+ }
+
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ if (counter_clockwise != stroke_conversion->swing_counter_clockwise)
+ {
+ /* Swing to the opposite direction. */
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point->prev, 1));
+ }
+ }
+
+ if (counter_clockwise)
+ {
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ vg_lite_path_point_ptr prev_point = stroke_conversion->left_stroke_point->next; /* Skip the line segment movement. */
+ vg_lite_float_t deltaX = X2 - prev_point->x;
+ vg_lite_float_t deltaY = Y2 - prev_point->y;
+ if (_is_angle_span_acute(stroke_conversion->swing_stroke_deltax,
+ stroke_conversion->swing_stroke_deltay,
+ deltaX, deltaY))
+ {
+ /* Continue swinging. */
+ stroke_conversion->swing_stroke_deltax = deltaX;
+ stroke_conversion->swing_stroke_deltay = deltaY;
+ }
+ else
+ {
+ /* Swing to the max. */
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point->prev, 1));
+ }
+ }
+
+ /* Check if the miter length is too long for inner intersection. */
+ if (stroke_conversion->swing_handling == SWING_NO
+ && ! handle_short_line
+ && min_length_square <= Length * Length
+ && min_length_square <= prev_length * prev_length)
+ {
+ /* Adjust leftStrokePoint to the intersection point. */
+ _adjust_joint_point(Point, stroke_conversion->left_stroke_point, X2, Y2, ratio);
+ }
+ else if (stroke_conversion->swing_handling == SWING_NO && Point->flatten_flag == vgcFLATTEN_NO)
+ {
+ /* Add the point to avoid incorrect sharp angle. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, Point->x, Point->y));
+ /* Add the point to form a loop to avoid out-of-bound problem. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ }
+ else if (stroke_conversion->swing_handling == SWING_NO && (! fat_line || Swing_handling == SWING_NO))
+ {
+ /* Flattened line segments should not have sharp angle. */
+ /* Add the point to form a loop to avoid out-of-bound problem. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ }
+ else
+ {
+ if (stroke_conversion->swing_handling == SWING_NO)
+ {
+ vg_lite_path_point_ptr prev_point = stroke_conversion->left_stroke_point;
+
+ /* Start swing handling. */
+ stroke_conversion->swing_handling = Swing_handling;
+ stroke_conversion->swing_counter_clockwise = 1;
+ stroke_conversion->swing_start_point = Point;
+ stroke_conversion->swing_center_length = 0.0f;
+ stroke_conversion->swing_count= 0;
+
+ /* Save stroking path delta. */
+ stroke_conversion->swing_stroke_deltax = X2 - prev_point->x;
+ stroke_conversion->swing_stroke_deltay = Y2 - prev_point->y;
+
+ /* Add extra center point for swing out pie area. */
+ /* VIV: [todo] Should adjust prev_point, instead of adding new point? */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, Point->x, Point->y));
+
+ /* Add extra start stroke point for swing out pie area. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, prev_point->x, prev_point->y));
+
+ stroke_conversion->swing_start_stroke_point = stroke_conversion->left_stroke_point;
+ }
+
+#if USE_MIN_ARC_FILTER
+ if (cosTheta > FLOAT_MIN_ARC_ANGLE_COS)
+ {
+ /* Add a point. */
+ gcmERR_GOTO(_add_point_to_left_stroke_point_list_head(Context, stroke_conversion, X2, Y2));
+
+ VGSL_STAT_COUNTER_INCREASE(vgStrokeFilteredByMinArcAngleCount);
+ }
+ else
+#endif
+ {
+ /* Add curve. */
+ /* Note that the curve will be reversed, so the direction is CW. */
+ /* Then, left side is in reversed order, so the direction is CCW. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ stroke_conversion->left_stroke_point->curve_type = CURVE_ARC_SCCW;
+ stroke_conversion->left_stroke_point->centerX = Point->x;
+ stroke_conversion->left_stroke_point->centerY = Point->y;
+ }
+ stroke_conversion->swing_count++;
+ }
+
+ switch (stroke_join_style)
+ {
+ case VG_LITE_JOIN_ROUND:
+ if (cos_theta > FLOAT_MIN_ARC_ANGLE_COS)
+ {
+ /* Add a point. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ }
+ else
+ {
+ /* Add curve. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ stroke_conversion->last_right_stroke_point->curve_type = CURVE_ARC_SCCW;
+ stroke_conversion->last_right_stroke_point->centerX = Point->x;
+ stroke_conversion->last_right_stroke_point->centerY = Point->y;
+ }
+ break;
+ case VG_LITE_JOIN_MITER:
+ if (ratio <= stroke_conversion->stroke_miter_limit_square)
+ {
+ /* Adjust lastRightStrokePoint to the outer intersection point. */
+ _adjust_joint_point(Point, stroke_conversion->last_right_stroke_point, X1, Y1, ratio);
+ break;
+ }
+ /* Else use Bevel join style. */
+ case VG_LITE_JOIN_BEVEL:
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ break;
+ }
+ }
+ else
+ {
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ vg_lite_path_point_ptr prev_point = stroke_conversion->last_right_stroke_point->prev; /* Skip the line segment movement. */
+ vg_lite_float_t deltaX = X1 - prev_point->x;
+ vg_lite_float_t deltaY = Y1 - prev_point->y;
+ if (_is_angle_span_acute(stroke_conversion->swing_stroke_deltax,
+ stroke_conversion->swing_stroke_deltay,
+ deltaX, deltaY))
+ {
+ /* Continue swinging. */
+ stroke_conversion->swing_stroke_deltax = deltaX;
+ stroke_conversion->swing_stroke_deltay = deltaY;
+ }
+ else
+ {
+ /* Swing to the max. */
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point->prev, 1));
+ }
+ }
+
+ /* Check if the miter length is too long for inner intersection. */
+ if (stroke_conversion->swing_handling == SWING_NO
+ && ! handle_short_line
+ && min_length_square <= Length * Length
+ && min_length_square <= prev_length * prev_length)
+ {
+ /* Adjust lastRightStrokePoint to the intersection point. */
+ _adjust_joint_point(Point, stroke_conversion->last_right_stroke_point, X1, Y1, ratio);
+ }
+ else if (stroke_conversion->swing_handling == SWING_NO && Point->flatten_flag == vgcFLATTEN_NO)
+ {
+ /* Add the point to avoid incorrect sharp angle. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, Point->x, Point->y));
+ /* Add the point to form a loop to avoid out-of-bound problem. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ }
+ else if (stroke_conversion->swing_handling == SWING_NO && (! fat_line || Swing_handling == SWING_NO))
+ {
+ /* Flattened line segments should not have sharp angle. */
+ /* Add the point to form a loop to avoid out-of-bound problem. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ }
+ else
+ {
+ if (stroke_conversion->swing_handling == SWING_NO)
+ {
+ vg_lite_path_point_ptr prev_point = stroke_conversion->last_right_stroke_point;
+
+ /* Start swing handling. */
+ stroke_conversion->swing_handling = Swing_handling;
+ stroke_conversion->swing_counter_clockwise = 0;
+ stroke_conversion->swing_start_point = Point;
+ stroke_conversion->swing_center_length = 0.0f;
+ stroke_conversion->swing_count= 0;
+
+ /* Save stroking path delta. */
+ stroke_conversion->swing_stroke_deltax = X1 - prev_point->x;
+ stroke_conversion->swing_stroke_deltay = Y1 - prev_point->y;
+
+ /* Add extra center point for swing out pie area. */
+ /* VIV: [todo] Should adjust prev_point, instead of adding new point? */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, Point->x, Point->y));
+
+ /* Add extra start stroke point for swing out pie area. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, prev_point->x, prev_point->y));
+
+ stroke_conversion->swing_start_stroke_point = stroke_conversion->last_right_stroke_point;
+ }
+
+ if (cos_theta > FLOAT_MIN_ARC_ANGLE_COS)
+ {
+ /* Add a point. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ }
+ else
+ {
+ /* Add curve. */
+ /* Note that the curve will be reversed, so the direction is CCW. */
+ stroke_conversion->last_right_stroke_point->curve_type = CURVE_ARC_SCCW;
+ stroke_conversion->last_right_stroke_point->centerX = Point->x;
+ stroke_conversion->last_right_stroke_point->centerY = Point->y;
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X1, Y1));
+ }
+ stroke_conversion->swing_count++;
+ }
+
+ switch (stroke_join_style)
+ {
+ case VG_LITE_JOIN_ROUND:
+ if (cos_theta > FLOAT_MIN_ARC_ANGLE_COS)
+ {
+ /* Add a point. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ }
+ else
+ {
+ /* Add curve. */
+ stroke_conversion->left_stroke_point->curve_type = CURVE_ARC_SCCW;
+ stroke_conversion->left_stroke_point->centerX = Point->x;
+ stroke_conversion->left_stroke_point->centerY = Point->y;
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ }
+ break;
+ case VG_LITE_JOIN_MITER:
+ if (ratio <= stroke_conversion->stroke_miter_limit_square)
+ {
+ /* Adjust leftStrokePoint to the outer intersection point. */
+ _adjust_joint_point(Point, stroke_conversion->left_stroke_point, X2, Y2, ratio);
+ break;
+ }
+ /* Else use Bevel join style. */
+ case VG_LITE_JOIN_BEVEL:
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion, X2, Y2));
+ break;
+ }
+ }
+
+endCheck:
+ if (stroke_conversion->swing_need_to_handle)
+ {
+ stroke_conversion->swing_accu_length += Point->length;
+ }
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ if (Point->flatten_flag == vgcFLATTEN_END ||
+ (stroke_conversion->swing_handling == SWING_OUT &&
+ stroke_conversion->swing_accu_length > half_width))
+ {
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point, 0));
+ }
+ else
+ {
+ /* Check if center line will move too far. */
+ stroke_conversion->swing_center_length += Point->length;
+ if (stroke_conversion->swing_center_length > FLOAT_SWING_CENTER_RANGE)
+ {
+#if USE_NEW_SWING_HANDLE_FOR_END
+ if (stroke_conversion->currentSubPath->length < half_width ||
+ Point->next->flatten_flag == vgcFLATTEN_END)
+#endif
+ {
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, Point, 0));
+ }
+ }
+ }
+ }
+
+ErrorHandler:
+
+ return error;
+}
+
+static vg_lite_error_t
+_close_stroke_sub_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_path_point_ptr Point,
+ vg_lite_float_t Length,
+ vg_lite_float_t prev_length,
+ uint8_t Swing_handling,
+ vg_lite_path_point_ptr first_stroke_point,
+ vg_lite_path_point_ptr last_stroke_point
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Handle line joint style for the first/last point in closed path. */
+ VG_LITE_ERROR_HANDLER(_process_line_joint(
+ stroke_conversion, Point,
+ Length, prev_length, Swing_handling,
+ first_stroke_point->x, first_stroke_point->y,
+ last_stroke_point->x, last_stroke_point->y
+ ));
+
+ /* Adjust the two end ponts of the first point. */
+ first_stroke_point->x = stroke_conversion->last_right_stroke_point->x;
+ first_stroke_point->y = stroke_conversion->last_right_stroke_point->y;
+ last_stroke_point->x = stroke_conversion->left_stroke_point->x;
+ last_stroke_point->y = stroke_conversion->left_stroke_point->y;
+
+ /* Concatnate right and left point lists. */
+ stroke_conversion->last_right_stroke_point->next = stroke_conversion->left_stroke_point;
+ stroke_conversion->left_stroke_point->prev = stroke_conversion->last_right_stroke_point;
+
+ /*gcmERROR_RETURN(_CheckStrokeSubPath(stroke_conversion->lastStrokeSubPath));*/
+
+ErrorHandler:
+ return error;
+}
+
+static vg_lite_error_t _end_stroke_sub_path(
+ vg_lite_stroke_conversion_t *stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t Dx,
+ vg_lite_float_t Dy
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Add points for end of line. */
+ VG_LITE_RETURN_ERROR(_add_point_to_right_stroke_point_list_tail(stroke_conversion, X + Dx, Y + Dy));
+ VG_LITE_RETURN_ERROR(_add_point_to_left_stroke_point_list_head(stroke_conversion, X - Dx, Y - Dy));
+
+ /* Add end cap if the subPath is not closed. */
+ switch (stroke_conversion->stroke_cap_style)
+ {
+ case VG_LITE_CAP_BUTT:
+ /* No adjustment needed. */
+ break;
+ case VG_LITE_CAP_ROUND:
+ /* Add curve. */
+ stroke_conversion->left_stroke_point->curve_type = CURVE_ARC_SCCW_HALF;
+ stroke_conversion->left_stroke_point->centerX = X;
+ stroke_conversion->left_stroke_point->centerY = Y;
+ break;
+ case VG_LITE_CAP_SQUARE:
+ stroke_conversion->last_right_stroke_point->x -= Dy;
+ stroke_conversion->last_right_stroke_point->y += Dx;
+ stroke_conversion->left_stroke_point->x -= Dy;
+ stroke_conversion->left_stroke_point->y += Dx;
+ break;
+ }
+
+ /* Concatnate right and left point lists. */
+ stroke_conversion->last_right_stroke_point->next = stroke_conversion->left_stroke_point;
+ stroke_conversion->left_stroke_point->prev = stroke_conversion->last_right_stroke_point;
+
+ /*gcmERROR_RETURN(_CheckStrokeSubPath(stroke_conversion->lastStrokeSubPath));*/
+ return error;
+}
+
+static vg_lite_error_t _get_next_dash_length(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ uint32_t * dash_index,
+ vg_lite_float_t * dash_length
+ )
+{
+ if(!stroke_conversion || !dash_index || !dash_length)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ (*dash_index)++;
+ if (*dash_index == stroke_conversion->stroke_dash_pattern_count)
+ {
+ *dash_index = 0;
+ }
+ *dash_length = stroke_conversion->stroke_dash_pattern[*dash_index];
+
+ return VG_LITE_SUCCESS;
+}
+
+static vg_lite_error_t
+_create_stroke_path(
+ vg_lite_stroke_conversion_t * stroke_conversion
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_sub_path_ptr stroke_sub_path = NULL,first_stroke_sub_path = NULL;
+ vg_lite_path_point_ptr point, next_point;
+ vg_lite_float_t half_width;
+ vg_lite_float_t x, y;
+ vg_lite_float_t dx, dy, ux, uy;
+ vg_lite_float_t length, prev_length, first_length;
+ vg_lite_float_t dash_length;
+ uint32_t dash_index;
+ uint8_t dashing;
+ uint8_t add_end_cap;
+ uint8_t need_to_handle_swing = 1 /* (stroke_conversion->strokeCapStyle == gcvCAP_BUTT) */;
+
+ vg_lite_path_point_ptr first_right_point = NULL;
+ vg_lite_path_point_ptr last_left_point = NULL;
+ vg_lite_float_t first_dx = 0.0f, first_dy = 0.0f;
+ uint8_t drawing = 0;
+ vg_lite_float_t total_length = 0.0f;
+ vg_lite_float_t accu_length = 0.0f;
+ uint32_t swing_handling = SWING_NO;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ half_width = stroke_conversion->half_line_width;
+ dashing = stroke_conversion->stroke_dash_pattern_count > 0 ? 1 : 0;
+ dash_index = stroke_conversion->stroke_dash_initial_index;
+ dash_length = stroke_conversion->stroke_dash_initial_length;
+
+ /* VIV: [todo] Need to check/debug closed stroke path. */
+ need_to_handle_swing = (stroke_conversion->stroke_cap_style == VG_LITE_CAP_BUTT || stroke_conversion->closed);
+ if (need_to_handle_swing)
+ {
+ uint8_t reallyneed_to_handle_swing = 0;
+
+ /* Calculate the total length. */
+ for (point = stroke_conversion->path_point_list; point; point = point->next)
+ {
+ total_length += point->length;
+
+ if (point->flatten_flag != vgcFLATTEN_NO)
+ {
+ reallyneed_to_handle_swing = 1;
+ }
+ }
+ stroke_conversion->stroke_path_length = total_length;
+ if (reallyneed_to_handle_swing)
+ {
+ swing_handling = SWING_OUT;
+ }
+ else
+ {
+ need_to_handle_swing = 0;
+ swing_handling = SWING_NO;
+ }
+ }
+ stroke_conversion->swing_need_to_handle = need_to_handle_swing;
+
+ point = stroke_conversion->path_point_list;
+ next_point = point->next;
+ if (next_point == NULL)
+ {
+ if (!dashing || ((dash_index & 0x1) == 0))
+ {
+ /* Single point (zero-length) subpath. */
+ /* Note that one-MOVE_TO subpaths are removed during parsing. */
+ VG_LITE_ERROR_HANDLER(_add_zero_length_stroke_sub_path(stroke_conversion, &stroke_sub_path));
+ }
+ goto ErrorHandler;
+ }
+
+ /* Adjust closed status for dashing. */
+ if (dashing && stroke_conversion->closed && ((dash_index & 0x1) == 1))
+ {
+ stroke_conversion->closed = FALSE;
+ }
+
+ /* Set add_end_cap. */
+ add_end_cap = dashing ? 1: (stroke_conversion->closed ? 0 : 1);
+
+ /* Process first line. */
+ first_length = point->length;
+ ux = point->tangentX;
+ uy = point->tangentY;
+ dx = uy * half_width;
+ dy = -ux * half_width;
+ if (need_to_handle_swing)
+ {
+ stroke_conversion->swing_accu_length = first_length;
+ }
+
+ if (dashing)
+ {
+ vg_lite_float_t delta_length;
+
+ /* Draw dashes. */
+ x = point->x;
+ y = point->y;
+ do
+ {
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_start_new_stroke_sub_path(
+ stroke_conversion,
+ x, y,
+ dx, dy, add_end_cap,
+ &stroke_sub_path
+ ));
+
+ drawing = 1;
+ add_end_cap = 1;
+ if (stroke_conversion->closed && (first_stroke_sub_path == NULL))
+ {
+ first_stroke_sub_path = stroke_conversion->last_stroke_sub_path;
+ first_right_point = stroke_conversion->last_right_stroke_point;
+ last_left_point = stroke_conversion->left_stroke_point;
+ first_dx = dx;
+ first_dy = dy;
+ }
+ }
+
+ delta_length = first_length - dash_length;
+ if (delta_length >= FLOAT_EPSILON)
+ {
+ /* Move (x, y) forward along the line by dash_length. */
+ x += ux * dash_length;
+ y += uy * dash_length;
+
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_end_stroke_sub_path(
+ stroke_conversion,
+ x, y,
+ dx, dy
+ ));
+
+ drawing = 0;
+ }
+
+ VG_LITE_ERROR_HANDLER(_get_next_dash_length(stroke_conversion, &dash_index, &dash_length));
+ first_length = delta_length;
+ }
+ else if (delta_length <= -FLOAT_EPSILON)
+ {
+ dash_length = -delta_length;
+ break;
+ }
+ else
+ {
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_end_stroke_sub_path(
+ stroke_conversion,
+ next_point->x, next_point->y,
+ dx, dy
+ ));
+
+ drawing = 0;
+ }
+
+ VG_LITE_ERROR_HANDLER(_get_next_dash_length(stroke_conversion, &dash_index, &dash_length));
+ first_length = 0;
+ break;
+ }
+ }
+ while (1);
+ }
+ else
+ {
+ VG_LITE_ERROR_HANDLER(_start_new_stroke_sub_path(
+ stroke_conversion,
+ point->x, point->y,
+ dx, dy, add_end_cap,
+ &stroke_sub_path
+ ));
+
+ drawing = 1;
+ add_end_cap = 1;
+ }
+
+ /* Process the rest of lines. */
+ prev_length = first_length;
+ for (point = next_point, next_point = point->next; next_point;
+ point = next_point, next_point = point->next)
+ {
+ if (!dashing || ((dash_index & 0x1) == 0 && drawing))
+ {
+ /* Add points for end of line for line join process with next line. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ point->x + dx, point->y + dy));
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ point->x - dx, point->y - dy));
+ }
+
+ length = point->length;
+ ux = point->tangentX;
+ uy = point->tangentY;
+ dx = uy * half_width;
+ dy = -ux * half_width;
+ if (need_to_handle_swing)
+ {
+ accu_length += point->prev->length;
+ stroke_conversion->swing_accu_length = accu_length;
+ if (accu_length < half_width)
+ {
+ swing_handling = SWING_OUT;
+ }
+ else if (total_length - accu_length < half_width)
+ {
+ swing_handling = SWING_IN;
+ }
+ else
+ {
+ swing_handling = SWING_NO;
+ }
+ }
+
+ if (!dashing)
+ {
+ /* Handle line joint style. */
+ VG_LITE_ERROR_HANDLER(_process_line_joint(
+ stroke_conversion, point,
+ length, prev_length, swing_handling,
+ point->x + dx, point->y + dy,
+ point->x - dx, point->y - dy
+ ));
+ }
+ else
+ {
+ vg_lite_float_t delta_length;
+
+ /* Draw dashes. */
+ x = point->x;
+ y = point->y;
+ if ((dash_index & 0x1) == 0)
+ {
+ if (drawing)
+ {
+ /* Handle line joint style. */
+ VG_LITE_ERROR_HANDLER(_process_line_joint(
+ stroke_conversion, point,
+ dash_length, prev_length, swing_handling,
+ x + dx, y + dy,
+ x - dx, y - dy
+ ));
+ }
+ else
+ {
+ /* Start a new sub path. */
+ VG_LITE_ERROR_HANDLER(_start_new_stroke_sub_path(
+ stroke_conversion,
+ x, y,
+ dx, dy, add_end_cap,
+ &stroke_sub_path
+ ));
+
+ drawing = 1;
+ add_end_cap = 1;
+ }
+ }
+ do
+ {
+ delta_length = length - dash_length;
+ if (delta_length >= FLOAT_EPSILON)
+ {
+ /* Move (x, y) forward along the line by dash_length. */
+ x += ux * dash_length;
+ y += uy * dash_length;
+
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_end_stroke_sub_path(
+ stroke_conversion,
+ x, y, dx, dy
+ ));
+
+ drawing = 0;
+ }
+
+ VG_LITE_ERROR_HANDLER(_get_next_dash_length(stroke_conversion, &dash_index, &dash_length));
+ length = delta_length;
+ }
+ else if (delta_length <= -FLOAT_EPSILON)
+ {
+ dash_length = -delta_length;
+ break;
+ }
+ else
+ {
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_end_stroke_sub_path(
+ stroke_conversion,
+ next_point->x, next_point->y,
+ dx, dy
+ ));
+
+ drawing = 0;
+ }
+
+ VG_LITE_ERROR_HANDLER(_get_next_dash_length(stroke_conversion, &dash_index, &dash_length));
+ length = 0;
+ break;
+ }
+
+ if ((dash_index & 0x1) == 0)
+ {
+ VG_LITE_ERROR_HANDLER(_start_new_stroke_sub_path(
+ stroke_conversion,
+ x, y,
+ dx, dy, add_end_cap,
+ &stroke_sub_path
+ ));
+
+ drawing = 1;
+ add_end_cap = 1;
+ }
+ }
+ while (1);
+ }
+
+ prev_length = length;
+ }
+
+ if (need_to_handle_swing)
+ {
+ accu_length += point->prev->length;
+ stroke_conversion->swing_accu_length = accu_length;
+ if (accu_length < half_width)
+ {
+ swing_handling = SWING_OUT;
+ }
+ else if (total_length - accu_length < half_width)
+ {
+ swing_handling = SWING_IN;
+ }
+ else
+ {
+ swing_handling = SWING_NO;
+ }
+ }
+
+ if (stroke_conversion->swing_handling != SWING_NO)
+ {
+ /* Draw the swing area (pie area). */
+ VG_LITE_ERROR_HANDLER(_draw_swing_pie_area(stroke_conversion, stroke_conversion->path_last_point, FALSE));
+ }
+
+ if (stroke_conversion->closed)
+ {
+ if (! dashing || drawing)
+ {
+ /* Add points for end of line. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_right_stroke_point_list_tail(stroke_conversion,
+ point->x + dx, point->y + dy));
+ VG_LITE_ERROR_HANDLER(_add_point_to_left_stroke_point_list_head(stroke_conversion,
+ point->x - dx, point->y - dy));
+
+ if (! dashing)
+ {
+ /* Handle line joint style for the first/last point in closed path. */
+ VG_LITE_ERROR_HANDLER(_close_stroke_sub_path(
+ stroke_conversion, point,
+ first_length, prev_length, swing_handling,
+ stroke_sub_path->point_list, stroke_sub_path->last_point
+ ));
+ }
+ else
+ {
+ /* Handle line joint style for the first/last point in closed path. */
+ VG_LITE_ERROR_HANDLER(_close_stroke_sub_path(
+ stroke_conversion, point,
+ first_length, prev_length, swing_handling,
+ first_right_point, last_left_point
+ ));
+ }
+ }
+ else if (stroke_conversion->stroke_cap_style != VG_LITE_CAP_BUTT)
+ {
+ /* No closing join need. Add end cap for the starting point. */
+
+ if (stroke_conversion->stroke_cap_style == VG_LITE_CAP_SQUARE)
+ {
+ first_right_point->x += first_dy;
+ first_right_point->y -= first_dx;
+ last_left_point->x += first_dy;
+ last_left_point->y -= first_dx;
+ }
+ else
+ {
+ vg_lite_sub_path_ptr last_stroke_sub_path = stroke_conversion->last_stroke_sub_path;
+ vg_lite_path_point_ptr start_point = last_stroke_sub_path->point_list;
+ vg_lite_path_point_ptr point;
+
+ /* Add curve. */
+ /* Add extra point to the beginning with end point's coordinates. */
+ point = (vg_lite_path_point_ptr)vg_lite_os_malloc(sizeof(*point));
+ if(!point)
+ return VG_LITE_INVALID_ARGUMENT;
+ memset(point, 0, sizeof(*point));
+
+ point->x = last_stroke_sub_path->last_point->x;
+ point->y = last_stroke_sub_path->last_point->y;
+ point->next = start_point;
+ start_point->prev = point;
+ start_point->curve_type = CURVE_ARC_SCCW;
+ start_point->centerX = stroke_conversion->path_point_list->x;
+ start_point->centerY = stroke_conversion->path_point_list->y;
+ last_stroke_sub_path->point_list = point;
+ }
+ }
+ }
+ else if (! dashing ||
+ (((dash_index & 0x1) == 0) && (dash_length < stroke_conversion->stroke_dash_pattern[dash_index])))
+ {
+ /* Add end cap if the subPath is not closed. */
+ VG_LITE_ERROR_HANDLER(_end_stroke_sub_path(
+ stroke_conversion,
+ point->x, point->y,
+ dx, dy
+ ));
+
+ drawing = 0;
+ }
+
+
+ErrorHandler:
+ return error;
+}
+
+static vg_lite_error_t _copy_stroke_path(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_path_t *path
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr point,prev_point,tmp_point;
+ uint32_t totalsize = 0,real_size = 0;
+ float *pfloat;
+ char *cpath = NULL;
+ char last_opcode = 0;
+ void *temp_stroke_path_data = NULL;
+ uint32_t temp_stroke_path_size;
+ vg_lite_sub_path_ptr sub_path;
+ vg_lite_float_t half_width;
+
+ if(!stroke_conversion || !path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ half_width = stroke_conversion->half_line_width;
+ sub_path = stroke_conversion->stroke_sub_path_list;
+
+ if(!stroke_conversion || !path || !sub_path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ while (sub_path)
+ {
+ tmp_point = prev_point = point = sub_path->point_list;
+ totalsize += _commandSize_float[VLC_OP_LINE] * sub_path->point_count + _commandSize_float[VLC_OP_CLOSE];
+ for(;tmp_point;tmp_point = tmp_point->next)
+ {
+ if(tmp_point->curve_type == CURVE_ARC_SCCW || tmp_point->curve_type == CURVE_ARC_SCCW_HALF) {
+ totalsize += 4 * _commandSize_float[VLC_OP_QUAD];
+ }
+ }
+
+ temp_stroke_path_data = path->stroke_path_data;
+ temp_stroke_path_size = path->stroke_path_size;
+
+ path->stroke_path_size += totalsize;
+ if(path->stroke_path_size == 0) {
+ error = VG_LITE_INVALID_ARGUMENT;
+ goto ErrorHandler;
+ }
+ path->stroke_path_data = (void *)vg_lite_os_malloc(path->stroke_path_size);
+ if(!path->stroke_path_data) {
+ error = VG_LITE_OUT_OF_RESOURCES;
+ goto ErrorHandler;
+ }
+
+ memset(path->stroke_path_data, 0, path->stroke_path_size);
+
+ if(temp_stroke_path_data) {
+ memcpy(path->stroke_path_data,temp_stroke_path_data,temp_stroke_path_size);
+ vg_lite_os_free(temp_stroke_path_data);
+ temp_stroke_path_data = NULL;
+ }
+
+ pfloat = (vg_lite_float_t *)((char *)path->stroke_path_data + temp_stroke_path_size);
+ if(last_opcode == VLC_OP_CLOSE) {
+ cpath = (char *)(pfloat - 1) + 1;
+ *cpath++ = VLC_OP_MOVE;
+ cpath = (char *)pfloat;
+ }
+ else {
+ cpath = (char *)pfloat;
+ *cpath = VLC_OP_MOVE;
+ pfloat++;
+ }
+
+ *pfloat++ = point->x;
+ *pfloat++ = point->y;
+ real_size += _commandSize_float[VLC_OP_MOVE];
+ if(last_opcode == VLC_OP_CLOSE)
+ real_size -= 4;
+
+ for (point = point->next; point; prev_point = point, point = point->next)
+ {
+ if (point->curve_type == CURVE_LINE)
+ {
+ if (point->x == prev_point->x && point->y == prev_point->y)
+ {
+ path->stroke_path_size -= _commandSize_float[VLC_OP_LINE];
+ /* Skip zero-length lines. */
+ continue;
+ }
+
+ /* Add new command. */
+ cpath = (char *)pfloat;
+ *cpath = VLC_OP_LINE;
+ pfloat++;
+
+ /* Set the coordinates. */
+ *pfloat++ = point->x;
+ *pfloat++ = point->y;
+ real_size += _commandSize_float[VLC_OP_LINE];
+ }
+ else if (point->curve_type == CURVE_QUAD_CONTROL)
+ {
+ /* Add new command. */
+ cpath = (char *)pfloat;
+ *cpath = VLC_OP_QUAD;
+ pfloat++;
+
+ /* Set the coordinates. */
+ prev_point = point, point = point->next;
+ *pfloat++ = prev_point->x;
+ *pfloat++ = prev_point->y;
+ *pfloat++ = point->x;
+ *pfloat++ = point->y;
+
+ real_size += _commandSize_float[VLC_OP_QUAD];
+ }
+ else
+ {
+ vg_lite_path_point_ptr point_list, p, nextP;
+ vg_lite_path_point_ptr p2;
+
+ if (point->curve_type == CURVE_ARC_SCCW)
+ {
+ /* Convert an arc to Bezier curves. */
+ VG_LITE_ERROR_HANDLER(_convert_circle_arc(stroke_conversion, half_width,
+ point->centerX, point->centerY,
+ prev_point->x, prev_point->y,
+ point->x, point->y,
+ 0, &point_list));
+ }
+ else
+ {
+ /* Convert a half circle to Bezier curves. */
+ VG_LITE_ERROR_HANDLER(_convert_circle_arc(stroke_conversion, half_width,
+ point->centerX, point->centerY,
+ prev_point->x, prev_point->y,
+ point->x, point->y,
+ 1, &point_list));
+
+ }
+
+ if (point_list)
+ {
+ for (p = point_list; p; p = nextP)
+ {
+ /* Add new command. */
+ cpath = (char *)pfloat;
+ *cpath = VLC_OP_QUAD;
+ pfloat++;
+
+ /* Set the coordinates. */
+ p2 = p->next;
+ nextP = p2->next;
+
+ *pfloat++ = p->x;
+ *pfloat++ = p->y;
+ *pfloat++ = p2->x;
+ *pfloat++ = p2->y;
+ real_size += _commandSize_float[VLC_OP_QUAD];
+ vg_lite_os_free(p);
+ vg_lite_os_free(p2);
+ }
+ }
+ else
+ {
+ /* Handle special case of huge scaling. */
+ /* Add new command. */
+ cpath = (char *)pfloat;
+ *cpath = VLC_OP_LINE;
+ pfloat++;
+
+ /* Set the coordinates. */
+ *pfloat++ = point->x;
+ *pfloat++ = point->y;
+ real_size += _commandSize_float[VLC_OP_LINE];
+ }
+ }
+ }
+
+ /* Create a CLOSE_PATH command at the end. */
+ cpath = (char *)pfloat;
+ if(sub_path->next)
+ *cpath = VLC_OP_CLOSE;
+ else
+ *cpath = VLC_OP_END;
+ real_size += _commandSize_float[VLC_OP_CLOSE];
+ path->stroke_path_size = temp_stroke_path_size + real_size;
+ totalsize = 0;
+ real_size = 0;
+ sub_path = sub_path->next;
+ last_opcode = *cpath;
+ }
+
+ErrorHandler:
+
+ if(temp_stroke_path_data) {
+ vg_lite_os_free(temp_stroke_path_data);
+ temp_stroke_path_data = NULL;
+ }
+
+ return error;
+}
+
+static vg_lite_error_t _initialize_stroke_dash_parameters(
+ vg_lite_stroke_conversion_t * stroke_conversion
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t count;
+ uint32_t i;
+ vg_lite_float_t *pattern_src;
+ vg_lite_float_t *pattern,*temp_pattern;
+ vg_lite_float_t length;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ count = stroke_conversion->stroke_dash_pattern_count;
+ if (count == 0 || !stroke_conversion->stroke_dash_pattern)
+ return error;
+
+ length = stroke_conversion->stroke_dash_phase;
+
+ /* The last pattern is ignored if the number is odd. */
+ if (count & 0x1) count--;
+
+ pattern = (vg_lite_float_t *)vg_lite_os_malloc(count * sizeof(vg_lite_float_t));
+ if(!pattern)
+ return VG_LITE_OUT_OF_RESOURCES;
+
+ temp_pattern = pattern;
+ stroke_conversion->stroke_dash_pattern_length = 0.0f;
+ pattern_src = stroke_conversion->stroke_dash_pattern;
+
+ for (i = 0; i < count; i++, pattern++, pattern_src++)
+ {
+ if (*pattern_src < 0.0f)
+ {
+ *pattern = 0.0f;
+ }
+ else
+ {
+ *pattern = *pattern_src;
+ }
+ stroke_conversion->stroke_dash_pattern_length += *pattern;
+ }
+
+ if (stroke_conversion->stroke_dash_pattern_length < FLOAT_EPSILON)
+ {
+ stroke_conversion->stroke_dash_pattern_count = 0;
+ vg_lite_os_free(temp_pattern);
+ temp_pattern = NULL;
+ return error;
+ }
+
+ while (length < 0.0f)
+ {
+ length += stroke_conversion->stroke_dash_pattern_length;
+ }
+
+ while (length >= stroke_conversion->stroke_dash_pattern_length)
+ {
+ length -= stroke_conversion->stroke_dash_pattern_length;
+ }
+
+ pattern = stroke_conversion->stroke_dash_pattern;
+ for (i = 0; i < stroke_conversion->stroke_dash_pattern_count; i++, pattern++)
+ {
+ if (length <= *pattern) break;
+
+ length -= *pattern;
+ }
+
+ stroke_conversion->stroke_dash_initial_index = i;
+ stroke_conversion->stroke_dash_initial_length = *pattern - length;
+
+ vg_lite_os_free(temp_pattern);
+ temp_pattern = NULL;
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_update_stroke(
+ vg_lite_path_t *path
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_stroke_conversion_t * stroke_conversion;
+
+ if(!path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!path->path_length)
+ return VG_LITE_SUCCESS;
+
+ if(!path->path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if (!path->stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ stroke_conversion = path->stroke_conversion;
+
+ /* Free the stroke. */
+ if (path->stroke_path_data)
+ {
+ vg_lite_os_free(path->stroke_path_data);
+ /* Reset the stroke. */
+ path->stroke_path_data = NULL;
+ }
+
+ if (stroke_conversion->stroke_line_width >= FLOAT_FAT_LINE_WIDTH
+ && stroke_conversion->stroke_line_width >= 1.0f)
+ {
+ stroke_conversion->is_fat = 1;
+ }
+ VG_LITE_RETURN_ERROR(_initialize_stroke_dash_parameters(stroke_conversion));
+ VG_LITE_RETURN_ERROR(_flatten_path(stroke_conversion, path));
+ VG_LITE_RETURN_ERROR(_create_stroke_path(stroke_conversion));
+ VG_LITE_RETURN_ERROR(_copy_stroke_path(stroke_conversion, path));
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_set_stroke(
+ vg_lite_path_t *path,
+ vg_lite_cap_style_t stroke_cap_style,
+ vg_lite_join_style_t stroke_join_style,
+ vg_lite_float_t stroke_line_width,
+ vg_lite_float_t stroke_miter_limit,
+ vg_lite_float_t *stroke_dash_pattern,
+ uint32_t stroke_dash_pattern_count,
+ vg_lite_float_t stroke_dash_phase,
+ vg_lite_color_t stroke_color
+ )
+{
+ if(!path || stroke_line_width <= 0)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(stroke_miter_limit < 1.0f)
+ stroke_miter_limit = 1.0f;
+
+ if (!path->stroke_conversion) {
+ path->stroke_conversion = (vg_lite_stroke_conversion_t *)vg_lite_os_malloc(sizeof(vg_lite_stroke_conversion_t));
+ if (!path->stroke_conversion)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(path->stroke_conversion, 0, sizeof(vg_lite_stroke_conversion_t));
+ }
+
+ path->stroke_conversion->stroke_cap_style = stroke_cap_style;
+ path->stroke_conversion->stroke_join_style = stroke_join_style;
+ path->stroke_conversion->stroke_line_width = stroke_line_width;
+ path->stroke_conversion->stroke_miter_limit = stroke_miter_limit;
+ path->stroke_conversion->half_line_width = stroke_line_width / 2.0f;
+ path->stroke_conversion->stroke_miter_limit_square = path->stroke_conversion->stroke_miter_limit * path->stroke_conversion->stroke_miter_limit;
+ path->stroke_conversion->stroke_dash_pattern = stroke_dash_pattern;
+ path->stroke_conversion->stroke_dash_pattern_count = stroke_dash_pattern_count;
+ path->stroke_conversion->stroke_dash_phase = stroke_dash_phase;
+ path->stroke_color = stroke_color;
+
+ return VG_LITE_SUCCESS;
+}
+
+static inline vg_lite_error_t transform_bounding_box(vg_lite_rectangle_t *in_bbx,
+ vg_lite_matrix_t *matrix,
+ vg_lite_rectangle_t *clip,
+ vg_lite_rectangle_t *out_bbx,
+ vg_lite_point_t *origin);
+
+#if (VG_BLIT_WORKAROUND == 1)
+/*
+ * Calculates the minimal possible target buffer starting from a given target
+ * buffer and considering a source texture (to blit), graphic transformations
+ * and clipping window.
+ */
+static vg_lite_error_t config_new_target(vg_lite_buffer_t *target,
+ vg_lite_buffer_t *source,
+ vg_lite_matrix_t *matrix,
+ vg_lite_rectangle_t *clip,
+ vg_lite_buffer_t *new_target);
+#endif /* VG_BLIT_WORKAROUND */
+
+static vg_lite_error_t swap(float *a,float *b)
+{
+ float temp;
+ if(a == NULL || b == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+ temp = *a;
+ *a = *b;
+ *b = temp;
+ return VG_LITE_SUCCESS;
+}
+
+static vg_lite_float_t _angle(
+ vg_lite_float_t Ux,
+ vg_lite_float_t Uy,
+ vg_lite_float_t Vx,
+ vg_lite_float_t Vy
+ )
+{
+
+ vg_lite_float_t dot, length, angle, cosVal;
+ int32_t sign;
+
+ dot = Ux * Vx + Uy * Vy;
+ length = SQRTF(Ux * Ux + Uy * Uy) * SQRTF(Vx * Vx + Vy * Vy);
+ sign = (Ux * Vy - Uy * Vx < 0) ? -1 : 1;
+ cosVal = dot / length;
+ cosVal = CLAMP(cosVal, -1.0f, 1.0f);
+ angle = sign * ACOSF(cosVal);
+ return angle;
+}
+
+/*!
+ @discussion
+ Convert arc to multi-segment bezier curve.
+ @param HorRadius
+ Major axis radius.
+ @param VerRadius
+ minor axis radius.
+ @param RotAngle
+ Rotation angle.
+ @param EndX
+ End coordinate x.
+ @param EndX
+ End coordinate y.
+ @param CounterClockwise
+ If this is 0,anticlockwise rotation,if this is 1,clockwise rotation.
+ @param Large
+ 1 means big arc,0 means little arc.
+ @param Relative
+ 1 means absolute coordinates,0 means relative coordinates.
+ @param coords
+ Including the start point coordinates of the path,the control point of the last segment of the path,
+ and the end point of the last segment of the path.
+ @param path_data
+ Path data usr for internal conversion.
+ @param offset
+ The offset of path_data.
+ @param last_size
+ The remain unconverted size of the original path data.
+ @result
+ Error code. VG_LITE_INVALID_ARGUMENTS to indicate the parameters are wrong.
+*/
+vg_lite_error_t _convert_arc(
+ vg_lite_float_t HorRadius,
+ vg_lite_float_t VerRadius,
+ vg_lite_float_t RotAngle,
+ vg_lite_float_t EndX,
+ vg_lite_float_t EndY,
+ uint8_t CounterClockwise,
+ uint8_t Large,
+ uint8_t Relative,
+ vg_lite_control_coord_t* coords,
+ void ** path_data,
+ uint32_t *offset,
+ uint32_t last_size
+ )
+{
+ vg_lite_float_t endX, endY;
+ uint8_t segmentCommand;
+ vg_lite_float_t phi, cosPhi, sinPhi;
+ vg_lite_float_t dxHalf, dyHalf;
+ vg_lite_float_t x1Prime, y1Prime;
+ vg_lite_float_t rx, ry;
+ vg_lite_float_t x1PrimeSquare, y1PrimeSquare;
+ vg_lite_float_t lambda;
+ vg_lite_float_t rxSquare, rySquare;
+ int32_t sign;
+ vg_lite_float_t sq, signedSq;
+ vg_lite_float_t cxPrime, cyPrime;
+ vg_lite_float_t theta1, thetaSpan;
+ int32_t segs;
+ vg_lite_float_t theta, ax, ay, x, y;
+ vg_lite_float_t controlX, controlY, anchorX, anchorY;
+ vg_lite_float_t lastX, lastY;
+ uint32_t bufferSize;
+ char *pchar, *arcPath;
+ vg_lite_float_t *pfloat;
+ /*******************************************************************
+ ** Converting.
+ */
+ if(path_data == NULL || *path_data == NULL || offset == NULL || coords == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if (Relative)
+ {
+ endX = EndX + coords->lastX;
+ endY = EndY + coords->lastY;
+ }
+ else
+ {
+ endX = EndX;
+ endY = EndY;
+ }
+
+ phi = RotAngle / 180.0f * PI;
+ cosPhi = COSF(phi);
+ sinPhi = SINF(phi);
+
+ if (Relative)
+ {
+ dxHalf = - EndX / 2.0f;
+ dyHalf = - EndY / 2.0f;
+ }
+ else
+ {
+ dxHalf = (coords->lastX - endX) / 2.0f;
+ dyHalf = (coords->lastY - endY) / 2.0f;
+ }
+
+ x1Prime = cosPhi * dxHalf + sinPhi * dyHalf;
+ y1Prime = -sinPhi * dxHalf + cosPhi * dyHalf;
+
+ rx = FABSF(HorRadius);
+ ry = FABSF(VerRadius);
+
+ x1PrimeSquare = x1Prime * x1Prime;
+ y1PrimeSquare = y1Prime * y1Prime;
+
+ lambda = x1PrimeSquare / (rx * rx) + y1PrimeSquare / (ry * ry);
+ if (lambda > 1.0f)
+ {
+ rx *= SQRTF(lambda);
+ ry *= SQRTF(lambda);
+ }
+
+ rxSquare = rx * rx;
+ rySquare = ry * ry;
+
+ sign = (Large == CounterClockwise) ? -1 : 1;
+ sq = ( rxSquare * rySquare
+ - rxSquare * y1PrimeSquare
+ - rySquare * x1PrimeSquare
+ )
+ /
+ ( rxSquare * y1PrimeSquare
+ + rySquare * x1PrimeSquare
+ );
+ signedSq = sign * ((sq < 0) ? 0 : SQRTF(sq));
+ cxPrime = signedSq * (rx * y1Prime / ry);
+ cyPrime = signedSq * -(ry * x1Prime / rx);
+
+ theta1 = _angle(1, 0, (x1Prime - cxPrime) / rx, (y1Prime - cyPrime) / ry);
+ theta1 = FMODF(theta1, 2 * PI);
+
+ thetaSpan = _angle(( x1Prime - cxPrime) / rx, ( y1Prime - cyPrime) / ry,
+ (-x1Prime - cxPrime) / rx, (-y1Prime - cyPrime) / ry);
+
+ if (!CounterClockwise && (thetaSpan > 0))
+ {
+ thetaSpan -= 2 * PI;
+ }
+ else if (CounterClockwise && (thetaSpan < 0))
+ {
+ thetaSpan += 2 * PI;
+ }
+
+ thetaSpan = FMODF(thetaSpan, 2 * PI);
+
+
+ /*******************************************************************
+ ** Drawing.
+ */
+
+ segs = (int32_t) (CEILF(FABSF(thetaSpan) / (45.0f / 180.0f * PI)));
+
+ theta = thetaSpan / segs;
+
+ ax = coords->lastX - COSF(theta1) * rx;
+ ay = coords->lastY - SINF(theta1) * ry;
+
+ /* Determine the segment command. */
+ segmentCommand = Relative
+ ? VLC_OP_QUAD_REL
+ : VLC_OP_QUAD;
+
+ /* Determine the size of the buffer required. */
+ bufferSize = (1 + 2 * 2) * SIZEOF(vg_lite_float_t) * segs;
+
+ arcPath = (char *)vg_lite_os_malloc(*offset + bufferSize + last_size);
+ if (arcPath == NULL)
+ return VG_LITE_OUT_OF_MEMORY;
+ memset(arcPath, 0, *offset + bufferSize + last_size);
+ memcpy(arcPath,(char *)*path_data,*offset);
+ vg_lite_os_free(*path_data);
+
+ *path_data = arcPath;
+
+ pchar = arcPath + *offset;
+ pfloat = (vg_lite_float_t *)pchar;
+
+ /* Set initial last point. */
+ lastX = coords->lastX;
+ lastY = coords->lastY;
+
+ while (segs-- > 0)
+ {
+ theta1 += theta;
+
+ controlX = ax + COSF(theta1 - (theta / 2.0f)) * rx / COSF(theta / 2.0f);
+ controlY = ay + SINF(theta1 - (theta / 2.0f)) * ry / COSF(theta / 2.0f);
+
+ anchorX = ax + COSF(theta1) * rx;
+ anchorY = ay + SINF(theta1) * ry;
+
+ if (RotAngle != 0)
+ {
+ x = coords->lastX + cosPhi * (controlX - coords->lastX) - sinPhi * (controlY - coords->lastY);
+ y = coords->lastY + sinPhi * (controlX - coords->lastX) + cosPhi * (controlY - coords->lastY);
+ controlX = x;
+ controlY = y;
+
+ x = coords->lastX + cosPhi * (anchorX - coords->lastX) - sinPhi * (anchorY - coords->lastY);
+ y = coords->lastY + sinPhi * (anchorX - coords->lastX) + cosPhi * (anchorY - coords->lastY);
+ anchorX = x;
+ anchorY = y;
+ }
+
+ if (segs == 0)
+ {
+ /* Use end point directly to avoid accumulated errors. */
+ anchorX = endX;
+ anchorY = endY;
+ }
+
+ /* Adjust relative coordinates. */
+ if (Relative)
+ {
+ vg_lite_float_t nextLastX = anchorX;
+ vg_lite_float_t nextLastY = anchorY;
+
+ controlX -= lastX;
+ controlY -= lastY;
+
+ anchorX -= lastX;
+ anchorY -= lastY;
+
+ lastX = nextLastX;
+ lastY = nextLastY;
+ }
+ pchar = (char*)pfloat;
+ *pchar = segmentCommand ;
+ pfloat++;
+ *pfloat++ = controlX;
+ *pfloat++ = controlY;
+ *pfloat++ = anchorX;
+ *pfloat++ = anchorY;
+ *offset += (1 + 2 * 2) * SIZEOF(vg_lite_float_t);
+ }
+
+ /* Update the control coordinates. */
+ coords->lastX = endX;
+ coords->lastY = endY;
+ coords->controlX = endX;
+ coords->controlY = endY;
+
+ return VG_LITE_SUCCESS;
+}
+
+// added by MicroEJ
+void __attribute__((weak)) vg_lite_draw_notify_render_area(uint32_t x, uint32_t y, uint32_t right, uint32_t bottom)
+{
+ /*
+ * Default implementation does nothing. Application can override this handler if it requires to be notified
+ * by the vglite rendering area.
+ */
+ return;
+}
+
+vg_lite_error_t _allocate_command_buffer(uint32_t size)
+{
+ vg_lite_kernel_allocate_t allocate;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif
+
+ if(size == 0)
+ return VG_LITE_SUCCESS;
+
+ allocate.bytes = size;
+ allocate.contiguous = 1;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+
+ ctx->context.command_buffer[0] = allocate.memory_handle;
+ ctx->context.command_buffer_logical[0] = allocate.memory;
+ ctx->context.command_buffer_physical[0] = allocate.memory_gpu;
+
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+
+ ctx->context.command_buffer[1] = allocate.memory_handle;
+ ctx->context.command_buffer_logical[1] = allocate.memory;
+ ctx->context.command_buffer_physical[1] = allocate.memory_gpu;
+
+ ctx->command_buffer[0] = ctx->context.command_buffer_logical[0];
+ ctx->command_buffer[1] = ctx->context.command_buffer_logical[1];
+
+ ctx->command_buffer_size = size;
+ ctx->command_offset[0] = 0;
+ ctx->command_offset[1] = 0;
+ ctx->command_buffer_current = 0;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ ctx->start_offset = 0;
+ ctx->end_offset = 0;
+ ctx->ts_init = 0;
+ memset(ctx->ts_record, 0, sizeof(ctx->ts_record));
+#endif
+
+ return error;
+}
+
+vg_lite_error_t _free_command_buffer()
+{
+ vg_lite_kernel_free_t free;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif
+
+ if(ctx->context.command_buffer[0]){
+ free.memory_handle = ctx->context.command_buffer[0];
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &free));
+ ctx->context.command_buffer[0] = 0;
+ ctx->context.command_buffer_logical[0] = 0;
+ }
+
+ if(ctx->context.command_buffer[1]){
+ free.memory_handle = ctx->context.command_buffer[1];
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &free));
+ ctx->context.command_buffer[1] = 0;
+ ctx->context.command_buffer_logical[1] = 0;
+ }
+
+ return error;
+}
+
+static void ClampColor(FLOATVECTOR4 Source,FLOATVECTOR4 Target,uint8_t Premultiplied)
+{
+ vg_lite_float_t colorMax;
+ /* Clamp the alpha channel. */
+ Target[3] = CLAMP(Source[3], 0.0f, 1.0f);
+
+ /* Determine the maximum value for the color channels. */
+ colorMax = Premultiplied ? Target[3] : 1.0f;
+
+ /* Clamp the color channels. */
+ Target[0] = CLAMP(Source[0], 0.0f, colorMax);
+ Target[1] = CLAMP(Source[1], 0.0f, colorMax);
+ Target[2] = CLAMP(Source[2], 0.0f, colorMax);
+}
+
+static uint8_t PackColorComponent(vg_lite_float_t value)
+{
+ /* Compute the rounded normalized value. */
+ vg_lite_float_t rounded = value * 255.0f + 0.5f;
+
+ /* Get the integer part. */
+ int32_t roundedInt = (int32_t) rounded;
+
+ /* Clamp to 0..1 range. */
+ uint8_t clamped = (uint8_t) CLAMP(roundedInt, 0, 255);
+
+ /* Return result. */
+ return clamped;
+}
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+static void command_buffer_copy(void *new_cmd, void *old_cmd, uint32_t start, uint32_t end, uint32_t *cmd_count)
+{
+ uint32_t i = start,j;
+ uint32_t *p_new_cmd32,*p_cmd32,*temp;
+ uint32_t data_count = 0;
+
+ memset(&hw,0,sizeof(vg_lite_hardware_t));
+ temp = NULL;
+ p_new_cmd32 = (uint32_t *)new_cmd;
+ p_cmd32 = (uint32_t *)old_cmd;
+ while(i < end)
+ {
+ /* data command is 0x40000000 | count, and count = databytes / 8 ,and data command and databytes should align to 8 */
+ if((*p_cmd32 & 0xF0000000) == 0x40000000) {
+ data_count = *p_cmd32 & 0x0FFFFFFF;
+ data_count++;
+ p_cmd32 += 2 * data_count;
+ i += data_count * 8;
+ /* SEMAPHORE command is 0x10000000 | id,stall command is 0x20000000 | id , call command is is 0x20000000 | count,
+ and this three command should occupy 8bytes*/
+ }else if((*p_cmd32 & 0xF0000000) == 0x20000000 || (*p_cmd32 & 0xF0000000) == 0x10000000
+ || (*p_cmd32 & 0xF0000000) == 0x60000000 || (*p_cmd32 & 0xF0000000) == 0x80000000){
+ p_cmd32 += 2;
+ i += 8;
+ /* register command is 0x30000000 | ((count) << 16) | address,
+ and the bytes of this command add register count should align to 8 */
+ }else if((*p_cmd32 & 0xF0000000) == 0x30000000) {
+ /* get register data count */
+ data_count = (*p_cmd32 & 0x0FFFFFFF) >> 16;
+ if(data_count == 1)
+ {
+ temp = p_cmd32 + 1;
+ if(hw.hw_states[*p_cmd32 & 0xff].state != *temp || !hw.hw_states[*p_cmd32 & 0xff].init){
+ hw.hw_states[*p_cmd32 & 0xff].state = *temp;
+ hw.hw_states[*p_cmd32 & 0xff].init = 1;
+ for(j = 0; j < 2; j++) {
+ *p_new_cmd32 = *p_cmd32;
+ p_new_cmd32++;
+ p_cmd32++;
+ *cmd_count += 4;
+ i += 4;
+ }
+ }
+ else
+ {
+ p_cmd32 += 2;
+ i += 8;
+ }
+ }else{
+ /* the bytes of register count add register command */
+ data_count++;
+ if(data_count % 2 != 0)
+ data_count++;
+ for(j = 0; j < data_count; j++) {
+ *p_new_cmd32 = *p_cmd32;
+ p_new_cmd32++;
+ p_cmd32++;
+ *cmd_count += 4;
+ i += 4;
+ }
+ }
+ }
+ }
+}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+static void _memset(void *p, unsigned char value, int size)
+{
+ int i;
+ for (i = 0; i < size; i++) {
+ ((unsigned char*) p)[i] = value;
+ }
+}
+
+static int has_valid_command_buffer(vg_lite_context_t *context)
+{
+ if(context == NULL)
+ return 0;
+ if(context->command_buffer_current >= CMDBUF_COUNT)
+ return 0;
+ if(context->command_buffer[context->command_buffer_current] == NULL)
+ return 0;
+
+ return 1;
+}
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+static int has_valid_context_buffer(vg_lite_context_t *context)
+{
+ if(context == NULL)
+ return 0;
+
+ return 1;
+}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+#if DUMP_IMAGE
+static void dump_img(void * memory, int width, int height, vg_lite_buffer_format_t format)
+{
+ FILE * fp;
+ char imgname[255] = {'\0'};
+ int i;
+ static int num = 1;
+ unsigned int* pt = (unsigned int*) memory;
+
+ sprintf(imgname, "img_pid%d_%d.txt", getpid(), num++);
+
+ fp = fopen(imgname, "w");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+
+ switch (format) {
+ case VG_LITE_INDEX_1:
+ for(i = 0; i < width * height / 32; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_INDEX_2:
+ for(i = 0; i < width * height / 16; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_INDEX_4:
+ for(i = 0; i < width * height / 8; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_INDEX_8:
+ for(i = 0; i < width * height / 4; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_RGBA2222:
+ for(i = 0; i < width * height / 4; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_RGBA4444:
+ case VG_LITE_BGRA4444:
+ case VG_LITE_RGB565:
+ case VG_LITE_BGR565:
+ for(i = 0; i < width * height / 2; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ case VG_LITE_RGBA8888:
+ case VG_LITE_BGRA8888:
+ case VG_LITE_RGBX8888:
+ case VG_LITE_BGRX8888:
+ for(i = 0; i < width * height; ++i)
+ {
+ fprintf(fp, "0x%08x\n",pt[i]);
+ }
+ break;
+
+ default:
+ break;
+ }
+ fclose(fp);
+ fp = NULL;
+}
+#endif
+
+/* Convert VGLite data format to HW value. */
+static uint32_t convert_path_format(vg_lite_format_t format)
+{
+ switch (format) {
+ case VG_LITE_S8:
+ return 0;
+
+ case VG_LITE_S16:
+ return 0x100000;
+
+ case VG_LITE_S32:
+ return 0x200000;
+
+ case VG_LITE_FP32:
+ return 0x300000;
+
+ default:
+ return 0;
+ }
+}
+
+/* Convert VGLite quality enums to HW values. */
+static uint32_t convert_path_quality(vg_lite_quality_t quality)
+{
+ switch (quality) {
+ case VG_LITE_HIGH:
+ return 0x3;
+
+ case VG_LITE_UPPER:
+ return 0x2;
+
+ case VG_LITE_MEDIUM:
+ return 0x1;
+
+ default:
+ return 0x0;
+ }
+}
+
+static uint32_t rgb_to_l(uint32_t color)
+{
+ uint32_t l = (uint32_t)((0.2126f * (vg_lite_float_t)(color & 0xFF)) +
+ (0.7152f * (vg_lite_float_t)((color >> 8) & 0xFF)) +
+ (0.0722f * (vg_lite_float_t)((color >> 16) & 0xFF)));
+ return l | (l << 24);
+}
+
+/* Get the bpp information of a color format. */
+static void get_format_bytes(vg_lite_buffer_format_t format,
+ uint32_t *mul,
+ uint32_t *div,
+ uint32_t *bytes_align)
+{
+ *mul = *div = 1;
+ *bytes_align = 4;
+ switch (format) {
+ case VG_LITE_L8:
+ case VG_LITE_A8:
+ *bytes_align = 16;
+ break;
+
+ case VG_LITE_A4:
+ *div = 2;
+ *bytes_align = 8;
+ break;
+
+ case VG_LITE_ABGR1555:
+ case VG_LITE_ARGB1555:
+ case VG_LITE_BGRA5551:
+ case VG_LITE_RGBA5551:
+ case VG_LITE_RGBA4444:
+ case VG_LITE_BGRA4444:
+ case VG_LITE_ABGR4444:
+ case VG_LITE_ARGB4444:
+ case VG_LITE_RGB565:
+ case VG_LITE_BGR565:
+ case VG_LITE_YUYV:
+ case VG_LITE_YUY2:
+ case VG_LITE_YUY2_TILED:
+ /* AYUY2 buffer memory = YUY2 + alpha. */
+ case VG_LITE_AYUY2:
+ case VG_LITE_AYUY2_TILED:
+ *mul = 2;
+ *bytes_align = 32;
+ break;
+
+ case VG_LITE_RGBA8888:
+ case VG_LITE_BGRA8888:
+ case VG_LITE_ABGR8888:
+ case VG_LITE_ARGB8888:
+ case VG_LITE_RGBX8888:
+ case VG_LITE_BGRX8888:
+ case VG_LITE_XBGR8888:
+ case VG_LITE_XRGB8888:
+ *mul = 4;
+ *bytes_align = 64;
+ break;
+
+ case VG_LITE_NV12:
+ case VG_LITE_NV12_TILED:
+ *mul = 3;
+ *bytes_align = 32;
+ break;
+
+ case VG_LITE_ANV12:
+ case VG_LITE_ANV12_TILED:
+ *mul = 4;
+ *bytes_align = 64;
+ break;
+
+ case VG_LITE_INDEX_1:
+ *div = 8;
+ *bytes_align = 8;
+ break;
+
+ case VG_LITE_INDEX_2:
+ *div = 4;
+ *bytes_align = 8;
+ break;
+
+ case VG_LITE_INDEX_4:
+ *div = 2;
+ *bytes_align = 8;
+ break;
+
+ case VG_LITE_INDEX_8:
+ *bytes_align = 16;
+ break;
+
+ case VG_LITE_RGBA2222:
+ case VG_LITE_BGRA2222:
+ case VG_LITE_ABGR2222:
+ case VG_LITE_ARGB2222:
+ *mul = 1;
+ *bytes_align = 8;
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* Convert VGLite target color format to HW value. */
+static uint32_t convert_target_format(vg_lite_buffer_format_t format, vg_lite_capabilities_t caps)
+{
+ switch (format) {
+ case VG_LITE_A8:
+ return 0x0;
+
+ case VG_LITE_L8:
+ return 0x6;
+
+ case VG_LITE_ABGR4444:
+ return 0x14;
+
+ case VG_LITE_ARGB4444:
+ return 0x34;
+
+ case VG_LITE_RGBA4444:
+ return 0x24;
+
+ case VG_LITE_BGRA4444:
+ return 0x4;
+
+ case VG_LITE_RGB565:
+ return 0x21;
+
+ case VG_LITE_BGR565:
+ return 0x1;
+
+ case VG_LITE_ABGR8888:
+ return 0x13;
+
+ case VG_LITE_ARGB8888:
+ return 0x33;
+
+ case VG_LITE_RGBA8888:
+ return 0x23;
+
+ case VG_LITE_BGRA8888:
+ return 0x3;
+
+ case VG_LITE_RGBX8888:
+ return 0x22;
+
+ case VG_LITE_BGRX8888:
+ return 0x2;
+
+ case VG_LITE_XBGR8888:
+ return 0x12;
+
+ case VG_LITE_XRGB8888:
+ return 0x32;
+
+ case VG_LITE_ABGR1555:
+ return 0x15;
+
+ case VG_LITE_RGBA5551:
+ return 0x25;
+
+ case VG_LITE_ARGB1555:
+ return 0x35;
+
+ case VG_LITE_BGRA5551:
+ return 0x5;
+
+ case VG_LITE_YUYV:
+ case VG_LITE_YUY2:
+ case VG_LITE_YUY2_TILED:
+ return 0x8;
+
+ case VG_LITE_NV12:
+ case VG_LITE_NV12_TILED:
+ return 0xB;
+
+ case VG_LITE_ANV12:
+ case VG_LITE_ANV12_TILED:
+ return 0xE;
+
+ case VG_LITE_BGRA2222:
+ return 0x7;
+
+ case VG_LITE_RGBA2222:
+ return 0x27;
+
+ case VG_LITE_ABGR2222:
+ return 0x17;
+
+ case VG_LITE_ARGB2222:
+ return 0x37;
+
+ case VG_LITE_AYUY2:
+ case VG_LITE_AYUY2_TILED:
+ default:
+ return 0xF;
+ }
+}
+
+/* determine source IM is aligned by specified bytes */
+static vg_lite_error_t _check_source_aligned(vg_lite_buffer_format_t format,uint32_t stride)
+{
+ switch (format) {
+ case VG_LITE_A4:
+ case VG_LITE_INDEX_1:
+ case VG_LITE_INDEX_2:
+ case VG_LITE_INDEX_4:
+ FORMAT_ALIGNMENT(stride,8);
+ break;
+
+ case VG_LITE_L8:
+ case VG_LITE_A8:
+ case VG_LITE_INDEX_8:
+ case VG_LITE_RGBA2222:
+ case VG_LITE_BGRA2222:
+ case VG_LITE_ABGR2222:
+ case VG_LITE_ARGB2222:
+ FORMAT_ALIGNMENT(stride,16);
+ break;
+
+ case VG_LITE_RGBA4444:
+ case VG_LITE_BGRA4444:
+ case VG_LITE_ABGR4444:
+ case VG_LITE_ARGB4444:
+ case VG_LITE_RGB565:
+ case VG_LITE_BGR565:
+ case VG_LITE_BGRA5551:
+ case VG_LITE_RGBA5551:
+ case VG_LITE_ABGR1555:
+ case VG_LITE_ARGB1555:
+ case VG_LITE_YUYV:
+ case VG_LITE_YUY2:
+ case VG_LITE_NV12:
+ case VG_LITE_YV12:
+ case VG_LITE_YV24:
+ case VG_LITE_YV16:
+ case VG_LITE_NV16:
+ FORMAT_ALIGNMENT(stride,32);
+ break;
+
+ case VG_LITE_RGBA8888:
+ case VG_LITE_BGRA8888:
+ case VG_LITE_ABGR8888:
+ case VG_LITE_ARGB8888:
+ case VG_LITE_RGBX8888:
+ case VG_LITE_BGRX8888:
+ case VG_LITE_XBGR8888:
+ case VG_LITE_XRGB8888:
+ FORMAT_ALIGNMENT(stride,64);
+ break;
+
+ default:
+ return VG_LITE_SUCCESS;
+ }
+}
+
+/* Convert VGLite source color format to HW values. */
+static uint32_t convert_source_format(vg_lite_buffer_format_t format)
+{
+ switch (format) {
+ case VG_LITE_L8:
+ return 0x0;
+
+ case VG_LITE_A4:
+ return 0x1;
+
+ case VG_LITE_A8:
+ return 0x2;
+
+ case VG_LITE_RGBA4444:
+ return 0x23;
+
+ case VG_LITE_BGRA4444:
+ return 0x3;
+
+ case VG_LITE_ABGR4444:
+ return 0x13;
+
+ case VG_LITE_ARGB4444:
+ return 0x33;
+
+ case VG_LITE_RGB565:
+ return 0x25;
+
+ case VG_LITE_BGR565:
+ return 0x5;
+
+ case VG_LITE_RGBA8888:
+ return 0x27;
+
+ case VG_LITE_BGRA8888:
+ return 0x7;
+
+ case VG_LITE_ABGR8888:
+ return 0x17;
+
+ case VG_LITE_ARGB8888:
+ return 0x37;
+
+ case VG_LITE_RGBX8888:
+ return 0x26;
+
+ case VG_LITE_BGRX8888:
+ return 0x6;
+
+ case VG_LITE_XBGR8888:
+ return 0x16;
+
+ case VG_LITE_XRGB8888:
+ return 0x36;
+
+ case VG_LITE_BGRA5551:
+ return 0x4;
+
+ case VG_LITE_RGBA5551:
+ return 0x24;
+
+ case VG_LITE_ABGR1555:
+ return 0x14;
+
+ case VG_LITE_ARGB1555:
+ return 0x34;
+
+ case VG_LITE_YUYV:
+ return 0x8;
+
+ case VG_LITE_YUY2:
+ case VG_LITE_YUY2_TILED:
+ return 0x8;
+
+ case VG_LITE_NV12:
+ case VG_LITE_NV12_TILED:
+ return 0xB;
+
+ case VG_LITE_ANV12:
+ case VG_LITE_ANV12_TILED:
+ return 0xE;
+
+ case VG_LITE_YV12:
+ return 0x9;
+
+ case VG_LITE_YV24:
+ return 0xD;
+
+ case VG_LITE_YV16:
+ return 0xC;
+
+ case VG_LITE_NV16:
+ return 0xA;
+
+ case VG_LITE_AYUY2:
+ case VG_LITE_AYUY2_TILED:
+ default:
+ return 0xF;
+
+ case VG_LITE_INDEX_1:
+ return 0x200;
+
+ case VG_LITE_INDEX_2:
+ return 0x400;
+
+ case VG_LITE_INDEX_4:
+ return 0x600;
+
+ case VG_LITE_INDEX_8:
+ return 0x800;
+
+ case VG_LITE_RGBA2222:
+ return 0xA20;
+
+ case VG_LITE_BGRA2222:
+ return 0xA00;
+
+ case VG_LITE_ABGR2222:
+ return 0xA10;
+
+ case VG_LITE_ARGB2222:
+ return 0xA30;
+ }
+}
+
+/* Convert VGLite blend modes to HW values. */
+static uint32_t convert_blend(vg_lite_blend_t blend)
+{
+ switch (blend) {
+ case VG_LITE_BLEND_SRC_OVER:
+ return 0x00000100;
+
+ case VG_LITE_BLEND_DST_OVER:
+ return 0x00000200;
+
+ case VG_LITE_BLEND_SRC_IN:
+ return 0x00000300;
+
+ case VG_LITE_BLEND_DST_IN:
+ return 0x00000400;
+
+ case VG_LITE_BLEND_SCREEN:
+ return 0x00000600;
+
+ case VG_LITE_BLEND_MULTIPLY:
+ return 0x00000500;
+
+ case VG_LITE_BLEND_ADDITIVE:
+ return 0x00000900;
+
+ case VG_LITE_BLEND_SUBTRACT:
+ return 0x00000A00;
+
+ default:
+ return 0;
+ }
+}
+
+/* Convert VGLite uv swizzle enums to HW values. */
+static uint32_t convert_uv_swizzle(vg_lite_swizzle_t swizzle)
+{
+ switch (swizzle) {
+ case VG_LITE_SWIZZLE_UV:
+ return 0x00000040;
+ break;
+
+ case VG_LITE_SWIZZLE_VU:
+ return 0x00000050;
+
+ default:
+ return 0;
+ break;
+ }
+}
+
+/* Convert VGLite yuv standard enums to HW values. */
+static uint32_t convert_yuv2rgb(vg_lite_yuv2rgb_t yuv)
+{
+ switch (yuv) {
+ case VG_LITE_YUV601:
+ return 0;
+ break;
+
+ case VG_LITE_YUV709:
+ return 0x00008000;
+
+ default:
+ return 0;
+ break;
+ }
+}
+
+/* Initialize the feature table of a chip. */
+static vg_lite_error_t fill_feature_table(uint32_t * feature)
+{
+ uint16_t size = sizeof(VGFeatureInfos) / sizeof(VGFeatureInfos[0]);
+ uint16_t i;
+ uint32_t cid = 0;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif
+
+ /* Clear all bits. */
+ _memset(feature, 0, sizeof(uint32_t) * gcFEATURE_COUNT);
+ vg_lite_get_product_info(NULL,&ctx->chip_id,&ctx->chip_rev);
+ if(ctx->chip_id == GPU_CHIP_ID_GC355)
+ ctx->premultiply_enabled = 1;
+ vg_lite_get_register(0x30, &cid);
+
+ for(i = 0;i < size; i++){
+ if ((VGFeatureInfos[i].chip_id == ctx->chip_id)
+ && (VGFeatureInfos[i].chip_version == ctx->chip_rev)
+ && (VGFeatureInfos[i].cid == cid)
+ )
+ {
+ feature[gcFEATURE_BIT_VG_IM_INDEX_FORMAT] = VGFeatureInfos[i].vg_im_index_format;
+ feature[gcFEATURE_BIT_VG_PE_PREMULTIPLY] = VGFeatureInfos[i].vg_pe_premultiply;
+ feature[gcFEATURE_BIT_VG_BORDER_CULLING] = VGFeatureInfos[i].vg_border_culling;
+ feature[gcFEATURE_BIT_VG_RGBA2_FORMAT] = VGFeatureInfos[i].vg_rgba2_format;
+ feature[gcFEATURE_BIT_VG_QUALITY_8X] = VGFeatureInfos[i].vg_quality_8x;
+ feature[gcFEATURE_BIT_VG_RADIAL_GRADIENT] = VGFeatureInfos[i].vg_radial_gradient;
+ feature[gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT] = VGFeatureInfos[i].vg_linear_gradient_ext;
+ feature[gcFEATURE_BIT_VG_DITHER] = VGFeatureInfos[i].vg_dither;
+ feature[gcFEATURE_BIT_VG_COLOR_KEY] = VGFeatureInfos[i].vg_color_key;
+ break;
+ }
+ }
+
+ if(i == size) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ ctx->s_ftable.ftflag = 1;
+
+ return VG_LITE_SUCCESS;
+}
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+static vg_lite_error_t flush(vg_lite_context_t *context);
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+static vg_lite_error_t submit(vg_lite_context_t * context);
+#if defined(VG_DRIVER_SINGLE_THREAD)
+static vg_lite_error_t stall(vg_lite_context_t * context, uint32_t time_ms, uint32_t mask);
+#else
+static vg_lite_error_t stall(vg_lite_context_t * context, uint32_t time_ms);
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+/* Push a state array into context buffer. */
+static vg_lite_error_t push_states_to_context(vg_lite_context_t * context, uint32_t address, uint32_t count, uint32_t *data)
+{
+ uint32_t i, command_id;
+ vg_lite_error_t error;
+ if (!has_valid_context_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the context buffer for flush and submit */
+ if (context->context_buffer_offset[command_id] + 8 >= context->context_buffer_size) {
+ return VG_LITE_OUT_OF_RESOURCES;
+ }
+
+ ((uint32_t *) (context->context_buffer[command_id] + context->context_buffer_offset[command_id]))[0] = VG_LITE_STATES(count, address);
+
+ for (i = 0; i < count; i++) {
+ ((uint32_t *) (context->context_buffer[command_id] + context->context_buffer_offset[command_id]))[1 + i] = data[i];
+ }
+ if (i%2 == 0) {
+ ((uint32_t *) (context->context_buffer[command_id] + context->context_buffer_offset[command_id]))[1 + i] = VG_LITE_NOP();
+ }
+
+ context->context_buffer_offset[command_id] += VG_LITE_ALIGN(count + 1, 2) * 4;
+
+ return VG_LITE_SUCCESS;
+}
+
+static vg_lite_error_t update_context_buffer()
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_kernel_context_switch_t check;
+ vg_lite_tls_t* tls;
+ uint32_t command_id;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(tls->t_context);
+ check.context =(uint32_t)&tls->t_context.context;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_QUERY_CONTEXT_SWITCH, &check));
+ /* if context have been switched and this task need use index. */
+ if(check.isContextSwitched && tls->t_context.index_format)
+ {
+ uint32_t clut_addr[4]={0x0A98,0x0A9C,0x0AA0,0x0B00};
+ uint32_t clut_count[4]={2,4,16,256};
+
+ for(int i = 0; i < 4; i++)
+ {
+ /* check which index colors would be use in this task. */
+ if(tls->t_context.colors[i] && tls->t_context.clut_used[i]){
+ VG_LITE_RETURN_ERROR(push_states_to_context(&tls->t_context, clut_addr[i], clut_count[i], tls->t_context.colors[i]));
+ tls->t_context.clut_used[i] = 0;
+ }
+ }
+ tls->t_context.index_format = 0;
+ }
+
+ /* Set tessellation buffer states */
+ if(check.isContextSwitched && tls->t_context.ts_init && !tls->t_context.ts_init_used && tls->t_context.ts_init_use){
+ /* Reserve enough space in the context buffer for flush and submit */
+ if (tls->t_context.context_buffer_offset[command_id] + 80 >= tls->t_context.context_buffer_size) {
+ return VG_LITE_OUT_OF_RESOURCES;
+ }
+ memcpy(tls->t_context.context_buffer[command_id] + tls->t_context.context_buffer_offset[command_id], tls->t_context.ts_record, 80);
+ tls->t_context.ts_init = 0;
+ tls->t_context.ts_init_used = 0;
+ tls->t_context.ts_init_use = 0;
+ tls->t_context.context_buffer_offset[command_id] += 80;
+ }
+
+ if(tls->t_context.context_buffer_offset[command_id]){
+ ((uint32_t *) (tls->t_context.context_buffer[command_id] + tls->t_context.context_buffer_offset[command_id]))[0] = VG_LITE_RETURN();
+ ((uint32_t *) (tls->t_context.context_buffer[command_id] + tls->t_context.context_buffer_offset[command_id]))[1] = 0;
+ tls->t_context.context_buffer_offset[command_id] += 8;
+ ((uint32_t *) CMDBUF_BUFFER(tls->t_context))[0] = VG_LITE_CALL((tls->t_context.context_buffer_offset[command_id] + 7) / 8);
+ ((uint32_t *) CMDBUF_BUFFER(tls->t_context))[1] = tls->t_context.context.context_buffer_physical[command_id];
+ tls->t_context.context_buffer_offset[command_id] = 0;
+ }
+
+ return error;
+}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+/* Push a state array into current command buffer. */
+static vg_lite_error_t push_states(vg_lite_context_t * context, uint32_t address, uint32_t count, uint32_t *data)
+{
+ uint32_t i;
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 8 + VG_LITE_ALIGN(count + 1, 2) * 4 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATES(count, address);
+
+ for (i = 0; i < count; i++) {
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1 + i] = data[i];
+ }
+ if (i%2 == 0) {
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1 + i] = VG_LITE_NOP();
+ }
+
+ CMDBUF_OFFSET(*context) += VG_LITE_ALIGN(count + 1, 2) * 4;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a single state command into the current command buffer. */
+static vg_lite_error_t push_state(vg_lite_context_t * context, uint32_t address, uint32_t data)
+{
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATE(address);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = data;
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a single state command with given address. */
+static vg_lite_error_t push_state_ptr(vg_lite_context_t * context, uint32_t address, void * data_ptr)
+{
+ vg_lite_error_t error;
+ uint32_t data = *(uint32_t *) data_ptr;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATE(address);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = data;
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a "call" command into the current command buffer. */
+static vg_lite_error_t push_call(vg_lite_context_t * context, uint32_t address, uint32_t bytes)
+{
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_CALL((bytes + 7) / 8);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = address;
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a rectangle command into the current command buffer. */
+static vg_lite_error_t push_rectangle(vg_lite_context_t * context, int x, int y, int width, int height)
+{
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_DATA(1);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[4] = (uint16_t)x;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[5] = (uint16_t)y;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[6] = (uint16_t)width;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[7] = (uint16_t)height;
+
+ CMDBUF_OFFSET(*context) += 16;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a data array into the current command buffer. */
+static vg_lite_error_t push_data(vg_lite_context_t * context, int size, void * data)
+{
+ vg_lite_error_t error;
+ int bytes = VG_LITE_ALIGN(size, 8);
+
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 + bytes >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint64_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(bytes / 8)] = 0;
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_DATA(bytes / 8);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context) + 8, data, size);
+
+ CMDBUF_OFFSET(*context) += 8 + bytes;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a "stall" command into the current command buffer. */
+static vg_lite_error_t push_stall(vg_lite_context_t * context, uint32_t module)
+{
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ if (CMDBUF_OFFSET(*context) + 16 >= CMDBUF_SIZE(*context)) {
+ VG_LITE_RETURN_ERROR(submit(context));
+ VG_LITE_RETURN_ERROR(stall(context, 0, (uint32_t)~0));
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_SEMAPHORE(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[2] = VG_LITE_STALL(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[3] = 0;
+
+ CMDBUF_OFFSET(*context) += 16;
+
+ return VG_LITE_SUCCESS;
+}
+
+#else
+
+/* Push a state array into current command buffer. */
+static vg_lite_error_t push_states(vg_lite_context_t * context, uint32_t address, uint32_t count, uint32_t *data)
+{
+ uint32_t i, command_id, index;
+ vg_lite_error_t error;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 40 + VG_LITE_ALIGN(count + 1, 2) * 4 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATES(count, address);
+
+ for (i = 0; i < count; i++) {
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1 + i] = data[i];
+ }
+ if (i%2 == 0) {
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1 + i] = VG_LITE_NOP();
+ }
+
+#if DUMP_COMMAND
+ {
+ uint32_t loops;
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, ",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0]);
+
+ for (loops = 0; loops < count / 2; loops++) {
+ fprintf(fp, "0x%08x,\nCommand buffer: 0x%08x, ",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(loops + 1) * 2 - 1],
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(loops + 1) * 2]);
+ }
+
+ fprintf(fp, "0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(loops + 1) * 2 - 1]);
+
+ fclose(fp);
+ fp = NULL;
+ }
+#endif
+
+ CMDBUF_OFFSET(*context) += VG_LITE_ALIGN(count + 1, 2) * 4;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a single state command into the current command buffer. */
+static vg_lite_error_t push_state(vg_lite_context_t * context, uint32_t address, uint32_t data)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 56 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATE(address);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = data;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0],
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1]);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a single state command with given address. */
+static vg_lite_error_t push_state_ptr(vg_lite_context_t * context, uint32_t address, void * data_ptr)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ uint32_t data = *(uint32_t *) data_ptr;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 56 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATE(address);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = data;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0],
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1]);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a "call" command into the current command buffer. */
+static vg_lite_error_t push_call(vg_lite_context_t * context, uint32_t address, uint32_t bytes)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 56 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_CALL((bytes + 7) / 8);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = address;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0],
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1]);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a rectangle command into the current command buffer. */
+static vg_lite_error_t push_rectangle(vg_lite_context_t * context, int x, int y, int width, int height)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 56 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_DATA(1);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[4] = (uint16_t)x;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[5] = (uint16_t)y;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[6] = (uint16_t)width;
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[7] = (uint16_t)height;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0], 0);
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[5] << 16 |
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[4],
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[7] << 16 |
+ ((uint16_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[6]);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 16;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a data array into the current command buffer. */
+static vg_lite_error_t push_data(vg_lite_context_t * context, int size, void * data)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ int bytes = VG_LITE_ALIGN(size, 8);
+
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 48 + bytes >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint64_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(bytes / 8)] = 0;
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_DATA(bytes / 8);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context) + 8, data, size);
+
+#if DUMP_COMMAND
+ {
+ int loops;
+
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0], 0);
+ for (loops = 0; loops < bytes / 8; loops++) {
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(loops + 1) * 2],
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[(loops + 1) * 2 + 1]);
+ }
+
+ fclose(fp);
+ fp = NULL;
+ }
+#endif
+
+ CMDBUF_OFFSET(*context) += 8 + bytes;
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Push a "stall" command into the current command buffer. */
+static vg_lite_error_t push_stall(vg_lite_context_t * context, uint32_t module)
+{
+ vg_lite_error_t error;
+ uint32_t command_id, index;
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ /* Reserve enough space in the command buffer for flush and submit */
+ if (CMDBUF_OFFSET(*context) + 56 >= CMDBUF_SIZE(*context)) {
+ uint32_t cmd_count = 0,start_offset = 0;
+ context->end_offset = CMDBUF_OFFSET(*context);
+ start_offset = context->start_offset;
+ VG_LITE_RETURN_ERROR(flush(context));
+ VG_LITE_RETURN_ERROR(submit(context));
+ CMDBUF_SWAP(*context);
+ command_id = CMDBUF_INDEX(*context);
+ if(CMDBUF_IN_QUEUE(&context->context, command_id))
+ VG_LITE_RETURN_ERROR(stall(context, 0));
+
+ RESERVE_BYTES_IN_CMDBUF(*context);
+
+ if(context->ts_init){
+ memcpy(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context), context->ts_record, 80);
+ CMDBUF_OFFSET(*context) += 80;
+ context->ts_init_used = 1;
+ }
+
+ /* update start offset */
+ context->start_offset = CMDBUF_OFFSET(*context);
+
+ index = (command_id? 0 : 1);
+ command_buffer_copy((void *)(CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)), (void *)(context->command_buffer[index] + start_offset),
+ start_offset, context->end_offset, &cmd_count);
+ CMDBUF_OFFSET(*context) += cmd_count;
+ }
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_SEMAPHORE(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[2] = VG_LITE_STALL(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[3] = 0;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0], 0);
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[2], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 16;
+
+ return VG_LITE_SUCCESS;
+}
+
+static vg_lite_error_t flush(vg_lite_context_t *context)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t address0 = 0x0A34;
+ uint32_t address1 = 0x0A1B;
+ uint32_t data0 = 0;
+ uint32_t data1 = 0x00000001;
+ uint32_t module = 7;
+
+ /* Check if there is a valid context and an allocated command buffer. */
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ /* Check if there is anything to flush. */
+ if (CMDBUF_OFFSET(*context) == 0)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Check if there is enough space in the command buffer. */
+ if (CMDBUF_OFFSET(*context) + 32 > CMDBUF_SIZE(*context)) {
+ return VG_LITE_OUT_OF_RESOURCES;
+ }
+
+ /* Finialize command buffer. */
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_STATE(address0);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = data0;
+
+ /* flush target */
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[2] = VG_LITE_STATE(address1);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[3] = data1;
+
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[4] = VG_LITE_SEMAPHORE(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[5] = 0;
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[6] = VG_LITE_STALL(module);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[7] = 0;
+
+ CMDBUF_OFFSET(*context) += 32;
+
+ return error;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+/* Submit the current command buffer to HW and reset the current command buffer offset. */
+static vg_lite_error_t submit(vg_lite_context_t *context)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_kernel_submit_t submit;
+
+ /* Check if there is a valid context and an allocated command buffer. */
+ if (!has_valid_command_buffer(context))
+ return VG_LITE_NO_CONTEXT;
+
+ /* Check if there is anything to submit. */
+ if (CMDBUF_OFFSET(*context) == 0)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Check if there is enough space in the command buffer for the END. */
+ if (CMDBUF_OFFSET(*context) + 8 > CMDBUF_SIZE(*context)) {
+ /* Reset command buffer offset. */
+ CMDBUF_OFFSET(*context) = 0;
+ return VG_LITE_OUT_OF_RESOURCES;
+ }
+
+ /* Append END command into the command buffer. */
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0] = VG_LITE_END(0);
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[1] = 0;
+
+#if DUMP_COMMAND
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) (CMDBUF_BUFFER(*context) + CMDBUF_OFFSET(*context)))[0], 0);
+
+ fprintf(fp, "Command buffer addr is : %p,\n", CMDBUF_BUFFER(*context));
+ fprintf(fp, "Command buffer offset is : %d,\n", CMDBUF_OFFSET(*context) + 8);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+
+ CMDBUF_OFFSET(*context) += 8;
+
+ /* Submit the command buffer. */
+ submit.context = &context->context;
+ submit.commands = CMDBUF_BUFFER(*context);
+ submit.command_size = CMDBUF_OFFSET(*context);
+ submit.command_id = CMDBUF_INDEX(*context);
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ /* Wait if GPU has not completed previous CMD buffer */
+ if (submit_flag) {
+ VG_LITE_RETURN_ERROR(stall(&s_context, 0, (uint32_t)~0));
+ }
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_SUBMIT, &submit));
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ submit_flag = 1;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ vglitemDUMP_BUFFER("command", (unsigned int)CMDBUF_BUFFER(*context),
+ submit.context->command_buffer_logical[CMDBUF_INDEX(*context)], 0, submit.command_size);
+ vglitemDUMP("@[commit]");
+
+ /* Reset command buffer. */
+ CMDBUF_OFFSET(*context) = 0;
+
+ return error;
+}
+
+/* Wait for the HW to finish the current execution. */
+#if defined(VG_DRIVER_SINGLE_THREAD)
+static vg_lite_error_t stall(vg_lite_context_t *context, uint32_t time_ms, uint32_t mask)
+#else
+static vg_lite_error_t stall(vg_lite_context_t *context, uint32_t time_ms)
+#endif /* VG_DRIVER_SINGLE_THREAD */
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_wait_t wait;
+
+ vglitemDUMP("@[stall]");
+ /* Wait until GPU is ready. */
+ wait.context = &context->context;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ wait.timeout_ms = time_ms > 0 ? time_ms : VG_LITE_INFINITE;
+ wait.event_mask = mask;
+#else
+ wait.timeout_ms = time_ms > 0 ? time_ms : VG_LITE_MAX_WAIT_TIME;
+ wait.command_id = CMDBUF_INDEX(*context);
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_WAIT, &wait));
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ submit_flag = 0;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+ return VG_LITE_SUCCESS;
+}
+
+/* Get the inversion of a matrix. */
+VG_LITE_OPTIMIZE(LOW) static int inverse(vg_lite_matrix_t * result, vg_lite_matrix_t * matrix)
+{
+ vg_lite_float_t det00, det01, det02;
+ vg_lite_float_t d;
+ int isAffine;
+
+ /* Test for identity matrix. */
+ if (matrix == NULL) {
+ result->m[0][0] = 1.0f;
+ result->m[0][1] = 0.0f;
+ result->m[0][2] = 0.0f;
+ result->m[1][0] = 0.0f;
+ result->m[1][1] = 1.0f;
+ result->m[1][2] = 0.0f;
+ result->m[2][0] = 0.0f;
+ result->m[2][1] = 0.0f;
+ result->m[2][2] = 1.0f;
+
+ /* Success. */
+ return 1;
+ }
+
+ det00 = (matrix->m[1][1] * matrix->m[2][2]) - (matrix->m[2][1] * matrix->m[1][2]);
+ det01 = (matrix->m[2][0] * matrix->m[1][2]) - (matrix->m[1][0] * matrix->m[2][2]);
+ det02 = (matrix->m[1][0] * matrix->m[2][1]) - (matrix->m[2][0] * matrix->m[1][1]);
+
+ /* Compute determinant. */
+ d = (matrix->m[0][0] * det00) + (matrix->m[0][1] * det01) + (matrix->m[0][2] * det02);
+
+ /* Return 0 if there is no inverse matrix. */
+ if (d == 0.0f)
+ return 0;
+
+ /* Compute reciprocal. */
+ d = 1.0f / d;
+
+ /* Determine if the matrix is affine. */
+ isAffine = (matrix->m[2][0] == 0.0f) && (matrix->m[2][1] == 0.0f) && (matrix->m[2][2] == 1.0f);
+
+ result->m[0][0] = d * det00;
+ result->m[0][1] = d * ((matrix->m[2][1] * matrix->m[0][2]) - (matrix->m[0][1] * matrix->m[2][2]));
+ result->m[0][2] = d * ((matrix->m[0][1] * matrix->m[1][2]) - (matrix->m[1][1] * matrix->m[0][2]));
+ result->m[1][0] = d * det01;
+ result->m[1][1] = d * ((matrix->m[0][0] * matrix->m[2][2]) - (matrix->m[2][0] * matrix->m[0][2]));
+ result->m[1][2] = d * ((matrix->m[1][0] * matrix->m[0][2]) - (matrix->m[0][0] * matrix->m[1][2]));
+ result->m[2][0] = isAffine ? 0.0f : d * det02;
+ result->m[2][1] = isAffine ? 0.0f : d * ((matrix->m[2][0] * matrix->m[0][1]) - (matrix->m[0][0] * matrix->m[2][1]));
+ result->m[2][2] = isAffine ? 1.0f : d * ((matrix->m[0][0] * matrix->m[1][1]) - (matrix->m[1][0] * matrix->m[0][1]));
+
+ /* Success. */
+ return 1;
+}
+
+/* Transform a 2D point by a given matrix. */
+static int transform(vg_lite_point_t * result, vg_lite_float_t x, vg_lite_float_t y, vg_lite_matrix_t * matrix)
+{
+ vg_lite_float_t pt_x;
+ vg_lite_float_t pt_y;
+ vg_lite_float_t pt_w;
+
+ /* Test for identity matrix. */
+ if (matrix == NULL) {
+ result->x = (int)x;
+ result->y = (int)y;
+
+ /* Success. */
+ return 1;
+ }
+
+ /* Transform x, y, and w. */
+ pt_x = (x * matrix->m[0][0]) + (y * matrix->m[0][1]) + matrix->m[0][2];
+ pt_y = (x * matrix->m[1][0]) + (y * matrix->m[1][1]) + matrix->m[1][2];
+ pt_w = (x * matrix->m[2][0]) + (y * matrix->m[2][1]) + matrix->m[2][2];
+
+ if (pt_w <= 0.0f)
+ return 0;
+
+ /* Compute projected x and y. */
+ result->x = (int)(pt_x / pt_w);
+ result->y = (int)(pt_y / pt_w);
+
+ /* Success. */
+ return 1;
+}
+
+/*!
+ Flush specific VG module.
+ */
+static vg_lite_error_t flush_target()
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ do {
+ VG_LITE_BREAK_ERROR(push_state(ctx, 0x0A1B, 0x00000001));
+ VG_LITE_BREAK_ERROR(push_stall(ctx, 7));
+ } while (0);
+
+ return error;
+}
+
+/****************** FAST_CLEAR feature implementation. ***************/
+#if VG_TARGET_FAST_CLEAR
+static vg_lite_error_t convert_color(vg_lite_buffer_format_t format, uint32_t value, uint32_t *result, int *bpp)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t r, g, b, a;
+ int Bpp = 0;
+
+ r = B(value);
+ g = G(value);
+ b = R(value);
+ a = A(value);
+
+ do {
+ switch (format) {
+ case VG_LITE_RGBA8888:
+ *result = ARGB(a, b, g, r);
+ Bpp = 32;
+ break;
+
+ case VG_LITE_BGRA8888:
+ *result = ARGB(a, r, g, b);
+ Bpp = 32;
+ break;
+
+ case VG_LITE_RGBX8888:
+ *result = ARGB(0xff, b, g, r);
+ Bpp = 32;
+ break;
+
+ case VG_LITE_BGRX8888:
+ *result = ARGB(0xff, r, g, b);
+ Bpp = 32;
+ break;
+
+ case VG_LITE_RGBA4444:
+ *result = ARGB4(a, b, g, r);
+ Bpp = 16;
+ break;
+
+ case VG_LITE_BGRA4444:
+ *result = ARGB4(a, r, g, b);
+ Bpp = 16;
+ break;
+
+ case VG_LITE_RGB565:
+ *result = ((b & 0xf8) << 8) |
+ ((g & 0xfc) << 3) |
+ ((r & 0xf8) >> 3);
+ Bpp = 16;
+ break;
+
+ case VG_LITE_BGR565:
+ *result = ((r & 0xf8) << 8) |
+ ((g & 0xfc) << 3) |
+ ((b & 0xf8) >> 3);
+ Bpp = 16;
+ break;
+
+ case VG_LITE_BGRA5551:
+ *result = ((b & 0xf8) << 8) |
+ ((g & 0xf8) << 3) |
+ ((r & 0xf8) >> 2) |
+ ((a & 0x80) >> 7);
+ Bpp = 16;
+ break;
+
+ case VG_LITE_A8:
+ *result = ARGB(a, a, a, a);
+ Bpp = 8;
+ break;
+
+ case VG_LITE_L8:
+ *result = ARGB(r, r, r, r);
+ Bpp = 8;
+ break;
+
+ default:
+ error = VG_LITE_NOT_SUPPORT;
+ break;
+ }
+ } while (0);
+
+ if (bpp != NULL) {
+ *bpp = Bpp;
+ }
+
+ if (Bpp == 16) {
+ *result = ((*result) << 16) | (*result);
+ }
+ return error;
+}
+
+/* Fill Target buffer by FC buffer. Only used in cmodel/fpga for verification. */
+#if defined(DEBUG) || defined(_DEBUG)
+static vg_lite_error_t fill_fc_target(vg_lite_buffer_t *target, vg_lite_buffer_t *fcb)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint8_t *fc = (uint8_t *)fcb->memory;
+ uint16_t *target16;
+ uint32_t *target32;
+ uint8_t *target8;
+ uint32_t clear32;
+ int byte_done = 0;
+ int i, j, k;
+ int bpp;
+
+ do {
+ convert_color(target->format, s_context.clearValue, &clear32, &bpp);
+
+ if (bpp == 32) {
+ target32 = (uint32_t *)target->memory;
+ for (i = 0; i < fcb->width; i++) {
+
+ for (j = 0; j < 8; j++) { /* Loop the bits*/
+
+ if (!(((*fc) >> j) & 1)) {
+ for (k = 0; k < 64 / 4; k++) {
+ target32[k] = clear32;
+ byte_done+=4;
+ if (byte_done >= target->stride * target->height) {
+ return error;
+ }
+ }
+ }
+
+ target32 += 64/4;
+ }
+
+ fc++;
+ }
+ }
+ else if (bpp == 16){
+ target16 = (uint16_t *)target->memory;
+ for (i = 0; i < fcb->width; i++) {
+
+ for (j = 0; j < 8; j++) { /* Loop the bits*/
+
+ if (!(((*fc) >> j) & 1)) {
+ for (k = 0; k < 64 / 2; k++) {
+ target16[k] = (uint16_t)clear32;
+ byte_done+=2;
+ if (byte_done >= target->stride * target->height) {
+ return error;
+ }
+ }
+ }
+
+ target16 += 64/2;
+ }
+
+ fc++;
+ }
+ }
+ else if (bpp == 8) {
+ target8 = (uint8_t *)target->memory;
+ for (i = 0; i < fcb->width; i++) {
+
+ for (j = 0; j < 8; j++) { /* Loop the bits*/
+
+ if (!(((*fc) >> j) & 1)) {
+ for (k = 0; k < 64; k++) {
+ target8[k] = (uint8_t)clear32;
+ byte_done++;
+ if (byte_done >= target->stride * target->height) {
+ return error;
+ }
+ }
+ }
+
+ target8 += 64;
+ }
+
+ fc++;
+ }
+ }
+ } while (0);
+
+ return error;
+}
+#endif
+
+/* Update the fast_clear buffer when render target switched. */
+static vg_lite_error_t update_fc_buffer(vg_lite_buffer_t *target)
+{
+ int rt_bytes;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_context_t *context = GET_CONTEXT();
+ vg_lite_kernel_allocate_t allocate;
+
+ do {
+ if (target == NULL) {
+ error = VG_LITE_INVALID_ARGUMENT;
+ break;
+ }
+
+ rt_bytes = target->stride * target->height;
+ rt_bytes = VG_LITE_ALIGN(rt_bytes, (FC_BIT_TO_BYTES * 8));
+ rt_bytes = rt_bytes / FC_BIT_TO_BYTES / 8;
+ /* Only allocate new buffer when the allocated is not big enough. Yes*/
+ if (rt_bytes > context->fcBuffer.stride ) {
+ vg_lite_free(&context->fcBuffer);
+
+ context->fcBuffer.width = rt_bytes; /* The actually used bytes. */
+ rt_bytes = VG_LITE_ALIGN(rt_bytes, FC_BURST_BYTES); /* The allocated aligned bytes. */
+ context->fcBuffer.stride = rt_bytes;
+ allocate.bytes = rt_bytes;
+ allocate.contiguous = 1;
+
+ VG_LITE_BREAK_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+ context->fcBuffer.handle = allocate.memory_handle;
+ context->fcBuffer.memory = allocate.memory;
+ context->fcBuffer.address = allocate.memory_gpu;
+ }
+ else {
+ /* Just update the fc buffer size. */
+ context->fcBuffer.width = rt_bytes;
+ }
+ memset(context->fcBuffer.memory, 0xff, context->fcBuffer.stride);
+ } while (0);
+
+ return error;
+}
+
+/* Update FC registers and clear FC buffer. */
+static vg_lite_error_t clear_fc(uint32_t value)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_context_t *context = GET_CONTEXT();
+ uint32_t bytes_to_clear = context->fcBuffer.stride / FC_BURST_BYTES;
+
+ do {
+ VG_LITE_BREAK_ERROR(push_state(context, 0x0A9A, context->fcBuffer.address)); /* FC buffer address. */
+ VG_LITE_BREAK_ERROR(push_state(context, 0x0A9B, value)); /* FC clear value. */
+ VG_LITE_BREAK_ERROR(push_state(context, 0x0AB0, 0x80000000 | bytes_to_clear)); /* FC clear command. */
+ } while (0);
+
+ return error;
+}
+
+#if VG_TARGET_FC_DUMP
+static int fc_buf_dump(vg_lite_buffer_t *target, vg_lite_buffer_t *fcb)
+{
+ int error = VG_LITE_SUCCESS;
+ uint8_t *fc = (uint8_t *)fcb->memory;
+ uint8_t *target8;
+ int byte_done = 0;
+ int target_bytes;
+ int i, j;
+
+ static unsigned s_cnt;
+ unsigned cnt = s_cnt;
+
+ FILE *fpFCBuf;
+ FILE *fpTargetBuf;
+ FILE *fpTargetBufInfo;
+ char buf[256];
+
+ s_cnt++;
+
+ sprintf(buf, "vg255v2.fc_buf.f%04d.txt", cnt);
+ fpFCBuf = fopen(buf, "wt");
+ if (NULL == fpFCBuf) {
+ fprintf(stderr, "[Warning] Open file \'%s\' fail.\n", buf);
+ return -1;
+ }
+
+ sprintf(buf, "vg255v2.target_buf_info.f%04d.txt", cnt);
+ fpTargetBufInfo = fopen(buf, "wt");
+ if (NULL == fpTargetBufInfo) {
+ fprintf(stderr, "[Warning] Open file \'%s\' fail.\n", buf);
+ fclose(fpFCBuf);
+ return -1;
+ } else {
+ fprintf(fpTargetBufInfo, "%-12s: %d\n", "format", target->format);
+ fprintf(fpTargetBufInfo, "%-12s: %d\n", "tiled", target->tiled);
+ fprintf(fpTargetBufInfo, "%-12s: %d\n", "width", target->width);
+ fprintf(fpTargetBufInfo, "%-12s: %d\n", "height", target->height);
+ fprintf(fpTargetBufInfo, "%-12s: %d\n", "stride", target->stride);
+
+ fclose(fpTargetBufInfo);
+ }
+
+ sprintf(buf, "vg255v2.target_buf.f%04d.txt", cnt);
+ fpTargetBuf = fopen(buf, "wt");
+ if (NULL == fpTargetBuf) {
+ fprintf(stderr, "[Warning] Open file \'%s\' fail.\n", buf);
+ fclose(fpFCBuf);
+ return -1;
+ }
+
+ /* Dump FC buffer & Dump target buffer */
+ target8 = (uint8_t *)target->memory;
+ target_bytes = target->stride * target->height;
+
+ for (i = 0; i < fcb->width; ++i)
+ {
+ fprintf(fpFCBuf, "%02x\n", fc[i]);
+ /* 1 byte of fc related with 512 bytes of target buffer */
+ for (j = 0; j < 128; ++j) {
+ fprintf(fpTargetBuf, "%02x", byte_done < target_bytes ? target8[0] : 0);
+ byte_done++;
+
+ fprintf(fpTargetBuf, "%02x", byte_done < target_bytes ? target8[1] : 0);
+ byte_done++;
+
+ fprintf(fpTargetBuf, "%02x", byte_done < target_bytes ? target8[2] : 0);
+ byte_done++;
+
+ fprintf(fpTargetBuf, "%02x\n", byte_done < target_bytes ? target8[3] : 0);
+ byte_done++;
+
+ target8 += 4;
+ }
+ }
+
+ fclose(fpFCBuf);
+ fclose(fpTargetBuf);
+
+ return error;
+}
+#endif /* VG_TARGET_FC_DUMP */
+
+#endif
+
+/* Set the current render target. */
+#if defined(VG_DRIVER_SINGLE_THREAD)
+static vg_lite_error_t set_render_target(vg_lite_buffer_t *target)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t yuv2rgb = 0;
+ uint32_t uv_swiz = 0;
+ int32_t tiled;
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+ if(target == NULL) {
+ return VG_LITE_INVALID_ARGUMENT;
+ } else if(s_context.scissor_enabled && (s_context.scissor[2] <= 0 || s_context.scissor[3] <= 0)) {
+ /* Check scissoring rectangle dimensions
+ A scissoring rectangle with width <= 0 or height <= 0 must be
+ ignored. If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs. */
+ return VG_LITE_NO_CONTEXT;
+ }
+ /* Skip if render target and scissor are not changed. */
+ if ((s_context.rtbuffer != NULL) &&
+ !(memcmp(s_context.rtbuffer,target,sizeof(vg_lite_buffer_t))) &&
+ (s_context.scissor_dirty == 0) && (s_context.premultiply_dirty == 0))
+ {
+ return VG_LITE_SUCCESS;
+ }
+
+ if ((target != NULL) &&
+ (target->format == VG_LITE_YUY2 ||
+ target->format == VG_LITE_AYUY2 ||
+ target->format == VG_LITE_YUY2_TILED ||
+ target->format == VG_LITE_AYUY2_TILED))
+ {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+
+#if VG_TARGET_FAST_CLEAR
+ /* Flush target if necessary when switching. */
+ if (s_context.rtbuffer&& s_context.rtbuffer->memory) { /* If it's not the first time to set target. */
+ vg_lite_finish();
+ }
+ update_fc_buffer(target);
+#else
+ if (s_context.rtbuffer && s_context.rtbuffer->memory) {
+ /* Flush the old target. */
+ vg_lite_finish();
+ }
+#endif
+
+ tiled = (target->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0;
+
+ if (((target->format >= VG_LITE_YUY2) &&
+ (target->format <= VG_LITE_AYUY2)) ||
+ ((target->format >= VG_LITE_YUY2_TILED) &&
+ (target->format <= VG_LITE_AYUY2_TILED))) {
+ yuv2rgb = convert_yuv2rgb(target->yuv.yuv2rgb);
+ uv_swiz = convert_uv_swizzle(target->yuv.swizzle);
+ }
+
+ /* Program render target. */
+ if (s_context.premultiply_dirty || s_context.rtbuffer != target || memcmp(s_context.rtbuffer,target,sizeof(vg_lite_buffer_t)) ) {
+ if(target->tiled == VG_LITE_TILED) {
+ if((target->stride % DEST_ALIGNMENT_LIMITATION) != 0)
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ if(s_context.premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A10,
+ convert_target_format(target->format, s_context.capabilities) | 0x00010000 | uv_swiz | yuv2rgb));
+ }else {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A10,
+ convert_target_format(target->format, s_context.capabilities) | 0x00010000 | uv_swiz | yuv2rgb | 0x100));
+ }
+ if (target->yuv.uv_planar)
+ { /* Program uv plane address if necessary. */
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A5C, target->yuv.uv_planar));
+ }
+ if (target->yuv.alpha_planar) {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A5D, target->yuv.alpha_planar));
+ }
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A11, target->address));
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A12, target->stride | tiled));
+ s_context.premultiply_dirty = 0;
+ }
+
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+
+ if (s_context.scissor_dirty != 0) {
+ if (s_context.scissor_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A13, (s_context.scissor[0] + s_context.scissor[2]) | ((s_context.scissor[1] + s_context.scissor[3]) << 16)));
+ }
+ else {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A13, dst_align_width | (target->height << 16)));
+ }
+ s_context.scissor_dirty = 0;
+ }
+ else {
+ VG_LITE_RETURN_ERROR(push_state(&s_context, 0x0A13, dst_align_width | (target->height << 16)));
+ }
+
+ memcpy(s_context.rtbuffer, target, sizeof(vg_lite_buffer_t));
+
+ return error;
+}
+#else
+static vg_lite_error_t set_render_target(vg_lite_buffer_t *target)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t yuv2rgb = 0;
+ uint32_t uv_swiz = 0;
+ int32_t tiled;
+ vg_lite_tls_t* tls;
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ if(target == NULL) {
+ return VG_LITE_INVALID_ARGUMENT;
+ } else if(tls->t_context.scissor_enabled && (tls->t_context.scissor[2] <= 0 || tls->t_context.scissor[3] <= 0)) {
+ /* Check scissoring rectangle dimensions
+ A scissoring rectangle with width <= 0 or height <= 0 must be
+ ignored. If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs. */
+ return VG_LITE_NO_CONTEXT;
+ }
+
+ tls->t_context.start_offset = CMDBUF_OFFSET(tls->t_context);
+
+ if ((target != NULL) &&
+ (target->format == VG_LITE_YUY2 ||
+ target->format == VG_LITE_AYUY2 ||
+ target->format == VG_LITE_YUY2_TILED ||
+ target->format == VG_LITE_AYUY2_TILED))
+ {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+#if VG_TARGET_FAST_CLEAR
+ /* Flush target if necessary when switching. */
+ if (tls->t_context.rtbuffer != NULL) { /* If it's not the first time to set target. */
+ vg_lite_finish();
+ }
+ update_fc_buffer(target);
+#endif
+
+ tiled = (target->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0;
+
+ if (((target->format >= VG_LITE_YUY2) &&
+ (target->format <= VG_LITE_AYUY2)) ||
+ ((target->format >= VG_LITE_YUY2_TILED) &&
+ (target->format <= VG_LITE_AYUY2_TILED))) {
+ yuv2rgb = convert_yuv2rgb(target->yuv.yuv2rgb);
+ uv_swiz = convert_uv_swizzle(target->yuv.swizzle);
+ }
+
+ /* Program render target. */
+ if(target->tiled == VG_LITE_TILED) {
+ if((target->stride % DEST_ALIGNMENT_LIMITATION) != 0)
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ if(tls->t_context.premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A10,
+ convert_target_format(target->format, tls->t_context.capabilities) | 0x00010000 | uv_swiz | yuv2rgb));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A10,
+ convert_target_format(target->format, tls->t_context.capabilities) | 0x00010000 | uv_swiz | yuv2rgb | 0x100));
+ }
+ if (target->yuv.uv_planar)
+ { /* Program uv plane address if necessary. */
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A5C, target->yuv.uv_planar));
+ }
+ if (target->yuv.alpha_planar) {
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A5D, target->yuv.alpha_planar));
+ }
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A11, target->address));
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A12, target->stride | tiled));
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+
+ if (tls->t_context.scissor_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A13, (tls->t_context.scissor[0] + tls->t_context.scissor[2]) | ((tls->t_context.scissor[1] + tls->t_context.scissor[3]) << 16)));
+ }
+ else {
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A13, dst_align_width | (target->height << 16)));
+ }
+
+ tls->t_context.rtbuffer = target;
+
+ return error;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+static inline vg_lite_error_t transform_bounding_box(vg_lite_rectangle_t *in_bbx,
+ vg_lite_matrix_t *matrix,
+ vg_lite_rectangle_t *clip,
+ vg_lite_rectangle_t *out_bbx,
+ vg_lite_point_t *origin)
+{
+ vg_lite_point_t temp;
+
+ memset(out_bbx, 0, sizeof(vg_lite_rectangle_t));
+
+ /* Transform image point (x, y). */
+ if (!transform(&temp, in_bbx->x, in_bbx->y, matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+ out_bbx->x = temp.x;
+ out_bbx->y = temp.y;
+
+ /* Provide position of the new origin to the caller if requested. */
+ if (origin != NULL) {
+ origin->x = temp.x;
+ origin->y = temp.y;
+ }
+
+ /* Transform image point (x, y+height). */
+ if (!transform(&temp, in_bbx->x, (in_bbx->y + in_bbx->height), matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+ UPDATE_BOUNDING_BOX(*out_bbx, temp);
+
+ /* Transform image point (x+width, y+height). */
+ if (!transform(&temp, (in_bbx->x + in_bbx->width), (in_bbx->y + in_bbx->height),
+ matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+ UPDATE_BOUNDING_BOX(*out_bbx, temp);
+
+ /* Transform image point (x+width, y). */
+ if (!transform(&temp, (in_bbx->x + in_bbx->width), in_bbx->y, matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+ UPDATE_BOUNDING_BOX(*out_bbx, temp);
+
+ /* Clip is required */
+ if (clip) {
+ out_bbx->x = MAX(out_bbx->x, clip->x);
+ out_bbx->y = MAX(out_bbx->y, clip->y);
+ out_bbx->width = MIN((out_bbx->x + out_bbx->width), (clip->x + clip->width)) - out_bbx->x;
+ out_bbx->height = MIN((out_bbx->y + out_bbx->height), (clip->y + clip->height)) - out_bbx->y;
+ }
+
+ return VG_LITE_SUCCESS;
+}
+
+#if (VG_BLIT_WORKAROUND == 1)
+/*
+ * Calculates the minimal possible target buffer starting from a given target
+ * buffer and considering a source texture (to blit), graphic transformations
+ * and clipping window.
+ */
+static vg_lite_error_t config_new_target(vg_lite_buffer_t *target,
+ vg_lite_buffer_t *source,
+ vg_lite_matrix_t *matrix,
+ vg_lite_rectangle_t *bbx,
+ vg_lite_buffer_t *new_target)
+{
+ uint8_t *p;
+ vg_lite_point_t origin;
+ vg_lite_rectangle_t src_bbx, bounding_box, clip;
+ int tx, ty;
+ uint32_t mul, div, required_align, align;
+
+ /*
+ * Acquire the bounding box of the transformed source image and the location
+ * of its origin.
+ */
+ memset(&src_bbx, 0, sizeof(vg_lite_rectangle_t));
+ src_bbx.width = source->width;
+ src_bbx.height = source->height;
+ if (bbx == NULL) {
+ /*
+ * If no clipping rectangle provided, just configure the clip bounds to
+ * be as big as the target
+ */
+ memset(&clip, 0, sizeof(vg_lite_rectangle_t));
+ clip.width = target->width;
+ clip.height = target->height;
+ } else {
+ /* Otherwise clip according to the bounding box specified by the caller */
+ memcpy(&clip, bbx, sizeof(vg_lite_rectangle_t));
+ }
+ transform_bounding_box(&src_bbx, matrix, &clip, &bounding_box, &origin);
+
+ /* Calculate the data address of the new target */
+ get_format_bytes(target->format, &mul, &div, &required_align);
+ p = target->memory;
+ p += bounding_box.y * target->stride + bounding_box.x * (mul / div);
+ align = (uint32_t)p & (required_align - 1);
+ p -= align;
+
+ /*
+ * Update pixel coordinate of the base address. The width of the target will
+ * increase, since the x coordinate of the bounding box decreases to
+ * accomodate the image data alignment.
+ */
+ tx = align / (mul / div);
+ bounding_box.x -= tx;
+ bounding_box.width += tx;
+
+ /* Update bounding box if provided by the caller */
+ if (bbx) {
+ bbx->x = tx;
+ bbx->y = 0;
+ }
+
+ /* Calculate translation from the source image origin to the target origin. */
+ tx = origin.x - bounding_box.x;
+ ty = origin.y - bounding_box.y;
+
+ /* Copy content of the target buffer descriptor into the new target. */
+ memcpy(new_target, target, sizeof(vg_lite_buffer_t));
+
+ /* Update the new buffer */
+ new_target->memory = p;
+ new_target->address = (uint32_t) p;
+ new_target->width = bounding_box.width;
+ new_target->height = bounding_box.height;
+
+ /* Update matrix */
+ matrix->m[0][2] = tx;
+ matrix->m[1][2] = ty;
+
+ return VG_LITE_SUCCESS;
+}
+#endif /* VG_BLIT_WORKAROUND */
+
+static vg_lite_error_t set_interpolation_steps(vg_lite_buffer_t *target,
+ vg_lite_float_t s_width,
+ vg_lite_float_t s_height,
+ vg_lite_matrix_t *matrix)
+{
+ vg_lite_matrix_t im;
+ vg_lite_rectangle_t src_bbx, bounding_box, clip;
+ vg_lite_float_t xs[3], ys[3], cs[3];
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ float dx = 0.0f, dy = 0.0f;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ #define ERR_LIMIT 0.0000610351562f
+
+ /* Get bounding box. */
+ memset(&src_bbx, 0, sizeof(vg_lite_rectangle_t));
+ memset(&clip, 0, sizeof(vg_lite_rectangle_t));
+ src_bbx.width = (int32_t)s_width;
+ src_bbx.height = (int32_t)s_height;
+
+ if (ctx->scissor_enabled) {
+ clip.x = ctx->scissor[0];
+ clip.y = ctx->scissor[1];
+ clip.width = ctx->scissor[2];
+ clip.height = ctx->scissor[3];
+ } else {
+ clip.x = clip.y = 0;
+ clip.width = ctx->rtbuffer->width;
+ clip.height = ctx->rtbuffer->height;
+ }
+ transform_bounding_box(&src_bbx, matrix, &clip, &bounding_box, NULL);
+
+ /* Compute inverse matrix. */
+ if (!inverse(&im, matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+ /* Compute interpolation steps. */
+ /* X step */
+ xs[0] = im.m[0][0] / s_width;
+ xs[1] = im.m[1][0] / s_height;
+ xs[2] = im.m[2][0];
+ /* Y step */
+ ys[0] = im.m[0][1] / s_width;
+ ys[1] = im.m[1][1] / s_height;
+ ys[2] = im.m[2][1];
+ /* C step 2 */
+ cs[2] = 0.5f * (im.m[2][0] + im.m[2][1]) + im.m[2][2];
+ /* Keep track of the rounding errors (underflow) */
+ if (ctx->chip_id == GPU_CHIP_ID_GCNanoliteV) {
+ /* Check if matrix has rotation or perspective transformations */
+ if (matrix != NULL &&
+ (matrix->m[0][1] != 0.0f || matrix->m[1][0] != 0.0f ||
+ matrix->m[2][0] != 0.0f || matrix->m[2][1] != 0.0f ||
+ matrix->m[2][2] != 1.0f)) {
+ if (xs[0] != 0.0f && -ERR_LIMIT < xs[0] && xs[0] < ERR_LIMIT)
+ dx = 0.5f * (2 * bounding_box.x + bounding_box.width) * im.m[0][0];
+ else if (ys[0] != 0.0f && -ERR_LIMIT < ys[0] && ys[0] < ERR_LIMIT)
+ dx = 0.5f * (2 * bounding_box.y + bounding_box.height) * im.m[0][1];
+ if (xs[1] != 0.0f && -ERR_LIMIT < xs[1] && xs[1] < ERR_LIMIT)
+ dy = 0.5f * (2 * bounding_box.x + bounding_box.width) * im.m[1][0];
+ else if (ys[1] != 0.0f && -ERR_LIMIT < ys[1] && ys[1] < ERR_LIMIT)
+ dy = 0.5f * (2 * bounding_box.y + bounding_box.height) * im.m[1][1];
+ }
+ }
+ /* C step 0, 1*/
+ cs[0] = (0.5f * (im.m[0][0] + im.m[0][1]) + im.m[0][2] + dx) / s_width;
+ cs[1] = (0.5f * (im.m[1][0] + im.m[1][1]) + im.m[1][2] + dy) / s_height;
+ /* Set command buffer */
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A18, (void *)&cs[0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A19, (void *)&cs[1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A1A, (void *)&cs[2]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A1C, (void *)&xs[0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A1D, (void *)&xs[1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A1E, (void *)&xs[2]));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1F, 0x00000001));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A20, (void *)&ys[0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A21, (void *)&ys[1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A22, (void *)&ys[2]));
+
+ return VG_LITE_SUCCESS;
+}
+
+/*************** API Functions ***********************************************/
+vg_lite_error_t vg_lite_get_transform_matrix(vg_lite_point4_t src, vg_lite_point4_t dst,vg_lite_matrix_t *mat)
+{
+ float a[8][8],b[9],A[64];
+ int i, j, k, m = 8, n = 1;
+ int astep = 8,bstep = 1;
+ float d;
+
+ if(src == NULL || dst == NULL || mat == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ for(i = 0; i < 4; ++i )
+ {
+ a[i][0] = a[i+4][3] = src[i].x;
+ a[i][1] = a[i+4][4] = src[i].y;
+ a[i][2] = a[i+4][5] = 1;
+ a[i][3] = a[i][4] = a[i][5] =
+ a[i+4][0] = a[i+4][1] = a[i+4][2] = 0;
+ a[i][6] = -src[i].x*dst[i].x;
+ a[i][7] = -src[i].y*dst[i].x;
+ a[i+4][6] = -src[i].x*dst[i].y;
+ a[i+4][7] = -src[i].y*dst[i].y;
+ b[i] = dst[i].x;
+ b[i+4] = dst[i].y;
+ }
+ for(i = 0; i < 8; ++i )
+ {
+ for(j = 0; j < 8; ++j )
+ {
+ A[8 * i + j] = a[i][j];
+ }
+ }
+
+ for (i = 0; i < m; i++)
+ {
+ k = i;
+ for (j = i + 1; j < m; j++)
+ if (ABS(A[j*astep + i]) > ABS(A[k*astep + i]))
+ k = j;
+ if (ABS(A[k*astep + i]) < EPS)
+ return VG_LITE_INVALID_ARGUMENT;
+ if (k != i)
+ {
+ for (j = i; j < m; j++)
+ swap(&A[i*astep + j], &A[k*astep + j]);
+ for (j = 0; j < n; j++)
+ swap(&b[i*bstep + j], &b[k*bstep + j]);
+ }
+ d = -1 / A[i*astep + i];
+ for (j = i + 1; j < m; j++)
+ {
+ float alpha = A[j*astep + i] * d;
+ for (k = i + 1; k < m; k++)
+ A[j*astep + k] += alpha * A[i*astep + k];
+ for (k = 0; k < n; k++)
+ b[j*bstep + k] += alpha * b[i*bstep + k];
+ }
+ }
+
+ for (i = m - 1; i >= 0; i--)
+ for (j = 0; j < n; j++)
+ {
+ float s = b[i*bstep + j];
+ for (k = i + 1; k < m; k++)
+ s -= A[i*astep + k] * b[k*bstep + j];
+ b[i*bstep + j] = s / A[i*astep + i];
+ }
+ b[8] = 1;
+
+ for(i = 0; i < 3; ++i )
+ {
+ for(j = 0; j < 3; ++j )
+ {
+ mat->m[i][j] = b[i* 3 + j];
+ }
+ }
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_clear(vg_lite_buffer_t * target,
+ vg_lite_rectangle_t * rectangle,
+ vg_lite_color_t color)
+{
+ vg_lite_error_t error;
+ int32_t x, y, width, height;
+ uint32_t color32;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ /* Get rectangle. */
+ x = (rectangle != NULL) ? rectangle->x : 0;
+ y = (rectangle != NULL) ? rectangle->y : 0;
+ width = (rectangle != NULL) ? rectangle->width : ctx->rtbuffer->width;
+ height = (rectangle != NULL) ? rectangle->height : ctx->rtbuffer->height;
+
+ /* Compute the valid rectangle. */
+ if (x < 0)
+ {
+ width += x;
+ x = 0;
+ }
+ if (y < 0)
+ {
+ height += y;
+ y = 0;
+ }
+
+ if (ctx->scissor_enabled)
+ {
+ int right, bottom;
+ right = x + width;
+ bottom = y + height;
+
+ /* Bounds check. */
+ if ((ctx->scissor[0] >= x + width) ||
+ (ctx->scissor[0] + ctx->scissor[2] <= x) ||
+ (ctx->scissor[1] >= y + height) ||
+ (ctx->scissor[1] + ctx->scissor[3] <= y))
+ {
+ /* Do nothing. */
+ return VG_LITE_SUCCESS;
+ }
+ /* Intersects the scissor and the rectangle. */
+ x = (x > ctx->scissor[0] ? x : ctx->scissor[0]);
+ y = (y > ctx->scissor[1] ? y : ctx->scissor[1]);
+ right = (right < ctx->scissor[0] + ctx->scissor[2] ? right : ctx->scissor[0] + ctx->scissor[2]);
+ bottom = (bottom < ctx->scissor[1] + ctx->scissor[3] ? bottom : ctx->scissor[1] + ctx->scissor[3]);
+ width = right - x;
+ height = bottom - y;
+ }
+
+ /* Get converted color when target is in L8 format. */
+ color32 = (target->format == VG_LITE_L8) ? rgb_to_l(color) : color;
+
+#if VG_TARGET_FAST_CLEAR
+ if ((rectangle == NULL) ||
+ ((x == 0) && (y == 0) &&
+ (width == ctx->rtbuffer->width) &&
+ (height == ctx->rtbuffer->height))) {
+ ctx->clearValue = color32;
+ convert_color(ctx->rtbuffer->format, color32, &color32, NULL);
+ clear_fc((uint32_t)color32);
+ }
+ else
+#endif
+ {
+ /* Setup the command buffer. */
+ if(ctx->premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x00000001));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x10000001));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, color32));
+ VG_LITE_RETURN_ERROR(push_rectangle(ctx, x, y, width, height));
+
+ /* Notify rendering area (added by MicroEJ) */
+ vg_lite_draw_notify_render_area(x, y, x + width-1, y + height-1);
+
+ VG_LITE_RETURN_ERROR(flush_target());
+ }
+
+ /* Success. */
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_blit(vg_lite_buffer_t * target,
+ vg_lite_buffer_t * source,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color,
+ vg_lite_filter_t filter)
+{
+ vg_lite_error_t error;
+ vg_lite_rectangle_t src_bbx, bounding_box, clip;
+ uint32_t imageMode;
+ uint32_t blend_mode;
+ uint32_t transparency_mode = 0;
+ vg_lite_blend_t forced_blending = blend;
+ uint32_t conversion = 0;
+ uint32_t tiled_source;
+#if (VG_BLIT_WORKAROUND == 1)
+ vg_lite_matrix_t new_matrix;
+ vg_lite_buffer_t new_target;
+#endif /* VG_BLIT_WORKAROUND */
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ /* Calculate bounding box */
+ memset(&src_bbx, 0, sizeof(vg_lite_rectangle_t));
+ memset(&clip, 0, sizeof(vg_lite_rectangle_t));
+ src_bbx.width = source->width;
+ src_bbx.height = source->height;
+ if (ctx->scissor_enabled) {
+ clip.x = ctx->scissor[0];
+ clip.y = ctx->scissor[1];
+ clip.width = ctx->scissor[2];
+ clip.height = ctx->scissor[3];
+ } else {
+ clip.width = target->width;
+ clip.height = target->height;
+ }
+ transform_bounding_box(&src_bbx, matrix, &clip, &bounding_box, NULL);
+
+ /* Notify rendering area (added by MicroEJ) */
+ vg_lite_draw_notify_render_area(bounding_box.x, bounding_box.y, bounding_box.x + bounding_box.width-1, bounding_box.y + bounding_box.height-1);
+
+#if (VG_BLIT_WORKAROUND==1)
+ /*
+ * The blit output quality workaround works only for afine transformations
+ * because it is based on the process of cumulating translations into the
+ * matrix. This process is not possible for non-affine transformations, such
+ * as the perspective projections.
+ */
+ if ((matrix->m[2][0] == 0) && (matrix->m[2][1] == 0)) {
+ /*
+ * Make a local copy of the transformation matrix in order not to mess
+ * up the user's matrix.
+ */
+ memcpy(&new_matrix, matrix, sizeof(vg_lite_matrix_t));
+ matrix = &new_matrix;
+
+ config_new_target(target, source, matrix, &bounding_box, &new_target);
+ target = &new_target;
+ }
+#endif /* VG_BLIT_WORKAROUND */
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ transparency_mode = (source->transparency_mode == VG_LITE_IMAGE_TRANSPARENT ? 0x8000:0);
+ /* Check if the specified matrix has rotation or perspective. */
+ if ( (matrix != NULL)
+ && ( (matrix->m[0][1] != 0.0f)
+ || (matrix->m[1][0] != 0.0f)
+ || (matrix->m[2][0] != 0.0f)
+ || (matrix->m[2][1] != 0.0f)
+ || (matrix->m[2][2] != 1.0f)
+ )
+ && ( blend == VG_LITE_BLEND_NONE
+ || blend == VG_LITE_BLEND_SRC_IN
+ || blend == VG_LITE_BLEND_DST_IN
+ )
+ ) {
+ if(vg_lite_query_feature(gcFEATURE_BIT_VG_BORDER_CULLING)) {
+ /* Mark that we have rotation. */
+ transparency_mode = 0x8000;
+ }else
+ {
+ blend_mode = VG_LITE_BLEND_SRC_OVER;
+ }
+
+ }
+
+ /* Check whether L8 is supported or not. */
+ if ((target->format == VG_LITE_L8) && ((source->format != VG_LITE_L8) && (source->format != VG_LITE_A8))) {
+ conversion = 0x80000000;
+ }
+
+ /* determine if source specify bytes are aligned */
+ error = _check_source_aligned(source->format,source->stride);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ }
+
+ /* Determine image mode (NORMAL, NONE or MULTIPLY) depending on the color. */
+ imageMode = (source->image_mode == VG_LITE_NONE_IMAGE_MODE) ? 0 : (source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE) ? 0x00002000 : 0x00001000;
+ blend_mode = convert_blend(forced_blending);
+ tiled_source = (source->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0 ;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ /* Setup the command buffer. */
+ if(source->format >= VG_LITE_INDEX_1 && source->format <= VG_LITE_INDEX_8)
+ {
+ /* this task will use index format,set index_flag to 1. */
+ ctx->index_format = 1;
+ switch (source->format) {
+ case VG_LITE_INDEX_8:
+ if(ctx->clut_dirty[3]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0B00, 256, tls->t_context.colors[3]));
+ tls->t_context.clut_dirty[3] = 0;
+ }
+ else
+ {
+ ctx->clut_used[3] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_4:
+ if(ctx->clut_dirty[2]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0AA0, 16, ctx->colors[2]));
+ ctx->clut_dirty[2] = 0;
+ }
+ else
+ {
+ ctx->clut_used[2] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_2:
+ if(ctx->clut_dirty[1]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0A9C, 4, ctx->colors[1]));
+ ctx->clut_dirty[1] = 0;
+ }
+ else
+ {
+ ctx->clut_used[1] = 1;
+ }
+ break;
+
+ default:
+ if(ctx->clut_dirty[0]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0A98, 2, ctx->colors[0]));
+ ctx->clut_dirty[0] = 0;
+ }
+ else
+ {
+ ctx->clut_used[0] = 1;
+ }
+ }
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x10000001 | imageMode | blend_mode | transparency_mode));
+ } else {
+ /* enable pre-multiplied from VG to VGPE */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x00000001 | imageMode | blend_mode | transparency_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, color));
+ VG_LITE_RETURN_ERROR(set_interpolation_steps(target, source->width, source->height, matrix));
+
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ if(source->transparency_mode == VG_LITE_IMAGE_OPAQUE){
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion | 0x01000100));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion | 0x00000100));
+ }
+ } else {
+ /* enable pre-multiplied in imager unit */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion));
+ }
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A27, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A29, source->address));
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2B, source->stride | tiled_source));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2D, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2F, source->width | (source->height << 16)));
+ VG_LITE_RETURN_ERROR(push_rectangle(ctx, bounding_box.x, bounding_box.y, bounding_box.width,
+ bounding_box.height));
+
+ error = flush_target();
+ vglitemDUMP_BUFFER("image", source->address, source->memory, 0, (source->stride)*(source->height));
+
+#if DUMP_IMAGE
+ dump_img(source->memory, source->width, source->height, source->format);
+#endif
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_blit_rect(vg_lite_buffer_t * target,
+ vg_lite_buffer_t * source,
+ uint32_t * rect,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color,
+ vg_lite_filter_t filter)
+{
+ vg_lite_error_t error;
+ vg_lite_rectangle_t src_bbx, bounding_box, clip;
+ uint32_t imageMode;
+ uint32_t transparency_mode = 0;
+ uint32_t blend_mode;
+ vg_lite_blend_t forced_blending = blend;
+ uint32_t conversion = 0;
+ uint32_t tiled_source;
+ uint32_t rect_x = 0, rect_y = 0, rect_w = 0, rect_h = 0;
+ int32_t src_align_width;
+ uint32_t mul, div, align;
+#if (VG_BLIT_WORKAROUND == 1)
+ vg_lite_matrix_t new_matrix;
+ vg_lite_buffer_t new_target;
+#endif /* VG_BLIT_WORKAROUND */
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ transparency_mode = (source->transparency_mode == VG_LITE_IMAGE_TRANSPARENT ? 0x8000:0);
+ /* Check if the specified matrix has rotation or perspective. */
+ if ( (matrix != NULL)
+ && ( (matrix->m[0][1] != 0.0f)
+ || (matrix->m[1][0] != 0.0f)
+ || (matrix->m[2][0] != 0.0f)
+ || (matrix->m[2][1] != 0.0f)
+ || (matrix->m[2][2] != 1.0f)
+ )
+ && ( blend == VG_LITE_BLEND_NONE
+ || blend == VG_LITE_BLEND_SRC_IN
+ || blend == VG_LITE_BLEND_DST_IN
+ )
+ ) {
+ if(vg_lite_query_feature(gcFEATURE_BIT_VG_BORDER_CULLING)) {
+ /* Mark that we have rotation. */
+ transparency_mode = 0x8000;
+ }else
+ {
+ blend_mode = VG_LITE_BLEND_SRC_OVER;
+ }
+
+ }
+
+ /* Check whether L8 is supported or not. */
+ if ((target->format == VG_LITE_L8) && ((source->format != VG_LITE_L8) && (source->format != VG_LITE_A8))) {
+ conversion = 0x80000000;
+ }
+
+ /* determine if source specify bytes are aligned */
+ error = _check_source_aligned(source->format,source->stride);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ }
+ get_format_bytes(source->format, &mul, &div, &align);
+ src_align_width = source->stride * div / mul;
+ memset(&src_bbx, 0, sizeof(vg_lite_rectangle_t));
+ /* Set source region. */
+ if (rect != NULL) {
+ rect_x = rect[0];
+ rect_y = rect[1];
+ rect_w = rect[2];
+ rect_h = rect[3];
+
+ if ((rect_x > (uint32_t)src_align_width) || (rect_y > (uint32_t)source->height) ||
+ (rect_w == 0) || (rect_h == 0))
+ {
+ /*No intersection*/
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ if (rect_x + rect_w > (uint32_t)src_align_width)
+ {
+ rect_w = src_align_width - rect_x;
+ }
+
+ if (rect_y + rect_h > (uint32_t)source->height)
+ {
+ rect_h = source->height - rect_y;
+ }
+
+ src_bbx.width = rect_w;
+ src_bbx.height = rect_h;
+ }
+ else {
+ rect_x = rect_y = 0;
+ rect_w = src_bbx.width = src_align_width;
+ rect_h = src_bbx.height = source->height;
+ }
+
+ /* Calculate bounding box. */
+ memset(&clip, 0, sizeof(vg_lite_rectangle_t));
+ if (ctx->scissor_enabled) {
+ clip.x = ctx->scissor[0];
+ clip.y = ctx->scissor[1];
+ clip.width = ctx->scissor[2];
+ clip.height = ctx->scissor[3];
+ } else {
+ clip.x = clip.y = 0;
+ clip.width = target->width;
+ clip.height = target->height;
+ }
+ transform_bounding_box(&src_bbx, matrix, &clip, &bounding_box, NULL);
+
+ /* Notify rendering area (added by MicroEJ) */
+ vg_lite_draw_notify_render_area(bounding_box.x, bounding_box.y, bounding_box.x + bounding_box.width-1, bounding_box.y + bounding_box.height-1);
+
+#if (VG_BLIT_WORKAROUND==1)
+ /*
+ * The blit output quality workaround works only for afine transformations
+ * because it is based on the process of cumulating translations into the
+ * matrix. This process is not possible for non-affine transformations, such
+ * as the perspective projections.
+ */
+ if ((matrix->m[2][0] == 0) && (matrix->m[2][1] == 0)) {
+ /*
+ * Make a local copy of the transformation matrix in order not to mess
+ * up the user's matrix.
+ */
+ memcpy(&new_matrix, matrix, sizeof(vg_lite_matrix_t));
+ matrix = &new_matrix;
+
+ config_new_target(target, source, matrix, &bounding_box, &new_target);
+ target = &new_target;
+ }
+#endif /* VG_BLIT_WORKAROUND */
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ /* Determine image mode (NORMAL, NONE or MULTIPLY) depending on the color. */
+ imageMode = (source->image_mode == VG_LITE_NONE_IMAGE_MODE) ? 0 : (source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE) ? 0x00002000 : 0x00001000;
+ blend_mode = convert_blend(forced_blending);
+ tiled_source = (source->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0 ;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ /* Setup the command buffer. */
+ if(source->format >= VG_LITE_INDEX_1 && source->format <= VG_LITE_INDEX_8)
+ {
+ /* this task will use index format,set index_flag to 1. */
+ ctx->index_format = 1;
+ switch (source->format) {
+ case VG_LITE_INDEX_8:
+ if(tls->t_context.clut_dirty[3]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0B00, 256, ctx->colors[3]));
+ ctx->clut_dirty[3] = 0;
+ }
+ else
+ {
+ tls->t_context.clut_used[3] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_4:
+ if(tls->t_context.clut_dirty[2]){
+ VG_LITE_RETURN_ERROR(push_states(&tls->t_context, 0x0AA0, 16, tls->t_context.colors[2]));
+ tls->t_context.clut_dirty[2] = 0;
+ }
+ else
+ {
+ tls->t_context.clut_used[2] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_2:
+ if(tls->t_context.clut_dirty[1]){
+ VG_LITE_RETURN_ERROR(push_states(&tls->t_context, 0x0A9C, 4, tls->t_context.colors[1]));
+ tls->t_context.clut_dirty[1] = 0;
+ }
+ else
+ {
+ tls->t_context.clut_used[1] = 1;
+ }
+ break;
+
+ default:
+ if(tls->t_context.clut_dirty[0]){
+ VG_LITE_RETURN_ERROR(push_states(&tls->t_context, 0x0A98, 2, tls->t_context.colors[0]));
+ tls->t_context.clut_dirty[0] = 0;
+ }
+ else
+ {
+ tls->t_context.clut_used[0] = 1;
+ }
+ }
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x10000001 | imageMode | blend_mode | transparency_mode));
+ } else {
+ /* enable pre-multiplied from VG to VGPE */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x00000001 | imageMode | blend_mode | transparency_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, color));
+
+ VG_LITE_RETURN_ERROR(set_interpolation_steps(target, rect_w, rect_h, matrix));
+
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ if(source->transparency_mode == VG_LITE_IMAGE_OPAQUE){
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion | 0x01000100));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion | 0x00000100));
+ }
+ } else {
+ /* enable pre-multiplied in imager unit */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) | filter | conversion));
+ }
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A27, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A29, source->address));
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2B, source->stride | tiled_source));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2D, rect_x | (rect_y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2F, rect_w | (rect_h << 16)));
+ VG_LITE_RETURN_ERROR(push_rectangle(ctx, bounding_box.x, bounding_box.y, bounding_box.width,
+ bounding_box.height));
+ error = flush_target();
+
+ vglitemDUMP_BUFFER("image", source->address, source->memory, 0, (source->stride)*(source->height));
+#if DUMP_IMAGE
+ dump_img(source->memory, src_align_width, source->height, source->format);
+#endif
+
+ return error;
+}
+
+/* Program initial states for tessellation buffer. */
+static vg_lite_error_t program_tessellation(vg_lite_context_t *context)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t tessellation_size;
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ uint32_t offset;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ tessellation_size = ( context->tsbuffer.tessellation_buffer_size[2]
+ ? context->tsbuffer.tessellation_buffer_size[2]
+ : context->tsbuffer.tessellation_buffer_size[1]
+ );
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ offset = CMDBUF_OFFSET(*context);
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ /* Since TS buffer won't change during runtime, we program it here in initialization. */
+ /* Program tessellation buffer: input for VG module. */
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A30, context->tsbuffer.tessellation_buffer_gpu[0])); /* Tessellation buffer address. */
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A31, context->tsbuffer.tessellation_buffer_gpu[1])); /* L1 address of tessellation buffer. */
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A32, context->tsbuffer.tessellation_buffer_gpu[2])); /* L2 address of tessellation buffer. */
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A33, context->tsbuffer.tessellation_stride));
+ /* Program tessellation control: for TS module. */
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A35, context->tsbuffer.tessellation_buffer_gpu[0]));
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A36, context->tsbuffer.tessellation_buffer_gpu[1]));
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A37, context->tsbuffer.tessellation_buffer_gpu[2]));
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A38, context->tsbuffer.tessellation_stride));
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A3A, context->tsbuffer.tessellation_width_height));
+
+ VG_LITE_RETURN_ERROR(push_state(context, 0x0A3D, tessellation_size / 64));
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ /* Backup tessellation buffer states. */
+ context->ts_init_used = 0;
+ context->ts_init_use = 0;
+ context->ts_dirty = 1;
+ memcpy(context->ts_record, (CMDBUF_BUFFER(*context) + offset), 80);
+ CMDBUF_OFFSET(*context) = 0;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ return error;
+}
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_error_t vg_lite_init(int32_t tessellation_width,
+ int32_t tessellation_height)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_initialize_t initialize;
+
+ s_context.rtbuffer = (vg_lite_buffer_t *)malloc(sizeof(vg_lite_buffer_t));
+ if(!s_context.rtbuffer)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(s_context.rtbuffer, 0, sizeof(vg_lite_buffer_t));
+
+ if (tessellation_width <= 0) {
+ tessellation_width = 0;
+ tessellation_height = 0;
+ }
+ if (tessellation_height <= 0) {
+ tessellation_height = 0;
+ tessellation_width = 0;
+ }
+ tessellation_width = VG_LITE_ALIGN(tessellation_width, 16);
+
+#if VG_TARGET_FAST_CLEAR
+ vg_lite_get_product_info(NULL,&s_context.chip_id,&s_context.chip_rev);
+ vg_lite_get_register(0x30, &cid);
+ if(s_context.chip_id == 0x255 && s_context.chip_rev == 0x1311 && cid == 0x404)
+ {
+ tessellation_width = 64;
+ tessellation_height = 64;
+ }
+#endif
+
+ /* Allocate a command buffer and a tessellation buffer. */
+ initialize.command_buffer_size = command_buffer_size;
+ initialize.tessellation_width = tessellation_width;
+ initialize.tessellation_height = tessellation_height;
+ initialize.context = &s_context.context;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_INITIALIZE, &initialize));
+
+ /* Save draw context. */
+ s_context.capabilities = initialize.capabilities;
+ s_context.command_buffer[0] = (uint8_t *)initialize.command_buffer[0];
+ s_context.command_buffer[1] = (uint8_t *)initialize.command_buffer[1];
+ s_context.command_buffer_size = initialize.command_buffer_size;
+ s_context.command_offset[0] = 0;
+ s_context.command_offset[1] = 0;
+
+ if ((tessellation_width > 0) &&
+ (tessellation_height > 0))
+ {
+ /* Set and Program Tessellation Buffer states. */
+ s_context.tsbuffer.tessellation_buffer_gpu[0] = initialize.tessellation_buffer_gpu[0];
+ s_context.tsbuffer.tessellation_buffer_gpu[1] = initialize.tessellation_buffer_gpu[1];
+ s_context.tsbuffer.tessellation_buffer_gpu[2] = initialize.tessellation_buffer_gpu[2];
+ s_context.tsbuffer.tessellation_buffer_logic[0] = initialize.tessellation_buffer_logic[0];
+ s_context.tsbuffer.tessellation_buffer_logic[1] = initialize.tessellation_buffer_logic[1];
+ s_context.tsbuffer.tessellation_buffer_logic[2] = initialize.tessellation_buffer_logic[2];
+ s_context.tsbuffer.tessellation_stride = initialize.tessellation_stride;
+ s_context.tsbuffer.tessellation_width_height = initialize.tessellation_width_height;
+ s_context.tsbuffer.tessellation_buffer_size[0] = initialize.tessellation_buffer_size[0];
+ s_context.tsbuffer.tessellation_buffer_size[1] = initialize.tessellation_buffer_size[1];
+ s_context.tsbuffer.tessellation_buffer_size[2] = initialize.tessellation_buffer_size[2];
+ s_context.tsbuffer.tessellation_shift = initialize.tessellation_shift;
+
+ VG_LITE_RETURN_ERROR(program_tessellation(&s_context));
+ }
+
+ /* Fill feature table. */
+ if (!s_context.s_ftable.ftflag){
+ VG_LITE_RETURN_ERROR(fill_feature_table(s_context.s_ftable.ftable));
+ }
+
+#if VG_TARGET_FAST_CLEAR
+ /* Reset the FAST_CLEAR buffer. */
+ memset(&s_context.fcBuffer, 0, sizeof(s_context.fcBuffer));
+ s_context.fcBuffer.format = VG_LITE_A8;
+ s_context.fcBuffer.height = 1;
+ s_context.clearValue = 0;
+#endif
+
+ /* Init scissor rect. */
+ s_context.scissor[0] =
+ s_context.scissor[1] =
+ s_context.scissor[2] =
+ s_context.scissor[3] = 0;
+#if DUMP_CAPTURE
+ _SetDumpFileInfo();
+#endif
+
+#if (VG_RENDER_TEXT==1)
+ vg_lite_text_init();
+#endif /* VG_RENDER_TEXT */
+
+ return VG_LITE_SUCCESS;
+}
+#else
+vg_lite_error_t vg_lite_init(int32_t tessellation_width,
+ int32_t tessellation_height)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_initialize_t initialize;
+ vg_lite_tls_t* task_tls;
+
+ task_tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(task_tls)
+ return VG_LITE_SUCCESS;
+
+ task_tls = (vg_lite_tls_t *) vg_lite_os_malloc(sizeof(vg_lite_tls_t));
+ if(!task_tls)
+ return VG_LITE_OUT_OF_RESOURCES;
+ memset(task_tls,0,sizeof(vg_lite_tls_t));
+ error = (vg_lite_error_t)vg_lite_os_set_tls((void *) task_tls);
+ if(error != VG_LITE_SUCCESS)
+ return error;
+
+ task_tls->t_context.rtbuffer = NULL;
+
+ if (tessellation_width <= 0) {
+ tessellation_width = 0;
+ tessellation_height = 0;
+ }
+ if (tessellation_height <= 0) {
+ tessellation_height = 0;
+ tessellation_width = 0;
+ }
+ tessellation_width = VG_LITE_ALIGN(tessellation_width, 16);
+
+ /* Allocate a command buffer and a tessellation buffer. */
+ initialize.command_buffer_size = command_buffer_size;
+ initialize.context_buffer_size = CONTEXT_BUFFER_SIZE;
+ initialize.tessellation_width = tessellation_width;
+ initialize.tessellation_height = tessellation_height;
+ initialize.context = &task_tls->t_context.context;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_INITIALIZE, &initialize));
+
+ /* Save draw context. */
+ task_tls->t_context.capabilities = initialize.capabilities;
+ task_tls->t_context.command_buffer[0] = (uint8_t *)initialize.command_buffer[0];
+ task_tls->t_context.command_buffer[1] = (uint8_t *)initialize.command_buffer[1];
+ task_tls->t_context.command_buffer_size = initialize.command_buffer_size;
+ task_tls->t_context.command_offset[0] = 0;
+ task_tls->t_context.command_offset[1] = 0;
+ task_tls->t_context.command_buffer_current = 0;
+ task_tls->t_context.context_buffer[0] = (uint8_t *)initialize.context_buffer[0];
+ task_tls->t_context.context_buffer[1] = (uint8_t *)initialize.context_buffer[1];
+ task_tls->t_context.context_buffer_size = initialize.context_buffer_size;
+ task_tls->t_context.context_buffer_offset[0] = 0;
+ task_tls->t_context.context_buffer_offset[1] = 0;
+ task_tls->t_context.start_offset = 0;
+ task_tls->t_context.end_offset = 0;
+ task_tls->t_context.ts_init = 0;
+ memset(task_tls->t_context.ts_record, 0, sizeof(task_tls->t_context.ts_record));
+
+ if ((tessellation_width > 0) &&
+ (tessellation_height > 0))
+ {
+ /* Set and Program Tessellation Buffer states. */
+ task_tls->t_context.tsbuffer.tessellation_buffer_gpu[0] = initialize.tessellation_buffer_gpu[0];
+ task_tls->t_context.tsbuffer.tessellation_buffer_gpu[1] = initialize.tessellation_buffer_gpu[1];
+ task_tls->t_context.tsbuffer.tessellation_buffer_gpu[2] = initialize.tessellation_buffer_gpu[2];
+ task_tls->t_context.tsbuffer.tessellation_buffer_logic[0] = initialize.tessellation_buffer_logic[0];
+ task_tls->t_context.tsbuffer.tessellation_buffer_logic[1] = initialize.tessellation_buffer_logic[1];
+ task_tls->t_context.tsbuffer.tessellation_buffer_logic[2] = initialize.tessellation_buffer_logic[2];
+ task_tls->t_context.tsbuffer.tessellation_stride = initialize.tessellation_stride;
+ task_tls->t_context.tsbuffer.tessellation_width_height = initialize.tessellation_width_height;
+ task_tls->t_context.tsbuffer.tessellation_buffer_size[0] = initialize.tessellation_buffer_size[0];
+ task_tls->t_context.tsbuffer.tessellation_buffer_size[1] = initialize.tessellation_buffer_size[1];
+ task_tls->t_context.tsbuffer.tessellation_buffer_size[2] = initialize.tessellation_buffer_size[2];
+ task_tls->t_context.tsbuffer.tessellation_shift = initialize.tessellation_shift;
+
+ VG_LITE_RETURN_ERROR(program_tessellation(&task_tls->t_context));
+ }
+
+ VG_LITE_RETURN_ERROR(push_state(&task_tls->t_context, 0x0A00, 0x0));
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_LOCK, NULL));
+ /* Fill feature table. */
+ if (!task_tls->t_context.s_ftable.ftflag){
+ VG_LITE_RETURN_ERROR(fill_feature_table(task_tls->t_context.s_ftable.ftable));
+ }
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_UNLOCK, NULL));
+
+#if VG_TARGET_FAST_CLEAR
+ /* Reset the FAST_CLEAR buffer. */
+ memset(&task_tls->t_context.fcBuffer, 0, sizeof(task_tls->t_context.fcBuffer));
+ task_tls->t_context.fcBuffer.format = VG_LITE_A8;
+ task_tls->t_context.fcBuffer.height = 1;
+ task_tls->t_context.clearValue = 0;
+#endif
+
+ /* Init scissor rect. */
+ task_tls->t_context.scissor[0] =
+ task_tls->t_context.scissor[1] =
+ task_tls->t_context.scissor[2] =
+ task_tls->t_context.scissor[3] = 0;
+#if DUMP_CAPTURE
+ _SetDumpFileInfo();
+#endif
+
+#if (VG_RENDER_TEXT==1)
+ vg_lite_text_init();
+#endif /* VG_RENDER_TEXT */
+
+ return VG_LITE_SUCCESS;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+vg_lite_error_t vg_lite_set_draw_path_type(vg_lite_path_t * path,vg_lite_draw_path_type_t path_type)
+{
+ if(!path || (path_type > VG_LITE_DRAW_STROKE_PATH + 1))
+ return VG_LITE_INVALID_ARGUMENT;
+
+ path->path_type = path_type;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_draw(vg_lite_buffer_t * target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_blend_t blend,
+ vg_lite_color_t color)
+{
+ uint32_t blend_mode;
+ uint32_t format, quality, tiling, fill;
+ uint32_t tessellation_size;
+ vg_lite_error_t error;
+ vg_lite_point_t point_min = {0}, point_max = {0}, temp = {0};
+ int x, y, width, height;
+ uint8_t ts_is_fullscreen = 0;
+#if DUMP_COMMAND
+ uint32_t return_offset = 0;
+ vg_lite_kernel_allocate_t memory;
+#endif
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!path->path_length)
+ return VG_LITE_SUCCESS;
+
+ if(!path->path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_QUALITY_8X) && path->quality == VG_LITE_UPPER){
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ width = ctx->tsbuffer.tessellation_width_height & 0xFFFF;
+ height = ctx->tsbuffer.tessellation_width_height >> 16;
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+ if(width == 0 || height == 0)
+ return VG_LITE_NO_CONTEXT;
+ if ((dst_align_width <= width) && (target->height <= height))
+ {
+ ts_is_fullscreen = 1;
+ point_min.x = 0;
+ point_min.y = 0;
+ point_max.x = dst_align_width;
+ point_max.y = target->height;
+ }
+
+ if (ts_is_fullscreen == 0){
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[1], matrix);
+ point_min = point_max = temp;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[1], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ if (point_min.x < 0) point_min.x = 0;
+ if (point_min.y < 0) point_min.y = 0;
+ if (point_max.x > dst_align_width) point_max.x = dst_align_width;
+ if (point_max.y > target->height) point_max.y = target->height;
+ }
+
+ if (ctx->scissor_enabled) {
+ point_min.x = MAX(point_min.x, ctx->scissor[0]);
+ point_min.y = MAX(point_min.y, ctx->scissor[1]);
+ point_max.x = MIN(point_max.x, ctx->scissor[0] + ctx->scissor[2]);
+ point_max.y = MIN(point_max.y, ctx->scissor[1] + ctx->scissor[3]);
+ }
+
+ /* Convert states into hardware values. */
+ blend_mode = convert_blend(blend);
+ format = convert_path_format(path->format);
+ quality = convert_path_quality(path->quality);
+ tiling = (ctx->capabilities.cap.tiled == 2) ? 0x2000000 : 0;
+ fill = (fill_rule == VG_LITE_FILL_EVEN_ODD) ? 0x10 : 0;
+ tessellation_size = ( ctx->tsbuffer.tessellation_buffer_size[2]
+ ? ctx->tsbuffer.tessellation_buffer_size[2]
+ : ctx->tsbuffer.tessellation_buffer_size[1]
+ );
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ if(ctx->ts_dirty){
+ memcpy(CMDBUF_BUFFER(*ctx) + CMDBUF_OFFSET(*ctx), ctx->ts_record, 80);
+ CMDBUF_OFFSET(*ctx) += 80;
+ ctx->ts_dirty = 0;
+ ctx->ts_init_used = 1;
+ }
+ else
+ {
+ ctx->ts_init_use = 1;
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ /* Setup the command buffer. */
+ /* Program color register. */
+ if(ctx->premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, ctx->capabilities.cap.tiled | blend_mode));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x10000000 | ctx->capabilities.cap.tiled | blend_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, color));
+ /* Program tessellation control: for TS module. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000200 | format | quality | tiling | fill));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3B, 0x3F800000)); /* Path tessellation SCALE. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3C, 0x00000000)); /* Path tessellation BIAS. */
+ /* Program matrix. */
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A40, (void *) &matrix->m[0][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A41, (void *) &matrix->m[0][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A42, (void *) &matrix->m[0][2]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A43, (void *) &matrix->m[1][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A44, (void *) &matrix->m[1][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A45, (void *) &matrix->m[1][2]));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ vglitemDUMP_BUFFER("path", path->uploaded.address, (uint8_t *)(path->uploaded.memory), 0, path->uploaded.bytes);
+ }
+ vglitemDUMP("@[memory 0x%08X 0x%08X]", ctx->tsbuffer.tessellation_buffer_gpu[0], ctx->tsbuffer.tessellation_buffer_size[0]);
+ /* Setup tessellation loop. */
+ if((path->path_type & 0x1) == VG_LITE_DRAW_FILL_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ push_data(ctx, path->path_length, path->path);
+ }
+ }
+ }
+ }
+ /* Setup tessellation loop. */
+ if(path->path_type == VG_LITE_DRAW_STROKE_PATH || path->path_type == VG_LITE_DRAW_FILL_STROKE_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ format = convert_path_format(VG_LITE_FP32);
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000200 | format | quality | tiling | 0x0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, path->stroke_color));
+ push_data(ctx, path->stroke_path_size, path->stroke_path_data);
+ }
+ }
+ }
+ }
+
+ /* Finialize command buffer. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0));
+
+ /* Notify rendering area (added by MicroEJ) */
+ vg_lite_draw_notify_render_area(point_min.x, point_min.y, point_max.x, point_max.y);
+
+ VG_LITE_RETURN_ERROR(flush_target());
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ ctx->ts_init = 1;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+ return error;
+}
+
+vg_lite_error_t vg_lite_close(void)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_terminate_t terminate;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+#if VG_TARGET_FAST_CLEAR
+ if (ctx->fcBuffer.handle != NULL) {
+ vg_lite_free(&ctx->fcBuffer);
+ }
+#endif
+
+ /* Termnate the draw context. */
+ terminate.context = &ctx->context;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_TERMINATE, &terminate));
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ if(ctx->rtbuffer)
+ free(ctx->rtbuffer);
+
+ submit_flag = 0;
+
+ /* Reset the draw context. */
+ _memset(ctx, 0, sizeof(s_context));
+
+ /* Reset the s_ftable. */
+ _memset(&ctx->s_ftable, 0, sizeof(ctx->s_ftable));
+
+ ctx->init = 0;
+#else
+ /* Reset the draw context. */
+ free(ctx->colors[0]);
+ free(ctx->colors[1]);
+ free(ctx->colors[2]);
+ free(ctx->colors[3]);
+
+ _memset(ctx, 0, sizeof(*ctx));
+
+ vg_lite_os_reset_tls();
+ vg_lite_os_free((void *) tls);
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+#if DUMP_CAPTURE
+ _SetDumpFileInfo();
+#endif
+
+ return VG_LITE_SUCCESS;
+}
+
+/* Handle tiled & yuv allocation. Currently including NV12, ANV12, YV12, YV16, NV16, YV24. */
+static vg_lite_error_t _allocate_tiled_yuv_planar(vg_lite_buffer_t *buffer)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t yplane_size = 0;
+ vg_lite_kernel_allocate_t allocate, uv_allocate, v_allocate;
+
+ if ((buffer->format < VG_LITE_NV12) || (buffer->format > VG_LITE_ANV12_TILED)
+ || (buffer->format == VG_LITE_AYUY2) || (buffer->format == VG_LITE_YUY2_TILED))
+ {
+ return error;
+ }
+
+ /* For NV12, there are 2 planes (Y, UV);
+ For ANV12, there are 3 planes (Y, UV, Alpha).
+ Each plane must be aligned by (4, 8).
+ Then Y plane must be aligned by (8, 8).
+ For YVxx, there are 3 planes (Y, U, V).
+ YV12 is similar to NV12, both YUV420 format.
+ YV16 and NV16 are YUV422 format.
+ YV24 is YUV444 format.
+ */
+ buffer->width = VG_LITE_ALIGN(buffer->width, 8);
+ buffer->height = VG_LITE_ALIGN(buffer->height, 8);
+ buffer->stride = VG_LITE_ALIGN(buffer->width, 128);
+
+ switch (buffer->format) {
+ case VG_LITE_NV12:
+ case VG_LITE_ANV12:
+ case VG_LITE_NV12_TILED:
+ case VG_LITE_ANV12_TILED:
+ buffer->yuv.uv_stride = buffer->stride;
+ buffer->yuv.alpha_stride = buffer->stride;
+ buffer->yuv.uv_height = buffer->height / 2;
+ break;
+
+ case VG_LITE_NV16:
+ buffer->yuv.uv_stride = buffer->stride;
+ buffer->yuv.uv_height = buffer->height;
+ break;
+
+ case VG_LITE_YV12:
+ buffer->yuv.uv_stride =
+ buffer->yuv.v_stride = buffer->stride / 2;
+ buffer->yuv.uv_height =
+ buffer->yuv.v_height = buffer->height / 2;
+ break;
+
+ case VG_LITE_YV16:
+ buffer->yuv.uv_stride =
+ buffer->yuv.v_stride = buffer->stride;
+ buffer->yuv.uv_height =
+ buffer->yuv.v_height = buffer->height / 2;
+ break;
+
+ case VG_LITE_YV24:
+ buffer->yuv.uv_stride =
+ buffer->yuv.v_stride = buffer->stride;
+ buffer->yuv.uv_height =
+ buffer->yuv.v_height = buffer->height;
+ break;
+
+ default:
+ return error;
+ }
+
+ yplane_size = buffer->stride * buffer->height;
+
+ /* Allocate buffer memory: Y. */
+ allocate.bytes = yplane_size;
+ allocate.contiguous = 1;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+
+ /* Save the allocation. */
+ buffer->handle = allocate.memory_handle;
+ buffer->memory = allocate.memory;
+ buffer->address = allocate.memory_gpu;
+
+ if ((buffer->format == VG_LITE_NV12) || (buffer->format == VG_LITE_ANV12)
+ || (buffer->format == VG_LITE_NV16) || (buffer->format == VG_LITE_NV12_TILED)
+ || (buffer->format == VG_LITE_ANV12_TILED)) {
+ /* Allocate buffer memory: UV. */
+ uv_allocate.bytes = buffer->yuv.uv_stride * buffer->yuv.uv_height;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &uv_allocate));
+ buffer->yuv.uv_handle = uv_allocate.memory_handle;
+ buffer->yuv.uv_memory = uv_allocate.memory;
+ buffer->yuv.uv_planar = uv_allocate.memory_gpu;
+
+ if ((buffer->format == VG_LITE_ANV12) || (buffer->format == VG_LITE_ANV12_TILED)) {
+ uv_allocate.bytes = yplane_size;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &uv_allocate));
+ buffer->yuv.alpha_planar = uv_allocate.memory_gpu;
+ }
+ } else {
+ /* Allocate buffer memory: U, V. */
+ uv_allocate.bytes = buffer->yuv.uv_stride * buffer->yuv.uv_height;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &uv_allocate));
+ buffer->yuv.uv_handle = uv_allocate.memory_handle;
+ buffer->yuv.uv_memory = uv_allocate.memory;
+ buffer->yuv.uv_planar = uv_allocate.memory_gpu;
+
+ v_allocate.bytes = buffer->yuv.v_stride * buffer->yuv.v_height;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &v_allocate));
+ buffer->yuv.v_handle = v_allocate.memory_handle;
+ buffer->yuv.v_memory = v_allocate.memory;
+ buffer->yuv.v_planar = v_allocate.memory_gpu;
+ }
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_allocate(vg_lite_buffer_t * buffer)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_kernel_allocate_t allocate;
+
+ /* Reset planar. */
+ buffer->yuv.uv_planar =
+ buffer->yuv.v_planar =
+ buffer->yuv.alpha_planar = 0;
+
+ /* Align height in case format is tiled. */
+ if (buffer->format >= VG_LITE_YUY2 && buffer->format <= VG_LITE_NV16) {
+ buffer->height = VG_LITE_ALIGN(buffer->height, 4);
+ buffer->yuv.swizzle = VG_LITE_SWIZZLE_UV;
+ }
+
+ if (buffer->format >= VG_LITE_YUY2_TILED && buffer->format <= VG_LITE_AYUY2_TILED) {
+ buffer->height = VG_LITE_ALIGN(buffer->height, 4);
+ buffer->tiled = VG_LITE_TILED;
+ buffer->yuv.swizzle = VG_LITE_SWIZZLE_UV;
+ }
+
+ if ((buffer->format >= VG_LITE_NV12 && buffer->format <= VG_LITE_ANV12_TILED
+ && buffer->format != VG_LITE_AYUY2 && buffer->format != VG_LITE_YUY2_TILED)) {
+ _allocate_tiled_yuv_planar(buffer);
+ }
+ else {
+ /* Driver need compute the stride always with RT500 project. */
+ uint32_t mul, div, align;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ get_format_bytes(buffer->format, &mul, &div, &align);
+ vg_lite_get_product_info(NULL,&ctx->chip_id,NULL);
+ buffer->stride = VG_LITE_ALIGN((buffer->width * mul / div), align);
+ /* Allocate the buffer. */
+ allocate.bytes = buffer->stride * buffer->height;
+#if VG_TARGET_FAST_CLEAR
+ allocate.bytes = VG_LITE_ALIGN(allocate.bytes, 64);
+#endif
+ allocate.contiguous = 1;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+
+ /* Save the buffer allocation. */
+ buffer->handle = allocate.memory_handle;
+ buffer->memory = allocate.memory;
+ buffer->address = allocate.memory_gpu;
+
+ if ((buffer->format == VG_LITE_AYUY2) || (buffer->format == VG_LITE_AYUY2_TILED)) {
+ allocate.bytes = buffer->stride * buffer->height;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &allocate));
+ buffer->yuv.alpha_planar = allocate.memory_gpu;
+ }
+
+ }
+
+ return VG_LITE_SUCCESS;
+}
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_error_t vg_lite_free(vg_lite_buffer_t * buffer)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_free_t free, uv_free, v_free;
+
+ if(buffer == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+ if (!(memcmp(s_context.rtbuffer,buffer,sizeof(vg_lite_buffer_t))) ) {
+ if (VG_LITE_SUCCESS == submit(&s_context)) {
+ VG_LITE_RETURN_ERROR(stall(&s_context, 0, ~0));
+ }
+ vglitemDUMP("@[swap 0x%08X %dx%d +%u]",
+ s_context.rtbuffer->address,
+ s_context.rtbuffer->width, s_context.rtbuffer->height,
+ s_context.rtbuffer->stride);
+ vglitemDUMP_BUFFER(
+ "framebuffer",
+ s_context.rtbuffer->address,s_context.rtbuffer->memory,
+ 0,
+ s_context.rtbuffer->stride*(s_context.rtbuffer->height));
+
+ memset(s_context.rtbuffer, 0, sizeof(vg_lite_buffer_t));
+ }
+
+ if (buffer->yuv.uv_planar) {
+ /* Free UV(U) planar buffer. */
+ uv_free.memory_handle = buffer->yuv.uv_handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &uv_free));
+
+ /* Mark the buffer as freed. */
+ buffer->yuv.uv_handle = NULL;
+ buffer->yuv.uv_memory = NULL;
+ }
+
+ if (buffer->yuv.v_planar) {
+ /* Free V planar buffer. */
+ v_free.memory_handle = buffer->yuv.v_handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &v_free));
+
+ /* Mark the buffer as freed. */
+ buffer->yuv.v_handle = NULL;
+ buffer->yuv.v_memory = NULL;
+ }
+
+ /* Make sure we have a valid memory handle. */
+ if (buffer->handle == NULL) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ /* Free the buffer. */
+ free.memory_handle = buffer->handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &free));
+
+ /* Mark the buffer as freed. */
+ buffer->handle = NULL;
+ buffer->memory = NULL;
+
+ return VG_LITE_SUCCESS;
+}
+#else
+vg_lite_error_t vg_lite_free(vg_lite_buffer_t * buffer)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_free_t free, uv_free, v_free;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ if(buffer == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+ if (tls->t_context.rtbuffer == buffer && !(memcmp(tls->t_context.rtbuffer,buffer,sizeof(vg_lite_buffer_t))) ) {
+ if (VG_LITE_SUCCESS == submit(&tls->t_context)) {
+ VG_LITE_RETURN_ERROR(stall(&tls->t_context, 0));
+ }
+ vglitemDUMP("@[swap 0x%08X %dx%d +%u]",
+ tls->t_context.rtbuffer->address,
+ tls->t_context.rtbuffer->width, tls->t_context.rtbuffer->height,
+ tls->t_context.rtbuffer->stride);
+ vglitemDUMP_BUFFER(
+ "framebuffer",
+ tls->t_context.rtbuffer->address,tls->t_context.rtbuffer->memory,
+ 0,
+ tls->t_context.rtbuffer->stride*(tls->t_context.rtbuffer->height));
+
+ memset(tls->t_context.rtbuffer, 0, sizeof(vg_lite_buffer_t));
+ }
+
+ if (buffer->yuv.uv_planar) {
+ /* Free UV(U) planar buffer. */
+ uv_free.memory_handle = buffer->yuv.uv_handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &uv_free));
+
+ /* Mark the buffer as freed. */
+ buffer->yuv.uv_handle = NULL;
+ buffer->yuv.uv_memory = NULL;
+ }
+
+ if (buffer->yuv.v_planar) {
+ /* Free V planar buffer. */
+ v_free.memory_handle = buffer->yuv.v_handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &v_free));
+
+ /* Mark the buffer as freed. */
+ buffer->yuv.v_handle = NULL;
+ buffer->yuv.v_memory = NULL;
+ }
+
+ /* Make sure we have a valid memory handle. */
+ if (buffer->handle == NULL) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ /* Free the buffer. */
+ free.memory_handle = buffer->handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &free));
+
+ /* Mark the buffer as freed. */
+ buffer->handle = NULL;
+ buffer->memory = NULL;
+
+ return VG_LITE_SUCCESS;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+vg_lite_error_t vg_lite_map(vg_lite_buffer_t * buffer)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_map_t map;
+
+ /* We either need a logical or physical address. */
+ if (buffer->memory == NULL && buffer->address == 0) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ /* Check if we need to compute the stride. Usually map a pre-allocated memory, so the stride
+ usually should be set*/
+ if (buffer->stride == 0) {
+ uint32_t mul, div, align;
+ get_format_bytes(buffer->format, &mul, &div, &align);
+ /* Compute the stride to be aligned. */
+ buffer->stride = VG_LITE_ALIGN((buffer->width * mul / div), align);
+ }
+
+ /* Map the buffer. */
+ map.bytes = buffer->stride * buffer->height;
+ map.logical = buffer->memory;
+ map.physical = buffer->address;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_MAP, &map));
+
+ /* Save the buffer allocation. */
+ buffer->handle = map.memory_handle;
+ buffer->address = map.memory_gpu;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_unmap(vg_lite_buffer_t * buffer)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_unmap_t unmap;
+
+ /* Make sure we have a valid memory handle. */
+ if (buffer->handle == NULL) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ /* Unmap the buffer. */
+ unmap.memory_handle = buffer->handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_UNMAP, &unmap));
+
+ /* Mark the buffer as freed. */
+ buffer->handle = NULL;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_get_register(uint32_t address, uint32_t * result)
+{
+ vg_lite_error_t error;
+ vg_lite_kernel_info_t data;
+
+ /* Get input register address. */
+ data.addr = address;
+
+ /* Get register info. */
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_CHECK, &data));
+
+ /* Return register info. */
+ *result = data.reg;
+
+ return VG_LITE_SUCCESS;
+}
+
+void vg_lite_get_info(vg_lite_info_t *info)
+{
+ if (info != NULL)
+ {
+ info->api_version = VGLITE_API_VERSION_2_0;
+ info->header_version = VGLITE_HEADER_VERSION;
+ info->release_version = VGLITE_RELEASE_VERSION;
+ info->reserved = 0;
+ }
+}
+
+uint32_t vg_lite_get_product_info(char *name, uint32_t *chip_id, uint32_t *chip_rev)
+{
+ const char *product_name = "GCNanoLiteV";
+ uint32_t name_len;
+ uint32_t rev = 0, id = 0;
+
+ vg_lite_get_register(0x24, &rev);
+ vg_lite_get_register(0x20, &id);
+
+ name_len = strlen(product_name) + 1;
+ if (name != NULL)
+ {
+ memcpy(name, product_name, name_len);
+ }
+
+ if (chip_id != NULL)
+ {
+ *chip_id = id;
+ }
+
+ if (chip_rev != NULL)
+ {
+ *chip_rev = rev;
+ }
+ return name_len;
+}
+
+uint32_t vg_lite_query_feature(vg_lite_feature_t feature)
+{
+ uint32_t result;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if (tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if (feature < gcFEATURE_COUNT)
+ result = ctx->s_ftable.ftable[feature];
+ else
+ result = 0;
+
+ return result;
+}
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_error_t vg_lite_finish()
+{
+ vg_lite_error_t error;
+
+ /* Return if there is nothing to submit. */
+ if (CMDBUF_OFFSET(s_context) == 0)
+ {
+ if(submit_flag)
+ VG_LITE_RETURN_ERROR(stall(&s_context, 0, (uint32_t)~0));
+ return VG_LITE_SUCCESS;
+ }
+
+ /* Flush is moved from each draw to here. */
+ VG_LITE_RETURN_ERROR(flush_target());
+ VG_LITE_RETURN_ERROR(submit(&s_context));
+ VG_LITE_RETURN_ERROR(stall(&s_context, 0, (uint32_t)~0));
+
+#if VG_TARGET_FAST_CLEAR
+ /*Only used in cmodel/fpga. In final SOC this SW FC decoder should be removed. */
+ if (s_context.rtbuffer != NULL) {
+#if VG_TARGET_FC_DUMP
+ fc_buf_dump(s_context.rtbuffer, &s_context.fcBuffer);
+#endif /* VG_TARGET_FC_DUMP */
+ }
+#endif
+
+ CMDBUF_SWAP(s_context);
+ /* Reset command buffer. */
+ CMDBUF_OFFSET(s_context) = 0;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_flush(void)
+{
+ vg_lite_error_t error;
+
+ /* Return if there is nothing to submit. */
+ if (CMDBUF_OFFSET(s_context) == 0)
+ return VG_LITE_SUCCESS;
+
+ /* Wait if GPU has not completed previous CMD buffer */
+ if (submit_flag)
+ {
+ VG_LITE_RETURN_ERROR(stall(&s_context, 0, (uint32_t)~0));
+ }
+
+ /* Submit the current command buffer. */
+ VG_LITE_RETURN_ERROR(flush_target());
+ VG_LITE_RETURN_ERROR(submit(&s_context));
+ CMDBUF_SWAP(s_context);
+ /* Reset command buffer. */
+ CMDBUF_OFFSET(s_context) = 0;
+
+ return VG_LITE_SUCCESS;
+}
+#else
+vg_lite_error_t vg_lite_finish()
+{
+ vg_lite_error_t error;
+ vg_lite_tls_t* tls;
+ uint32_t command_id, index;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ command_id = CMDBUF_INDEX(tls->t_context);
+ index = command_id ? 0 : 1;
+
+ if (CMDBUF_OFFSET(tls->t_context) <= 8){
+ /* Return if there is nothing to submit. */
+ if (!CMDBUF_IN_QUEUE(&tls->t_context.context, 0) && !CMDBUF_IN_QUEUE(&tls->t_context.context, 1) )
+ return VG_LITE_SUCCESS;
+ /* This frame has unfinished command. */
+ else if(CMDBUF_IN_QUEUE(&tls->t_context.context, index))
+ {
+ CMDBUF_SWAP(tls->t_context);
+ VG_LITE_RETURN_ERROR(stall(&tls->t_context, 0));
+ }
+ /* This frame has unfinished command. */
+ else if(CMDBUF_IN_QUEUE(&tls->t_context.context, command_id))
+ {
+ VG_LITE_RETURN_ERROR(stall(&tls->t_context, 0));
+ }
+ CMDBUF_OFFSET(tls->t_context) = 0;
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A00, 0x0));
+ return VG_LITE_SUCCESS;
+ }
+ else
+ {
+ /* Flush is moved from each draw to here. */
+ VG_LITE_RETURN_ERROR(flush_target());
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_LOCK, NULL));
+ /* if context have been switched and this task need use index. */
+ VG_LITE_RETURN_ERROR(update_context_buffer());
+ VG_LITE_RETURN_ERROR(submit(&tls->t_context));
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_UNLOCK, NULL));
+ VG_LITE_RETURN_ERROR(stall(&tls->t_context, 0));
+ }
+
+#if VG_TARGET_FAST_CLEAR
+ /*Only used in cmodel/fpga. In final SOC this SW FC decoder should be removed. */
+ if (tls->t_context.rtbuffer != NULL) {
+#if VG_TARGET_FC_DUMP
+ fc_buf_dump(tls->t_context.rtbuffer, &tls->t_context.fcBuffer);
+#endif /* VG_TARGET_FC_DUMP */
+ }
+#endif
+
+ CMDBUF_SWAP(tls->t_context);
+ CMDBUF_OFFSET(tls->t_context) = 0;
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A00, 0x0));
+ tls->t_context.ts_init_used = 0;
+ tls->t_context.ts_init_use = 0;
+ tls->t_context.ts_init = 0;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_flush(void)
+{
+ vg_lite_error_t error;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ /* Return if there is nothing to submit. */
+ if (CMDBUF_OFFSET(tls->t_context) == 0)
+ return VG_LITE_SUCCESS;
+
+ /* Submit the current command buffer. */
+ VG_LITE_RETURN_ERROR(flush_target());
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_LOCK, NULL));
+ /* if context have been switched and this task need use index. */
+ VG_LITE_RETURN_ERROR(update_context_buffer());
+ VG_LITE_RETURN_ERROR(submit(&tls->t_context));
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_UNLOCK, NULL));
+
+ CMDBUF_SWAP(tls->t_context);
+ CMDBUF_OFFSET(tls->t_context) = 0;
+ VG_LITE_RETURN_ERROR(push_state(&tls->t_context, 0x0A00, 0x0));
+ tls->t_context.ts_init_used = 0;
+ tls->t_context.ts_init_use = 0;
+ tls->t_context.ts_init = 0;
+
+ return VG_LITE_SUCCESS;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+vg_lite_error_t vg_lite_init_arc_path(vg_lite_path_t * path,
+ vg_lite_format_t data_format,
+ vg_lite_quality_t quality,
+ uint32_t path_length,
+ void * path_data,
+ vg_lite_float_t min_x, vg_lite_float_t min_y,
+ vg_lite_float_t max_x, vg_lite_float_t max_y)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t i = 0,command = 0,offset = 0;
+ vg_lite_float_t moveToX,moveToY,lineToX,lineToY,controlX, controlY,quadToX, quadToY;
+ vg_lite_float_t controlX1, controlY1,controlX2, controlY2,cubicToX, cubicToY;
+ vg_lite_float_t horRadius,verRadius,rotAngle,endX,endY;
+ float *pfloat,*fpath;
+ char *cpath,*pathdata;
+ vg_lite_control_coord_t coords;
+
+ if(path == NULL || path_data == NULL || data_format != VG_LITE_FP32)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ memset(path, 0, sizeof(*path));
+
+ if(!path_length)
+ {
+ path->format = data_format;
+ path->quality = quality;
+ path->bounding_box[0] = min_x;
+ path->bounding_box[1] = min_y;
+ path->bounding_box[2] = max_x;
+ path->bounding_box[3] = max_y;
+
+ path->path_length = 0;
+ path->path = NULL;
+ path->pdata_internal = 1;
+ path->path_changed = 1;
+ path->uploaded.address = 0;
+ path->uploaded.bytes = 0;
+ path->uploaded.handle = NULL;
+ path->uploaded.memory = NULL;
+ return VG_LITE_SUCCESS;
+ }
+
+ memset(&coords, 0, sizeof(vg_lite_control_coord_t));
+ pathdata = (char *)vg_lite_os_malloc(path_length);
+ if (pathdata == NULL)
+ return VG_LITE_OUT_OF_MEMORY;
+ memset(pathdata, 0, path_length);
+ pfloat = (vg_lite_float_t *)path_data;
+ while(i < path_length)
+ {
+ cpath = (char *)pfloat;
+ command = (uint32_t)*cpath;
+ pfloat++;
+ switch (command)
+ {
+ case VLC_OP_END:
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_END;
+ offset += _commandSize_float[VLC_OP_END];
+ i += _commandSize_float[VLC_OP_END];
+ break;
+ case VLC_OP_CLOSE:
+ /* Update the control coordinates. */
+ coords.lastX = coords.startX;
+ coords.lastY = coords.startY;
+ coords.controlX = coords.startX;
+ coords.controlY = coords.startY;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_CLOSE;
+ offset += _commandSize_float[VLC_OP_CLOSE];
+ i += _commandSize_float[VLC_OP_CLOSE];
+ break;
+ case VLC_OP_MOVE:
+ moveToX = *pfloat++;
+ moveToY = *pfloat++;
+
+ /* Update the control coordinates. */
+ coords.startX = moveToX;
+ coords.startY = moveToY;
+ coords.lastX = moveToX;
+ coords.lastY = moveToY;
+ coords.controlX = moveToX;
+ coords.controlY = moveToY;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_MOVE;
+ fpath++;
+ *fpath++ = moveToX;
+ *fpath++ = moveToY;
+ offset += _commandSize_float[VLC_OP_MOVE];
+ i += _commandSize_float[VLC_OP_MOVE];
+ break;
+ case VLC_OP_MOVE_REL:
+ moveToX = *pfloat++;
+ moveToY = *pfloat++;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_MOVE_REL;
+ fpath++;
+ *fpath++ = moveToX;
+ *fpath++ = moveToY;
+ offset += _commandSize_float[VLC_OP_MOVE_REL];
+ i += _commandSize_float[VLC_OP_MOVE_REL];
+
+ /* Determine the absolute coordinates. */
+ moveToX += coords.lastX;
+ moveToY += coords.lastY;
+
+ /* Update the control coordinates. */
+ coords.startX = moveToX;
+ coords.startY = moveToY;
+ coords.lastX = moveToX;
+ coords.lastY = moveToY;
+ coords.controlX = moveToX;
+ coords.controlY = moveToY;
+ break;
+ case VLC_OP_LINE:
+ lineToX = *pfloat++;
+ lineToY = *pfloat++;
+
+ /* Update the control coordinates. */
+ coords.lastX = lineToX;
+ coords.lastY = lineToY;
+ coords.controlX = lineToX;
+ coords.controlY = lineToY;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_LINE;
+ fpath++;
+ *fpath++ = lineToX;
+ *fpath++ = lineToY;
+ offset += _commandSize_float[VLC_OP_LINE];
+ i += _commandSize_float[VLC_OP_LINE];
+ break;
+ case VLC_OP_LINE_REL:
+ lineToX = *pfloat++;
+ lineToY = *pfloat++;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_LINE_REL;
+ fpath++;
+ *fpath++ = lineToX;
+ *fpath++ = lineToY;
+ offset += _commandSize_float[VLC_OP_LINE_REL];
+ i += _commandSize_float[VLC_OP_LINE_REL];
+
+ /* Determine the absolute coordinates. */
+ lineToX += coords.lastX;
+ lineToY += coords.lastY;
+
+ /* Update the control coordinates. */
+ coords.lastX = lineToX;
+ coords.lastY = lineToY;
+ coords.controlX = lineToX;
+ coords.controlY = lineToY;
+ break;
+ case VLC_OP_QUAD:
+ controlX = *pfloat++;
+ controlY = *pfloat++;
+ quadToX = *pfloat++;
+ quadToY = *pfloat++;
+
+ /* Update the control coordinates. */
+ coords.lastX = quadToX;
+ coords.lastY = quadToY;
+ coords.controlX = controlX;
+ coords.controlY = controlY;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_QUAD;
+ fpath++;
+ *fpath++ = controlX;
+ *fpath++ = controlY;
+ *fpath++ = quadToX;
+ *fpath++ = quadToY;
+ offset += _commandSize_float[VLC_OP_QUAD];
+ i += _commandSize_float[VLC_OP_QUAD];
+ break;
+ case VLC_OP_QUAD_REL:
+ controlX = *pfloat++;
+ controlY = *pfloat++;
+ quadToX = *pfloat++;
+ quadToY = *pfloat++;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_QUAD_REL;
+ fpath++;
+ *fpath++ = controlX;
+ *fpath++ = controlY;
+ *fpath++ = quadToX;
+ *fpath++ = quadToY;
+ offset += _commandSize_float[VLC_OP_QUAD_REL];
+ i += _commandSize_float[VLC_OP_QUAD_REL];
+
+ /* Determine the absolute coordinates. */
+ controlX += coords.lastX;
+ controlY += coords.lastY;
+ quadToX += coords.lastX;
+ quadToY += coords.lastY;
+
+ /* Update the control coordinates. */
+ coords.lastX = quadToX;
+ coords.lastY = quadToY;
+ coords.controlX = controlX;
+ coords.controlY = controlY;
+ break;
+ case VLC_OP_CUBIC:
+ controlX1 = *pfloat++;
+ controlY1 = *pfloat++;
+ controlX2 = *pfloat++;
+ controlY2 = *pfloat++;
+ cubicToX = *pfloat++;
+ cubicToY = *pfloat++;
+
+ /* Update the control coordinates. */
+ coords.lastX = cubicToX;
+ coords.lastY = cubicToY;
+ coords.controlX = controlX2;
+ coords.controlY = controlY2;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_CUBIC;
+ fpath++;
+ *fpath++ = controlX1;
+ *fpath++ = controlY1;
+ *fpath++ = controlX2;
+ *fpath++ = controlY2;
+ *fpath++ = cubicToX;
+ *fpath++ = cubicToY;
+ offset += _commandSize_float[VLC_OP_CUBIC];
+ i += _commandSize_float[VLC_OP_CUBIC];
+ break;
+ case VLC_OP_CUBIC_REL:
+ controlX1 = *pfloat++;
+ controlY1 = *pfloat++;
+ controlX2 = *pfloat++;
+ controlY2 = *pfloat++;
+ cubicToX = *pfloat++;
+ cubicToY = *pfloat++;
+
+ cpath = (char *)pathdata + offset;
+ fpath = (vg_lite_float_t *)cpath;
+ *cpath = VLC_OP_CUBIC_REL;
+ fpath++;
+ *fpath++ = controlX1;
+ *fpath++ = controlY1;
+ *fpath++ = controlX2;
+ *fpath++ = controlY2;
+ *fpath++ = cubicToX;
+ *fpath++ = cubicToY;
+ offset += _commandSize_float[VLC_OP_CUBIC_REL];
+ i += _commandSize_float[VLC_OP_CUBIC_REL];
+
+ /* Determine the absolute coordinates. */
+ controlX2 += coords.lastX;
+ controlY2 += coords.lastY;
+ cubicToX += coords.lastX;
+ cubicToY += coords.lastY;
+
+ /* Update the control coordinates. */
+ coords.lastX = cubicToX;
+ coords.lastY = cubicToY;
+ coords.controlX = controlX2;
+ coords.controlY = controlY2;
+ break;
+ case VLC_OP_SCCWARC:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,FALSE,FALSE,FALSE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_SCCWARC_REL:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,FALSE,FALSE,TURE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_SCWARC:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,TURE,FALSE,FALSE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_SCWARC_REL:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,TURE,FALSE,TURE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_LCCWARC:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,FALSE,TURE,FALSE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_LCCWARC_REL:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,FALSE,TURE,TURE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_LCWARC:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,TURE,TURE,FALSE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ case VLC_OP_LCWARC_REL:
+ horRadius = *pfloat++;
+ verRadius = *pfloat++;
+ rotAngle = *pfloat++;
+ endX = *pfloat++;
+ endY = *pfloat++;
+ i += _commandSize_float[VLC_OP_SCCWARC_REL];
+ VG_LITE_ERROR_HANDLER(_convert_arc(horRadius,verRadius,rotAngle,endX,endY,TURE,TURE,TURE,&coords,(void *)&pathdata,&offset,path_length - i));
+ break;
+ default:
+ break;
+ }
+ }
+
+ path->format = data_format;
+ path->quality = quality;
+ path->bounding_box[0] = min_x;
+ path->bounding_box[1] = min_y;
+ path->bounding_box[2] = max_x;
+ path->bounding_box[3] = max_y;
+
+ path->path_length = offset;
+ path->path = pathdata;
+ path->pdata_internal = 1;
+ path->path_changed = 1;
+ path->uploaded.address = 0;
+ path->uploaded.bytes = 0;
+ path->uploaded.handle = NULL;
+ path->uploaded.memory = NULL;
+
+ return VG_LITE_SUCCESS;
+
+ErrorHandler:
+ vg_lite_os_free(pathdata);
+ pathdata = NULL;
+ return error;
+}
+
+vg_lite_error_t vg_lite_init_path(vg_lite_path_t * path,
+ vg_lite_format_t data_format,
+ vg_lite_quality_t quality,
+ uint32_t path_length,
+ void * path_data,
+ vg_lite_float_t min_x, vg_lite_float_t min_y,
+ vg_lite_float_t max_x, vg_lite_float_t max_y)
+{
+ if(path == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ memset(path, 0, sizeof(*path));
+ path->format = data_format;
+ path->quality = quality;
+ path->bounding_box[0] = min_x;
+ path->bounding_box[1] = min_y;
+ path->bounding_box[2] = max_x;
+ path->bounding_box[3] = max_y;
+
+ path->path_length = path_length;
+ path->path = path_data;
+
+ path->path_changed = 1;
+ path->uploaded.address = 0;
+ path->uploaded.bytes = 0;
+ path->uploaded.handle = NULL;
+ path->uploaded.memory = NULL;
+ path->uploaded.property = 0;
+ path->pdata_internal = 0;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_clear_path(vg_lite_path_t * path)
+{
+ vg_lite_error_t error;
+ if (path->uploaded.handle != NULL)
+ {
+ vg_lite_kernel_free_t free_cmd;
+ free_cmd.memory_handle = path->uploaded.handle;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_FREE, &free_cmd));
+ }
+
+ path->uploaded.address = 0;
+ path->uploaded.bytes = 0;
+ path->uploaded.handle = NULL;
+ path->uploaded.memory = NULL;
+
+ if(path->pdata_internal == 1 && path->path != NULL){
+ vg_lite_os_free(path->path);
+ }
+ path->path = NULL;
+
+ if(path->stroke_path_data) {
+ vg_lite_os_free(path->stroke_path_data);
+ path->stroke_path_data = NULL;
+ }
+
+ if (path->stroke_conversion) {
+ if(path->stroke_conversion->path_point_list) {
+ vg_lite_path_point_ptr temp_point;
+ while(path->stroke_conversion->path_point_list) {
+ temp_point = path->stroke_conversion->path_point_list->next;
+ vg_lite_os_free(path->stroke_conversion->path_point_list);
+ path->stroke_conversion->path_point_list = temp_point;
+ }
+ temp_point = NULL;
+ }
+
+ if(path->stroke_conversion->stroke_sub_path_list) {
+ vg_lite_sub_path_ptr temp_sub_path;
+ while(path->stroke_conversion->stroke_sub_path_list) {
+ temp_sub_path = path->stroke_conversion->stroke_sub_path_list->next;
+ if(path->stroke_conversion->stroke_sub_path_list->point_list) {
+ vg_lite_path_point_ptr temp_point;
+ while(path->stroke_conversion->stroke_sub_path_list->point_list) {
+ temp_point = path->stroke_conversion->stroke_sub_path_list->point_list->next;
+ vg_lite_os_free(path->stroke_conversion->stroke_sub_path_list->point_list);
+ path->stroke_conversion->stroke_sub_path_list->point_list = temp_point;
+ }
+ temp_point = NULL;
+ }
+ vg_lite_os_free(path->stroke_conversion->stroke_sub_path_list);
+ path->stroke_conversion->stroke_sub_path_list = temp_sub_path;
+ }
+ temp_sub_path = NULL;
+ }
+
+ vg_lite_os_free(path->stroke_conversion);
+ path->stroke_conversion = NULL;
+ }
+ return VG_LITE_SUCCESS;
+}
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_error_t vg_lite_set_CLUT(uint32_t count,
+ uint32_t * colors)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ uint32_t addr = 0x0B00;
+
+ if(!s_context.s_ftable.ftable[gcFEATURE_BIT_VG_IM_INDEX_FORMAT])
+ return VG_LITE_NOT_SUPPORT;
+
+ switch (count) {
+ case 256:
+ addr = 0x0B00;
+ break;
+
+ case 16:
+ addr = 0x0AA0;
+ break;
+
+ case 4:
+ addr = 0x0A9C;
+ break;
+
+ case 2:
+ addr = 0x0A98;
+ break;
+
+ default:
+ error = VG_LITE_INVALID_ARGUMENT;
+ return error;
+ break;
+ }
+
+ VG_LITE_RETURN_ERROR(push_states(&s_context, addr, count, colors));
+
+ return error;
+}
+#else
+vg_lite_error_t vg_lite_set_CLUT(uint32_t count,
+ uint32_t * colors)
+{
+ vg_lite_tls_t* tls;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ if(!tls->t_context.s_ftable.ftable[gcFEATURE_BIT_VG_IM_INDEX_FORMAT])
+ return VG_LITE_NOT_SUPPORT;
+
+ switch (count) {
+ case 2:
+ tls->t_context.clut_dirty[0] = 1;
+ tls->t_context.clut_used[0] = 0;
+ if(!tls->t_context.colors[0])
+ tls->t_context.colors[0] = (uint32_t *)malloc(count * sizeof(uint32_t));
+ memcpy(tls->t_context.colors[0], colors, count * sizeof(uint32_t));
+ break;
+ case 4:
+ tls->t_context.clut_dirty[1] = 1;
+ tls->t_context.clut_used[1] = 0;
+ if(!tls->t_context.colors[1])
+ tls->t_context.colors[1] = (uint32_t *)malloc(count * sizeof(uint32_t));
+ memcpy(tls->t_context.colors[1], colors, count * sizeof(uint32_t));
+ break;
+ case 16:
+ tls->t_context.clut_dirty[2] = 1;
+ tls->t_context.clut_used[2] = 0;
+ if(!tls->t_context.colors[2])
+ tls->t_context.colors[2] = (uint32_t *)malloc(count * sizeof(uint32_t));
+ memcpy(tls->t_context.colors[2], colors, count * sizeof(uint32_t));
+ break;
+ case 256:
+ tls->t_context.clut_dirty[3] = 1;
+ tls->t_context.clut_used[3] = 0;
+ if(!tls->t_context.colors[3])
+ tls->t_context.colors[3] = (uint32_t *)malloc(count * sizeof(uint32_t));
+ memcpy(tls->t_context.colors[3], colors, count * sizeof(uint32_t));
+ break;
+
+ default:
+ error = VG_LITE_INVALID_ARGUMENT;
+ return error;
+ break;
+ }
+
+ return error;
+}
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+vg_lite_error_t vg_lite_draw_pattern(vg_lite_buffer_t * target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix0,
+ vg_lite_buffer_t * source,
+ vg_lite_matrix_t * matrix1,
+ vg_lite_blend_t blend,
+ vg_lite_pattern_mode_t pattern_mode,
+ vg_lite_color_t pattern_color,
+ vg_lite_filter_t filter)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t imageMode;
+ uint32_t blend_mode;
+ uint32_t conversion = 0;
+ uint32_t tiled_source;
+ vg_lite_matrix_t * matrix = matrix1;
+ uint32_t pattern_tile = 0;
+ uint32_t transparency_mode = 0;
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!path->path_length)
+ return VG_LITE_SUCCESS;
+
+ if(!path->path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* The following code is from "draw path" */
+ uint32_t format, quality, tiling, fill;
+ uint32_t tessellation_size;
+#if DUMP_COMMAND
+ vg_lite_kernel_allocate_t memory;
+ uint32_t return_offset = 0;
+#endif
+ vg_lite_point_t point_min = {0}, point_max = {0}, temp = {0};
+ int x, y, width, height;
+ uint8_t ts_is_fullscreen = 0;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_QUALITY_8X) && path->quality == VG_LITE_UPPER){
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ if(source->format == VG_LITE_A4 || source->format == VG_LITE_A8) {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ transparency_mode = (source->transparency_mode == VG_LITE_IMAGE_TRANSPARENT ? 0x8000:0);
+ width = ctx->tsbuffer.tessellation_width_height & 0xFFFF;
+ height = ctx->tsbuffer.tessellation_width_height >> 16;
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+
+ if(width == 0 || height == 0)
+ return VG_LITE_NO_CONTEXT;
+ if ((dst_align_width <= width) && (target->height <= height))
+ {
+ ts_is_fullscreen = 1;
+ point_min.x = 0;
+ point_min.y = 0;
+ point_max.x = dst_align_width;
+ point_max.y = target->height;
+ }
+
+ /* If target is L8 and source is in YUV or RGB (not L8 or A8) then we have to convert RGB into L8. */
+ if ((target->format == VG_LITE_L8) && ((source->format != VG_LITE_L8) && (source->format != VG_LITE_A8))) {
+ conversion = 0x80000000;
+ }
+
+ /* Determine image mode (NORMAL or MULTIPLY) depending on the color. */
+ imageMode = (source->image_mode == VG_LITE_NONE_IMAGE_MODE) ? 0 : (source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE) ? 0x00002000 : 0x00001000;
+ tiled_source = (source->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0 ;
+
+ if (pattern_mode == VG_LITE_PATTERN_COLOR)
+ {
+ uint8_t a,r,g,b;
+ pattern_tile = 0;
+ a = pattern_color >> 24;
+ r = pattern_color >> 16;
+ g = pattern_color >> 8;
+ b = pattern_color;
+ pattern_color = (a << 24) | (b << 16) | (g << 8) | r;
+ }
+ else if (pattern_mode == VG_LITE_PATTERN_PAD)
+ {
+ pattern_tile = 0x1000;
+ }
+ else
+ {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ if(ctx->ts_dirty){
+ memcpy(CMDBUF_BUFFER(*ctx) + CMDBUF_OFFSET(*ctx), ctx->ts_record, 80);
+ CMDBUF_OFFSET(*ctx) += 80;
+ ctx->ts_dirty = 0;
+ ctx->ts_init_used = 1;
+ }
+ else
+ {
+ ctx->ts_init_use = 1;
+ }
+
+ /* Setup the command buffer. */
+ if(source->format >= VG_LITE_INDEX_1 && source->format <= VG_LITE_INDEX_8)
+ {
+ /* this task will use index format,set index_flag to 1. */
+ ctx->index_format = 1;
+ switch (source->format) {
+ case VG_LITE_INDEX_8:
+ if(ctx->clut_dirty[3]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0B00, 256, ctx->colors[3]));
+ ctx->clut_dirty[3] = 0;
+ }
+ else
+ {
+ ctx->clut_used[3] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_4:
+ if(ctx->clut_dirty[2]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0AA0, 16, ctx->colors[2]));
+ ctx->clut_dirty[2] = 0;
+ }
+ else
+ {
+ ctx->clut_used[2] = 1;
+ }
+ break;
+
+ case VG_LITE_INDEX_2:
+ if(ctx->clut_dirty[1]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0A9C, 4, ctx->colors[1]));
+ ctx->clut_dirty[1] = 0;
+ }
+ else
+ {
+ ctx->clut_used[1] = 1;
+ }
+ break;
+
+ default:
+ if(ctx->clut_dirty[0]){
+ VG_LITE_RETURN_ERROR(push_states(ctx, 0x0A98, 2, ctx->colors[0]));
+ ctx->clut_dirty[0] = 0;
+ }
+ else
+ {
+ ctx->clut_used[0] = 1;
+ }
+ }
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ VG_LITE_RETURN_ERROR(set_interpolation_steps(target, source->width, source->height, matrix));
+
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ if(source->transparency_mode == VG_LITE_IMAGE_OPAQUE){
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) |
+ filter | pattern_tile | conversion | 0x01000100));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) |
+ filter | pattern_tile | conversion | 0x00000100));
+ }
+ } else {
+ /* enable pre-multiplied in imager unit */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A25, convert_source_format(source->format) |
+ filter | pattern_tile | conversion));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A27, pattern_color));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A29, source->address));
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2B, source->stride | tiled_source));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2D, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2F, source->width | (source->height << 16)));
+
+ /* Work on path states. */
+ matrix = matrix0;
+
+ if (ts_is_fullscreen == 0){
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[1], matrix);
+ point_min = point_max = temp;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[1], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ point_min.x = MAX(point_min.x, 0);
+ point_min.y = MAX(point_min.y, 0);
+ point_max.x = MIN(point_max.x, dst_align_width);
+ point_max.y = MIN(point_max.y, target->height);
+ }
+
+ if (ctx->scissor_enabled) {
+ point_min.x = MAX(point_min.x, ctx->scissor[0]);
+ point_min.y = MAX(point_min.y, ctx->scissor[1]);
+ point_max.x = MIN(point_max.x, ctx->scissor[0] + ctx->scissor[2]);
+ point_max.y = MIN(point_max.y, ctx->scissor[1] + ctx->scissor[3]);
+ }
+
+ /* Convert states into hardware values. */
+ blend_mode = convert_blend(blend);
+ format = convert_path_format(path->format);
+ quality = convert_path_quality(path->quality);
+ tiling = (ctx->capabilities.cap.tiled == 2) ? 0x2000000 : 0;
+ fill = (fill_rule == VG_LITE_FILL_EVEN_ODD) ? 0x10 : 0;
+ tessellation_size = ( ctx->tsbuffer.tessellation_buffer_size[2]
+ ? ctx->tsbuffer.tessellation_buffer_size[2]
+ : ctx->tsbuffer.tessellation_buffer_size[1]
+ );
+
+ /* Setup the command buffer. */
+ /* Program color register. */
+ if(!ctx->premultiply_enabled && source->format != VG_LITE_A8 && source->format != VG_LITE_A4) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x10000000 | ctx->capabilities.cap.tiled | 0x00000002 | imageMode | blend_mode | transparency_mode));
+ } else {
+ /* enable pre-multiplied from VG to VGPE */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, ctx->capabilities.cap.tiled | 0x00000002 | imageMode | blend_mode | transparency_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000400 | format | quality | tiling | fill));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3B, 0x3F800000)); /* Path tessellation SCALE. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3C, 0x00000000)); /* Path tessellation BIAS. */
+ /* Program matrix. */
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A40, (void *) &matrix->m[0][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A41, (void *) &matrix->m[0][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A42, (void *) &matrix->m[0][2]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A43, (void *) &matrix->m[1][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A44, (void *) &matrix->m[1][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A45, (void *) &matrix->m[1][2]));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+
+ vglitemDUMP_BUFFER("path", path->uploaded.address, (uint8_t *)(path->uploaded.memory), 0, path->uploaded.bytes);
+ }
+
+ vglitemDUMP("@[memory 0x%08X 0x%08X]", ctx->tsbuffer.tessellation_buffer_gpu[0], ctx->tsbuffer.tessellation_buffer_size[0]);
+
+ /* Setup tessellation loop. */
+ if((path->path_type & 0x1) == VG_LITE_DRAW_FILL_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ push_data(ctx, path->path_length, path->path);
+ }
+ }
+ }
+ }
+ /* Setup tessellation loop. */
+ if(path->path_type == VG_LITE_DRAW_STROKE_PATH || path->path_type == VG_LITE_DRAW_FILL_STROKE_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ format = convert_path_format(VG_LITE_FP32);
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000200 | format | quality | tiling | 0x0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, path->stroke_color));
+ push_data(ctx, path->stroke_path_size, path->stroke_path_data);
+ }
+ }
+ }
+ }
+
+ /* Finialize command buffer. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0));
+ VG_LITE_RETURN_ERROR(flush_target());
+
+ vglitemDUMP_BUFFER("image", source->address, source->memory, 0, (source->stride)*(source->height));
+#if DUMP_IMAGE
+ dump_img(source->memory, source->width, source->height, source->format);
+#endif
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ tls->t_context.ts_init = 1;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+ return error;
+}
+
+vg_lite_error_t vg_lite_draw_linear_gradient(vg_lite_buffer_t * target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * path_matrix,
+ vg_lite_linear_gradient_ext_t *grad,
+ vg_lite_color_t paint_color,
+ vg_lite_blend_t blend,
+ vg_lite_filter_t filter)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t image_mode;
+ uint32_t blend_mode;
+ uint32_t conversion = 0;
+ uint32_t tiled_source;
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+ vg_lite_matrix_t inverse_matrix;
+ vg_lite_buffer_t * source = &grad->image;
+ vg_lite_matrix_t * matrix = &grad->matrix;
+ uint32_t linear_tile = 0;
+ uint32_t transparency_mode = 0;
+ void *data;
+
+ /* The following code is from "draw path" */
+ uint32_t format, quality, tiling, fill;
+ uint32_t tessellation_size;
+
+ vg_lite_kernel_allocate_t memory;
+ vg_lite_kernel_free_t free_memory;
+ uint32_t return_offset = 0;
+
+ vg_lite_point_t point_min = {0}, point_max = {0}, temp = {0};
+ int x, y, width, height;
+ uint8_t ts_is_fullscreen = 0;
+
+ vg_lite_float_t dx, dy, dxdx_dydy;
+ vg_lite_float_t lg_step_x_lin, lg_step_y_lin, lg_constant_lin;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if (tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!path->path_length)
+ return VG_LITE_SUCCESS;
+
+ if(!path->path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT))
+ return VG_LITE_NOT_SUPPORT;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_QUALITY_8X) && path->quality == VG_LITE_UPPER){
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ if(source->format == VG_LITE_A4 || source->format == VG_LITE_A8) {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ transparency_mode = (source->transparency_mode == VG_LITE_IMAGE_TRANSPARENT ? 0x8000:0);
+ width = ctx->tsbuffer.tessellation_width_height & 0xFFFF;
+ height = ctx->tsbuffer.tessellation_width_height >> 16;
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+ if(width == 0 || height == 0)
+ return VG_LITE_NO_CONTEXT;
+ if ((dst_align_width <= width) && (target->height <= height))
+ {
+ ts_is_fullscreen = 1;
+ point_min.x = 0;
+ point_min.y = 0;
+ point_max.x = dst_align_width;
+ point_max.y = target->height;
+ }
+
+ /* If target is L8 and source is in YUV or RGB (not L8 or A8) then we have to convert RGB into L8. */
+ if ((target->format == VG_LITE_L8) && ((source->format != VG_LITE_L8) && (source->format != VG_LITE_A8))) {
+ conversion = 0x80000000;
+ }
+
+ /* Determine image mode (NORMAL or MULTIPLY) depending on the color. */
+ image_mode = (source->image_mode == VG_LITE_NONE_IMAGE_MODE) ? 0 : (source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE) ? 0x00002000 : 0x00001000;
+ tiled_source = (source->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0 ;
+
+ linear_tile = (grad->spread_mode == VG_LITE_RADIAL_GRADIENT_SPREAD_FILL) ? 0 :
+ (grad->spread_mode == VG_LITE_RADIAL_GRADIENT_SPREAD_PAD) ? 0x1000 :
+ (grad->spread_mode == VG_LITE_RADIAL_GRADIENT_SPREAD_REPEAT) ? 0x2000 : 0x3000;
+
+ if (grad->spread_mode == VG_LITE_RADIAL_GRADIENT_SPREAD_FILL)
+ {
+ uint8_t a,r,g,b;
+ a = paint_color >> 24;
+ r = paint_color >> 16;
+ g = paint_color >> 8;
+ b = paint_color;
+ paint_color = (a << 24) | (b << 16) | (g << 8) | r;
+ }
+
+ /* compute radial gradient paremeters */
+
+ if (!inverse(&inverse_matrix, matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+
+ dx = grad->linear_gradient.X1 - grad->linear_gradient.X0;
+ dy = grad->linear_gradient.Y1 - grad->linear_gradient.Y0;
+ dxdx_dydy = dx * dx + dy * dy;
+
+ /*
+ ** dx (T(x) - x0) + dy (T(y) - y0)
+ ** g = -------------------------------
+ ** dx^2 + dy^2
+ **
+ ** where
+ **
+ ** dx := x1 - x0
+ ** dy := y1 - y1
+ ** T(x) := (x + 0.5) m00 + (y + 0.5) m01 + m02
+ ** = x m00 + y m01 + 0.5 (m00 + m01) + m02
+ ** T(y) := (x + 0.5) m10 + (y + 0.5) m11 + m12
+ ** = x m10 + y m11 + 0.5 (m10 + m11) + m12.
+ **
+ ** We can factor the top line into:
+ **
+ ** = dx (x m00 + y m01 + 0.5 (m00 + m01) + m02 - x0)
+ ** + dy (x m10 + y m11 + 0.5 (m10 + m11) + m12 - y0)
+ **
+ ** = x (dx m00 + dy m10)
+ ** + y (dx m01 + dy m11)
+ ** + dx (0.5 (m00 + m01) + m02 - x0)
+ ** + dy (0.5 (m10 + m11) + m12 - y0).
+ */
+
+ lg_step_x_lin
+ = (dx * MAT(&inverse_matrix, 0, 0) + dy * MAT(&inverse_matrix, 1, 0))
+ / dxdx_dydy;
+
+ lg_step_y_lin
+ = (dx * MAT(&inverse_matrix, 0, 1) + dy * MAT(&inverse_matrix, 1, 1))
+ / dxdx_dydy;
+
+ lg_constant_lin =
+ (
+ (
+ 0.5f * ( MAT(&inverse_matrix, 0, 0) + MAT(&inverse_matrix, 0, 1) )
+ + MAT(&inverse_matrix, 0, 2) - grad->linear_gradient.X0
+ ) * dx
+
+ +
+
+ (
+ 0.5f * ( MAT(&inverse_matrix, 1, 0) + MAT(&inverse_matrix, 1, 1) )
+ + MAT(&inverse_matrix, 1, 2) - grad->linear_gradient.Y0
+ ) * dy
+ )
+ / dxdx_dydy;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ if(ctx->ts_dirty){
+ memcpy(CMDBUF_BUFFER(*ctx) + CMDBUF_OFFSET(*ctx), ctx->ts_record, 80);
+ CMDBUF_OFFSET(*ctx) += 80;
+ ctx->ts_dirty = 0;
+ ctx->ts_init_used = 1;
+ }
+ else
+ {
+ ctx->ts_init_use = 1;
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ /* Setup the command buffer. */
+
+ /* linear gradient parameters*/
+ data = &lg_constant_lin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A04,*(uint32_t*) data));
+ data = &lg_step_x_lin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A06,*(uint32_t*) data));
+ data = &lg_step_y_lin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A08,*(uint32_t*) data));
+
+ VG_LITE_RETURN_ERROR(set_interpolation_steps(target, source->width, source->height, matrix));
+
+ if(!ctx->premultiply_enabled) {
+ if(source->transparency_mode == VG_LITE_IMAGE_OPAQUE){
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | linear_tile | conversion | 0x01000100));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | linear_tile | conversion | 0x00000100));
+ }
+ } else {
+ /* enable pre-multiplied in imager unit */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | linear_tile | conversion));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A26, paint_color));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A28, source->address));
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2A, tiled_source));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2C, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2E, source->width));
+
+ /* Work on path states. */
+ matrix = path_matrix;
+
+ if (ts_is_fullscreen == 0){
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[1], matrix);
+ point_min = point_max = temp;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[1], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ point_min.x = MAX(point_min.x, 0);
+ point_min.y = MAX(point_min.y, 0);
+ point_max.x = MIN(point_max.x, dst_align_width);
+ point_max.y = MIN(point_max.y, target->height);
+ }
+
+ if (ctx->scissor_enabled) {
+ point_min.x = MAX(point_min.x, ctx->scissor[0]);
+ point_min.y = MAX(point_min.y, ctx->scissor[1]);
+ point_max.x = MIN(point_max.x, ctx->scissor[0] + ctx->scissor[2]);
+ point_max.y = MIN(point_max.y, ctx->scissor[1] + ctx->scissor[3]);
+ }
+
+ /* Convert states into hardware values. */
+ blend_mode = convert_blend(blend);
+ format = convert_path_format(path->format);
+ quality = convert_path_quality(path->quality);
+ tiling = (ctx->capabilities.cap.tiled == 2) ? 0x2000000 : 0;
+ fill = (fill_rule == VG_LITE_FILL_EVEN_ODD) ? 0x10 : 0;
+ tessellation_size = ( ctx->tsbuffer.tessellation_buffer_size[2]
+ ? ctx->tsbuffer.tessellation_buffer_size[2]
+ : ctx->tsbuffer.tessellation_buffer_size[1]
+ );
+
+ /* Setup the command buffer. */
+ /* Program color register. */
+ if(!ctx->premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x11000000 | ctx->capabilities.cap.tiled | 0x00000002 | image_mode | blend_mode | transparency_mode));
+ } else {
+ /* enable pre-multiplied from VG to VGPE */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x01000000 | ctx->capabilities.cap.tiled | 0x00000002 | image_mode | blend_mode | transparency_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000400 | format | quality | tiling | fill));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3B, 0x3F800000)); /* Path tessellation SCALE. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3C, 0x00000000)); /* Path tessellation BIAS. */
+ /* Program matrix. */
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A40, (void *) &matrix->m[0][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A41, (void *) &matrix->m[0][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A42, (void *) &matrix->m[0][2]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A43, (void *) &matrix->m[1][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A44, (void *) &matrix->m[1][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A45, (void *) &matrix->m[1][2]));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1)
+ {
+ if (path->path_changed != 0) {
+ if (path->uploaded.handle != NULL) {
+ free_memory.memory_handle = path->uploaded.handle;
+ vg_lite_kernel(VG_LITE_FREE, &free_memory);
+ path->uploaded.address = 0;
+ path->uploaded.memory = NULL;
+ path->uploaded.handle = NULL;
+ }
+ /* Allocate memory for the path data. */
+ memory.bytes = 16 + VG_LITE_ALIGN(path->path_length, 8);
+ return_offset = (8 + VG_LITE_ALIGN(path->path_length, 8)) / 4;
+ memory.contiguous = 1;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &memory));
+ ((uint64_t *) memory.memory)[(path->path_length + 7) / 8] = 0;
+ ((uint32_t *) memory.memory)[0] = VG_LITE_DATA((path->path_length + 7) / 8);
+ ((uint32_t *) memory.memory)[1] = 0;
+ memcpy((uint8_t *) memory.memory + 8, path->path, path->path_length);
+ ((uint32_t *) memory.memory)[return_offset] = VG_LITE_RETURN();
+ ((uint32_t *) memory.memory)[return_offset + 1] = 0;
+
+ path->uploaded.handle = memory.memory_handle;
+ path->uploaded.memory = memory.memory;
+ path->uploaded.address = memory.memory_gpu;
+ path->uploaded.bytes = memory.bytes;
+ path->path_changed = 0;
+ }
+ }
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+
+ vglitemDUMP_BUFFER("path", path->uploaded.address, (uint8_t *)(path->uploaded.memory), 0, path->uploaded.bytes);
+ }
+
+ vglitemDUMP("@[memory 0x%08X 0x%08X]", ctx->tsbuffer.tessellation_buffer_gpu[0], ctx->tsbuffer.tessellation_buffer_size[0]);
+
+ /* Setup tessellation loop. */
+ if((path->path_type & 0x1) == VG_LITE_DRAW_FILL_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ push_data(ctx, path->path_length, path->path);
+ }
+ }
+ }
+ }
+ /* Setup tessellation loop. */
+ if(path->path_type == VG_LITE_DRAW_STROKE_PATH || path->path_type == VG_LITE_DRAW_FILL_STROKE_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ format = convert_path_format(VG_LITE_FP32);
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000200 | format | quality | tiling | 0x0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, path->stroke_color));
+ push_data(ctx, path->stroke_path_size, path->stroke_path_data);
+ }
+ }
+ }
+ }
+
+ /* Finialize command buffer. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0));
+
+ vglitemDUMP_BUFFER("image", source->address, source->memory, 0, (source->stride)*(source->height));
+#if DUMP_IMAGE
+ dump_img(source->memory, source->width, source->height, source->format);
+#endif
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ tls->t_context.ts_init = 1;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+ return error;
+}
+
+vg_lite_error_t vg_lite_draw_radial_gradient(vg_lite_buffer_t * target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * path_matrix,
+ vg_lite_radial_gradient_t *grad,
+ vg_lite_color_t paint_color,
+ vg_lite_blend_t blend,
+ vg_lite_filter_t filter)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t imageMode;
+ uint32_t blend_mode;
+ uint32_t conversion = 0;
+ uint32_t tiled_source;
+ int32_t dst_align_width;
+ uint32_t mul, div, align;
+ vg_lite_matrix_t inverse_matrix;
+ vg_lite_buffer_t * source = &grad->image;
+ vg_lite_matrix_t * matrix = &grad->matrix;
+ uint32_t rad_tile = 0;
+ uint32_t transparency_mode = 0;
+ void *data;
+
+ /* The following code is from "draw path" */
+ uint32_t format, quality, tiling, fill;
+ uint32_t tessellation_size;
+
+ vg_lite_kernel_allocate_t memory;
+ vg_lite_kernel_free_t free_memory;
+ uint32_t return_offset = 0;
+
+ vg_lite_point_t point_min = {0}, point_max = {0}, temp = {0};
+ int x, y, width, height;
+ uint8_t ts_is_fullscreen = 0;
+
+ vg_lite_float_t radius;
+
+ vg_lite_float_t centerX, centerY;
+ vg_lite_float_t focalX, focalY;
+ vg_lite_float_t fx, fy;
+ vg_lite_float_t fxfy_2;
+ vg_lite_float_t radius2;
+ vg_lite_float_t r2_fx2, r2_fy2;
+ vg_lite_float_t r2_fx2_2, r2_fy2_2;
+ vg_lite_float_t r2_fx2_fy2;
+ vg_lite_float_t r2_fx2_fy2sq;
+ vg_lite_float_t cx, cy;
+
+ vg_lite_float_t rgConstantLin, rgStepXLin, rgStepYLin;
+ vg_lite_float_t rgConstantRad, rgStepXRad, rgStepYRad;
+ vg_lite_float_t rgStepXXRad, rgStepYYRad, rgStepXYRad;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!path->path_length)
+ return VG_LITE_SUCCESS;
+
+ if(!path->path)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_RADIAL_GRADIENT))
+ return VG_LITE_NOT_SUPPORT;
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_QUALITY_8X) && path->quality == VG_LITE_UPPER){
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ if(source->format == VG_LITE_A4 || source->format == VG_LITE_A8) {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ radius = grad->radialGradient.r;
+ if(radius <= 0)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ error = set_render_target(target);
+ if (error != VG_LITE_SUCCESS) {
+ return error;
+ } else if (error == VG_LITE_NO_CONTEXT) {
+ /* If scissoring is enabled and no valid scissoring rectangles
+ are present, no drawing occurs */
+ return VG_LITE_SUCCESS;
+ }
+
+ transparency_mode = (source->transparency_mode == VG_LITE_IMAGE_TRANSPARENT ? 0x8000:0);
+ width = ctx->tsbuffer.tessellation_width_height & 0xFFFF;
+ height = ctx->tsbuffer.tessellation_width_height >> 16;
+ get_format_bytes(target->format, &mul, &div, &align);
+ dst_align_width = target->stride * div / mul;
+ if(width == 0 || height == 0)
+ return VG_LITE_NO_CONTEXT;
+ if ((dst_align_width <= width) && (target->height <= height))
+ {
+ ts_is_fullscreen = 1;
+ point_min.x = 0;
+ point_min.y = 0;
+ point_max.x = dst_align_width;
+ point_max.y = target->height;
+ }
+
+ /* If target is L8 and source is in YUV or RGB (not L8 or A8) then we have to convert RGB into L8. */
+ if ((target->format == VG_LITE_L8) && ((source->format != VG_LITE_L8) && (source->format != VG_LITE_A8))) {
+ conversion = 0x80000000;
+ }
+
+ /* Determine image mode (NORMAL or MULTIPLY) depending on the color. */
+ imageMode = (source->image_mode == VG_LITE_NONE_IMAGE_MODE) ? 0 : (source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE) ? 0x00002000 : 0x00001000;
+ tiled_source = (source->tiled != VG_LITE_LINEAR) ? 0x10000000 : 0 ;
+
+ rad_tile = (grad->SpreadMode == VG_LITE_RADIAL_GRADIENT_SPREAD_FILL) ? 0 :
+ (grad->SpreadMode == VG_LITE_RADIAL_GRADIENT_SPREAD_PAD) ? 0x1000 :
+ (grad->SpreadMode == VG_LITE_RADIAL_GRADIENT_SPREAD_REPEAT) ? 0x2000 : 0x3000;
+
+ if (grad->SpreadMode == VG_LITE_RADIAL_GRADIENT_SPREAD_FILL)
+ {
+ uint8_t a,r,g,b;
+ a = paint_color >> 24;
+ r = paint_color >> 16;
+ g = paint_color >> 8;
+ b = paint_color;
+ paint_color = (a << 24) | (b << 16) | (g << 8) | r;
+ }
+
+ /* compute radial gradient paremeters */
+
+ /* Compute inverse matrix. */
+ if (!inverse(&inverse_matrix, matrix))
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Make shortcuts to the gradient information. */
+ centerX = grad->radialGradient.cx;
+ centerY = grad->radialGradient.cy;
+ focalX = grad->radialGradient.fx;
+ focalY = grad->radialGradient.fy;
+
+ /* Compute constants of the equation. */
+ fx = focalX - centerX;
+ fy = focalY - centerY;
+ radius2 = radius * radius;
+ if (fx*fx + fy*fy > radius2)
+ {
+ /* If the focal point is outside the circle, let's move it
+ to inside the circle. Per vg11 spec pg125 "If (fx, fy) lies outside ...
+ For here, we set it at 0.9 ratio to the center.
+ */
+ vg_lite_float_t fr = (vg_lite_float_t)sqrt(fx*fx + fy*fy);
+ fx = radius * fx / fr * 0.9f;
+ fy = radius * fy / fr * 0.9f;
+ focalX = grad->radialGradient.fx + fx;
+ focalY = grad->radialGradient.fy + fy;
+ }
+
+ fxfy_2 = 2.0f * fx * fy;
+ r2_fx2 = radius2 - fx * fx;
+ r2_fy2 = radius2 - fy * fy;
+ r2_fx2_2 = 2.0f * r2_fx2;
+ r2_fy2_2 = 2.0f * r2_fy2;
+ r2_fx2_fy2 = r2_fx2 - fy * fy;
+ r2_fx2_fy2sq = r2_fx2_fy2 * r2_fx2_fy2;
+
+ /* _____________________________________
+ ** dx fx + dy fy + \/r^2 (dx^2 + dy^2) - (dx fy - dy fx)^2
+ ** g = -------------------------------------------------------
+ ** r^2 - fx^2 - fy^2
+ **
+ ** Where
+ **
+ ** dx := F(x) - focalX
+ ** dy := F(y) - focalY
+ ** fx := focalX - centerX
+ ** fy := focalX - centerY
+ **
+ ** and
+ **
+ ** F(x) := (x + 0.5) m00 + (y + 0.5) m01 + m02
+ ** F(y) := (x + 0.5) m10 + (y + 0.5) m11 + m12
+ **
+ ** So, dx can be factored into
+ **
+ ** dx = (x + 0.5) m00 + (y + 0.5) m01 + m02 - focalX
+ ** = x m00 + y m01 + 0.5 m00 + 0.5 m01 + m02 - focalX
+ **
+ ** = x m00 + y m01 + cx
+ **
+ ** where
+ **
+ ** cx := 0.5 m00 + 0.5 m01 + m02 - focalX
+ **
+ ** The same way we can factor dy into
+ **
+ ** dy = x m10 + y m11 + cy
+ **
+ ** where
+ **
+ ** cy := 0.5 m10 + 0.5 m11 + m12 - focalY.
+ **
+ ** Now we can rewrite g as
+ ** ______________________________________
+ ** dx fx + dy fy / r^2 (dx^2 + dy^2) - (dx fy - dy fx)^2
+ ** g = ----------------- + \ / -------------------------------------
+ ** r^2 - fx^2 - fy^2 \/ (r^2 - fx^2 - fy^2)^2
+ ** ____
+ ** = gLin + \/gRad
+ **
+ ** where
+ **
+ ** dx fx + dy fy
+ ** gLin := -----------------
+ ** r^2 - fx^2 - fy^2
+ **
+ ** r^2 (dx^2 + dy^2) - (dx fy - dy fx)^2
+ ** gRad := -------------------------------------
+ ** (r^2 - fx^2 - fy^2)^2
+ */
+
+ cx
+ = 0.5f * ( MAT(&inverse_matrix, 0, 0) + MAT(&inverse_matrix, 0, 1) )
+ + MAT(&inverse_matrix, 0, 2)
+ - focalX;
+
+ cy
+ = 0.5f * ( MAT(&inverse_matrix, 1, 0) + MAT(&inverse_matrix, 1, 1) )
+ + MAT(&inverse_matrix, 1, 2)
+ - focalY;
+
+ /*
+ ** dx fx + dy fy
+ ** gLin := -----------------
+ ** r^2 - fx^2 - fy^2
+ **
+ ** We can factor the top half into
+ **
+ ** = (x m00 + y m01 + cx) fx + (x m10 + y m11 + cy) fy
+ **
+ ** = x (m00 fx + m10 fy)
+ ** + y (m01 fx + m11 fy)
+ ** + cx fx + cy fy.
+ */
+
+ rgStepXLin
+ = ( MAT(&inverse_matrix, 0, 0) * fx + MAT(&inverse_matrix, 1, 0) * fy )
+ / r2_fx2_fy2;
+
+ rgStepYLin
+ = ( MAT(&inverse_matrix, 0, 1) * fx + MAT(&inverse_matrix, 1, 1) * fy )
+ / r2_fx2_fy2;
+
+ rgConstantLin = ( cx * fx + cy * fy ) / r2_fx2_fy2;
+
+ /*
+ ** r^2 (dx^2 + dy^2) - (dx fy - dy fx)^2
+ ** gRad := -------------------------------------
+ ** (r^2 - fx^2 - fy^2)^2
+ **
+ ** r^2 (dx^2 + dy^2) - dx^2 fy^2 - dy^2 fx^2 + 2 dx dy fx fy
+ ** := ---------------------------------------------------------
+ ** (r^2 - fx^2 - fy^2)^2
+ **
+ ** dx^2 (r^2 - fy^2) + dy^2 (r^2 - fx^2) + 2 dx dy fx fy
+ ** := -----------------------------------------------------
+ ** (r^2 - fx^2 - fy^2)^2
+ **
+ ** First, lets factor dx^2 into
+ **
+ ** dx^2 = (x m00 + y m01 + cx)^2
+ ** = x^2 m00^2 + y^2 m01^2 + 2 x y m00 m01
+ ** + 2 x m00 cx + 2 y m01 cx + cx^2
+ **
+ ** = x^2 (m00^2)
+ ** + y^2 (m01^2)
+ ** + x y (2 m00 m01)
+ ** + x (2 m00 cx)
+ ** + y (2 m01 cx)
+ ** + cx^2.
+ **
+ ** The same can be done for dy^2:
+ **
+ ** dy^2 = x^2 (m10^2)
+ ** + y^2 (m11^2)
+ ** + x y (2 m10 m11)
+ ** + x (2 m10 cy)
+ ** + y (2 m11 cy)
+ ** + cy^2.
+ **
+ ** Let's also factor dx dy into
+ **
+ ** dx dy = (x m00 + y m01 + cx) (x m10 + y m11 + cy)
+ ** = x^2 m00 m10 + y^2 m01 m11 + x y m00 m11 + x y m01 m10
+ ** + x m00 cy + x m10 cx + y m01 cy + y m11 cx + cx cy
+ **
+ ** = x^2 (m00 m10)
+ ** + y^2 (m01 m11)
+ ** + x y (m00 m11 + m01 m10)
+ ** + x (m00 cy + m10 cx)
+ ** + y (m01 cy + m11 cx)
+ ** + cx cy.
+ **
+ ** Now that we have all this, lets look at the top of gRad.
+ **
+ ** = dx^2 (r^2 - fy^2) + dy^2 (r^2 - fx^2) + 2 dx dy fx fy
+ ** = x^2 m00^2 (r^2 - fy^2) + y^2 m01^2 (r^2 - fy^2)
+ ** + x y 2 m00 m01 (r^2 - fy^2) + x 2 m00 cx (r^2 - fy^2)
+ ** + y 2 m01 cx (r^2 - fy^2) + cx^2 (r^2 - fy^2)
+ ** + x^2 m10^2 (r^2 - fx^2) + y^2 m11^2 (r^2 - fx^2)
+ ** + x y 2 m10 m11 (r^2 - fx^2) + x 2 m10 cy (r^2 - fx^2)
+ ** + y 2 m11 cy (r^2 - fx^2) + cy^2 (r^2 - fx^2)
+ ** + x^2 m00 m10 2 fx fy + y^2 m01 m11 2 fx fy
+ ** + x y (m00 m11 + m01 m10) 2 fx fy
+ ** + x (m00 cy + m10 cx) 2 fx fy + y (m01 cy + m11 cx) 2 fx fy
+ ** + cx cy 2 fx fy
+ **
+ ** = x^2 ( m00^2 (r^2 - fy^2)
+ ** + m10^2 (r^2 - fx^2)
+ ** + m00 m10 2 fx fy
+ ** )
+ ** + y^2 ( m01^2 (r^2 - fy^2)
+ ** + m11^2 (r^2 - fx^2)
+ ** + m01 m11 2 fx fy
+ ** )
+ ** + x y ( 2 m00 m01 (r^2 - fy^2)
+ ** + 2 m10 m11 (r^2 - fx^2)
+ ** + (m00 m11 + m01 m10) 2 fx fy
+ ** )
+ ** + x ( 2 m00 cx (r^2 - fy^2)
+ ** + 2 m10 cy (r^2 - fx^2)
+ ** + (m00 cy + m10 cx) 2 fx fy
+ ** )
+ ** + y ( 2 m01 cx (r^2 - fy^2)
+ ** + 2 m11 cy (r^2 - fx^2)
+ ** + (m01 cy + m11 cx) 2 fx fy
+ ** )
+ ** + cx^2 (r^2 - fy^2) + cy^2 (r^2 - fx^2) + cx cy 2 fx fy.
+ */
+
+ rgStepXXRad =
+ (
+ MAT(&inverse_matrix, 0, 0) * MAT(&inverse_matrix, 0, 0) * r2_fy2
+ + MAT(&inverse_matrix, 1, 0) * MAT(&inverse_matrix, 1, 0) * r2_fx2
+ + MAT(&inverse_matrix, 0, 0) * MAT(&inverse_matrix, 1, 0) * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+ rgStepYYRad =
+ (
+ MAT(&inverse_matrix, 0, 1) * MAT(&inverse_matrix, 0, 1) * r2_fy2
+ + MAT(&inverse_matrix, 1, 1) * MAT(&inverse_matrix, 1, 1) * r2_fx2
+ + MAT(&inverse_matrix, 0, 1) * MAT(&inverse_matrix, 1, 1) * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+ rgStepXYRad =
+ (
+ MAT(&inverse_matrix, 0, 0) * MAT(&inverse_matrix, 0, 1) * r2_fy2_2
+ + MAT(&inverse_matrix, 1, 0) * MAT(&inverse_matrix, 1, 1) * r2_fx2_2
+ + (
+ MAT(&inverse_matrix, 0, 0) * MAT(&inverse_matrix, 1, 1)
+ + MAT(&inverse_matrix, 0, 1) * MAT(&inverse_matrix, 1, 0)
+ )
+ * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+ rgStepXRad =
+ (
+ MAT(&inverse_matrix, 0, 0) * cx * r2_fy2_2
+ + MAT(&inverse_matrix, 1, 0) * cy * r2_fx2_2
+ + (
+ MAT(&inverse_matrix, 0, 0) * cy
+ + MAT(&inverse_matrix, 1, 0) * cx
+ )
+ * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+ rgStepYRad =
+ (
+ MAT(&inverse_matrix, 0, 1) * cx * r2_fy2_2
+ + MAT(&inverse_matrix, 1, 1) * cy * r2_fx2_2
+ + (
+ MAT(&inverse_matrix, 0, 1) * cy
+ + MAT(&inverse_matrix, 1, 1) * cx
+ )
+ * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+ rgConstantRad =
+ (
+ cx * cx * r2_fy2
+ + cy * cy * r2_fx2
+ + cx * cy * fxfy_2
+ )
+ / r2_fx2_fy2sq;
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ if(ctx->ts_dirty){
+ memcpy(CMDBUF_BUFFER(*ctx) + CMDBUF_OFFSET(*ctx), ctx->ts_record, 80);
+ CMDBUF_OFFSET(*ctx) += 80;
+ ctx->ts_dirty = 0;
+ ctx->ts_init_used = 1;
+ }
+ else
+ {
+ ctx->ts_init_use = 1;
+ }
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+ /* Setup the command buffer. */
+
+ /* rad gradient parameters*/
+ data = &rgConstantLin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A04,*(uint32_t*) data));
+ data = &rgStepXLin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A06,*(uint32_t*) data));
+ data = &rgStepYLin;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A08,*(uint32_t*) data));
+ data = &rgConstantRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A05,*(uint32_t*) data));
+ data = &rgStepXRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A07,*(uint32_t*) data));
+ data = &rgStepYRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A09,*(uint32_t*) data));
+ data = &rgStepXXRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A03,*(uint32_t*) data));
+ data = &rgStepYYRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A0A,*(uint32_t*) data));
+ data = &rgStepXYRad;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A0B,*(uint32_t*) data));
+ VG_LITE_RETURN_ERROR(set_interpolation_steps(target, source->width, source->height, matrix));
+
+ if(!ctx->premultiply_enabled) {
+ if(source->transparency_mode == VG_LITE_IMAGE_OPAQUE){
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | rad_tile | conversion | 0x01000100));
+ } else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | rad_tile | conversion | 0x00000100));
+ }
+ } else {
+ /* enable pre-multiplied in imager unit */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A24, convert_source_format(source->format) |
+ filter | rad_tile | conversion));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A26, paint_color));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A28, source->address));
+
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2A, tiled_source));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2C, 0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A2E, source->width));
+
+ /* Work on path states. */
+ matrix = path_matrix;
+
+ if (ts_is_fullscreen == 0){
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[1], matrix);
+ point_min = point_max = temp;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[1], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[2], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ transform(&temp, (vg_lite_float_t)path->bounding_box[0], (vg_lite_float_t)path->bounding_box[3], matrix);
+ if (temp.x < point_min.x) point_min.x = temp.x;
+ if (temp.y < point_min.y) point_min.y = temp.y;
+ if (temp.x > point_max.x) point_max.x = temp.x;
+ if (temp.y > point_max.y) point_max.y = temp.y;
+
+ point_min.x = MAX(point_min.x, 0);
+ point_min.y = MAX(point_min.y, 0);
+ point_max.x = MIN(point_max.x, dst_align_width);
+ point_max.y = MIN(point_max.y, target->height);
+ }
+
+ if (ctx->scissor_enabled) {
+ point_min.x = MAX(point_min.x, ctx->scissor[0]);
+ point_min.y = MAX(point_min.y, ctx->scissor[1]);
+ point_max.x = MIN(point_max.x, ctx->scissor[0] + ctx->scissor[2]);
+ point_max.y = MIN(point_max.y, ctx->scissor[1] + ctx->scissor[3]);
+ }
+
+ /* Convert states into hardware values. */
+ blend_mode = convert_blend(blend);
+ format = convert_path_format(path->format);
+ quality = convert_path_quality(path->quality);
+ tiling = (ctx->capabilities.cap.tiled == 2) ? 0x2000000 : 0;
+ fill = (fill_rule == VG_LITE_FILL_EVEN_ODD) ? 0x10 : 0;
+ tessellation_size = ( ctx->tsbuffer.tessellation_buffer_size[2]
+ ? ctx->tsbuffer.tessellation_buffer_size[2]
+ : ctx->tsbuffer.tessellation_buffer_size[1]
+ );
+
+ /* Setup the command buffer. */
+ /* Program color register. */
+ if(!ctx->premultiply_enabled) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x12000000 | ctx->capabilities.cap.tiled | 0x00000002 | imageMode | blend_mode | transparency_mode));
+ } else {
+ /* enable pre-multiplied from VG to VGPE */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A00, 0x02000000 | ctx->capabilities.cap.tiled | 0x00000002 | imageMode | blend_mode | transparency_mode));
+ }
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000400 | format | quality | tiling | fill));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3B, 0x3F800000)); /* Path tessellation SCALE. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3C, 0x00000000)); /* Path tessellation BIAS. */
+ /* Program matrix. */
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A40, (void *) &matrix->m[0][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A41, (void *) &matrix->m[0][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A42, (void *) &matrix->m[0][2]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A43, (void *) &matrix->m[1][0]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A44, (void *) &matrix->m[1][1]));
+ VG_LITE_RETURN_ERROR(push_state_ptr(ctx, 0x0A45, (void *) &matrix->m[1][2]));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1)
+ {
+ if (path->path_changed != 0) {
+ if (path->uploaded.handle != NULL) {
+ free_memory.memory_handle = path->uploaded.handle;
+ vg_lite_kernel(VG_LITE_FREE, &free_memory);
+ path->uploaded.address = 0;
+ path->uploaded.memory = NULL;
+ path->uploaded.handle = NULL;
+ }
+ /* Allocate memory for the path data. */
+ memory.bytes = 16 + VG_LITE_ALIGN(path->path_length, 8);
+ return_offset = (8 + VG_LITE_ALIGN(path->path_length, 8)) / 4;
+ memory.contiguous = 1;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_ALLOCATE, &memory));
+ ((uint64_t *) memory.memory)[(path->path_length + 7) / 8] = 0;
+ ((uint32_t *) memory.memory)[0] = VG_LITE_DATA((path->path_length + 7) / 8);
+ ((uint32_t *) memory.memory)[1] = 0;
+ memcpy((uint8_t *) memory.memory + 8, path->path, path->path_length);
+ ((uint32_t *) memory.memory)[return_offset] = VG_LITE_RETURN();
+ ((uint32_t *) memory.memory)[return_offset + 1] = 0;
+
+ path->uploaded.handle = memory.memory_handle;
+ path->uploaded.memory = memory.memory;
+ path->uploaded.address = memory.memory_gpu;
+ path->uploaded.bytes = memory.bytes;
+ path->path_changed = 0;
+ }
+ }
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+
+ vglitemDUMP_BUFFER("path", path->uploaded.address, (uint8_t *)(path->uploaded.memory), 0, path->uploaded.bytes);
+ }
+
+ vglitemDUMP("@[memory 0x%08X 0x%08X]", ctx->tsbuffer.tessellation_buffer_gpu[0], ctx->tsbuffer.tessellation_buffer_size[0]);
+
+ /* Setup tessellation loop. */
+ if((path->path_type & 0x1) == VG_LITE_DRAW_FILL_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ push_data(ctx, path->path_length, path->path);
+ }
+ }
+ }
+ }
+ /* Setup tessellation loop. */
+ if(path->path_type == VG_LITE_DRAW_STROKE_PATH || path->path_type == VG_LITE_DRAW_FILL_STROKE_PATH) {
+ for (y = point_min.y; y < point_max.y; y += height) {
+ for (x = point_min.x; x < point_max.x; x += width) {
+ /* Tessellate path. */
+ VG_LITE_RETURN_ERROR(push_stall(ctx, 15));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A1B, 0x00011000));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A01, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A39, x | (y << 16)));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A3D, tessellation_size / 64));
+
+ if (VLM_PATH_GET_UPLOAD_BIT(*path) == 1) {
+ VG_LITE_RETURN_ERROR(push_call(ctx, path->uploaded.address, path->uploaded.bytes));
+#if (DUMP_COMMAND)
+ if (strncmp(filename, "Commandbuffer", 13)) {
+ sprintf(filename, "Commandbuffer_pid%d.txt", getpid());
+ }
+
+ fp = fopen(filename, "a");
+
+ if (fp == NULL)
+ printf("error!\n");
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[0], 0);
+
+ unsigned char* pt = (unsigned char*) memory.memory;
+
+ for(int i = 8; i <= return_offset * 4 - 1; i = i + 4)
+ {
+ if (i % 8 == 0)
+ fprintf(fp, "Command buffer: ");
+
+ if (i % 4 == 0)
+ fprintf(fp, "0x");
+
+ for (int j = 3; j >= 0; --j)
+ fprintf(fp, "%02x", pt[i + j]);
+
+ if ((i / 4 + 1) % 2 == 0)
+ fprintf(fp, ",\n");
+ else
+ fprintf(fp, ", ");
+ }
+
+ fprintf(fp, "Command buffer: 0x%08x, 0x%08x,\n",
+ ((uint32_t *) memory.memory)[return_offset], 0);
+
+ fclose(fp);
+ fp = NULL;
+#endif
+ } else {
+ format = convert_path_format(VG_LITE_FP32);
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0x01000200 | format | quality | tiling | 0x0));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A02, path->stroke_color));
+ push_data(ctx, path->stroke_path_size, path->stroke_path_data);
+ }
+ }
+ }
+ }
+
+ /* Notify rendering area (added by MicroEJ) */
+ vg_lite_draw_notify_render_area(point_min.x, point_min.y, point_max.x, point_max.y);
+
+ /* Finialize command buffer. */
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A34, 0));
+
+ vglitemDUMP_BUFFER("image", source->address, source->memory, 0, (source->stride)*(source->height));
+#if DUMP_IMAGE
+ dump_img(source->memory, src_align_width, source->height, source->format);
+#endif
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+ tls->t_context.ts_init = 1;
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+ return error;
+}
+
+vg_lite_error_t vg_lite_init_grad(vg_lite_linear_gradient_t *grad)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ /* Set the member values according to driver defaults. */
+ grad->image.width = VLC_GRADBUFFER_WIDTH;
+ grad->image.height = 1;
+ grad->image.stride = 0;
+ grad->image.format = VG_LITE_BGRA8888;
+
+ /* Allocate the image for gradient. */
+ error = vg_lite_allocate(&grad->image);
+
+ grad->count = 0;
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_set_linear_grad(vg_lite_linear_gradient_ext_t *grad,
+ uint32_t count,
+ vg_lite_color_ramp_t *vg_color_ramp,
+ vg_lite_linear_gradient_parameter_t linear_gradient,
+ vg_lite_radial_gradient_spreadmode_t spread_mode,
+ uint8_t color_ramp_premultiplied)
+{
+ int i;
+ static vg_lite_color_ramp_t default_ramp[] =
+ {
+ {
+ 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ },
+ {
+ 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f
+ }
+ };
+
+ uint32_t trg_count;
+ vg_lite_float_t prev_stop;
+ vg_lite_color_ramp_ptr src_ramp;
+ vg_lite_color_ramp_ptr src_ramp_last;
+ vg_lite_color_ramp_ptr trg_ramp;
+
+ /* Reset the count. */
+ trg_count = 0;
+
+ if ((linear_gradient.X0 == linear_gradient.X1) && (linear_gradient.Y0 == linear_gradient.Y1))
+ return VG_LITE_INVALID_ARGUMENT;
+
+ grad->linear_gradient = linear_gradient;
+ grad->color_ramp_premultiplied = color_ramp_premultiplied;
+ grad->spread_mode = spread_mode;
+
+ if (!count || count > MAX_COLOR_RAMP_STOPS || vg_color_ramp == NULL)
+ goto Empty_sequence_handler;
+
+ for(i = 0; i < count;i++)
+ grad->vg_color_ramp[i] = vg_color_ramp[i];
+ grad->vg_color_ramp_length = count;
+
+ /* Determine the last source ramp. */
+ src_ramp_last
+ = grad->vg_color_ramp
+ + grad->vg_color_ramp_length;
+
+ /* Set the initial previous stop. */
+ prev_stop = -1;
+
+ /* Reset the count. */
+ trg_count = 0;
+
+ /* Walk through the source ramp. */
+ for (
+ src_ramp = grad->vg_color_ramp, trg_ramp = grad->int_color_ramp;
+ (src_ramp < src_ramp_last) && (trg_count < MAX_COLOR_RAMP_STOPS + 2);
+ src_ramp += 1
+ )
+ {
+ /* Must be in increasing order. */
+ if (src_ramp->stop < prev_stop)
+ {
+ /* Ignore the entire sequence. */
+ trg_count = 0;
+ break;
+ }
+
+ /* Update the previous stop value. */
+ prev_stop = src_ramp->stop;
+
+ /* Must be within [0..1] range. */
+ if ((src_ramp->stop < 0.0f) || (src_ramp->stop > 1.0f))
+ {
+ /* Ignore. */
+ continue;
+ }
+
+ /* Clamp color. */
+ ClampColor(COLOR_FROM_RAMP(src_ramp),COLOR_FROM_RAMP(trg_ramp),0);
+
+ /* First stop greater then zero? */
+ if ((trg_count == 0) && (src_ramp->stop > 0.0f))
+ {
+ /* Force the first stop to 0.0f. */
+ trg_ramp->stop = 0.0f;
+
+ /* Replicate the entry. */
+ trg_ramp[1] = *trg_ramp;
+ trg_ramp[1].stop = src_ramp->stop;
+
+ /* Advance. */
+ trg_ramp += 2;
+ trg_count += 2;
+ }
+ else
+ {
+ /* Set the stop value. */
+ trg_ramp->stop = src_ramp->stop;
+
+ /* Advance. */
+ trg_ramp += 1;
+ trg_count += 1;
+ }
+ }
+
+ /* Empty sequence? */
+ if (trg_count == 0)
+ {
+ memcpy(grad->int_color_ramp,default_ramp,sizeof(default_ramp));
+ grad->int_color_ramp_length = sizeof(default_ramp) / 5;
+ }
+ else
+ {
+ /* The last stop must be at 1.0. */
+ if (trg_ramp[-1].stop != 1.0f)
+ {
+ /* Replicate the last entry. */
+ *trg_ramp = trg_ramp[-1];
+
+ /* Force the last stop to 1.0f. */
+ trg_ramp->stop = 1.0f;
+
+ /* Update the final entry count. */
+ trg_count += 1;
+ }
+
+ /* Set new length. */
+ grad->int_color_ramp_length = trg_count;
+ }
+ return VG_LITE_SUCCESS;
+
+Empty_sequence_handler:
+ memcpy(grad->int_color_ramp,default_ramp,sizeof(default_ramp));
+ grad->int_color_ramp_length = sizeof(default_ramp) / 5;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_update_linear_grad(vg_lite_linear_gradient_ext_t *grad)
+{
+ uint32_t color_ramp_length;
+ vg_lite_color_ramp_ptr color_ramp;
+ uint32_t common, stop;
+ uint32_t i, width;
+ uint8_t* bits;
+ vg_lite_float_t x0,y0,x1,y1,length;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ /* Get shortcuts to the color ramp. */
+ color_ramp_length = grad->int_color_ramp_length;
+ color_ramp = grad->int_color_ramp;
+
+ x0 = grad->linear_gradient.X0;
+ y0 = grad->linear_gradient.Y0;
+ x1 = grad->linear_gradient.X1;
+ y1 = grad->linear_gradient.Y1;
+ length = (vg_lite_float_t)sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
+
+ if(length <= 0)
+ return VG_LITE_INVALID_ARGUMENT;
+ /* Find the common denominator of the color ramp stops. */
+ if (length < 1)
+ {
+ common = 1;
+ }
+ else
+ {
+ common = (uint32_t)length;
+ }
+
+ for (i = 0; i < color_ramp_length; ++i)
+ {
+ if (color_ramp[i].stop != 0.0f)
+ {
+ vg_lite_float_t mul = common * color_ramp[i].stop;
+ vg_lite_float_t frac = mul - (vg_lite_float_t) floor(mul);
+ if (frac > 0.00013f) /* Suppose error for zero is 0.00013 */
+ {
+ common = MAX(common, (uint32_t) (1.0f / frac + 0.5f));
+ }
+ }
+ }
+
+ /* Compute the width of the required color array. */
+ width = common + 1;
+
+ /* Allocate the color ramp surface. */
+ memset(&grad->image, 0, sizeof(grad->image));
+ grad->image.width = width;
+ grad->image.height = 1;
+ grad->image.stride = 0;
+ grad->image.image_mode = VG_LITE_NONE_IMAGE_MODE;
+ grad->image.format = VG_LITE_ABGR8888;
+
+ /* Allocate the image for gradient. */
+ VG_LITE_RETURN_ERROR(vg_lite_allocate(&grad->image));
+
+ grad->image.width = width;
+
+ /* Set pointer to color array. */
+ bits = (uint8_t *)grad->image.memory;
+
+ /* Start filling the color array. */
+ stop = 0;
+ for (i = 0; i < width; ++i)
+ {
+ vg_lite_float_t gradient;
+ vg_lite_float_t color[4];
+ vg_lite_float_t color1[4];
+ vg_lite_float_t color2[4];
+ vg_lite_float_t weight;
+
+ /* Compute gradient for current color array entry. */
+ gradient = (vg_lite_float_t) i / (vg_lite_float_t) (width - 1);
+
+ /* Find the entry in the color ramp that matches or exceeds this
+ ** gradient. */
+ while ((stop < color_ramp_length - 1) && (gradient > color_ramp[stop].stop))
+ {
+ ++stop;
+ }
+
+ if (gradient == color_ramp[stop].stop)
+ {
+ /* Perfect match weight 1.0. */
+ weight = 1.0f;
+
+ /* Use color ramp color. */
+ color1[3] = color_ramp[stop].alpha;
+ color1[2] = color_ramp[stop].blue;
+ color1[1] = color_ramp[stop].green;
+ color1[0] = color_ramp[stop].red;
+
+ color2[3] =
+ color2[2] =
+ color2[1] =
+ color2[0] = 0.0f;
+ }
+ else
+ {
+ /* Compute weight. */
+ weight = (color_ramp[stop].stop - gradient)
+ / (color_ramp[stop].stop - color_ramp[stop - 1].stop);
+
+ /* Grab color ramp color of previous stop. */
+ color1[3] = color_ramp[stop - 1].alpha;
+ color1[2] = color_ramp[stop - 1].blue;
+ color1[1] = color_ramp[stop - 1].green;
+ color1[0] = color_ramp[stop - 1].red;
+
+ /* Grab color ramp color of current stop. */
+ color2[3] = color_ramp[stop].alpha;
+ color2[2] = color_ramp[stop].blue;
+ color2[1] = color_ramp[stop].green;
+ color2[0] = color_ramp[stop].red;
+ }
+
+ if (grad->color_ramp_premultiplied)
+ {
+ /* Pre-multiply the first color. */
+ color1[2] *= color1[3];
+ color1[1] *= color1[3];
+ color1[0] *= color1[3];
+
+ /* Pre-multiply the second color. */
+ color2[2] *= color2[3];
+ color2[1] *= color2[3];
+ color2[0] *= color2[3];
+ }
+
+ /* Filter the colors per channel. */
+ color[3] = LERP(color1[3], color2[3], weight);
+ color[2] = LERP(color1[2], color2[2], weight);
+ color[1] = LERP(color1[1], color2[1], weight);
+ color[0] = LERP(color1[0], color2[0], weight);
+
+ /* Pack the final color. */
+ *bits++ = PackColorComponent(color[3]);
+ *bits++ = PackColorComponent(color[2]);
+ *bits++ = PackColorComponent(color[1]);
+ *bits++ = PackColorComponent(color[0]);
+ }
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_set_rad_grad(vg_lite_radial_gradient_t *grad,
+ uint32_t count,
+ vg_lite_color_ramp_t *vgColorRamp,
+ vg_lite_radial_gradient_parameter_t radialGradient,
+ vg_lite_radial_gradient_spreadmode_t SpreadMode,
+ uint8_t colorRampPremultiplied)
+{
+ int i;
+ static vg_lite_color_ramp_t defaultRamp[] =
+ {
+ {
+ 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ },
+ {
+ 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f
+ }
+ };
+
+ uint32_t trgCount;
+ vg_lite_float_t prevStop;
+ vg_lite_color_ramp_ptr srcRamp;
+ vg_lite_color_ramp_ptr srcRampLast;
+ vg_lite_color_ramp_ptr trgRamp;
+
+ /* Reset the count. */
+ trgCount = 0;
+
+ if(radialGradient.r <= 0)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ grad->radialGradient = radialGradient;
+ grad->colorRampPremultiplied = colorRampPremultiplied;
+ grad->SpreadMode = SpreadMode;
+
+ if (!count || count > MAX_COLOR_RAMP_STOPS || vgColorRamp == NULL)
+ goto Empty_sequence_handler;
+
+ for(i = 0; i < count;i++)
+ grad->vgColorRamp[i] = vgColorRamp[i];
+ grad->vgColorRampLength = count;
+
+ /* Determine the last source ramp. */
+ srcRampLast
+ = grad->vgColorRamp
+ + grad->vgColorRampLength;
+
+ /* Set the initial previous stop. */
+ prevStop = -1;
+
+ /* Reset the count. */
+ trgCount = 0;
+
+ /* Walk through the source ramp. */
+ for (
+ srcRamp = grad->vgColorRamp, trgRamp = grad->intColorRamp;
+ (srcRamp < srcRampLast) && (trgCount < MAX_COLOR_RAMP_STOPS + 2);
+ srcRamp += 1
+ )
+ {
+ /* Must be in increasing order. */
+ if (srcRamp->stop < prevStop)
+ {
+ /* Ignore the entire sequence. */
+ trgCount = 0;
+ break;
+ }
+
+ /* Update the previous stop value. */
+ prevStop = srcRamp->stop;
+
+ /* Must be within [0..1] range. */
+ if ((srcRamp->stop < 0.0f) || (srcRamp->stop > 1.0f))
+ {
+ /* Ignore. */
+ continue;
+ }
+
+ /* Clamp color. */
+ ClampColor(COLOR_FROM_RAMP(srcRamp),COLOR_FROM_RAMP(trgRamp),0);
+
+ /* First stop greater then zero? */
+ if ((trgCount == 0) && (srcRamp->stop > 0.0f))
+ {
+ /* Force the first stop to 0.0f. */
+ trgRamp->stop = 0.0f;
+
+ /* Replicate the entry. */
+ trgRamp[1] = *trgRamp;
+ trgRamp[1].stop = srcRamp->stop;
+
+ /* Advance. */
+ trgRamp += 2;
+ trgCount += 2;
+ }
+ else
+ {
+ /* Set the stop value. */
+ trgRamp->stop = srcRamp->stop;
+
+ /* Advance. */
+ trgRamp += 1;
+ trgCount += 1;
+ }
+ }
+
+ /* Empty sequence? */
+ if (trgCount == 0)
+ {
+ memcpy(grad->intColorRamp,defaultRamp,sizeof(defaultRamp));
+ grad->intColorRampLength = sizeof(defaultRamp) / 5;
+ }
+ else
+ {
+ /* The last stop must be at 1.0. */
+ if (trgRamp[-1].stop != 1.0f)
+ {
+ /* Replicate the last entry. */
+ *trgRamp = trgRamp[-1];
+
+ /* Force the last stop to 1.0f. */
+ trgRamp->stop = 1.0f;
+
+ /* Update the final entry count. */
+ trgCount += 1;
+ }
+
+ /* Set new length. */
+ grad->intColorRampLength = trgCount;
+ }
+ return VG_LITE_SUCCESS;
+
+Empty_sequence_handler:
+ memcpy(grad->intColorRamp,defaultRamp,sizeof(defaultRamp));
+ grad->intColorRampLength = sizeof(defaultRamp) / 5;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_update_rad_grad(vg_lite_radial_gradient_t *grad)
+{
+ uint32_t colorRampLength;
+ vg_lite_color_ramp_ptr colorRamp;
+ uint32_t common, stop;
+ uint32_t i, width;
+ uint8_t* bits;
+ vg_lite_float_t r;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ /* Get shortcuts to the color ramp. */
+ colorRampLength = grad->intColorRampLength;
+ colorRamp = grad->intColorRamp;
+
+ r = grad->radialGradient.r;
+
+ if(r <= 0)
+ return VG_LITE_INVALID_ARGUMENT;
+ /* Find the common denominator of the color ramp stops. */
+ if (r < 1)
+ {
+ common = 1;
+ }
+ else
+ {
+ common = (uint32_t)r;
+ }
+
+ for (i = 0; i < colorRampLength; ++i)
+ {
+ if (colorRamp[i].stop != 0.0f)
+ {
+ vg_lite_float_t mul = common * colorRamp[i].stop;
+ vg_lite_float_t frac = mul - (vg_lite_float_t) floor(mul);
+ if (frac > 0.00013f) /* Suppose error for zero is 0.00013 */
+ {
+ common = MAX(common, (uint32_t) (1.0f / frac + 0.5f));
+ }
+ }
+ }
+
+ /* Compute the width of the required color array. */
+ width = common + 1;
+
+ /* Allocate the color ramp surface. */
+ memset(&grad->image, 0, sizeof(grad->image));
+ grad->image.width = width;
+ grad->image.height = 1;
+ grad->image.stride = 0;
+ grad->image.image_mode = VG_LITE_NONE_IMAGE_MODE;
+ grad->image.format = VG_LITE_ABGR8888;
+
+ /* Allocate the image for gradient. */
+ VG_LITE_RETURN_ERROR(vg_lite_allocate(&grad->image));
+
+ grad->image.width = width;
+
+ /* Set pointer to color array. */
+ bits = (uint8_t *)grad->image.memory;
+
+ /* Start filling the color array. */
+ stop = 0;
+ for (i = 0; i < width; ++i)
+ {
+ vg_lite_float_t gradient;
+ vg_lite_float_t color[4];
+ vg_lite_float_t color1[4];
+ vg_lite_float_t color2[4];
+ vg_lite_float_t weight;
+
+ /* Compute gradient for current color array entry. */
+ gradient = (vg_lite_float_t) i / (vg_lite_float_t) (width - 1);
+
+ /* Find the entry in the color ramp that matches or exceeds this
+ ** gradient. */
+ while ((stop < colorRampLength - 1) && (gradient > colorRamp[stop].stop))
+ {
+ ++stop;
+ }
+
+ if (gradient == colorRamp[stop].stop)
+ {
+ /* Perfect match weight 1.0. */
+ weight = 1.0f;
+
+ /* Use color ramp color. */
+ color1[3] = colorRamp[stop].alpha;
+ color1[2] = colorRamp[stop].blue;
+ color1[1] = colorRamp[stop].green;
+ color1[0] = colorRamp[stop].red;
+
+ color2[3] =
+ color2[2] =
+ color2[1] =
+ color2[0] = 0.0f;
+ }
+ else
+ {
+ /* Compute weight. */
+ weight = (colorRamp[stop].stop - gradient)
+ / (colorRamp[stop].stop - colorRamp[stop - 1].stop);
+
+ /* Grab color ramp color of previous stop. */
+ color1[3] = colorRamp[stop - 1].alpha;
+ color1[2] = colorRamp[stop - 1].blue;
+ color1[1] = colorRamp[stop - 1].green;
+ color1[0] = colorRamp[stop - 1].red;
+
+ /* Grab color ramp color of current stop. */
+ color2[3] = colorRamp[stop].alpha;
+ color2[2] = colorRamp[stop].blue;
+ color2[1] = colorRamp[stop].green;
+ color2[0] = colorRamp[stop].red;
+ }
+
+ if (grad->colorRampPremultiplied)
+ {
+ /* Pre-multiply the first color. */
+ color1[2] *= color1[3];
+ color1[1] *= color1[3];
+ color1[0] *= color1[3];
+
+ /* Pre-multiply the second color. */
+ color2[2] *= color2[3];
+ color2[1] *= color2[3];
+ color2[0] *= color2[3];
+ }
+
+ /* Filter the colors per channel. */
+ color[3] = LERP(color1[3], color2[3], weight);
+ color[2] = LERP(color1[2], color2[2], weight);
+ color[1] = LERP(color1[1], color2[1], weight);
+ color[0] = LERP(color1[0], color2[0], weight);
+
+ /* Pack the final color. */
+ *bits++ = PackColorComponent(color[3]);
+ *bits++ = PackColorComponent(color[2]);
+ *bits++ = PackColorComponent(color[1]);
+ *bits++ = PackColorComponent(color[0]);
+ }
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_set_grad(vg_lite_linear_gradient_t *grad,
+ uint32_t count,
+ uint32_t * colors,
+ uint32_t * stops)
+{
+ uint32_t i;
+
+ grad->count = 0; /* Opaque B&W gradient */
+ if (!count || count > VLC_MAX_GRAD || colors == NULL || stops == NULL)
+ return VG_LITE_SUCCESS;
+ /* Check stops validity */
+ for (i = 0; i < count; i++)
+ if (stops[i] <= 255) {
+ if (!grad->count || stops[i] > grad->stops[grad->count - 1]) {
+ grad->stops[grad->count] = stops[i];
+ grad->colors[grad->count] = colors[i];
+ grad->count++;
+ } else if (stops[i] == grad->stops[grad->count - 1]) {
+ /* Equal stops : use the color corresponding to the last stop
+ in the sequence */
+ grad->colors[grad->count - 1] = colors[i];
+ }
+ }
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_update_grad(vg_lite_linear_gradient_t *grad)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ int32_t r0, g0, b0, a0;
+ int32_t r1, g1, b1, a1;
+ int32_t lr, lg, lb, la;
+ uint32_t i;
+ int32_t j;
+ int32_t ds, dr, dg, db, da;
+ uint32_t *buffer = (uint32_t *)grad->image.memory;
+
+ if (grad->count == 0) {
+ /* If no valid stops have been specified (e.g., due to an empty input
+ * array, out-of-range, or out-of-order stops), a stop at 0 with color
+ * 0xFF000000 (opaque black) and a stop at 255 with color 0xFFFFFFFF
+ * (opaque white) are implicitly defined. */
+ grad->stops[0] = 0;
+ grad->colors[0] = 0xFF000000; /* Opaque black */
+ grad->stops[1] = 255;
+ grad->colors[1] = 0xFFFFFFFF; /* Opaque white */
+ grad->count = 2;
+ } else if (grad->count && grad->stops[0] != 0) {
+ /* If at least one valid stop has been specified, but none has been
+ * defined with an offset of 0, an implicit stop is added with an
+ * offset of 0 and the same color as the first user-defined stop. */
+ for (i = 0; i < grad->stops[0]; i++)
+ buffer[i] = grad->colors[0];
+ }
+ a0 = A(grad->colors[0]);
+ r0 = R(grad->colors[0]);
+ g0 = G(grad->colors[0]);
+ b0 = B(grad->colors[0]);
+
+ /* Calculate the colors for each pixel of the image. */
+ for (i = 0; i < grad->count - 1; i++) {
+ buffer[grad->stops[i]] = grad->colors[i];
+ ds = grad->stops[i + 1] - grad->stops[i];
+ a1 = A(grad->colors[i + 1]);
+ r1 = R(grad->colors[i + 1]);
+ g1 = G(grad->colors[i + 1]);
+ b1 = B(grad->colors[i + 1]);
+
+ da = a1 - a0;
+ dr = r1 - r0;
+ dg = g1 - g0;
+ db = b1 - b0;
+
+ for (j = 1; j < ds; j++) {
+ la = a0 + da * j / ds;
+ lr = r0 + dr * j / ds;
+ lg = g0 + dg * j / ds;
+ lb = b0 + db * j / ds;
+
+ buffer[grad->stops[i] + j] = ARGB(la, lr, lg, lb);
+ }
+
+ a0 = a1;
+ r0 = r1;
+ g0 = g1;
+ b0 = b1;
+ }
+ /* If at least one valid stop has been specified, but none has been defined
+ * with an offset of 255, an implicit stop is added with an offset of 255
+ * and the same color as the last user-defined stop. */
+ for (i = grad->stops[grad->count - 1]; i < 255; i++)
+ buffer[i] = grad->colors[grad->count - 1];
+ /* Last pixel */
+ buffer[i] = grad->colors[grad->count - 1];
+ return error;
+}
+
+vg_lite_error_t vg_lite_clear_grad(vg_lite_linear_gradient_t *grad)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ grad->count = 0;
+ /* Release the image resource. */
+ if (grad->image.handle != NULL)
+ {
+ error = vg_lite_free(&grad->image);
+ }
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_clear_rad_grad(vg_lite_radial_gradient_t *grad)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ grad->count = 0;
+ /* Release the image resource. */
+ if (grad->image.handle != NULL)
+ {
+ error = vg_lite_free(&grad->image);
+ }
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_clear_linear_grad(vg_lite_linear_gradient_ext_t *grad)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ grad->count = 0;
+ /* Release the image resource. */
+ if (grad->image.handle != NULL)
+ {
+ error = vg_lite_free(&grad->image);
+ }
+
+ return error;
+}
+
+vg_lite_matrix_t * vg_lite_get_linear_grad_matrix(vg_lite_linear_gradient_ext_t *grad)
+{
+ return &grad->matrix;
+}
+
+vg_lite_matrix_t * vg_lite_get_grad_matrix(vg_lite_linear_gradient_t *grad)
+{
+ return &grad->matrix;
+}
+
+vg_lite_matrix_t * vg_lite_get_rad_grad_matrix(vg_lite_radial_gradient_t *grad)
+{
+ return &grad->matrix;
+}
+
+vg_lite_error_t vg_lite_draw_gradient(vg_lite_buffer_t * target,
+ vg_lite_path_t * path,
+ vg_lite_fill_t fill_rule,
+ vg_lite_matrix_t * matrix,
+ vg_lite_linear_gradient_t * grad,
+ vg_lite_blend_t blend)
+{
+ return vg_lite_draw_pattern(target, path, fill_rule, matrix,
+ &grad->image, &grad->matrix, blend, VG_LITE_PATTERN_PAD, 0, VG_LITE_FILTER_LINEAR);
+}
+
+// added by MicroEJ
+uint32_t vg_lite_get_scissor(int32_t** scissor)
+{
+ *scissor = s_context.scissor;
+ return s_context.scissor_enabled;
+}
+
+vg_lite_error_t vg_lite_set_command_buffer_size(uint32_t size)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ if(!ctx->init){
+ if(!size)
+ return VG_LITE_INVALID_ARGUMENT;
+ command_buffer_size = size;
+ }
+ else{
+#else
+ if(CMDBUF_IN_QUEUE(&ctx->context, 0) ||
+ CMDBUF_IN_QUEUE(&ctx->context, 1))
+ return VG_LITE_INVALID_ARGUMENT;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ VG_LITE_RETURN_ERROR(_free_command_buffer());
+ VG_LITE_RETURN_ERROR(_allocate_command_buffer(size));
+ VG_LITE_RETURN_ERROR(program_tessellation(ctx));
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ }
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_set_scissor(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+
+ /* Scissor dirty. */
+ ctx->scissor_dirty = 1;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ /* Save scissor Box States. */
+ ctx->scissor[0] = x;
+ ctx->scissor[1] = y;
+ ctx->scissor[2] = width;
+ ctx->scissor[3] = height;
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_enable_scissor(void)
+{
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+
+ /* Scissor dirty. */
+ ctx->scissor_dirty = 1;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ /* Enable scissor Mode. */
+ ctx->scissor_enabled = 1;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_disable_scissor(void)
+{
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+
+ /* Scissor dirty. */
+ ctx->scissor_dirty = 1;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ /* disable scissor Mode. */
+ ctx->scissor_enabled = 0;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_mem_avail(uint32_t *size)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_kernel_mem_t mem;
+ VG_LITE_RETURN_ERROR(vg_lite_kernel(VG_LITE_QUERY_MEM,&mem));
+ *size = mem.bytes;
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_enable_premultiply(void)
+{
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t *tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if (tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_PE_PREMULTIPLY))
+ return VG_LITE_NOT_SUPPORT;
+
+ /* Enable premultiply Mode. */
+ ctx->premultiply_enabled = 1;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_disable_premultiply(void)
+{
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_PE_PREMULTIPLY))
+ return VG_LITE_NOT_SUPPORT;
+
+ /* disable premultiply Mode. */
+ ctx->premultiply_enabled = 0;
+
+ return VG_LITE_SUCCESS;
+}
+
+vg_lite_error_t vg_lite_set_dither(int enable)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ uint32_t table_low = 0x7B48F3C0;
+ uint32_t table_high = 0x596AD1E2;
+ int dither_enable = enable;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_tls_t* tls;
+ vg_lite_context_t *ctx;
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_DITHER)) {
+ return VG_LITE_NOT_SUPPORT;
+ }
+
+ if(dither_enable) {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A5A, table_low));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A5B, table_high));
+ }
+ else {
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A5A, 0xFFFFFFFF));
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A5B, 0xFFFFFFFF));
+ }
+
+ return error;
+}
+
+vg_lite_error_t vg_lite_set_color_key(vg_lite_color_key4_t colorkey)
+{
+ uint8_t i;
+ uint32_t value_low = 0;
+ uint32_t value_high = 0;
+ uint8_t r, g, b, a, e;
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ vg_lite_context_t *ctx = &s_context;
+#else
+ vg_lite_context_t *ctx;
+ vg_lite_tls_t* tls;
+
+ tls = (vg_lite_tls_t *) vg_lite_os_get_tls();
+ if(tls == NULL)
+ return VG_LITE_NO_CONTEXT;
+
+ ctx = &tls->t_context;
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ if(!vg_lite_query_feature(gcFEATURE_BIT_VG_COLOR_KEY))
+ return VG_LITE_NOT_SUPPORT;
+
+ /* Set color key states. */
+ for (i = 0; i < 4; i++)
+ {
+ /* Set gcregVGPEColorKeyLow. Layout "E/R/G/B". */
+ r = colorkey[i].low_r;
+ g = colorkey[i].low_g;
+ b = colorkey[i].low_b;
+ e = colorkey[i].enable;
+ value_low = (e << 24) | (r << 16) | (g << 8) | b;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A90 + i , value_low));
+
+ /* Set gcregVGPEColorKeyHigh. Layout "A/R/G/B". */
+ r = colorkey[i].hign_r;
+ g = colorkey[i].hign_g;
+ b = colorkey[i].hign_b;
+ a = colorkey[i].alpha;
+ value_high = (a << 24) | (r << 16) | (g << 8) | b;
+ VG_LITE_RETURN_ERROR(push_state(ctx, 0x0A94 + i , value_high));
+ }
+
+ return error;
+}
diff --git a/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.c b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.c
new file mode 100644
index 0000000..7c6861d
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.c
@@ -0,0 +1,536 @@
+
+/****************************************************************************
+*
+* Copyright Raph Levien 2022
+* Copyright Nicolas Silva 2022
+* Copyright NXP 2022
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*****************************************************************************/
+
+#include
+
+#include "vg_lite_flat.h"
+#include "nxp_support.h"
+
+/*
+ * Stop IAR compiler from warning about implicit conversions from float to
+ * double
+ */
+#if (defined(__ICCARM__))
+#pragma diag_suppress = Pa205
+#endif
+
+#ifndef VG_CURVE_FLATTENING_TOLERANCE
+#define VG_CURVE_FLATTENING_TOLERANCE 0.25
+#endif /* defined(VG_CURVE_FLATTENING_TOLERANCE) */
+
+#define FABSF(x) ((vg_lite_float_t) fabs(x))
+#define SQRTF(x) ((vg_lite_float_t) sqrt(x))
+#define CEILF(x) ((vg_lite_float_t) ceil(x))
+
+#define VG_LITE_ERROR_HANDLER(func) \
+if ((error = func) != VG_LITE_SUCCESS) \
+goto ErrorHandler
+
+/* Point flatten type for flattened line segments. */
+#define vgcFLATTEN_NO 0
+#define vgcFLATTEN_START 1
+#define vgcFLATTEN_MIDDLE 2
+#define vgcFLATTEN_END 3
+
+/*
+ * Algorithm originally created by Raph Levien:
+ * https://raphlinus.github.io/graphics/curves/2019/12/23/flatten-quadbez.html
+ */
+
+#define FHYPOTF(x, y) ((vg_lite_float_t) hypotf(x, y))
+#define FPOWF(x, y) ((vg_lite_float_t) powf(x, y))
+
+/*
+ * Contains the fields that are used to represent the quadratic Bezier curve
+ * as a 'y = x^2' parabola.
+ */
+typedef struct parabola_approx {
+ vg_lite_float_t x0;
+ vg_lite_float_t x2;
+ vg_lite_float_t scale;
+ vg_lite_float_t cross;
+} parabola_approx_t;
+
+/*
+ * Keeps the quadratic Bezier's control points. This makes life easier when
+ * passing quadratics as parameters, so we don't have to give 6 floats every
+ * time.
+ */
+typedef struct quad_bezier {
+ vg_lite_float_t X0;
+ vg_lite_float_t Y0;
+ vg_lite_float_t X1;
+ vg_lite_float_t Y1;
+ vg_lite_float_t X2;
+ vg_lite_float_t Y2;
+} quad_bezier_t;
+
+/*
+ * Parameters which are used by the flattening algorithm.
+ */
+typedef struct quad_bezier_flatten_params {
+ vg_lite_float_t a0;
+ vg_lite_float_t a2;
+ int num_points;
+ vg_lite_float_t u0;
+ vg_lite_float_t u2;
+} quad_bezier_flatten_params_t;
+
+/*
+ * Keeps the cubic Bezier's control points.
+ */
+typedef struct cubic_bezier {
+ vg_lite_float_t X0;
+ vg_lite_float_t Y0;
+ vg_lite_float_t X1;
+ vg_lite_float_t Y1;
+ vg_lite_float_t X2;
+ vg_lite_float_t Y2;
+ vg_lite_float_t X3;
+ vg_lite_float_t Y3;
+} cubic_bezier_t;
+
+
+vg_lite_error_t _add_point_to_point_list(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ uint8_t flatten_flag);
+
+vg_lite_error_t _add_point_to_point_list_wdelta(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X,
+ vg_lite_float_t Y,
+ vg_lite_float_t DX,
+ vg_lite_float_t DY,
+ uint8_t flatten_flag);
+
+
+/*
+ * Evaluates the Bernstein polynomial that represents the curve, at 't'.
+ * 't' should be a value between 0.0 and 1.0 (though it can be any float, but
+ * the relevant values are between 0 and 1).
+ * 'x' and 'y' will contain the coordinates of the evaluated point.
+ */
+static void quad_bezier_eval(
+ const quad_bezier_t *q,
+ vg_lite_float_t t,
+ vg_lite_float_t *x,
+ vg_lite_float_t *y
+ )
+{
+ const vg_lite_float_t omt = 1.0 - t;
+ *x = q->X0 * omt * omt + 2.0 * q->X1 * t * omt + q->X2 * t * t;
+ *y = q->Y0 * omt * omt + 2.0 * q->Y1 * t * omt + q->Y2 * t * t;
+}
+
+/*
+ * Approximates the integral which uses the arclength and curvature of the
+ * parabola.
+ */
+static vg_lite_float_t approx_integral(vg_lite_float_t x)
+{
+ const vg_lite_float_t D = 0.67;
+ return x / (1.0 - D + FPOWF(FPOWF(D, 4) + 0.25 * x * x, 0.25));
+}
+
+/*
+ * Approximates the inverse of the previous integral.
+ */
+static vg_lite_float_t approx_inverse_integral(vg_lite_float_t x)
+{
+ const vg_lite_float_t B = 0.39;
+ return x * (1.0 - B + SQRTF(B * B + 0.25 * x * x));
+}
+
+/*
+ * Represents a quadratic Bezier curve as a parabola.
+ */
+static parabola_approx_t map_to_parabola(const quad_bezier_t *q)
+{
+ const vg_lite_float_t ddx = 2 * q->X1 - q->X0 - q->X2;
+ const vg_lite_float_t ddy = 2 * q->Y1 - q->Y0 - q->Y2;
+ const vg_lite_float_t u0 = (q->X1 - q->X0) * ddx + (q->Y1 - q->Y0) * ddy;
+ const vg_lite_float_t u2 = (q->X2 - q->X1) * ddx + (q->Y2 - q->Y1) * ddy;
+ const vg_lite_float_t cross = (q->X2 - q->X0) * ddy - (q->Y2 - q->Y0) * ddx;
+ const vg_lite_float_t x0 = u0 / cross;
+ const vg_lite_float_t x2 = u2 / cross;
+ const vg_lite_float_t scale = FABSF(cross) / (FHYPOTF(ddx, ddy) * FABSF(x2 - x0));
+
+ return (parabola_approx_t) {
+ .x0 = x0,
+ .x2 = x2,
+ .scale = scale,
+ .cross = cross
+ };
+}
+
+/*
+ * Tolerance influences the number of lines generated. The lower the tolerance,
+ * the more lines it generates, thus the flattening will have a higher quality,
+ * but it will also consume more memory. The bigger the tolerance, the less lines
+ * will be generated, so the quality will be worse, but the memory consumption
+ * will be better.
+ *
+ * A good default value could be 0.25.
+ */
+static quad_bezier_flatten_params_t quad_bezier_flatten_params_init(
+ const quad_bezier_t *q,
+ vg_lite_float_t tolerance
+ )
+{
+ const parabola_approx_t params = map_to_parabola(q);
+ const vg_lite_float_t a0 = approx_integral(params.x0);
+ const vg_lite_float_t a2 = approx_integral(params.x2);
+ const vg_lite_float_t count = 0.5 * FABSF(a2 - a0) * SQRTF(params.scale / tolerance);
+ const int num_points = (int)CEILF(count);
+ const vg_lite_float_t u0 = approx_inverse_integral(a0);
+ const vg_lite_float_t u2 = approx_inverse_integral(a2);
+
+ return (quad_bezier_flatten_params_t) {
+ .a0 = a0,
+ .a2 = a2,
+ .num_points = num_points,
+ .u0 = u0,
+ .u2 = u2
+ };
+}
+
+/*
+ * Puts into (x, y) the coordinate to which a line should be drawn given the step.
+ * This should be used in a loop to flatten a curve, like this:
+ * ```
+ * params = quad_bezier_flatten_params_init(&q, tolerance);
+ * for (int i = 1; i < params.num_points; ++i) {
+ * vg_lite_float_t x, y;
+ * quad_bezier_flatten_at(&q, ¶ms, i, &x, &y);
+ * draw_line_to(x, y);
+ * }
+ * ```
+ */
+static void quad_bezier_flatten_at(
+ const quad_bezier_t *q,
+ const quad_bezier_flatten_params_t *params,
+ int step,
+ vg_lite_float_t *x,
+ vg_lite_float_t *y
+ )
+{
+ const vg_lite_float_t a0 = params->a0, a2 = params->a2, u0 = params->u0, u2 = params->u2;
+ const int num_points = params->num_points;
+ const vg_lite_float_t u = approx_inverse_integral(a0 + ((a2 - a0) * step) / num_points);
+ const vg_lite_float_t t = (u - u0) / (u2 - u0);
+
+ quad_bezier_eval(q, t, x, y);
+}
+
+vg_lite_error_t
+_flatten_quad_bezier(
+ vg_lite_stroke_conversion_t *stroke_conversion,
+ vg_lite_float_t X0,
+ vg_lite_float_t Y0,
+ vg_lite_float_t X1,
+ vg_lite_float_t Y1,
+ vg_lite_float_t X2,
+ vg_lite_float_t Y2
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr point0, point1;
+ vg_lite_float_t x, y;
+
+ const vg_lite_float_t tolerance = VG_CURVE_FLATTENING_TOLERANCE;
+ const quad_bezier_t q = {
+ .X0 = X0,
+ .Y0 = Y0,
+ .X1 = X1,
+ .Y1 = Y1,
+ .X2 = X2,
+ .Y2 = Y2
+ };
+ const quad_bezier_flatten_params_t params = quad_bezier_flatten_params_init(&q, tolerance);
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Add extra P0 for incoming tangent. */
+ point0 = stroke_conversion->path_last_point;
+ /* First add P1 to calculate incoming tangent, which is saved in P0. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X1, Y1, vgcFLATTEN_START));
+
+ point1 = stroke_conversion->path_last_point;
+ /* Change the point1's coordinates back to P0. */
+ point1->x = X0;
+ point1->y = Y0;
+ point0->length = 0.0f;
+
+ for (int i = 1; i < params.num_points; ++i) {
+ quad_bezier_flatten_at(&q, ¶ms, i, &x, &y);
+ _add_point_to_point_list(stroke_conversion, x, y, vgcFLATTEN_MIDDLE);
+ }
+
+ /* Add point 2 separately to avoid cumulative errors. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X2, Y2, vgcFLATTEN_END));
+
+ /* Add extra P2 for outgoing tangent. */
+ /* First change P2(point0)'s coordinates to P1. */
+ point0 = stroke_conversion->path_last_point;
+ point0->x = X1;
+ point0->y = Y1;
+
+ /* Add P2 to calculate outgoing tangent. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X2, Y2, vgcFLATTEN_NO));
+
+ point1 = stroke_conversion->path_last_point;
+
+ /* Change point0's coordinates back to P2. */
+ point0->x = X2;
+ point0->y = Y2;
+ point0->length = 0.0f;
+
+ErrorHandler:
+ return error;
+}
+
+/*
+ * Like eval_quad_bezier, computes the coordinates of the point which resides at
+ * `t` for the cubic.
+ */
+static void cubic_bezier_eval(
+ const cubic_bezier_t *c,
+ vg_lite_float_t t,
+ vg_lite_float_t *x,
+ vg_lite_float_t *y
+ )
+{
+ const vg_lite_float_t omt = 1.0 - t;
+ const vg_lite_float_t omt2 = omt * omt;
+ const vg_lite_float_t omt3 = omt * omt2;
+ const vg_lite_float_t t2 = t * t;
+ const vg_lite_float_t t3 = t * t2;
+
+ *x = omt3 * c->X0 + 3.0 * t * omt2 * c->X1 + 3.0 * t2 * omt * c->X2 + t3 * c->X3;
+ *y = omt3 * c->Y0 + 3.0 * t * omt2 * c->Y1 + 3.0 * t2 * omt * c->Y2 + t3 * c->Y3;
+}
+
+static quad_bezier_t cubic_bezier_derivative(const cubic_bezier_t *c)
+{
+ const vg_lite_float_t x0 = 3.0 * (c->X1 - c->X0);
+ const vg_lite_float_t y0 = 3.0 * (c->Y1 - c->Y0);
+ const vg_lite_float_t x1 = 3.0 * (c->X2 - c->X1);
+ const vg_lite_float_t y1 = 3.0 * (c->Y2 - c->Y1);
+ const vg_lite_float_t x2 = 3.0 * (c->X3 - c->X2);
+ const vg_lite_float_t y2 = 3.0 * (c->Y3 - c->Y2);
+
+ return (quad_bezier_t) {
+ .X0 = x0,
+ .Y0 = y0,
+ .X1 = x1,
+ .Y1 = y1,
+ .X2 = x2,
+ .Y2 = y2
+ };
+}
+
+/*
+ * Returns the cubic bezier that is between t0 and t1 of c.
+ */
+static cubic_bezier_t cubic_bezier_split_at(
+ const cubic_bezier_t *c,
+ vg_lite_float_t t0,
+ vg_lite_float_t t1
+ )
+{
+ vg_lite_float_t p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, d1x, d1y, d2x, d2y;
+ vg_lite_float_t scale;
+ quad_bezier_t derivative;
+
+ cubic_bezier_eval(c, t0, &p0x, &p0y);
+ cubic_bezier_eval(c, t1, &p3x, &p3y);
+ derivative = cubic_bezier_derivative(c);
+ scale = (t1 - t0) * (1.0 / 3.0);
+ quad_bezier_eval(&derivative, t0, &d1x, &d1y);
+ quad_bezier_eval(&derivative, t1, &d2x, &d2y);
+ p1x = p0x + scale * d1x;
+ p1y = p0y + scale * d1y;
+ p2x = p3x - scale * d2x;
+ p2y = p3y - scale * d2y;
+
+ return (cubic_bezier_t) {
+ .X0 = p0x,
+ .Y0 = p0y,
+ .X1 = p1x,
+ .Y1 = p1y,
+ .X2 = p2x,
+ .Y2 = p2y,
+ .X3 = p3x,
+ .Y3 = p3y
+ };
+}
+
+/*
+ * This function returns the number of quadratic Bezier curves that are needed to
+ * represent the given cubic, respecting the tolerance.
+ *
+ * As with the flattening of quadratics, the lower the tolerance, the better the
+ * quality. The higher the tolerance, the worse the quality, but better performance
+ * or memory consumption.
+ *
+ * The algorithm comes from:
+ * https://web.archive.org/web/20210108052742/http://caffeineowl.com/graphics/2d/vectorial/cubic2quad01.html
+ *
+ * Implementation adapted from:
+ * https://github.com/linebender/kurbo/blob/master/src/cubicbez.rs
+ * and:
+ * https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=1000&context=facpub#section.10.6
+ */
+static int cubic_bezier_get_flatten_count(
+ const cubic_bezier_t *c,
+ vg_lite_float_t tolerance
+ )
+{
+ const vg_lite_float_t x = c->X0 - 3.0 * c->X1 + 3.0 * c->X2 - c->X3;
+ const vg_lite_float_t y = c->Y0 - 3.0 * c->Y1 + 3.0 * c->Y2 - c->Y3;
+ const vg_lite_float_t err = x * x + y * y;
+ vg_lite_float_t result;
+
+ result = FPOWF(err / (432.0 * tolerance * tolerance), 1.0 / 6.0);
+ result = CEILF(result);
+
+ return result > 1.0 ? (int)result : 1;
+}
+
+vg_lite_error_t
+_flatten_cubic_bezier(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X0,
+ vg_lite_float_t Y0,
+ vg_lite_float_t X1,
+ vg_lite_float_t Y1,
+ vg_lite_float_t X2,
+ vg_lite_float_t Y2,
+ vg_lite_float_t X3,
+ vg_lite_float_t Y3
+ )
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ vg_lite_path_point_ptr point0, point1;
+ const cubic_bezier_t c = {
+ .X0 = X0,
+ .Y0 = Y0,
+ .X1 = X1,
+ .Y1 = Y1,
+ .X2 = X2,
+ .Y2 = Y2,
+ .X3 = X3,
+ .Y3 = Y3
+ };
+ const vg_lite_float_t tolerance = VG_CURVE_FLATTENING_TOLERANCE;
+ int num_curves = cubic_bezier_get_flatten_count(&c, tolerance);
+ vg_lite_float_t fnum_curves = (vg_lite_float_t)num_curves;
+ vg_lite_float_t fi, t0, t1, p1x, p1y, p2x, p2y, x, y;
+ cubic_bezier_t subsegment;
+ quad_bezier_t current_curve;
+ quad_bezier_flatten_params_t params;
+
+ if(!stroke_conversion)
+ return VG_LITE_INVALID_ARGUMENT;
+
+ /* Add extra P0 for incoming tangent. */
+ point0 = stroke_conversion->path_last_point;
+ /* First add P1/P2/P3 to calculate incoming tangent, which is saved in P0. */
+ if (X0 != X1 || Y0 != Y1)
+ {
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X1, Y1, vgcFLATTEN_START));
+ }
+ else if (X0 != X2 || Y0 != Y2)
+ {
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X2, Y2, vgcFLATTEN_START));
+ }
+ else
+ {
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X3, Y3, vgcFLATTEN_START));
+ }
+ point1 = stroke_conversion->path_last_point;
+ /* Change the point1's coordinates back to P0. */
+ point1->x = X0;
+ point1->y = Y0;
+ point0->length = 0.0f;
+
+ for (int i = 0; i < num_curves; ++i) {
+ fi = (vg_lite_float_t)i;
+ t0 = fi / fnum_curves;
+ t1 = (fi + 1.0) / fnum_curves;
+ subsegment = cubic_bezier_split_at(&c, t0, t1);
+ p1x = 3.0 * subsegment.X1 - subsegment.X0;
+ p1y = 3.0 * subsegment.Y1 - subsegment.Y0;
+ p2x = 3.0 * subsegment.X2 - subsegment.X3;
+ p2y = 3.0 * subsegment.Y2 - subsegment.Y3;
+ current_curve = (quad_bezier_t) {
+ .X0 = subsegment.X0,
+ .Y0 = subsegment.Y0,
+ .X1 = (p1x + p2x) / 4.0,
+ .Y1 = (p1y + p2y) / 4.0,
+ .X2 = subsegment.X3,
+ .Y2 = subsegment.Y3
+ };
+ params = quad_bezier_flatten_params_init(¤t_curve, tolerance);
+ for (int j = 0; j < params.num_points; ++j) {
+ quad_bezier_flatten_at(¤t_curve, ¶ms, j, &x, &y);
+ _add_point_to_point_list(stroke_conversion, x, y, vgcFLATTEN_MIDDLE);
+ }
+ }
+
+ /* Add point 3 separately to avoid cumulative errors. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X3, Y3, vgcFLATTEN_END));
+
+ /* Add extra P3 for outgoing tangent. */
+ /* First change P3(point0)'s coordinates to P0/P1/P2. */
+ point0 = stroke_conversion->path_last_point;
+ if (X3 != X2 || Y3 != Y2)
+ {
+ point0->x = X2;
+ point0->y = Y2;
+ }
+ else if (X3 != X1 || Y3 != Y1)
+ {
+ point0->x = X1;
+ point0->y = Y1;
+ }
+ else
+ {
+ point0->x = X0;
+ point0->y = Y0;
+ }
+
+ /* Add P3 to calculate outgoing tangent. */
+ VG_LITE_ERROR_HANDLER(_add_point_to_point_list(stroke_conversion, X3, Y3, vgcFLATTEN_NO));
+
+ point1 = stroke_conversion->path_last_point;
+
+ /* Change point0's coordinates back to P3. */
+ point0->x = X3;
+ point0->y = Y3;
+ point0->length = 0.0f;
+
+ErrorHandler:
+ return error;
+}
diff --git a/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.h b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.h
new file mode 100644
index 0000000..fa7fbfd
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_flat.h
@@ -0,0 +1,55 @@
+
+/****************************************************************************
+*
+* Copyright Raph Levien 2022
+* Copyright Nicolas Silva 2022
+* Copyright NXP 2022
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*****************************************************************************/
+
+#ifndef _vg_lite_flat_h_
+#define _vg_lite_flat_h_
+
+#include "vg_lite.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+vg_lite_error_t _flatten_quad_bezier(
+ vg_lite_stroke_conversion_t *stroke_conversion,
+ vg_lite_float_t X0,
+ vg_lite_float_t Y0,
+ vg_lite_float_t X1,
+ vg_lite_float_t Y1,
+ vg_lite_float_t X2,
+ vg_lite_float_t Y2);
+
+vg_lite_error_t _flatten_cubic_bezier(
+ vg_lite_stroke_conversion_t * stroke_conversion,
+ vg_lite_float_t X0,
+ vg_lite_float_t Y0,
+ vg_lite_float_t X1,
+ vg_lite_float_t Y1,
+ vg_lite_float_t X2,
+ vg_lite_float_t Y2,
+ vg_lite_float_t X3,
+ vg_lite_float_t Y3);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _vg_lite_flat_h_ */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_image.c b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_image.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_image.c
rename to bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_image.c
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c
rename to bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c
index 53f9469..1df88e4 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c
+++ b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_matrix.c
@@ -111,14 +111,3 @@ void vg_lite_rotate(vg_lite_float_t degrees, vg_lite_matrix_t * matrix)
/* Multiply with current matrix. */
multiply(matrix, &r);
}
-
-void vg_lite_perspective(vg_lite_float_t px, vg_lite_float_t py, vg_lite_matrix_t * matrix)
-{
- /* set prespective matrix */
- vg_lite_matrix_t p = { { {1.0f, 0.0f, 0.0f},
- {0.0f, 1.0f, 0.0f},
- {px, py, 1.0f}
- } };
- /* Multiply with current matrix. */
- multiply(matrix, &p);
-}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_path.c b/bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_path.c
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_path.c
rename to bsp/sdk_overlay/middleware/vglite/VGLite/vg_lite_path.c
diff --git a/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_hal.c b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_hal.c
new file mode 100644
index 0000000..9e0d2c4
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_hal.c
@@ -0,0 +1,504 @@
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright (c) 2014 - 2020 Vivante Corporation
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "vg_lite_platform.h"
+#include "vg_lite_kernel.h"
+#include "vg_lite_hal.h"
+#include "vg_lite_hw.h"
+#include "vg_lite_os.h"
+
+#if !_BAREMETAL
+#include "FreeRTOS.h"
+#include "semphr.h"
+#include "task.h"
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+#include "queue.h"
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+#else
+#include "xil_cache.h"
+#endif
+
+#if _BAREMETAL
+/* The followings should be configured by FPGA. */
+static uint32_t registerMemBase = 0x43c80000;
+#else
+static uint32_t registerMemBase = 0x40240000;
+#endif
+
+#define HEAP_NODE_USED 0xABBAF00D
+
+volatile void* contiguousMem = NULL;
+uint32_t gpuMemBase = 0;
+
+/* Default heap size is 16MB. */
+static int heap_size = MAX_CONTIGUOUS_SIZE;
+
+void vg_lite_init_mem(uint32_t register_mem_base,
+ uint32_t gpu_mem_base,
+ volatile void * contiguous_mem_base,
+ uint32_t contiguous_mem_size)
+{
+ registerMemBase = register_mem_base;
+ gpuMemBase = gpu_mem_base;
+ contiguousMem = contiguous_mem_base;
+ heap_size = contiguous_mem_size;
+}
+
+/* Implementation of list. ****************************************/
+typedef struct list_head {
+ struct list_head *next;
+ struct list_head *prev;
+}list_head_t;
+
+#define INIT_LIST_HEAD(entry) \
+ (entry)->next = (entry);\
+ (entry)->prev = (entry);
+
+/* Add the list item in front of "head". */
+static inline void add_list(list_head_t *to_add, list_head_t *head)
+{
+ /* Link the new item. */
+ to_add->next = head;
+ to_add->prev = head->prev;
+
+ /* Modify the neighbor. */
+ head->prev = to_add;
+ if (to_add->prev != NULL) {
+ to_add->prev->next = to_add;
+ }
+}
+
+/* Remove an entry out of the list. */
+static inline void delete_list(list_head_t *entry)
+{
+ if (entry->prev != NULL) {
+ entry->prev->next = entry->next;
+ }
+ if (entry->next != NULL) {
+ entry->next->prev = entry->prev;
+ }
+}
+
+/* End of list implementation. ***********/
+static inline void _memset(void *mem, unsigned char value, int size)
+{
+ int i;
+ for (i = 0; i < size; i++) {
+ ((unsigned char*)mem)[i] = value;
+ }
+}
+
+typedef struct heap_node {
+ list_head_t list; /* TODO: Linux specific, needs to rewrite. */
+ uint32_t offset;
+ unsigned long size;
+ uint32_t status;
+}heap_node_t;
+
+struct memory_heap {
+ uint32_t free;
+ list_head_t list;
+};
+
+struct mapped_memory {
+ void * logical;
+ uint32_t physical;
+ int page_count;
+ struct page ** pages;
+};
+
+struct vg_lite_device {
+ /* void * gpu; */
+ uint32_t gpu; /* Always use physical for register access in RTOS. */
+ /* struct page * pages; */
+ volatile void * contiguous;
+ unsigned int order;
+ unsigned int heap_size;
+ void * virtual;
+ uint32_t physical;
+ uint32_t size;
+ struct memory_heap heap;
+ int irq_enabled;
+
+#if defined(VG_DRIVER_SINGLE_THREAD)
+ volatile uint32_t int_flags;
+#if _BAREMETAL
+ /* wait_queue_head_t int_queue; */
+ xSemaphoreHandle int_queue;
+#else
+ /* wait_queue_head_t int_queue; */
+ SemaphoreHandle_t int_queue;
+#endif
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
+ void * device;
+ int registered;
+ int major;
+ struct class * class;
+ int created;
+};
+
+struct client_data {
+ struct vg_lite_device * device;
+ struct vm_area_struct * vm;
+ void * contiguous_mapped;
+};
+
+static struct vg_lite_device Device, * device;
+
+void vg_lite_hal_delay(uint32_t ms)
+{
+ vg_lite_os_sleep(ms);
+}
+
+void vg_lite_hal_barrier(void)
+{
+ /*Memory barrier. */
+#if _BAREMETAL
+ Xil_DCacheFlush();
+#else
+ __asm("DSB");
+#endif
+}
+
+static int vg_lite_init(void);
+vg_lite_error_t vg_lite_hal_initialize(void)
+{
+ int32_t error = VG_LITE_SUCCESS;
+ /* TODO: Turn on the power. */
+ vg_lite_init();
+ /* TODO: Turn on the clock. */
+ error = vg_lite_os_initialize();
+
+ return (vg_lite_error_t)error;
+}
+
+void vg_lite_hal_deinitialize(void)
+{
+ /* TODO: Remove clock. */
+ vg_lite_os_deinitialize();
+ /* TODO: Remove power. */
+}
+
+static int split_node(heap_node_t * node, unsigned long size)
+{
+ /* TODO: the original is linux specific list based, needs rewrite.
+ */
+ heap_node_t * split;
+
+ /*
+ * If the newly allocated object fits exactly the size of the free
+ * node, there is no need to split.
+ */
+ if (node->size - size == 0)
+ return 0;
+
+ /* Allocate a new node. */
+ split = (heap_node_t *)vg_lite_os_malloc(sizeof(heap_node_t));
+
+ if (split == NULL)
+ return -1;
+
+ /* Fill in the data of this node of the remaning size. */
+ split->offset = node->offset + size;
+ split->size = node->size - size;
+ split->status = 0;
+
+ /* Add the new node behind the current node. */
+ add_list(&split->list, &node->list);
+
+ /* Adjust the size of the current node. */
+ node->size = size;
+ return 0;
+}
+
+vg_lite_error_t vg_lite_hal_allocate_contiguous(unsigned long size, void ** logical, uint32_t * physical,void ** node)
+{
+ unsigned long aligned_size;
+ heap_node_t * pos;
+
+ /* Align the size to 64 bytes. */
+ aligned_size = (size + 63) & ~63;
+
+ /* Check if there is enough free memory available. */
+ if (aligned_size > device->heap.free) {
+ return VG_LITE_OUT_OF_MEMORY;
+ }
+
+ /* Walk the heap backwards. */
+ for (pos = (heap_node_t*)device->heap.list.prev;
+ &pos->list != &device->heap.list;
+ pos = (heap_node_t*) pos->list.prev) {
+ /* Check if the current node is free and is big enough. */
+ if (pos->status == 0 && pos->size >= aligned_size) {
+ /* See if we the current node is big enough to split. */
+ if (0 != split_node(pos, aligned_size))
+ {
+ return VG_LITE_OUT_OF_RESOURCES;
+ }
+ /* Mark the current node as used. */
+ pos->status = HEAP_NODE_USED;
+
+ /* Return the logical/physical address. */
+ /* *logical = (uint8_t *) private_data->contiguous_mapped + pos->offset; */
+ *logical = (uint8_t *)device->virtual + pos->offset;
+ *physical = gpuMemBase + (uint32_t)(*logical);/* device->physical + pos->offset; */
+ device->heap.free -= aligned_size;
+
+ *node = pos;
+ return VG_LITE_SUCCESS;
+ }
+ }
+
+ /* Out of memory. */
+ return VG_LITE_OUT_OF_MEMORY;
+}
+
+void vg_lite_hal_free_contiguous(void * memory_handle)
+{
+ /* TODO: no list available in RTOS. */
+ heap_node_t * pos, * node;
+
+ /* Get pointer to node. */
+ node = memory_handle;
+
+ if (node->status != HEAP_NODE_USED) {
+ return;
+ }
+
+ /* Mark node as free. */
+ node->status = 0;
+
+ /* Add node size to free count. */
+ device->heap.free += node->size;
+
+ /* Check if next node is free. */
+ pos = node;
+ for (pos = (heap_node_t *)pos->list.next;
+ &pos->list != &device->heap.list;
+ pos = (heap_node_t *)pos->list.next) {
+ if (pos->status == 0) {
+ /* Merge the nodes. */
+ node->size += pos->size;
+ if(node->offset > pos->offset)
+ node->offset = pos->offset;
+ /* Delete the next node from the list. */
+ delete_list(&pos->list);
+ vg_lite_os_free(pos);
+ }
+ break;
+ }
+
+ /* Check if the previous node is free. */
+ pos = node;
+ for (pos = (heap_node_t *)pos->list.prev;
+ &pos->list != &device->heap.list;
+ pos = (heap_node_t *)pos->list.prev) {
+ if (pos->status == 0) {
+ /* Merge the nodes. */
+ pos->size += node->size;
+ if(pos->offset > node->offset)
+ pos->offset = node->offset;
+ /* Delete the current node from the list. */
+ delete_list(&node->list);
+ vg_lite_os_free(node);
+ }
+ break;
+ }
+ /* when release command buffer node and ts buffer node to exit,release the linked list*/
+ if(device->heap.list.next == device->heap.list.prev) {
+ delete_list(&pos->list);
+ vg_lite_os_free(pos);
+ }
+}
+
+void vg_lite_hal_free_os_heap(void)
+{
+ struct heap_node *pos, *n;
+
+ /* Check for valid device. */
+ if (device != NULL) {
+ /* Process each node. */
+ for (pos = (heap_node_t *)device->heap.list.next,
+ n = (heap_node_t *)pos->list.next;
+ &pos->list != &device->heap.list;
+ pos = n, n = (heap_node_t *)n->list.next) {
+ /* Remove it from the linked list. */
+ delete_list(&pos->list);
+ /* Free up the memory. */
+ vg_lite_os_free(pos);
+ }
+ }
+}
+
+/* Portable: read register value. */
+uint32_t vg_lite_hal_peek(uint32_t address)
+{
+ /* Read data from the GPU register. */
+ return (uint32_t) (*(volatile uint32_t *) (device->gpu + address));
+}
+
+/* Portable: write register. */
+void vg_lite_hal_poke(uint32_t address, uint32_t data)
+{
+ /* Write data to the GPU register. */
+ uint32_t *LocalAddr = (uint32_t *)(device->gpu + address);
+ *LocalAddr = data;
+}
+
+vg_lite_error_t vg_lite_hal_query_mem(vg_lite_kernel_mem_t *mem)
+{
+ if(device != NULL){
+ mem->bytes = device->heap.free;
+ return VG_LITE_SUCCESS;
+ }
+ mem->bytes = 0;
+ return VG_LITE_NO_CONTEXT;
+}
+
+void vg_lite_IRQHandler(void)
+{
+ vg_lite_os_IRQHandler();
+}
+
+int32_t vg_lite_hal_wait_interrupt(uint32_t timeout, uint32_t mask, uint32_t * value)
+{
+ return vg_lite_os_wait_interrupt(timeout,mask,value);
+}
+
+void * vg_lite_hal_map(unsigned long bytes, void * logical, uint32_t physical, uint32_t * gpu)
+{
+
+ (void) bytes;
+ (void) logical;
+ (void) physical;
+ (void) gpu;
+ return (void *)0;
+}
+
+void vg_lite_hal_unmap(void * handle)
+{
+
+ (void) handle;
+}
+
+#if !defined(VG_DRIVER_SINGLE_THREAD)
+vg_lite_error_t vg_lite_hal_submit(uint32_t context,uint32_t physical, uint32_t offset, uint32_t size, vg_lite_os_async_event_t *event)
+{
+ return (vg_lite_error_t)vg_lite_os_submit(context,physical,offset,size,event);
+}
+
+vg_lite_error_t vg_lite_hal_wait(uint32_t timeout, vg_lite_os_async_event_t *event)
+{
+ return (vg_lite_error_t)vg_lite_os_wait(timeout,event);
+}
+#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+
+static void vg_lite_exit(void)
+{
+ heap_node_t * pos;
+ heap_node_t * n;
+
+ /* Check for valid device. */
+ if (device != NULL) {
+ /* TODO: unmap register mem should be unnecessary. */
+ device->gpu = 0;
+
+ /* Process each node. */
+ for (pos = (heap_node_t *)device->heap.list.next, n = (heap_node_t *)pos->list.next;
+ &pos->list != &device->heap.list;
+ pos = n, n = (heap_node_t *)n->list.next) {
+ /* Remove it from the linked list. */
+ delete_list(&pos->list);
+
+ /* Free up the memory. */
+ vg_lite_os_free(pos);
+ }
+
+ /* Free up the device structure. */
+ vg_lite_os_free(device);
+ }
+}
+
+static int vg_lite_init(void)
+{
+ heap_node_t * node;
+
+ /* Initialize memory and objects ***************************************/
+ /* Create device structure. */
+ device = &Device;
+
+ /* Zero out the enture structure. */
+ _memset(device, 0, sizeof(struct vg_lite_device));
+
+ /* Setup register memory. **********************************************/
+ device->gpu = registerMemBase;
+
+ /* Initialize contiguous memory. ***************************************/
+ /* Allocate the contiguous memory. */
+ device->heap_size = heap_size;
+ device->contiguous = (volatile void *)contiguousMem;
+ _memset((void *)device->contiguous, 0, heap_size);
+ /* Make 64byte aligned. */
+ while ((((uint32_t)device->contiguous) & 63) != 0)
+ {
+ device->contiguous = ((unsigned char*) device->contiguous) + 4;
+ device->heap_size -= 4;
+ }
+
+ /* Check if we allocated any contiguous memory or not. */
+ if (device->contiguous == NULL) {
+ vg_lite_exit();
+ return -1;
+ }
+
+ device->virtual = (void *)device->contiguous;
+ device->physical = gpuMemBase + (uint32_t)device->virtual;
+ device->size = device->heap_size;
+
+ /* Create the heap. */
+ INIT_LIST_HEAD(&device->heap.list);
+ device->heap.free = device->size;
+
+ node = (heap_node_t *)vg_lite_os_malloc(sizeof(heap_node_t));
+
+ if (node == NULL) {
+ vg_lite_exit();
+ return -1;
+ }
+ node->offset = 0;
+ node->size = device->size;
+ node->status = 0;
+ add_list(&node->list, &device->heap.list);
+#if defined(VG_DRIVER_SINGLE_THREAD)
+#if !_BAREMETAL /*for rt500*/
+ device->int_queue = xSemaphoreCreateBinary();
+ device->int_flags = 0;
+#endif
+#endif /* VG_DRIVER_SINGLE_THREAD */
+ /* Success. */
+ return 0;
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_platform.h b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_platform.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_platform.h
rename to bsp/sdk_overlay/middleware/vglite/VGLiteKernel/rtos/vg_lite_platform.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_hw.h b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_hw.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_hw.h
rename to bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_hw.h
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c
similarity index 94%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c
rename to bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c
index cb4c654..8468675 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c
+++ b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.c
@@ -41,6 +41,18 @@ static vg_lite_kernel_initialize_t ts_initialize = {0};
static uint8_t ts_init = 0;
#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
+#if defined(VG_DRIVER_SINGLE_THREAD)
+
+#define VG_LITE_OS_LOCK() VG_LITE_SUCCESS
+#define VG_LITE_OS_UNLOCK()
+
+#else
+
+#define VG_LITE_OS_LOCK() vg_lite_os_lock()
+#define VG_LITE_OS_UNLOCK() vg_lite_os_unlock()
+
+#endif /* VG_DRIVER_SINGLE_THREAD */
+
static vg_lite_error_t do_terminate(vg_lite_kernel_terminate_t * data);
static void soft_reset(void);
@@ -49,9 +61,9 @@ static void gpu(int enable)
{
vg_lite_hw_clock_control_t value;
uint32_t reset_timer = 2;
-#ifndef VGLITE_DISABLE_AUTO_CLOCK_GATING
+#ifdef VG_GPU_AUTO_CLOCK_GATING
uint32_t temp;
-#endif
+#endif /* VG_GPU_AUTO_CLOCK_GATING */
const uint32_t reset_timer_limit = 1000;
if (enable) {
@@ -76,12 +88,12 @@ static void gpu(int enable)
vg_lite_hal_delay(reset_timer);
reset_timer *= 2; // If reset failed, try again with a longer wait. Need to check why if dead lopp happens here.
} while (!VG_LITE_KERNEL_IS_GPU_IDLE());
-#ifndef VGLITE_DISABLE_AUTO_CLOCK_GATING
+#ifdef VG_GPU_AUTO_CLOCK_GATING
temp = vg_lite_hal_peek(VG_LITE_HW_POWER_CONTROL);
temp |= 0x1;
vg_lite_hal_poke(VG_LITE_HW_POWER_CONTROL, temp);
vg_lite_hal_delay(1);
-#endif
+#endif /* VG_GPU_AUTO_CLOCK_GATING */
}
else
{
@@ -354,7 +366,7 @@ static vg_lite_error_t init_vglite(vg_lite_kernel_initialize_t * data)
}
}
- if((error = (vg_lite_error_t)vg_lite_os_lock()) == VG_LITE_SUCCESS){
+ if((error = (vg_lite_error_t)VG_LITE_OS_LOCK()) == VG_LITE_SUCCESS){
++task_num;
for(semaphore_id = 0; semaphore_id < TASK_LENGTH ; semaphore_id++)
{
@@ -371,7 +383,7 @@ static vg_lite_error_t init_vglite(vg_lite_kernel_initialize_t * data)
break;
}
}
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
}
else
return error;
@@ -392,12 +404,12 @@ static vg_lite_error_t init_vglite(vg_lite_kernel_initialize_t * data)
for (i = 0; i < CMDBUF_COUNT; i ++)
{
/* Allocate the memory. */
- vg_lite_os_lock();
+ VG_LITE_OS_LOCK();
error = vg_lite_hal_allocate_contiguous(data->command_buffer_size,
&context->command_buffer_logical[i],
&context->command_buffer_physical[i],
&context->command_buffer[i]);
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
if (error != VG_LITE_SUCCESS) {
/* Free any allocated memory. */
@@ -420,12 +432,12 @@ static vg_lite_error_t init_vglite(vg_lite_kernel_initialize_t * data)
for (i = 0; i < CMDBUF_COUNT; i ++)
{
/* Allocate the memory. */
- vg_lite_os_lock();
+ VG_LITE_OS_LOCK();
error = vg_lite_hal_allocate_contiguous(data->context_buffer_size,
&context->context_buffer_logical[i],
&context->context_buffer_physical[i],
&context->context_buffer[i]);
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
if (error != VG_LITE_SUCCESS) {
/* Free any allocated memory. */
@@ -473,12 +485,12 @@ static vg_lite_error_t init_vglite(vg_lite_kernel_initialize_t * data)
l2_size = data->capabilities.cap.l2_cache ? VG_LITE_ALIGN(VG_LITE_ALIGN(l1_size / 32, 64) / 8, 64) : 0;
/* Allocate the memory. */
- vg_lite_os_lock();
+ VG_LITE_OS_LOCK();
error = vg_lite_hal_allocate_contiguous(buffer_size + l1_size + l2_size,
&context->tessellation_buffer_logical,
&context->tessellation_buffer_physical,
&context->tessellation_buffer);
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
if (error != VG_LITE_SUCCESS) {
/* Free any allocated memory. */
@@ -646,10 +658,10 @@ static vg_lite_error_t terminate_vglite(vg_lite_kernel_terminate_t * data)
context->context_buffer[1] = NULL;
}
- if((error = (vg_lite_error_t)vg_lite_os_lock()) == VG_LITE_SUCCESS){
+ if((error = (vg_lite_error_t)VG_LITE_OS_LOCK()) == VG_LITE_SUCCESS){
--task_num;
--s_reference;
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
}
else
return error;
@@ -703,15 +715,11 @@ static vg_lite_error_t do_allocate(vg_lite_kernel_allocate_t * data)
{
vg_lite_error_t error;
-#if defined(VG_DRIVER_SINGLE_THREAD)
- error = vg_lite_hal_allocate_contiguous(data->bytes, &data->memory, &data->memory_gpu, &data->memory_handle);
-#else
- if((error = (vg_lite_error_t)vg_lite_os_lock()) == VG_LITE_SUCCESS)
+ if((error = (vg_lite_error_t)VG_LITE_OS_LOCK()) == VG_LITE_SUCCESS)
{
error = vg_lite_hal_allocate_contiguous(data->bytes, &data->memory, &data->memory_gpu, &data->memory_handle);
- vg_lite_os_unlock();
+ VG_LITE_OS_UNLOCK();
}
-#endif /* VG_DRIVER_SINGLE_THREAD */
return error;
}
@@ -928,12 +936,12 @@ static void soft_reset(void)
#if !defined(VG_DRIVER_SINGLE_THREAD)
static vg_lite_error_t do_mutex_lock()
{
- return (vg_lite_error_t)vg_lite_os_lock();
+ return (vg_lite_error_t)VG_LITE_OS_LOCK();
}
static vg_lite_error_t do_mutex_unlock()
{
- return (vg_lite_error_t)vg_lite_os_unlock();
+ return (vg_lite_error_t)VG_LITE_OS_UNLOCK();
}
#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h
rename to bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h
index 04dc5f6..c119637 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h
+++ b/bsp/sdk_overlay/middleware/vglite/VGLiteKernel/vg_lite_kernel.h
@@ -40,9 +40,7 @@
#define MAX_CONTIGUOUS_SIZE 0x02000000
#define VG_LITE_INFINITE 0xFFFFFFFF
-#if !defined(VG_DRIVER_SINGLE_THREAD)
#define VG_LITE_MAX_WAIT_TIME 0x130000
-#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
#define CMDBUF_COUNT 2
#define VG_LITE_ALIGN(number, alignment) \
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h b/bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h
rename to bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h
index cb8c91f..28529d3 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/inc/Elm.h
@@ -1,681 +1,681 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#ifndef ELM_H_
-#define ELM_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ELM_VERSION 0x00010000 /* Current Version: 1.0. */
-#define ELM_NULL_HANDLE 0 /*! NULL object handle, represent a void object. */
-
- /*!
- @typedef ELM_EVO_PROP_BIT
- evo property bits to control evo manipulation.
- */
- typedef enum {
- ELM_PROP_ROTATE_BIT = 1 << 0, /*! rotate bit of evo/ego/ebo transformation property. */
- ELM_PROP_TRANSFER_BIT = 1 << 1, /*! transfer bit of evo/ego/ebo transformation property. */
- ELM_PROP_SCALE_BIT = 1 << 2, /*! scale bit of evo/ego/ebo transformation property. */
- ELM_PROP_BLEND_BIT = 1 << 3, /*! blending bit of evo/ebo rendering property. */
- ELM_PROP_QUALITY_BIT = 1 << 4, /*! quality bit of evo/ebo rendering property. */
- ELM_PROP_FILL_BIT = 1 << 5, /*! fill rule bit of evo rendering property. */
- ELM_PROP_COLOR_BIT = 1 << 6, /*! fill color bit of evo rendering property. */
- ELM_PROP_PAINT_BIT = 1 << 7, /*! paint type bit of evo. */
- ELM_PROP_ALL_BIT = 0xFFFFFFFF, /*! all transformation property bits of evo. */
- } ELM_EVO_PROP_BIT;
-
- /*!
- @typedef ELM_EVO_BLEND
- The blending property of the evo object when it's drawn.
- D is Destination color, S is Source color;
- Da is Destination alpha, S is Source alpha.
- */
- typedef enum {
- ELM_BLEND_NONE = 0, /*! D = S. */
- ELM_BLEND_SRC_OVER, /*! D = S + (1 - Sa) * D */
- ELM_BLEND_DST_OVER, /*! D = (1 - Da) * S + D */
- ELM_BLEND_SRC_IN, /*! D = Da * S */
- ELM_BLEND_DST_IN, /*! D = Sa * D */
- ELM_BLEND_SCR, /*! D = S + D - S * D */
- ELM_BLEND_MUL, /*! D = S * (1 - Da) + D * (1 - Sa) + S * D */
- ELM_BLEND_ADD, /*! S + D */
- ELM_BLEND_SUB /*! D * (1 - S) */
- } ELM_BLEND;
-
- /*!
- @typedef ELM_EVO_QUALITY
- The drawing quality of the evo object.
- */
- typedef enum {
- ELM_QUALITY_LOW = 0, /*! NOAA for evo, POINT SAMPLE for ebo. */
- ELM_QUALITY_MED = 1, /*! 2XAA for evo, LINEAR SAMPLE for ebo. */
- ELM_QULIATY_HI = 2, /*! 4XAA for evo, BI-LINEAR SAMPLE for ebo. */
- } ELM_QUALITY;
-
- /*!
- @typedef ELM_PAINT_TYPE
- Those are types for evo fill paint.
- COLOR means solid color fill;
- PATTERN means fill with an image (evo);
- GRADIENT means fill with linear gradient.
- */
- typedef enum {
- ELM_PAINT_COLOR = 0, /*! Paint evo with solid color */
- ELM_PAINT_PATTERN = 1, /*! Paint evo with ebo */
- ELM_PAINT_GRADIENT = 2, /*! Paint evo with a linear gradient built-in evo object */
- ELM_PAINT_RADIAL_GRADIENT = 3, /*! Paint evo with a radial gradient built-in evo object */
- ELM_PAINT_TEXT = 4, /*! Paint evo-text */
- } ELM_PAINT_TYPE;
-
- /*!
- @typedef ELM_PATTERN_MODE
- Those are enum types for pattern fill mode.
- COLOR means fill the area outside the pattern with a solid color;
- PAD means extend the border color to the area outside the pattern.
- */
- typedef enum {
- ELM_PATTERN_MODE_COLOR = 0,
- ELM_PATTERN_MODE_PAD = 1,
- } ELM_PATTERN_MODE;
-
- /*!
- @typedef ELM_EVO_FILL
- The filling rule of for an evo object.
- EO = EVEN_ODD;
- NZ = NONE_ZERO;
- */
- typedef enum {
- ELM_EVO_FILL_NZ = 0, /*! none-zero fill rule */
- ELM_EVO_FILL_EO = 1, /*! Even-odd fill rule */
- } ELM_EVO_FILL;
-
- /*!
- @typedef ELM_EVO_TYPE
- the type of an evo object. could be pathes, images, or a group which contains other EVOs.
- */
- typedef enum {
- ELM_OBJECT_TYPE_EVO = 0, /*! elementary vector object, representing a path object. */
- ELM_OBJECT_TYPE_EGO = 1, /*! elementary group object, containing multiple path objects. */
- ELM_OBJECT_TYPE_EBO = 2, /*! elementary bitmap object, representing image data. */
- ELM_OBJECT_TYPE_BUF = 3, /*! rendering buffer object, created by application. */
- ELM_OBJECT_TYPE_FONT = 4, /*! elementary font object, representing character data. */
- ELM_OBJECT_TYPE_TEXT = 5, /*! elementary text object, representing text data. */
- } ELM_OBJECT_TYPE;
-
- /*!
- @typedef ELM_BUFFER_FORMAT
- Enumeration for buffer format, all format name definiton is sequenced from LSB to MSB.
- */
- typedef enum {
- ELM_BUFFER_FORMAT_RGBA8888, /*! 32-bit RGBA format with 8 bits per color channel. Red is in bits 7:0, green in bits 15:8, blue in
- bits 23:16, and the alpha channel is in bits 31:24. */
- ELM_BUFFER_FORMAT_BGRA8888, /*! 32-bit RGBA format with 8 bits per color channel. Red is in bits 23:16, green in bits 15:8, blue in
- bits 7:0, and the alpha channel is in bits 31:24. */
- ELM_BUFFER_FORMAT_RGBX8888, /*! 32-bit RGBX format with 8 bits per color channel. Red is in bits 7:0, green in bits 15:8, blue in
- bits 23:16, and the x channel is in bits 31:24. */
- ELM_BUFFER_FORMAT_BGRX8888, /*! 32-bit RGBX format with 8 bits per color channel. Red is in bits 23:16, green in bits 15:8, blue in
- bits 7:0, and the x channel is in bits 31:24. */
- ELM_BUFFER_FORMAT_RGB565, /*! 16-bit RGB format with 5 and 6 bits per color channel. Red is in bits 4:0, green in bits 10:5, and
- the blue color channel is in bits 15:11. */
- ELM_BUFFER_FORMAT_BGR565, /*! 16-bit RGB format with 5 and 6 bits per color channel. Red is in bits 15:11, green in bits 10:5,
- and the blue color channel is in bits 4:0. */
- ELM_BUFFER_FORMAT_RGBA4444, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 3:0, green in bits 7:4, blue in
- bits 11:8 and the alpha channel is in bits 15:12. */
- ELM_BUFFER_FORMAT_BGRA4444, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 11:8, green in bits 7:4, blue in
- bits 3:0 and the alpha channel is in bits 15:12. */
- ELM_BUFFER_FORMAT_BGRA5551, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 14:10, green in bits 9:5, blue in
- bits 4:0 and the alpha channel is in bit 15:15. */
- ELM_BUFFER_FORMAT_INDEX_1, /*! 1-bit indexed format. */
- ELM_BUFFER_FORMAT_INDEX_2, /*! 2-bits indexed format. */
- ELM_BUFFER_FORMAT_INDEX_4, /*! 4-bits indexed format. */
- ELM_BUFFER_FORMAT_INDEX_8, /*! 8-bits indexed format. */
- } ELM_BUFFER_FORMAT;
-
- /*!
- @typedef ElmHandle
- common handle type for object reference.
- */
- typedef unsigned int ElmHandle;
-
- /*!
- @typedef ElmVecObj
- evo object handle (elemtry vector object). Created from an external binary evo file.
- */
- typedef ElmHandle ElmVecObj;
-
- /*!
- @typedef ElmBitmapObj
- ebo object handle (elementry image object). Created from an external ebo file.
- */
- typedef ElmHandle ElmBitmapObj;
-
- /*!
- @typedef ElmGroupObj
- group object handle. Create from an external ego file.
- */
- typedef ElmHandle ElmGroupObj;
-
- /*!
- @typedef ElmBuffer
- render buffer object handle.
- */
- typedef ElmHandle ElmBuffer;
-
- #define TRUE 1
- #define FALSE 0
- /*!
- @typedef BOOL
- boolean type define.
- */
- typedef unsigned int BOOL;
-
- /*!
- @abstract Initialize Elementary context.
-
- @discussion
- It should be called as the first function of Elemenatary libary, which initializes the library. Currently
- Elementary library doesn't support context concept, neigher multi-threading. Elementary library defines
- origin of coordinate system is at top-left.
-
- @param none
-
- @return none
- */
- BOOL ElmInitialize(uint32_t width, uint32_t height);
-
- /*!
- @abstract Terminate Elementary context.
-
- @discussion
- This should be called when an app exits. It frees all the resource.
-
- @param none
-
- @return none
- */
- void ElmTerminate(void);
-
- /*!
- @abstract Create an elementary object from an existing binary file.
-
- @discussion
- This function creates an elementary object from the file whose file name is specified by param name.
- Caller must match type with the binary file, otherwise create mail fail by returning ELM_NULL_HANDLE.
-
- @param type
- Specify what type of object to be created.
-
- @param name
- The name of the binary resource file.
-
- @return ElmHandle
- An object handle depending on the corresponding type. If type mismatches, it
- returns ELM_NULL_HANDLE.
- */
- ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name);
-
- /*!
- @abstract Create an elementary object from build-in data within the appplication.
-
- @discussion
- This function creates an elementar object from local data pointer, which is specially useful for environment without filesystem support.
-
- @param type
- Specify what type of object to be created.
-
- @param data
- The pointer to the binary data which has exactly same layout as external resource file.
-
- @return ElmHandle
- An object handle depending on the corresponding type. If type mismatches with the binary data, it
- returns ELM_NULL_HANDLE.
- */
- ElmHandle ElmCreateObjectFromData(ELM_OBJECT_TYPE type, void *data, int size);
-
- /*!
- @abstract Rotate a graphics object with centain degree
-
- @discussion
- This function sets an evo/ebo/ego object rotated with specified angle. Without reset, these setting will be
- accumulated.
-
- @param obj
- The graphics object will be rotated.
-
- @param angle
- A radian value to be applied on the evo object.
-
- @return bool
- Rotate is set successfully.
- */
- BOOL ElmRotate(ElmHandle obj, float angle);
-
- /*!
- @abstract Transfer an graphics object at different directions.
-
- @discussion
- This function put an evo/ebo/ego object away at different directions. Without reset, the setting will be
- accumulated.
-
- @param obj
- The graphics object will be transfered.
-
- @param x
- The units in pixel of X direction.
-
- @param y
- The units in pixel of Y direction.
-
- @return bool
- Transfer is set successfully.
- */
- BOOL ElmTransfer(ElmHandle obj, int x, int y);
-
- /*!
- @abstract Scale an graphics object at different directions.
-
- @discussion
- This function scale up or down an evo/ego/ebo object at different directions. Without reset, the setting will
- be accumateled.
-
- @param obj
- The graphics object which is targeted to manipulate.
-
- @param x
- The scale ratio in X direction.
-
- @param y
- The scale ratio in Y direction.
-
- @return bool
- Scale is set succefully.
- */
- BOOL ElmScale(ElmHandle obj, float x, float y);
-
- /*!
- @abstract Reset the attribute of a graphics object for specified property bit.
-
- @discussion
- This funcion resets specified property for an elementary object. It can be applied all types of objects.
- But some properties are only valid for centain types of objects. If the function is called to reset an invalid
- property for this type of object, it will be siliently ignored.
- After reset, the specifed property of an evo/ebo/ego object is set to the initial state. The initial states are decided
- by the binary resource file. The resource creator should set right value for all properties if they want to directly render
- the object without any adjustment in application. There is one issue, at present, application has no way to query current value
- of each property, is it required?
-
- @param obj
- The graphics object which is targeted to manipulate.
-
- @param mask
- Specify which property or properties need to reset to initial value.
-
- @return bool
- Reset is done successfully. If some mask is not valid for this type of object, it would return false.
- */
- BOOL ElmReset(ElmHandle obj, ELM_EVO_PROP_BIT mask);
-
- /*!
- @abstract Draw a graphics object onto current render target
-
- @discussion
- This is an enssentail function to do the real job, it takes all current setting of the elementary object and
- render into theb buffer target.
-
- @param buffer
- The render target that an elmentary object will be rendered into.
-
- @param obj
- The elmentary object will be draw into render target.
-
- @return bool
- The draw operation for this elmentary object is sucessful.
- */
- BOOL ElmDraw(ElmBuffer buffer, ElmHandle object);
-
- /*!
- @abstract Set the rendering quality of an graphics object.
-
- @discussion
- This function sets the rendering quality of an evo/ebo object. Avaliable quality setting contains:
- ELM_EVO_QUALITY_LOW, ELM_EVO_QUALITY_MED, ELM_EVO_QUALITY_HI. This function is only applied to an evo or an ebo.
- Group object can't be set quality. It always use the setting from its binary.
-
- @param obj
- The elementary object.
-
- @param quality
- The quality enum.
-
- @return bool
- The operation for this object is sucessful, for group object and invalid enum, would return false.
- */
- BOOL ElmSetQuality(ElmHandle obj, ELM_QUALITY quality);
-
- /*!
- @abstract Set the fill rule of an evo object.
-
- @discussion
- This function sets the fill rule of an elementary object. Avaliable quality setting contains:
- ELM_EVO_EO, ELM_EVO_NZ. It only applies to evo object.
-
- @param evo
- The evo object.
-
- @param fill
- The fill rule enum.
-
- @return bool
- The operation for this evo is sucessful. For non-evo object an ENUM is not a valid enum, would return false.
- */
- BOOL ElmSetFill(ElmVecObj evo, ELM_EVO_FILL fill);
-
- /*!
- @abstract Set the blending mode of an evo/ebo object.
-
- @discussion
- This function sets the blending mode of an evo/ebo object. It's not applied to group object.
-
- @param obj
- The graphics object.
-
- @param blend
- The blending mode enum.
-
- @return bool
- The operation for this evo/ebo is sucessful. If object is a group object or blend mode is not a legal one, it would return false.
- */
- BOOL ElmSetBlend(ElmHandle obj, ELM_BLEND blend);
-
- /*!
- @abstract Set the solid fill color of an evo object.
-
- @discussion
- This function sets the solid fill color of an evo object.
-
- @param evo
- The evo object.
-
- @param color
- The uint32 color value in rgba order.
-
- @return bool
- The operation for this evo is sucessful. If the object is not a evo object, it would return false.
- */
- BOOL ElmSetColor(ElmVecObj evo, uint32_t color);
-
- /*!
- @abstract Set the image paint fill of an evo.
-
- @discussion
- This function sets the image pattern for filling an evo. The image pattern
- is a loaded ebo. The ebo's transformation is applied when drawing the evo.
-
- @param evo
- The evo object.
-
- @param pattern
- The image pattern to be set for the evo.
-
- @return bool
- The operation is successful or not.
- */
- BOOL ElmSetPattern(ElmVecObj evo, ElmBitmapObj pattern);
-
- /*!
- @abstract Set the image paint fill of an evo.
-
- @discussion
- This function sets the image pattern for filling an evo. The image pattern
- is a loaded ebo. The ebo's transformation is applied when drawing the evo.
-
- @param evo
- The evo object.
-
- @param pattern
- The image pattern to be set for the evo.
-
- @return bool
- The operation is successful or not.
- */
- BOOL ElmSetPatternMode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color);
-
- /*!
- @abstract Set the paint type of an evo.
-
- @discussion
- This function selects the paint type for evo to use. An evo may have 3 types
- of paint: COLOR, PATTERN, and LINEAR GRADIENT. The Linear graident is always
- a built-in resource, which can not be altered. If a binary resource doesn't
- have built-in gradient paint resource, it can't be selected as the paint source.
- Solid color is also a built-in attribute, but it can be changed by ElmSetColor().
- Paint with a pattern always need an external ebo object, which is impossible
- to be embedded in resource file,i.e. ebo object. Before select paint type to
- be PATTERN, ElmSetPattern() must be called to attach an EBO to an EVO.
-
- @param evo
- The evo object.
-
- @param type
- The paint type to be set for the evo.
-
- @return bool
- The operation is successful or not.
- If the corresponding type is not avaiable for the evo, it returns false and
- type paint type falls back to COLOR.
- */
- BOOL ElmSetPaintType(ElmVecObj evo, ELM_PAINT_TYPE type);
-
- /*!
- @abstract Create internal render buffer.
-
- @discussion
- This functiois is to create an internal render buffer for Elementary rendering, ussually it's not for direct display.
- The buffer which is displayed on pannel is wrapped up by another API, whose address is managed by display controller side.
-
- @param width
- The buffer's width.
-
- @param height
- The buffer's height.
-
- @param format
- The buffer's format, check enumeration of ELM_BUFFER_FORMAT.
-
- @return
- The buffer handle.
- */
- ElmBuffer ElmCreateBuffer(unsigned int width, unsigned int height, ELM_BUFFER_FORMAT format);
-
- /*!
- @abstract Wrap a customized buffer.
-
- @discussion
- The application may wrap a user created buffer by giving the information of
- the buffer including the size, the memory addresses and format. E.g., the
- application can wrap a system framebuffer thus ELM can directly render onto
- the screen.
-
- @return
- The buffer handle.
- */
- ElmBuffer ElmWrapBuffer(int width, int height, int stride,
- void *logical, uint32_t physical,
- ELM_BUFFER_FORMAT format);
-
- /*!
- @abstract Get buffer address.
-
- @discussion
- The function is to get the address of ElmBuffer.
-
- @return
- The buffer address.
- */
-
- uint32_t ElmGetBufferAddress(ElmBuffer buffer);
-
- /*!
- @abstract Destroy a render buffer.
-
- @discussion
- This function is to release all internal resource inside Elementary libary belonging to this buffer.
- Applicatoin need make sure the buffer is not being used by elmentary library any more when calling this function.
-
- @param buffer
- The render buffer handle
-
- @return
- If destroying is completed successfully.
- */
- BOOL ElmDestroyBuffer(ElmBuffer buffer);
-
- /*!
- @abstract Save a buffer to PNG file.
-
- @discussion
- This function can save the buffer into a PNG file.
-
- @param buffer
- The render buffer handle.
-
- @param name
- The name of the PNG file to sve.
-
- @return
- Save OK or NOT.
-
- */
- BOOL ElmSaveBuffer(ElmBuffer buffer, const char *name);
-
- /*!
- @abstract Clear a render buffer with specified color and dimension.
-
- @discussion
- This function is called to clear full or partial of the buffer. If the rectangle is out of buffer space, the intersect portion will be cleared.
-
- @param buffer
- A render buffer handle.
-
- @param color
- Clear color value.
-
- @param x
- x origin of partical clear rectangle.
-
- @param y
- y origin of partial clear rectangle.
-
- @param width
- width of partical clear rectangle.
-
- @param height
- height of partical clear rectangle.
-
- @param full
- Flag to indicate a full buffer clear. If true, the dimension parameters will be ignored.
-
- @return bool
- Indicate the clear operation is set up correctly.
- */
- BOOL ElmClear(ElmBuffer buffer, uint32_t color, uint32_t x, uint32_t y, uint32_t width, uint32_t height, BOOL full);
-
- /*!
- @abstract Destroy an ELM object.
-
- @discussion
- This function is to release all internal resource inside Elementary libary belonging to this object.
- Applicatoin need make sure the object is not being used by elmentary library any more when calling this function.
- If an EBO is being destroyed and it's attached to one EVO, it need to guarantee that EVO is not being used by elementary library too.
-
- @param object
- The object handle
-
- @return
- If destroying is completed successfully.
- */
- BOOL ElmDestroyObject(ElmHandle object);
-
- /*!
- @abstract Finish all rendering on GPU issued before this call.
-
- @discussion
- This function tells the engine that it has finished the frame data and GPU can draw it now. It's blocked until GPU rendering done.
-
- @return
- If the opeartion is successfully done or not.
- */
- BOOL ElmFinish();
-
- /*!
- @abstract Flush all rendering command to GPU issued before this call.
-
- @discussion
- This function tells the engine to start kicking off command to GPU side, it will return immediately after firing off GPU.
-
- @return
- If the opeartion is successfully done or not.
- */
- BOOL ElmFlush();
-
- /*!
- @abstract Query the paint color of an evo object.
- */
- BOOL ElmGetColor(ElmVecObj evoHandle,uint32_t *color);
-
- /*!
- @abstract Query the vectory path count of an EGO object. If the given object
- is an evo/ebo, the count is 0.
- */
- uint32_t ElmGetVectorCount(ElmHandle handle);
-
- /*!
- @abstract Query the type of an object (by handle).
- */
- ELM_OBJECT_TYPE ElmGetObjectType(ElmHandle handle);
-
- /*!
- @abstract Set the current vectory object index to operate on.
- */
- BOOL ElmSetCurrentVector(int32_t id);
-
- BOOL ElmScalePaint(ElmHandle handle, float sx, float sy);
- BOOL ElmRotatePaint(ElmHandle handle, float degrees);
- BOOL ElmTranslatePaint(ElmHandle handle, float tx, float ty);
-
- /*!
- @abstract Get handle of the framebuffer.
- */
- ElmBuffer ElmGetBuffer(vg_lite_buffer_t *buffer);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* ELM_H_ */
+/****************************************************************************
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#ifndef ELM_H_
+#define ELM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ELM_VERSION 0x00010000 /* Current Version: 1.0. */
+#define ELM_NULL_HANDLE 0 /*! NULL object handle, represent a void object. */
+
+ /*!
+ @typedef ELM_EVO_PROP_BIT
+ evo property bits to control evo manipulation.
+ */
+ typedef enum {
+ ELM_PROP_ROTATE_BIT = 1 << 0, /*! rotate bit of evo/ego/ebo transformation property. */
+ ELM_PROP_TRANSFER_BIT = 1 << 1, /*! transfer bit of evo/ego/ebo transformation property. */
+ ELM_PROP_SCALE_BIT = 1 << 2, /*! scale bit of evo/ego/ebo transformation property. */
+ ELM_PROP_BLEND_BIT = 1 << 3, /*! blending bit of evo/ebo rendering property. */
+ ELM_PROP_QUALITY_BIT = 1 << 4, /*! quality bit of evo/ebo rendering property. */
+ ELM_PROP_FILL_BIT = 1 << 5, /*! fill rule bit of evo rendering property. */
+ ELM_PROP_COLOR_BIT = 1 << 6, /*! fill color bit of evo rendering property. */
+ ELM_PROP_PAINT_BIT = 1 << 7, /*! paint type bit of evo. */
+ ELM_PROP_ALL_BIT = 0xFFFFFFFF, /*! all transformation property bits of evo. */
+ } ELM_EVO_PROP_BIT;
+
+ /*!
+ @typedef ELM_EVO_BLEND
+ The blending property of the evo object when it's drawn.
+ D is Destination color, S is Source color;
+ Da is Destination alpha, S is Source alpha.
+ */
+ typedef enum {
+ ELM_BLEND_NONE = 0, /*! D = S. */
+ ELM_BLEND_SRC_OVER, /*! D = S + (1 - Sa) * D */
+ ELM_BLEND_DST_OVER, /*! D = (1 - Da) * S + D */
+ ELM_BLEND_SRC_IN, /*! D = Da * S */
+ ELM_BLEND_DST_IN, /*! D = Sa * D */
+ ELM_BLEND_SCR, /*! D = S + D - S * D */
+ ELM_BLEND_MUL, /*! D = S * (1 - Da) + D * (1 - Sa) + S * D */
+ ELM_BLEND_ADD, /*! S + D */
+ ELM_BLEND_SUB /*! D * (1 - S) */
+ } ELM_BLEND;
+
+ /*!
+ @typedef ELM_EVO_QUALITY
+ The drawing quality of the evo object.
+ */
+ typedef enum {
+ ELM_QUALITY_LOW = 0, /*! NOAA for evo, POINT SAMPLE for ebo. */
+ ELM_QUALITY_MED = 1, /*! 2XAA for evo, LINEAR SAMPLE for ebo. */
+ ELM_QULIATY_HI = 2, /*! 4XAA for evo, BI-LINEAR SAMPLE for ebo. */
+ } ELM_QUALITY;
+
+ /*!
+ @typedef ELM_PAINT_TYPE
+ Those are types for evo fill paint.
+ COLOR means solid color fill;
+ PATTERN means fill with an image (evo);
+ GRADIENT means fill with linear gradient.
+ */
+ typedef enum {
+ ELM_PAINT_COLOR = 0, /*! Paint evo with solid color */
+ ELM_PAINT_PATTERN = 1, /*! Paint evo with ebo */
+ ELM_PAINT_GRADIENT = 2, /*! Paint evo with a linear gradient built-in evo object */
+ ELM_PAINT_RADIAL_GRADIENT = 3, /*! Paint evo with a radial gradient built-in evo object */
+ ELM_PAINT_TEXT = 4, /*! Paint evo-text */
+ } ELM_PAINT_TYPE;
+
+ /*!
+ @typedef ELM_PATTERN_MODE
+ Those are enum types for pattern fill mode.
+ COLOR means fill the area outside the pattern with a solid color;
+ PAD means extend the border color to the area outside the pattern.
+ */
+ typedef enum {
+ ELM_PATTERN_MODE_COLOR = 0,
+ ELM_PATTERN_MODE_PAD = 1,
+ } ELM_PATTERN_MODE;
+
+ /*!
+ @typedef ELM_EVO_FILL
+ The filling rule of for an evo object.
+ EO = EVEN_ODD;
+ NZ = NONE_ZERO;
+ */
+ typedef enum {
+ ELM_EVO_FILL_NZ = 0, /*! none-zero fill rule */
+ ELM_EVO_FILL_EO = 1, /*! Even-odd fill rule */
+ } ELM_EVO_FILL;
+
+ /*!
+ @typedef ELM_EVO_TYPE
+ the type of an evo object. could be pathes, images, or a group which contains other EVOs.
+ */
+ typedef enum {
+ ELM_OBJECT_TYPE_EVO = 0, /*! elementary vector object, representing a path object. */
+ ELM_OBJECT_TYPE_EGO = 1, /*! elementary group object, containing multiple path objects. */
+ ELM_OBJECT_TYPE_EBO = 2, /*! elementary bitmap object, representing image data. */
+ ELM_OBJECT_TYPE_BUF = 3, /*! rendering buffer object, created by application. */
+ ELM_OBJECT_TYPE_FONT = 4, /*! elementary font object, representing character data. */
+ ELM_OBJECT_TYPE_TEXT = 5, /*! elementary text object, representing text data. */
+ } ELM_OBJECT_TYPE;
+
+ /*!
+ @typedef ELM_BUFFER_FORMAT
+ Enumeration for buffer format, all format name definiton is sequenced from LSB to MSB.
+ */
+ typedef enum {
+ ELM_BUFFER_FORMAT_RGBA8888, /*! 32-bit RGBA format with 8 bits per color channel. Red is in bits 7:0, green in bits 15:8, blue in
+ bits 23:16, and the alpha channel is in bits 31:24. */
+ ELM_BUFFER_FORMAT_BGRA8888, /*! 32-bit RGBA format with 8 bits per color channel. Red is in bits 23:16, green in bits 15:8, blue in
+ bits 7:0, and the alpha channel is in bits 31:24. */
+ ELM_BUFFER_FORMAT_RGBX8888, /*! 32-bit RGBX format with 8 bits per color channel. Red is in bits 7:0, green in bits 15:8, blue in
+ bits 23:16, and the x channel is in bits 31:24. */
+ ELM_BUFFER_FORMAT_BGRX8888, /*! 32-bit RGBX format with 8 bits per color channel. Red is in bits 23:16, green in bits 15:8, blue in
+ bits 7:0, and the x channel is in bits 31:24. */
+ ELM_BUFFER_FORMAT_RGB565, /*! 16-bit RGB format with 5 and 6 bits per color channel. Red is in bits 4:0, green in bits 10:5, and
+ the blue color channel is in bits 15:11. */
+ ELM_BUFFER_FORMAT_BGR565, /*! 16-bit RGB format with 5 and 6 bits per color channel. Red is in bits 15:11, green in bits 10:5,
+ and the blue color channel is in bits 4:0. */
+ ELM_BUFFER_FORMAT_RGBA4444, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 3:0, green in bits 7:4, blue in
+ bits 11:8 and the alpha channel is in bits 15:12. */
+ ELM_BUFFER_FORMAT_BGRA4444, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 11:8, green in bits 7:4, blue in
+ bits 3:0 and the alpha channel is in bits 15:12. */
+ ELM_BUFFER_FORMAT_BGRA5551, /*! 16-bit RGBA format with 4 bits per color channel. Red is in bits 14:10, green in bits 9:5, blue in
+ bits 4:0 and the alpha channel is in bit 15:15. */
+ ELM_BUFFER_FORMAT_INDEX_1, /*! 1-bit indexed format. */
+ ELM_BUFFER_FORMAT_INDEX_2, /*! 2-bits indexed format. */
+ ELM_BUFFER_FORMAT_INDEX_4, /*! 4-bits indexed format. */
+ ELM_BUFFER_FORMAT_INDEX_8, /*! 8-bits indexed format. */
+ } ELM_BUFFER_FORMAT;
+
+ /*!
+ @typedef ElmHandle
+ common handle type for object reference.
+ */
+ typedef unsigned int ElmHandle;
+
+ /*!
+ @typedef ElmVecObj
+ evo object handle (elemtry vector object). Created from an external binary evo file.
+ */
+ typedef ElmHandle ElmVecObj;
+
+ /*!
+ @typedef ElmBitmapObj
+ ebo object handle (elementry image object). Created from an external ebo file.
+ */
+ typedef ElmHandle ElmBitmapObj;
+
+ /*!
+ @typedef ElmGroupObj
+ group object handle. Create from an external ego file.
+ */
+ typedef ElmHandle ElmGroupObj;
+
+ /*!
+ @typedef ElmBuffer
+ render buffer object handle.
+ */
+ typedef ElmHandle ElmBuffer;
+
+ #define TRUE 1
+ #define FALSE 0
+ /*!
+ @typedef BOOL
+ boolean type define.
+ */
+ typedef unsigned int BOOL;
+
+ /*!
+ @abstract Initialize Elementary context.
+
+ @discussion
+ It should be called as the first function of Elemenatary libary, which initializes the library. Currently
+ Elementary library doesn't support context concept, neigher multi-threading. Elementary library defines
+ origin of coordinate system is at top-left.
+
+ @param none
+
+ @return none
+ */
+ BOOL ElmInitialize(uint32_t width, uint32_t height);
+
+ /*!
+ @abstract Terminate Elementary context.
+
+ @discussion
+ This should be called when an app exits. It frees all the resource.
+
+ @param none
+
+ @return none
+ */
+ void ElmTerminate(void);
+
+ /*!
+ @abstract Create an elementary object from an existing binary file.
+
+ @discussion
+ This function creates an elementary object from the file whose file name is specified by param name.
+ Caller must match type with the binary file, otherwise create mail fail by returning ELM_NULL_HANDLE.
+
+ @param type
+ Specify what type of object to be created.
+
+ @param name
+ The name of the binary resource file.
+
+ @return ElmHandle
+ An object handle depending on the corresponding type. If type mismatches, it
+ returns ELM_NULL_HANDLE.
+ */
+ ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name);
+
+ /*!
+ @abstract Create an elementary object from build-in data within the appplication.
+
+ @discussion
+ This function creates an elementar object from local data pointer, which is specially useful for environment without filesystem support.
+
+ @param type
+ Specify what type of object to be created.
+
+ @param data
+ The pointer to the binary data which has exactly same layout as external resource file.
+
+ @return ElmHandle
+ An object handle depending on the corresponding type. If type mismatches with the binary data, it
+ returns ELM_NULL_HANDLE.
+ */
+ ElmHandle ElmCreateObjectFromData(ELM_OBJECT_TYPE type, void *data, int size);
+
+ /*!
+ @abstract Rotate a graphics object with centain degree
+
+ @discussion
+ This function sets an evo/ebo/ego object rotated with specified angle. Without reset, these setting will be
+ accumulated.
+
+ @param obj
+ The graphics object will be rotated.
+
+ @param angle
+ A radian value to be applied on the evo object.
+
+ @return bool
+ Rotate is set successfully.
+ */
+ BOOL ElmRotate(ElmHandle obj, float angle);
+
+ /*!
+ @abstract Transfer an graphics object at different directions.
+
+ @discussion
+ This function put an evo/ebo/ego object away at different directions. Without reset, the setting will be
+ accumulated.
+
+ @param obj
+ The graphics object will be transfered.
+
+ @param x
+ The units in pixel of X direction.
+
+ @param y
+ The units in pixel of Y direction.
+
+ @return bool
+ Transfer is set successfully.
+ */
+ BOOL ElmTransfer(ElmHandle obj, int x, int y);
+
+ /*!
+ @abstract Scale an graphics object at different directions.
+
+ @discussion
+ This function scale up or down an evo/ego/ebo object at different directions. Without reset, the setting will
+ be accumateled.
+
+ @param obj
+ The graphics object which is targeted to manipulate.
+
+ @param x
+ The scale ratio in X direction.
+
+ @param y
+ The scale ratio in Y direction.
+
+ @return bool
+ Scale is set succefully.
+ */
+ BOOL ElmScale(ElmHandle obj, float x, float y);
+
+ /*!
+ @abstract Reset the attribute of a graphics object for specified property bit.
+
+ @discussion
+ This funcion resets specified property for an elementary object. It can be applied all types of objects.
+ But some properties are only valid for centain types of objects. If the function is called to reset an invalid
+ property for this type of object, it will be siliently ignored.
+ After reset, the specifed property of an evo/ebo/ego object is set to the initial state. The initial states are decided
+ by the binary resource file. The resource creator should set right value for all properties if they want to directly render
+ the object without any adjustment in application. There is one issue, at present, application has no way to query current value
+ of each property, is it required?
+
+ @param obj
+ The graphics object which is targeted to manipulate.
+
+ @param mask
+ Specify which property or properties need to reset to initial value.
+
+ @return bool
+ Reset is done successfully. If some mask is not valid for this type of object, it would return false.
+ */
+ BOOL ElmReset(ElmHandle obj, ELM_EVO_PROP_BIT mask);
+
+ /*!
+ @abstract Draw a graphics object onto current render target
+
+ @discussion
+ This is an enssentail function to do the real job, it takes all current setting of the elementary object and
+ render into theb buffer target.
+
+ @param buffer
+ The render target that an elmentary object will be rendered into.
+
+ @param obj
+ The elmentary object will be draw into render target.
+
+ @return bool
+ The draw operation for this elmentary object is sucessful.
+ */
+ BOOL ElmDraw(ElmBuffer buffer, ElmHandle object);
+
+ /*!
+ @abstract Set the rendering quality of an graphics object.
+
+ @discussion
+ This function sets the rendering quality of an evo/ebo object. Avaliable quality setting contains:
+ ELM_EVO_QUALITY_LOW, ELM_EVO_QUALITY_MED, ELM_EVO_QUALITY_HI. This function is only applied to an evo or an ebo.
+ Group object can't be set quality. It always use the setting from its binary.
+
+ @param obj
+ The elementary object.
+
+ @param quality
+ The quality enum.
+
+ @return bool
+ The operation for this object is sucessful, for group object and invalid enum, would return false.
+ */
+ BOOL ElmSetQuality(ElmHandle obj, ELM_QUALITY quality);
+
+ /*!
+ @abstract Set the fill rule of an evo object.
+
+ @discussion
+ This function sets the fill rule of an elementary object. Avaliable quality setting contains:
+ ELM_EVO_EO, ELM_EVO_NZ. It only applies to evo object.
+
+ @param evo
+ The evo object.
+
+ @param fill
+ The fill rule enum.
+
+ @return bool
+ The operation for this evo is sucessful. For non-evo object an ENUM is not a valid enum, would return false.
+ */
+ BOOL ElmSetFill(ElmVecObj evo, ELM_EVO_FILL fill);
+
+ /*!
+ @abstract Set the blending mode of an evo/ebo object.
+
+ @discussion
+ This function sets the blending mode of an evo/ebo object. It's not applied to group object.
+
+ @param obj
+ The graphics object.
+
+ @param blend
+ The blending mode enum.
+
+ @return bool
+ The operation for this evo/ebo is sucessful. If object is a group object or blend mode is not a legal one, it would return false.
+ */
+ BOOL ElmSetBlend(ElmHandle obj, ELM_BLEND blend);
+
+ /*!
+ @abstract Set the solid fill color of an evo object.
+
+ @discussion
+ This function sets the solid fill color of an evo object.
+
+ @param evo
+ The evo object.
+
+ @param color
+ The uint32 color value in rgba order.
+
+ @return bool
+ The operation for this evo is sucessful. If the object is not a evo object, it would return false.
+ */
+ BOOL ElmSetColor(ElmVecObj evo, uint32_t color);
+
+ /*!
+ @abstract Set the image paint fill of an evo.
+
+ @discussion
+ This function sets the image pattern for filling an evo. The image pattern
+ is a loaded ebo. The ebo's transformation is applied when drawing the evo.
+
+ @param evo
+ The evo object.
+
+ @param pattern
+ The image pattern to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ */
+ BOOL ElmSetPattern(ElmVecObj evo, ElmBitmapObj pattern);
+
+ /*!
+ @abstract Set the image paint fill of an evo.
+
+ @discussion
+ This function sets the image pattern for filling an evo. The image pattern
+ is a loaded ebo. The ebo's transformation is applied when drawing the evo.
+
+ @param evo
+ The evo object.
+
+ @param pattern
+ The image pattern to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ */
+ BOOL ElmSetPatternMode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color);
+
+ /*!
+ @abstract Set the paint type of an evo.
+
+ @discussion
+ This function selects the paint type for evo to use. An evo may have 3 types
+ of paint: COLOR, PATTERN, and LINEAR GRADIENT. The Linear graident is always
+ a built-in resource, which can not be altered. If a binary resource doesn't
+ have built-in gradient paint resource, it can't be selected as the paint source.
+ Solid color is also a built-in attribute, but it can be changed by ElmSetColor().
+ Paint with a pattern always need an external ebo object, which is impossible
+ to be embedded in resource file,i.e. ebo object. Before select paint type to
+ be PATTERN, ElmSetPattern() must be called to attach an EBO to an EVO.
+
+ @param evo
+ The evo object.
+
+ @param type
+ The paint type to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ If the corresponding type is not avaiable for the evo, it returns false and
+ type paint type falls back to COLOR.
+ */
+ BOOL ElmSetPaintType(ElmVecObj evo, ELM_PAINT_TYPE type);
+
+ /*!
+ @abstract Create internal render buffer.
+
+ @discussion
+ This functiois is to create an internal render buffer for Elementary rendering, ussually it's not for direct display.
+ The buffer which is displayed on pannel is wrapped up by another API, whose address is managed by display controller side.
+
+ @param width
+ The buffer's width.
+
+ @param height
+ The buffer's height.
+
+ @param format
+ The buffer's format, check enumeration of ELM_BUFFER_FORMAT.
+
+ @return
+ The buffer handle.
+ */
+ ElmBuffer ElmCreateBuffer(unsigned int width, unsigned int height, ELM_BUFFER_FORMAT format);
+
+ /*!
+ @abstract Wrap a customized buffer.
+
+ @discussion
+ The application may wrap a user created buffer by giving the information of
+ the buffer including the size, the memory addresses and format. E.g., the
+ application can wrap a system framebuffer thus ELM can directly render onto
+ the screen.
+
+ @return
+ The buffer handle.
+ */
+ ElmBuffer ElmWrapBuffer(int width, int height, int stride,
+ void *logical, uint32_t physical,
+ ELM_BUFFER_FORMAT format);
+
+ /*!
+ @abstract Get buffer address.
+
+ @discussion
+ The function is to get the address of ElmBuffer.
+
+ @return
+ The buffer address.
+ */
+
+ uint32_t ElmGetBufferAddress(ElmBuffer buffer);
+
+ /*!
+ @abstract Destroy a render buffer.
+
+ @discussion
+ This function is to release all internal resource inside Elementary libary belonging to this buffer.
+ Applicatoin need make sure the buffer is not being used by elmentary library any more when calling this function.
+
+ @param buffer
+ The render buffer handle
+
+ @return
+ If destroying is completed successfully.
+ */
+ BOOL ElmDestroyBuffer(ElmBuffer buffer);
+
+ /*!
+ @abstract Save a buffer to PNG file.
+
+ @discussion
+ This function can save the buffer into a PNG file.
+
+ @param buffer
+ The render buffer handle.
+
+ @param name
+ The name of the PNG file to sve.
+
+ @return
+ Save OK or NOT.
+
+ */
+ BOOL ElmSaveBuffer(ElmBuffer buffer, const char *name);
+
+ /*!
+ @abstract Clear a render buffer with specified color and dimension.
+
+ @discussion
+ This function is called to clear full or partial of the buffer. If the rectangle is out of buffer space, the intersect portion will be cleared.
+
+ @param buffer
+ A render buffer handle.
+
+ @param color
+ Clear color value.
+
+ @param x
+ x origin of partical clear rectangle.
+
+ @param y
+ y origin of partial clear rectangle.
+
+ @param width
+ width of partical clear rectangle.
+
+ @param height
+ height of partical clear rectangle.
+
+ @param full
+ Flag to indicate a full buffer clear. If true, the dimension parameters will be ignored.
+
+ @return bool
+ Indicate the clear operation is set up correctly.
+ */
+ BOOL ElmClear(ElmBuffer buffer, uint32_t color, uint32_t x, uint32_t y, uint32_t width, uint32_t height, BOOL full);
+
+ /*!
+ @abstract Destroy an ELM object.
+
+ @discussion
+ This function is to release all internal resource inside Elementary libary belonging to this object.
+ Applicatoin need make sure the object is not being used by elmentary library any more when calling this function.
+ If an EBO is being destroyed and it's attached to one EVO, it need to guarantee that EVO is not being used by elementary library too.
+
+ @param object
+ The object handle
+
+ @return
+ If destroying is completed successfully.
+ */
+ BOOL ElmDestroyObject(ElmHandle object);
+
+ /*!
+ @abstract Finish all rendering on GPU issued before this call.
+
+ @discussion
+ This function tells the engine that it has finished the frame data and GPU can draw it now. It's blocked until GPU rendering done.
+
+ @return
+ If the opeartion is successfully done or not.
+ */
+ BOOL ElmFinish();
+
+ /*!
+ @abstract Flush all rendering command to GPU issued before this call.
+
+ @discussion
+ This function tells the engine to start kicking off command to GPU side, it will return immediately after firing off GPU.
+
+ @return
+ If the opeartion is successfully done or not.
+ */
+ BOOL ElmFlush();
+
+ /*!
+ @abstract Query the paint color of an evo object.
+ */
+ BOOL ElmGetColor(ElmVecObj evoHandle,uint32_t *color);
+
+ /*!
+ @abstract Query the vectory path count of an EGO object. If the given object
+ is an evo/ebo, the count is 0.
+ */
+ uint32_t ElmGetVectorCount(ElmHandle handle);
+
+ /*!
+ @abstract Query the type of an object (by handle).
+ */
+ ELM_OBJECT_TYPE ElmGetObjectType(ElmHandle handle);
+
+ /*!
+ @abstract Set the current vectory object index to operate on.
+ */
+ BOOL ElmSetCurrentVector(int32_t id);
+
+ BOOL ElmScalePaint(ElmHandle handle, float sx, float sy);
+ BOOL ElmRotatePaint(ElmHandle handle, float degrees);
+ BOOL ElmTranslatePaint(ElmHandle handle, float tx, float ty);
+
+ /*!
+ @abstract Get handle of the framebuffer.
+ */
+ ElmBuffer ElmGetBuffer(vg_lite_buffer_t *buffer);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ELM_H_ */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c
index 0a45291..36f1414 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_buffer.c
@@ -1,321 +1,321 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#include "elm_precom.h"
-#include "vg_lite.h"
-#if !DDRLESS
-static vg_lite_buffer_format_t _buffer_format_to_vglite(ELM_BUFFER_FORMAT format)
-{
- vg_lite_buffer_format_t fmt;
- switch (format) {
- case ELM_BUFFER_FORMAT_RGBA8888:
- fmt = VG_LITE_RGBA8888;
- break;
-
- case ELM_BUFFER_FORMAT_RGBX8888:
- fmt = VG_LITE_RGBX8888;
- break;
-
- case ELM_BUFFER_FORMAT_BGRA8888:
- fmt = VG_LITE_BGRA8888;
- break;
-
- case ELM_BUFFER_FORMAT_BGRX8888:
- fmt = VG_LITE_BGRX8888;
- break;
-
- case ELM_BUFFER_FORMAT_RGB565:
- fmt = VG_LITE_RGB565;
- break;
-
- case ELM_BUFFER_FORMAT_BGR565:
- fmt = VG_LITE_BGR565;
- break;
-
- case ELM_BUFFER_FORMAT_RGBA4444:
- fmt = VG_LITE_RGBA4444;
- break;
-
- case ELM_BUFFER_FORMAT_BGRA4444:
- fmt = VG_LITE_BGRA4444;
- break;
-
- default:
- fmt = VG_LITE_RGBA8888;
- break;
- }
-
- return fmt;
-}
-#endif
-/*!
- @abstract Create internal render buffer.
-
- @discussion
- This functiois is to create an internal render buffer for Elementary rendering, ussually it's not for direct display.
- The buffer which is displayed on pannel is wrapped up by another API, whose address is managed by display controller side.
-
- @param width
- The buffer's width.
-
- @param height
- The buffer's height.
-
- @param format
- The buffer's format, check enumeration of ELM_BUFFER_FORMAT.
-
- @return
- The buffer handle.
- */
-ElmBuffer ElmCreateBuffer(unsigned int width, unsigned int height, ELM_BUFFER_FORMAT format)
-{
-#if !DDRLESS
- el_Obj_Buffer *buffer_obj;
- vg_lite_buffer_t *buffer;
- vg_lite_error_t error;
- ElmHandle handle = ELM_NULL_HANDLE;
-
- do {
- /* Allocate ebo object. */
- buffer_obj = (el_Obj_Buffer *)calloc(1,sizeof(el_Obj_Buffer));
- if (buffer_obj != NULL) {
- buffer_obj->object.type = ELM_OBJECT_TYPE_BUF;
-
- /* Allocate the buffer. */
- buffer = &buffer_obj->buffer;
- memset(buffer, 0, sizeof(vg_lite_buffer_t));
- buffer->width = width;
- buffer->height = height;
- buffer->format = (vg_lite_buffer_format_t)format;
- error = vg_lite_allocate(buffer);
- if (error)
- goto error_exit;
-
- JUMP_IF_NON_ZERO_VALUE(add_object((el_Object *)buffer_obj), error_exit);
- handle = buffer_obj->object.handle;
- }
- } while(0);
-
- return handle;
-error_exit:
- vg_lite_free(buffer);
- free(buffer_obj);
- return ELM_NULL_HANDLE;
-#else
- return ELM_NULL_HANDLE;
-#endif
-}
-
-/*!
- @abstract Wrap a customized buffer.
-
- @discussion
- The application may wrap a user created buffer by giving the information of
- the buffer including the size, the memory addresses and format. E.g., the
- application can wrap a system framebuffer thus ELM can directly render onto
- the screen.
-
- @return
- The buffer handle.
- */
-ElmBuffer ElmWrapBuffer(int width, int height, int stride,
- void *logical, uint32_t physical,
- ELM_BUFFER_FORMAT format)
-{
-#if !DDRLESS
- el_Obj_Buffer *buffer_obj;
- vg_lite_buffer_t *buffer;
- ElmHandle handle = ELM_NULL_HANDLE;
-
- do {
- /* open framebuffer. */
- buffer_obj = (el_Obj_Buffer *)elm_alloc(1, sizeof(el_Obj_Buffer));
- if (buffer_obj != NULL) {
- buffer_obj->object.type = ELM_OBJECT_TYPE_BUF;
- buffer = &buffer_obj->buffer;
-
- buffer->width = width;
- buffer->height = height;
- buffer->stride = stride;
- buffer->memory = logical;
- buffer->handle = NULL;
- buffer->address = physical;
- buffer->format = _buffer_format_to_vglite(format);
- buffer->tiled = VG_LITE_LINEAR;
- JUMP_IF_NON_ZERO_VALUE(add_object((el_Object *)buffer_obj), error_exit);
- handle = buffer_obj->object.handle;
- }
- } while(0);
-
- return handle;
-
-error_exit:
- free(buffer_obj);
- return ELM_NULL_HANDLE;
-#else
- return ELM_NULL_HANDLE;
-#endif
-
-}
-
-/*!
- @abstract Get buffer address.
-
-@discussion
-The function is to get the address of ElmBuffer.
-
-@return
-The buffer address.
-*/
-
-uint32_t ElmGetBufferAddress(ElmBuffer buffer)
-{
-#if !DDRLESS
- el_Obj_Buffer *buff_obj;
- buff_obj = (el_Obj_Buffer *)get_object(buffer);
-
- if (buff_obj == NULL)
- {
- return 0;
- }
- else
- {
- return buff_obj->buffer.address;
- }
-#else
- return 0;
-#endif
-}
-
-/*!
- @abstract Destroy a render buffer.
-
- @discussion
- This function is to release all internal resource inside Elementary libary belonging to this buffer.
- Applicatoin need make sure the buffer is not being used by elmentary library any more when calling this function.
-
- @param buffer
- The render buffer handle
-
- @return
- If destroying is completed successfully.
- */
-BOOL ElmDestroyBuffer(ElmBuffer buffer)
-{
-#if !DDRLESS
- /* Find the object. */
- el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
-
- /* If found, delete the vg_lite_buffer object. Otherwise, return FALSE. */
- if (buff != NULL) {
- if (buff->buffer.handle != NULL) {
- /* Free the buffer memory. */
- vg_lite_free(&buff->buffer);
- }
-
- remove_object((el_Object*)buff);
- elm_free(buff);
-
- return TRUE;
- }
- else {
- return FALSE;
- }
-#else
- return TRUE;
-#endif
-}
-
-BOOL ElmSaveBuffer(ElmBuffer buffer, const char *name)
-{
-#if !DDRLESS
- el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
-
- /* If found, delete the vg_lite_buffer object. Otherwise, return FALSE. */
- if (buff != NULL) {
-#if !RTOS
- /*
- "vg_lite_save_png" function does not exist (anymore). Probably a left
- over from an older driver.
- */
- if (buff->buffer.memory != NULL) {
- vg_lite_save_png(name, &buff->buffer);
- }
-#endif
- return TRUE;
- }
- else {
- return FALSE;
- }
-#else
- return TRUE;
-#endif
-}
-
- /*!
- @abstract Convert vglite format to elm format.
- */
-ELM_BUFFER_FORMAT _buffer_format_to_Elm(vg_lite_buffer_format_t format)
-{
- switch (format)
- {
- case VG_LITE_RGB565:
- return ELM_BUFFER_FORMAT_RGB565;
- break;
- case VG_LITE_BGR565:
- return ELM_BUFFER_FORMAT_BGR565;
- break;
- default:
- return ELM_BUFFER_FORMAT_RGBA8888;
- break;
- }
-}
-
- /*!
- @abstract Get handle of the framebuffer.
- */
-ElmBuffer ElmGetBuffer(vg_lite_buffer_t *buffer)
-{
- elm_tls_t* elm_tls;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return ELM_NULL_HANDLE;
-
- for (int i = 0; i < APP_BUFFER_COUNT; i++) {
- if (elm_tls->gContext.elmFB[i].buffer == NULL) {
- elm_tls->gContext.elmFB[i].buffer = buffer;
- elm_tls->gContext.elmFB[i].handle = ElmWrapBuffer(buffer->width, buffer->height, buffer->stride, buffer->memory,
- buffer->address, _buffer_format_to_Elm(buffer->format));
- vg_lite_clear(buffer, NULL, 0x0);
- return elm_tls->gContext.elmFB[i].handle;
- }
- if (elm_tls->gContext.elmFB[i].buffer == buffer)
- return elm_tls->gContext.elmFB[i].handle;
- }
- return 0;
+/****************************************************************************
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "elm_precom.h"
+#include "vg_lite.h"
+#if !DDRLESS
+static vg_lite_buffer_format_t _buffer_format_to_vglite(ELM_BUFFER_FORMAT format)
+{
+ vg_lite_buffer_format_t fmt;
+ switch (format) {
+ case ELM_BUFFER_FORMAT_RGBA8888:
+ fmt = VG_LITE_RGBA8888;
+ break;
+
+ case ELM_BUFFER_FORMAT_RGBX8888:
+ fmt = VG_LITE_RGBX8888;
+ break;
+
+ case ELM_BUFFER_FORMAT_BGRA8888:
+ fmt = VG_LITE_BGRA8888;
+ break;
+
+ case ELM_BUFFER_FORMAT_BGRX8888:
+ fmt = VG_LITE_BGRX8888;
+ break;
+
+ case ELM_BUFFER_FORMAT_RGB565:
+ fmt = VG_LITE_RGB565;
+ break;
+
+ case ELM_BUFFER_FORMAT_BGR565:
+ fmt = VG_LITE_BGR565;
+ break;
+
+ case ELM_BUFFER_FORMAT_RGBA4444:
+ fmt = VG_LITE_RGBA4444;
+ break;
+
+ case ELM_BUFFER_FORMAT_BGRA4444:
+ fmt = VG_LITE_BGRA4444;
+ break;
+
+ default:
+ fmt = VG_LITE_RGBA8888;
+ break;
+ }
+
+ return fmt;
+}
+#endif
+/*!
+ @abstract Create internal render buffer.
+
+ @discussion
+ This functiois is to create an internal render buffer for Elementary rendering, ussually it's not for direct display.
+ The buffer which is displayed on pannel is wrapped up by another API, whose address is managed by display controller side.
+
+ @param width
+ The buffer's width.
+
+ @param height
+ The buffer's height.
+
+ @param format
+ The buffer's format, check enumeration of ELM_BUFFER_FORMAT.
+
+ @return
+ The buffer handle.
+ */
+ElmBuffer ElmCreateBuffer(unsigned int width, unsigned int height, ELM_BUFFER_FORMAT format)
+{
+#if !DDRLESS
+ el_Obj_Buffer *buffer_obj;
+ vg_lite_buffer_t *buffer;
+ vg_lite_error_t error;
+ ElmHandle handle = ELM_NULL_HANDLE;
+
+ do {
+ /* Allocate ebo object. */
+ buffer_obj = (el_Obj_Buffer *)calloc(1,sizeof(el_Obj_Buffer));
+ if (buffer_obj != NULL) {
+ buffer_obj->object.type = ELM_OBJECT_TYPE_BUF;
+
+ /* Allocate the buffer. */
+ buffer = &buffer_obj->buffer;
+ memset(buffer, 0, sizeof(vg_lite_buffer_t));
+ buffer->width = width;
+ buffer->height = height;
+ buffer->format = (vg_lite_buffer_format_t)format;
+ error = vg_lite_allocate(buffer);
+ if (error)
+ goto error_exit;
+
+ JUMP_IF_NON_ZERO_VALUE(add_object((el_Object *)buffer_obj), error_exit);
+ handle = buffer_obj->object.handle;
+ }
+ } while(0);
+
+ return handle;
+error_exit:
+ vg_lite_free(buffer);
+ free(buffer_obj);
+ return ELM_NULL_HANDLE;
+#else
+ return ELM_NULL_HANDLE;
+#endif
+}
+
+/*!
+ @abstract Wrap a customized buffer.
+
+ @discussion
+ The application may wrap a user created buffer by giving the information of
+ the buffer including the size, the memory addresses and format. E.g., the
+ application can wrap a system framebuffer thus ELM can directly render onto
+ the screen.
+
+ @return
+ The buffer handle.
+ */
+ElmBuffer ElmWrapBuffer(int width, int height, int stride,
+ void *logical, uint32_t physical,
+ ELM_BUFFER_FORMAT format)
+{
+#if !DDRLESS
+ el_Obj_Buffer *buffer_obj;
+ vg_lite_buffer_t *buffer;
+ ElmHandle handle = ELM_NULL_HANDLE;
+
+ do {
+ /* open framebuffer. */
+ buffer_obj = (el_Obj_Buffer *)elm_alloc(1, sizeof(el_Obj_Buffer));
+ if (buffer_obj != NULL) {
+ buffer_obj->object.type = ELM_OBJECT_TYPE_BUF;
+ buffer = &buffer_obj->buffer;
+
+ buffer->width = width;
+ buffer->height = height;
+ buffer->stride = stride;
+ buffer->memory = logical;
+ buffer->handle = NULL;
+ buffer->address = physical;
+ buffer->format = _buffer_format_to_vglite(format);
+ buffer->tiled = VG_LITE_LINEAR;
+ JUMP_IF_NON_ZERO_VALUE(add_object((el_Object *)buffer_obj), error_exit);
+ handle = buffer_obj->object.handle;
+ }
+ } while(0);
+
+ return handle;
+
+error_exit:
+ free(buffer_obj);
+ return ELM_NULL_HANDLE;
+#else
+ return ELM_NULL_HANDLE;
+#endif
+
+}
+
+/*!
+ @abstract Get buffer address.
+
+@discussion
+The function is to get the address of ElmBuffer.
+
+@return
+The buffer address.
+*/
+
+uint32_t ElmGetBufferAddress(ElmBuffer buffer)
+{
+#if !DDRLESS
+ el_Obj_Buffer *buff_obj;
+ buff_obj = (el_Obj_Buffer *)get_object(buffer);
+
+ if (buff_obj == NULL)
+ {
+ return 0;
+ }
+ else
+ {
+ return buff_obj->buffer.address;
+ }
+#else
+ return 0;
+#endif
+}
+
+/*!
+ @abstract Destroy a render buffer.
+
+ @discussion
+ This function is to release all internal resource inside Elementary libary belonging to this buffer.
+ Applicatoin need make sure the buffer is not being used by elmentary library any more when calling this function.
+
+ @param buffer
+ The render buffer handle
+
+ @return
+ If destroying is completed successfully.
+ */
+BOOL ElmDestroyBuffer(ElmBuffer buffer)
+{
+#if !DDRLESS
+ /* Find the object. */
+ el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
+
+ /* If found, delete the vg_lite_buffer object. Otherwise, return FALSE. */
+ if (buff != NULL) {
+ if (buff->buffer.handle != NULL) {
+ /* Free the buffer memory. */
+ vg_lite_free(&buff->buffer);
+ }
+
+ remove_object((el_Object*)buff);
+ elm_free(buff);
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+#else
+ return TRUE;
+#endif
+}
+
+BOOL ElmSaveBuffer(ElmBuffer buffer, const char *name)
+{
+#if !DDRLESS
+ el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
+
+ /* If found, delete the vg_lite_buffer object. Otherwise, return FALSE. */
+ if (buff != NULL) {
+#if !RTOS
+ /*
+ "vg_lite_save_png" function does not exist (anymore). Probably a left
+ over from an older driver.
+ */
+ if (buff->buffer.memory != NULL) {
+ vg_lite_save_png(name, &buff->buffer);
+ }
+#endif
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+#else
+ return TRUE;
+#endif
+}
+
+ /*!
+ @abstract Convert vglite format to elm format.
+ */
+ELM_BUFFER_FORMAT _buffer_format_to_Elm(vg_lite_buffer_format_t format)
+{
+ switch (format)
+ {
+ case VG_LITE_RGB565:
+ return ELM_BUFFER_FORMAT_RGB565;
+ break;
+ case VG_LITE_BGR565:
+ return ELM_BUFFER_FORMAT_BGR565;
+ break;
+ default:
+ return ELM_BUFFER_FORMAT_RGBA8888;
+ break;
+ }
+}
+
+ /*!
+ @abstract Get handle of the framebuffer.
+ */
+ElmBuffer ElmGetBuffer(vg_lite_buffer_t *buffer)
+{
+ elm_tls_t* elm_tls;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return ELM_NULL_HANDLE;
+
+ for (int i = 0; i < APP_BUFFER_COUNT; i++) {
+ if (elm_tls->gContext.elmFB[i].buffer == NULL) {
+ elm_tls->gContext.elmFB[i].buffer = buffer;
+ elm_tls->gContext.elmFB[i].handle = ElmWrapBuffer(buffer->width, buffer->height, buffer->stride, buffer->memory,
+ buffer->address, _buffer_format_to_Elm(buffer->format));
+ vg_lite_clear(buffer, NULL, 0x0);
+ return elm_tls->gContext.elmFB[i].handle;
+ }
+ if (elm_tls->gContext.elmFB[i].buffer == buffer)
+ return elm_tls->gContext.elmFB[i].handle;
+ }
+ return 0;
}
\ No newline at end of file
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c
index 6e90409..8d66881 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_draw.c
@@ -1,483 +1,483 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#include "elm_precom.h"
-
-#if (VG_RENDER_TEXT==1)
-#include "elm_text.h"
-#endif /* VG_RENDER_TEXT */
-
-static void multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t * mult)
-{
- vg_lite_matrix_t temp;
- int row, column;
-
- /* Process all rows. */
- for (row = 0; row < 3; row++) {
- /* Process all columns. */
- for (column = 0; column < 3; column++) {
- /* Compute matrix entry. */
- temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column])
- + (matrix->m[row][1] * mult->m[1][column])
- + (matrix->m[row][2] * mult->m[2][column]);
- }
- }
-
- memcpy(matrix, &temp, sizeof(temp));
-
-}
-
-static vg_lite_filter_t quality_to_filter(ELM_QUALITY quality)
-{
- switch (quality) {
- case ELM_QULIATY_HI:
- return VG_LITE_FILTER_BI_LINEAR;
- break;
-
- case ELM_QUALITY_MED:
- return VG_LITE_FILTER_LINEAR;
- break;
-
- case ELM_QUALITY_LOW:
- default:
- return VG_LITE_FILTER_POINT;
- break;
- }
-}
-
-static vg_lite_pattern_mode_t pat_to_pad(ELM_PATTERN_MODE mode)
-{
- switch (mode) {
- case ELM_PATTERN_MODE_PAD:
- return VG_LITE_PATTERN_PAD;
- break;
-
- default:
- return VG_LITE_PATTERN_COLOR;
- break;
- }
-}
-static vg_lite_error_t draw_evo_pattern(el_Obj_Buffer *buff, el_Obj_Group *ego,int * index)
-{
- el_Obj_EVO *evo;
- vg_lite_error_t error = VG_LITE_INVALID_ARGUMENT;
- vg_lite_color_t color;
- vg_lite_filter_t filter;
- vg_lite_blend_t blend;
- vg_lite_fill_t rule;
- vg_lite_buffer_t *buffer;
- vg_lite_matrix_t mat;
- vg_lite_pattern_mode_t pat_mode;
- int width = 0;
- int height = 0;
-
- int start = *index;
- int i = start;
- evo = &ego->group.objects[i];
- width = (int)(evo->data.path.bounding_box[2] - evo->data.path.bounding_box[0]);
- height = (int)(evo->data.path.bounding_box[3] - evo->data.path.bounding_box[1]);
- buffer = (vg_lite_buffer_t *)malloc(sizeof(vg_lite_buffer_t));
- memset(buffer,0,sizeof(vg_lite_buffer_t));
- buffer->width = width;
- buffer->height = height;
- buffer->format = VG_LITE_RGBA8888;
- error = vg_lite_allocate(buffer);
- vg_lite_clear(buffer,NULL,0xffffffff);
- i++;
- evo = &ego->group.objects[i];
- while(evo->is_pattern)
- {
- blend = (vg_lite_blend_t)evo->attribute.blend;
- rule = (vg_lite_fill_t)evo->attribute.fill_rule;
- color = (vg_lite_color_t)evo->attribute.paint.color;
- memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
- error = vg_lite_draw(buffer, &evo->data.path,
- rule,
- &mat,
- blend,
- color);
- if(error)
- return error;
- i++;
- evo = &ego->group.objects[i];
- }
- *index = i - 1;
- evo = &ego->group.objects[start];
- blend = (vg_lite_blend_t)evo->attribute.blend;
- rule = (vg_lite_fill_t)evo->attribute.fill_rule;
- color = (vg_lite_color_t)evo->attribute.paint.color;
- memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
- filter = VG_LITE_FILTER_POINT;
- pat_mode = VG_LITE_PATTERN_COLOR;
- error = vg_lite_draw_pattern(&buff->buffer, &evo->data.path,
- rule,
- &mat,
- buffer,
- &mat,
- blend,
- pat_mode,
- color,
- filter);
- vg_lite_finish();
- vg_lite_free(buffer);
- free(buffer);
- return error;
-}
-
-static vg_lite_error_t draw_evo(el_Obj_Buffer *buff, el_Obj_EVO *evo, vg_lite_matrix_t *mat)
-{
- el_Obj_EBO *pattern;
- vg_lite_error_t error = VG_LITE_INVALID_ARGUMENT;
- vg_lite_color_t color;
- vg_lite_filter_t filter;
- vg_lite_matrix_t mat_pattern;
- ELM_PAINT_TYPE paint_type = evo->attribute.paint.type;
- vg_lite_blend_t blend = (vg_lite_blend_t)evo->attribute.blend;
- vg_lite_fill_t rule = (vg_lite_fill_t)evo->attribute.fill_rule;
- vg_lite_pattern_mode_t pat_mode = pat_to_pad(evo->attribute.paint.pattern.mode);
-
- switch (paint_type) {
- case ELM_PAINT_GRADIENT:
- memcpy(&evo->attribute.paint.grad->data.grad.matrix,
- &evo->attribute.paint.grad->data.transform.matrix,
- sizeof(evo->attribute.paint.grad->data.transform.matrix));
-#if !DDRLESS
- error = vg_lite_draw_gradient(&buff->buffer, &evo->data.path,
- rule,
- mat,
- &evo->attribute.paint.grad->data.grad,
- blend);
-#else
- error = vg_lite_draw_gradient(NULL, &evo->data.path,
- rule,
- mat,
- &evo->attribute.paint.grad->data.grad,
- blend);
-#endif
- break;
- case ELM_PAINT_RADIAL_GRADIENT:
- memcpy(&evo->attribute.paint.radgrad->data.rad_grad.matrix,
- &evo->attribute.paint.radgrad->data.transform.matrix,
- sizeof(evo->attribute.paint.radgrad->data.transform.matrix));
-
- error = vg_lite_draw_radial_gradient(&buff->buffer, &evo->data.path,
- rule,
- mat,
- &evo->attribute.paint.radgrad->data.rad_grad,
- 0,
- blend,
- VG_LITE_FILTER_LINEAR);
- break;
- case ELM_PAINT_COLOR:
- color = (vg_lite_color_t)evo->attribute.paint.color;
-
-#if !DDRLESS
- error = vg_lite_draw(&buff->buffer, &evo->data.path,
- rule,
- mat,
- blend,
- color);
-#else
- error = vg_lite_draw(NULL, &evo->data.path,
- rule,
- mat,
- blend,
- color);
-#endif
- break;
- case ELM_PAINT_PATTERN:
- pattern = (el_Obj_EBO *)(evo->attribute.paint.pattern.pattern);
- blend = (vg_lite_blend_t)(pattern->attribute.blend);
- filter = quality_to_filter(evo->attribute.quality);
- color = (vg_lite_color_t)pattern->attribute.paint.color;
- memcpy(&mat_pattern, &pattern->attribute.transform.matrix,
- sizeof(pattern->attribute.transform.matrix));
-
-#if !DDRLESS
- error = vg_lite_draw_pattern(&buff->buffer, &evo->data.path, rule, mat,
- &pattern->data.buffer, &mat_pattern, blend,
- pat_mode, color, filter);
-#else
- error = vg_lite_draw_pattern(NULL, &evo->data.path, rule, mat,
- &pattern->data.buffer, &mat_pattern, blend,
- pat_mode, color, filter);
-#endif
- break;
- case ELM_PAINT_TEXT:
-#if (VG_RENDER_TEXT==1)
- error = draw_text(buff, evo, mat);
-#endif /* VG_RENDER_TEXT */
- break;
- }
-
- return error;
-}
-
-static vg_lite_error_t draw_ebo(el_Obj_Buffer *buff, el_Obj_EBO *ebo, vg_lite_matrix_t *mat)
-{
- vg_lite_error_t error;
- vg_lite_buffer_t *image_buffer = &ebo->data.buffer;
- vg_lite_blend_t blend = (vg_lite_blend_t)ebo->attribute.blend;
- vg_lite_color_t color = ebo->attribute.paint.color;
- vg_lite_filter_t filter = quality_to_filter(ebo->attribute.quality);
-
- if (image_buffer->format >= VG_LITE_INDEX_1 && image_buffer->format <= VG_LITE_INDEX_8)
- {
- vg_lite_set_CLUT(ebo->clut_count, ebo->clut);
- }
-
- image_buffer->image_mode = VG_LITE_NORMAL_IMAGE_MODE;
-#if !DDRLESS
- error = vg_lite_blit(&buff->buffer, image_buffer, mat, blend, color, filter);
-#else
- error = vg_lite_blit(NULL, image_buffer, mat, blend, color, filter);
-#endif
- return error;
-}
-/*!
- @abstract Clear a render buffer with specified color and dimension.
-
- @discussion
- This function is called to clear full or partial of the buffer. If the rectangle is out of buffer space, the intersect portion will be cleared.
-
- @param buffer
- A render buffer handle.
-
- @param color
- Clear color value.
-
- @param x
- x origin of partical clear rectangle.
-
- @param y
- y origin of partial clear rectangle.
-
- @param width
- width of partical clear rectangle.
-
- @param height
- height of partical clear rectangle.
-
- @param full
- Flag to indicate a full buffer clear. If true, the dimension parameters will be ignored.
-
- @return bool
- Indicate the clear operation is set up correctly.
- */
-BOOL ElmClear(ElmBuffer buffer, uint32_t color, uint32_t x, uint32_t y, uint32_t width, uint32_t height, BOOL full)
-{
-#if !DDRLESS
- vg_lite_error_t error = VG_LITE_SUCCESS;
- el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
- vg_lite_rectangle_t rectangle;
- rectangle.x = x;
- rectangle.y = y;
- rectangle.width = width;
- rectangle.height = height;
-
- if (full == 1)
- {
- error = vg_lite_clear(&buff->buffer, NULL, color);
- }
- else
- {
- error = vg_lite_clear(&buff->buffer, &rectangle, color);
- }
- return ((error == VG_LITE_SUCCESS) ? TRUE : FALSE);
-#else
- return TRUE;
-#endif
-}
-
-/*!
- @abstract Finish all rendering on GPU issued before this call.
-
- @discussion
- This function tells the engine that it has finished the frame data and GPU can draw it now. It's blocked until GPU rendering done.
-
- @return
- If the opeartion is successfully done or not.
- */
-BOOL ElmFinish()
-{
- vg_lite_finish();
- return TRUE;
-}
-
-/*!
- @abstract Flush all rendering command to GPU issued before this call.
-
- @discussion
- This function tells the engine to start kicking off command to GPU side, it will return immediately after firing off GPU.
-
- @return
- If the opeartion is successfully done or not.
- */
-BOOL ElmFlush()
-{
- vg_lite_flush();
- return TRUE;
-}
-
-
-
-/*!
- @abstract Draw a graphics object onto current render target
-
- @discussion
- This is an enssentail function to do the real job, it takes all current setting of the elementary object and
- render into theb buffer target.
-
- @param buffer
- The render target that an elmentary object will be rendered into.
-
- @param obj
- The elmentary object will be draw into render target.
-
- @return bool
- The draw operation for this elmentary object is sucessful.
- */
-BOOL ElmDraw(ElmBuffer buffer, ElmHandle object)
-{
- BOOL status = TRUE;
- el_Object *elm;
- el_Obj_Buffer *buff;
- vg_lite_error_t error;
- vg_lite_matrix_t mat;
- elm = get_object(object);
-
- if (!elm)
- {
- return FALSE;
- }
-
-#if !DDRLESS
- buff = (el_Obj_Buffer *)get_object(buffer);
- if (buff == NULL)
- {
- return FALSE;
- }
-#else
- buff = NULL;
-#endif
-
- if (elm->type == ELM_OBJECT_TYPE_EGO)
- {
- el_Obj_EVO *evo;
- el_Obj_Group *ego = (el_Obj_Group *)elm;
- vg_lite_matrix_t mat_group, res_mat;
-
- if (ego->group.count > 0)
- {
- int i;
- memcpy(&mat_group, &(ego->transform.matrix), sizeof(ego->transform.matrix));
- for (i = 0; i < ego->group.count; i++)
- {
- evo = &ego->group.objects[i];
-
- /* Font objects may generate empty objects */
- if (evo->object.handle == ELM_NULL_HANDLE)
- continue;
-
- if(evo->is_image)
- {
- ElmHandle ebo_handle;
- el_Object *elm_ebo;
- el_Obj_EBO *ebo;
- ebo_handle = ElmCreateObjectFromFile(ELM_OBJECT_TYPE_EBO, evo->eboname);
- elm_ebo = get_object(ebo_handle);
- ebo = (el_Obj_EBO *)elm_ebo;
- memcpy(&mat, &evo->defaultAttrib.transform.matrix, sizeof(mat));
-
- error = draw_ebo(buff, ebo, &mat);
- if (error)
- {
- status = FALSE;
- }
- continue;
- }
- memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
- memcpy(&res_mat, &mat_group, sizeof(mat_group));
- multiply(&res_mat, &mat);
-
- if(evo->has_pattern)
- error = draw_evo_pattern(buff,ego,&i);
- else
- error = draw_evo(buff, evo, &res_mat);
- if (error)
- {
- status = FALSE;
- break;
- }
- }
- }
- }
- else if (elm->type == ELM_OBJECT_TYPE_EVO)
- {
- el_Obj_EVO *evo = (el_Obj_EVO *)elm;
- memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
-
- error = draw_evo(buff, evo, &mat);
- if (error)
- {
- status = FALSE;
- }
- }
- else if (elm->type == ELM_OBJECT_TYPE_EBO)
- {
- el_Obj_EBO *ebo = (el_Obj_EBO *)elm;
- memcpy(&mat, &(ebo->attribute.transform.matrix), sizeof(mat));
-
- error = draw_ebo(buff, ebo, &mat);
- if (error)
- {
- status = FALSE;
- }
-
- }
- else if (elm->type == ELM_OBJECT_TYPE_BUF)
- {
- el_Obj_Buffer *src = (el_Obj_Buffer *)elm;
- vg_lite_identity(&mat);
-
-#if !DDRLESS
- if (VG_LITE_SUCCESS !=
- vg_lite_blit(&buff->buffer, &src->buffer, &mat, VG_LITE_BLEND_NONE, 0,
- VG_LITE_FILTER_BI_LINEAR)
- )
-#else
- if (VG_LITE_SUCCESS !=
- vg_lite_blit(NULL, &src->buffer, &mat, VG_LITE_BLEND_NONE, 0,
- VG_LITE_FILTER_BI_LINEAR)
- )
-#endif
- {
- status = FALSE;
- }
- }
- return status;
-}
+/****************************************************************************
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "elm_precom.h"
+
+#if (VG_RENDER_TEXT==1)
+#include "elm_text.h"
+#endif /* VG_RENDER_TEXT */
+
+static void multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t * mult)
+{
+ vg_lite_matrix_t temp;
+ int row, column;
+
+ /* Process all rows. */
+ for (row = 0; row < 3; row++) {
+ /* Process all columns. */
+ for (column = 0; column < 3; column++) {
+ /* Compute matrix entry. */
+ temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column])
+ + (matrix->m[row][1] * mult->m[1][column])
+ + (matrix->m[row][2] * mult->m[2][column]);
+ }
+ }
+
+ memcpy(matrix, &temp, sizeof(temp));
+
+}
+
+static vg_lite_filter_t quality_to_filter(ELM_QUALITY quality)
+{
+ switch (quality) {
+ case ELM_QULIATY_HI:
+ return VG_LITE_FILTER_BI_LINEAR;
+ break;
+
+ case ELM_QUALITY_MED:
+ return VG_LITE_FILTER_LINEAR;
+ break;
+
+ case ELM_QUALITY_LOW:
+ default:
+ return VG_LITE_FILTER_POINT;
+ break;
+ }
+}
+
+static vg_lite_pattern_mode_t pat_to_pad(ELM_PATTERN_MODE mode)
+{
+ switch (mode) {
+ case ELM_PATTERN_MODE_PAD:
+ return VG_LITE_PATTERN_PAD;
+ break;
+
+ default:
+ return VG_LITE_PATTERN_COLOR;
+ break;
+ }
+}
+static vg_lite_error_t draw_evo_pattern(el_Obj_Buffer *buff, el_Obj_Group *ego,int * index)
+{
+ el_Obj_EVO *evo;
+ vg_lite_error_t error = VG_LITE_INVALID_ARGUMENT;
+ vg_lite_color_t color;
+ vg_lite_filter_t filter;
+ vg_lite_blend_t blend;
+ vg_lite_fill_t rule;
+ vg_lite_buffer_t *buffer;
+ vg_lite_matrix_t mat;
+ vg_lite_pattern_mode_t pat_mode;
+ int width = 0;
+ int height = 0;
+
+ int start = *index;
+ int i = start;
+ evo = &ego->group.objects[i];
+ width = (int)(evo->data.path.bounding_box[2] - evo->data.path.bounding_box[0]);
+ height = (int)(evo->data.path.bounding_box[3] - evo->data.path.bounding_box[1]);
+ buffer = (vg_lite_buffer_t *)malloc(sizeof(vg_lite_buffer_t));
+ memset(buffer,0,sizeof(vg_lite_buffer_t));
+ buffer->width = width;
+ buffer->height = height;
+ buffer->format = VG_LITE_RGBA8888;
+ error = vg_lite_allocate(buffer);
+ vg_lite_clear(buffer,NULL,0xffffffff);
+ i++;
+ evo = &ego->group.objects[i];
+ while(evo->is_pattern)
+ {
+ blend = (vg_lite_blend_t)evo->attribute.blend;
+ rule = (vg_lite_fill_t)evo->attribute.fill_rule;
+ color = (vg_lite_color_t)evo->attribute.paint.color;
+ memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
+ error = vg_lite_draw(buffer, &evo->data.path,
+ rule,
+ &mat,
+ blend,
+ color);
+ if(error)
+ return error;
+ i++;
+ evo = &ego->group.objects[i];
+ }
+ *index = i - 1;
+ evo = &ego->group.objects[start];
+ blend = (vg_lite_blend_t)evo->attribute.blend;
+ rule = (vg_lite_fill_t)evo->attribute.fill_rule;
+ color = (vg_lite_color_t)evo->attribute.paint.color;
+ memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
+ filter = VG_LITE_FILTER_POINT;
+ pat_mode = VG_LITE_PATTERN_COLOR;
+ error = vg_lite_draw_pattern(&buff->buffer, &evo->data.path,
+ rule,
+ &mat,
+ buffer,
+ &mat,
+ blend,
+ pat_mode,
+ color,
+ filter);
+ vg_lite_finish();
+ vg_lite_free(buffer);
+ free(buffer);
+ return error;
+}
+
+static vg_lite_error_t draw_evo(el_Obj_Buffer *buff, el_Obj_EVO *evo, vg_lite_matrix_t *mat)
+{
+ el_Obj_EBO *pattern;
+ vg_lite_error_t error = VG_LITE_INVALID_ARGUMENT;
+ vg_lite_color_t color;
+ vg_lite_filter_t filter;
+ vg_lite_matrix_t mat_pattern;
+ ELM_PAINT_TYPE paint_type = evo->attribute.paint.type;
+ vg_lite_blend_t blend = (vg_lite_blend_t)evo->attribute.blend;
+ vg_lite_fill_t rule = (vg_lite_fill_t)evo->attribute.fill_rule;
+ vg_lite_pattern_mode_t pat_mode = pat_to_pad(evo->attribute.paint.pattern.mode);
+
+ switch (paint_type) {
+ case ELM_PAINT_GRADIENT:
+ memcpy(&evo->attribute.paint.grad->data.grad.matrix,
+ &evo->attribute.paint.grad->data.transform.matrix,
+ sizeof(evo->attribute.paint.grad->data.transform.matrix));
+#if !DDRLESS
+ error = vg_lite_draw_gradient(&buff->buffer, &evo->data.path,
+ rule,
+ mat,
+ &evo->attribute.paint.grad->data.grad,
+ blend);
+#else
+ error = vg_lite_draw_gradient(NULL, &evo->data.path,
+ rule,
+ mat,
+ &evo->attribute.paint.grad->data.grad,
+ blend);
+#endif
+ break;
+ case ELM_PAINT_RADIAL_GRADIENT:
+ memcpy(&evo->attribute.paint.radgrad->data.rad_grad.matrix,
+ &evo->attribute.paint.radgrad->data.transform.matrix,
+ sizeof(evo->attribute.paint.radgrad->data.transform.matrix));
+
+ error = vg_lite_draw_radial_gradient(&buff->buffer, &evo->data.path,
+ rule,
+ mat,
+ &evo->attribute.paint.radgrad->data.rad_grad,
+ 0,
+ blend,
+ VG_LITE_FILTER_LINEAR);
+ break;
+ case ELM_PAINT_COLOR:
+ color = (vg_lite_color_t)evo->attribute.paint.color;
+
+#if !DDRLESS
+ error = vg_lite_draw(&buff->buffer, &evo->data.path,
+ rule,
+ mat,
+ blend,
+ color);
+#else
+ error = vg_lite_draw(NULL, &evo->data.path,
+ rule,
+ mat,
+ blend,
+ color);
+#endif
+ break;
+ case ELM_PAINT_PATTERN:
+ pattern = (el_Obj_EBO *)(evo->attribute.paint.pattern.pattern);
+ blend = (vg_lite_blend_t)(pattern->attribute.blend);
+ filter = quality_to_filter(evo->attribute.quality);
+ color = (vg_lite_color_t)pattern->attribute.paint.color;
+ memcpy(&mat_pattern, &pattern->attribute.transform.matrix,
+ sizeof(pattern->attribute.transform.matrix));
+
+#if !DDRLESS
+ error = vg_lite_draw_pattern(&buff->buffer, &evo->data.path, rule, mat,
+ &pattern->data.buffer, &mat_pattern, blend,
+ pat_mode, color, filter);
+#else
+ error = vg_lite_draw_pattern(NULL, &evo->data.path, rule, mat,
+ &pattern->data.buffer, &mat_pattern, blend,
+ pat_mode, color, filter);
+#endif
+ break;
+ case ELM_PAINT_TEXT:
+#if (VG_RENDER_TEXT==1)
+ error = draw_text(buff, evo, mat);
+#endif /* VG_RENDER_TEXT */
+ break;
+ }
+
+ return error;
+}
+
+static vg_lite_error_t draw_ebo(el_Obj_Buffer *buff, el_Obj_EBO *ebo, vg_lite_matrix_t *mat)
+{
+ vg_lite_error_t error;
+ vg_lite_buffer_t *image_buffer = &ebo->data.buffer;
+ vg_lite_blend_t blend = (vg_lite_blend_t)ebo->attribute.blend;
+ vg_lite_color_t color = ebo->attribute.paint.color;
+ vg_lite_filter_t filter = quality_to_filter(ebo->attribute.quality);
+
+ if (image_buffer->format >= VG_LITE_INDEX_1 && image_buffer->format <= VG_LITE_INDEX_8)
+ {
+ vg_lite_set_CLUT(ebo->clut_count, ebo->clut);
+ }
+
+ image_buffer->image_mode = VG_LITE_NORMAL_IMAGE_MODE;
+#if !DDRLESS
+ error = vg_lite_blit(&buff->buffer, image_buffer, mat, blend, color, filter);
+#else
+ error = vg_lite_blit(NULL, image_buffer, mat, blend, color, filter);
+#endif
+ return error;
+}
+/*!
+ @abstract Clear a render buffer with specified color and dimension.
+
+ @discussion
+ This function is called to clear full or partial of the buffer. If the rectangle is out of buffer space, the intersect portion will be cleared.
+
+ @param buffer
+ A render buffer handle.
+
+ @param color
+ Clear color value.
+
+ @param x
+ x origin of partical clear rectangle.
+
+ @param y
+ y origin of partial clear rectangle.
+
+ @param width
+ width of partical clear rectangle.
+
+ @param height
+ height of partical clear rectangle.
+
+ @param full
+ Flag to indicate a full buffer clear. If true, the dimension parameters will be ignored.
+
+ @return bool
+ Indicate the clear operation is set up correctly.
+ */
+BOOL ElmClear(ElmBuffer buffer, uint32_t color, uint32_t x, uint32_t y, uint32_t width, uint32_t height, BOOL full)
+{
+#if !DDRLESS
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+ el_Obj_Buffer *buff = (el_Obj_Buffer *)get_object(buffer);
+ vg_lite_rectangle_t rectangle;
+ rectangle.x = x;
+ rectangle.y = y;
+ rectangle.width = width;
+ rectangle.height = height;
+
+ if (full == 1)
+ {
+ error = vg_lite_clear(&buff->buffer, NULL, color);
+ }
+ else
+ {
+ error = vg_lite_clear(&buff->buffer, &rectangle, color);
+ }
+ return ((error == VG_LITE_SUCCESS) ? TRUE : FALSE);
+#else
+ return TRUE;
+#endif
+}
+
+/*!
+ @abstract Finish all rendering on GPU issued before this call.
+
+ @discussion
+ This function tells the engine that it has finished the frame data and GPU can draw it now. It's blocked until GPU rendering done.
+
+ @return
+ If the opeartion is successfully done or not.
+ */
+BOOL ElmFinish()
+{
+ vg_lite_finish();
+ return TRUE;
+}
+
+/*!
+ @abstract Flush all rendering command to GPU issued before this call.
+
+ @discussion
+ This function tells the engine to start kicking off command to GPU side, it will return immediately after firing off GPU.
+
+ @return
+ If the opeartion is successfully done or not.
+ */
+BOOL ElmFlush()
+{
+ vg_lite_flush();
+ return TRUE;
+}
+
+
+
+/*!
+ @abstract Draw a graphics object onto current render target
+
+ @discussion
+ This is an enssentail function to do the real job, it takes all current setting of the elementary object and
+ render into theb buffer target.
+
+ @param buffer
+ The render target that an elmentary object will be rendered into.
+
+ @param obj
+ The elmentary object will be draw into render target.
+
+ @return bool
+ The draw operation for this elmentary object is sucessful.
+ */
+BOOL ElmDraw(ElmBuffer buffer, ElmHandle object)
+{
+ BOOL status = TRUE;
+ el_Object *elm;
+ el_Obj_Buffer *buff;
+ vg_lite_error_t error;
+ vg_lite_matrix_t mat;
+ elm = get_object(object);
+
+ if (!elm)
+ {
+ return FALSE;
+ }
+
+#if !DDRLESS
+ buff = (el_Obj_Buffer *)get_object(buffer);
+ if (buff == NULL)
+ {
+ return FALSE;
+ }
+#else
+ buff = NULL;
+#endif
+
+ if (elm->type == ELM_OBJECT_TYPE_EGO)
+ {
+ el_Obj_EVO *evo;
+ el_Obj_Group *ego = (el_Obj_Group *)elm;
+ vg_lite_matrix_t mat_group, res_mat;
+
+ if (ego->group.count > 0)
+ {
+ int i;
+ memcpy(&mat_group, &(ego->transform.matrix), sizeof(ego->transform.matrix));
+ for (i = 0; i < ego->group.count; i++)
+ {
+ evo = &ego->group.objects[i];
+
+ /* Font objects may generate empty objects */
+ if (evo->object.handle == ELM_NULL_HANDLE)
+ continue;
+
+ if(evo->is_image)
+ {
+ ElmHandle ebo_handle;
+ el_Object *elm_ebo;
+ el_Obj_EBO *ebo;
+ ebo_handle = ElmCreateObjectFromFile(ELM_OBJECT_TYPE_EBO, evo->eboname);
+ elm_ebo = get_object(ebo_handle);
+ ebo = (el_Obj_EBO *)elm_ebo;
+ memcpy(&mat, &evo->defaultAttrib.transform.matrix, sizeof(mat));
+
+ error = draw_ebo(buff, ebo, &mat);
+ if (error)
+ {
+ status = FALSE;
+ }
+ continue;
+ }
+ memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
+ memcpy(&res_mat, &mat_group, sizeof(mat_group));
+ multiply(&res_mat, &mat);
+
+ if(evo->has_pattern)
+ error = draw_evo_pattern(buff,ego,&i);
+ else
+ error = draw_evo(buff, evo, &res_mat);
+ if (error)
+ {
+ status = FALSE;
+ break;
+ }
+ }
+ }
+ }
+ else if (elm->type == ELM_OBJECT_TYPE_EVO)
+ {
+ el_Obj_EVO *evo = (el_Obj_EVO *)elm;
+ memcpy(&mat, &(evo->attribute.transform.matrix), sizeof(mat));
+
+ error = draw_evo(buff, evo, &mat);
+ if (error)
+ {
+ status = FALSE;
+ }
+ }
+ else if (elm->type == ELM_OBJECT_TYPE_EBO)
+ {
+ el_Obj_EBO *ebo = (el_Obj_EBO *)elm;
+ memcpy(&mat, &(ebo->attribute.transform.matrix), sizeof(mat));
+
+ error = draw_ebo(buff, ebo, &mat);
+ if (error)
+ {
+ status = FALSE;
+ }
+
+ }
+ else if (elm->type == ELM_OBJECT_TYPE_BUF)
+ {
+ el_Obj_Buffer *src = (el_Obj_Buffer *)elm;
+ vg_lite_identity(&mat);
+
+#if !DDRLESS
+ if (VG_LITE_SUCCESS !=
+ vg_lite_blit(&buff->buffer, &src->buffer, &mat, VG_LITE_BLEND_NONE, 0,
+ VG_LITE_FILTER_BI_LINEAR)
+ )
+#else
+ if (VG_LITE_SUCCESS !=
+ vg_lite_blit(NULL, &src->buffer, &mat, VG_LITE_BLEND_NONE, 0,
+ VG_LITE_FILTER_BI_LINEAR)
+ )
+#endif
+ {
+ status = FALSE;
+ }
+ }
+ return status;
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h
index 70937c8..dff48eb 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_headers.h
@@ -1,158 +1,158 @@
-/****************************************************************************
-*
-* Copyright 2021 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#ifndef __ELM_HEADERS_H__
-#define __ELM_HEADERS_H__
-
-
-#define ATTR_PACKED __attribute__((packed, aligned(4)))
-
-
-typedef struct {
- vg_lite_matrix_t matrix;
- uint32_t reserved;
- uint32_t stop_count;
- uint32_t stop_offset;
- uint32_t color_offset;
-} el_EVO_GradData;
-
-typedef struct {
- vg_lite_radial_gradient_parameter_t params;
- vg_lite_radial_gradient_spreadmode_t spread_mode;
-} el_EVO_RadGradDataExt;
-
-struct el_PaintType_t {
- uint32_t paint:28;
- uint32_t flags:1;
- uint32_t is_image:1;
- uint32_t is_pattern:1;
- uint32_t has_pattern:1;
-};
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- vg_lite_float_t min_x, min_y, max_x, max_y;
- uint32_t format;
- uint32_t length:31;
- uint32_t arc_flag:1;
- uint32_t offset;
- vg_lite_matrix_t matrix;
- uint32_t reserved;
- uint32_t quality;
- uint32_t fill_rule;
- uint32_t blend;
- union {
- uint32_t paint_data;
- struct el_PaintType_t paint_type;
- };
- vg_lite_color_t color;
- el_EVO_GradData grad;
-} el_EVO_Polygon;
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- uint32_t namelength;
- char eboname[76];
- union {
- uint32_t paint_data;
- struct el_PaintType_t paint_type;
- };
- vg_lite_matrix_t matrix;
- uint32_t width;
- uint32_t height;
-} el_EVO_Image;
-
-typedef struct ATTR_PACKED {
- union {
- el_EVO_Polygon polygon;
- el_EVO_Image image;
- };
-} el_EVO_Header;
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- uint32_t size_font_block;
- uint32_t num_ttf_fonts;
- uint32_t num_vector_fonts;
- uint32_t num_text_fonts;
- uint32_t ttf_fonts_block_offset;
- uint32_t ttf_fonts_block_length;
- uint32_t vector_fonts_block_offset;
- uint32_t vector_fonts_block_length;
- uint32_t text_fonts_block_offset;
- uint32_t text_fonts_block_length;
- uint32_t property_block_offset;
- uint32_t property_block_length;
-} el_Font_Header;
-
-struct el_TextFlags_t {
- uint32_t flags1:1;
- uint32_t text_anchor:2;
- uint32_t flags2:29;
-};
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- uint32_t size_text_block;
- uint32_t tspan_has_dx_dy;
- float x_pos;
- float y_pos;
- float font_size;
- uint32_t font_id;
- uint32_t color;
- union {
- uint32_t flags_data;
- struct el_TextFlags_t text_flags;
- };
- vg_lite_matrix_t matrix;
- uint32_t reserved;
- uint16_t data_length;
-} el_Text_Header;
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- uint32_t width;
- uint32_t height;
- uint32_t stride;
- uint32_t tiled;
- uint32_t format;
- uint32_t data_offset;
-} el_EBO_Header;
-
-typedef struct ATTR_PACKED {
- uint32_t clut_count;
- uint32_t clut_data_offset;
-} el_EBO_Palette;
-
-typedef struct ATTR_PACKED {
- uint32_t type;
- vg_lite_matrix_t matrix;
- uint32_t count;
-} el_EGO_Header;
-
-
-#endif /* __ELM_HEADERS_H__ */
+/****************************************************************************
+*
+* Copyright 2021 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#ifndef __ELM_HEADERS_H__
+#define __ELM_HEADERS_H__
+
+
+#define ATTR_PACKED __attribute__((packed, aligned(4)))
+
+
+typedef struct {
+ vg_lite_matrix_t matrix;
+ uint32_t reserved;
+ uint32_t stop_count;
+ uint32_t stop_offset;
+ uint32_t color_offset;
+} el_EVO_GradData;
+
+typedef struct {
+ vg_lite_radial_gradient_parameter_t params;
+ vg_lite_radial_gradient_spreadmode_t spread_mode;
+} el_EVO_RadGradDataExt;
+
+struct el_PaintType_t {
+ uint32_t paint:28;
+ uint32_t flags:1;
+ uint32_t is_image:1;
+ uint32_t is_pattern:1;
+ uint32_t has_pattern:1;
+};
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ vg_lite_float_t min_x, min_y, max_x, max_y;
+ uint32_t format;
+ uint32_t length:31;
+ uint32_t arc_flag:1;
+ uint32_t offset;
+ vg_lite_matrix_t matrix;
+ uint32_t reserved;
+ uint32_t quality;
+ uint32_t fill_rule;
+ uint32_t blend;
+ union {
+ uint32_t paint_data;
+ struct el_PaintType_t paint_type;
+ };
+ vg_lite_color_t color;
+ el_EVO_GradData grad;
+} el_EVO_Polygon;
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ uint32_t namelength;
+ char eboname[76];
+ union {
+ uint32_t paint_data;
+ struct el_PaintType_t paint_type;
+ };
+ vg_lite_matrix_t matrix;
+ uint32_t width;
+ uint32_t height;
+} el_EVO_Image;
+
+typedef struct ATTR_PACKED {
+ union {
+ el_EVO_Polygon polygon;
+ el_EVO_Image image;
+ };
+} el_EVO_Header;
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ uint32_t size_font_block;
+ uint32_t num_ttf_fonts;
+ uint32_t num_vector_fonts;
+ uint32_t num_text_fonts;
+ uint32_t ttf_fonts_block_offset;
+ uint32_t ttf_fonts_block_length;
+ uint32_t vector_fonts_block_offset;
+ uint32_t vector_fonts_block_length;
+ uint32_t text_fonts_block_offset;
+ uint32_t text_fonts_block_length;
+ uint32_t property_block_offset;
+ uint32_t property_block_length;
+} el_Font_Header;
+
+struct el_TextFlags_t {
+ uint32_t flags1:1;
+ uint32_t text_anchor:2;
+ uint32_t flags2:29;
+};
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ uint32_t size_text_block;
+ uint32_t tspan_has_dx_dy;
+ float x_pos;
+ float y_pos;
+ float font_size;
+ uint32_t font_id;
+ uint32_t color;
+ union {
+ uint32_t flags_data;
+ struct el_TextFlags_t text_flags;
+ };
+ vg_lite_matrix_t matrix;
+ uint32_t reserved;
+ uint16_t data_length;
+} el_Text_Header;
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ uint32_t tiled;
+ uint32_t format;
+ uint32_t data_offset;
+} el_EBO_Header;
+
+typedef struct ATTR_PACKED {
+ uint32_t clut_count;
+ uint32_t clut_data_offset;
+} el_EBO_Palette;
+
+typedef struct ATTR_PACKED {
+ uint32_t type;
+ vg_lite_matrix_t matrix;
+ uint32_t count;
+} el_EGO_Header;
+
+
+#endif /* __ELM_HEADERS_H__ */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c
index 3c5f168..2318e9b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_init.c
@@ -1,160 +1,160 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#include "elm_precom.h"
-#include "elm_os.h"
-#include "vg_lite_os.h"
-#if (VG_RENDER_TEXT==1)
-#include "elm_text.h"
-#endif /* VG_RENDER_TEXT */
-
-/* Prototypes */
-static int _initialize_elm(uint32_t width, uint32_t height);
-
-/* Initialize vg_lite related. */
-static int _initialize_vglite(int32_t width, int32_t height)
-{
- vg_lite_error_t error = VG_LITE_SUCCESS;
-
- error = vg_lite_init(width, height);
-
- return (error == VG_LITE_SUCCESS);
-}
-
-/* Initialize elm global objects. */
-static int _initialize_elm(uint32_t width, uint32_t height)
-{
- vg_lite_error_t error;
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *)elm_os_get_tls();
- if (elm_tls == NULL) {
- elm_tls = (elm_tls_t *)vg_lite_os_malloc(sizeof(elm_tls_t));
- error = elm_os_set_tls((void *) elm_tls);
- if(error != VG_LITE_SUCCESS)
- return error;
- }
-
- int i;
-
- elm_tls->gContext.version = VERSION;
- elm_tls->gContext.currentHandle = (ELM_NULL_HANDLE + 1); /* Reserve handle 0 for error */
- elm_tls->gContext.objectCount = 0;
- elm_tls->gContext.tessellation_width = width;
- elm_tls->gContext.tessellation_height = height;
- elm_tls->gContext.vector_id = -1;
-
- for (i = 0; i < SLOT_COUNT; i++) {
- elm_tls->gContext.object_slots[i] = NULL;
- }
-
-#if (RTOS && DDRLESS) || BAREMETAL
- for (i = 0; i < sizeof(elm_tls->gContext.objmap_ebo) / 4; i++) {
- elm_tls->gContext.objmap_ebo[i] = 0;
- }
- for (i = 0; i < sizeof(elm_tls->gContext.objmap_evo) / 4; i++) {
- elm_tls->gContext.objmap_evo[i] = 0;
- }
- for (i = 0; i < sizeof(elm_tls->gContext.objmap_group) / 4; i++) {
- elm_tls->gContext.objmap_group[i] = 0;
- }
- for (i = 0; i < sizeof(elm_tls->gContext.objmap_grad) / 4; i++) {
- elm_tls->gContext.objmap_grad[i] = 0;
- }
-
- elm_tls->gContext.objcounter_grad = 0;
- elm_tls->gContext.objcounter_evo = 0;
- elm_tls->gContext.objcounter_ebo = 0;
- elm_tls->gContext.objcounter_group = 0;
-#endif
- return 1;
-}
-
-/* Terminate vg_lite related. */
-static void _terminate_vglite(void)
-{
- vg_lite_close();
-}
-
-/* Terminate elm global objects. */
-static void _terminate_elm(void)
-{
-#if (VG_RENDER_TEXT==1)
- _release_default_text_parameters();
-#endif
- elm_os_reset_tls();
-}
-
-/*!
- @abstract Initialize Elementary context.
-
- @discussion
- It should be called as the first function of Elemenatary libary, which initializes the library. Currently
- Elementary library doesn't support context concept, neigher multi-threading. Elementary library defines
- origin of coordinate system is at top-left.
-
- @param none
-
- @return none
- */
-BOOL ElmInitialize(uint32_t width, uint32_t height)
-{
- BOOL result = TRUE;
-
- do {
- result = _initialize_vglite((int32_t)width, (int32_t)height);
-
- if (!result)
- break;
-
- result = _initialize_elm(width, height);
-
- if (!result)
- break;
- }
- while (0);
-
-#if (VG_RENDER_TEXT==1)
- initialize_elm_text();
-#endif /* VG_RENDER_TEXT */
- return result;
-}
-
-/*!
- @abstract Terminate Elementary context.
-
- @discussion
- This should be called when an app exits. It frees all the resource.
-
- @param none
-
- @return none
- */
-void ElmTerminate(void)
-{
- _terminate_elm();
- _terminate_vglite();
-}
+/****************************************************************************
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "elm_precom.h"
+#include "elm_os.h"
+#include "vg_lite_os.h"
+#if (VG_RENDER_TEXT==1)
+#include "elm_text.h"
+#endif /* VG_RENDER_TEXT */
+
+/* Prototypes */
+static int _initialize_elm(uint32_t width, uint32_t height);
+
+/* Initialize vg_lite related. */
+static int _initialize_vglite(int32_t width, int32_t height)
+{
+ vg_lite_error_t error = VG_LITE_SUCCESS;
+
+ error = vg_lite_init(width, height);
+
+ return (error == VG_LITE_SUCCESS);
+}
+
+/* Initialize elm global objects. */
+static int _initialize_elm(uint32_t width, uint32_t height)
+{
+ vg_lite_error_t error;
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *)elm_os_get_tls();
+ if (elm_tls == NULL) {
+ elm_tls = (elm_tls_t *)vg_lite_os_malloc(sizeof(elm_tls_t));
+ error = elm_os_set_tls((void *) elm_tls);
+ if(error != VG_LITE_SUCCESS)
+ return error;
+ }
+
+ int i;
+
+ elm_tls->gContext.version = VERSION;
+ elm_tls->gContext.currentHandle = (ELM_NULL_HANDLE + 1); /* Reserve handle 0 for error */
+ elm_tls->gContext.objectCount = 0;
+ elm_tls->gContext.tessellation_width = width;
+ elm_tls->gContext.tessellation_height = height;
+ elm_tls->gContext.vector_id = -1;
+
+ for (i = 0; i < SLOT_COUNT; i++) {
+ elm_tls->gContext.object_slots[i] = NULL;
+ }
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ for (i = 0; i < sizeof(elm_tls->gContext.objmap_ebo) / 4; i++) {
+ elm_tls->gContext.objmap_ebo[i] = 0;
+ }
+ for (i = 0; i < sizeof(elm_tls->gContext.objmap_evo) / 4; i++) {
+ elm_tls->gContext.objmap_evo[i] = 0;
+ }
+ for (i = 0; i < sizeof(elm_tls->gContext.objmap_group) / 4; i++) {
+ elm_tls->gContext.objmap_group[i] = 0;
+ }
+ for (i = 0; i < sizeof(elm_tls->gContext.objmap_grad) / 4; i++) {
+ elm_tls->gContext.objmap_grad[i] = 0;
+ }
+
+ elm_tls->gContext.objcounter_grad = 0;
+ elm_tls->gContext.objcounter_evo = 0;
+ elm_tls->gContext.objcounter_ebo = 0;
+ elm_tls->gContext.objcounter_group = 0;
+#endif
+ return 1;
+}
+
+/* Terminate vg_lite related. */
+static void _terminate_vglite(void)
+{
+ vg_lite_close();
+}
+
+/* Terminate elm global objects. */
+static void _terminate_elm(void)
+{
+#if (VG_RENDER_TEXT==1)
+ _release_default_text_parameters();
+#endif
+ elm_os_reset_tls();
+}
+
+/*!
+ @abstract Initialize Elementary context.
+
+ @discussion
+ It should be called as the first function of Elemenatary libary, which initializes the library. Currently
+ Elementary library doesn't support context concept, neigher multi-threading. Elementary library defines
+ origin of coordinate system is at top-left.
+
+ @param none
+
+ @return none
+ */
+BOOL ElmInitialize(uint32_t width, uint32_t height)
+{
+ BOOL result = TRUE;
+
+ do {
+ result = _initialize_vglite((int32_t)width, (int32_t)height);
+
+ if (!result)
+ break;
+
+ result = _initialize_elm(width, height);
+
+ if (!result)
+ break;
+ }
+ while (0);
+
+#if (VG_RENDER_TEXT==1)
+ initialize_elm_text();
+#endif /* VG_RENDER_TEXT */
+ return result;
+}
+
+/*!
+ @abstract Terminate Elementary context.
+
+ @discussion
+ This should be called when an app exits. It frees all the resource.
+
+ @param none
+
+ @return none
+ */
+void ElmTerminate(void)
+{
+ _terminate_elm();
+ _terminate_vglite();
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c
index 742bc14..55c1852 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_object.c
@@ -1,2238 +1,2238 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#include "elm_precom.h"
-#include "elm_os.h"
-#include "vg_lite_text.h"
-#include "vft_debug.h"
-#include "elm_headers.h"
-
-#if (VG_RENDER_TEXT==1)
-#include "elm_text.h"
-#endif /* VG_RENDER_TEXT */
-
-#if RTOS
-#define BASE_ADDRESS_ALIGNMENT 32
-#else
-#define BASE_ADDRESS_ALIGNMENT 4
-# endif
-/* #define ENABLE_ELM_CRATE_OBJECT_FROM_FILE */
-
-/*
- * ANSI APIs are missing so application can use ElmCreateObjectFromData
- * This simplifies things since file can be from FATFS, NOR Flash buffer etc.
- */
-
-#if (RTOS && DDRLESS) || BAREMETAL
-/* Find some free objects, return the first index,
- * and mark the bits as 1 (allocated).
- * Params:
- * free_map: the map bits of the objects where 0 is free and 1 is allocated;
- * count : the element count of free_map[];
- * obj_count:how many objects to allocate from the pool.
- *
- * Return:
- * The free index of the object in the pool.
- * */
-int get_free_objects(int32_t free_map[], int count, int obj_count)
-{
- int i, j;
- int result = -1;
- int counter = 0;
- int bit_count = 0;
- int32_t bits;
-
- /* Find a free bit. */
- for (i = 0; i < count; i++) {
- bits = free_map[i];
-
- for (j = 0; j < 32; j++) {
- //Increase the bit counter.
- bit_count++;
-
- if ((bits & 0x80000000) == 0) {
- //Free bit is found. then count available free bits.
- counter++;
- }
- else {
- //Free bit is not found, reset the counter.
- counter = 0;
- }
-
- //Check to see whether enough bits are found.
- if (counter >= obj_count) {
- result = bit_count - counter;
-
- //Get out of the two loops.
- i = count;
- break;
- }
-
- //Shift to next bit.
- bits <<= 1;
- }
- }
-
- /* Mark the bits as allocated if OK. */
- if (result > -1) {
- int bits_set = 1;
- int bit_offset = result % 32;
- bit_count = result / 32;
-
- while (obj_count > 0) {
- bits_set = ~(0xffffffff << (32 - bit_offset));
- if (obj_count <= 32 - bit_offset) {
- //Done.
- bits_set = bits_set & (0xffffffff << (32 - bit_offset - obj_count));
- free_map[bit_count] |= bits_set;
- break;
- }
- free_map[bit_count] |= bits_set;
-
- //Go to next map element.
- obj_count -= (32 - bit_offset);
- bit_count++;
- bit_offset = 0;
- }
- }
-
- return result;
-}
-
-/* When an object is "freed", mark the corresponding bits to 0. */
-void mark_free_object(int32_t free_map[], int object)
-{
- int index, offset;
-
- index = object / 32;
- offset = object % 32;
-
- free_map[index] &= ~(1 << (31 - offset));
-}
-
-/* Check whether an object (with given index) allocated or not. */
-int object_exists(int32_t free_map[], int index)
-{
- int32_t bits;
- int offset = index % 32;
- index /= 32;
-
- bits = ~(1 << (31 - offset));
-
- if (free_map[index] & bits) {
- return 1;
- }
- else {
- return 0;
- }
-}
-
-/* Allocate an EVO object from pool. */
-static el_Obj_EVO * alloc_evo(int count)
-{
- elm_tls_t* elm_tls;
- int index;
- el_Obj_EVO *object = NULL;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
- index = get_free_objects(elm_tls->gContext.objmap_evo, COUNT_OF(elm_tls->gContext.objmap_evo), count);
-
- if (index > -1) {
- object = &elm_tls->gContext.objpool_evo[index];
- elm_tls->gContext.objcounter_evo += count;
- for (; count > 0; count--) {
- object[count - 1].object.index = index + count - 1;
- }
- }
-
- return object;
-}
-
-/* Allocate an EBO object from pool. */
-static el_Obj_EBO * alloc_ebo()
-{
- elm_tls_t* elm_tls;
- int index;
- el_Obj_EBO *object = NULL;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
- index = get_free_objects(elm_tls->gContext.objmap_ebo, COUNT_OF(elm_tls->gContext.objmap_ebo), 1);
-
- if (index > -1) {
- object = &elm_tls->gContext.objpool_ebo[index];
- object->object.index = index;
- elm_tls->gContext.objcounter_ebo++;
- }
-
- return object;
-}
-
-/* Allocate an EGO object from pool. */
-static el_Obj_Group * alloc_ego()
-{
- elm_tls_t* elm_tls;
- int index;
- el_Obj_Group *object = NULL;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
- index = get_free_objects(elm_tls->gContext.objmap_group, COUNT_OF(elm_tls->gContext.objmap_group), 1);
-
- if (index > -1) {
- object = &elm_tls->gContext.objpool_group[index];
- object->object.index = index;
- elm_tls->gContext.objcounter_group++;
- }
-
- return object;
-}
-
-/* Mark an EGO object as free: insert it into the free list. */
-static void free_ego(el_Obj_Group *object)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
- mark_free_object(elm_tls->gContext.objmap_group, elm_tls->object->object.index);
- elm_tls->gContext.objcounter_group--;
-}
-
-/* Allocate a grad object from pool. */
-static el_Obj_Grad * alloc_grad()
-{
- elm_tls_t* elm_tls;
- int index;
- el_Obj_Grad *object = NULL;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
- index = get_free_objects(elm_tls->gContext.objmap_grad, COUNT_OF(elm_tls->gContext.objmap_grad), 1);
-
- if (index > -1) {
- object = &elm_tls->gContext.objpool_grad[index];
- object->object.index = index;
- elm_tls->gContext.objcounter_grad++;
- }
-
- return object;
-}
-
-#endif
-/* Internal Implementations *******************************/
-int deref_object(el_Object *object)
-{
- object->reference--;
- return object->reference;
-}
-
-int ref_object(el_Object *object)
-{
- object->reference++;
- return object->reference;
-}
-
-int add_object(el_Object *object)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return 0;
-#if (RTOS && DDRLESS) || BAREMETAL
- /* Assign handle. */
- object->handle = elm_tls->gContext.currentHandle++;
- return 1;
-#else
- int result = 1;
- el_ObjList *list = NULL;
-
- /* Assign handle. */
- object->handle = elm_tls->gContext.currentHandle++;
-
- /* Get the list slot. */
- list = OBJECT_SLOT(object->handle);
- if (list == NULL) {
- list = (el_ObjList *) elm_alloc(1, sizeof(el_ObjList));
- if ( list == NULL ) {
- return 0; /* Memory allocation failed */
- }
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(list, 0, sizeof(el_ObjList));
-#endif
-
- OBJECT_SLOT(object->handle) = list;
-
- list->object = object;
- list->next = NULL;
-
- return 1;
- }
-
- /* Insert the object. */
- while (list->next != NULL) {
- list = list->next;
- }
- list->next = (el_ObjList *) elm_alloc(1, sizeof(el_ObjList));
- if ( list->next == NULL ) {
- return 0; /* Memory allocation failed */
- }
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(list->next, 0, sizeof(el_ObjList));
-#endif
- list = list->next;
- list->object = object;
- list->next = NULL;
-
- return result;
-#endif
-}
-
-int remove_object(el_Object *object)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return 0;
-
- int result = 0;
-#if (!(RTOS && DDRLESS)) && (!BAREMETAL)
- el_ObjList *list = NULL, *node = NULL;
-
- // Get the list slot.
- list = OBJECT_SLOT(object->handle);
-
- // Invalid.
- if (list == NULL)
- return 0;
-
- // Find the object.
- if (list->object == object) {
- OBJECT_SLOT(object->handle) = list->next;
- elm_free(list);
- return 1;
- }
-
- while (list->next != NULL) {
- if (list->next->object == object) {
- node = list->next;
- list->next = list->next->next;
- elm_free(node);
- return 1;
- }
- list = list->next;
- }
-#endif
-
- return result;
-}
-
-el_Object *get_object(ElmHandle handle)
-{
- elm_tls_t* elm_tls;
- el_Object *object = NULL;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return NULL;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- int i;
- for (i = 0; i < OBJCOUNT_EVO; i++) {
- if (object_exists(elm_tls->gContext.objmap_evo, i)) {
- if (elm_tls->gContext.objpool_evo[i].object.handle == handle) {
- object = (el_Object *)&elm_tls->gContext.objpool_evo[i];
- return object;
- }
- }
- }
- for (i = 0; i < OBJCOUNT_EBO; i++) {
- if (object_exists(elm_tls->gContext.objmap_ebo, i)) {
- if (elm_tls->gContext.objpool_ebo[i].object.handle == handle) {
- object = (el_Object *)&elm_tls->gContext.objpool_ebo[i];
- return object;
- }
- }
- }
- for (i = 0; i < OBJCOUNT_GRAD; i++) {
- if (object_exists(elm_tls->gContext.objmap_grad, i)) {
- if (elm_tls->gContext.objpool_grad[i].object.handle == handle) {
- object = (el_Object *)&elm_tls->gContext.objpool_grad[i];
- return object;
- }
- }
- }
- for (i = 0; i < OBJCOUNT_GROUP; i++) {
- if (object_exists(elm_tls->gContext.objmap_group, i)) {
- if (elm_tls->gContext.objpool_group[i].object.handle == handle) {
- object = (el_Object *)&elm_tls->gContext.objpool_group[i];
- return object;
- }
- }
- }
-#else
- el_ObjList *list = NULL;
-
- // Get the slot.
- list = OBJECT_SLOT(handle);
-
- // Find the object.
- while (list != NULL) {
- if ((list->object != NULL) &&
- (list->object->handle == handle)) {
- object = list->object;
- return object;
- }
- list = list->next;
- }
-#endif
-
- DEBUG_ASSERT(0, "Unknown object");
- return NULL;
-}
-
-#if (RTOS && DDRLESS) || BAREMETAL
-static void free_grad(el_Obj_Grad *object)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls != NULL) {
- mark_free_object(elm_tls->gContext.objmap_grad, object->object.index);
- elm_tls->gContext.objcounter_grad--;
- }
-}
-#endif
-
-/* Destroy an evo object data. */
-int destroy_evo(el_Obj_EVO *evo)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return 0;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- mark_free_object(elm_tls->gContext.objmap_evo, evo->object.index);
- elm_tls->gContext.objcounter_evo--;
- free_grad(evo->defaultAttrib.paint.grad);
-#else
-
- if ( evo->defaultAttrib.paint.type == ELM_PAINT_TEXT ) {
-#if (VG_RENDER_TEXT==1)
- _unload_text(evo);
-#else
- ;
-#endif /* VG_RENDER_TEXT */
- } else {
- /* TODO: EVO destroy not done yet. */
- if (evo->defaultAttrib.paint.grad != NULL) {
- vg_lite_clear_grad(&evo->defaultAttrib.paint.grad->data.grad);
- elm_free(evo->defaultAttrib.paint.grad);
- evo->defaultAttrib.paint.grad = NULL;
- }
-
- if (evo->data.path.path != NULL) {
- vg_lite_clear_path(&evo->data.path);
- elm_free(evo->data.path.path);
- evo->data.path.path = NULL;
- }
- }
-
- remove_object(&evo->object);
-#endif
-
-#if (VG_RENDER_TEXT==1)
- destroy_font_data();
-#endif /* VG_RENDER_TEXT */
- return 1;
-}
-
-/* Destroy an ego object data. */
-int destroy_ego(el_Obj_Group *ego)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if(elm_tls == NULL)
- return 0;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- mark_free_object(elm_tls->gContext.objmap_group, ego->object.index);
- elm_tls->gContext.objcounter_group--;
-#else
- int i;
- for (i = 0; i < ego->group.count; i++)
- {
- destroy_evo(&ego->group.objects[i]);
- }
- elm_free(ego->group.objects);
- elm_free(ego);
-#endif
-
-#if (VG_RENDER_TEXT==1)
- destroy_font_data();
-#endif /* VG_RENDER_TEXT */
- return 1;
-}
-
-/* Destroy an ebo object data. */
-int destroy_ebo(el_Obj_EBO *ebo)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if(elm_tls == NULL)
- return 0;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- mark_free_object(elm_tls->gContext.objmap_ebo, ebo->object.index);
- elm_tls->gContext.objcounter_ebo--;
-#else
- if ( ebo != NULL && ebo->data.buffer.handle != NULL) {
- vg_lite_free(&ebo->data.buffer);
- }
- elm_free(ebo);
-#endif
- return 1;
-}
-
-/* Destroy an object.
- return:
- -1: any error;
- 0: destroyed when reference count is 0;
- 1: decreased reference count but still > 0.
- */
-int destroy_object(ElmHandle handle)
-{
- el_Object *object = NULL;
- int ref_count = 0;
-
- object = get_object(handle);
-
- // No such object.
- if (object == NULL) {
- DEBUG_ASSERT(0, "No such object");
- return -1;
- }
-
- // Dereference object, and destroy if it's no more referred.
- ref_count = deref_object(object);
- if (ref_count == 0) {
- remove_object(object);
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EVO:
- destroy_evo((el_Obj_EVO *)object);
- elm_free(object);
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- destroy_ego((el_Obj_Group *) object);
- break;
-
- case ELM_OBJECT_TYPE_EBO:
- destroy_ebo((el_Obj_EBO *) object);
- break;
-
- default:
- DEBUG_ASSERT(0, "Unknow object type");
- break;
- }
- }
-
- return 1;
-}
-
-void _init_transform(el_Transform *transform)
-{
- int i = 0;
- transform->rotate = 0.0f;
- for (i = 0;i < 2; i++)
- {
- transform->scale[i] = 1.0f;
- transform->translate[i] = 0.0f;
- }
- vg_lite_identity(&transform->matrix);
-}
-
-/* Static functions. *************************************************/
-
-/* Get the specified vector object in a group. */
-static el_Obj_EVO* _get_evo(el_Obj_Group *group, int32_t id)
-{
- if ((id >= group->group.count) ||
- (id < 0)){
- return (el_Obj_EVO*)NULL;
- }
- else {
- return (el_Obj_EVO*)(group->group.objects + id);
- }
-}
-
-#if (VG_RENDER_TEXT==1)
-static int _load_font(uint8_t *data,
- unsigned size)
-{
- ElmHandle ret = ELM_NULL_HANDLE;
- el_Font_Header *font_header = (el_Font_Header *)data;
-
-
- if (font_header->size_font_block != size)
- return ret;
-
- return _load_font_data(data);
-}
-
-static ElmHandle _load_text(uint8_t *data,
- unsigned size,
- el_Obj_EVO *evo)
-{
- ElmHandle ret = ELM_NULL_HANDLE;
- el_Text_Header *text_header = (el_Text_Header *)data;
-
-
- if (text_header->size_text_block != size)
- return ret;
-
- return _load_text_data(data, evo);
-}
-#endif /* VG_RENDER_TEXT */
-
-#if (defined(__ICCARM__))
-/*
- * Disable the unaligned structure attribute warning. Due to the packed data
- * structures used to interpret ELM objects data the IAR compiler issues a
- * number of warnings that certain attributes of the headers might be unaligned.
- * This is not true, however, as all atributes are manually aligned to 4 bytes.
- */
-#pragma diag_suppress = Pa039
-#endif
-
-static ElmHandle _load_evo(const uint8_t *data, unsigned size, el_Obj_EVO *evo)
-{
- int i = 0;
-#if (RTOS && DDRLESS) || BAREMETAL
- uint32_t colors[VLC_MAX_GRAD];
- void *path_data;
-#else
- uint32_t *colors = NULL;
- uint8_t *path_data = NULL;
-#endif
- el_Obj_EVO *local_evo = NULL;
- el_EVO_Header *evo_header = (el_EVO_Header *) data;
-
- if (evo == NULL) {
-#if (RTOS && DDRLESS) || BAREMETAL
- local_evo = alloc_evo(1);
-#else
- local_evo = (el_Obj_EVO *)elm_alloc(1, sizeof(el_Obj_EVO));
-#endif
- evo = local_evo;
- }
- JUMP_IF_NULL(evo, error_exit);
- memset(evo, 0, sizeof(el_Obj_EVO));
-
- /*
- * Check if object size is valid. The size parameter
- * needs to be a value greater or equal to the
- * size of the current object to be loaded.
- * This check needs to be done in order to ensure
- * that the is_image field is correctly read and
- * we do not read from invalid memory.
- */
- JUMP_IF_LOWER(size,
- MIN(sizeof(el_EVO_Polygon), sizeof(el_EVO_Image)),
- error_exit);
-
- if(evo_header->polygon.paint_type.is_image)
- {
- /*
- * Check if object size is valid
- * (greater or equal to el_EVO_Image size).
- */
- JUMP_IF_LOWER(size,
- sizeof(el_EVO_Image),
- error_exit);
- memcpy(evo->eboname,
- evo_header->image.eboname,
- evo_header->image.namelength);
- evo->is_image = evo_header->image.paint_type.is_image;
- _init_transform(&evo->defaultAttrib.transform);
- memcpy(&evo->defaultAttrib.transform.matrix,
- &(evo_header->image.matrix),
- sizeof(vg_lite_matrix_t));
- evo->img_width = evo_header->image.width;
- evo->img_height = evo_header->image.height;
- }
- else
- {
- /*
- * Check if object size is valid
- * (greater or equal to el_EVO_Polygon size).
- */
- JUMP_IF_LOWER(size,
- sizeof(el_EVO_Polygon),
- error_exit);
- el_Transform *transform = NULL;
- el_Transform *grad_transform = NULL;
- el_EVO_Polygon *object_data = (el_EVO_Polygon *) &(evo_header->polygon);
- el_EVO_GradData *grad_data = (el_EVO_GradData *) &(evo_header->polygon.grad);
-
- /* Get path data from the object. */
-#if (RTOS && DDRLESS) || BAREMETAL
- path_data = (void *) (data + object_data->offset);
-#else
- path_data = (uint8_t *)elm_alloc(1, object_data->length);
- JUMP_IF_NULL(path_data, error_exit);
-
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(path_data, 0, object_data->length);
-#endif
- JUMP_IF_LOWER(size,
- object_data->offset + object_data->length,
- error_exit);
- /* Get path data. */
- memcpy(path_data, (void *)(data + object_data->offset),
- object_data->length);
-#endif
-
- if(object_data->paint_type.has_pattern)
- evo->has_pattern = 1;
- if(object_data->paint_type.is_pattern)
- evo->is_pattern = 1;
-
- _init_transform(&evo->defaultAttrib.transform);
- transform = &evo->defaultAttrib.transform;
-
- evo->object.type = ELM_OBJECT_TYPE_EVO;
- evo->object.reference = 0;
-
- if ((object_data->paint_type.paint == ELM_PAINT_RADIAL_GRADIENT) ||
- (object_data->paint_type.paint == ELM_PAINT_GRADIENT)) {
-#if (RTOS && DDRLESS) || BAREMETAL
- evo->defaultAttrib.paint.grad = alloc_grad();
-#else
- evo->defaultAttrib.paint.grad = (el_Obj_Grad*)elm_alloc(1, sizeof(el_Obj_Grad));
-#endif
- JUMP_IF_NULL(evo->defaultAttrib.paint.grad, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(evo->defaultAttrib.paint.grad, 0, sizeof(el_Obj_Grad));
-#endif
- evo->defaultAttrib.paint.grad->data.grad.image.width = 0;
- evo->defaultAttrib.paint.grad->data.grad.image.height = 0;
- evo->defaultAttrib.paint.grad->data.grad.image.stride = 0;
- evo->defaultAttrib.paint.grad->data.grad.image.tiled = VG_LITE_LINEAR;
-
- _init_transform(&evo->defaultAttrib.paint.grad->data.transform);
- grad_transform = &evo->defaultAttrib.paint.grad->data.transform;
- memcpy(&grad_transform->matrix, &(grad_data->matrix),
- sizeof(vg_lite_matrix_t));
- colors = (uint32_t *)elm_alloc(grad_data->stop_count, sizeof(uint32_t));
- JUMP_IF_NULL(colors, error_exit);
- memcpy(colors,
- data + grad_data->color_offset,
- grad_data->stop_count * sizeof(uint32_t));
- }
-
- if (object_data->arc_flag)
- vg_lite_init_arc_path(&evo->data.path,
- (vg_lite_format_t) object_data->format,
- (vg_lite_quality_t) object_data->quality,
- object_data->length,
- path_data,
- object_data->min_x,
- object_data->min_y,
- object_data->max_x,
- object_data->max_y);
- else
- vg_lite_init_path(&evo->data.path,
- (vg_lite_format_t) object_data->format,
- (vg_lite_quality_t) object_data->quality,
- object_data->length,
- path_data,
- object_data->min_x,
- object_data->min_y,
- object_data->max_x,
- object_data->max_y);
-
- memcpy(&transform->matrix, &(object_data->matrix), sizeof(vg_lite_matrix_t));
-
- evo->defaultAttrib.quality = ELM_QUALITY_LOW;
- evo->defaultAttrib.fill_rule = (ELM_EVO_FILL) object_data->fill_rule;
- evo->defaultAttrib.blend = (ELM_BLEND) object_data->blend;
- evo->defaultAttrib.paint.type = (ELM_PAINT_TYPE) object_data->paint_type.paint;
-
- switch (object_data->paint_type.paint) {
- case ELM_PAINT_GRADIENT:
- {
-#if (RTOS && DDRLESS) || BAREMETAL
- uint32_t stops[VLC_MAX_GRAD];
-#else
- uint32_t *stops = NULL;
-
- stops = (uint32_t *)elm_alloc(sizeof(uint32_t), grad_data->stop_count);
- JUMP_IF_NULL(stops, error_exit);
-#endif
- for (i = 0 ;i < grad_data->stop_count; i++)
- {
- stops[i] = (uint32_t)((*(float *) (data +
- grad_data->stop_offset + i * 4)) * 255);
- }
-
- vg_lite_init_grad(&evo->defaultAttrib.paint.grad->data.grad);
- vg_lite_set_grad(&evo->defaultAttrib.paint.grad->data.grad,
- grad_data->stop_count, colors, stops);
- if (grad_data->stop_count > 0)
- {
- vg_lite_update_grad(&evo->defaultAttrib.paint.grad->data.grad);
- }
-#if (RTOS && DDRLESS) || BAREMETAL
-#else
- elm_free(stops);
-#endif
- break;
- }
- case ELM_PAINT_RADIAL_GRADIENT:
- {
- float *stops;
- vg_lite_color_ramp_t *vgColorRamp;
- el_EVO_RadGradDataExt *rad_grad = (el_EVO_RadGradDataExt *) (data + sizeof(el_EVO_Header));
-
- JUMP_IF_LOWER(size,
- sizeof(el_EVO_Polygon) + sizeof(el_EVO_RadGradDataExt),
- error_exit);
-
- stops = (float *)elm_alloc(grad_data->stop_count, sizeof(float));
- JUMP_IF_NULL(stops, error_exit);
- memset(stops, 0, grad_data->stop_count * sizeof(float));
- vgColorRamp = (vg_lite_color_ramp_t *) elm_alloc(grad_data->stop_count,
- sizeof(vg_lite_color_ramp_t));
- if (vgColorRamp == NULL) {
- elm_free(stops);
- goto error_exit;
- }
- memset(vgColorRamp, 0,
- sizeof(vg_lite_color_ramp_t) * grad_data->stop_count);
- for (i = 0; i < grad_data->stop_count; i++)
- {
- stops[i] = (*(float *) (data + grad_data->stop_offset + i * 4));
- vgColorRamp[i].alpha = (float)(colors[i] >> 24) / 255.0f;
- vgColorRamp[i].red = (float)(colors[i] >> 16 & 0xFF) / 255.0f;
- vgColorRamp[i].green = (float)(colors[i] >> 8 & 0xFF) / 255.0f;
- vgColorRamp[i].blue = (float)(colors[i] & 0xFF) / 255.0f;
- vgColorRamp[i].stop = stops[i];
- }
-
- memset(&evo->defaultAttrib.paint.radgrad->data.rad_grad, 0, sizeof(evo->defaultAttrib.paint.radgrad->data.rad_grad));
- vg_lite_set_rad_grad(&evo->defaultAttrib.paint.radgrad->data.rad_grad,
- grad_data->stop_count,
- vgColorRamp,
- rad_grad->params,
- rad_grad->spread_mode,
- 0);
- vg_lite_update_rad_grad(&evo->defaultAttrib.paint.radgrad->data.rad_grad);
-
- elm_free(stops);
- elm_free(vgColorRamp);
- break;
- }
- default:
- /* Do nothing */
- break;
- }
-
- evo->defaultAttrib.paint.color = object_data->color;
- evo->attribute = evo->defaultAttrib;
- ref_object(&evo->object);
- JUMP_IF_NON_ZERO_VALUE(add_object(&evo->object), error_exit);
-
-#if (RTOS && DDRLESS) || BAREMETAL
-#else
- elm_free(colors);
-#endif
- }
-
- return evo->object.handle;
-
-error_exit:
-#if (RTOS && DDRLESS) || BAREMETAL
-#else
- if ( colors != NULL )
- elm_free(colors);
- if ( path_data != NULL)
- elm_free(path_data);
-#endif
-
- if ( (evo != NULL) && (evo->defaultAttrib.paint.grad != NULL) )
- elm_free(evo->defaultAttrib.paint.grad);
- if ( (evo != NULL) && (evo->defaultAttrib.paint.radgrad != NULL) )
- elm_free(evo->defaultAttrib.paint.radgrad);
- if ( local_evo != NULL )
- elm_free(local_evo);
-
- return ELM_NULL_HANDLE;
-}
-
-static ElmHandle _load_ebo(const uint8_t *data, int size, uint32_t version)
-{
- vg_lite_error_t error;
- vg_lite_buffer_t *buffer;
- uint32_t *colors, bytes = 0;
-
- el_EBO_Header *ebo_header = (el_EBO_Header *) data;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- el_Obj_EBO *ebo = alloc_ebo();
-#else
- el_Obj_EBO *ebo = (el_Obj_EBO *)elm_alloc(1, (sizeof(el_Obj_EBO)));
-#endif
- JUMP_IF_NULL(ebo, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(ebo, 0, sizeof(el_Obj_EBO));
-#endif
- buffer = &ebo->data.buffer;
-
- /*
- * Check if object size is valid. "size" needs to be a value greater than or
- * equal to the size of the current object header.
- */
- JUMP_IF_LOWER(size, sizeof(el_EBO_Header), error_exit);
- bytes += sizeof(el_EBO_Header);
-
- if(version == 1)
- {
- el_EBO_Palette *clut_header = (el_EBO_Palette *) (data + sizeof(el_EBO_Header));
-
- /* Make sure object size includes the CLUT header */
- bytes += sizeof(el_EBO_Palette);
- JUMP_IF_LOWER(size, bytes, error_exit);
-
- ebo->object.type = (ELM_OBJECT_TYPE) ebo_header->type;
- ebo->object.reference = 0;
-
- buffer->width = ebo_header->width;
- buffer->height = ebo_header->height;
- buffer->format = (vg_lite_buffer_format_t) ebo_header->format;
- buffer->stride = 0;
-
- error = vg_lite_allocate(buffer);
- if (error != VG_LITE_SUCCESS)
- {
- destroy_ebo(ebo);
- return 0;
- }
-
- buffer->stride = ebo_header->stride;
- buffer->tiled = (vg_lite_buffer_layout_t) ebo_header->tiled;
- colors = (uint32_t *)(data + clut_header->clut_data_offset);
-
- /* Make sure the object size includes image data */
- JUMP_IF_LOWER(size,
- ebo_header->data_offset +
- (buffer->stride * buffer->height),
- error_exit);
-
- memcpy(buffer->memory,
- data + ebo_header->data_offset,
- buffer->stride * buffer->height);
-
- /* Save CLUT infomation. */
- ebo->clut_count = clut_header->clut_count;
-
- /* Make sure object size includes CLUT data */
- JUMP_IF_LOWER(size,
- clut_header->clut_data_offset +
- (sizeof(uint32_t) * clut_header->clut_count),
- error_exit);
-
- memcpy(ebo->clut, colors, sizeof(uint32_t) * clut_header->clut_count);
- }
- else if(version == 2)
- {
- ebo->object.type = (ELM_OBJECT_TYPE) ebo_header->type;
- ebo->object.reference = 0;
-
- buffer->width = ebo_header->width;
- buffer->height = ebo_header->height;
- buffer->format = (vg_lite_buffer_format_t) ebo_header->format;
- buffer->stride = 0;
-
- error = vg_lite_allocate(buffer);
- if (error != VG_LITE_SUCCESS)
- {
- destroy_ebo(ebo);
- return 0;
- }
-
- buffer->stride = ebo_header->stride;
- buffer->tiled = (vg_lite_buffer_layout_t) ebo_header->tiled;
-
- /* Make sure the object size includes image data */
- JUMP_IF_LOWER(size,
- ebo_header->data_offset +
- (buffer->stride * buffer->height),
- error_exit);
-
- memcpy(buffer->memory,
- data + ebo_header->data_offset,
- buffer->stride * buffer->height);
- }
- /* Set transformation to identity. */
- ebo->defaultAttrib.transform.dirty = 1;
- ebo->defaultAttrib.transform.identity = 1;
-
- _init_transform(&ebo->defaultAttrib.transform);
- ebo->attribute = ebo->defaultAttrib;
-
- ref_object(&ebo->object);
- JUMP_IF_NON_ZERO_VALUE(add_object(&ebo->object), error_exit);
-
- return ebo->object.handle;
-
-error_exit:
- if (ebo != NULL ) {
- elm_free(ebo);
- }
-
- return ELM_NULL_HANDLE;
-}
-
-static ElmHandle _load_ego(const uint8_t *data, int size)
-{
- int i;
- unsigned int invalid_count = 0;
- uint32_t *obj_size, *obj_offset, *obj_type;
- void *obj_data;
- el_EGO_Header *ego_header = (el_EGO_Header *) data;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- el_Obj_Group *ego = alloc_ego();
-#else
- el_Obj_Group *ego = (el_Obj_Group *)elm_alloc(1, sizeof(el_Obj_Group));
-#endif
- JUMP_IF_NULL(ego, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(ego, 0, sizeof(el_Obj_Group));
-#endif
-
- ego->object.type = (ELM_OBJECT_TYPE) ego_header->type;
- ego->object.reference = 0;
-
- _init_transform(&ego->defaultTrans);
- memcpy(&(ego->defaultTrans.matrix.m),
- &(ego_header->matrix),
- sizeof(vg_lite_matrix_t));
- ego->group.count = ego_header->count;
-#if (RTOS && DDRLESS) || BAREMETAL
- ego->group.objects = alloc_evo(ego->group.count);
-#else
- ego->group.objects = (el_Obj_EVO *)elm_alloc(1, ego->group.count * sizeof(el_Obj_EVO));
-#endif
- JUMP_IF_NULL(ego->group.objects, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(ego->group.objects, 0, ego->group.count * sizeof(el_Obj_EVO));
-#endif
-
- obj_size = (uint32_t *)((unsigned)data + sizeof(el_EGO_Header));
- obj_offset = (uint32_t *)((unsigned)obj_size + \
- (ego_header->count * sizeof(uint32_t)));
-
- for (i = 0; i < ego->group.count && obj_offset[i] < size; i++)
- {
- if (obj_size[i] == 0) {
- invalid_count++;
- continue;
- }
-
- /* Check whether EVO object is truncated */
- JUMP_IF_GREATER(obj_offset[i] + obj_size[i], size, error_exit);
-
- /* Call appropriate object loader according to object type */
- obj_data = (void*)((unsigned)data + obj_offset[i]);
- obj_type = obj_data;
- switch (*obj_type) {
- case ELM_OBJECT_TYPE_EVO:
- ego->group.objects[i].object.handle = _load_evo(obj_data,
- obj_size[i],
- &ego->group.objects[i]);
- break;
-#if (VG_RENDER_TEXT==1)
- case ELM_OBJECT_TYPE_FONT:
- _load_font(obj_data, obj_size[i]);
- break;
- case ELM_OBJECT_TYPE_TEXT:
- ego->group.objects[i].object.handle = _load_text(obj_data,
- obj_size[i],
- &ego->group.objects[i]);
- break;
-#endif /* VG_RENDER_TEXT */
- default:
- break;
- }
- }
-
- ego->group.count -= invalid_count;
- ego->transform = ego->defaultTrans;
-
- ref_object(&ego->object);
- JUMP_IF_NON_ZERO_VALUE(add_object(&ego->object), error_exit);
-
- return ego->object.handle;
-
-error_exit:
- if (ego != NULL ) {
- if ( ego->group.objects != NULL ) {
- elm_free(ego->group.objects);
- }
- elm_free(ego);
- }
-
- return ELM_NULL_HANDLE;
-}
-
-#if (defined(__ICCARM__))
-/* Restore the unaligned data structure attribute warning */
-#pragma diag_default = Pa039
-#endif
-
-static BOOL _scale(ElmHandle obj, float x, float y)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *ego = NULL;
- el_Transform *transform = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- transform = &ebo->attribute.transform;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- ego = (el_Obj_Group *)object;
- if (elm_tls->gContext.vector_id < 0) {
- transform = &ego->transform;
- }
- else {
- evo = _get_evo(ego, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- transform = &evo->attribute.transform;
- }
- else { /* No such vector object to set. */
- return FALSE;
- }
- }
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- transform = &evo->attribute.transform;
- break;
-
- default:
- DEBUG_ASSERT(0, "Bad object type");
- break;
- }
-
- // Update the transformation params.
- transform->scale[0] *= x;
- transform->scale[1] *= y;
-
- vg_lite_scale(x, y, &transform->matrix);
-
- // Clean dirty.
- transform->dirty = FALSE;
-
- return TRUE;
-}
-
-static BOOL _reset_attrib(ElmHandle obj, ELM_EVO_PROP_BIT mask)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *ego = NULL;
- el_Attribute *attrib = NULL;
- el_Attribute *defaultAttr = NULL;
- el_Transform *transform = NULL;
- el_Transform *defaultTrans = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- attrib = &ebo->attribute;
- defaultAttr = &ebo->defaultAttrib;
- transform = &attrib->transform;
- defaultTrans = &defaultAttr->transform;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- ego = (el_Obj_Group *)object;
- if (elm_tls->gContext.vector_id < 0) {
- transform = &ego->transform;
- defaultTrans = &ego->defaultTrans;
- }
- else {
- evo = _get_evo((el_Obj_Group*)obj, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- attrib = &evo->attribute;
- defaultAttr = &evo->defaultAttrib;
- transform = &attrib->transform;
- defaultTrans = &defaultAttr->transform;
- }
- else {
- return FALSE;
- }
- }
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- attrib = &evo->attribute;
- defaultAttr = &evo->defaultAttrib;
- transform = &attrib->transform;
- defaultTrans = &defaultAttr->transform;
- break;
-
- default:
- DEBUG_ASSERT(0, "Bad object type");
- return FALSE;
- break;
- }
-
- // Update the attribute value. When transform is modified, update the matrix.
- if (mask & ELM_PROP_ROTATE_BIT) {
- transform->rotate = defaultTrans->rotate;
- }
-
- if (mask & ELM_PROP_TRANSFER_BIT) {
- transform->translate[0] = defaultTrans->translate[0];
- transform->translate[1] = defaultTrans->translate[1];
- }
-
- if (mask & ELM_PROP_SCALE_BIT) {
- transform->scale[0] = defaultTrans->scale[0];
- transform->scale[1] = defaultTrans->scale[1];
- }
-
- /* On any bit reset, reset the whole matrix to the default one. */
- if (mask & (ELM_PROP_ROTATE_BIT | ELM_PROP_TRANSFER_BIT | ELM_PROP_SCALE_BIT)) {
- memcpy(&(transform->matrix), &(defaultTrans->matrix), sizeof(defaultTrans->matrix));
- transform->dirty = FALSE;
- }
-
- /* Update other rendering attributes. */
- if (mask & ELM_PROP_BLEND_BIT) {
- attrib->blend = defaultAttr->blend;
- }
-
- if (mask & ELM_PROP_QUALITY_BIT) {
- attrib->quality = defaultAttr->quality;
- }
-
- if (mask & ELM_PROP_FILL_BIT) {
- attrib->fill_rule = defaultAttr->fill_rule;
- }
-
- if (mask & ELM_PROP_COLOR_BIT) {
- attrib->paint.color = defaultAttr->paint.color;
- }
-
- if (mask & ELM_PROP_PAINT_BIT) {
- attrib->paint.type = defaultAttr->paint.type;
- }
-
- return TRUE;
-}
-
-static BOOL _set_quality(ElmHandle obj, ELM_QUALITY quality)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *group = NULL;
- el_Attribute *attrib = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- attrib = &ebo->attribute;
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- attrib = &evo->attribute;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- evo = _get_evo(group, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- attrib = &evo->attribute;
- }
- else {
- return FALSE;
- }
- break;
- default:
- DEBUG_ASSERT(0, "Bad object type");
- return FALSE;
- break;
- }
-
- attrib->quality = quality;
-
- return TRUE;
-}
-
-static BOOL _set_fill(ElmVecObj evo, ELM_EVO_FILL fill)
-{
- el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
-
- if (object == NULL) {
- DEBUG_ASSERT(0, "Bad object handle");
- return FALSE;
- }
-
- object->attribute.fill_rule = fill;
-
- return TRUE;
-}
-
-static BOOL _set_blend(ElmHandle obj, ELM_BLEND blend)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *group = NULL;
- el_Attribute *attrib = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- attrib = &ebo->attribute;
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- attrib = &evo->attribute;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- evo = _get_evo(group, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- attrib = &evo->attribute;
- }
- else {
- return FALSE;
- }
- break;
- default:
- DEBUG_ASSERT(0, "Bad object type");
- return FALSE;
- break;
- }
-
- attrib->blend = blend;
-
- return TRUE;
-}
-
-static BOOL _set_color(ElmVecObj evo, uint32_t color)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
- el_Obj_Group *group = NULL;
-
- if (object == NULL) {
- DEBUG_ASSERT(0, "Bad object handle");
- return FALSE;
- }
-
- switch (object->object.type) {
- case ELM_OBJECT_TYPE_EVO:
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- object = _get_evo(group, elm_tls->gContext.vector_id);
- if (object == NULL) {
- return FALSE;
- }
- break;
- case ELM_OBJECT_TYPE_EBO:
- default:
- DEBUG_ASSERT(0, "Bad object type");
- return FALSE;
- break;
- }
-
- object->attribute.paint.color = color;
-
- return TRUE;
-}
-
-static BOOL _set_pattern(ElmVecObj evo, ElmBitmapObj pattern)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
- el_Obj_EBO *ebo_obj = (el_Obj_EBO *) get_object(pattern);
- el_Obj_Group *group = NULL;
-
- if ((object == NULL) ||
- (ebo_obj == NULL)){
- DEBUG_ASSERT(0, "Bad object handle");
- return FALSE;
- }
-
- switch (object->object.type) {
- case ELM_OBJECT_TYPE_EVO:
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- object = _get_evo(group, elm_tls->gContext.vector_id);
- if (object == NULL) {
- return FALSE;
- }
- break;
-
- default:
- break;
- }
-
- object->attribute.paint.pattern.pattern = ebo_obj;
- ref_object((el_Object *)ebo_obj);
-
- return TRUE;
-}
-
-static BOOL _set_pattern_mode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
- el_Obj_Group *group = NULL;
-
- if (object == NULL){
- DEBUG_ASSERT(0, "Bad object handle");
- return FALSE;
- }
-
- switch (object->object.type) {
- case ELM_OBJECT_TYPE_EVO:
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- object = _get_evo(group, elm_tls->gContext.vector_id);
- if (object == NULL) {
- return FALSE;
- }
- break;
-
- default:
- break;
- }
-
- object->attribute.paint.pattern.mode = mode;
- object->attribute.paint.pattern.color = color;
-
- return TRUE;
-}
-
-static BOOL _set_paintType(ElmVecObj evo, ELM_PAINT_TYPE type)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
- el_Obj_Group *group = NULL;
-
- if (object == NULL) {
- DEBUG_ASSERT(0, "Bad object handle");
- return FALSE;
- }
- switch (object->object.type) {
- case ELM_OBJECT_TYPE_EVO:
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)object;
- object = _get_evo(group, elm_tls->gContext.vector_id);
- if (object == NULL) {
- return FALSE;
- }
- break;
-
- default:
- break;
- }
-
- object->attribute.paint.type = type;
-
- return TRUE;
-}
-
-static BOOL _rotate(ElmHandle obj, float angle)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *ego = NULL;
- el_Transform *transform = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- transform = &ebo->attribute.transform;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- ego = (el_Obj_Group *)object;
- if (elm_tls->gContext.vector_id < 0) {
- transform = &ego->transform;
- }
- else {
- evo = _get_evo(ego, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- transform = &evo->attribute.transform;
- }
- else {
- return FALSE;
- }
- }
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- transform = &evo->attribute.transform;
- break;
-
- default:
- DEBUG_ASSERT(0, "Bad object type");
- break;
- }
-
- // Update the transformation params.
- transform->rotate += angle;
-
- // Upate the matrix.
- vg_lite_rotate(angle, &transform->matrix);
-
- // Clean dirty.
- transform->dirty = FALSE;
-
- return TRUE;
-}
-static BOOL _translate(ElmHandle obj, float x, float y)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Object *object = get_object(obj);
- el_Obj_EBO *ebo = NULL;
- el_Obj_EVO *evo = NULL;
- el_Obj_Group *ego = NULL;
- el_Transform *transform = NULL;
-
- switch (object->type) {
- case ELM_OBJECT_TYPE_EBO:
- ebo = (el_Obj_EBO *)object;
- transform = &ebo->attribute.transform;
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- ego = (el_Obj_Group *)object;
- if (elm_tls->gContext.vector_id < 0) {
- transform = &ego->transform;
- }
- else {
- evo = _get_evo(ego, elm_tls->gContext.vector_id);
- if (evo != NULL) {
- transform = &evo->attribute.transform;
- }
- else {
- return FALSE;
- }
- }
- break;
-
- case ELM_OBJECT_TYPE_EVO:
- evo = (el_Obj_EVO *)object;
- transform = &evo->attribute.transform;
- break;
-
- default:
- DEBUG_ASSERT(0, "Bad object type");
- break;
- }
-
- // Update the transformation params.
- transform->translate[0] += x;
- transform->translate[1] += y;
-
- // Update the matrix.
- vg_lite_translate(x, y, &transform->matrix);
-
- // Clean dirty.
- transform->dirty = FALSE;
-
- return TRUE;
-}
-
-static BOOL _verify_header(ELM_OBJECT_TYPE *type, uint32_t *version, void *data)
-{
- uint32_t *p32_data = (uint32_t *)data;
-
- if (type != NULL) {
- *type = (ELM_OBJECT_TYPE)(*(p32_data + 1));
- }
-
- if (version != NULL) {
- *version = *p32_data;
-
- if (*version <= ELM_VERSION) {
- return TRUE; /* Verified OK, compatible. */
- }
- else {
- return FALSE; /* Verified Failed, API version is lower. */
- }
- }
-
- return TRUE;
-}
-
-/*
- Load the specified object from the data.
- */
-static ElmHandle _create_object_from_data(ELM_OBJECT_TYPE type, void *data, int size)
-{
- ELM_OBJECT_TYPE real_type;
- uint32_t p_data = (uint32_t)data;
- uint32_t version;
-
- if(p_data % BASE_ADDRESS_ALIGNMENT != 0) {
- DEBUG_ASSERT(0, "Error: data address don't align with 32 bytes!");
- return ELM_NULL_HANDLE;
- }
-
- if (FALSE == _verify_header(&real_type, &version, data)) {
- DEBUG_ASSERT(0, "Error: Incompatible file.");
- return ELM_NULL_HANDLE;
- }
-
- if (real_type != type) {
- DEBUG_ASSERT(0, "Warning: Specified type mismatched.\n");
- }
-
- /* Jump over the version field to get to the start of the first ELM object */
- data = (void *)((unsigned)data + sizeof(uint32_t));
-
- switch (real_type) {
- case ELM_OBJECT_TYPE_EVO:
- return _load_evo(data, size, NULL);
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- return _load_ego(data, size);
-
- case ELM_OBJECT_TYPE_EBO:
- return _load_ebo(data, size, version);
-#if (VG_RENDER_TEXT==1)
- case ELM_OBJECT_TYPE_FONT:
- return _load_font(data, size);
-
- case ELM_OBJECT_TYPE_TEXT:
- return _load_text(data, size, NULL);
-#endif
- default:
- DEBUG_ASSERT(0, "Bad object type");
- break;
- }
-
- return ELM_NULL_HANDLE;
-}
-
-static el_Transform *_get_paint_transform(ElmHandle handle)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Transform *transform = NULL;
- el_Obj_Group *group = NULL;
- el_Obj_EVO *evo = NULL;
-
- evo = (el_Obj_EVO *)get_object(handle);
-
- if (evo == NULL) {
- DEBUG_ASSERT(0, "Bad object handle.\n");
- return NULL;
- }
-
- /* Find the corresponding evo object. */
- switch (evo->object.type) {
- case ELM_OBJECT_TYPE_EVO:
- break;
-
- case ELM_OBJECT_TYPE_EGO:
- group = (el_Obj_Group *)evo;
- evo = _get_evo(group, elm_tls->gContext.vector_id);
- if (evo == NULL) {
- return NULL;
- }
- break;
-
- case ELM_OBJECT_TYPE_EBO:
- default:
- DEBUG_ASSERT(0, "Incorrect object tyoe.\n");
- return NULL;
- break;
- }
-
- /* Get the correct transformation based on the paint type. */
- if (evo->attribute.paint.type == ELM_PAINT_PATTERN) {
- transform = &((el_Obj_EBO*)evo->attribute.paint.pattern.pattern)->attribute.transform;
- }
- else if (evo->attribute.paint.type == ELM_PAINT_GRADIENT) {
- transform = &evo->attribute.paint.grad->data.transform;
- }
-
- return transform;
-}
-
-/*********************** ELM API *********************/
-#if !RTOS
-/*!
- @abstract Create an elementary object from an existing binary file.
-
- @discussion
- This function creates an elementary object from the file whose file name is specified by param name.
- Caller must match type with the binary file, otherwise create mail fail by returning ELM_NULL_HANDLE.
-
- @param type
- Specify what type of object to be created.
-
- @param name
- The name of the binary resource file.
-
- @return ElmHandle
- An object handle depending on the corresponding type. If type mismatches, it
- returns ELM_NULL_HANDLE.
- */
-ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name)
-{
-#if RTOS || BAREMETAL
- return ELM_NULL_HANDLE;
-#else
- void *data = NULL;
- long size = 0;
- FILE *fp = fopen(name, "rb");
- ElmHandle handle = ELM_NULL_HANDLE;
-
- if (fp != NULL) {
- fseek(fp, 0, SEEK_END);
- size = ftell(fp);
-
- data = elm_alloc(1, size);
- if (data != NULL) {
- fseek(fp, 0, SEEK_SET);
- fread(data, size, 1, fp);
-
- handle = _create_object_from_data(type, data, size);
- }
- else {
- printf("open %s failed!\n", name);
- }
- elm_free(data);
- fclose(fp);
- }
-
- return handle;
-#endif
-}
-#else
-ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name)
-{
- return ELM_NULL_HANDLE;
-}
-#endif /*!ENABLE_ELM_CRATE_OBJECT_FROM_FILE*/
-/*!
- @abstract Create an elementary object from build-in data within the appplication.
-
- @discussion
- This function creates an elementar object from local data pointer, which is specially useful for environment without filesystem support.
-
- @param type
- Specify what type of object to be created.
-
- @param data
- The pointer to the binary data which has exactly same layout as external resource file.
-
- @return ElmHandle
- An object handle depending on the corresponding type. If type mismatches with the binary data, it
- returns ELM_NULL_HANDLE.
- */
-ElmHandle ElmCreateObjectFromData(ELM_OBJECT_TYPE type, void *data, int size)
-{
- return _create_object_from_data(type, data, size);
-}
-
-/*!
- @abstract Destroy an ELM object.
-
- @discussion
- This function is to release all internal resource inside Elementary libary belonging to this object.
- Applicatoin need make sure the object is not being used by elmentary library any more when calling this function.
- If an EBO is being destroyed and it's attached to one EVO, it need to guarantee that EVO is not being used by elementary library too.
-
- @param object
- The object handle
-
- @return
- If destroying is completed successfully.
- */
-BOOL ElmDestroyObject(ElmHandle object)
-{
- int result = destroy_object(object);
- return (result >= 0);
-}
-
-/*!
- @abstract Rotate a graphics object with centain degree
-
- @discussion
- This function sets an evo/ebo/ego object rotated with specified angle. Without reset, these setting will be
- accumulated.
-
- @param obj
- The graphics object will be rotated.
-
- @param angle
- A radian value to be applied on the evo object.
-
- @return bool
- Rotate is set successfully.
- */
-BOOL ElmRotate(ElmHandle obj, float angle)
-{
- return _rotate(obj, angle);
-}
-
-/*!
- @abstract Transfer an graphics object at different directions.
-
- @discussion
- This function put an evo/ebo/ego object away at different directions. Without reset, the setting will be
- accumulated.
-
- @param obj
- The graphics object will be transfered.
-
- @param x
- The units in pixel of X direction.
-
- @param y
- The units in pixel of Y direction.
-
- @return bool
- Transfer is set successfully.
- */
-BOOL ElmTransfer(ElmHandle obj, int x, int y)
-{
- return _translate(obj, x, y);
-}
-
-/*!
- @abstract Scale an graphics object at different directions.
-
- @discussion
- This function scale up or down an evo/ego/ebo object at different directions. Without reset, the setting will
- be accumateled.
-
- @param obj
- The graphics object which is targeted to manipulate.
-
- @param x
- The scale ratio in X direction.
-
- @param y
- The scale ratio in Y direction.
-
- @return bool
- Scale is set succefully.
- */
-BOOL ElmScale(ElmHandle obj, float x, float y)
-{
- return _scale(obj, x, y);
-}
-
-/*!
- @abstract Reset the attribute of a graphics object for specified property bit.
-
- @discussion
- This funcion resets specified property for an elementary object. It can be applied all types of objects.
- But some properties are only valid for centain types of objects. If the function is called to reset an invalid
- property for this type of object, it will be siliently ignored.
- After reset, the specifed property of an evo/ebo/ego object is set to the initial state. The initial states are decided
- by the binary resource file. The resource creator should set right value for all properties if they want to directly render
- the object without any adjustment in application. There is one issue, at present, application has no way to query current value
- of each property, is it required?
-
- @param obj
- The graphics object which is targeted to manipulate.
-
- @param mask
- Specify which property or properties need to reset to initial value.
-
- @return bool
- Reset is done successfully. If some mask is not valid for this type of object, it would return false.
- */
-BOOL ElmReset(ElmHandle obj, ELM_EVO_PROP_BIT mask)
-{
- return _reset_attrib(obj, mask);
-}
-
-/*!
- @abstract Set the rendering quality of an graphics object.
-
- @discussion
- This function sets the rendering quality of an evo/ebo object. Avaliable quality setting contains:
- ELM_EVO_QUALITY_LOW, ELM_EVO_QUALITY_MED, ELM_EVO_QUALITY_HI. This function is only applied to an evo or an ebo.
- Group object can't be set quality. It always use the setting from its binary.
-
- @param obj
- The elementary object.
-
- @param quality
- The quality enum.
-
- @return bool
- The operation for this object is sucessful, for group object and invalid enum, would return false.
- */
-BOOL ElmSetQuality(ElmHandle obj, ELM_QUALITY quality)
-{
- return _set_quality(obj, quality);
-}
-
-/*!
- @abstract Set the fill rule of an evo object.
-
- @discussion
- This function sets the fill rule of an elementary object. Avaliable quality setting contains:
- ELM_EVO_EO, ELM_EVO_NZ. It only applies to evo object.
-
- @param evo
- The evo object.
-
- @param fill
- The fill rule enum.
-
- @return bool
- The operation for this evo is sucessful. For non-evo object an ENUM is not a valid enum, would return false.
- */
-BOOL ElmSetFill(ElmVecObj evo, ELM_EVO_FILL fill)
-{
- return _set_fill(evo, fill);
-}
-
-/*!
- @abstract Set the blending mode of an evo/ebo object.
-
- @discussion
- This function sets the blending mode of an evo/ebo object. It's not applied to group object.
-
- @param obj
- The graphics object.
-
- @param blend
- The blending mode enum.
-
- @return bool
- The operation for this evo/ebo is sucessful. If object is a group object or blend mode is not a legal one, it would return false.
- */
-BOOL ElmSetBlend(ElmHandle obj, ELM_BLEND blend)
-{
- return _set_blend(obj, blend);
-}
-
-/*!
- @abstract Set the solid fill color of an evo object.
-
- @discussion
- This function sets the solid fill color of an evo object.
-
- @param evo
- The evo object.
-
- @param color
- The uint32 color value in rgba order.
-
- @return bool
- The operation for this evo is sucessful. If the object is not a evo object, it would return false.
- */
-BOOL ElmSetColor(ElmVecObj evo, uint32_t color)
-{
- return _set_color(evo, color);
-}
-
-/*!
- @abstract Set the image paint fill of an evo.
-
- @discussion
- This function sets the image pattern for filling an evo. The image pattern
- is a loaded ebo. The ebo's transformation is applied when drawing the evo.
-
- @param evo
- The evo object.
-
- @param pattern
- The image pattern to be set for the evo.
-
- @return bool
- The operation is successful or not.
- */
-BOOL ElmSetPattern(ElmVecObj evo, ElmBitmapObj pattern)
-{
- return _set_pattern(evo, pattern);
-}
-
-/*!
- @abstract Set the image paint fill of an evo.
-
- @discussion
- This function sets the image pattern for filling an evo. The image pattern
- is a loaded ebo. The ebo's transformation is applied when drawing the evo.
-
- @param evo
- The evo object.
-
- @param pattern
- The image pattern to be set for the evo.
-
- @return bool
- The operation is successful or not.
- */
-BOOL ElmSetPatternMode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color)
-{
- return _set_pattern_mode(evo, mode, color);
-}
-
-/*!
- @abstract Set the paint type of an evo.
-
- @discussion
- This function selects the paint type for evo to use. An evo may have 3 types
- of paint: COLOR, PATTERN, and LINEAR GRADIENT. The Linear graident is always
- a built-in resource, which can not be altered. If a binary resource doesn't
- have built-in gradient paint resource, it can't be selected as the paint source.
- Solid color is also a built-in attribute, but it can be changed by ElmSetColor().
- Paint with a pattern always need an external ebo object, which is impossible
- to be embedded in resource file,i.e. ebo object. Before select paint type to
- be PATTERN, ElmSetPattern() must be called to attach an EBO to an EVO.
-
- @param evo
- The evo object.
-
- @param type
- The paint type to be set for the evo.
-
- @return bool
- The operation is successful or not.
- If the corresponding type is not avaiable for the evo, it returns false and
- type paint type falls back to COLOR.
- */
-BOOL ElmSetPaintType(ElmVecObj evo, ELM_PAINT_TYPE type)
-{
- return _set_paintType(evo, type);
-}
-
-/*!
- @abstract Get the solid fill color of an evo object.
-
- @discussion
- This function Get the solid fill color of an evo object.
-
- @param evo
- The evo object.
-
- @return uint32_t
- The uint32 color value in rgba order.
- */
-BOOL ElmGetColor(ElmGroupObj handle,uint32_t *color)
-{
- elm_tls_t* elm_tls;
- el_Obj_EVO *evo;
-
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- el_Obj_Group *ego = (el_Obj_Group*) get_object(handle);
- evo = _get_evo(ego, elm_tls->gContext.vector_id);
- *color = evo->attribute.paint.color;
-
- return TRUE;
-}
-
-/*!
- @abstract Query the vectory path count of an EGO object. If the given object
- is an evo/ebo, the count is 0.
- */
-uint32_t ElmGetVectorCount(ElmHandle handle)
-{
- el_Obj_Group *ego = (el_Obj_Group*) get_object(handle);
- if (ego->object.type != ELM_OBJECT_TYPE_EGO) {
- return 0;
- }
- else {
- return ego->group.count;
- }
-}
-
-/*!
- @abstract Query the type of an object (by handle).
- */
-ELM_OBJECT_TYPE ElmGetObjectType(ElmHandle handle)
-{
- el_Object *object = get_object(handle);
- return object->type;
-}
-
-/*!
- @abstract Set the current vectory object index to operate on.
- */
-BOOL ElmSetCurrentVector(int32_t id)
-{
- elm_tls_t* elm_tls;
- elm_tls = (elm_tls_t *) elm_os_get_tls();
- if (elm_tls == NULL)
- return FALSE;
-
- elm_tls->gContext.vector_id = id;
-
- return TRUE;
-}
-
-BOOL ElmScalePaint(ElmHandle handle, float sx, float sy)
-{
- el_Transform *transform = NULL;
-
- transform = _get_paint_transform(handle);
-
- if (transform != NULL) {
- vg_lite_scale(sx, sy, &transform->matrix);
- transform->dirty = FALSE;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-BOOL ElmRotatePaint(ElmHandle handle, float degrees)
-{
- el_Transform *transform = NULL;
-
- transform = _get_paint_transform(handle);
-
- if (transform != NULL) {
- vg_lite_rotate(degrees, &transform->matrix);
- transform->dirty = FALSE;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-BOOL ElmTranslatePaint(ElmHandle handle, float tx, float ty)
-{
- el_Transform *transform = NULL;
-
- transform = _get_paint_transform(handle);
-
- if (transform != NULL) {
- vg_lite_translate(tx, ty, &transform->matrix);
- transform->dirty = FALSE;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
+/****************************************************************************
+*
+* Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include "elm_precom.h"
+#include "elm_os.h"
+#include "vg_lite_text.h"
+#include "vft_debug.h"
+#include "elm_headers.h"
+
+#if (VG_RENDER_TEXT==1)
+#include "elm_text.h"
+#endif /* VG_RENDER_TEXT */
+
+#if RTOS
+#define BASE_ADDRESS_ALIGNMENT 32
+#else
+#define BASE_ADDRESS_ALIGNMENT 4
+# endif
+/* #define ENABLE_ELM_CRATE_OBJECT_FROM_FILE */
+
+/*
+ * ANSI APIs are missing so application can use ElmCreateObjectFromData
+ * This simplifies things since file can be from FATFS, NOR Flash buffer etc.
+ */
+
+#if (RTOS && DDRLESS) || BAREMETAL
+/* Find some free objects, return the first index,
+ * and mark the bits as 1 (allocated).
+ * Params:
+ * free_map: the map bits of the objects where 0 is free and 1 is allocated;
+ * count : the element count of free_map[];
+ * obj_count:how many objects to allocate from the pool.
+ *
+ * Return:
+ * The free index of the object in the pool.
+ * */
+int get_free_objects(int32_t free_map[], int count, int obj_count)
+{
+ int i, j;
+ int result = -1;
+ int counter = 0;
+ int bit_count = 0;
+ int32_t bits;
+
+ /* Find a free bit. */
+ for (i = 0; i < count; i++) {
+ bits = free_map[i];
+
+ for (j = 0; j < 32; j++) {
+ //Increase the bit counter.
+ bit_count++;
+
+ if ((bits & 0x80000000) == 0) {
+ //Free bit is found. then count available free bits.
+ counter++;
+ }
+ else {
+ //Free bit is not found, reset the counter.
+ counter = 0;
+ }
+
+ //Check to see whether enough bits are found.
+ if (counter >= obj_count) {
+ result = bit_count - counter;
+
+ //Get out of the two loops.
+ i = count;
+ break;
+ }
+
+ //Shift to next bit.
+ bits <<= 1;
+ }
+ }
+
+ /* Mark the bits as allocated if OK. */
+ if (result > -1) {
+ int bits_set = 1;
+ int bit_offset = result % 32;
+ bit_count = result / 32;
+
+ while (obj_count > 0) {
+ bits_set = ~(0xffffffff << (32 - bit_offset));
+ if (obj_count <= 32 - bit_offset) {
+ //Done.
+ bits_set = bits_set & (0xffffffff << (32 - bit_offset - obj_count));
+ free_map[bit_count] |= bits_set;
+ break;
+ }
+ free_map[bit_count] |= bits_set;
+
+ //Go to next map element.
+ obj_count -= (32 - bit_offset);
+ bit_count++;
+ bit_offset = 0;
+ }
+ }
+
+ return result;
+}
+
+/* When an object is "freed", mark the corresponding bits to 0. */
+void mark_free_object(int32_t free_map[], int object)
+{
+ int index, offset;
+
+ index = object / 32;
+ offset = object % 32;
+
+ free_map[index] &= ~(1 << (31 - offset));
+}
+
+/* Check whether an object (with given index) allocated or not. */
+int object_exists(int32_t free_map[], int index)
+{
+ int32_t bits;
+ int offset = index % 32;
+ index /= 32;
+
+ bits = ~(1 << (31 - offset));
+
+ if (free_map[index] & bits) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/* Allocate an EVO object from pool. */
+static el_Obj_EVO * alloc_evo(int count)
+{
+ elm_tls_t* elm_tls;
+ int index;
+ el_Obj_EVO *object = NULL;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+ index = get_free_objects(elm_tls->gContext.objmap_evo, COUNT_OF(elm_tls->gContext.objmap_evo), count);
+
+ if (index > -1) {
+ object = &elm_tls->gContext.objpool_evo[index];
+ elm_tls->gContext.objcounter_evo += count;
+ for (; count > 0; count--) {
+ object[count - 1].object.index = index + count - 1;
+ }
+ }
+
+ return object;
+}
+
+/* Allocate an EBO object from pool. */
+static el_Obj_EBO * alloc_ebo()
+{
+ elm_tls_t* elm_tls;
+ int index;
+ el_Obj_EBO *object = NULL;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+ index = get_free_objects(elm_tls->gContext.objmap_ebo, COUNT_OF(elm_tls->gContext.objmap_ebo), 1);
+
+ if (index > -1) {
+ object = &elm_tls->gContext.objpool_ebo[index];
+ object->object.index = index;
+ elm_tls->gContext.objcounter_ebo++;
+ }
+
+ return object;
+}
+
+/* Allocate an EGO object from pool. */
+static el_Obj_Group * alloc_ego()
+{
+ elm_tls_t* elm_tls;
+ int index;
+ el_Obj_Group *object = NULL;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+ index = get_free_objects(elm_tls->gContext.objmap_group, COUNT_OF(elm_tls->gContext.objmap_group), 1);
+
+ if (index > -1) {
+ object = &elm_tls->gContext.objpool_group[index];
+ object->object.index = index;
+ elm_tls->gContext.objcounter_group++;
+ }
+
+ return object;
+}
+
+/* Mark an EGO object as free: insert it into the free list. */
+static void free_ego(el_Obj_Group *object)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+ mark_free_object(elm_tls->gContext.objmap_group, elm_tls->object->object.index);
+ elm_tls->gContext.objcounter_group--;
+}
+
+/* Allocate a grad object from pool. */
+static el_Obj_Grad * alloc_grad()
+{
+ elm_tls_t* elm_tls;
+ int index;
+ el_Obj_Grad *object = NULL;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+ index = get_free_objects(elm_tls->gContext.objmap_grad, COUNT_OF(elm_tls->gContext.objmap_grad), 1);
+
+ if (index > -1) {
+ object = &elm_tls->gContext.objpool_grad[index];
+ object->object.index = index;
+ elm_tls->gContext.objcounter_grad++;
+ }
+
+ return object;
+}
+
+#endif
+/* Internal Implementations *******************************/
+int deref_object(el_Object *object)
+{
+ object->reference--;
+ return object->reference;
+}
+
+int ref_object(el_Object *object)
+{
+ object->reference++;
+ return object->reference;
+}
+
+int add_object(el_Object *object)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return 0;
+#if (RTOS && DDRLESS) || BAREMETAL
+ /* Assign handle. */
+ object->handle = elm_tls->gContext.currentHandle++;
+ return 1;
+#else
+ int result = 1;
+ el_ObjList *list = NULL;
+
+ /* Assign handle. */
+ object->handle = elm_tls->gContext.currentHandle++;
+
+ /* Get the list slot. */
+ list = OBJECT_SLOT(object->handle);
+ if (list == NULL) {
+ list = (el_ObjList *) elm_alloc(1, sizeof(el_ObjList));
+ if ( list == NULL ) {
+ return 0; /* Memory allocation failed */
+ }
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(list, 0, sizeof(el_ObjList));
+#endif
+
+ OBJECT_SLOT(object->handle) = list;
+
+ list->object = object;
+ list->next = NULL;
+
+ return 1;
+ }
+
+ /* Insert the object. */
+ while (list->next != NULL) {
+ list = list->next;
+ }
+ list->next = (el_ObjList *) elm_alloc(1, sizeof(el_ObjList));
+ if ( list->next == NULL ) {
+ return 0; /* Memory allocation failed */
+ }
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(list->next, 0, sizeof(el_ObjList));
+#endif
+ list = list->next;
+ list->object = object;
+ list->next = NULL;
+
+ return result;
+#endif
+}
+
+int remove_object(el_Object *object)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return 0;
+
+ int result = 0;
+#if (!(RTOS && DDRLESS)) && (!BAREMETAL)
+ el_ObjList *list = NULL, *node = NULL;
+
+ // Get the list slot.
+ list = OBJECT_SLOT(object->handle);
+
+ // Invalid.
+ if (list == NULL)
+ return 0;
+
+ // Find the object.
+ if (list->object == object) {
+ OBJECT_SLOT(object->handle) = list->next;
+ elm_free(list);
+ return 1;
+ }
+
+ while (list->next != NULL) {
+ if (list->next->object == object) {
+ node = list->next;
+ list->next = list->next->next;
+ elm_free(node);
+ return 1;
+ }
+ list = list->next;
+ }
+#endif
+
+ return result;
+}
+
+el_Object *get_object(ElmHandle handle)
+{
+ elm_tls_t* elm_tls;
+ el_Object *object = NULL;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return NULL;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ int i;
+ for (i = 0; i < OBJCOUNT_EVO; i++) {
+ if (object_exists(elm_tls->gContext.objmap_evo, i)) {
+ if (elm_tls->gContext.objpool_evo[i].object.handle == handle) {
+ object = (el_Object *)&elm_tls->gContext.objpool_evo[i];
+ return object;
+ }
+ }
+ }
+ for (i = 0; i < OBJCOUNT_EBO; i++) {
+ if (object_exists(elm_tls->gContext.objmap_ebo, i)) {
+ if (elm_tls->gContext.objpool_ebo[i].object.handle == handle) {
+ object = (el_Object *)&elm_tls->gContext.objpool_ebo[i];
+ return object;
+ }
+ }
+ }
+ for (i = 0; i < OBJCOUNT_GRAD; i++) {
+ if (object_exists(elm_tls->gContext.objmap_grad, i)) {
+ if (elm_tls->gContext.objpool_grad[i].object.handle == handle) {
+ object = (el_Object *)&elm_tls->gContext.objpool_grad[i];
+ return object;
+ }
+ }
+ }
+ for (i = 0; i < OBJCOUNT_GROUP; i++) {
+ if (object_exists(elm_tls->gContext.objmap_group, i)) {
+ if (elm_tls->gContext.objpool_group[i].object.handle == handle) {
+ object = (el_Object *)&elm_tls->gContext.objpool_group[i];
+ return object;
+ }
+ }
+ }
+#else
+ el_ObjList *list = NULL;
+
+ // Get the slot.
+ list = OBJECT_SLOT(handle);
+
+ // Find the object.
+ while (list != NULL) {
+ if ((list->object != NULL) &&
+ (list->object->handle == handle)) {
+ object = list->object;
+ return object;
+ }
+ list = list->next;
+ }
+#endif
+
+ DEBUG_ASSERT(0, "Unknown object");
+ return NULL;
+}
+
+#if (RTOS && DDRLESS) || BAREMETAL
+static void free_grad(el_Obj_Grad *object)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls != NULL) {
+ mark_free_object(elm_tls->gContext.objmap_grad, object->object.index);
+ elm_tls->gContext.objcounter_grad--;
+ }
+}
+#endif
+
+/* Destroy an evo object data. */
+int destroy_evo(el_Obj_EVO *evo)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return 0;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ mark_free_object(elm_tls->gContext.objmap_evo, evo->object.index);
+ elm_tls->gContext.objcounter_evo--;
+ free_grad(evo->defaultAttrib.paint.grad);
+#else
+
+ if ( evo->defaultAttrib.paint.type == ELM_PAINT_TEXT ) {
+#if (VG_RENDER_TEXT==1)
+ _unload_text(evo);
+#else
+ ;
+#endif /* VG_RENDER_TEXT */
+ } else {
+ /* TODO: EVO destroy not done yet. */
+ if (evo->defaultAttrib.paint.grad != NULL) {
+ vg_lite_clear_grad(&evo->defaultAttrib.paint.grad->data.grad);
+ elm_free(evo->defaultAttrib.paint.grad);
+ evo->defaultAttrib.paint.grad = NULL;
+ }
+
+ if (evo->data.path.path != NULL) {
+ vg_lite_clear_path(&evo->data.path);
+ elm_free(evo->data.path.path);
+ evo->data.path.path = NULL;
+ }
+ }
+
+ remove_object(&evo->object);
+#endif
+
+#if (VG_RENDER_TEXT==1)
+ destroy_font_data();
+#endif /* VG_RENDER_TEXT */
+ return 1;
+}
+
+/* Destroy an ego object data. */
+int destroy_ego(el_Obj_Group *ego)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if(elm_tls == NULL)
+ return 0;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ mark_free_object(elm_tls->gContext.objmap_group, ego->object.index);
+ elm_tls->gContext.objcounter_group--;
+#else
+ int i;
+ for (i = 0; i < ego->group.count; i++)
+ {
+ destroy_evo(&ego->group.objects[i]);
+ }
+ elm_free(ego->group.objects);
+ elm_free(ego);
+#endif
+
+#if (VG_RENDER_TEXT==1)
+ destroy_font_data();
+#endif /* VG_RENDER_TEXT */
+ return 1;
+}
+
+/* Destroy an ebo object data. */
+int destroy_ebo(el_Obj_EBO *ebo)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if(elm_tls == NULL)
+ return 0;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ mark_free_object(elm_tls->gContext.objmap_ebo, ebo->object.index);
+ elm_tls->gContext.objcounter_ebo--;
+#else
+ if ( ebo != NULL && ebo->data.buffer.handle != NULL) {
+ vg_lite_free(&ebo->data.buffer);
+ }
+ elm_free(ebo);
+#endif
+ return 1;
+}
+
+/* Destroy an object.
+ return:
+ -1: any error;
+ 0: destroyed when reference count is 0;
+ 1: decreased reference count but still > 0.
+ */
+int destroy_object(ElmHandle handle)
+{
+ el_Object *object = NULL;
+ int ref_count = 0;
+
+ object = get_object(handle);
+
+ // No such object.
+ if (object == NULL) {
+ DEBUG_ASSERT(0, "No such object");
+ return -1;
+ }
+
+ // Dereference object, and destroy if it's no more referred.
+ ref_count = deref_object(object);
+ if (ref_count == 0) {
+ remove_object(object);
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EVO:
+ destroy_evo((el_Obj_EVO *)object);
+ elm_free(object);
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ destroy_ego((el_Obj_Group *) object);
+ break;
+
+ case ELM_OBJECT_TYPE_EBO:
+ destroy_ebo((el_Obj_EBO *) object);
+ break;
+
+ default:
+ DEBUG_ASSERT(0, "Unknow object type");
+ break;
+ }
+ }
+
+ return 1;
+}
+
+void _init_transform(el_Transform *transform)
+{
+ int i = 0;
+ transform->rotate = 0.0f;
+ for (i = 0;i < 2; i++)
+ {
+ transform->scale[i] = 1.0f;
+ transform->translate[i] = 0.0f;
+ }
+ vg_lite_identity(&transform->matrix);
+}
+
+/* Static functions. *************************************************/
+
+/* Get the specified vector object in a group. */
+static el_Obj_EVO* _get_evo(el_Obj_Group *group, int32_t id)
+{
+ if ((id >= group->group.count) ||
+ (id < 0)){
+ return (el_Obj_EVO*)NULL;
+ }
+ else {
+ return (el_Obj_EVO*)(group->group.objects + id);
+ }
+}
+
+#if (VG_RENDER_TEXT==1)
+static int _load_font(uint8_t *data,
+ unsigned size)
+{
+ ElmHandle ret = ELM_NULL_HANDLE;
+ el_Font_Header *font_header = (el_Font_Header *)data;
+
+
+ if (font_header->size_font_block != size)
+ return ret;
+
+ return _load_font_data(data);
+}
+
+static ElmHandle _load_text(uint8_t *data,
+ unsigned size,
+ el_Obj_EVO *evo)
+{
+ ElmHandle ret = ELM_NULL_HANDLE;
+ el_Text_Header *text_header = (el_Text_Header *)data;
+
+
+ if (text_header->size_text_block != size)
+ return ret;
+
+ return _load_text_data(data, evo);
+}
+#endif /* VG_RENDER_TEXT */
+
+#if (defined(__ICCARM__))
+/*
+ * Disable the unaligned structure attribute warning. Due to the packed data
+ * structures used to interpret ELM objects data the IAR compiler issues a
+ * number of warnings that certain attributes of the headers might be unaligned.
+ * This is not true, however, as all atributes are manually aligned to 4 bytes.
+ */
+#pragma diag_suppress = Pa039
+#endif
+
+static ElmHandle _load_evo(const uint8_t *data, unsigned size, el_Obj_EVO *evo)
+{
+ int i = 0;
+#if (RTOS && DDRLESS) || BAREMETAL
+ uint32_t colors[VLC_MAX_GRAD];
+ void *path_data;
+#else
+ uint32_t *colors = NULL;
+ uint8_t *path_data = NULL;
+#endif
+ el_Obj_EVO *local_evo = NULL;
+ el_EVO_Header *evo_header = (el_EVO_Header *) data;
+
+ if (evo == NULL) {
+#if (RTOS && DDRLESS) || BAREMETAL
+ local_evo = alloc_evo(1);
+#else
+ local_evo = (el_Obj_EVO *)elm_alloc(1, sizeof(el_Obj_EVO));
+#endif
+ evo = local_evo;
+ }
+ JUMP_IF_NULL(evo, error_exit);
+ memset(evo, 0, sizeof(el_Obj_EVO));
+
+ /*
+ * Check if object size is valid. The size parameter
+ * needs to be a value greater or equal to the
+ * size of the current object to be loaded.
+ * This check needs to be done in order to ensure
+ * that the is_image field is correctly read and
+ * we do not read from invalid memory.
+ */
+ JUMP_IF_LOWER(size,
+ MIN(sizeof(el_EVO_Polygon), sizeof(el_EVO_Image)),
+ error_exit);
+
+ if(evo_header->polygon.paint_type.is_image)
+ {
+ /*
+ * Check if object size is valid
+ * (greater or equal to el_EVO_Image size).
+ */
+ JUMP_IF_LOWER(size,
+ sizeof(el_EVO_Image),
+ error_exit);
+ memcpy(evo->eboname,
+ evo_header->image.eboname,
+ evo_header->image.namelength);
+ evo->is_image = evo_header->image.paint_type.is_image;
+ _init_transform(&evo->defaultAttrib.transform);
+ memcpy(&evo->defaultAttrib.transform.matrix,
+ &(evo_header->image.matrix),
+ sizeof(vg_lite_matrix_t));
+ evo->img_width = evo_header->image.width;
+ evo->img_height = evo_header->image.height;
+ }
+ else
+ {
+ /*
+ * Check if object size is valid
+ * (greater or equal to el_EVO_Polygon size).
+ */
+ JUMP_IF_LOWER(size,
+ sizeof(el_EVO_Polygon),
+ error_exit);
+ el_Transform *transform = NULL;
+ el_Transform *grad_transform = NULL;
+ el_EVO_Polygon *object_data = (el_EVO_Polygon *) &(evo_header->polygon);
+ el_EVO_GradData *grad_data = (el_EVO_GradData *) &(evo_header->polygon.grad);
+
+ /* Get path data from the object. */
+#if (RTOS && DDRLESS) || BAREMETAL
+ path_data = (void *) (data + object_data->offset);
+#else
+ path_data = (uint8_t *)elm_alloc(1, object_data->length);
+ JUMP_IF_NULL(path_data, error_exit);
+
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(path_data, 0, object_data->length);
+#endif
+ JUMP_IF_LOWER(size,
+ object_data->offset + object_data->length,
+ error_exit);
+ /* Get path data. */
+ memcpy(path_data, (void *)(data + object_data->offset),
+ object_data->length);
+#endif
+
+ if(object_data->paint_type.has_pattern)
+ evo->has_pattern = 1;
+ if(object_data->paint_type.is_pattern)
+ evo->is_pattern = 1;
+
+ _init_transform(&evo->defaultAttrib.transform);
+ transform = &evo->defaultAttrib.transform;
+
+ evo->object.type = ELM_OBJECT_TYPE_EVO;
+ evo->object.reference = 0;
+
+ if ((object_data->paint_type.paint == ELM_PAINT_RADIAL_GRADIENT) ||
+ (object_data->paint_type.paint == ELM_PAINT_GRADIENT)) {
+#if (RTOS && DDRLESS) || BAREMETAL
+ evo->defaultAttrib.paint.grad = alloc_grad();
+#else
+ evo->defaultAttrib.paint.grad = (el_Obj_Grad*)elm_alloc(1, sizeof(el_Obj_Grad));
+#endif
+ JUMP_IF_NULL(evo->defaultAttrib.paint.grad, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(evo->defaultAttrib.paint.grad, 0, sizeof(el_Obj_Grad));
+#endif
+ evo->defaultAttrib.paint.grad->data.grad.image.width = 0;
+ evo->defaultAttrib.paint.grad->data.grad.image.height = 0;
+ evo->defaultAttrib.paint.grad->data.grad.image.stride = 0;
+ evo->defaultAttrib.paint.grad->data.grad.image.tiled = VG_LITE_LINEAR;
+
+ _init_transform(&evo->defaultAttrib.paint.grad->data.transform);
+ grad_transform = &evo->defaultAttrib.paint.grad->data.transform;
+ memcpy(&grad_transform->matrix, &(grad_data->matrix),
+ sizeof(vg_lite_matrix_t));
+ colors = (uint32_t *)elm_alloc(grad_data->stop_count, sizeof(uint32_t));
+ JUMP_IF_NULL(colors, error_exit);
+ memcpy(colors,
+ data + grad_data->color_offset,
+ grad_data->stop_count * sizeof(uint32_t));
+ }
+
+ if (object_data->arc_flag)
+ vg_lite_init_arc_path(&evo->data.path,
+ (vg_lite_format_t) object_data->format,
+ (vg_lite_quality_t) object_data->quality,
+ object_data->length,
+ path_data,
+ object_data->min_x,
+ object_data->min_y,
+ object_data->max_x,
+ object_data->max_y);
+ else
+ vg_lite_init_path(&evo->data.path,
+ (vg_lite_format_t) object_data->format,
+ (vg_lite_quality_t) object_data->quality,
+ object_data->length,
+ path_data,
+ object_data->min_x,
+ object_data->min_y,
+ object_data->max_x,
+ object_data->max_y);
+
+ memcpy(&transform->matrix, &(object_data->matrix), sizeof(vg_lite_matrix_t));
+
+ evo->defaultAttrib.quality = ELM_QUALITY_LOW;
+ evo->defaultAttrib.fill_rule = (ELM_EVO_FILL) object_data->fill_rule;
+ evo->defaultAttrib.blend = (ELM_BLEND) object_data->blend;
+ evo->defaultAttrib.paint.type = (ELM_PAINT_TYPE) object_data->paint_type.paint;
+
+ switch (object_data->paint_type.paint) {
+ case ELM_PAINT_GRADIENT:
+ {
+#if (RTOS && DDRLESS) || BAREMETAL
+ uint32_t stops[VLC_MAX_GRAD];
+#else
+ uint32_t *stops = NULL;
+
+ stops = (uint32_t *)elm_alloc(sizeof(uint32_t), grad_data->stop_count);
+ JUMP_IF_NULL(stops, error_exit);
+#endif
+ for (i = 0 ;i < grad_data->stop_count; i++)
+ {
+ stops[i] = (uint32_t)((*(float *) (data +
+ grad_data->stop_offset + i * 4)) * 255);
+ }
+
+ vg_lite_init_grad(&evo->defaultAttrib.paint.grad->data.grad);
+ vg_lite_set_grad(&evo->defaultAttrib.paint.grad->data.grad,
+ grad_data->stop_count, colors, stops);
+ if (grad_data->stop_count > 0)
+ {
+ vg_lite_update_grad(&evo->defaultAttrib.paint.grad->data.grad);
+ }
+#if (RTOS && DDRLESS) || BAREMETAL
+#else
+ elm_free(stops);
+#endif
+ break;
+ }
+ case ELM_PAINT_RADIAL_GRADIENT:
+ {
+ float *stops;
+ vg_lite_color_ramp_t *vgColorRamp;
+ el_EVO_RadGradDataExt *rad_grad = (el_EVO_RadGradDataExt *) (data + sizeof(el_EVO_Header));
+
+ JUMP_IF_LOWER(size,
+ sizeof(el_EVO_Polygon) + sizeof(el_EVO_RadGradDataExt),
+ error_exit);
+
+ stops = (float *)elm_alloc(grad_data->stop_count, sizeof(float));
+ JUMP_IF_NULL(stops, error_exit);
+ memset(stops, 0, grad_data->stop_count * sizeof(float));
+ vgColorRamp = (vg_lite_color_ramp_t *) elm_alloc(grad_data->stop_count,
+ sizeof(vg_lite_color_ramp_t));
+ if (vgColorRamp == NULL) {
+ elm_free(stops);
+ goto error_exit;
+ }
+ memset(vgColorRamp, 0,
+ sizeof(vg_lite_color_ramp_t) * grad_data->stop_count);
+ for (i = 0; i < grad_data->stop_count; i++)
+ {
+ stops[i] = (*(float *) (data + grad_data->stop_offset + i * 4));
+ vgColorRamp[i].alpha = (float)(colors[i] >> 24) / 255.0f;
+ vgColorRamp[i].red = (float)(colors[i] >> 16 & 0xFF) / 255.0f;
+ vgColorRamp[i].green = (float)(colors[i] >> 8 & 0xFF) / 255.0f;
+ vgColorRamp[i].blue = (float)(colors[i] & 0xFF) / 255.0f;
+ vgColorRamp[i].stop = stops[i];
+ }
+
+ memset(&evo->defaultAttrib.paint.radgrad->data.rad_grad, 0, sizeof(evo->defaultAttrib.paint.radgrad->data.rad_grad));
+ vg_lite_set_rad_grad(&evo->defaultAttrib.paint.radgrad->data.rad_grad,
+ grad_data->stop_count,
+ vgColorRamp,
+ rad_grad->params,
+ rad_grad->spread_mode,
+ 0);
+ vg_lite_update_rad_grad(&evo->defaultAttrib.paint.radgrad->data.rad_grad);
+
+ elm_free(stops);
+ elm_free(vgColorRamp);
+ break;
+ }
+ default:
+ /* Do nothing */
+ break;
+ }
+
+ evo->defaultAttrib.paint.color = object_data->color;
+ evo->attribute = evo->defaultAttrib;
+ ref_object(&evo->object);
+ JUMP_IF_NON_ZERO_VALUE(add_object(&evo->object), error_exit);
+
+#if (RTOS && DDRLESS) || BAREMETAL
+#else
+ elm_free(colors);
+#endif
+ }
+
+ return evo->object.handle;
+
+error_exit:
+#if (RTOS && DDRLESS) || BAREMETAL
+#else
+ if ( colors != NULL )
+ elm_free(colors);
+ if ( path_data != NULL)
+ elm_free(path_data);
+#endif
+
+ if ( (evo != NULL) && (evo->defaultAttrib.paint.grad != NULL) )
+ elm_free(evo->defaultAttrib.paint.grad);
+ if ( (evo != NULL) && (evo->defaultAttrib.paint.radgrad != NULL) )
+ elm_free(evo->defaultAttrib.paint.radgrad);
+ if ( local_evo != NULL )
+ elm_free(local_evo);
+
+ return ELM_NULL_HANDLE;
+}
+
+static ElmHandle _load_ebo(const uint8_t *data, int size, uint32_t version)
+{
+ vg_lite_error_t error;
+ vg_lite_buffer_t *buffer;
+ uint32_t *colors, bytes = 0;
+
+ el_EBO_Header *ebo_header = (el_EBO_Header *) data;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ el_Obj_EBO *ebo = alloc_ebo();
+#else
+ el_Obj_EBO *ebo = (el_Obj_EBO *)elm_alloc(1, (sizeof(el_Obj_EBO)));
+#endif
+ JUMP_IF_NULL(ebo, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(ebo, 0, sizeof(el_Obj_EBO));
+#endif
+ buffer = &ebo->data.buffer;
+
+ /*
+ * Check if object size is valid. "size" needs to be a value greater than or
+ * equal to the size of the current object header.
+ */
+ JUMP_IF_LOWER(size, sizeof(el_EBO_Header), error_exit);
+ bytes += sizeof(el_EBO_Header);
+
+ if(version == 1)
+ {
+ el_EBO_Palette *clut_header = (el_EBO_Palette *) (data + sizeof(el_EBO_Header));
+
+ /* Make sure object size includes the CLUT header */
+ bytes += sizeof(el_EBO_Palette);
+ JUMP_IF_LOWER(size, bytes, error_exit);
+
+ ebo->object.type = (ELM_OBJECT_TYPE) ebo_header->type;
+ ebo->object.reference = 0;
+
+ buffer->width = ebo_header->width;
+ buffer->height = ebo_header->height;
+ buffer->format = (vg_lite_buffer_format_t) ebo_header->format;
+ buffer->stride = 0;
+
+ error = vg_lite_allocate(buffer);
+ if (error != VG_LITE_SUCCESS)
+ {
+ destroy_ebo(ebo);
+ return 0;
+ }
+
+ buffer->stride = ebo_header->stride;
+ buffer->tiled = (vg_lite_buffer_layout_t) ebo_header->tiled;
+ colors = (uint32_t *)(data + clut_header->clut_data_offset);
+
+ /* Make sure the object size includes image data */
+ JUMP_IF_LOWER(size,
+ ebo_header->data_offset +
+ (buffer->stride * buffer->height),
+ error_exit);
+
+ memcpy(buffer->memory,
+ data + ebo_header->data_offset,
+ buffer->stride * buffer->height);
+
+ /* Save CLUT infomation. */
+ ebo->clut_count = clut_header->clut_count;
+
+ /* Make sure object size includes CLUT data */
+ JUMP_IF_LOWER(size,
+ clut_header->clut_data_offset +
+ (sizeof(uint32_t) * clut_header->clut_count),
+ error_exit);
+
+ memcpy(ebo->clut, colors, sizeof(uint32_t) * clut_header->clut_count);
+ }
+ else if(version == 2)
+ {
+ ebo->object.type = (ELM_OBJECT_TYPE) ebo_header->type;
+ ebo->object.reference = 0;
+
+ buffer->width = ebo_header->width;
+ buffer->height = ebo_header->height;
+ buffer->format = (vg_lite_buffer_format_t) ebo_header->format;
+ buffer->stride = 0;
+
+ error = vg_lite_allocate(buffer);
+ if (error != VG_LITE_SUCCESS)
+ {
+ destroy_ebo(ebo);
+ return 0;
+ }
+
+ buffer->stride = ebo_header->stride;
+ buffer->tiled = (vg_lite_buffer_layout_t) ebo_header->tiled;
+
+ /* Make sure the object size includes image data */
+ JUMP_IF_LOWER(size,
+ ebo_header->data_offset +
+ (buffer->stride * buffer->height),
+ error_exit);
+
+ memcpy(buffer->memory,
+ data + ebo_header->data_offset,
+ buffer->stride * buffer->height);
+ }
+ /* Set transformation to identity. */
+ ebo->defaultAttrib.transform.dirty = 1;
+ ebo->defaultAttrib.transform.identity = 1;
+
+ _init_transform(&ebo->defaultAttrib.transform);
+ ebo->attribute = ebo->defaultAttrib;
+
+ ref_object(&ebo->object);
+ JUMP_IF_NON_ZERO_VALUE(add_object(&ebo->object), error_exit);
+
+ return ebo->object.handle;
+
+error_exit:
+ if (ebo != NULL ) {
+ elm_free(ebo);
+ }
+
+ return ELM_NULL_HANDLE;
+}
+
+static ElmHandle _load_ego(const uint8_t *data, int size)
+{
+ int i;
+ unsigned int invalid_count = 0;
+ uint32_t *obj_size, *obj_offset, *obj_type;
+ void *obj_data;
+ el_EGO_Header *ego_header = (el_EGO_Header *) data;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ el_Obj_Group *ego = alloc_ego();
+#else
+ el_Obj_Group *ego = (el_Obj_Group *)elm_alloc(1, sizeof(el_Obj_Group));
+#endif
+ JUMP_IF_NULL(ego, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(ego, 0, sizeof(el_Obj_Group));
+#endif
+
+ ego->object.type = (ELM_OBJECT_TYPE) ego_header->type;
+ ego->object.reference = 0;
+
+ _init_transform(&ego->defaultTrans);
+ memcpy(&(ego->defaultTrans.matrix.m),
+ &(ego_header->matrix),
+ sizeof(vg_lite_matrix_t));
+ ego->group.count = ego_header->count;
+#if (RTOS && DDRLESS) || BAREMETAL
+ ego->group.objects = alloc_evo(ego->group.count);
+#else
+ ego->group.objects = (el_Obj_EVO *)elm_alloc(1, ego->group.count * sizeof(el_Obj_EVO));
+#endif
+ JUMP_IF_NULL(ego->group.objects, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(ego->group.objects, 0, ego->group.count * sizeof(el_Obj_EVO));
+#endif
+
+ obj_size = (uint32_t *)((unsigned)data + sizeof(el_EGO_Header));
+ obj_offset = (uint32_t *)((unsigned)obj_size + \
+ (ego_header->count * sizeof(uint32_t)));
+
+ for (i = 0; i < ego->group.count && obj_offset[i] < size; i++)
+ {
+ if (obj_size[i] == 0) {
+ invalid_count++;
+ continue;
+ }
+
+ /* Check whether EVO object is truncated */
+ JUMP_IF_GREATER(obj_offset[i] + obj_size[i], size, error_exit);
+
+ /* Call appropriate object loader according to object type */
+ obj_data = (void*)((unsigned)data + obj_offset[i]);
+ obj_type = obj_data;
+ switch (*obj_type) {
+ case ELM_OBJECT_TYPE_EVO:
+ ego->group.objects[i].object.handle = _load_evo(obj_data,
+ obj_size[i],
+ &ego->group.objects[i]);
+ break;
+#if (VG_RENDER_TEXT==1)
+ case ELM_OBJECT_TYPE_FONT:
+ _load_font(obj_data, obj_size[i]);
+ break;
+ case ELM_OBJECT_TYPE_TEXT:
+ ego->group.objects[i].object.handle = _load_text(obj_data,
+ obj_size[i],
+ &ego->group.objects[i]);
+ break;
+#endif /* VG_RENDER_TEXT */
+ default:
+ break;
+ }
+ }
+
+ ego->group.count -= invalid_count;
+ ego->transform = ego->defaultTrans;
+
+ ref_object(&ego->object);
+ JUMP_IF_NON_ZERO_VALUE(add_object(&ego->object), error_exit);
+
+ return ego->object.handle;
+
+error_exit:
+ if (ego != NULL ) {
+ if ( ego->group.objects != NULL ) {
+ elm_free(ego->group.objects);
+ }
+ elm_free(ego);
+ }
+
+ return ELM_NULL_HANDLE;
+}
+
+#if (defined(__ICCARM__))
+/* Restore the unaligned data structure attribute warning */
+#pragma diag_default = Pa039
+#endif
+
+static BOOL _scale(ElmHandle obj, float x, float y)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *ego = NULL;
+ el_Transform *transform = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ transform = &ebo->attribute.transform;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ ego = (el_Obj_Group *)object;
+ if (elm_tls->gContext.vector_id < 0) {
+ transform = &ego->transform;
+ }
+ else {
+ evo = _get_evo(ego, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ transform = &evo->attribute.transform;
+ }
+ else { /* No such vector object to set. */
+ return FALSE;
+ }
+ }
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ transform = &evo->attribute.transform;
+ break;
+
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ break;
+ }
+
+ // Update the transformation params.
+ transform->scale[0] *= x;
+ transform->scale[1] *= y;
+
+ vg_lite_scale(x, y, &transform->matrix);
+
+ // Clean dirty.
+ transform->dirty = FALSE;
+
+ return TRUE;
+}
+
+static BOOL _reset_attrib(ElmHandle obj, ELM_EVO_PROP_BIT mask)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *ego = NULL;
+ el_Attribute *attrib = NULL;
+ el_Attribute *defaultAttr = NULL;
+ el_Transform *transform = NULL;
+ el_Transform *defaultTrans = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ attrib = &ebo->attribute;
+ defaultAttr = &ebo->defaultAttrib;
+ transform = &attrib->transform;
+ defaultTrans = &defaultAttr->transform;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ ego = (el_Obj_Group *)object;
+ if (elm_tls->gContext.vector_id < 0) {
+ transform = &ego->transform;
+ defaultTrans = &ego->defaultTrans;
+ }
+ else {
+ evo = _get_evo((el_Obj_Group*)obj, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ attrib = &evo->attribute;
+ defaultAttr = &evo->defaultAttrib;
+ transform = &attrib->transform;
+ defaultTrans = &defaultAttr->transform;
+ }
+ else {
+ return FALSE;
+ }
+ }
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ attrib = &evo->attribute;
+ defaultAttr = &evo->defaultAttrib;
+ transform = &attrib->transform;
+ defaultTrans = &defaultAttr->transform;
+ break;
+
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ return FALSE;
+ break;
+ }
+
+ // Update the attribute value. When transform is modified, update the matrix.
+ if (mask & ELM_PROP_ROTATE_BIT) {
+ transform->rotate = defaultTrans->rotate;
+ }
+
+ if (mask & ELM_PROP_TRANSFER_BIT) {
+ transform->translate[0] = defaultTrans->translate[0];
+ transform->translate[1] = defaultTrans->translate[1];
+ }
+
+ if (mask & ELM_PROP_SCALE_BIT) {
+ transform->scale[0] = defaultTrans->scale[0];
+ transform->scale[1] = defaultTrans->scale[1];
+ }
+
+ /* On any bit reset, reset the whole matrix to the default one. */
+ if (mask & (ELM_PROP_ROTATE_BIT | ELM_PROP_TRANSFER_BIT | ELM_PROP_SCALE_BIT)) {
+ memcpy(&(transform->matrix), &(defaultTrans->matrix), sizeof(defaultTrans->matrix));
+ transform->dirty = FALSE;
+ }
+
+ /* Update other rendering attributes. */
+ if (mask & ELM_PROP_BLEND_BIT) {
+ attrib->blend = defaultAttr->blend;
+ }
+
+ if (mask & ELM_PROP_QUALITY_BIT) {
+ attrib->quality = defaultAttr->quality;
+ }
+
+ if (mask & ELM_PROP_FILL_BIT) {
+ attrib->fill_rule = defaultAttr->fill_rule;
+ }
+
+ if (mask & ELM_PROP_COLOR_BIT) {
+ attrib->paint.color = defaultAttr->paint.color;
+ }
+
+ if (mask & ELM_PROP_PAINT_BIT) {
+ attrib->paint.type = defaultAttr->paint.type;
+ }
+
+ return TRUE;
+}
+
+static BOOL _set_quality(ElmHandle obj, ELM_QUALITY quality)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *group = NULL;
+ el_Attribute *attrib = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ attrib = &ebo->attribute;
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ attrib = &evo->attribute;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ evo = _get_evo(group, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ attrib = &evo->attribute;
+ }
+ else {
+ return FALSE;
+ }
+ break;
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ return FALSE;
+ break;
+ }
+
+ attrib->quality = quality;
+
+ return TRUE;
+}
+
+static BOOL _set_fill(ElmVecObj evo, ELM_EVO_FILL fill)
+{
+ el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
+
+ if (object == NULL) {
+ DEBUG_ASSERT(0, "Bad object handle");
+ return FALSE;
+ }
+
+ object->attribute.fill_rule = fill;
+
+ return TRUE;
+}
+
+static BOOL _set_blend(ElmHandle obj, ELM_BLEND blend)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *group = NULL;
+ el_Attribute *attrib = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ attrib = &ebo->attribute;
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ attrib = &evo->attribute;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ evo = _get_evo(group, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ attrib = &evo->attribute;
+ }
+ else {
+ return FALSE;
+ }
+ break;
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ return FALSE;
+ break;
+ }
+
+ attrib->blend = blend;
+
+ return TRUE;
+}
+
+static BOOL _set_color(ElmVecObj evo, uint32_t color)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
+ el_Obj_Group *group = NULL;
+
+ if (object == NULL) {
+ DEBUG_ASSERT(0, "Bad object handle");
+ return FALSE;
+ }
+
+ switch (object->object.type) {
+ case ELM_OBJECT_TYPE_EVO:
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ object = _get_evo(group, elm_tls->gContext.vector_id);
+ if (object == NULL) {
+ return FALSE;
+ }
+ break;
+ case ELM_OBJECT_TYPE_EBO:
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ return FALSE;
+ break;
+ }
+
+ object->attribute.paint.color = color;
+
+ return TRUE;
+}
+
+static BOOL _set_pattern(ElmVecObj evo, ElmBitmapObj pattern)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
+ el_Obj_EBO *ebo_obj = (el_Obj_EBO *) get_object(pattern);
+ el_Obj_Group *group = NULL;
+
+ if ((object == NULL) ||
+ (ebo_obj == NULL)){
+ DEBUG_ASSERT(0, "Bad object handle");
+ return FALSE;
+ }
+
+ switch (object->object.type) {
+ case ELM_OBJECT_TYPE_EVO:
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ object = _get_evo(group, elm_tls->gContext.vector_id);
+ if (object == NULL) {
+ return FALSE;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ object->attribute.paint.pattern.pattern = ebo_obj;
+ ref_object((el_Object *)ebo_obj);
+
+ return TRUE;
+}
+
+static BOOL _set_pattern_mode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
+ el_Obj_Group *group = NULL;
+
+ if (object == NULL){
+ DEBUG_ASSERT(0, "Bad object handle");
+ return FALSE;
+ }
+
+ switch (object->object.type) {
+ case ELM_OBJECT_TYPE_EVO:
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ object = _get_evo(group, elm_tls->gContext.vector_id);
+ if (object == NULL) {
+ return FALSE;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ object->attribute.paint.pattern.mode = mode;
+ object->attribute.paint.pattern.color = color;
+
+ return TRUE;
+}
+
+static BOOL _set_paintType(ElmVecObj evo, ELM_PAINT_TYPE type)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Obj_EVO *object = (el_Obj_EVO *)get_object(evo);
+ el_Obj_Group *group = NULL;
+
+ if (object == NULL) {
+ DEBUG_ASSERT(0, "Bad object handle");
+ return FALSE;
+ }
+ switch (object->object.type) {
+ case ELM_OBJECT_TYPE_EVO:
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)object;
+ object = _get_evo(group, elm_tls->gContext.vector_id);
+ if (object == NULL) {
+ return FALSE;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ object->attribute.paint.type = type;
+
+ return TRUE;
+}
+
+static BOOL _rotate(ElmHandle obj, float angle)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *ego = NULL;
+ el_Transform *transform = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ transform = &ebo->attribute.transform;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ ego = (el_Obj_Group *)object;
+ if (elm_tls->gContext.vector_id < 0) {
+ transform = &ego->transform;
+ }
+ else {
+ evo = _get_evo(ego, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ transform = &evo->attribute.transform;
+ }
+ else {
+ return FALSE;
+ }
+ }
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ transform = &evo->attribute.transform;
+ break;
+
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ break;
+ }
+
+ // Update the transformation params.
+ transform->rotate += angle;
+
+ // Upate the matrix.
+ vg_lite_rotate(angle, &transform->matrix);
+
+ // Clean dirty.
+ transform->dirty = FALSE;
+
+ return TRUE;
+}
+static BOOL _translate(ElmHandle obj, float x, float y)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Object *object = get_object(obj);
+ el_Obj_EBO *ebo = NULL;
+ el_Obj_EVO *evo = NULL;
+ el_Obj_Group *ego = NULL;
+ el_Transform *transform = NULL;
+
+ switch (object->type) {
+ case ELM_OBJECT_TYPE_EBO:
+ ebo = (el_Obj_EBO *)object;
+ transform = &ebo->attribute.transform;
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ ego = (el_Obj_Group *)object;
+ if (elm_tls->gContext.vector_id < 0) {
+ transform = &ego->transform;
+ }
+ else {
+ evo = _get_evo(ego, elm_tls->gContext.vector_id);
+ if (evo != NULL) {
+ transform = &evo->attribute.transform;
+ }
+ else {
+ return FALSE;
+ }
+ }
+ break;
+
+ case ELM_OBJECT_TYPE_EVO:
+ evo = (el_Obj_EVO *)object;
+ transform = &evo->attribute.transform;
+ break;
+
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ break;
+ }
+
+ // Update the transformation params.
+ transform->translate[0] += x;
+ transform->translate[1] += y;
+
+ // Update the matrix.
+ vg_lite_translate(x, y, &transform->matrix);
+
+ // Clean dirty.
+ transform->dirty = FALSE;
+
+ return TRUE;
+}
+
+static BOOL _verify_header(ELM_OBJECT_TYPE *type, uint32_t *version, void *data)
+{
+ uint32_t *p32_data = (uint32_t *)data;
+
+ if (type != NULL) {
+ *type = (ELM_OBJECT_TYPE)(*(p32_data + 1));
+ }
+
+ if (version != NULL) {
+ *version = *p32_data;
+
+ if (*version <= ELM_VERSION) {
+ return TRUE; /* Verified OK, compatible. */
+ }
+ else {
+ return FALSE; /* Verified Failed, API version is lower. */
+ }
+ }
+
+ return TRUE;
+}
+
+/*
+ Load the specified object from the data.
+ */
+static ElmHandle _create_object_from_data(ELM_OBJECT_TYPE type, void *data, int size)
+{
+ ELM_OBJECT_TYPE real_type;
+ uint32_t p_data = (uint32_t)data;
+ uint32_t version;
+
+ if(p_data % BASE_ADDRESS_ALIGNMENT != 0) {
+ DEBUG_ASSERT(0, "Error: data address don't align with 32 bytes!");
+ return ELM_NULL_HANDLE;
+ }
+
+ if (FALSE == _verify_header(&real_type, &version, data)) {
+ DEBUG_ASSERT(0, "Error: Incompatible file.");
+ return ELM_NULL_HANDLE;
+ }
+
+ if (real_type != type) {
+ DEBUG_ASSERT(0, "Warning: Specified type mismatched.\n");
+ }
+
+ /* Jump over the version field to get to the start of the first ELM object */
+ data = (void *)((unsigned)data + sizeof(uint32_t));
+
+ switch (real_type) {
+ case ELM_OBJECT_TYPE_EVO:
+ return _load_evo(data, size, NULL);
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ return _load_ego(data, size);
+
+ case ELM_OBJECT_TYPE_EBO:
+ return _load_ebo(data, size, version);
+#if (VG_RENDER_TEXT==1)
+ case ELM_OBJECT_TYPE_FONT:
+ return _load_font(data, size);
+
+ case ELM_OBJECT_TYPE_TEXT:
+ return _load_text(data, size, NULL);
+#endif
+ default:
+ DEBUG_ASSERT(0, "Bad object type");
+ break;
+ }
+
+ return ELM_NULL_HANDLE;
+}
+
+static el_Transform *_get_paint_transform(ElmHandle handle)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Transform *transform = NULL;
+ el_Obj_Group *group = NULL;
+ el_Obj_EVO *evo = NULL;
+
+ evo = (el_Obj_EVO *)get_object(handle);
+
+ if (evo == NULL) {
+ DEBUG_ASSERT(0, "Bad object handle.\n");
+ return NULL;
+ }
+
+ /* Find the corresponding evo object. */
+ switch (evo->object.type) {
+ case ELM_OBJECT_TYPE_EVO:
+ break;
+
+ case ELM_OBJECT_TYPE_EGO:
+ group = (el_Obj_Group *)evo;
+ evo = _get_evo(group, elm_tls->gContext.vector_id);
+ if (evo == NULL) {
+ return NULL;
+ }
+ break;
+
+ case ELM_OBJECT_TYPE_EBO:
+ default:
+ DEBUG_ASSERT(0, "Incorrect object tyoe.\n");
+ return NULL;
+ break;
+ }
+
+ /* Get the correct transformation based on the paint type. */
+ if (evo->attribute.paint.type == ELM_PAINT_PATTERN) {
+ transform = &((el_Obj_EBO*)evo->attribute.paint.pattern.pattern)->attribute.transform;
+ }
+ else if (evo->attribute.paint.type == ELM_PAINT_GRADIENT) {
+ transform = &evo->attribute.paint.grad->data.transform;
+ }
+
+ return transform;
+}
+
+/*********************** ELM API *********************/
+#if !RTOS
+/*!
+ @abstract Create an elementary object from an existing binary file.
+
+ @discussion
+ This function creates an elementary object from the file whose file name is specified by param name.
+ Caller must match type with the binary file, otherwise create mail fail by returning ELM_NULL_HANDLE.
+
+ @param type
+ Specify what type of object to be created.
+
+ @param name
+ The name of the binary resource file.
+
+ @return ElmHandle
+ An object handle depending on the corresponding type. If type mismatches, it
+ returns ELM_NULL_HANDLE.
+ */
+ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name)
+{
+#if RTOS || BAREMETAL
+ return ELM_NULL_HANDLE;
+#else
+ void *data = NULL;
+ long size = 0;
+ FILE *fp = fopen(name, "rb");
+ ElmHandle handle = ELM_NULL_HANDLE;
+
+ if (fp != NULL) {
+ fseek(fp, 0, SEEK_END);
+ size = ftell(fp);
+
+ data = elm_alloc(1, size);
+ if (data != NULL) {
+ fseek(fp, 0, SEEK_SET);
+ fread(data, size, 1, fp);
+
+ handle = _create_object_from_data(type, data, size);
+ }
+ else {
+ printf("open %s failed!\n", name);
+ }
+ elm_free(data);
+ fclose(fp);
+ }
+
+ return handle;
+#endif
+}
+#else
+ElmHandle ElmCreateObjectFromFile(ELM_OBJECT_TYPE type, const char *name)
+{
+ return ELM_NULL_HANDLE;
+}
+#endif /*!ENABLE_ELM_CRATE_OBJECT_FROM_FILE*/
+/*!
+ @abstract Create an elementary object from build-in data within the appplication.
+
+ @discussion
+ This function creates an elementar object from local data pointer, which is specially useful for environment without filesystem support.
+
+ @param type
+ Specify what type of object to be created.
+
+ @param data
+ The pointer to the binary data which has exactly same layout as external resource file.
+
+ @return ElmHandle
+ An object handle depending on the corresponding type. If type mismatches with the binary data, it
+ returns ELM_NULL_HANDLE.
+ */
+ElmHandle ElmCreateObjectFromData(ELM_OBJECT_TYPE type, void *data, int size)
+{
+ return _create_object_from_data(type, data, size);
+}
+
+/*!
+ @abstract Destroy an ELM object.
+
+ @discussion
+ This function is to release all internal resource inside Elementary libary belonging to this object.
+ Applicatoin need make sure the object is not being used by elmentary library any more when calling this function.
+ If an EBO is being destroyed and it's attached to one EVO, it need to guarantee that EVO is not being used by elementary library too.
+
+ @param object
+ The object handle
+
+ @return
+ If destroying is completed successfully.
+ */
+BOOL ElmDestroyObject(ElmHandle object)
+{
+ int result = destroy_object(object);
+ return (result >= 0);
+}
+
+/*!
+ @abstract Rotate a graphics object with centain degree
+
+ @discussion
+ This function sets an evo/ebo/ego object rotated with specified angle. Without reset, these setting will be
+ accumulated.
+
+ @param obj
+ The graphics object will be rotated.
+
+ @param angle
+ A radian value to be applied on the evo object.
+
+ @return bool
+ Rotate is set successfully.
+ */
+BOOL ElmRotate(ElmHandle obj, float angle)
+{
+ return _rotate(obj, angle);
+}
+
+/*!
+ @abstract Transfer an graphics object at different directions.
+
+ @discussion
+ This function put an evo/ebo/ego object away at different directions. Without reset, the setting will be
+ accumulated.
+
+ @param obj
+ The graphics object will be transfered.
+
+ @param x
+ The units in pixel of X direction.
+
+ @param y
+ The units in pixel of Y direction.
+
+ @return bool
+ Transfer is set successfully.
+ */
+BOOL ElmTransfer(ElmHandle obj, int x, int y)
+{
+ return _translate(obj, x, y);
+}
+
+/*!
+ @abstract Scale an graphics object at different directions.
+
+ @discussion
+ This function scale up or down an evo/ego/ebo object at different directions. Without reset, the setting will
+ be accumateled.
+
+ @param obj
+ The graphics object which is targeted to manipulate.
+
+ @param x
+ The scale ratio in X direction.
+
+ @param y
+ The scale ratio in Y direction.
+
+ @return bool
+ Scale is set succefully.
+ */
+BOOL ElmScale(ElmHandle obj, float x, float y)
+{
+ return _scale(obj, x, y);
+}
+
+/*!
+ @abstract Reset the attribute of a graphics object for specified property bit.
+
+ @discussion
+ This funcion resets specified property for an elementary object. It can be applied all types of objects.
+ But some properties are only valid for centain types of objects. If the function is called to reset an invalid
+ property for this type of object, it will be siliently ignored.
+ After reset, the specifed property of an evo/ebo/ego object is set to the initial state. The initial states are decided
+ by the binary resource file. The resource creator should set right value for all properties if they want to directly render
+ the object without any adjustment in application. There is one issue, at present, application has no way to query current value
+ of each property, is it required?
+
+ @param obj
+ The graphics object which is targeted to manipulate.
+
+ @param mask
+ Specify which property or properties need to reset to initial value.
+
+ @return bool
+ Reset is done successfully. If some mask is not valid for this type of object, it would return false.
+ */
+BOOL ElmReset(ElmHandle obj, ELM_EVO_PROP_BIT mask)
+{
+ return _reset_attrib(obj, mask);
+}
+
+/*!
+ @abstract Set the rendering quality of an graphics object.
+
+ @discussion
+ This function sets the rendering quality of an evo/ebo object. Avaliable quality setting contains:
+ ELM_EVO_QUALITY_LOW, ELM_EVO_QUALITY_MED, ELM_EVO_QUALITY_HI. This function is only applied to an evo or an ebo.
+ Group object can't be set quality. It always use the setting from its binary.
+
+ @param obj
+ The elementary object.
+
+ @param quality
+ The quality enum.
+
+ @return bool
+ The operation for this object is sucessful, for group object and invalid enum, would return false.
+ */
+BOOL ElmSetQuality(ElmHandle obj, ELM_QUALITY quality)
+{
+ return _set_quality(obj, quality);
+}
+
+/*!
+ @abstract Set the fill rule of an evo object.
+
+ @discussion
+ This function sets the fill rule of an elementary object. Avaliable quality setting contains:
+ ELM_EVO_EO, ELM_EVO_NZ. It only applies to evo object.
+
+ @param evo
+ The evo object.
+
+ @param fill
+ The fill rule enum.
+
+ @return bool
+ The operation for this evo is sucessful. For non-evo object an ENUM is not a valid enum, would return false.
+ */
+BOOL ElmSetFill(ElmVecObj evo, ELM_EVO_FILL fill)
+{
+ return _set_fill(evo, fill);
+}
+
+/*!
+ @abstract Set the blending mode of an evo/ebo object.
+
+ @discussion
+ This function sets the blending mode of an evo/ebo object. It's not applied to group object.
+
+ @param obj
+ The graphics object.
+
+ @param blend
+ The blending mode enum.
+
+ @return bool
+ The operation for this evo/ebo is sucessful. If object is a group object or blend mode is not a legal one, it would return false.
+ */
+BOOL ElmSetBlend(ElmHandle obj, ELM_BLEND blend)
+{
+ return _set_blend(obj, blend);
+}
+
+/*!
+ @abstract Set the solid fill color of an evo object.
+
+ @discussion
+ This function sets the solid fill color of an evo object.
+
+ @param evo
+ The evo object.
+
+ @param color
+ The uint32 color value in rgba order.
+
+ @return bool
+ The operation for this evo is sucessful. If the object is not a evo object, it would return false.
+ */
+BOOL ElmSetColor(ElmVecObj evo, uint32_t color)
+{
+ return _set_color(evo, color);
+}
+
+/*!
+ @abstract Set the image paint fill of an evo.
+
+ @discussion
+ This function sets the image pattern for filling an evo. The image pattern
+ is a loaded ebo. The ebo's transformation is applied when drawing the evo.
+
+ @param evo
+ The evo object.
+
+ @param pattern
+ The image pattern to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ */
+BOOL ElmSetPattern(ElmVecObj evo, ElmBitmapObj pattern)
+{
+ return _set_pattern(evo, pattern);
+}
+
+/*!
+ @abstract Set the image paint fill of an evo.
+
+ @discussion
+ This function sets the image pattern for filling an evo. The image pattern
+ is a loaded ebo. The ebo's transformation is applied when drawing the evo.
+
+ @param evo
+ The evo object.
+
+ @param pattern
+ The image pattern to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ */
+BOOL ElmSetPatternMode(ElmVecObj evo, ELM_PATTERN_MODE mode, uint32_t color)
+{
+ return _set_pattern_mode(evo, mode, color);
+}
+
+/*!
+ @abstract Set the paint type of an evo.
+
+ @discussion
+ This function selects the paint type for evo to use. An evo may have 3 types
+ of paint: COLOR, PATTERN, and LINEAR GRADIENT. The Linear graident is always
+ a built-in resource, which can not be altered. If a binary resource doesn't
+ have built-in gradient paint resource, it can't be selected as the paint source.
+ Solid color is also a built-in attribute, but it can be changed by ElmSetColor().
+ Paint with a pattern always need an external ebo object, which is impossible
+ to be embedded in resource file,i.e. ebo object. Before select paint type to
+ be PATTERN, ElmSetPattern() must be called to attach an EBO to an EVO.
+
+ @param evo
+ The evo object.
+
+ @param type
+ The paint type to be set for the evo.
+
+ @return bool
+ The operation is successful or not.
+ If the corresponding type is not avaiable for the evo, it returns false and
+ type paint type falls back to COLOR.
+ */
+BOOL ElmSetPaintType(ElmVecObj evo, ELM_PAINT_TYPE type)
+{
+ return _set_paintType(evo, type);
+}
+
+/*!
+ @abstract Get the solid fill color of an evo object.
+
+ @discussion
+ This function Get the solid fill color of an evo object.
+
+ @param evo
+ The evo object.
+
+ @return uint32_t
+ The uint32 color value in rgba order.
+ */
+BOOL ElmGetColor(ElmGroupObj handle,uint32_t *color)
+{
+ elm_tls_t* elm_tls;
+ el_Obj_EVO *evo;
+
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ el_Obj_Group *ego = (el_Obj_Group*) get_object(handle);
+ evo = _get_evo(ego, elm_tls->gContext.vector_id);
+ *color = evo->attribute.paint.color;
+
+ return TRUE;
+}
+
+/*!
+ @abstract Query the vectory path count of an EGO object. If the given object
+ is an evo/ebo, the count is 0.
+ */
+uint32_t ElmGetVectorCount(ElmHandle handle)
+{
+ el_Obj_Group *ego = (el_Obj_Group*) get_object(handle);
+ if (ego->object.type != ELM_OBJECT_TYPE_EGO) {
+ return 0;
+ }
+ else {
+ return ego->group.count;
+ }
+}
+
+/*!
+ @abstract Query the type of an object (by handle).
+ */
+ELM_OBJECT_TYPE ElmGetObjectType(ElmHandle handle)
+{
+ el_Object *object = get_object(handle);
+ return object->type;
+}
+
+/*!
+ @abstract Set the current vectory object index to operate on.
+ */
+BOOL ElmSetCurrentVector(int32_t id)
+{
+ elm_tls_t* elm_tls;
+ elm_tls = (elm_tls_t *) elm_os_get_tls();
+ if (elm_tls == NULL)
+ return FALSE;
+
+ elm_tls->gContext.vector_id = id;
+
+ return TRUE;
+}
+
+BOOL ElmScalePaint(ElmHandle handle, float sx, float sy)
+{
+ el_Transform *transform = NULL;
+
+ transform = _get_paint_transform(handle);
+
+ if (transform != NULL) {
+ vg_lite_scale(sx, sy, &transform->matrix);
+ transform->dirty = FALSE;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+BOOL ElmRotatePaint(ElmHandle handle, float degrees)
+{
+ el_Transform *transform = NULL;
+
+ transform = _get_paint_transform(handle);
+
+ if (transform != NULL) {
+ vg_lite_rotate(degrees, &transform->matrix);
+ transform->dirty = FALSE;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+BOOL ElmTranslatePaint(ElmHandle handle, float tx, float ty)
+{
+ el_Transform *transform = NULL;
+
+ transform = _get_paint_transform(handle);
+
+ if (transform != NULL) {
+ vg_lite_translate(tx, ty, &transform->matrix);
+ transform->dirty = FALSE;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c
index 7a883cf..4baa5b8 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.c
@@ -1,21 +1,21 @@
-#include "elm_os.h"
-#include "FreeRTOS.h"
-#include "task.h"
-
-vg_lite_error_t elm_os_set_tls(void* tls)
-{
- if(tls == NULL)
- return VG_LITE_INVALID_ARGUMENT;
- vTaskSetThreadLocalStoragePointer(NULL, 1, tls);
- return VG_LITE_SUCCESS;
-}
-
-void * elm_os_get_tls(void)
-{
- return pvTaskGetThreadLocalStoragePointer(NULL, 1);
-}
-
-void elm_os_reset_tls(void)
-{
- vTaskSetThreadLocalStoragePointer(NULL, 1, NULL);
+#include "elm_os.h"
+#include "FreeRTOS.h"
+#include "task.h"
+
+vg_lite_error_t elm_os_set_tls(void* tls)
+{
+ if(tls == NULL)
+ return VG_LITE_INVALID_ARGUMENT;
+ vTaskSetThreadLocalStoragePointer(NULL, 1, tls);
+ return VG_LITE_SUCCESS;
+}
+
+void * elm_os_get_tls(void)
+{
+ return pvTaskGetThreadLocalStoragePointer(NULL, 1);
+}
+
+void elm_os_reset_tls(void)
+{
+ vTaskSetThreadLocalStoragePointer(NULL, 1, NULL);
}
\ No newline at end of file
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h
index e5a0736..e91ed3c 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_os.h
@@ -1,13 +1,13 @@
-#ifndef ELM_OS_H_
-#define ELM_OS_H_
-
-#include
-#include"vg_lite.h"
-
-vg_lite_error_t elm_os_set_tls(void* tls);
-
-void * elm_os_get_tls(void);
-
-void elm_os_reset_tls(void);
-
+#ifndef ELM_OS_H_
+#define ELM_OS_H_
+
+#include
+#include"vg_lite.h"
+
+vg_lite_error_t elm_os_set_tls(void* tls);
+
+void * elm_os_get_tls(void);
+
+void elm_os_reset_tls(void);
+
#endif
\ No newline at end of file
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h
index 0ef71a3..fecd979 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_precom.h
@@ -1,55 +1,55 @@
-/****************************************************************************
-*
-* Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#ifndef elm_precom_h
-#define elm_precom_h
-
-/* System headers. */
-#include
-#include
-#include
-
-/* VGLite hdaders. */
-#include "vg_lite.h"
-
-/* Project headers. */
-#include "Elm.h"
-#include "velm.h"
-#include "elm_os.h"
-
-#define JUMP_IF_NON_ZERO_VALUE(x, label) { int ret = x; if ( (ret) != 1 ) { goto label; } }
-#define JUMP_IF_NULL(x, label) { if (x == NULL) { goto label;} }
-#define JUMP_IF_LOWER(x, y, label) {if (x < y) {goto label;} }
-#define JUMP_IF_GREATER(x, y, label) {if (x > y) {goto label;} }
-#define JUMP_IF_EQUAL(x, y, label) {if (x == y) {goto label;} }
-#define JUMP_IF_LOWER_OR_EQUAL(x, y, label) {if (x <= y) {goto label;} }
-#define JUMP_IF_GREATER_OR_EQUAL(x, y, label) {if (x => y) {goto label;} }
-
-#define MIN(a, b) ((a) > (b) ? (b) : (a))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
-#endif /* elm_precom_h */
+/****************************************************************************
+*
+* Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#ifndef elm_precom_h
+#define elm_precom_h
+
+/* System headers. */
+#include
+#include
+#include
+
+/* VGLite hdaders. */
+#include "vg_lite.h"
+
+/* Project headers. */
+#include "Elm.h"
+#include "velm.h"
+#include "elm_os.h"
+
+#define JUMP_IF_NON_ZERO_VALUE(x, label) { int ret = x; if ( (ret) != 1 ) { goto label; } }
+#define JUMP_IF_NULL(x, label) { if (x == NULL) { goto label;} }
+#define JUMP_IF_LOWER(x, y, label) {if (x < y) {goto label;} }
+#define JUMP_IF_GREATER(x, y, label) {if (x > y) {goto label;} }
+#define JUMP_IF_EQUAL(x, y, label) {if (x == y) {goto label;} }
+#define JUMP_IF_LOWER_OR_EQUAL(x, y, label) {if (x <= y) {goto label;} }
+#define JUMP_IF_GREATER_OR_EQUAL(x, y, label) {if (x => y) {goto label;} }
+
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
+#endif /* elm_precom_h */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c
rename to bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c
index 0feff8e..d5bb3e4 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c
+++ b/bsp/sdk_overlay/middleware/vglite/elementary/src/elm_text.c
@@ -1,734 +1,734 @@
-/****************************************************************************
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-/*
- ElmDrawText API
- */
-/** Include Files */
-#include // for snprintf
-#include
-#include
-
-#include "FreeRTOS.h"
-
-#include "vg_lite.h"
-#include "Elm.h"
-#include "velm.h"
-#include "vg_lite_text.h"
-#include "elm_headers.h"
-#include "elm_text.h"
-#include "elm_precom.h"
-#include "vft_draw.h"
-
-/** Macros */
-#ifndef VECTOR_DEFAULT_FONT
-#define VECTOR_DEFAULT_FONT 1
-#endif
-
-#if VECTOR_DEFAULT_FONT /* Use vector font as default font */
-#define DEFAULT_FONT_NAME "SVGFreeSansASCII"
-#define DEFAULT_FONT_WEIGHT eFontWeightRegular
-#define DEFAULT_FONT_STRETCH eFontStretchNormal
-#define DEFAULT_FONT_STYLE eFontStyleNormal
-#define DEFAULT_FONT_HEIGHT 35
-#define DEFAULT_TEXT_FG_COLOR 0xff000000
-#define DEFAULT_TEXT_ALIGN (eTextAlignLeft)
-
-#else /* Use raster font as default font */
-#define DEFAULT_FONT_NAME "DejaVuSans_Oblique"
-#define DEFAULT_FONT_WEIGHT eFontWeightRegular
-#define DEFAULT_FONT_STRETCH eFontStretchNormal
-#define DEFAULT_FONT_STYLE eFontStyleItalic
-#define DEFAULT_FONT_HEIGHT 35
-#define DEFAULT_TEXT_FG_COLOR 0xff000000
-#define DEFAULT_TEXT_ALIGN (eTextAlignLeft)
-
-#endif
-
-/* Maximum font properties from EVO file */
-#define MAX_FONT_ATTRIB_COMBINATIONS (32)
-
-#define TRANSPARENT_VGLITE_COLOUR(a, r, g, b) \
- ((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(g) << 8) | \
- (uint32_t)r
-
-#define OPAQUE_VGLITE_COLOUR(r, g, b) TRANSPARENT_VGLITE_COLOUR(0xff, r, g, b)
-
-/** Data structures */
-
-/** Internal or external API prototypes */
-int vg_lite_is_font_valid(vg_lite_font_t font);
-char *vg_lite_get_font_name(vg_lite_font_t font);
-vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font);
-int ref_object (el_Object *object);
-
-/** Globals */
-int g_total_system_font = 0;
-static font_field_info_t g_default_font_properties[eMaxFontProperties];
-static font_field_info_t g_font_properties[MAX_FONT_ATTRIB_COMBINATIONS][eMaxFontProperties];
-
-/** Externs if any */
-extern vg_lite_font_attributes_t g_font_attribs;
-extern vg_lite_font_t g_last_font;
-extern int g_last_font_attrib_idx;
-
-void initialize_elm_text(void)
-{
- font_field_info_t *font_fields = NULL;
- /* internal parameters of mcufont library */
- g_font_attribs.alignment = 0;
- g_font_attribs.scale = 1;
- g_font_attribs.width = 1200; /* Describes drawing area */
- g_font_attribs.margin = 5; /* Left margin in drawing area */
- g_font_attribs.bg_color = OPAQUE_VGLITE_COLOUR(0xff,0xff,0xff); // white
- g_font_attribs.last_y = 0;
- g_font_attribs.last_x =0;
- g_font_attribs.last_dx = 0;
-
- /* Initialize default properties */
- font_fields = &g_default_font_properties[0];
-
- char *font_name = (char *)elm_alloc(1, strlen(DEFAULT_FONT_NAME)+1);
- strcpy(font_name, DEFAULT_FONT_NAME);
- font_fields[eFontNameProperty].value.data = font_name;
- font_fields[eFontWeightProperty].value.i_value = DEFAULT_FONT_WEIGHT;
- font_fields[eFontStretchProperty].value.i_value = DEFAULT_FONT_STRETCH;
- font_fields[eFontStyleProperty].value.i_value = DEFAULT_FONT_STYLE;
- font_fields[eFontHeightProperty].value.i_value = DEFAULT_FONT_HEIGHT;
- font_fields[eTextColorProperty].value.i_value = DEFAULT_TEXT_FG_COLOR;
- font_fields[eTextAlignProperty].value.i_value = DEFAULT_TEXT_ALIGN;
-}
-
-static int get_property(font_field_info_t *dst_font_fields, font_fields_t *src_font_fields, int num_fields)
-{
- int i=0;
- int len;
-
- /* Initialize default values */
- dst_font_fields[eFontWeightProperty].value.i_value = DEFAULT_FONT_WEIGHT;
- dst_font_fields[eFontStretchProperty].value.i_value = DEFAULT_FONT_STRETCH;
- dst_font_fields[eFontStyleProperty].value.i_value = eFontStyleNormal;
- dst_font_fields[eTextAlignProperty].value.i_value = DEFAULT_TEXT_ALIGN;
-
- dst_font_fields[eFontNameProperty].value.data = NULL;
- dst_font_fields[eFontHeightProperty].value.i_value = DEFAULT_FONT_HEIGHT;
- dst_font_fields[eTextColorProperty].value.i_value = DEFAULT_TEXT_FG_COLOR;
-
- for(i=0; iattribute.blend;
- vg_lite_font_t curr_font = VG_LITE_INVALID_FONT;
- int curr_font_attrib_idx = INVALID_FONT_PROPERTY_IDX;
-
- vg_lite_font_attributes_t *font_attribs = &g_font_attribs;
- font_field_info_t *font_fields = NULL;
-
- curr_font_attrib_idx = text->font_id;
-
- /* Single font caching can be done here (No caching for now)
- Release last font object if it is different
- */
- if ( vg_lite_is_font_valid(g_last_font) == 1 ) {
- /* recycle font objects */
- vg_lite_free_font_memory(g_last_font);
- g_last_font = VG_LITE_INVALID_FONT;
- }
-
- if(curr_font_attrib_idx != INVALID_FONT_PROPERTY_IDX)
- {
- font_fields = &g_font_properties[curr_font_attrib_idx][0];
- font_fields[eFontHeightProperty].value.i_value = text->font_size;
-
- curr_font = vg_lite_find_font(
- font_fields[eFontNameProperty].value.data,
- (eFontWeight_t)font_fields[eFontWeightProperty].value.i_value,
- (eFontStretch_t)font_fields[eFontStretchProperty].value.i_value,
- (eFontStyle_t)font_fields[eFontStyleProperty].value.i_value,
- font_fields[eFontHeightProperty].value.i_value
- );
- }
-
- if (curr_font == VG_LITE_INVALID_FONT) {
- //printf("ERROR: Font not found. Rendering with default configuration\n");
- font_fields = &g_default_font_properties[0];
- curr_font = vg_lite_find_font(
- font_fields[eFontNameProperty].value.data,
- (eFontWeight_t)font_fields[eFontWeightProperty].value.i_value,
- (eFontStretch_t)font_fields[eFontStretchProperty].value.i_value,
- (eFontStyle_t)font_fields[eFontStyleProperty].value.i_value,
- font_fields[eFontHeightProperty].value.i_value);
- }
- if (curr_font == VG_LITE_INVALID_FONT) {
- printf("Font[%s] not found\n", font_fields[eFontNameProperty].value.data);
- return VG_LITE_INVALID_ARGUMENT;
- }
- font_attribs->is_vector_font = vg_lite_is_vector_font(curr_font);
- /* Properties that changes over time */
- font_attribs->text_color = text->attribute.paint.color;
- font_attribs->alignment = (eTextAlign_t)text->text_anchor;
- font_attribs->font_height = font_fields[eFontHeightProperty].value.i_value;
- font_attribs->tspan_has_dx_dy = text->tspan_has_dx_dy;
-
- error = vg_lite_draw_text(&buff->buffer,
- (char *)text->msg,
- curr_font,
- text->x_pos, text->y_pos,
- &text->attribute.transform.matrix,
- blend,
- font_attribs);
-
- g_last_font = curr_font;
- g_last_font_attrib_idx = curr_font_attrib_idx;
- return error;
-}
-
-/* process font-field data */
-static int _process_font_field_data( uint8_t *data_start, uint8_t *data, int num_fields, font_fields_t* fields)
-{
- eFontFields_t eName;
-
- if (g_total_system_font >= MAX_FONT_ATTRIB_COMBINATIONS) {
- printf("WARNING: Font property buffer overflowing...\n"
- "Increase MAX_FONT_ATTRIB_COMBINATIONS\n");
- return -1;
- }
-
- for(int i=0; ittf_fonts[id].id = *(uint32_t *)(data);
- fontblockobj->ttf_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
- num_fields = *(uint32_t *)(data + 2 * 4);
- fontblockobj->ttf_fonts[id].num_fields = num_fields;
- fontblockobj->ttf_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
-
- _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->ttf_fonts[id].fields);
- return 0;
-}
-
-/* process vector-type font data */
-static int _process_vector_font_data(uint8_t *data_start, uint8_t *data, font_block_t *fontblockobj, int id)
-{
- unsigned int num_fields = 0;
-
- fontblockobj->vector_fonts[id].id = *(uint32_t *)(data);
- fontblockobj->vector_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
- num_fields = *(uint32_t *)(data + 2 * 4);
- fontblockobj->vector_fonts[id].num_fields = num_fields;
- fontblockobj->vector_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
-
- _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->vector_fonts[id].fields);
-
- return 0;
-}
-
-static int _process_text_font_data(uint8_t *data_start, uint8_t *void_data, font_block_t *fontblockobj, int id)
-{
- unsigned int num_fields;
- uint8_t * data = (uint8_t *) void_data;
-
- fontblockobj->text_fonts[id].id = *(uint32_t *)(data);
- fontblockobj->text_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
- num_fields = *(uint32_t *)(data + 2 * 4);
- fontblockobj->text_fonts[id].num_fields = num_fields;
- fontblockobj->text_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
-
- _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->text_fonts[id].fields);
- return 0;
-}
-
-static uint32_t *alloc_mem(uint32_t size)
-{
- uint32_t *data = NULL;
- data = (uint32_t *)elm_alloc(1, size);
- JUMP_IF_NULL(data, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(data, 0, size);
-#endif
- return data;
-error_exit:
- return NULL;
-}
-
-font_block_t *fontblockobj = NULL;
-
-/* load font-data */
-int _load_font_data(uint8_t *data)
-{
- el_Font_Header *font_header = (el_Font_Header *)data;
-
- if ( fontblockobj != NULL )
- {
- return -1;
- }
-
- fontblockobj = (font_block_t *)elm_alloc(1, sizeof(font_block_t));
- memset(fontblockobj, 0, sizeof(font_block_t));
-
- fontblockobj->size = font_header->size_font_block;
- fontblockobj->type = eElemTypeFont;
- fontblockobj->num_ttf_fonts = font_header->num_ttf_fonts;
- fontblockobj->num_vector_fonts = font_header->num_vector_fonts;
- fontblockobj->num_text_fonts = font_header->num_text_fonts;
- fontblockobj->ttf_fonts_block_offset = font_header->ttf_fonts_block_offset;
- fontblockobj->ttf_fonts_block_length = font_header->ttf_fonts_block_length;
- fontblockobj->vector_fonts_block_offset = font_header->vector_fonts_block_offset;
- fontblockobj->vector_fonts_block_length = font_header->vector_fonts_block_length;
- fontblockobj->text_fonts_block_offset = font_header->text_fonts_block_offset;
- fontblockobj->text_fonts_block_length = font_header->text_fonts_block_length;
- fontblockobj->property_block_offset = font_header->property_block_offset;
- fontblockobj->property_block_length = font_header->property_block_length;
-#ifdef ENABLE_DEBUG_TRACE
- printf("size: %d(%0x)\n", fontblockobj->size, fontblockobj->size);
- printf("type: %d\n", fontblockobj->type);
- printf("num_ttf_fonts: %d\n", fontblockobj->num_ttf_fonts);
- printf("num_vector_fonts: %d\n", fontblockobj->num_vector_fonts);
- printf("num_text_fonts: %d\n", fontblockobj->num_text_fonts);
- printf("ttf_fonts_block_offset: %d(%0x)\n", fontblockobj->ttf_fonts_block_offset,
- fontblockobj->ttf_fonts_block_offset);
- printf("ttf_fonts_block_length: %d(%0x)\n", fontblockobj->ttf_fonts_block_length,
- fontblockobj->ttf_fonts_block_length);
- printf("vector_fonts_block_offset: %d(%0x)\n", fontblockobj->vector_fonts_block_offset,
- fontblockobj->vector_fonts_block_offset);
- printf("vector_fonts_block_length: %d(%0x)\n", fontblockobj->vector_fonts_block_length,
- fontblockobj->vector_fonts_block_length);
- printf("text_fonts_block_offset: %d(%0x)\n", fontblockobj->text_fonts_block_offset,
- fontblockobj->text_fonts_block_offset);
- printf("text_fonts_block_length: %d(%0x)\n", fontblockobj->text_fonts_block_length,
- fontblockobj->text_fonts_block_length);
- printf("property_block_offset: %d(%0x)\n", fontblockobj->property_block_offset,
- fontblockobj->property_block_offset);
- printf("property_block_length: %d(%0x)\n", fontblockobj->property_block_length,
- fontblockobj->property_block_length);
-#endif
-
- g_total_system_font = 0;
-
- if ( fontblockobj->num_ttf_fonts > 0 ) {
- fontblockobj->sizes_of_ttf_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_ttf_fonts);
- fontblockobj->offsets_of_ttf_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_ttf_fonts);
- fontblockobj->ttf_fonts = NULL;
- fontblockobj->ttf_fonts = (ttf_font_t *)elm_alloc(1, fontblockobj->num_ttf_fonts * sizeof(ttf_font_t));
- JUMP_IF_NULL(fontblockobj->sizes_of_ttf_data, error_exit);
- JUMP_IF_NULL(fontblockobj->offsets_of_ttf_data, error_exit);
- JUMP_IF_NULL(fontblockobj->ttf_fonts, error_exit);
-
- memset(fontblockobj->ttf_fonts, 0, fontblockobj->num_ttf_fonts * sizeof(ttf_font_t));
- for(int i=0; inum_ttf_fonts; i++)
- {
- fontblockobj->sizes_of_ttf_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->ttf_fonts_block_offset);
- printf("ttf-DataSize: %d(%0x)\n", fontblockobj->sizes_of_ttf_data[i],
- fontblockobj->sizes_of_ttf_data[i]);
- fontblockobj->offsets_of_ttf_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_ttf_fonts) * 4 + fontblockobj->ttf_fonts_block_offset);
- printf("ttf-offset: %d(%0x)\n", fontblockobj->offsets_of_ttf_data[i],
- fontblockobj->offsets_of_ttf_data[i]);
-
- if (fontblockobj->sizes_of_ttf_data[i] == 0)
- {
- continue;
- }
-
- _process_ttf_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_ttf_data[i]), fontblockobj, i);
- }
- }
-
- if ( fontblockobj->num_vector_fonts > 0 ) {
- fontblockobj->sizes_of_vector_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_vector_fonts);
- fontblockobj->offsets_of_vector_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_vector_fonts);
- fontblockobj->vector_fonts = NULL;
- fontblockobj->vector_fonts = (vector_font_t *)elm_alloc(1, fontblockobj->num_vector_fonts * sizeof(vector_font_t));
- JUMP_IF_NULL(fontblockobj->sizes_of_vector_data, error_exit);
- JUMP_IF_NULL(fontblockobj->offsets_of_vector_data, error_exit);
- JUMP_IF_NULL(fontblockobj->vector_fonts, error_exit);
-
- memset(fontblockobj->vector_fonts, 0, fontblockobj->num_vector_fonts * sizeof(vector_font_t));
- for(int i=0; inum_vector_fonts; i++)
- {
- fontblockobj->sizes_of_vector_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->vector_fonts_block_offset);
-#ifdef ENABLE_DEBUG_TRACE
- printf("vector-DataSize: %d(%0x)\n", fontblockobj->sizes_of_vector_data[i],
- fontblockobj->sizes_of_vector_data[i]);
-#endif
- fontblockobj->offsets_of_vector_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_vector_fonts) * 4 + fontblockobj->vector_fonts_block_offset);
-#ifdef ENABLE_DEBUG_TRACE
- printf("vector-offset: %d(%0x)\n", fontblockobj->offsets_of_vector_data[i],
- fontblockobj->offsets_of_vector_data[i]);
-#endif
-
- if (fontblockobj->sizes_of_vector_data[i] == 0)
- {
- continue;
- }
-
- _process_vector_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_vector_data[i]), fontblockobj, i);
- }
- }
-
- if ( fontblockobj->num_text_fonts > 0 ) {
- fontblockobj->sizes_of_text_font_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_text_fonts);
- fontblockobj->offsets_of_text_font_data =
- (unsigned int *)alloc_mem(4 * fontblockobj->num_text_fonts);
- fontblockobj->text_fonts = NULL;
- fontblockobj->text_fonts = (ttf_font_t *)elm_alloc(1, fontblockobj->num_text_fonts * sizeof(ttf_font_t));
- JUMP_IF_NULL(fontblockobj->sizes_of_text_font_data, error_exit);
- JUMP_IF_NULL(fontblockobj->offsets_of_text_font_data, error_exit);
- JUMP_IF_NULL(fontblockobj->text_fonts, error_exit);
- memset(fontblockobj->text_fonts, 0, fontblockobj->num_text_fonts * sizeof(ttf_font_t));
- for(int i=0; inum_text_fonts; i++)
- {
- fontblockobj->sizes_of_text_font_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->text_fonts_block_offset);
-#ifdef ENABLE_DEBUG_TRACE
- printf("textfont-DataSize: %d(%0x)\n", fontblockobj->sizes_of_text_font_data[i],
- fontblockobj->sizes_of_text_font_data[i]);
-#endif
- fontblockobj->offsets_of_text_font_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_text_fonts) * 4 + fontblockobj->text_fonts_block_offset);
-#ifdef ENABLE_DEBUG_TRACE
- printf("textfont-offset: %d(%0x)\n", fontblockobj->offsets_of_text_font_data[i],
- fontblockobj->offsets_of_text_font_data[i]);
-#endif
-
- if (fontblockobj->sizes_of_text_font_data[i] == 0)
- {
- continue;
- }
-
- _process_text_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_text_font_data[i]), fontblockobj, i);
- }
- }
-
- return 0;
-
-error_exit:
- destroy_font_data();
-
- return -1;
-}
-
-#if (defined(__ICCARM__))
-/*
- * Disable the unaligned structure attribute warning. Due to the packed data
- * structures used to interpret ELM objects data the IAR compiler issues a
- * number of warnings that certain attributes of the headers might be unaligned.
- * This is not true, however, as all atributes are manually aligned to 4 bytes.
- */
-#pragma diag_suppress = Pa039
-#endif
-
-#define TEXT_CONTENT_OFFSET_WITHOUT_TRANSFORM 9 * 4
-#define TRANSFORM_MATRIX_LENGTH 9 * 4
-ElmHandle _load_text_data(uint8_t *data, el_Obj_EVO *evo)
-{
- el_Obj_TEXT *evo_text = NULL;
- uint8_t *text_data = NULL;
- el_Text_Header *text_header = (el_Text_Header *)data;
-
- if (evo == NULL) {
-#if (RTOS && DDRLESS) || BAREMETAL
- evo = alloc_evo(1);
-#else
- evo = (el_Obj_EVO *)elm_alloc(1, sizeof(el_Obj_TEXT));
-#endif
- }
- JUMP_IF_NULL(evo, error_exit);
-#ifdef ENABLE_STRICT_DEBUG_MEMSET
- memset(evo, 0, sizeof(el_Obj_EVO));
-#endif
- evo_text = (el_Obj_TEXT *)evo;
-
- /*
- Default transform matrix is,
- identity matrix
- no-scaling
- zero-translate
- */
- _init_transform(&evo_text->defaultAttrib.transform);
- memcpy(&evo_text->defaultAttrib.transform.matrix, &text_header->matrix,
- sizeof(vg_lite_matrix_t));
-
- text_data = (uint8_t *)elm_alloc(1, text_header->data_length);
-
- memcpy(text_data, (void *)(data + sizeof(el_Text_Header)), text_header->data_length);
-
- evo_text->tspan_has_dx_dy = text_header->tspan_has_dx_dy;
- evo_text->x_pos = (int)text_header->x_pos;
- evo_text->y_pos = (int)text_header->y_pos;
- evo_text->text_anchor = text_header->text_flags.text_anchor;
- evo_text->font_id = (int)text_header->font_id;
- evo_text->font_size = (int)text_header->font_size;
- evo_text->msg = text_data;
-
- evo_text->defaultAttrib.quality = (ELM_QUALITY)VG_LITE_HIGH;
- evo_text->defaultAttrib.fill_rule = ELM_EVO_FILL_NZ;
- evo_text->defaultAttrib.blend = ELM_BLEND_SRC_OVER;
- evo_text->defaultAttrib.paint.type = ELM_PAINT_TEXT;
- evo_text->defaultAttrib.paint.color = text_header->color;
-
- evo_text->object.type = ELM_OBJECT_TYPE_EVO;
- evo_text->object.reference = 0;
- evo_text->attribute = evo_text->defaultAttrib;
-
- ref_object(&evo_text->object);
- JUMP_IF_NON_ZERO_VALUE(add_object(&evo_text->object), error_exit);
-
- return evo_text->object.handle;
-
-error_exit:
- if ( (evo_text) && (evo_text->msg != NULL) ) {
- elm_free(evo_text->msg);
- evo_text->msg = NULL;
- }
- if ( evo != NULL ) {
- elm_free(evo);
- }
-
- return ELM_NULL_HANDLE;
-}
-
-#if (defined(__ICCARM__))
-/* Restore the unaligned data structure attribute warning */
-#pragma diag_default = Pa039
-#endif
-
-void _unload_text(el_Obj_EVO *evo)
-{
- el_Obj_TEXT *evo_text = (el_Obj_TEXT *)evo;
- if(evo_text->msg != NULL)
- {
- elm_free(evo_text->msg);
- evo_text->msg = NULL;
- }
-}
-void destroy_font_data()
-{
- int i=0, j = 0;
- if(fontblockobj != NULL) {
- if(fontblockobj->sizes_of_ttf_data != NULL){
- elm_free(fontblockobj->sizes_of_ttf_data);
- fontblockobj->sizes_of_ttf_data = NULL;
- }
- if(fontblockobj->offsets_of_ttf_data != NULL){
- elm_free(fontblockobj->offsets_of_ttf_data);
- fontblockobj->offsets_of_ttf_data = NULL;
- }
- if(fontblockobj->sizes_of_vector_data != NULL){
- elm_free(fontblockobj->sizes_of_vector_data);
- fontblockobj->sizes_of_vector_data = NULL;
- }
- if(fontblockobj->offsets_of_vector_data != NULL){
- elm_free(fontblockobj->offsets_of_vector_data);
- fontblockobj->offsets_of_vector_data = NULL;
- }
- if(fontblockobj->sizes_of_text_font_data != NULL){
- elm_free(fontblockobj->sizes_of_text_font_data);
- fontblockobj->sizes_of_text_font_data = NULL;
- }
- if(fontblockobj->offsets_of_text_font_data != NULL){
- elm_free(fontblockobj->offsets_of_text_font_data);
- fontblockobj->offsets_of_text_font_data = NULL;
- }
- for(i=0; inum_ttf_fonts; i++)
- {
- if(fontblockobj->ttf_fonts[i].fields != NULL){
- for(j=0; jttf_fonts[i].num_fields; j++)
- {
- if(fontblockobj->ttf_fonts[i].fields[j].data != NULL) {
- elm_free(fontblockobj->ttf_fonts[i].fields[j].data);
- fontblockobj->ttf_fonts[i].fields[j].data = NULL;
- }
- }
- elm_free(fontblockobj->ttf_fonts[i].fields);
- fontblockobj->ttf_fonts[i].fields = NULL;
- }
- }
- if(fontblockobj->ttf_fonts != NULL){
- elm_free(fontblockobj->ttf_fonts);
- fontblockobj->ttf_fonts = NULL;
- }
- for(i=0; inum_vector_fonts; i++)
- {
- if(fontblockobj->vector_fonts[i].fields != NULL){
- for(j=0; jvector_fonts[i].num_fields; j++)
- {
- if(fontblockobj->vector_fonts[i].fields[j].data != NULL) {
- elm_free(fontblockobj->vector_fonts[i].fields[j].data);
- fontblockobj->vector_fonts[i].fields[j].data = NULL;
- }
- }
- elm_free(fontblockobj->vector_fonts[i].fields);
- fontblockobj->vector_fonts[i].fields = NULL;
- }
- }
- if(fontblockobj->vector_fonts != NULL){
- elm_free(fontblockobj->vector_fonts);
- fontblockobj->vector_fonts = NULL;
- }
- for(i=0; inum_text_fonts; i++)
- {
- if(fontblockobj->text_fonts[i].fields != NULL){
- for(j=0; jtext_fonts[i].num_fields; j++)
- {
- if(fontblockobj->text_fonts[i].fields[j].data != NULL) {
- elm_free(fontblockobj->text_fonts[i].fields[j].data);
- fontblockobj->text_fonts[i].fields[j].data = NULL;
- }
- }
- elm_free(fontblockobj->text_fonts[i].fields);
- fontblockobj->text_fonts[i].fields = NULL;
- }
- }
- if(fontblockobj->text_fonts != NULL){
- elm_free(fontblockobj->text_fonts);
- fontblockobj->text_fonts = NULL;
- }
-
- elm_free(fontblockobj);
- fontblockobj = NULL;
- }
-
- vg_lite_unload_font_data();
-
- for(int i=0; i // for snprintf
+#include
+#include
+
+#include "FreeRTOS.h"
+
+#include "vg_lite.h"
+#include "Elm.h"
+#include "velm.h"
+#include "vg_lite_text.h"
+#include "elm_headers.h"
+#include "elm_text.h"
+#include "elm_precom.h"
+#include "vft_draw.h"
+
+/** Macros */
+#ifndef VECTOR_DEFAULT_FONT
+#define VECTOR_DEFAULT_FONT 1
+#endif
+
+#if VECTOR_DEFAULT_FONT /* Use vector font as default font */
+#define DEFAULT_FONT_NAME "SVGFreeSansASCII"
+#define DEFAULT_FONT_WEIGHT eFontWeightRegular
+#define DEFAULT_FONT_STRETCH eFontStretchNormal
+#define DEFAULT_FONT_STYLE eFontStyleNormal
+#define DEFAULT_FONT_HEIGHT 35
+#define DEFAULT_TEXT_FG_COLOR 0xff000000
+#define DEFAULT_TEXT_ALIGN (eTextAlignLeft)
+
+#else /* Use raster font as default font */
+#define DEFAULT_FONT_NAME "DejaVuSans_Oblique"
+#define DEFAULT_FONT_WEIGHT eFontWeightRegular
+#define DEFAULT_FONT_STRETCH eFontStretchNormal
+#define DEFAULT_FONT_STYLE eFontStyleItalic
+#define DEFAULT_FONT_HEIGHT 35
+#define DEFAULT_TEXT_FG_COLOR 0xff000000
+#define DEFAULT_TEXT_ALIGN (eTextAlignLeft)
+
+#endif
+
+/* Maximum font properties from EVO file */
+#define MAX_FONT_ATTRIB_COMBINATIONS (32)
+
+#define TRANSPARENT_VGLITE_COLOUR(a, r, g, b) \
+ ((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(g) << 8) | \
+ (uint32_t)r
+
+#define OPAQUE_VGLITE_COLOUR(r, g, b) TRANSPARENT_VGLITE_COLOUR(0xff, r, g, b)
+
+/** Data structures */
+
+/** Internal or external API prototypes */
+int vg_lite_is_font_valid(vg_lite_font_t font);
+char *vg_lite_get_font_name(vg_lite_font_t font);
+vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font);
+int ref_object (el_Object *object);
+
+/** Globals */
+int g_total_system_font = 0;
+static font_field_info_t g_default_font_properties[eMaxFontProperties];
+static font_field_info_t g_font_properties[MAX_FONT_ATTRIB_COMBINATIONS][eMaxFontProperties];
+
+/** Externs if any */
+extern vg_lite_font_attributes_t g_font_attribs;
+extern vg_lite_font_t g_last_font;
+extern int g_last_font_attrib_idx;
+
+void initialize_elm_text(void)
+{
+ font_field_info_t *font_fields = NULL;
+ /* internal parameters of mcufont library */
+ g_font_attribs.alignment = 0;
+ g_font_attribs.scale = 1;
+ g_font_attribs.width = 1200; /* Describes drawing area */
+ g_font_attribs.margin = 5; /* Left margin in drawing area */
+ g_font_attribs.bg_color = OPAQUE_VGLITE_COLOUR(0xff,0xff,0xff); // white
+ g_font_attribs.last_y = 0;
+ g_font_attribs.last_x =0;
+ g_font_attribs.last_dx = 0;
+
+ /* Initialize default properties */
+ font_fields = &g_default_font_properties[0];
+
+ char *font_name = (char *)elm_alloc(1, strlen(DEFAULT_FONT_NAME)+1);
+ strcpy(font_name, DEFAULT_FONT_NAME);
+ font_fields[eFontNameProperty].value.data = font_name;
+ font_fields[eFontWeightProperty].value.i_value = DEFAULT_FONT_WEIGHT;
+ font_fields[eFontStretchProperty].value.i_value = DEFAULT_FONT_STRETCH;
+ font_fields[eFontStyleProperty].value.i_value = DEFAULT_FONT_STYLE;
+ font_fields[eFontHeightProperty].value.i_value = DEFAULT_FONT_HEIGHT;
+ font_fields[eTextColorProperty].value.i_value = DEFAULT_TEXT_FG_COLOR;
+ font_fields[eTextAlignProperty].value.i_value = DEFAULT_TEXT_ALIGN;
+}
+
+static int get_property(font_field_info_t *dst_font_fields, font_fields_t *src_font_fields, int num_fields)
+{
+ int i=0;
+ int len;
+
+ /* Initialize default values */
+ dst_font_fields[eFontWeightProperty].value.i_value = DEFAULT_FONT_WEIGHT;
+ dst_font_fields[eFontStretchProperty].value.i_value = DEFAULT_FONT_STRETCH;
+ dst_font_fields[eFontStyleProperty].value.i_value = eFontStyleNormal;
+ dst_font_fields[eTextAlignProperty].value.i_value = DEFAULT_TEXT_ALIGN;
+
+ dst_font_fields[eFontNameProperty].value.data = NULL;
+ dst_font_fields[eFontHeightProperty].value.i_value = DEFAULT_FONT_HEIGHT;
+ dst_font_fields[eTextColorProperty].value.i_value = DEFAULT_TEXT_FG_COLOR;
+
+ for(i=0; iattribute.blend;
+ vg_lite_font_t curr_font = VG_LITE_INVALID_FONT;
+ int curr_font_attrib_idx = INVALID_FONT_PROPERTY_IDX;
+
+ vg_lite_font_attributes_t *font_attribs = &g_font_attribs;
+ font_field_info_t *font_fields = NULL;
+
+ curr_font_attrib_idx = text->font_id;
+
+ /* Single font caching can be done here (No caching for now)
+ Release last font object if it is different
+ */
+ if ( vg_lite_is_font_valid(g_last_font) == 1 ) {
+ /* recycle font objects */
+ vg_lite_free_font_memory(g_last_font);
+ g_last_font = VG_LITE_INVALID_FONT;
+ }
+
+ if(curr_font_attrib_idx != INVALID_FONT_PROPERTY_IDX)
+ {
+ font_fields = &g_font_properties[curr_font_attrib_idx][0];
+ font_fields[eFontHeightProperty].value.i_value = text->font_size;
+
+ curr_font = vg_lite_find_font(
+ font_fields[eFontNameProperty].value.data,
+ (eFontWeight_t)font_fields[eFontWeightProperty].value.i_value,
+ (eFontStretch_t)font_fields[eFontStretchProperty].value.i_value,
+ (eFontStyle_t)font_fields[eFontStyleProperty].value.i_value,
+ font_fields[eFontHeightProperty].value.i_value
+ );
+ }
+
+ if (curr_font == VG_LITE_INVALID_FONT) {
+ //printf("ERROR: Font not found. Rendering with default configuration\n");
+ font_fields = &g_default_font_properties[0];
+ curr_font = vg_lite_find_font(
+ font_fields[eFontNameProperty].value.data,
+ (eFontWeight_t)font_fields[eFontWeightProperty].value.i_value,
+ (eFontStretch_t)font_fields[eFontStretchProperty].value.i_value,
+ (eFontStyle_t)font_fields[eFontStyleProperty].value.i_value,
+ font_fields[eFontHeightProperty].value.i_value);
+ }
+ if (curr_font == VG_LITE_INVALID_FONT) {
+ printf("Font[%s] not found\n", font_fields[eFontNameProperty].value.data);
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ font_attribs->is_vector_font = vg_lite_is_vector_font(curr_font);
+ /* Properties that changes over time */
+ font_attribs->text_color = text->attribute.paint.color;
+ font_attribs->alignment = (eTextAlign_t)text->text_anchor;
+ font_attribs->font_height = font_fields[eFontHeightProperty].value.i_value;
+ font_attribs->tspan_has_dx_dy = text->tspan_has_dx_dy;
+
+ error = vg_lite_draw_text(&buff->buffer,
+ (char *)text->msg,
+ curr_font,
+ text->x_pos, text->y_pos,
+ &text->attribute.transform.matrix,
+ blend,
+ font_attribs);
+
+ g_last_font = curr_font;
+ g_last_font_attrib_idx = curr_font_attrib_idx;
+ return error;
+}
+
+/* process font-field data */
+static int _process_font_field_data( uint8_t *data_start, uint8_t *data, int num_fields, font_fields_t* fields)
+{
+ eFontFields_t eName;
+
+ if (g_total_system_font >= MAX_FONT_ATTRIB_COMBINATIONS) {
+ printf("WARNING: Font property buffer overflowing...\n"
+ "Increase MAX_FONT_ATTRIB_COMBINATIONS\n");
+ return -1;
+ }
+
+ for(int i=0; ittf_fonts[id].id = *(uint32_t *)(data);
+ fontblockobj->ttf_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
+ num_fields = *(uint32_t *)(data + 2 * 4);
+ fontblockobj->ttf_fonts[id].num_fields = num_fields;
+ fontblockobj->ttf_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
+
+ _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->ttf_fonts[id].fields);
+ return 0;
+}
+
+/* process vector-type font data */
+static int _process_vector_font_data(uint8_t *data_start, uint8_t *data, font_block_t *fontblockobj, int id)
+{
+ unsigned int num_fields = 0;
+
+ fontblockobj->vector_fonts[id].id = *(uint32_t *)(data);
+ fontblockobj->vector_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
+ num_fields = *(uint32_t *)(data + 2 * 4);
+ fontblockobj->vector_fonts[id].num_fields = num_fields;
+ fontblockobj->vector_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
+
+ _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->vector_fonts[id].fields);
+
+ return 0;
+}
+
+static int _process_text_font_data(uint8_t *data_start, uint8_t *void_data, font_block_t *fontblockobj, int id)
+{
+ unsigned int num_fields;
+ uint8_t * data = (uint8_t *) void_data;
+
+ fontblockobj->text_fonts[id].id = *(uint32_t *)(data);
+ fontblockobj->text_fonts[id].type = (eElemType_t)*(uint32_t *)(data + 1 * 4);
+ num_fields = *(uint32_t *)(data + 2 * 4);
+ fontblockobj->text_fonts[id].num_fields = num_fields;
+ fontblockobj->text_fonts[id].fields = (font_fields_t *)elm_alloc(1, num_fields * sizeof(font_fields_t));
+
+ _process_font_field_data(data_start, (uint8_t*)(data + 3 * 4), num_fields, fontblockobj->text_fonts[id].fields);
+ return 0;
+}
+
+static uint32_t *alloc_mem(uint32_t size)
+{
+ uint32_t *data = NULL;
+ data = (uint32_t *)elm_alloc(1, size);
+ JUMP_IF_NULL(data, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(data, 0, size);
+#endif
+ return data;
+error_exit:
+ return NULL;
+}
+
+font_block_t *fontblockobj = NULL;
+
+/* load font-data */
+int _load_font_data(uint8_t *data)
+{
+ el_Font_Header *font_header = (el_Font_Header *)data;
+
+ if ( fontblockobj != NULL )
+ {
+ return -1;
+ }
+
+ fontblockobj = (font_block_t *)elm_alloc(1, sizeof(font_block_t));
+ memset(fontblockobj, 0, sizeof(font_block_t));
+
+ fontblockobj->size = font_header->size_font_block;
+ fontblockobj->type = eElemTypeFont;
+ fontblockobj->num_ttf_fonts = font_header->num_ttf_fonts;
+ fontblockobj->num_vector_fonts = font_header->num_vector_fonts;
+ fontblockobj->num_text_fonts = font_header->num_text_fonts;
+ fontblockobj->ttf_fonts_block_offset = font_header->ttf_fonts_block_offset;
+ fontblockobj->ttf_fonts_block_length = font_header->ttf_fonts_block_length;
+ fontblockobj->vector_fonts_block_offset = font_header->vector_fonts_block_offset;
+ fontblockobj->vector_fonts_block_length = font_header->vector_fonts_block_length;
+ fontblockobj->text_fonts_block_offset = font_header->text_fonts_block_offset;
+ fontblockobj->text_fonts_block_length = font_header->text_fonts_block_length;
+ fontblockobj->property_block_offset = font_header->property_block_offset;
+ fontblockobj->property_block_length = font_header->property_block_length;
+#ifdef ENABLE_DEBUG_TRACE
+ printf("size: %d(%0x)\n", fontblockobj->size, fontblockobj->size);
+ printf("type: %d\n", fontblockobj->type);
+ printf("num_ttf_fonts: %d\n", fontblockobj->num_ttf_fonts);
+ printf("num_vector_fonts: %d\n", fontblockobj->num_vector_fonts);
+ printf("num_text_fonts: %d\n", fontblockobj->num_text_fonts);
+ printf("ttf_fonts_block_offset: %d(%0x)\n", fontblockobj->ttf_fonts_block_offset,
+ fontblockobj->ttf_fonts_block_offset);
+ printf("ttf_fonts_block_length: %d(%0x)\n", fontblockobj->ttf_fonts_block_length,
+ fontblockobj->ttf_fonts_block_length);
+ printf("vector_fonts_block_offset: %d(%0x)\n", fontblockobj->vector_fonts_block_offset,
+ fontblockobj->vector_fonts_block_offset);
+ printf("vector_fonts_block_length: %d(%0x)\n", fontblockobj->vector_fonts_block_length,
+ fontblockobj->vector_fonts_block_length);
+ printf("text_fonts_block_offset: %d(%0x)\n", fontblockobj->text_fonts_block_offset,
+ fontblockobj->text_fonts_block_offset);
+ printf("text_fonts_block_length: %d(%0x)\n", fontblockobj->text_fonts_block_length,
+ fontblockobj->text_fonts_block_length);
+ printf("property_block_offset: %d(%0x)\n", fontblockobj->property_block_offset,
+ fontblockobj->property_block_offset);
+ printf("property_block_length: %d(%0x)\n", fontblockobj->property_block_length,
+ fontblockobj->property_block_length);
+#endif
+
+ g_total_system_font = 0;
+
+ if ( fontblockobj->num_ttf_fonts > 0 ) {
+ fontblockobj->sizes_of_ttf_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_ttf_fonts);
+ fontblockobj->offsets_of_ttf_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_ttf_fonts);
+ fontblockobj->ttf_fonts = NULL;
+ fontblockobj->ttf_fonts = (ttf_font_t *)elm_alloc(1, fontblockobj->num_ttf_fonts * sizeof(ttf_font_t));
+ JUMP_IF_NULL(fontblockobj->sizes_of_ttf_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->offsets_of_ttf_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->ttf_fonts, error_exit);
+
+ memset(fontblockobj->ttf_fonts, 0, fontblockobj->num_ttf_fonts * sizeof(ttf_font_t));
+ for(int i=0; inum_ttf_fonts; i++)
+ {
+ fontblockobj->sizes_of_ttf_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->ttf_fonts_block_offset);
+ printf("ttf-DataSize: %d(%0x)\n", fontblockobj->sizes_of_ttf_data[i],
+ fontblockobj->sizes_of_ttf_data[i]);
+ fontblockobj->offsets_of_ttf_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_ttf_fonts) * 4 + fontblockobj->ttf_fonts_block_offset);
+ printf("ttf-offset: %d(%0x)\n", fontblockobj->offsets_of_ttf_data[i],
+ fontblockobj->offsets_of_ttf_data[i]);
+
+ if (fontblockobj->sizes_of_ttf_data[i] == 0)
+ {
+ continue;
+ }
+
+ _process_ttf_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_ttf_data[i]), fontblockobj, i);
+ }
+ }
+
+ if ( fontblockobj->num_vector_fonts > 0 ) {
+ fontblockobj->sizes_of_vector_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_vector_fonts);
+ fontblockobj->offsets_of_vector_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_vector_fonts);
+ fontblockobj->vector_fonts = NULL;
+ fontblockobj->vector_fonts = (vector_font_t *)elm_alloc(1, fontblockobj->num_vector_fonts * sizeof(vector_font_t));
+ JUMP_IF_NULL(fontblockobj->sizes_of_vector_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->offsets_of_vector_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->vector_fonts, error_exit);
+
+ memset(fontblockobj->vector_fonts, 0, fontblockobj->num_vector_fonts * sizeof(vector_font_t));
+ for(int i=0; inum_vector_fonts; i++)
+ {
+ fontblockobj->sizes_of_vector_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->vector_fonts_block_offset);
+#ifdef ENABLE_DEBUG_TRACE
+ printf("vector-DataSize: %d(%0x)\n", fontblockobj->sizes_of_vector_data[i],
+ fontblockobj->sizes_of_vector_data[i]);
+#endif
+ fontblockobj->offsets_of_vector_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_vector_fonts) * 4 + fontblockobj->vector_fonts_block_offset);
+#ifdef ENABLE_DEBUG_TRACE
+ printf("vector-offset: %d(%0x)\n", fontblockobj->offsets_of_vector_data[i],
+ fontblockobj->offsets_of_vector_data[i]);
+#endif
+
+ if (fontblockobj->sizes_of_vector_data[i] == 0)
+ {
+ continue;
+ }
+
+ _process_vector_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_vector_data[i]), fontblockobj, i);
+ }
+ }
+
+ if ( fontblockobj->num_text_fonts > 0 ) {
+ fontblockobj->sizes_of_text_font_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_text_fonts);
+ fontblockobj->offsets_of_text_font_data =
+ (unsigned int *)alloc_mem(4 * fontblockobj->num_text_fonts);
+ fontblockobj->text_fonts = NULL;
+ fontblockobj->text_fonts = (ttf_font_t *)elm_alloc(1, fontblockobj->num_text_fonts * sizeof(ttf_font_t));
+ JUMP_IF_NULL(fontblockobj->sizes_of_text_font_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->offsets_of_text_font_data, error_exit);
+ JUMP_IF_NULL(fontblockobj->text_fonts, error_exit);
+ memset(fontblockobj->text_fonts, 0, fontblockobj->num_text_fonts * sizeof(ttf_font_t));
+ for(int i=0; inum_text_fonts; i++)
+ {
+ fontblockobj->sizes_of_text_font_data[i] = *(uint32_t *)(data + (i) * 4 + fontblockobj->text_fonts_block_offset);
+#ifdef ENABLE_DEBUG_TRACE
+ printf("textfont-DataSize: %d(%0x)\n", fontblockobj->sizes_of_text_font_data[i],
+ fontblockobj->sizes_of_text_font_data[i]);
+#endif
+ fontblockobj->offsets_of_text_font_data[i] = *(uint32_t *)(data + (i + fontblockobj->num_text_fonts) * 4 + fontblockobj->text_fonts_block_offset);
+#ifdef ENABLE_DEBUG_TRACE
+ printf("textfont-offset: %d(%0x)\n", fontblockobj->offsets_of_text_font_data[i],
+ fontblockobj->offsets_of_text_font_data[i]);
+#endif
+
+ if (fontblockobj->sizes_of_text_font_data[i] == 0)
+ {
+ continue;
+ }
+
+ _process_text_font_data(data, (uint8_t *)(data + fontblockobj->offsets_of_text_font_data[i]), fontblockobj, i);
+ }
+ }
+
+ return 0;
+
+error_exit:
+ destroy_font_data();
+
+ return -1;
+}
+
+#if (defined(__ICCARM__))
+/*
+ * Disable the unaligned structure attribute warning. Due to the packed data
+ * structures used to interpret ELM objects data the IAR compiler issues a
+ * number of warnings that certain attributes of the headers might be unaligned.
+ * This is not true, however, as all atributes are manually aligned to 4 bytes.
+ */
+#pragma diag_suppress = Pa039
+#endif
+
+#define TEXT_CONTENT_OFFSET_WITHOUT_TRANSFORM 9 * 4
+#define TRANSFORM_MATRIX_LENGTH 9 * 4
+ElmHandle _load_text_data(uint8_t *data, el_Obj_EVO *evo)
+{
+ el_Obj_TEXT *evo_text = NULL;
+ uint8_t *text_data = NULL;
+ el_Text_Header *text_header = (el_Text_Header *)data;
+
+ if (evo == NULL) {
+#if (RTOS && DDRLESS) || BAREMETAL
+ evo = alloc_evo(1);
+#else
+ evo = (el_Obj_EVO *)elm_alloc(1, sizeof(el_Obj_TEXT));
+#endif
+ }
+ JUMP_IF_NULL(evo, error_exit);
+#ifdef ENABLE_STRICT_DEBUG_MEMSET
+ memset(evo, 0, sizeof(el_Obj_EVO));
+#endif
+ evo_text = (el_Obj_TEXT *)evo;
+
+ /*
+ Default transform matrix is,
+ identity matrix
+ no-scaling
+ zero-translate
+ */
+ _init_transform(&evo_text->defaultAttrib.transform);
+ memcpy(&evo_text->defaultAttrib.transform.matrix, &text_header->matrix,
+ sizeof(vg_lite_matrix_t));
+
+ text_data = (uint8_t *)elm_alloc(1, text_header->data_length);
+
+ memcpy(text_data, (void *)(data + sizeof(el_Text_Header)), text_header->data_length);
+
+ evo_text->tspan_has_dx_dy = text_header->tspan_has_dx_dy;
+ evo_text->x_pos = (int)text_header->x_pos;
+ evo_text->y_pos = (int)text_header->y_pos;
+ evo_text->text_anchor = text_header->text_flags.text_anchor;
+ evo_text->font_id = (int)text_header->font_id;
+ evo_text->font_size = (int)text_header->font_size;
+ evo_text->msg = text_data;
+
+ evo_text->defaultAttrib.quality = (ELM_QUALITY)VG_LITE_HIGH;
+ evo_text->defaultAttrib.fill_rule = ELM_EVO_FILL_NZ;
+ evo_text->defaultAttrib.blend = ELM_BLEND_SRC_OVER;
+ evo_text->defaultAttrib.paint.type = ELM_PAINT_TEXT;
+ evo_text->defaultAttrib.paint.color = text_header->color;
+
+ evo_text->object.type = ELM_OBJECT_TYPE_EVO;
+ evo_text->object.reference = 0;
+ evo_text->attribute = evo_text->defaultAttrib;
+
+ ref_object(&evo_text->object);
+ JUMP_IF_NON_ZERO_VALUE(add_object(&evo_text->object), error_exit);
+
+ return evo_text->object.handle;
+
+error_exit:
+ if ( (evo_text) && (evo_text->msg != NULL) ) {
+ elm_free(evo_text->msg);
+ evo_text->msg = NULL;
+ }
+ if ( evo != NULL ) {
+ elm_free(evo);
+ }
+
+ return ELM_NULL_HANDLE;
+}
+
+#if (defined(__ICCARM__))
+/* Restore the unaligned data structure attribute warning */
+#pragma diag_default = Pa039
+#endif
+
+void _unload_text(el_Obj_EVO *evo)
+{
+ el_Obj_TEXT *evo_text = (el_Obj_TEXT *)evo;
+ if(evo_text->msg != NULL)
+ {
+ elm_free(evo_text->msg);
+ evo_text->msg = NULL;
+ }
+}
+void destroy_font_data()
+{
+ int i=0, j = 0;
+ if(fontblockobj != NULL) {
+ if(fontblockobj->sizes_of_ttf_data != NULL){
+ elm_free(fontblockobj->sizes_of_ttf_data);
+ fontblockobj->sizes_of_ttf_data = NULL;
+ }
+ if(fontblockobj->offsets_of_ttf_data != NULL){
+ elm_free(fontblockobj->offsets_of_ttf_data);
+ fontblockobj->offsets_of_ttf_data = NULL;
+ }
+ if(fontblockobj->sizes_of_vector_data != NULL){
+ elm_free(fontblockobj->sizes_of_vector_data);
+ fontblockobj->sizes_of_vector_data = NULL;
+ }
+ if(fontblockobj->offsets_of_vector_data != NULL){
+ elm_free(fontblockobj->offsets_of_vector_data);
+ fontblockobj->offsets_of_vector_data = NULL;
+ }
+ if(fontblockobj->sizes_of_text_font_data != NULL){
+ elm_free(fontblockobj->sizes_of_text_font_data);
+ fontblockobj->sizes_of_text_font_data = NULL;
+ }
+ if(fontblockobj->offsets_of_text_font_data != NULL){
+ elm_free(fontblockobj->offsets_of_text_font_data);
+ fontblockobj->offsets_of_text_font_data = NULL;
+ }
+ for(i=0; inum_ttf_fonts; i++)
+ {
+ if(fontblockobj->ttf_fonts[i].fields != NULL){
+ for(j=0; jttf_fonts[i].num_fields; j++)
+ {
+ if(fontblockobj->ttf_fonts[i].fields[j].data != NULL) {
+ elm_free(fontblockobj->ttf_fonts[i].fields[j].data);
+ fontblockobj->ttf_fonts[i].fields[j].data = NULL;
+ }
+ }
+ elm_free(fontblockobj->ttf_fonts[i].fields);
+ fontblockobj->ttf_fonts[i].fields = NULL;
+ }
+ }
+ if(fontblockobj->ttf_fonts != NULL){
+ elm_free(fontblockobj->ttf_fonts);
+ fontblockobj->ttf_fonts = NULL;
+ }
+ for(i=0; inum_vector_fonts; i++)
+ {
+ if(fontblockobj->vector_fonts[i].fields != NULL){
+ for(j=0; jvector_fonts[i].num_fields; j++)
+ {
+ if(fontblockobj->vector_fonts[i].fields[j].data != NULL) {
+ elm_free(fontblockobj->vector_fonts[i].fields[j].data);
+ fontblockobj->vector_fonts[i].fields[j].data = NULL;
+ }
+ }
+ elm_free(fontblockobj->vector_fonts[i].fields);
+ fontblockobj->vector_fonts[i].fields = NULL;
+ }
+ }
+ if(fontblockobj->vector_fonts != NULL){
+ elm_free(fontblockobj->vector_fonts);
+ fontblockobj->vector_fonts = NULL;
+ }
+ for(i=0; inum_text_fonts; i++)
+ {
+ if(fontblockobj->text_fonts[i].fields != NULL){
+ for(j=0; jtext_fonts[i].num_fields; j++)
+ {
+ if(fontblockobj->text_fonts[i].fields[j].data != NULL) {
+ elm_free(fontblockobj->text_fonts[i].fields[j].data);
+ fontblockobj->text_fonts[i].fields[j].data = NULL;
+ }
+ }
+ elm_free(fontblockobj->text_fonts[i].fields);
+ fontblockobj->text_fonts[i].fields = NULL;
+ }
+ }
+ if(fontblockobj->text_fonts != NULL){
+ elm_free(fontblockobj->text_fonts);
+ fontblockobj->text_fonts = NULL;
+ }
+
+ elm_free(fontblockobj);
+ fontblockobj = NULL;
+ }
+
+ vg_lite_unload_font_data();
+
+ for(int i=0; igContext.object_slots[id % SLOT_COUNT]
-
- /*
- VGLite releated configurations.
- */
-#define TS_WIDTH 64
-#define TS_HEIGHT 64
-#define RTOS 1
-#define APP_BUFFER_COUNT 2
-#if (RTOS && DDRLESS) || BAREMETAL
-#define OBJCOUNT_GRAD 16
-#define OBJCOUNT_EVO 128
-#define OBJCOUNT_EBO 64
-#define OBJCOUNT_GROUP 16
-#endif
-
-#if RTOS
-#include "FreeRTOS.h"
-
-#define elm_alloc(num_objects,object_size) pvPortMalloc(num_objects * object_size)
-#define elm_free vPortFree
-#else
-#define elm_alloc calloc
-#define elm_free free
-#endif
-
-typedef enum {
- ELEMENT_LINEARGRADIENT = 0, /*! linear gradient element */
- ELEMENT_PATH = 1, /*! path element */
- ELEMENT_GROUP = 2, /*! group element */
- ELEMENT_TEXT = 3, /*! text element */
- ELEMENT_TSPAN = 4, /*! tspan element */
- ELEMENT_FONT = 5, /*! font element */
- ELEMENT_TTF_FONT = 6, /*! ttf-type font */
- ELEMENT_VECTOR_FONT = 7, /*! vector fonts */
- ELEMENT_TEXT_FONT = 8, /*! text fonts */
-} ELM_ELEMENT_TYPE;
-
-#define COUNT_OF(array) (sizeof(array) / sizeof(array[0]))
- /*
- System definitions.
- */
-#define DEBUG_ASSERT(a, message) \
- if (!a) \
- printf("%s: ASSERT failed @ %s, %d.\n", message, __FILE__, __LINE__)
-
- /*!
- @typedef el_Object
- common object type definition shared by all EVO object to identify its handle,
- object type, and ELM version info.
- for reference purpose, handle = 0 is reserved.
- */
- typedef struct {
- ElmHandle handle;
- ELM_OBJECT_TYPE type;
- unsigned int reference; // Reference count by other objects.
-#if (RTOS && DDRLESS) || BAREMETAL
- int index; /* The index of the object in pool. */
-#endif
- } el_Object;
-
- /*!
- @typedef el_Transform
- The transformation attribute for an EVO/EBO/Group object.
- */
- typedef struct {
- float rotate;
- float translate[2];
- float scale[2];
- BOOL dirty;
- BOOL identity;
- vg_lite_matrix_t matrix;
- } el_Transform;
-
- /*!
- @typedef el_GradData
- Linear gradient definition.
- !grad the native vg_lite gradient data;
- !gransform the grad's transformation. matrix is synced to grad's.
- */
- typedef struct {
- vg_lite_linear_gradient_t grad;
- el_Transform transform;
- } el_GradData;
-
- /*!
- @typedef el_RadgradData
- Radial gradient definition.
- !rad_grad the native vg_lite_radial_gradient data;
- !gransform the grad's transformation. matrix is synced to grad's.
- */
- typedef struct {
- vg_lite_radial_gradient_t rad_grad;
- el_Transform transform;
- } el_RadgradData;
-
- /*!
- @typedef el_Obj_Grad
- The linear gradient object definition.
- */
- typedef struct {
- el_Object object;
- el_GradData data;
- } el_Obj_Grad;
-
- /*!
- @typedef el_Obj_Radgrad
- The radial gradient object definition.
- */
- typedef struct {
- el_Object object;
- el_RadgradData data;
- } el_Obj_Radgrad;
-
- /*!
- @typedef el_Obj_Pattern
- The pattern paint object definition.
- pattern: it should be an pointer to an el_Obj_EVO;
- mode: the pattern fill mode.
- color: the color value if pattern mode is COLOR
- */
- typedef struct {
- void *pattern;
- ELM_PATTERN_MODE mode;
- uint32_t color;
- } el_Obj_Pattern;
-
- /*!
- @typedef el_Paint
- The paint object definition.
- color: for solid fill;
- grad: for linear gradient fill;
- pattern: for image fill.
- */
- typedef struct {
- ELM_PAINT_TYPE type;
- uint32_t color;
- el_Obj_Grad * grad;
- el_Obj_Radgrad * radgrad;
- el_Obj_Pattern pattern;
- } el_Paint;
-
- /*!
- @typedef el_Attribute
- The rendering attribute definition.
- */
- typedef struct {
- ELM_QUALITY quality;
- ELM_BLEND blend;
- ELM_EVO_FILL fill_rule;
- el_Paint paint;
- el_Transform transform;
- } el_Attribute;
-
- /*!
- @typedef el_EVOData
- The data definition for EVO (vector object).
- */
- typedef struct {
- vg_lite_path_t path;
- } el_EVOData;
-
- /*!
- @typedef el_Obj_EVO
- EVO (Elementry Vector Object) type definition.
- */
- typedef struct {
- el_Object object;
- el_Attribute attribute;
- el_Attribute defaultAttrib;
- el_EVOData data;
- uint32_t has_pattern;
- uint32_t is_pattern;
- uint32_t is_image;
- char eboname[20];
- uint32_t img_width;
- uint32_t img_height;
- } el_Obj_EVO;
-
- /*!
- @typedef el_EBOData
- The data definition for EBO (bitmap object).
- */
- typedef struct {
- vg_lite_buffer_t buffer;
- } el_EBOData;
-
- /*!
- @typedef el_Obj_EBO
- EBO (Elementry Buffer Object) type definition.
- */
- typedef struct {
- el_Object object;
- el_Attribute attribute;
- el_Attribute defaultAttrib;
- el_EBOData data;
- uint32_t clut_count;
- uint32_t clut[256];
- } el_Obj_EBO;
-
- /*!
- @typedef el_GroupData
- The group object data definition.
- */
- typedef struct {
- unsigned int count;
- el_Obj_EVO * objects;
- } el_GroupData;
-
- /*!
- @typedef el_Obj_Group
- Group object type definition.
- */
- typedef struct {
- el_Object object;
- el_Transform transform;
- el_Transform defaultTrans;
- el_GroupData group;
- } el_Obj_Group;
-
- /*!
- @typedef el_Obj_Buffer
- The render buffer object definition.
- */
- typedef struct {
- el_Object object;
- vg_lite_buffer_t buffer;
- } el_Obj_Buffer;
-
- /*!
- @typedef el_ObjList
- List to organize objects.
- */
- typedef struct _object_list{
- el_Object *object;
- struct _object_list *next;
- } el_ObjList;
-
- /*!
- @typedef ElmRenderBuffer
- The ElmRenderBuffer definition.
- */
- typedef struct elm_render_buffer {
- ElmBuffer handle;
- vg_lite_buffer_t *buffer;
- } ElmRenderBuffer;
-
- /*!
- @typedef el_Context
- The context object for global data management.
- !version UXDK version
- !currentHandle The current handle for new object
- !objectCount Count of all objects
- !object_slots List array to manage objects
- */
- typedef struct {
- uint32_t version;
- int reference;
- ElmHandle currentHandle;
- unsigned int objectCount;
- el_ObjList *object_slots[SLOT_COUNT];
- ElmRenderBuffer elmFB[APP_BUFFER_COUNT];
- /* VGLite related states. */
- uint32_t tessellation_width;
- uint32_t tessellation_height;
-
- /* The current vector index (within a group). */
- int32_t vector_id;
-
-#if (RTOS && DDRLESS) || BAREMETAL
- /* Static object pools. */
- el_Obj_Grad objpool_grad[OBJCOUNT_GRAD];
- el_Obj_EVO objpool_evo[OBJCOUNT_EVO];
- el_Obj_EBO objpool_ebo[OBJCOUNT_EBO];
- el_Obj_Group objpool_group[OBJCOUNT_GROUP];
-
- /* The allocation map table.
- * Each bit in the element maps to the usage of the object.
- * 0 means free, 1 means allocated.
- * The mapping order is 01234567...31 (hi -> low) in big endian systems.
- * */
- int32_t objmap_grad[(OBJCOUNT_GRAD + 31) / 32];
- int32_t objmap_evo[(OBJCOUNT_EVO + 31) / 32];
- int32_t objmap_ebo[(OBJCOUNT_EBO + 31) / 32];
- int32_t objmap_group[(OBJCOUNT_GROUP + 31) / 32];
-
- int objcounter_grad;
- int objcounter_evo;
- int objcounter_ebo;
- int objcounter_group;
-#endif
- } el_Context;
-
- /*!
- @typedef elm_tls_t
- The elm_tls_t definition.
- */
- typedef struct vglite_elm_tls {
- el_Context gContext;
- } elm_tls_t;
-
- /*
- API function prototypes.
- */
- int add_object (el_Object *object);
- int remove_object (el_Object *object);
- el_Object *get_object (ElmHandle handle);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* VELM_H_ */
+/****************************************************************************
+*
+* Copyright 2012 - 2020 Vivante Corporation, Santa Clara, California.
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#ifndef VELM_H_
+#define VELM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ */
+#define VERSION 0x00000001
+#define SLOT_COUNT 256/*16*/
+#define OBJECT_SLOT(id) \
+ elm_tls->gContext.object_slots[id % SLOT_COUNT]
+
+ /*
+ VGLite releated configurations.
+ */
+#define TS_WIDTH 64
+#define TS_HEIGHT 64
+#define RTOS 1
+#define APP_BUFFER_COUNT 2
+#if (RTOS && DDRLESS) || BAREMETAL
+#define OBJCOUNT_GRAD 16
+#define OBJCOUNT_EVO 128
+#define OBJCOUNT_EBO 64
+#define OBJCOUNT_GROUP 16
+#endif
+
+#if RTOS
+#include "FreeRTOS.h"
+
+#define elm_alloc(num_objects,object_size) pvPortMalloc(num_objects * object_size)
+#define elm_free vPortFree
+#else
+#define elm_alloc calloc
+#define elm_free free
+#endif
+
+typedef enum {
+ ELEMENT_LINEARGRADIENT = 0, /*! linear gradient element */
+ ELEMENT_PATH = 1, /*! path element */
+ ELEMENT_GROUP = 2, /*! group element */
+ ELEMENT_TEXT = 3, /*! text element */
+ ELEMENT_TSPAN = 4, /*! tspan element */
+ ELEMENT_FONT = 5, /*! font element */
+ ELEMENT_TTF_FONT = 6, /*! ttf-type font */
+ ELEMENT_VECTOR_FONT = 7, /*! vector fonts */
+ ELEMENT_TEXT_FONT = 8, /*! text fonts */
+} ELM_ELEMENT_TYPE;
+
+#define COUNT_OF(array) (sizeof(array) / sizeof(array[0]))
+ /*
+ System definitions.
+ */
+#define DEBUG_ASSERT(a, message) \
+ if (!a) \
+ printf("%s: ASSERT failed @ %s, %d.\n", message, __FILE__, __LINE__)
+
+ /*!
+ @typedef el_Object
+ common object type definition shared by all EVO object to identify its handle,
+ object type, and ELM version info.
+ for reference purpose, handle = 0 is reserved.
+ */
+ typedef struct {
+ ElmHandle handle;
+ ELM_OBJECT_TYPE type;
+ unsigned int reference; // Reference count by other objects.
+#if (RTOS && DDRLESS) || BAREMETAL
+ int index; /* The index of the object in pool. */
+#endif
+ } el_Object;
+
+ /*!
+ @typedef el_Transform
+ The transformation attribute for an EVO/EBO/Group object.
+ */
+ typedef struct {
+ float rotate;
+ float translate[2];
+ float scale[2];
+ BOOL dirty;
+ BOOL identity;
+ vg_lite_matrix_t matrix;
+ } el_Transform;
+
+ /*!
+ @typedef el_GradData
+ Linear gradient definition.
+ !grad the native vg_lite gradient data;
+ !gransform the grad's transformation. matrix is synced to grad's.
+ */
+ typedef struct {
+ vg_lite_linear_gradient_t grad;
+ el_Transform transform;
+ } el_GradData;
+
+ /*!
+ @typedef el_RadgradData
+ Radial gradient definition.
+ !rad_grad the native vg_lite_radial_gradient data;
+ !gransform the grad's transformation. matrix is synced to grad's.
+ */
+ typedef struct {
+ vg_lite_radial_gradient_t rad_grad;
+ el_Transform transform;
+ } el_RadgradData;
+
+ /*!
+ @typedef el_Obj_Grad
+ The linear gradient object definition.
+ */
+ typedef struct {
+ el_Object object;
+ el_GradData data;
+ } el_Obj_Grad;
+
+ /*!
+ @typedef el_Obj_Radgrad
+ The radial gradient object definition.
+ */
+ typedef struct {
+ el_Object object;
+ el_RadgradData data;
+ } el_Obj_Radgrad;
+
+ /*!
+ @typedef el_Obj_Pattern
+ The pattern paint object definition.
+ pattern: it should be an pointer to an el_Obj_EVO;
+ mode: the pattern fill mode.
+ color: the color value if pattern mode is COLOR
+ */
+ typedef struct {
+ void *pattern;
+ ELM_PATTERN_MODE mode;
+ uint32_t color;
+ } el_Obj_Pattern;
+
+ /*!
+ @typedef el_Paint
+ The paint object definition.
+ color: for solid fill;
+ grad: for linear gradient fill;
+ pattern: for image fill.
+ */
+ typedef struct {
+ ELM_PAINT_TYPE type;
+ uint32_t color;
+ el_Obj_Grad * grad;
+ el_Obj_Radgrad * radgrad;
+ el_Obj_Pattern pattern;
+ } el_Paint;
+
+ /*!
+ @typedef el_Attribute
+ The rendering attribute definition.
+ */
+ typedef struct {
+ ELM_QUALITY quality;
+ ELM_BLEND blend;
+ ELM_EVO_FILL fill_rule;
+ el_Paint paint;
+ el_Transform transform;
+ } el_Attribute;
+
+ /*!
+ @typedef el_EVOData
+ The data definition for EVO (vector object).
+ */
+ typedef struct {
+ vg_lite_path_t path;
+ } el_EVOData;
+
+ /*!
+ @typedef el_Obj_EVO
+ EVO (Elementry Vector Object) type definition.
+ */
+ typedef struct {
+ el_Object object;
+ el_Attribute attribute;
+ el_Attribute defaultAttrib;
+ el_EVOData data;
+ uint32_t has_pattern;
+ uint32_t is_pattern;
+ uint32_t is_image;
+ char eboname[20];
+ uint32_t img_width;
+ uint32_t img_height;
+ } el_Obj_EVO;
+
+ /*!
+ @typedef el_EBOData
+ The data definition for EBO (bitmap object).
+ */
+ typedef struct {
+ vg_lite_buffer_t buffer;
+ } el_EBOData;
+
+ /*!
+ @typedef el_Obj_EBO
+ EBO (Elementry Buffer Object) type definition.
+ */
+ typedef struct {
+ el_Object object;
+ el_Attribute attribute;
+ el_Attribute defaultAttrib;
+ el_EBOData data;
+ uint32_t clut_count;
+ uint32_t clut[256];
+ } el_Obj_EBO;
+
+ /*!
+ @typedef el_GroupData
+ The group object data definition.
+ */
+ typedef struct {
+ unsigned int count;
+ el_Obj_EVO * objects;
+ } el_GroupData;
+
+ /*!
+ @typedef el_Obj_Group
+ Group object type definition.
+ */
+ typedef struct {
+ el_Object object;
+ el_Transform transform;
+ el_Transform defaultTrans;
+ el_GroupData group;
+ } el_Obj_Group;
+
+ /*!
+ @typedef el_Obj_Buffer
+ The render buffer object definition.
+ */
+ typedef struct {
+ el_Object object;
+ vg_lite_buffer_t buffer;
+ } el_Obj_Buffer;
+
+ /*!
+ @typedef el_ObjList
+ List to organize objects.
+ */
+ typedef struct _object_list{
+ el_Object *object;
+ struct _object_list *next;
+ } el_ObjList;
+
+ /*!
+ @typedef ElmRenderBuffer
+ The ElmRenderBuffer definition.
+ */
+ typedef struct elm_render_buffer {
+ ElmBuffer handle;
+ vg_lite_buffer_t *buffer;
+ } ElmRenderBuffer;
+
+ /*!
+ @typedef el_Context
+ The context object for global data management.
+ !version UXDK version
+ !currentHandle The current handle for new object
+ !objectCount Count of all objects
+ !object_slots List array to manage objects
+ */
+ typedef struct {
+ uint32_t version;
+ int reference;
+ ElmHandle currentHandle;
+ unsigned int objectCount;
+ el_ObjList *object_slots[SLOT_COUNT];
+ ElmRenderBuffer elmFB[APP_BUFFER_COUNT];
+ /* VGLite related states. */
+ uint32_t tessellation_width;
+ uint32_t tessellation_height;
+
+ /* The current vector index (within a group). */
+ int32_t vector_id;
+
+#if (RTOS && DDRLESS) || BAREMETAL
+ /* Static object pools. */
+ el_Obj_Grad objpool_grad[OBJCOUNT_GRAD];
+ el_Obj_EVO objpool_evo[OBJCOUNT_EVO];
+ el_Obj_EBO objpool_ebo[OBJCOUNT_EBO];
+ el_Obj_Group objpool_group[OBJCOUNT_GROUP];
+
+ /* The allocation map table.
+ * Each bit in the element maps to the usage of the object.
+ * 0 means free, 1 means allocated.
+ * The mapping order is 01234567...31 (hi -> low) in big endian systems.
+ * */
+ int32_t objmap_grad[(OBJCOUNT_GRAD + 31) / 32];
+ int32_t objmap_evo[(OBJCOUNT_EVO + 31) / 32];
+ int32_t objmap_ebo[(OBJCOUNT_EBO + 31) / 32];
+ int32_t objmap_group[(OBJCOUNT_GROUP + 31) / 32];
+
+ int objcounter_grad;
+ int objcounter_evo;
+ int objcounter_ebo;
+ int objcounter_group;
+#endif
+ } el_Context;
+
+ /*!
+ @typedef elm_tls_t
+ The elm_tls_t definition.
+ */
+ typedef struct vglite_elm_tls {
+ el_Context gContext;
+ } elm_tls_t;
+
+ /*
+ API function prototypes.
+ */
+ int add_object (el_Object *object);
+ int remove_object (el_Object *object);
+ el_Object *get_object (ElmHandle handle);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* VELM_H_ */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.c b/bsp/sdk_overlay/middleware/vglite/font/buf_reader.c
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.c
rename to bsp/sdk_overlay/middleware/vglite/font/buf_reader.c
index 110bf22..5eeaaf4 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/buf_reader.c
@@ -1,221 +1,221 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-#include "buf_reader.h"
-#include "stdio.h"
-#include "string.h"
-
-#define DBG_TRACE(x) printf x
-
-static int _is_buffered_handle_valid(bufferred_reader_t *fd)
-{
- if (fd == NULL)
- return E_BUF_INVALID_HANDLE;
- if ( fd->data_buf == NULL )
- return E_BUF_INVALID_HANDLE;
- if ( fd->size < 0 )
- return E_BUF_INVALID_HANDLE;
- if ( fd->index > fd->size )
- return E_BUF_INVALID_HANDLE;
-
- return 0;
-}
-
-/* Write buffered IO operations */
-int bufferred_fopen(bufferred_reader_t *fd, char *buf, int size)
-{
- if (fd == NULL)
- return E_BUF_INVALID_HANDLE;
-
- fd->data_buf = buf;
- fd->size = size;
- fd->index = 0;
-
- if ( _is_buffered_handle_valid(fd)) {
- return E_BUF_INVALID_HANDLE;
- }
-
- fd->is_valid = 1;
-
- return 0;
-}
-
-int bufferred_ftell(bufferred_reader_t *fd)
-{
- if ( _is_buffered_handle_valid(fd)) {
- return E_BUF_INVALID_HANDLE;
- }
-
- return fd->index;
-}
-
-int bufferred_fread(
- void *ptr,
- int size,
- int nmemb,
- bufferred_reader_t *fd
-)
-{
- int to_copy = 0;
- char *data_ptr = NULL;
- char *buff = (char *)ptr;
- int byte_to_read = size * nmemb;
-
- if ( _is_buffered_handle_valid(fd)) {
- return E_BUF_INVALID_HANDLE;
- }
-
- if ( buff == NULL ) {
- return E_BUF_IO_INVALID_PARAMETERS;
- }
-
- if ( byte_to_read < 0 ) {
- return E_BUF_IO_INVALID_PARAMETERS;
- }
-
- to_copy = (fd->size - fd->index);
- data_ptr = fd->data_buf + fd->index;
-
- if ( to_copy > byte_to_read )
- to_copy = byte_to_read;
-
- if (to_copy <= 0)
- return -1; //EOF
-
- memcpy(buff, data_ptr, to_copy);
-
- fd->index += to_copy;
-
- return 0;
-}
-
-int bufferred_fseek(
- bufferred_reader_t *fd,
- int offset,
- int direction
-)
-{
- if ( _is_buffered_handle_valid(fd)) {
- return E_BUF_INVALID_HANDLE;
- }
-
- switch(direction)
- {
- case SEEK_SET:
- fd->index = offset;
- break;
- case SEEK_CUR:
- fd->index += offset;
- break;
- case SEEK_END:
- fd->index = fd->size - offset;
- break;
- }
-
- /* Clamp current offset */
- if ( fd->index > fd->size ) {
- DBG_TRACE(("WARNING: seeking beyond buffer size\n"));
- fd->index = fd->size;
- }
- if ( fd->index < 0 ) {
- DBG_TRACE(("WARNING: seeking beyond buffer size\n"));
- fd->index = 0;
- }
-
- return 0;
-}
-
-int bufferred_fclose(bufferred_reader_t *fd)
-{
- if ( _is_buffered_handle_valid(fd)) {
- return E_BUF_INVALID_HANDLE;
- }
-
- fd->size = -1;
- fd->is_valid = 0;
-
- return 0;
-}
-
-char *bufferred_fgets(char* buff, int len, bufferred_reader_t *fd)
-{
- char *ptr;
- int i, j, valid_bytes;
-
- if ( buff == NULL ) {
- return NULL;
- }
-
- if ( len <= 0 ) {
- return NULL;
- }
-
- if ( _is_buffered_handle_valid(fd)) {
- return NULL;
- }
-
- /* Check how many bytes are available to read */
- valid_bytes = fd->size - fd->index;
- if ( len > 0 )
- len -=1; /* fgets read one character less than buffer length */
- if ( len > valid_bytes )
- len = valid_bytes;
-
- if ( valid_bytes <= 0 )
- return NULL;
-
- ptr = fd->data_buf + fd->index;
- for(i=0; ptr[i] != '\0' && i < len; i++)
- {
- if ( ptr[i] == '\n' )
- break;
- if ( ptr[i] == '\r' )
- break;
- buff[i] = ptr[i];
- }
- buff[i] = '\0';
- j = i;
- /* skip trailing newline from file buffer */
- if ( ptr[i] == '\r' )
- i++;
- if ( ptr[i] == '\n' )
- i++;
- fd->index += i;
-
- /* Trim trailing spaces from output buffer */
- for (i = j-1 ; i>0; i--) {
- if (buff[i] == ' ')
- buff[i] = '\0';
- else
- break;
- }
-
-
- return ptr;
-
-}
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+#include "buf_reader.h"
+#include "stdio.h"
+#include "string.h"
+
+#define DBG_TRACE(x) printf x
+
+static int _is_buffered_handle_valid(bufferred_reader_t *fd)
+{
+ if (fd == NULL)
+ return E_BUF_INVALID_HANDLE;
+ if ( fd->data_buf == NULL )
+ return E_BUF_INVALID_HANDLE;
+ if ( fd->size < 0 )
+ return E_BUF_INVALID_HANDLE;
+ if ( fd->index > fd->size )
+ return E_BUF_INVALID_HANDLE;
+
+ return 0;
+}
+
+/* Write buffered IO operations */
+int bufferred_fopen(bufferred_reader_t *fd, char *buf, int size)
+{
+ if (fd == NULL)
+ return E_BUF_INVALID_HANDLE;
+
+ fd->data_buf = buf;
+ fd->size = size;
+ fd->index = 0;
+
+ if ( _is_buffered_handle_valid(fd)) {
+ return E_BUF_INVALID_HANDLE;
+ }
+
+ fd->is_valid = 1;
+
+ return 0;
+}
+
+int bufferred_ftell(bufferred_reader_t *fd)
+{
+ if ( _is_buffered_handle_valid(fd)) {
+ return E_BUF_INVALID_HANDLE;
+ }
+
+ return fd->index;
+}
+
+int bufferred_fread(
+ void *ptr,
+ int size,
+ int nmemb,
+ bufferred_reader_t *fd
+)
+{
+ int to_copy = 0;
+ char *data_ptr = NULL;
+ char *buff = (char *)ptr;
+ int byte_to_read = size * nmemb;
+
+ if ( _is_buffered_handle_valid(fd)) {
+ return E_BUF_INVALID_HANDLE;
+ }
+
+ if ( buff == NULL ) {
+ return E_BUF_IO_INVALID_PARAMETERS;
+ }
+
+ if ( byte_to_read < 0 ) {
+ return E_BUF_IO_INVALID_PARAMETERS;
+ }
+
+ to_copy = (fd->size - fd->index);
+ data_ptr = fd->data_buf + fd->index;
+
+ if ( to_copy > byte_to_read )
+ to_copy = byte_to_read;
+
+ if (to_copy <= 0)
+ return -1; //EOF
+
+ memcpy(buff, data_ptr, to_copy);
+
+ fd->index += to_copy;
+
+ return 0;
+}
+
+int bufferred_fseek(
+ bufferred_reader_t *fd,
+ int offset,
+ int direction
+)
+{
+ if ( _is_buffered_handle_valid(fd)) {
+ return E_BUF_INVALID_HANDLE;
+ }
+
+ switch(direction)
+ {
+ case SEEK_SET:
+ fd->index = offset;
+ break;
+ case SEEK_CUR:
+ fd->index += offset;
+ break;
+ case SEEK_END:
+ fd->index = fd->size - offset;
+ break;
+ }
+
+ /* Clamp current offset */
+ if ( fd->index > fd->size ) {
+ DBG_TRACE(("WARNING: seeking beyond buffer size\n"));
+ fd->index = fd->size;
+ }
+ if ( fd->index < 0 ) {
+ DBG_TRACE(("WARNING: seeking beyond buffer size\n"));
+ fd->index = 0;
+ }
+
+ return 0;
+}
+
+int bufferred_fclose(bufferred_reader_t *fd)
+{
+ if ( _is_buffered_handle_valid(fd)) {
+ return E_BUF_INVALID_HANDLE;
+ }
+
+ fd->size = -1;
+ fd->is_valid = 0;
+
+ return 0;
+}
+
+char *bufferred_fgets(char* buff, int len, bufferred_reader_t *fd)
+{
+ char *ptr;
+ int i, j, valid_bytes;
+
+ if ( buff == NULL ) {
+ return NULL;
+ }
+
+ if ( len <= 0 ) {
+ return NULL;
+ }
+
+ if ( _is_buffered_handle_valid(fd)) {
+ return NULL;
+ }
+
+ /* Check how many bytes are available to read */
+ valid_bytes = fd->size - fd->index;
+ if ( len > 0 )
+ len -=1; /* fgets read one character less than buffer length */
+ if ( len > valid_bytes )
+ len = valid_bytes;
+
+ if ( valid_bytes <= 0 )
+ return NULL;
+
+ ptr = fd->data_buf + fd->index;
+ for(i=0; ptr[i] != '\0' && i < len; i++)
+ {
+ if ( ptr[i] == '\n' )
+ break;
+ if ( ptr[i] == '\r' )
+ break;
+ buff[i] = ptr[i];
+ }
+ buff[i] = '\0';
+ j = i;
+ /* skip trailing newline from file buffer */
+ if ( ptr[i] == '\r' )
+ i++;
+ if ( ptr[i] == '\n' )
+ i++;
+ fd->index += i;
+
+ /* Trim trailing spaces from output buffer */
+ for (i = j-1 ; i>0; i--) {
+ if (buff[i] == ' ')
+ buff[i] = '\0';
+ else
+ break;
+ }
+
+
+ return ptr;
+
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.h b/bsp/sdk_overlay/middleware/vglite/font/buf_reader.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.h
rename to bsp/sdk_overlay/middleware/vglite/font/buf_reader.h
index 2e8756f..9b85035 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/buf_reader.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/buf_reader.h
@@ -1,63 +1,63 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-/* Bufferred reader interface */
-#ifndef _BUFFERRED_READER_
-#define _BUFFERRED_READER_
-
-typedef struct buffered_reader {
- char *data_buf;
- int size;
- int index;
- int is_valid;
-} bufferred_reader_t;
-
-#define E_BUF_IO_OUT_OF_MEMORY -10
-#define E_BUF_IO_READ_ERROR -11
-#define E_BUF_INVALID_HANDLE -12
-#define E_BUF_IO_INVALID_PARAMETERS -13
-
-int is_buffered_handle_valid(bufferred_reader_t *fd);
-int bufferred_fopen(bufferred_reader_t *fd, char *buf, int size);
-int bufferred_ftell(bufferred_reader_t *fd);
-int bufferred_fread(
- void *ptr,
- int size,
- int nmemb,
- bufferred_reader_t *fd
-);
-int bufferred_fseek(
- bufferred_reader_t *fd,
- int offset,
- int direction
-);
-int bufferred_fclose(bufferred_reader_t *fd);
-char *bufferred_fgets(char* buff, int len, bufferred_reader_t *fd);
-
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+/* Bufferred reader interface */
+#ifndef _BUFFERRED_READER_
+#define _BUFFERRED_READER_
+
+typedef struct buffered_reader {
+ char *data_buf;
+ int size;
+ int index;
+ int is_valid;
+} bufferred_reader_t;
+
+#define E_BUF_IO_OUT_OF_MEMORY -10
+#define E_BUF_IO_READ_ERROR -11
+#define E_BUF_INVALID_HANDLE -12
+#define E_BUF_IO_INVALID_PARAMETERS -13
+
+int is_buffered_handle_valid(bufferred_reader_t *fd);
+int bufferred_fopen(bufferred_reader_t *fd, char *buf, int size);
+int bufferred_ftell(bufferred_reader_t *fd);
+int bufferred_fread(
+ void *ptr,
+ int size,
+ int nmemb,
+ bufferred_reader_t *fd
+);
+int bufferred_fseek(
+ bufferred_reader_t *fd,
+ int offset,
+ int direction
+);
+int bufferred_fclose(bufferred_reader_t *fd);
+char *bufferred_fgets(char* buff, int len, bufferred_reader_t *fd);
+
#endif //!_BUFFERRED_READER_
\ No newline at end of file
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/fonts.h b/bsp/sdk_overlay/middleware/vglite/font/fonts.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/fonts.h
rename to bsp/sdk_overlay/middleware/vglite/font/fonts.h
index 40ebe27..d260789 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/fonts.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/fonts.h
@@ -1,30 +1,30 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#define ABS_ARY(x) (void *)x, sizeof(x), 0
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#define ABS_ARY(x) (void *)x, sizeof(x), 0
diff --git a/bsp/sdk_overlay/middleware/vglite/font/mcufont/LICENSE b/bsp/sdk_overlay/middleware/vglite/font/mcufont/LICENSE
new file mode 100644
index 0000000..b67f3cf
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/LICENSE
@@ -0,0 +1,31 @@
+mcufont is available under the MIT license:
+
+Copyright (C) 2013 Petteri Aimonen
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+---
+
+In addition, the files under the "decoder" folder and all font files
+generated by the encoder are placed in the public domain. You can do
+anything with them without any restriction from me.
+
+Note that the licenses of the fonts you import may pose additional
+restrictions.
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h
similarity index 95%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h
index 8a81ff4..e02733b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mcufont.h
@@ -1,14 +1,14 @@
-/* Tiny library for rendering compressed bitmap fonts on microcontrollers. */
-
-#ifndef _MCUFONT_H_
-#define _MCUFONT_H_
-
-#include "mf_config.h"
-#include "mf_encoding.h"
-#include "mf_justify.h"
-#include "mf_kerning.h"
-#include "mf_rlefont.h"
-#include "mf_scaledfont.h"
-#include "mf_wordwrap.h"
-
-#endif
+/* Tiny library for rendering compressed bitmap fonts on microcontrollers. */
+
+#ifndef _MCUFONT_H_
+#define _MCUFONT_H_
+
+#include "mf_config.h"
+#include "mf_encoding.h"
+#include "mf_justify.h"
+#include "mf_kerning.h"
+#include "mf_rlefont.h"
+#include "mf_scaledfont.h"
+#include "mf_wordwrap.h"
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c
index a7b6530..20ab35b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.c
@@ -1,134 +1,134 @@
-#include "mf_bwfont.h"
-#include
-
-/* Find the character range and index that contains a given glyph.. */
-static const struct mf_bwfont_char_range_s *find_char_range(
- const struct mf_bwfont_s *font, uint16_t character, uint16_t *index_ret)
-{
- unsigned i, index;
- const struct mf_bwfont_char_range_s *range;
- for (i = 0; i < font->char_range_count; i++)
- {
- range = &font->char_ranges[i];
- index = character - range->first_char;
- if (character >= range->first_char && index < range->char_count)
- {
- *index_ret = index;
- return range;
- }
- }
-
- return 0;
-}
-
-static uint8_t get_width(const struct mf_bwfont_char_range_s *r, uint16_t index)
-{
- if (r->width)
- {
- return r->width + r->offset_x;
- }
- else
- {
- return r->glyph_widths[index];
- }
-}
-
-static uint8_t render_char(const struct mf_bwfont_char_range_s *r,
- int16_t x0, int16_t y0, uint16_t index,
- mf_pixel_callback_t callback,
- void *state)
-{
- const uint8_t *data, *p;
- uint8_t stride, runlen;
- uint8_t x, y, height, num_cols;
- uint8_t bit, byte, mask;
- bool oldstate, newstate;
-
- if (r->width)
- {
- data = r->glyph_data + r->width * index * r->height_bytes;
- num_cols = r->width;
- }
- else
- {
- data = r->glyph_data + r->glyph_offsets[index] * r->height_bytes;
- num_cols = r->glyph_offsets[index + 1] - r->glyph_offsets[index];
- }
-
- stride = r->height_bytes;
- height = r->height_pixels;
- y0 += r->offset_y;
- x0 += r->offset_x;
- bit = 0;
- byte = 0;
-
- for (y = 0; y < height; y++)
- {
- mask = (1 << bit);
-
- oldstate = false;
- runlen = 0;
- p = data + byte;
- for (x = 0; x < num_cols; x++, p += stride)
- {
- newstate = pgm_read_byte(p) & mask;
- if (newstate != oldstate)
- {
- if (oldstate && runlen)
- {
- callback(x0 + x - runlen, y0 + y, runlen, 255, state);
- }
-
- oldstate = newstate;
- runlen = 0;
- }
-
- runlen++;
- }
-
- if (oldstate && runlen)
- {
- callback(x0 + x - runlen, y0 + y, runlen, 255, state);
- }
-
- bit++;
- if (bit > 7)
- {
- bit = 0;
- byte++;
- }
- }
-
- return get_width(r, index);
-}
-
-uint8_t mf_bwfont_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- uint16_t character,
- mf_pixel_callback_t callback,
- void *state)
-{
- const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font;
- const struct mf_bwfont_char_range_s *range;
- uint16_t index;
-
- range = find_char_range(bwfont, character, &index);
- if (!range)
- return 0;
-
- return render_char(range, x0, y0, index, callback, state);
-}
-
-uint8_t mf_bwfont_character_width(const struct mf_font_s *font,
- uint16_t character)
-{
- const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font;
- const struct mf_bwfont_char_range_s *range;
- uint16_t index;
-
- range = find_char_range(bwfont, character, &index);
- if (!range)
- return 0;
-
- return get_width(range, index);
-}
+#include "mf_bwfont.h"
+#include
+
+/* Find the character range and index that contains a given glyph.. */
+static const struct mf_bwfont_char_range_s *find_char_range(
+ const struct mf_bwfont_s *font, uint16_t character, uint16_t *index_ret)
+{
+ unsigned i, index;
+ const struct mf_bwfont_char_range_s *range;
+ for (i = 0; i < font->char_range_count; i++)
+ {
+ range = &font->char_ranges[i];
+ index = character - range->first_char;
+ if (character >= range->first_char && index < range->char_count)
+ {
+ *index_ret = index;
+ return range;
+ }
+ }
+
+ return 0;
+}
+
+static uint8_t get_width(const struct mf_bwfont_char_range_s *r, uint16_t index)
+{
+ if (r->width)
+ {
+ return r->width + r->offset_x;
+ }
+ else
+ {
+ return r->glyph_widths[index];
+ }
+}
+
+static uint8_t render_char(const struct mf_bwfont_char_range_s *r,
+ int16_t x0, int16_t y0, uint16_t index,
+ mf_pixel_callback_t callback,
+ void *state)
+{
+ const uint8_t *data, *p;
+ uint8_t stride, runlen;
+ uint8_t x, y, height, num_cols;
+ uint8_t bit, byte, mask;
+ bool oldstate, newstate;
+
+ if (r->width)
+ {
+ data = r->glyph_data + r->width * index * r->height_bytes;
+ num_cols = r->width;
+ }
+ else
+ {
+ data = r->glyph_data + r->glyph_offsets[index] * r->height_bytes;
+ num_cols = r->glyph_offsets[index + 1] - r->glyph_offsets[index];
+ }
+
+ stride = r->height_bytes;
+ height = r->height_pixels;
+ y0 += r->offset_y;
+ x0 += r->offset_x;
+ bit = 0;
+ byte = 0;
+
+ for (y = 0; y < height; y++)
+ {
+ mask = (1 << bit);
+
+ oldstate = false;
+ runlen = 0;
+ p = data + byte;
+ for (x = 0; x < num_cols; x++, p += stride)
+ {
+ newstate = pgm_read_byte(p) & mask;
+ if (newstate != oldstate)
+ {
+ if (oldstate && runlen)
+ {
+ callback(x0 + x - runlen, y0 + y, runlen, 255, state);
+ }
+
+ oldstate = newstate;
+ runlen = 0;
+ }
+
+ runlen++;
+ }
+
+ if (oldstate && runlen)
+ {
+ callback(x0 + x - runlen, y0 + y, runlen, 255, state);
+ }
+
+ bit++;
+ if (bit > 7)
+ {
+ bit = 0;
+ byte++;
+ }
+ }
+
+ return get_width(r, index);
+}
+
+uint8_t mf_bwfont_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ uint16_t character,
+ mf_pixel_callback_t callback,
+ void *state)
+{
+ const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font;
+ const struct mf_bwfont_char_range_s *range;
+ uint16_t index;
+
+ range = find_char_range(bwfont, character, &index);
+ if (!range)
+ return 0;
+
+ return render_char(range, x0, y0, index, callback, state);
+}
+
+uint8_t mf_bwfont_character_width(const struct mf_font_s *font,
+ uint16_t character)
+{
+ const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font;
+ const struct mf_bwfont_char_range_s *range;
+ uint16_t index;
+
+ range = find_char_range(bwfont, character, &index);
+ if (!range)
+ return 0;
+
+ return get_width(range, index);
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h
index aadcbf2..1863a76 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_bwfont.h
@@ -1,77 +1,77 @@
-/* Uncompressed font format for storing black & white fonts. Very efficient
- * to decode and works well for small font sizes.
- */
-
-#ifndef _MF_BWFONT_H_
-#define _MF_BWFONT_H_
-
-#include "mf_font.h"
-
-/* Versions of the BW font format that are supported. */
-#define MF_BWFONT_VERSION_4_SUPPORTED 1
-
-/* Structure for a range of characters. */
-struct mf_bwfont_char_range_s
-{
- /* The number of the first character in this range. */
- uint16_t first_char;
-
- /* The total count of characters in this range. */
- uint16_t char_count;
-
- /* The left and top skips of the characters in this range.
- * This is the number of empty rows at left and at top. */
- uint8_t offset_x;
- uint8_t offset_y;
-
- /* Column height for glyphs in this range, in bytes and pixels. */
- uint8_t height_bytes;
- uint8_t height_pixels;
-
- /* Positive value if the width of all glyphs in this range is the
- * same, or zero if it is not. */
- uint8_t width;
-
- /* Lookup table for the character widths. NULL if width is specified. */
- uint8_t *glyph_widths;
-
- /* Lookup table for the character offsets. Multiply by height_bytes
- * to get the byte offset. Also allows lookup of the number of columns.
- * NULL if width is specified. */
- uint16_t *glyph_offsets;
-
- /* Table for the glyph data.
- * The data for each glyph is column-by-column, with N bytes per each
- * column. The LSB of the first byte is the top left pixel.
- */
- uint8_t *glyph_data;
-};
-
-/* Structure for the font */
-struct mf_bwfont_s
-{
- struct mf_font_s font;
-
- /* Version of the font format. */
- uint8_t version;
-
- /* Number of character ranges. */
- uint8_t char_range_count;
-
- /* Array of the character ranges */
- struct mf_bwfont_char_range_s *char_ranges;
-};
-
-#ifdef MF_BWFONT_INTERNALS
-/* Internal functions, don't use these directly. */
-MF_EXTERN uint8_t mf_bwfont_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state);
-
-MF_EXTERN uint8_t mf_bwfont_character_width(const struct mf_font_s *font,
- mf_char character);
-#endif
-
-#endif
+/* Uncompressed font format for storing black & white fonts. Very efficient
+ * to decode and works well for small font sizes.
+ */
+
+#ifndef _MF_BWFONT_H_
+#define _MF_BWFONT_H_
+
+#include "mf_font.h"
+
+/* Versions of the BW font format that are supported. */
+#define MF_BWFONT_VERSION_4_SUPPORTED 1
+
+/* Structure for a range of characters. */
+struct mf_bwfont_char_range_s
+{
+ /* The number of the first character in this range. */
+ uint16_t first_char;
+
+ /* The total count of characters in this range. */
+ uint16_t char_count;
+
+ /* The left and top skips of the characters in this range.
+ * This is the number of empty rows at left and at top. */
+ uint8_t offset_x;
+ uint8_t offset_y;
+
+ /* Column height for glyphs in this range, in bytes and pixels. */
+ uint8_t height_bytes;
+ uint8_t height_pixels;
+
+ /* Positive value if the width of all glyphs in this range is the
+ * same, or zero if it is not. */
+ uint8_t width;
+
+ /* Lookup table for the character widths. NULL if width is specified. */
+ uint8_t *glyph_widths;
+
+ /* Lookup table for the character offsets. Multiply by height_bytes
+ * to get the byte offset. Also allows lookup of the number of columns.
+ * NULL if width is specified. */
+ uint16_t *glyph_offsets;
+
+ /* Table for the glyph data.
+ * The data for each glyph is column-by-column, with N bytes per each
+ * column. The LSB of the first byte is the top left pixel.
+ */
+ uint8_t *glyph_data;
+};
+
+/* Structure for the font */
+struct mf_bwfont_s
+{
+ struct mf_font_s font;
+
+ /* Version of the font format. */
+ uint8_t version;
+
+ /* Number of character ranges. */
+ uint8_t char_range_count;
+
+ /* Array of the character ranges */
+ struct mf_bwfont_char_range_s *char_ranges;
+};
+
+#ifdef MF_BWFONT_INTERNALS
+/* Internal functions, don't use these directly. */
+MF_EXTERN uint8_t mf_bwfont_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state);
+
+MF_EXTERN uint8_t mf_bwfont_character_width(const struct mf_font_s *font,
+ mf_char character);
+#endif
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h
index 492dcd4..f8a2d39 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_config.h
@@ -1,144 +1,144 @@
-/* Configuration constants for mcufont. */
-
-#ifndef _MF_CONFIG_H_
-#define _MF_CONFIG_H_
-
-#ifdef __AVR__
- #include
-#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
- #include
-#else
- #include
- #define PROGMEM
- #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
- #define pgm_read_word(addr) (*(const uint16_t *)(addr))
-#endif /* __AVR__ */
-
-
-/*******************************************************
- * Configuration settings related to build environment *
- *******************************************************/
-
-/* Name of the file that contains all the included fonts. */
-#ifndef MF_FONT_FILE_NAME
-#define MF_FONT_FILE_NAME "fonts.h"
-#endif
-
-
-/*****************************************
- * Configuration settings related to API *
- *****************************************/
-
-/* Encoding for the input data.
- * With the unicode encodings, the library supports the range of unicode
- * characters 0x0000-0xFFFF (the Basic Multilingual Plane).
- *
- * ASCII: Plain ascii (somewhat works with ISO8859-1 also)
- * UTF8: UTF8 encoding (variable number of bytes)
- * UTF16: UTF16 encoding (2 bytes per character, compatible with UCS-2)
- * WCHAR: Use compiler's wchar_t (usually same as UTF16)
- */
-#define MF_ENCODING_ASCII 0
-#define MF_ENCODING_UTF8 1
-#define MF_ENCODING_UTF16 2
-#define MF_ENCODING_WCHAR 3
-#ifndef MF_ENCODING
-#define MF_ENCODING MF_ENCODING_UTF8
-#endif
-
-
-/************************************************************************
- * Configuration settings related to visual appearance of rendered text *
- ************************************************************************/
-
-/* Minimum space between characters, in percents of the glyph width.
- * Increasing this causes the kerning module to leave more space between
- * characters.
- */
-#ifndef MF_KERNING_SPACE_PERCENT
-#define MF_KERNING_SPACE_PERCENT 15
-#endif
-
-/* Minimum space between characters, in pixels. Added to the percentual
- * spacing. This pixel-based value guarantees enough space even with small
- * fonts.
- */
-#ifndef MF_KERNING_SPACE_PIXELS
-#define MF_KERNING_SPACE_PIXELS 3
-#endif
-
-/* Maximum adjustment done by the kerning algorithm, as percent of the
- * glyph width.
- */
-#ifndef MF_KERNING_LIMIT
-#define MF_KERNING_LIMIT 20
-#endif
-
-/* Spacing of tabulator stops. The value is multiplied by the width of the
- * 'm' character in the current font.
- */
-#ifndef MF_TABSIZE
-#define MF_TABSIZE 8
-#endif
-
-
-/*************************************************************************
- * Configuration settings to strip down library to reduce resource usage *
- *************************************************************************/
-
-/* Enable or disable the kerning module.
- * Disabling it saves some code size and run time, but causes the spacing
- * between characters to be less consistent.
- */
-#ifndef MF_USE_KERNING
-#define MF_USE_KERNING 1
-#endif
-
-/* Enable or disable the advanced word wrap algorithm.
- * If disabled, uses a simpler algorithm.
- */
-#ifndef MF_USE_ADVANCED_WORDWRAP
-#define MF_USE_ADVANCED_WORDWRAP 1
-#endif
-
-/* Enable of disable the justification algorithm.
- * If disabled, mf_render_justified renders just left-aligned.
- */
-#ifndef MF_USE_JUSTIFY
-#define MF_USE_JUSTIFY 1
-#endif
-
-/* Enable or disable the center and right alignment code.
- * If disabled, any alignment results in MF_ALIGN_LEFT.
- */
-#ifndef MF_USE_ALIGN
-#define MF_USE_ALIGN 1
-#endif
-
-/* Enable or disable the support for tab alignment.
- * If disabled, tabs will be rendered as regular space character.
- */
-#ifndef MF_USE_TABS
-#define MF_USE_TABS 1
-#endif
-
-/* Number of vertical zones to use when computing kerning.
- * Larger values give more accurate kerning, but are slower and use somewhat
- * more memory. There is no point to increase this beyond the height of the
- * font.
- */
-#ifndef MF_KERNING_ZONES
-#define MF_KERNING_ZONES 16
-#endif
-
-
-
-/* Add extern "C" when used from C++. */
-#ifdef __cplusplus
-#define MF_EXTERN extern "C"
-#else
-#define MF_EXTERN extern
-#endif
-
-#endif
-
+/* Configuration constants for mcufont. */
+
+#ifndef _MF_CONFIG_H_
+#define _MF_CONFIG_H_
+
+#ifdef __AVR__
+ #include
+#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
+ #include
+#else
+ #include
+ #define PROGMEM
+ #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
+ #define pgm_read_word(addr) (*(const uint16_t *)(addr))
+#endif /* __AVR__ */
+
+
+/*******************************************************
+ * Configuration settings related to build environment *
+ *******************************************************/
+
+/* Name of the file that contains all the included fonts. */
+#ifndef MF_FONT_FILE_NAME
+#define MF_FONT_FILE_NAME "fonts.h"
+#endif
+
+
+/*****************************************
+ * Configuration settings related to API *
+ *****************************************/
+
+/* Encoding for the input data.
+ * With the unicode encodings, the library supports the range of unicode
+ * characters 0x0000-0xFFFF (the Basic Multilingual Plane).
+ *
+ * ASCII: Plain ascii (somewhat works with ISO8859-1 also)
+ * UTF8: UTF8 encoding (variable number of bytes)
+ * UTF16: UTF16 encoding (2 bytes per character, compatible with UCS-2)
+ * WCHAR: Use compiler's wchar_t (usually same as UTF16)
+ */
+#define MF_ENCODING_ASCII 0
+#define MF_ENCODING_UTF8 1
+#define MF_ENCODING_UTF16 2
+#define MF_ENCODING_WCHAR 3
+#ifndef MF_ENCODING
+#define MF_ENCODING MF_ENCODING_UTF8
+#endif
+
+
+/************************************************************************
+ * Configuration settings related to visual appearance of rendered text *
+ ************************************************************************/
+
+/* Minimum space between characters, in percents of the glyph width.
+ * Increasing this causes the kerning module to leave more space between
+ * characters.
+ */
+#ifndef MF_KERNING_SPACE_PERCENT
+#define MF_KERNING_SPACE_PERCENT 15
+#endif
+
+/* Minimum space between characters, in pixels. Added to the percentual
+ * spacing. This pixel-based value guarantees enough space even with small
+ * fonts.
+ */
+#ifndef MF_KERNING_SPACE_PIXELS
+#define MF_KERNING_SPACE_PIXELS 3
+#endif
+
+/* Maximum adjustment done by the kerning algorithm, as percent of the
+ * glyph width.
+ */
+#ifndef MF_KERNING_LIMIT
+#define MF_KERNING_LIMIT 20
+#endif
+
+/* Spacing of tabulator stops. The value is multiplied by the width of the
+ * 'm' character in the current font.
+ */
+#ifndef MF_TABSIZE
+#define MF_TABSIZE 8
+#endif
+
+
+/*************************************************************************
+ * Configuration settings to strip down library to reduce resource usage *
+ *************************************************************************/
+
+/* Enable or disable the kerning module.
+ * Disabling it saves some code size and run time, but causes the spacing
+ * between characters to be less consistent.
+ */
+#ifndef MF_USE_KERNING
+#define MF_USE_KERNING 1
+#endif
+
+/* Enable or disable the advanced word wrap algorithm.
+ * If disabled, uses a simpler algorithm.
+ */
+#ifndef MF_USE_ADVANCED_WORDWRAP
+#define MF_USE_ADVANCED_WORDWRAP 1
+#endif
+
+/* Enable of disable the justification algorithm.
+ * If disabled, mf_render_justified renders just left-aligned.
+ */
+#ifndef MF_USE_JUSTIFY
+#define MF_USE_JUSTIFY 1
+#endif
+
+/* Enable or disable the center and right alignment code.
+ * If disabled, any alignment results in MF_ALIGN_LEFT.
+ */
+#ifndef MF_USE_ALIGN
+#define MF_USE_ALIGN 1
+#endif
+
+/* Enable or disable the support for tab alignment.
+ * If disabled, tabs will be rendered as regular space character.
+ */
+#ifndef MF_USE_TABS
+#define MF_USE_TABS 1
+#endif
+
+/* Number of vertical zones to use when computing kerning.
+ * Larger values give more accurate kerning, but are slower and use somewhat
+ * more memory. There is no point to increase this beyond the height of the
+ * font.
+ */
+#ifndef MF_KERNING_ZONES
+#define MF_KERNING_ZONES 16
+#endif
+
+
+
+/* Add extern "C" when used from C++. */
+#ifdef __cplusplus
+#define MF_EXTERN extern "C"
+#else
+#define MF_EXTERN extern
+#endif
+
+#endif
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c
similarity index 94%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c
index 74e13fe..8d1817b 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.c
@@ -1,84 +1,84 @@
-#include "mf_encoding.h"
-
-#if MF_ENCODING == MF_ENCODING_UTF8
-
-mf_char mf_getchar(mf_str *str)
-{
- uint8_t c;
- uint8_t tmp, seqlen;
- uint16_t result;
-
- c = **str;
- if (!c)
- return 0;
-
- (*str)++;
-
- if ((c & 0x80) == 0)
- {
- /* Just normal ASCII character. */
- return c;
- }
- else if ((c & 0xC0) == 0x80)
- {
- /* Dangling piece of corrupted multibyte sequence.
- * Did you cut the string in the wrong place?
- */
- return c;
- }
- else if ((**str & 0xC0) == 0xC0)
- {
- /* Start of multibyte sequence without any following bytes.
- * Silly. Maybe you are using the wrong encoding.
- */
- return c;
- }
- else
- {
- /* Beginning of a multi-byte sequence.
- * Find out how many characters and combine them.
- */
- seqlen = 2;
- tmp = 0x20;
- result = 0;
- while ((c & tmp) && (seqlen < 5))
- {
- seqlen++;
- tmp >>= 1;
-
- result = (result << 6) | (**str & 0x3F);
- (*str)++;
- }
-
- result = (result << 6) | (**str & 0x3F);
- (*str)++;
-
- result |= (c & (tmp - 1)) << ((seqlen - 1) * 6);
- return result;
- }
-}
-
-void mf_rewind(mf_str *str)
-{
- (*str)--;
-
- while ((**str & 0x80) != 0x00 && (**str & 0xC0) != 0xC0)
- (*str)--;
-}
-
-#else
-
-mf_char mf_getchar(mf_str *str)
-{
- if (!(**str))
- return 0;
- else
- return *(*str)++;
-}
-
-void mf_rewind(mf_str *str)
-{
- (*str)--;
-}
-
-#endif
+#include "mf_encoding.h"
+
+#if MF_ENCODING == MF_ENCODING_UTF8
+
+mf_char mf_getchar(mf_str *str)
+{
+ uint8_t c;
+ uint8_t tmp, seqlen;
+ uint16_t result;
+
+ c = **str;
+ if (!c)
+ return 0;
+
+ (*str)++;
+
+ if ((c & 0x80) == 0)
+ {
+ /* Just normal ASCII character. */
+ return c;
+ }
+ else if ((c & 0xC0) == 0x80)
+ {
+ /* Dangling piece of corrupted multibyte sequence.
+ * Did you cut the string in the wrong place?
+ */
+ return c;
+ }
+ else if ((**str & 0xC0) == 0xC0)
+ {
+ /* Start of multibyte sequence without any following bytes.
+ * Silly. Maybe you are using the wrong encoding.
+ */
+ return c;
+ }
+ else
+ {
+ /* Beginning of a multi-byte sequence.
+ * Find out how many characters and combine them.
+ */
+ seqlen = 2;
+ tmp = 0x20;
+ result = 0;
+ while ((c & tmp) && (seqlen < 5))
+ {
+ seqlen++;
+ tmp >>= 1;
+
+ result = (result << 6) | (**str & 0x3F);
+ (*str)++;
+ }
+
+ result = (result << 6) | (**str & 0x3F);
+ (*str)++;
+
+ result |= (c & (tmp - 1)) << ((seqlen - 1) * 6);
+ return result;
+ }
+}
+
+void mf_rewind(mf_str *str)
+{
+ (*str)--;
+
+ while ((**str & 0x80) != 0x00 && (**str & 0xC0) != 0xC0)
+ (*str)--;
+}
+
+#else
+
+mf_char mf_getchar(mf_str *str)
+{
+ if (!(**str))
+ return 0;
+ else
+ return *(*str)++;
+}
+
+void mf_rewind(mf_str *str)
+{
+ (*str)--;
+}
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h
index 68ddf14..cf04ef7 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_encoding.h
@@ -1,45 +1,45 @@
-/* Simple UTF-8 decoder. Also implements the much simpler ASCII and UTF16
- * input encodings.
- */
-
-#ifndef _MF_ENCODING_H_
-#define _MF_ENCODING_H_
-
-#include "mf_config.h"
-#include
-
-/* Type used to represent characters internally. */
-#if MF_ENCODING == MF_ENCODING_ASCII
-typedef char mf_char;
-#else
-typedef uint16_t mf_char;
-#endif
-
-/* Type used to represent input strings. */
-#if MF_ENCODING == MF_ENCODING_ASCII
-typedef const char * mf_str;
-#elif MF_ENCODING == MF_ENCODING_UTF8
-typedef const char * mf_str;
-#elif MF_ENCODING == MF_ENCODING_UTF16
-typedef const uint16_t * mf_str;
-#elif MF_ENCODING == MF_ENCODING_WCHAR
-#include
-typedef const wchar_t * mf_str;
-#endif
-
-/* Returns the next character in the string and advances the pointer.
- * When the string ends, returns 0 and leaves the pointer at the 0 byte.
- *
- * str: Pointer to variable holding current location in string.
- * Initialize it to the start of the string.
- *
- * Returns: The next character, as unicode codepoint.
- */
-MF_EXTERN mf_char mf_getchar(mf_str *str);
-
-/* Moves back the pointer to the beginning of the previous character.
- * Be careful not to go beyond the start of the string.
- */
-MF_EXTERN void mf_rewind(mf_str *str);
-
-#endif
+/* Simple UTF-8 decoder. Also implements the much simpler ASCII and UTF16
+ * input encodings.
+ */
+
+#ifndef _MF_ENCODING_H_
+#define _MF_ENCODING_H_
+
+#include "mf_config.h"
+#include
+
+/* Type used to represent characters internally. */
+#if MF_ENCODING == MF_ENCODING_ASCII
+typedef char mf_char;
+#else
+typedef uint16_t mf_char;
+#endif
+
+/* Type used to represent input strings. */
+#if MF_ENCODING == MF_ENCODING_ASCII
+typedef const char * mf_str;
+#elif MF_ENCODING == MF_ENCODING_UTF8
+typedef const char * mf_str;
+#elif MF_ENCODING == MF_ENCODING_UTF16
+typedef const uint16_t * mf_str;
+#elif MF_ENCODING == MF_ENCODING_WCHAR
+#include
+typedef const wchar_t * mf_str;
+#endif
+
+/* Returns the next character in the string and advances the pointer.
+ * When the string ends, returns 0 and leaves the pointer at the 0 byte.
+ *
+ * str: Pointer to variable holding current location in string.
+ * Initialize it to the start of the string.
+ *
+ * Returns: The next character, as unicode codepoint.
+ */
+MF_EXTERN mf_char mf_getchar(mf_str *str);
+
+/* Moves back the pointer to the beginning of the previous character.
+ * Be careful not to go beyond the start of the string.
+ */
+MF_EXTERN void mf_rewind(mf_str *str);
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c
index 58f91c5..8d87b31 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.c
@@ -1,122 +1,122 @@
-#include "mf_font.h"
-#include
-
-/* This will be made into a list of included fonts using macro magic. */
-#define MF_INCLUDED_FONTS 0
-
-/* Included fonts begin here */
-#include MF_FONT_FILE_NAME
-/* Include fonts end here */
-
-uint8_t mf_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state)
-{
- uint8_t width;
- width = font->render_character(font, x0, y0, character, callback, state);
-
- if (!width)
- {
- width = font->render_character(font, x0, y0, font->fallback_character,
- callback, state);
- }
-
- return width;
-}
-
-uint8_t mf_character_width(const struct mf_font_s *font,
- mf_char character)
-{
- uint8_t width;
- width = font->character_width(font, character);
-
- if (!width)
- {
- width = font->character_width(font, font->fallback_character);
- }
-
- return width;
-}
-
-struct whitespace_state
-{
- uint8_t min_x, min_y;
- uint8_t max_x, max_y;
-};
-
-static void whitespace_callback(int16_t x, int16_t y, uint8_t count,
- uint8_t alpha, void *state)
-{
- struct whitespace_state *s = state;
- if (alpha > 7)
- {
- if (s->min_x > x) s->min_x = x;
- if (s->min_y > y) s->min_y = y;
- x += count - 1;
- if (s->max_x < x) s->max_x = x;
- if (s->max_y < y) s->max_y = y;
- }
-}
-
-MF_EXTERN void mf_character_whitespace(const struct mf_font_s *font,
- mf_char character,
- uint8_t *left, uint8_t *top,
- uint8_t *right, uint8_t *bottom)
-{
- struct whitespace_state state = {255, 255, 0, 0};
- mf_render_character(font, 0, 0, character, whitespace_callback, &state);
-
- if (state.min_x == 255 && state.min_y == 255)
- {
- /* Character is whitespace */
- if (left) *left = font->width;
- if (top) *top = font->height;
- if (right) *right = 0;
- if (bottom) *bottom = 0;
- }
- else
- {
- if (left) *left = state.min_x;
- if (top) *top = state.min_y;
- if (right) *right = font->width - state.max_x - 1;
- if (bottom) *bottom = font->height - state.max_y - 1;
- }
-}
-
-/* Avoids a dependency on libc */
-static bool strequals(const char *a, const char *b)
-{
- while (*a)
- {
- if (*a++ != *b++)
- return false;
- }
- return (!*b);
-}
-
-const struct mf_font_s *mf_find_font(const char *name)
-{
- const struct mf_font_list_s *f;
- f = MF_INCLUDED_FONTS;
-
- while (f)
- {
- if (strequals(f->font->full_name, name) ||
- strequals(f->font->short_name, name))
- {
- return f->font;
- }
-
- f = f->next;
- }
-
- return 0;
-}
-
-const struct mf_font_list_s *mf_get_font_list()
-{
- return MF_INCLUDED_FONTS;
-}
-
+#include "mf_font.h"
+#include
+
+/* This will be made into a list of included fonts using macro magic. */
+#define MF_INCLUDED_FONTS 0
+
+/* Included fonts begin here */
+#include MF_FONT_FILE_NAME
+/* Include fonts end here */
+
+uint8_t mf_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state)
+{
+ uint8_t width;
+ width = font->render_character(font, x0, y0, character, callback, state);
+
+ if (!width)
+ {
+ width = font->render_character(font, x0, y0, font->fallback_character,
+ callback, state);
+ }
+
+ return width;
+}
+
+uint8_t mf_character_width(const struct mf_font_s *font,
+ mf_char character)
+{
+ uint8_t width;
+ width = font->character_width(font, character);
+
+ if (!width)
+ {
+ width = font->character_width(font, font->fallback_character);
+ }
+
+ return width;
+}
+
+struct whitespace_state
+{
+ uint8_t min_x, min_y;
+ uint8_t max_x, max_y;
+};
+
+static void whitespace_callback(int16_t x, int16_t y, uint8_t count,
+ uint8_t alpha, void *state)
+{
+ struct whitespace_state *s = state;
+ if (alpha > 7)
+ {
+ if (s->min_x > x) s->min_x = x;
+ if (s->min_y > y) s->min_y = y;
+ x += count - 1;
+ if (s->max_x < x) s->max_x = x;
+ if (s->max_y < y) s->max_y = y;
+ }
+}
+
+MF_EXTERN void mf_character_whitespace(const struct mf_font_s *font,
+ mf_char character,
+ uint8_t *left, uint8_t *top,
+ uint8_t *right, uint8_t *bottom)
+{
+ struct whitespace_state state = {255, 255, 0, 0};
+ mf_render_character(font, 0, 0, character, whitespace_callback, &state);
+
+ if (state.min_x == 255 && state.min_y == 255)
+ {
+ /* Character is whitespace */
+ if (left) *left = font->width;
+ if (top) *top = font->height;
+ if (right) *right = 0;
+ if (bottom) *bottom = 0;
+ }
+ else
+ {
+ if (left) *left = state.min_x;
+ if (top) *top = state.min_y;
+ if (right) *right = font->width - state.max_x - 1;
+ if (bottom) *bottom = font->height - state.max_y - 1;
+ }
+}
+
+/* Avoids a dependency on libc */
+static bool strequals(const char *a, const char *b)
+{
+ while (*a)
+ {
+ if (*a++ != *b++)
+ return false;
+ }
+ return (!*b);
+}
+
+const struct mf_font_s *mf_find_font(const char *name)
+{
+ const struct mf_font_list_s *f;
+ f = MF_INCLUDED_FONTS;
+
+ while (f)
+ {
+ if (strequals(f->font->full_name, name) ||
+ strequals(f->font->short_name, name))
+ {
+ return f->font;
+ }
+
+ f = f->next;
+ }
+
+ return 0;
+}
+
+const struct mf_font_list_s *mf_get_font_list()
+{
+ return MF_INCLUDED_FONTS;
+}
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h
index 6970937..309ed36 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_font.h
@@ -1,137 +1,137 @@
-/* Generic font type that supports fonts with multiple kinds of compression.
- * Provides an interface for decoding and rendering single characters.
- */
-
-#ifndef _MF_FONT_H_
-#define _MF_FONT_H_
-
-#include "mf_encoding.h"
-
-/* Callback function that writes pixels to screen / buffer / whatever.
- *
- * x: X coordinate of the first pixel to write.
- * y: Y coordinate of the first pixel to write.
- * count: Number of pixels to fill (horizontally).
- * alpha: The "opaqueness" of the pixels, 0 for background, 255 for text.
- * state: Free variable that was passed to render_character().
- */
-typedef void (*mf_pixel_callback_t) (int16_t x, int16_t y, uint8_t count,
- uint8_t alpha, void *state);
-
-/* General information about a font. */
-struct mf_font_s
-{
- /* Full name of the font, comes from the original font file. */
- char *full_name;
-
- /* Short name of the font, comes from file name. */
- char *short_name;
-
- /* Width and height of the character bounding box. */
- uint8_t width;
- uint8_t height;
-
- /* Minimum and maximum tracking width of characters. */
- uint8_t min_x_advance;
- uint8_t max_x_advance;
-
- /* Location of the text baseline relative to character. */
- int8_t baseline_x;
- uint8_t baseline_y;
-
- /* Line height of the font (vertical advance). */
- uint8_t line_height;
-
- /* Flags identifying various aspects of the font. */
- uint8_t flags;
-
- /* Fallback character to use for missing glyphs. */
- mf_char fallback_character;
-
- /* Function to get character width. Should return 0 if character is
- * not found. */
- uint8_t (*character_width)(const struct mf_font_s *font, mf_char character);
-
- /* Function to render a character. Returns the character width or 0 if
- * character is not found. */
- uint8_t (*render_character)(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state);
-};
-
-/* The flag definitions for the font.flags field. */
-#define MF_FONT_FLAG_MONOSPACE 0x01
-#define MF_FONT_FLAG_BW 0x02
-
-/* Lookup structure for searching fonts by name. */
-struct mf_font_list_s
-{
- const struct mf_font_list_s *next;
- const struct mf_font_s *font;
-};
-
-
-/* Function to decode and render a single character.
- *
- * font: Pointer to the font definition.
- * x0, y0: Upper left corner of the target area.
- * character: The character code (unicode) to render.
- * callback: Callback function to write out the pixels.
- * state: Free variable for caller to use (can be NULL).
- *
- * Returns width of the character.
- */
-MF_EXTERN uint8_t mf_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state);
-
-/* Function to get the width of a single character.
- * This is not necessarily the bounding box of the character
- * data, but rather the tracking width.
- *
- * font: Pointer to the font definition.
- * character: The character code (unicode) to check width of.
- *
- * Returns width of the character in pixels.
- */
-MF_EXTERN uint8_t mf_character_width(const struct mf_font_s *font,
- mf_char character);
-
-/* Count the amount of white space at the borders of a character.
- *
- * E.g. if the font->width and font->height are 10x20, but the character
- * is only a thin line at the very left edge, this function will return
- * (0, 0, 9, 0). If the character is fully whitespace, the function will
- * return (10, 20, 0, 0).
- *
- * font: Pointer to the font definition.
- * character: The character code (unicode) to check white space of.
- * left: Number of empty rows at left edge. Can be NULL.
- * top: Number of empty rows at top edge. Can be NULL.
- * right: Number of empty rows at right edge. Can be NULL.
- * bottom: Number of empty rows at bottom edge. Can be NULL.
- */
-MF_EXTERN void mf_character_whitespace(const struct mf_font_s *font,
- mf_char character,
- uint8_t *left, uint8_t *top,
- uint8_t *right, uint8_t *bottom);
-
-/* Find a font based on name. The name can be either short name or full name.
- * Note: You can pass MF_INCLUDED_FONTS to search among all the included .h
- * files.
- *
- * name: Font name to search for.
- * fonts: Pointer to the first font search entry.
- *
- * Returns a pointer to the font or NULL if not found.
- */
-MF_EXTERN const struct mf_font_s *mf_find_font(const char *name);
-
-/* Get the list of included fonts */
-MF_EXTERN const struct mf_font_list_s *mf_get_font_list();
-
-#endif
+/* Generic font type that supports fonts with multiple kinds of compression.
+ * Provides an interface for decoding and rendering single characters.
+ */
+
+#ifndef _MF_FONT_H_
+#define _MF_FONT_H_
+
+#include "mf_encoding.h"
+
+/* Callback function that writes pixels to screen / buffer / whatever.
+ *
+ * x: X coordinate of the first pixel to write.
+ * y: Y coordinate of the first pixel to write.
+ * count: Number of pixels to fill (horizontally).
+ * alpha: The "opaqueness" of the pixels, 0 for background, 255 for text.
+ * state: Free variable that was passed to render_character().
+ */
+typedef void (*mf_pixel_callback_t) (int16_t x, int16_t y, uint8_t count,
+ uint8_t alpha, void *state);
+
+/* General information about a font. */
+struct mf_font_s
+{
+ /* Full name of the font, comes from the original font file. */
+ char *full_name;
+
+ /* Short name of the font, comes from file name. */
+ char *short_name;
+
+ /* Width and height of the character bounding box. */
+ uint8_t width;
+ uint8_t height;
+
+ /* Minimum and maximum tracking width of characters. */
+ uint8_t min_x_advance;
+ uint8_t max_x_advance;
+
+ /* Location of the text baseline relative to character. */
+ int8_t baseline_x;
+ uint8_t baseline_y;
+
+ /* Line height of the font (vertical advance). */
+ uint8_t line_height;
+
+ /* Flags identifying various aspects of the font. */
+ uint8_t flags;
+
+ /* Fallback character to use for missing glyphs. */
+ mf_char fallback_character;
+
+ /* Function to get character width. Should return 0 if character is
+ * not found. */
+ uint8_t (*character_width)(const struct mf_font_s *font, mf_char character);
+
+ /* Function to render a character. Returns the character width or 0 if
+ * character is not found. */
+ uint8_t (*render_character)(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state);
+};
+
+/* The flag definitions for the font.flags field. */
+#define MF_FONT_FLAG_MONOSPACE 0x01
+#define MF_FONT_FLAG_BW 0x02
+
+/* Lookup structure for searching fonts by name. */
+struct mf_font_list_s
+{
+ const struct mf_font_list_s *next;
+ const struct mf_font_s *font;
+};
+
+
+/* Function to decode and render a single character.
+ *
+ * font: Pointer to the font definition.
+ * x0, y0: Upper left corner of the target area.
+ * character: The character code (unicode) to render.
+ * callback: Callback function to write out the pixels.
+ * state: Free variable for caller to use (can be NULL).
+ *
+ * Returns width of the character.
+ */
+MF_EXTERN uint8_t mf_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state);
+
+/* Function to get the width of a single character.
+ * This is not necessarily the bounding box of the character
+ * data, but rather the tracking width.
+ *
+ * font: Pointer to the font definition.
+ * character: The character code (unicode) to check width of.
+ *
+ * Returns width of the character in pixels.
+ */
+MF_EXTERN uint8_t mf_character_width(const struct mf_font_s *font,
+ mf_char character);
+
+/* Count the amount of white space at the borders of a character.
+ *
+ * E.g. if the font->width and font->height are 10x20, but the character
+ * is only a thin line at the very left edge, this function will return
+ * (0, 0, 9, 0). If the character is fully whitespace, the function will
+ * return (10, 20, 0, 0).
+ *
+ * font: Pointer to the font definition.
+ * character: The character code (unicode) to check white space of.
+ * left: Number of empty rows at left edge. Can be NULL.
+ * top: Number of empty rows at top edge. Can be NULL.
+ * right: Number of empty rows at right edge. Can be NULL.
+ * bottom: Number of empty rows at bottom edge. Can be NULL.
+ */
+MF_EXTERN void mf_character_whitespace(const struct mf_font_s *font,
+ mf_char character,
+ uint8_t *left, uint8_t *top,
+ uint8_t *right, uint8_t *bottom);
+
+/* Find a font based on name. The name can be either short name or full name.
+ * Note: You can pass MF_INCLUDED_FONTS to search among all the included .h
+ * files.
+ *
+ * name: Font name to search for.
+ * fonts: Pointer to the first font search entry.
+ *
+ * Returns a pointer to the font or NULL if not found.
+ */
+MF_EXTERN const struct mf_font_s *mf_find_font(const char *name);
+
+/* Get the list of included fonts */
+MF_EXTERN const struct mf_font_list_s *mf_get_font_list();
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c
index 623ab30..634c87c 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.c
@@ -1,332 +1,332 @@
-#include "mf_justify.h"
-#include "mf_kerning.h"
-
-#if MF_USE_TABS
-/* Round the X coordinate up to the nearest tab stop. */
-static int16_t mf_round_to_tab(const struct mf_font_s *font,
- int16_t x0, int16_t x)
-{
- int16_t tabw, dx;
-
- tabw = mf_character_width(font, 'm') * MF_TABSIZE;
-
- /* Always atleast 1 space */
- x += mf_character_width(font, ' ');
-
- /* Round to next tab stop */
- dx = x - x0 + font->baseline_x;
- x += tabw - (dx % tabw);
-
- return x;
-}
-
-/* Round the X coordinate down to the nearest tab stop. */
-static int16_t mf_round_to_prev_tab(const struct mf_font_s *font,
- int16_t x0, int16_t x)
-{
- int16_t tabw, dx;
-
- tabw = mf_character_width(font, 'm') * MF_TABSIZE;
-
- /* Always atleast 1 space */
- x -= mf_character_width(font, ' ');
-
- /* Round to previous tab stop */
- dx = x0 - x + font->baseline_x;
- x -= tabw - (dx % tabw);
-
- return x;
-}
-#endif
-
-int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text,
- uint16_t count, bool kern)
-{
- int16_t result = 0;
- uint16_t c1 = 0, c2;
-
- if (!count)
- count = 0xFFFF;
-
- while (count-- && *text)
- {
- c2 = mf_getchar(&text);
-
- if (c2 == '\t')
- {
-#if MF_USE_TABS
- result = mf_round_to_tab(font, 0, result);
- c1 = ' ';
- continue;
-#else
- c2 = ' ';
-#endif
- }
-
- if (kern && c1 != 0)
- result += mf_compute_kerning(font, c1, c2);
-
- result += mf_character_width(font, c2);
- c1 = c2;
- }
-
- return result;
-}
-
-/* Return the length of the string without trailing spaces. */
-static uint16_t strip_spaces(mf_str text, uint16_t count, mf_char *last_char)
-{
- uint16_t i = 0, result = 0;
- mf_char tmp = 0;
-
- if (!count)
- count = 0xFFFF;
-
- while (count-- && *text)
- {
- i++;
- tmp = mf_getchar(&text);
- if (tmp != ' ' && tmp != 0xA0 && tmp != '\n' &&
- tmp != '\r' && tmp != '\t')
- {
- result = i;
- }
- }
-
- if (last_char)
- {
- if (!*text)
- *last_char = 0;
- else
- *last_char = tmp;
- }
-
- return result;
-}
-
-/* Render left-aligned string, left edge at x0. */
-static void render_left(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- int16_t x;
- mf_char c1 = 0, c2;
-
- x = x0 - font->baseline_x;
- while (count--)
- {
- c2 = mf_getchar(&text);
-
- if (c2 == '\t')
- {
-#if MF_USE_TABS
- x = mf_round_to_tab(font, x0, x);
- c1 = ' ';
- continue;
-#else
- c2 = ' ';
-#endif
- }
-
- if (c1 != 0)
- x += mf_compute_kerning(font, c1, c2);
-
- x += callback(x, y0, c2, state);
- c1 = c2;
- }
-}
-
-#if !MF_USE_ALIGN
-
-void mf_render_aligned(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- enum mf_align_t align,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- int16_t string_width;
- count = strip_spaces(text, count, 0);
- render_left(font, x0, y0, text, count, callback, state);
-}
-
-#else
-
-/* Render right-aligned string, right edge at x0. */
-static void render_right(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- int16_t x;
- uint16_t i;
- mf_char c1, c2 = 0;
- mf_str tmp;
-
- /* Go to the end of the line. */
- for (i = 0; i < count; i++)
- mf_getchar(&text);
-
- x = x0 - font->baseline_x;
- for (i = 0; i < count; i++)
- {
- mf_rewind(&text);
- tmp = text;
- c1 = mf_getchar(&tmp);
-
- /* Perform tab alignment */
- if (c1 == '\t')
- {
-#if MF_USE_TABS
- x = mf_round_to_prev_tab(font, x0, x);
- c2 = ' ';
- continue;
-#else
- c1 = ' ';
-#endif
- }
-
- /* Apply the nominal character width */
- x -= mf_character_width(font, c1);
-
- /* Apply kerning */
- if (c2 != 0)
- x -= mf_compute_kerning(font, c1, c2);
-
- callback(x, y0, c1, state);
- c2 = c1;
- }
-}
-
-void mf_render_aligned(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- enum mf_align_t align,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- int16_t string_width;
- count = strip_spaces(text, count, 0);
-
- if (align == MF_ALIGN_LEFT)
- {
- render_left(font, x0, y0, text, count, callback, state);
- }
- if (align == MF_ALIGN_CENTER)
- {
- string_width = mf_get_string_width(font, text, count, false);
- x0 -= string_width / 2;
- render_left(font, x0, y0, text, count, callback, state);
- }
- else if (align == MF_ALIGN_RIGHT)
- {
- render_right(font, x0, y0, text, count, callback, state);
- }
-}
-
-#endif
-
-
-#if !MF_USE_JUSTIFY
-
-void mf_render_justified(const struct mf_font_s *font,
- int16_t x0, int16_t y0, int16_t width,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- mf_render_aligned(font, x0, y0, MF_ALIGN_LEFT, text, count, callback, state);
-}
-
-#else
-
-/* Returns true if the character is a justification point, i.e. expands
- * when the text is being justified. */
-static bool is_justify_space(uint16_t c)
-{
- return c == ' ' || c == 0xA0;
-}
-
-/* Count the number of space characters in string */
-static uint16_t count_spaces(mf_str text, uint16_t count)
-{
- uint16_t spaces = 0;
- while (count-- && *text)
- {
- if (is_justify_space(mf_getchar(&text)))
- spaces++;
- }
- return spaces;
-}
-
-void mf_render_justified(const struct mf_font_s *font,
- int16_t x0, int16_t y0, int16_t width,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state)
-{
- int16_t string_width, adjustment;
- uint16_t num_spaces;
- mf_char last_char;
-
- count = strip_spaces(text, count, &last_char);
-
- if (last_char == '\n' || last_char == 0)
- {
- /* Line ends in linefeed, do not justify. */
- render_left(font, x0, y0, text, count, callback, state);
- return;
- }
-
- string_width = mf_get_string_width(font, text, count, false);
- adjustment = width - string_width;
- num_spaces = count_spaces(text, count);
-
- {
- int16_t x, tmp;
- uint16_t c1 = 0, c2;
-
- x = x0 - font->baseline_x;
- while (count--)
- {
- c2 = mf_getchar(&text);
-
- if (c2 == '\t')
- {
-#if MF_USE_TABS
- tmp = x;
- x = mf_round_to_tab(font, x0, x);
- adjustment -= x - tmp - mf_character_width(font, '\t');
- c1 = c2;
- continue;
-#else
- c2 = ' ';
-#endif
- }
-
- if (is_justify_space(c2))
- {
- tmp = (adjustment + num_spaces / 2) / num_spaces;
- adjustment -= tmp;
- num_spaces--;
- x += tmp;
- }
-
- if (c1 != 0)
- {
- tmp = mf_compute_kerning(font, c1, c2);
- x += tmp;
- adjustment -= tmp;
- }
-
- x += callback(x, y0, c2, state);
- c1 = c2;
- }
- }
-}
-
-#endif
-
+#include "mf_justify.h"
+#include "mf_kerning.h"
+
+#if MF_USE_TABS
+/* Round the X coordinate up to the nearest tab stop. */
+static int16_t mf_round_to_tab(const struct mf_font_s *font,
+ int16_t x0, int16_t x)
+{
+ int16_t tabw, dx;
+
+ tabw = mf_character_width(font, 'm') * MF_TABSIZE;
+
+ /* Always atleast 1 space */
+ x += mf_character_width(font, ' ');
+
+ /* Round to next tab stop */
+ dx = x - x0 + font->baseline_x;
+ x += tabw - (dx % tabw);
+
+ return x;
+}
+
+/* Round the X coordinate down to the nearest tab stop. */
+static int16_t mf_round_to_prev_tab(const struct mf_font_s *font,
+ int16_t x0, int16_t x)
+{
+ int16_t tabw, dx;
+
+ tabw = mf_character_width(font, 'm') * MF_TABSIZE;
+
+ /* Always atleast 1 space */
+ x -= mf_character_width(font, ' ');
+
+ /* Round to previous tab stop */
+ dx = x0 - x + font->baseline_x;
+ x -= tabw - (dx % tabw);
+
+ return x;
+}
+#endif
+
+int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text,
+ uint16_t count, bool kern)
+{
+ int16_t result = 0;
+ uint16_t c1 = 0, c2;
+
+ if (!count)
+ count = 0xFFFF;
+
+ while (count-- && *text)
+ {
+ c2 = mf_getchar(&text);
+
+ if (c2 == '\t')
+ {
+#if MF_USE_TABS
+ result = mf_round_to_tab(font, 0, result);
+ c1 = ' ';
+ continue;
+#else
+ c2 = ' ';
+#endif
+ }
+
+ if (kern && c1 != 0)
+ result += mf_compute_kerning(font, c1, c2);
+
+ result += mf_character_width(font, c2);
+ c1 = c2;
+ }
+
+ return result;
+}
+
+/* Return the length of the string without trailing spaces. */
+static uint16_t strip_spaces(mf_str text, uint16_t count, mf_char *last_char)
+{
+ uint16_t i = 0, result = 0;
+ mf_char tmp = 0;
+
+ if (!count)
+ count = 0xFFFF;
+
+ while (count-- && *text)
+ {
+ i++;
+ tmp = mf_getchar(&text);
+ if (tmp != ' ' && tmp != 0xA0 && tmp != '\n' &&
+ tmp != '\r' && tmp != '\t')
+ {
+ result = i;
+ }
+ }
+
+ if (last_char)
+ {
+ if (!*text)
+ *last_char = 0;
+ else
+ *last_char = tmp;
+ }
+
+ return result;
+}
+
+/* Render left-aligned string, left edge at x0. */
+static void render_left(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ int16_t x;
+ mf_char c1 = 0, c2;
+
+ x = x0 - font->baseline_x;
+ while (count--)
+ {
+ c2 = mf_getchar(&text);
+
+ if (c2 == '\t')
+ {
+#if MF_USE_TABS
+ x = mf_round_to_tab(font, x0, x);
+ c1 = ' ';
+ continue;
+#else
+ c2 = ' ';
+#endif
+ }
+
+ if (c1 != 0)
+ x += mf_compute_kerning(font, c1, c2);
+
+ x += callback(x, y0, c2, state);
+ c1 = c2;
+ }
+}
+
+#if !MF_USE_ALIGN
+
+void mf_render_aligned(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ enum mf_align_t align,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ int16_t string_width;
+ count = strip_spaces(text, count, 0);
+ render_left(font, x0, y0, text, count, callback, state);
+}
+
+#else
+
+/* Render right-aligned string, right edge at x0. */
+static void render_right(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ int16_t x;
+ uint16_t i;
+ mf_char c1, c2 = 0;
+ mf_str tmp;
+
+ /* Go to the end of the line. */
+ for (i = 0; i < count; i++)
+ mf_getchar(&text);
+
+ x = x0 - font->baseline_x;
+ for (i = 0; i < count; i++)
+ {
+ mf_rewind(&text);
+ tmp = text;
+ c1 = mf_getchar(&tmp);
+
+ /* Perform tab alignment */
+ if (c1 == '\t')
+ {
+#if MF_USE_TABS
+ x = mf_round_to_prev_tab(font, x0, x);
+ c2 = ' ';
+ continue;
+#else
+ c1 = ' ';
+#endif
+ }
+
+ /* Apply the nominal character width */
+ x -= mf_character_width(font, c1);
+
+ /* Apply kerning */
+ if (c2 != 0)
+ x -= mf_compute_kerning(font, c1, c2);
+
+ callback(x, y0, c1, state);
+ c2 = c1;
+ }
+}
+
+void mf_render_aligned(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ enum mf_align_t align,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ int16_t string_width;
+ count = strip_spaces(text, count, 0);
+
+ if (align == MF_ALIGN_LEFT)
+ {
+ render_left(font, x0, y0, text, count, callback, state);
+ }
+ if (align == MF_ALIGN_CENTER)
+ {
+ string_width = mf_get_string_width(font, text, count, false);
+ x0 -= string_width / 2;
+ render_left(font, x0, y0, text, count, callback, state);
+ }
+ else if (align == MF_ALIGN_RIGHT)
+ {
+ render_right(font, x0, y0, text, count, callback, state);
+ }
+}
+
+#endif
+
+
+#if !MF_USE_JUSTIFY
+
+void mf_render_justified(const struct mf_font_s *font,
+ int16_t x0, int16_t y0, int16_t width,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ mf_render_aligned(font, x0, y0, MF_ALIGN_LEFT, text, count, callback, state);
+}
+
+#else
+
+/* Returns true if the character is a justification point, i.e. expands
+ * when the text is being justified. */
+static bool is_justify_space(uint16_t c)
+{
+ return c == ' ' || c == 0xA0;
+}
+
+/* Count the number of space characters in string */
+static uint16_t count_spaces(mf_str text, uint16_t count)
+{
+ uint16_t spaces = 0;
+ while (count-- && *text)
+ {
+ if (is_justify_space(mf_getchar(&text)))
+ spaces++;
+ }
+ return spaces;
+}
+
+void mf_render_justified(const struct mf_font_s *font,
+ int16_t x0, int16_t y0, int16_t width,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state)
+{
+ int16_t string_width, adjustment;
+ uint16_t num_spaces;
+ mf_char last_char;
+
+ count = strip_spaces(text, count, &last_char);
+
+ if (last_char == '\n' || last_char == 0)
+ {
+ /* Line ends in linefeed, do not justify. */
+ render_left(font, x0, y0, text, count, callback, state);
+ return;
+ }
+
+ string_width = mf_get_string_width(font, text, count, false);
+ adjustment = width - string_width;
+ num_spaces = count_spaces(text, count);
+
+ {
+ int16_t x, tmp;
+ uint16_t c1 = 0, c2;
+
+ x = x0 - font->baseline_x;
+ while (count--)
+ {
+ c2 = mf_getchar(&text);
+
+ if (c2 == '\t')
+ {
+#if MF_USE_TABS
+ tmp = x;
+ x = mf_round_to_tab(font, x0, x);
+ adjustment -= x - tmp - mf_character_width(font, '\t');
+ c1 = c2;
+ continue;
+#else
+ c2 = ' ';
+#endif
+ }
+
+ if (is_justify_space(c2))
+ {
+ tmp = (adjustment + num_spaces / 2) / num_spaces;
+ adjustment -= tmp;
+ num_spaces--;
+ x += tmp;
+ }
+
+ if (c1 != 0)
+ {
+ tmp = mf_compute_kerning(font, c1, c2);
+ x += tmp;
+ adjustment -= tmp;
+ }
+
+ x += callback(x, y0, c2, state);
+ c1 = c2;
+ }
+ }
+}
+
+#endif
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h
index c3e8ba7..437c0e2 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_justify.h
@@ -1,74 +1,74 @@
-/* Text alignment and justification algorithm. Supports left, right, center
- * alignment and justify. Supports tab stops and kerning.
- */
-
-#ifndef _MF_JUSTIFY_H_
-#define _MF_JUSTIFY_H_
-
-#include "mf_rlefont.h"
-#include
-
-enum mf_align_t
-{
- MF_ALIGN_LEFT = 0,
- MF_ALIGN_CENTER,
- MF_ALIGN_RIGHT
-};
-
-/* Callback for rendering a single character.
- * x0: Left edge of the target position of character.
- * y0: Upper edge of the target position of character.
- * character: Character to render.
- * state: Free state variable for use by the callback.
- * Returns the width of the character.
- */
-typedef uint8_t (*mf_character_callback_t) (int16_t x0, int16_t y0,
- mf_char character, void *state);
-
-/* Get width of a string in pixels.
- *
- * font: Pointer to the font definition.
- * text: Pointer to start of the text to measure.
- * count: Number of characters on the line or 0 to read until end of string.
- * kern: True to consider kerning (slower).
- */
-MF_EXTERN int16_t mf_get_string_width(const struct mf_font_s *font,
- mf_str text, uint16_t count, bool kern);
-
-/* Render a single line of aligned text.
- *
- * font: Pointer to the font definition.
- * x0: Depending on aligned, either left, center or right edge of target.
- * y0: Upper edge of the target area.
- * align: Type of alignment.
- * text: Pointer to start of the text to render.
- * count: Number of characters on the line or 0 to read until end of string.
- * callback: Callback to call for each character.
- * state: Free variable for use in the callback.
- */
-MF_EXTERN void mf_render_aligned(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- enum mf_align_t align,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state);
-
-/* Render a single line of justified text.
- *
- * font: Pointer to the font definition.
- * x0: Left edge of the target area.
- * y0: Upper edge of the target area.
- * width: Width of the target area.
- * text: Pointer to start of the text to render.
- * count: Number of characters on the line or 0 to read until end of string.
- * callback: Callback to call for each character.
- * state: Free variable for use in the callback.
- */
-MF_EXTERN void mf_render_justified(const struct mf_font_s *font,
- int16_t x0, int16_t y0, int16_t width,
- mf_str text, uint16_t count,
- mf_character_callback_t callback,
- void *state);
-
-
-#endif
+/* Text alignment and justification algorithm. Supports left, right, center
+ * alignment and justify. Supports tab stops and kerning.
+ */
+
+#ifndef _MF_JUSTIFY_H_
+#define _MF_JUSTIFY_H_
+
+#include "mf_rlefont.h"
+#include
+
+enum mf_align_t
+{
+ MF_ALIGN_LEFT = 0,
+ MF_ALIGN_CENTER,
+ MF_ALIGN_RIGHT
+};
+
+/* Callback for rendering a single character.
+ * x0: Left edge of the target position of character.
+ * y0: Upper edge of the target position of character.
+ * character: Character to render.
+ * state: Free state variable for use by the callback.
+ * Returns the width of the character.
+ */
+typedef uint8_t (*mf_character_callback_t) (int16_t x0, int16_t y0,
+ mf_char character, void *state);
+
+/* Get width of a string in pixels.
+ *
+ * font: Pointer to the font definition.
+ * text: Pointer to start of the text to measure.
+ * count: Number of characters on the line or 0 to read until end of string.
+ * kern: True to consider kerning (slower).
+ */
+MF_EXTERN int16_t mf_get_string_width(const struct mf_font_s *font,
+ mf_str text, uint16_t count, bool kern);
+
+/* Render a single line of aligned text.
+ *
+ * font: Pointer to the font definition.
+ * x0: Depending on aligned, either left, center or right edge of target.
+ * y0: Upper edge of the target area.
+ * align: Type of alignment.
+ * text: Pointer to start of the text to render.
+ * count: Number of characters on the line or 0 to read until end of string.
+ * callback: Callback to call for each character.
+ * state: Free variable for use in the callback.
+ */
+MF_EXTERN void mf_render_aligned(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ enum mf_align_t align,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state);
+
+/* Render a single line of justified text.
+ *
+ * font: Pointer to the font definition.
+ * x0: Left edge of the target area.
+ * y0: Upper edge of the target area.
+ * width: Width of the target area.
+ * text: Pointer to start of the text to render.
+ * count: Number of characters on the line or 0 to read until end of string.
+ * callback: Callback to call for each character.
+ * state: Free variable for use in the callback.
+ */
+MF_EXTERN void mf_render_justified(const struct mf_font_s *font,
+ int16_t x0, int16_t y0, int16_t width,
+ mf_str text, uint16_t count,
+ mf_character_callback_t callback,
+ void *state);
+
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c
index 51ce303..f2721ab 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.c
@@ -1,118 +1,118 @@
-#include "mf_kerning.h"
-#include
-
-#if MF_USE_KERNING
-
-/* Structure for keeping track of the edge of the glyph as it is rendered. */
-struct kerning_state_s
-{
- uint8_t edgepos[MF_KERNING_ZONES];
- uint8_t zoneheight;
-};
-
-/* Pixel callback for analyzing the left edge of a glyph. */
-static void fit_leftedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
- void *state)
-{
- struct kerning_state_s *s = state;
-
- if (alpha > 7)
- {
- uint8_t zone = y / s->zoneheight;
- if (x < s->edgepos[zone])
- s->edgepos[zone] = x;
- }
-}
-
-/* Pixel callback for analyzing the right edge of a glyph. */
-static void fit_rightedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
- void *state)
-{
- struct kerning_state_s *s = state;
-
- if (alpha > 7)
- {
- uint8_t zone = y / s->zoneheight;
- x += count - 1;
- if (x > s->edgepos[zone])
- s->edgepos[zone] = x;
- }
-}
-
-/* Should kerning be done against this character? */
-static bool do_kerning(mf_char c)
-{
- /* Just a speed optimization, spaces would be ignored anyway. */
- if (c == ' ' || c == '\n' || c == '\r' || c == '\t')
- return false;
-
- /* Do not kern against digits, in order to keep values in tables nicely
- * aligned. Most fonts have constant width for digits. */
- if (c >= '0' && c <= '9')
- return false;
-
- return true;
-}
-
-/*static int16_t min16(int16_t a, int16_t b) { return (a < b) ? a : b; }*/
-static int16_t max16(int16_t a, int16_t b) { return (a > b) ? a : b; }
-static int16_t avg16(int16_t a, int16_t b) { return (a + b) / 2; }
-
-int8_t mf_compute_kerning(const struct mf_font_s *font,
- mf_char c1, mf_char c2)
-{
- struct kerning_state_s leftedge, rightedge;
- uint8_t w1, w2, i, min_space;
- int16_t normal_space, adjust, max_adjust;
-
- if (font->flags & MF_FONT_FLAG_MONOSPACE)
- return 0; /* No kerning for monospace fonts */
-
- if (!do_kerning(c1) || !do_kerning(c2))
- return 0;
-
- /* Compute the height of one kerning zone in pixels */
- i = (font->height + MF_KERNING_ZONES - 1) / MF_KERNING_ZONES;
- if (i < 1) i = 1;
-
- /* Initialize structures */
- leftedge.zoneheight = rightedge.zoneheight = i;
- for (i = 0; i < MF_KERNING_ZONES; i++)
- {
- leftedge.edgepos[i] = 255;
- rightedge.edgepos[i] = 0;
- }
-
- /* Analyze the edges of both glyphs. */
- w1 = mf_render_character(font, 0, 0, c1, fit_rightedge, &rightedge);
- w2 = mf_render_character(font, 0, 0, c2, fit_leftedge, &leftedge);
-
- /* Find the minimum horizontal space between the glyphs. */
- min_space = 255;
- for (i = 0; i < MF_KERNING_ZONES; i++)
- {
- uint8_t space;
- if (leftedge.edgepos[i] == 255 || rightedge.edgepos[i] == 0)
- continue; /* Outside glyph area. */
-
- space = w1 - rightedge.edgepos[i] + leftedge.edgepos[i];
- if (space < min_space)
- min_space = space;
- }
-
- if (min_space == 255)
- return 0; /* One of the characters is space, or both are punctuation. */
-
- /* Compute the adjustment of the glyph position. */
- normal_space = avg16(w1, w2) * MF_KERNING_SPACE_PERCENT / 100;
- normal_space += MF_KERNING_SPACE_PIXELS;
- adjust = normal_space - min_space;
- max_adjust = -max16(w1, w2) * MF_KERNING_LIMIT / 100;
-
- if (adjust > 0) adjust = 0;
- if (adjust < max_adjust) adjust = max_adjust;
-
- return adjust;
-}
-
-#endif
+#include "mf_kerning.h"
+#include
+
+#if MF_USE_KERNING
+
+/* Structure for keeping track of the edge of the glyph as it is rendered. */
+struct kerning_state_s
+{
+ uint8_t edgepos[MF_KERNING_ZONES];
+ uint8_t zoneheight;
+};
+
+/* Pixel callback for analyzing the left edge of a glyph. */
+static void fit_leftedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
+ void *state)
+{
+ struct kerning_state_s *s = state;
+
+ if (alpha > 7)
+ {
+ uint8_t zone = y / s->zoneheight;
+ if (x < s->edgepos[zone])
+ s->edgepos[zone] = x;
+ }
+}
+
+/* Pixel callback for analyzing the right edge of a glyph. */
+static void fit_rightedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
+ void *state)
+{
+ struct kerning_state_s *s = state;
+
+ if (alpha > 7)
+ {
+ uint8_t zone = y / s->zoneheight;
+ x += count - 1;
+ if (x > s->edgepos[zone])
+ s->edgepos[zone] = x;
+ }
+}
+
+/* Should kerning be done against this character? */
+static bool do_kerning(mf_char c)
+{
+ /* Just a speed optimization, spaces would be ignored anyway. */
+ if (c == ' ' || c == '\n' || c == '\r' || c == '\t')
+ return false;
+
+ /* Do not kern against digits, in order to keep values in tables nicely
+ * aligned. Most fonts have constant width for digits. */
+ if (c >= '0' && c <= '9')
+ return false;
+
+ return true;
+}
+
+/*static int16_t min16(int16_t a, int16_t b) { return (a < b) ? a : b; }*/
+static int16_t max16(int16_t a, int16_t b) { return (a > b) ? a : b; }
+static int16_t avg16(int16_t a, int16_t b) { return (a + b) / 2; }
+
+int8_t mf_compute_kerning(const struct mf_font_s *font,
+ mf_char c1, mf_char c2)
+{
+ struct kerning_state_s leftedge, rightedge;
+ uint8_t w1, w2, i, min_space;
+ int16_t normal_space, adjust, max_adjust;
+
+ if (font->flags & MF_FONT_FLAG_MONOSPACE)
+ return 0; /* No kerning for monospace fonts */
+
+ if (!do_kerning(c1) || !do_kerning(c2))
+ return 0;
+
+ /* Compute the height of one kerning zone in pixels */
+ i = (font->height + MF_KERNING_ZONES - 1) / MF_KERNING_ZONES;
+ if (i < 1) i = 1;
+
+ /* Initialize structures */
+ leftedge.zoneheight = rightedge.zoneheight = i;
+ for (i = 0; i < MF_KERNING_ZONES; i++)
+ {
+ leftedge.edgepos[i] = 255;
+ rightedge.edgepos[i] = 0;
+ }
+
+ /* Analyze the edges of both glyphs. */
+ w1 = mf_render_character(font, 0, 0, c1, fit_rightedge, &rightedge);
+ w2 = mf_render_character(font, 0, 0, c2, fit_leftedge, &leftedge);
+
+ /* Find the minimum horizontal space between the glyphs. */
+ min_space = 255;
+ for (i = 0; i < MF_KERNING_ZONES; i++)
+ {
+ uint8_t space;
+ if (leftedge.edgepos[i] == 255 || rightedge.edgepos[i] == 0)
+ continue; /* Outside glyph area. */
+
+ space = w1 - rightedge.edgepos[i] + leftedge.edgepos[i];
+ if (space < min_space)
+ min_space = space;
+ }
+
+ if (min_space == 255)
+ return 0; /* One of the characters is space, or both are punctuation. */
+
+ /* Compute the adjustment of the glyph position. */
+ normal_space = avg16(w1, w2) * MF_KERNING_SPACE_PERCENT / 100;
+ normal_space += MF_KERNING_SPACE_PIXELS;
+ adjust = normal_space - min_space;
+ max_adjust = -max16(w1, w2) * MF_KERNING_LIMIT / 100;
+
+ if (adjust > 0) adjust = 0;
+ if (adjust < max_adjust) adjust = max_adjust;
+
+ return adjust;
+}
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h
index a7dcecc..0c41aec 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_kerning.h
@@ -1,27 +1,27 @@
-/* Automatic kerning for font rendering. This solves the issue where some
- * fonts (especially serif fonts) have too much space between specific
- * character pairs, like WA or L'.
- */
-
-#ifndef _MF_KERNING_H_
-#define _MF_KERNING_H_
-
-#include "mf_config.h"
-#include "mf_rlefont.h"
-
-/* Compute the kerning adjustment when c1 is followed by c2.
- *
- * font: Pointer to the font definition.
- * c1: The previous character.
- * c2: The next character to render.
- *
- * Returns the offset to add to the x position for c2.
- */
-#if MF_USE_KERNING
-MF_EXTERN int8_t mf_compute_kerning(const struct mf_font_s *font,
- mf_char c1, mf_char c2);
-#else
-#define mf_compute_kerning(f,c1,c2) (0)
-#endif
-
+/* Automatic kerning for font rendering. This solves the issue where some
+ * fonts (especially serif fonts) have too much space between specific
+ * character pairs, like WA or L'.
+ */
+
+#ifndef _MF_KERNING_H_
+#define _MF_KERNING_H_
+
+#include "mf_config.h"
+#include "mf_rlefont.h"
+
+/* Compute the kerning adjustment when c1 is followed by c2.
+ *
+ * font: Pointer to the font definition.
+ * c1: The previous character.
+ * c2: The next character to render.
+ *
+ * Returns the offset to add to the x position for c2.
+ */
+#if MF_USE_KERNING
+MF_EXTERN int8_t mf_compute_kerning(const struct mf_font_s *font,
+ mf_char c1, mf_char c2);
+#else
+#define mf_compute_kerning(f,c1,c2) (0)
+#endif
+
#endif
\ No newline at end of file
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c
index 27f2073..1407290 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.c
@@ -1,286 +1,286 @@
-#include "mf_rlefont.h"
-
-/* Number of reserved codes before the dictionary entries. */
-#define DICT_START 24
-
-/* Special reference to mean "fill with zeros to the end of the glyph" */
-#define REF_FILLZEROS 16
-
-/* RLE codes */
-#define RLE_CODEMASK 0xC0
-#define RLE_VALMASK 0x3F
-#define RLE_ZEROS 0x00
-#define RLE_64ZEROS 0x40
-#define RLE_ONES 0x80
-#define RLE_SHADE 0xC0
-
-/* Dictionary "fill entries" for encoding bits directly. */
-#define DICT_START7BIT 4
-#define DICT_START6BIT 132
-#define DICT_START5BIT 196
-#define DICT_START4BIT 228
-#define DICT_START3BIT 244
-#define DICT_START2BIT 252
-
-/* Find a pointer to the glyph matching a given character by searching
- * through the character ranges. If the character is not found, return
- * pointer to the default glyph.
- */
-static const uint8_t *find_glyph(const struct mf_rlefont_s *font,
- uint16_t character)
-{
- unsigned i, index;
- const struct mf_rlefont_char_range_s *range;
- for (i = 0; i < font->char_range_count; i++)
- {
- range = &font->char_ranges[i];
- index = character - range->first_char;
- if (character >= range->first_char && index < range->char_count)
- {
- uint16_t offset = pgm_read_word(range->glyph_offsets + index);
- return &range->glyph_data[offset];
- }
- }
-
- return 0;
-}
-
-/* Structure to keep track of coordinates of the next pixel to be written,
- * and also the bounds of the character. */
-struct renderstate_r
-{
- int16_t x_begin;
- int16_t x_end;
- int16_t x;
- int16_t y;
- int16_t y_end;
- mf_pixel_callback_t callback;
- void *state;
-};
-
-/* Call the callback to write one pixel to screen, and advance to next
- * pixel position. */
-static void write_pixels(struct renderstate_r *rstate, uint16_t count,
- uint8_t alpha)
-{
- uint8_t rowlen;
-
- /* Write row-by-row if the run spans multiple rows. */
- while (rstate->x + count >= rstate->x_end)
- {
- rowlen = rstate->x_end - rstate->x;
- rstate->callback(rstate->x, rstate->y, rowlen, alpha, rstate->state);
- count -= rowlen;
- rstate->x = rstate->x_begin;
- rstate->y++;
- }
-
- /* Write the remaining part */
- if (count)
- {
- rstate->callback(rstate->x, rstate->y, count, alpha, rstate->state);
- rstate->x += count;
- }
-}
-
-/* Skip the given number of pixels (0 alpha) */
-static void skip_pixels(struct renderstate_r *rstate, uint16_t count)
-{
- rstate->x += count;
- while (rstate->x >= rstate->x_end)
- {
- rstate->x -= rstate->x_end - rstate->x_begin;
- rstate->y++;
- }
-}
-
-/* Decode and write out a RLE-encoded dictionary entry. */
-static void write_rle_dictentry(const struct mf_rlefont_s *font,
- struct renderstate_r *rstate,
- uint8_t index)
-{
- uint16_t offset = pgm_read_word(font->dictionary_offsets + index);
- uint16_t length = pgm_read_word(font->dictionary_offsets + index + 1) - offset;
- uint16_t i;
-
- for (i = 0; i < length; i++)
- {
- uint8_t code = pgm_read_byte(font->dictionary_data + offset + i);
- if ((code & RLE_CODEMASK) == RLE_ZEROS)
- {
- skip_pixels(rstate, code & RLE_VALMASK);
- }
- else if ((code & RLE_CODEMASK) == RLE_64ZEROS)
- {
- skip_pixels(rstate, ((code & RLE_VALMASK) + 1) * 64);
- }
- else if ((code & RLE_CODEMASK) == RLE_ONES)
- {
- write_pixels(rstate, (code & RLE_VALMASK) + 1, 255);
- }
- else if ((code & RLE_CODEMASK) == RLE_SHADE)
- {
- uint8_t count, alpha;
- count = ((code & RLE_VALMASK) >> 4) + 1;
- alpha = ((code & RLE_VALMASK) & 0xF) * 0x11;
- write_pixels(rstate, count, alpha);
- }
- }
-}
-
-/* Get bit count for the "fill entries" */
-static uint8_t fillentry_bitcount(uint8_t index)
-{
- if (index >= DICT_START2BIT)
- return 2;
- else if (index >= DICT_START3BIT)
- return 3;
- else if (index >= DICT_START4BIT)
- return 4;
- else if (index >= DICT_START5BIT)
- return 5;
- else if (index >= DICT_START6BIT)
- return 6;
- else
- return 7;
-}
-
-/* Decode and write out a direct binary codeword */
-static void write_bin_codeword(const struct mf_rlefont_s *font,
- struct renderstate_r *rstate,
- uint8_t code)
-{
- uint8_t bitcount = fillentry_bitcount(code);
- uint8_t byte = code - DICT_START7BIT;
- uint8_t runlen = 0;
-
- while (bitcount--)
- {
- if (byte & 1)
- {
- runlen++;
- }
- else
- {
- if (runlen)
- {
- write_pixels(rstate, runlen, 255);
- runlen = 0;
- }
-
- skip_pixels(rstate, 1);
- }
-
- byte >>= 1;
- }
-
- if (runlen)
- write_pixels(rstate, runlen, 255);
-}
-
-/* Decode and write out a reference codeword */
-static void write_ref_codeword(const struct mf_rlefont_s *font,
- struct renderstate_r *rstate,
- uint8_t code)
-{
- if (code == 0)
- {
- skip_pixels(rstate, 1);
- }
- else if (code <= 15)
- {
- write_pixels(rstate, 1, 0x11 * code);
- }
- else if (code == REF_FILLZEROS)
- {
- /* Fill with zeroes to end */
- rstate->y = rstate->y_end;
- }
- else if (code < DICT_START)
- {
- /* Reserved */
- }
- else if (code < DICT_START + font->rle_entry_count)
- {
- write_rle_dictentry(font, rstate, code - DICT_START);
- }
- else
- {
- write_bin_codeword(font, rstate, code);
- }
-}
-
-/* Decode and write out a reference encoded dictionary entry. */
-static void write_ref_dictentry(const struct mf_rlefont_s *font,
- struct renderstate_r *rstate,
- uint8_t index)
-{
- uint16_t offset = pgm_read_word(font->dictionary_offsets + index);
- uint16_t length = pgm_read_word(font->dictionary_offsets + index + 1) - offset;
- uint16_t i;
-
- for (i = 0; i < length; i++)
- {
- uint8_t code = pgm_read_byte(font->dictionary_data + offset + i);
- write_ref_codeword(font, rstate, code);
- }
-}
-
-/* Decode and write out an arbitrary glyph codeword */
-static void write_glyph_codeword(const struct mf_rlefont_s *font,
- struct renderstate_r *rstate,
- uint8_t code)
-{
- if (code >= DICT_START + font->rle_entry_count &&
- code < DICT_START + font->dict_entry_count)
- {
- write_ref_dictentry(font, rstate, code - DICT_START);
- }
- else
- {
- write_ref_codeword(font, rstate, code);
- }
-}
-
-
-uint8_t mf_rlefont_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- uint16_t character,
- mf_pixel_callback_t callback,
- void *state)
-{
- const uint8_t *p;
- uint8_t width;
-
- struct renderstate_r rstate;
- rstate.x_begin = x0;
- rstate.x_end = x0 + font->width;
- rstate.x = x0;
- rstate.y = y0;
- rstate.y_end = y0 + font->height;
- rstate.callback = callback;
- rstate.state = state;
-
- p = find_glyph((struct mf_rlefont_s*)font, character);
- if (!p)
- return 0;
-
- width = pgm_read_byte(p++);
- while (rstate.y < rstate.y_end)
- {
- write_glyph_codeword((struct mf_rlefont_s*)font, &rstate, pgm_read_byte(p++));
- }
-
- return width;
-}
-
-uint8_t mf_rlefont_character_width(const struct mf_font_s *font,
- uint16_t character)
-{
- const uint8_t *p;
- p = find_glyph((struct mf_rlefont_s*)font, character);
- if (!p)
- return 0;
-
- return pgm_read_byte(p);
-}
+#include "mf_rlefont.h"
+
+/* Number of reserved codes before the dictionary entries. */
+#define DICT_START 24
+
+/* Special reference to mean "fill with zeros to the end of the glyph" */
+#define REF_FILLZEROS 16
+
+/* RLE codes */
+#define RLE_CODEMASK 0xC0
+#define RLE_VALMASK 0x3F
+#define RLE_ZEROS 0x00
+#define RLE_64ZEROS 0x40
+#define RLE_ONES 0x80
+#define RLE_SHADE 0xC0
+
+/* Dictionary "fill entries" for encoding bits directly. */
+#define DICT_START7BIT 4
+#define DICT_START6BIT 132
+#define DICT_START5BIT 196
+#define DICT_START4BIT 228
+#define DICT_START3BIT 244
+#define DICT_START2BIT 252
+
+/* Find a pointer to the glyph matching a given character by searching
+ * through the character ranges. If the character is not found, return
+ * pointer to the default glyph.
+ */
+static const uint8_t *find_glyph(const struct mf_rlefont_s *font,
+ uint16_t character)
+{
+ unsigned i, index;
+ const struct mf_rlefont_char_range_s *range;
+ for (i = 0; i < font->char_range_count; i++)
+ {
+ range = &font->char_ranges[i];
+ index = character - range->first_char;
+ if (character >= range->first_char && index < range->char_count)
+ {
+ uint16_t offset = pgm_read_word(range->glyph_offsets + index);
+ return &range->glyph_data[offset];
+ }
+ }
+
+ return 0;
+}
+
+/* Structure to keep track of coordinates of the next pixel to be written,
+ * and also the bounds of the character. */
+struct renderstate_r
+{
+ int16_t x_begin;
+ int16_t x_end;
+ int16_t x;
+ int16_t y;
+ int16_t y_end;
+ mf_pixel_callback_t callback;
+ void *state;
+};
+
+/* Call the callback to write one pixel to screen, and advance to next
+ * pixel position. */
+static void write_pixels(struct renderstate_r *rstate, uint16_t count,
+ uint8_t alpha)
+{
+ uint8_t rowlen;
+
+ /* Write row-by-row if the run spans multiple rows. */
+ while (rstate->x + count >= rstate->x_end)
+ {
+ rowlen = rstate->x_end - rstate->x;
+ rstate->callback(rstate->x, rstate->y, rowlen, alpha, rstate->state);
+ count -= rowlen;
+ rstate->x = rstate->x_begin;
+ rstate->y++;
+ }
+
+ /* Write the remaining part */
+ if (count)
+ {
+ rstate->callback(rstate->x, rstate->y, count, alpha, rstate->state);
+ rstate->x += count;
+ }
+}
+
+/* Skip the given number of pixels (0 alpha) */
+static void skip_pixels(struct renderstate_r *rstate, uint16_t count)
+{
+ rstate->x += count;
+ while (rstate->x >= rstate->x_end)
+ {
+ rstate->x -= rstate->x_end - rstate->x_begin;
+ rstate->y++;
+ }
+}
+
+/* Decode and write out a RLE-encoded dictionary entry. */
+static void write_rle_dictentry(const struct mf_rlefont_s *font,
+ struct renderstate_r *rstate,
+ uint8_t index)
+{
+ uint16_t offset = pgm_read_word(font->dictionary_offsets + index);
+ uint16_t length = pgm_read_word(font->dictionary_offsets + index + 1) - offset;
+ uint16_t i;
+
+ for (i = 0; i < length; i++)
+ {
+ uint8_t code = pgm_read_byte(font->dictionary_data + offset + i);
+ if ((code & RLE_CODEMASK) == RLE_ZEROS)
+ {
+ skip_pixels(rstate, code & RLE_VALMASK);
+ }
+ else if ((code & RLE_CODEMASK) == RLE_64ZEROS)
+ {
+ skip_pixels(rstate, ((code & RLE_VALMASK) + 1) * 64);
+ }
+ else if ((code & RLE_CODEMASK) == RLE_ONES)
+ {
+ write_pixels(rstate, (code & RLE_VALMASK) + 1, 255);
+ }
+ else if ((code & RLE_CODEMASK) == RLE_SHADE)
+ {
+ uint8_t count, alpha;
+ count = ((code & RLE_VALMASK) >> 4) + 1;
+ alpha = ((code & RLE_VALMASK) & 0xF) * 0x11;
+ write_pixels(rstate, count, alpha);
+ }
+ }
+}
+
+/* Get bit count for the "fill entries" */
+static uint8_t fillentry_bitcount(uint8_t index)
+{
+ if (index >= DICT_START2BIT)
+ return 2;
+ else if (index >= DICT_START3BIT)
+ return 3;
+ else if (index >= DICT_START4BIT)
+ return 4;
+ else if (index >= DICT_START5BIT)
+ return 5;
+ else if (index >= DICT_START6BIT)
+ return 6;
+ else
+ return 7;
+}
+
+/* Decode and write out a direct binary codeword */
+static void write_bin_codeword(const struct mf_rlefont_s *font,
+ struct renderstate_r *rstate,
+ uint8_t code)
+{
+ uint8_t bitcount = fillentry_bitcount(code);
+ uint8_t byte = code - DICT_START7BIT;
+ uint8_t runlen = 0;
+
+ while (bitcount--)
+ {
+ if (byte & 1)
+ {
+ runlen++;
+ }
+ else
+ {
+ if (runlen)
+ {
+ write_pixels(rstate, runlen, 255);
+ runlen = 0;
+ }
+
+ skip_pixels(rstate, 1);
+ }
+
+ byte >>= 1;
+ }
+
+ if (runlen)
+ write_pixels(rstate, runlen, 255);
+}
+
+/* Decode and write out a reference codeword */
+static void write_ref_codeword(const struct mf_rlefont_s *font,
+ struct renderstate_r *rstate,
+ uint8_t code)
+{
+ if (code == 0)
+ {
+ skip_pixels(rstate, 1);
+ }
+ else if (code <= 15)
+ {
+ write_pixels(rstate, 1, 0x11 * code);
+ }
+ else if (code == REF_FILLZEROS)
+ {
+ /* Fill with zeroes to end */
+ rstate->y = rstate->y_end;
+ }
+ else if (code < DICT_START)
+ {
+ /* Reserved */
+ }
+ else if (code < DICT_START + font->rle_entry_count)
+ {
+ write_rle_dictentry(font, rstate, code - DICT_START);
+ }
+ else
+ {
+ write_bin_codeword(font, rstate, code);
+ }
+}
+
+/* Decode and write out a reference encoded dictionary entry. */
+static void write_ref_dictentry(const struct mf_rlefont_s *font,
+ struct renderstate_r *rstate,
+ uint8_t index)
+{
+ uint16_t offset = pgm_read_word(font->dictionary_offsets + index);
+ uint16_t length = pgm_read_word(font->dictionary_offsets + index + 1) - offset;
+ uint16_t i;
+
+ for (i = 0; i < length; i++)
+ {
+ uint8_t code = pgm_read_byte(font->dictionary_data + offset + i);
+ write_ref_codeword(font, rstate, code);
+ }
+}
+
+/* Decode and write out an arbitrary glyph codeword */
+static void write_glyph_codeword(const struct mf_rlefont_s *font,
+ struct renderstate_r *rstate,
+ uint8_t code)
+{
+ if (code >= DICT_START + font->rle_entry_count &&
+ code < DICT_START + font->dict_entry_count)
+ {
+ write_ref_dictentry(font, rstate, code - DICT_START);
+ }
+ else
+ {
+ write_ref_codeword(font, rstate, code);
+ }
+}
+
+
+uint8_t mf_rlefont_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ uint16_t character,
+ mf_pixel_callback_t callback,
+ void *state)
+{
+ const uint8_t *p;
+ uint8_t width;
+
+ struct renderstate_r rstate;
+ rstate.x_begin = x0;
+ rstate.x_end = x0 + font->width;
+ rstate.x = x0;
+ rstate.y = y0;
+ rstate.y_end = y0 + font->height;
+ rstate.callback = callback;
+ rstate.state = state;
+
+ p = find_glyph((struct mf_rlefont_s*)font, character);
+ if (!p)
+ return 0;
+
+ width = pgm_read_byte(p++);
+ while (rstate.y < rstate.y_end)
+ {
+ write_glyph_codeword((struct mf_rlefont_s*)font, &rstate, pgm_read_byte(p++));
+ }
+
+ return width;
+}
+
+uint8_t mf_rlefont_character_width(const struct mf_font_s *font,
+ uint16_t character)
+{
+ const uint8_t *p;
+ p = find_glyph((struct mf_rlefont_s*)font, character);
+ if (!p)
+ return 0;
+
+ return pgm_read_byte(p);
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h
index b672ef9..fc84ebd 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_rlefont.h
@@ -1,82 +1,82 @@
-/* A compressed font format based on run length encoding and dictionary
- * compression.
- */
-
-#ifndef _MF_RLEFONT_H_
-#define _MF_RLEFONT_H_
-
-#include "mf_font.h"
-
-/* Versions of the RLE font format that are supported. */
-#define MF_RLEFONT_VERSION_4_SUPPORTED 1
-
-/* Structure for a range of characters. This implements a sparse storage of
- * character indices, so that you can e.g. pick a 100 characters in the middle
- * of the UTF16 range and just store them. */
-struct mf_rlefont_char_range_s
-{
- /* The number of the first character in this range. */
- uint16_t first_char;
-
- /* The total count of characters in this range. */
- uint16_t char_count;
-
- /* Lookup table with the start indices into glyph_data. */
- uint16_t *glyph_offsets;
- uint32_t glyph_offsets_size;
- uint32_t glyph_offsets_fp_offset;
-
- /* The encoded glyph data for glyphs in this range. */
- uint8_t *glyph_data;
- uint32_t glyph_data_size;
- uint32_t glyph_data_fp_offset;
-};
-
-/* Structure for a single encoded font. */
-struct mf_rlefont_s
-{
- struct mf_font_s font;
-
- /* Version of the font definition used. */
- uint8_t version;
-
- /* Big array of the data for all the dictionary entries. */
- uint8_t *dictionary_data;
- uint32_t dictionary_data_size;
- uint32_t dictionary_data_fp_offset;
-
- /* Lookup table with the start indices into dictionary_data.
- * Contains N+1 entries, so that the length of the entry can
- * be determined by subtracting from the next offset. */
- uint16_t *dictionary_offsets;
- uint32_t dictionary_offsets_size;
- uint32_t dictionary_offsets_fp_offset;
-
- /* Number of dictionary entries using the RLE encoding.
- * Entries starting at this index use the dictionary encoding. */
- uint8_t rle_entry_count;
-
- /* Total number of dictionary entries.
- * Entries after this are nonexistent. */
- uint8_t dict_entry_count;
-
- /* Number of discontinuous character ranges */
- uint8_t char_range_count;
-
- /* Array of the character ranges */
- struct mf_rlefont_char_range_s *char_ranges;
-};
-
-#ifdef MF_RLEFONT_INTERNALS
-/* Internal functions, don't use these directly. */
-MF_EXTERN uint8_t mf_rlefont_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state);
-
-MF_EXTERN uint8_t mf_rlefont_character_width(const struct mf_font_s *font,
- mf_char character);
-#endif
-
-#endif
+/* A compressed font format based on run length encoding and dictionary
+ * compression.
+ */
+
+#ifndef _MF_RLEFONT_H_
+#define _MF_RLEFONT_H_
+
+#include "mf_font.h"
+
+/* Versions of the RLE font format that are supported. */
+#define MF_RLEFONT_VERSION_4_SUPPORTED 1
+
+/* Structure for a range of characters. This implements a sparse storage of
+ * character indices, so that you can e.g. pick a 100 characters in the middle
+ * of the UTF16 range and just store them. */
+struct mf_rlefont_char_range_s
+{
+ /* The number of the first character in this range. */
+ uint16_t first_char;
+
+ /* The total count of characters in this range. */
+ uint16_t char_count;
+
+ /* Lookup table with the start indices into glyph_data. */
+ uint16_t *glyph_offsets;
+ uint32_t glyph_offsets_size;
+ uint32_t glyph_offsets_fp_offset;
+
+ /* The encoded glyph data for glyphs in this range. */
+ uint8_t *glyph_data;
+ uint32_t glyph_data_size;
+ uint32_t glyph_data_fp_offset;
+};
+
+/* Structure for a single encoded font. */
+struct mf_rlefont_s
+{
+ struct mf_font_s font;
+
+ /* Version of the font definition used. */
+ uint8_t version;
+
+ /* Big array of the data for all the dictionary entries. */
+ uint8_t *dictionary_data;
+ uint32_t dictionary_data_size;
+ uint32_t dictionary_data_fp_offset;
+
+ /* Lookup table with the start indices into dictionary_data.
+ * Contains N+1 entries, so that the length of the entry can
+ * be determined by subtracting from the next offset. */
+ uint16_t *dictionary_offsets;
+ uint32_t dictionary_offsets_size;
+ uint32_t dictionary_offsets_fp_offset;
+
+ /* Number of dictionary entries using the RLE encoding.
+ * Entries starting at this index use the dictionary encoding. */
+ uint8_t rle_entry_count;
+
+ /* Total number of dictionary entries.
+ * Entries after this are nonexistent. */
+ uint8_t dict_entry_count;
+
+ /* Number of discontinuous character ranges */
+ uint8_t char_range_count;
+
+ /* Array of the character ranges */
+ struct mf_rlefont_char_range_s *char_ranges;
+};
+
+#ifdef MF_RLEFONT_INTERNALS
+/* Internal functions, don't use these directly. */
+MF_EXTERN uint8_t mf_rlefont_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state);
+
+MF_EXTERN uint8_t mf_rlefont_character_width(const struct mf_font_s *font,
+ mf_char character);
+#endif
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c
index da2b31f..cb9d7e3 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.c
@@ -1,83 +1,83 @@
-#include "mf_scaledfont.h"
-
-struct scaled_renderstate
-{
- mf_pixel_callback_t orig_callback;
- void *orig_state;
- uint8_t x_scale;
- uint8_t y_scale;
- int16_t x0;
- int16_t y0;
-};
-
-static void scaled_pixel_callback(int16_t x, int16_t y, uint8_t count,
- uint8_t alpha, void *state)
-{
- struct scaled_renderstate *rstate = state;
- uint8_t dy;
-
- count *= rstate->x_scale;
- x = rstate->x0 + x * rstate->x_scale;
- y = rstate->y0 + y * rstate->y_scale;
-
- for (dy = 0; dy < rstate->y_scale; dy++)
- {
- rstate->orig_callback(x, y + dy, count, alpha, rstate->orig_state);
- }
-}
-
-static uint8_t scaled_character_width(const struct mf_font_s *font,
- mf_char character)
-{
- struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font;
- uint8_t basewidth;
-
- basewidth = sfont->basefont->character_width(sfont->basefont, character);
-
- return sfont->x_scale * basewidth;
-}
-
-static uint8_t scaled_render_character(const struct mf_font_s *font,
- int16_t x0, int16_t y0,
- mf_char character,
- mf_pixel_callback_t callback,
- void *state)
-{
- struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font;
- struct scaled_renderstate rstate;
- uint8_t basewidth;
-
- rstate.orig_callback = callback;
- rstate.orig_state = state;
- rstate.x_scale = sfont->x_scale;
- rstate.y_scale = sfont->y_scale;
- rstate.x0 = x0;
- rstate.y0 = y0;
-
- basewidth = sfont->basefont->render_character(sfont->basefont, 0, 0,
- character, scaled_pixel_callback, &rstate);
-
- return sfont->x_scale * basewidth;
-}
-
-void mf_scale_font(struct mf_scaledfont_s *newfont,
- const struct mf_font_s *basefont,
- uint8_t x_scale, uint8_t y_scale)
-{
- newfont->font = *basefont;
- newfont->basefont = basefont;
-
- newfont->font.width *= x_scale;
- newfont->font.height *= y_scale;
- newfont->font.baseline_x *= x_scale;
- newfont->font.baseline_y *= y_scale;
- newfont->font.min_x_advance *= x_scale;
- newfont->font.max_x_advance *= x_scale;
- newfont->font.line_height *= y_scale;
- newfont->font.character_width = &scaled_character_width;
- newfont->font.render_character = &scaled_render_character;
-
- newfont->x_scale = x_scale;
- newfont->y_scale = y_scale;
-}
-
+#include "mf_scaledfont.h"
+
+struct scaled_renderstate
+{
+ mf_pixel_callback_t orig_callback;
+ void *orig_state;
+ uint8_t x_scale;
+ uint8_t y_scale;
+ int16_t x0;
+ int16_t y0;
+};
+
+static void scaled_pixel_callback(int16_t x, int16_t y, uint8_t count,
+ uint8_t alpha, void *state)
+{
+ struct scaled_renderstate *rstate = state;
+ uint8_t dy;
+
+ count *= rstate->x_scale;
+ x = rstate->x0 + x * rstate->x_scale;
+ y = rstate->y0 + y * rstate->y_scale;
+
+ for (dy = 0; dy < rstate->y_scale; dy++)
+ {
+ rstate->orig_callback(x, y + dy, count, alpha, rstate->orig_state);
+ }
+}
+
+static uint8_t scaled_character_width(const struct mf_font_s *font,
+ mf_char character)
+{
+ struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font;
+ uint8_t basewidth;
+
+ basewidth = sfont->basefont->character_width(sfont->basefont, character);
+
+ return sfont->x_scale * basewidth;
+}
+
+static uint8_t scaled_render_character(const struct mf_font_s *font,
+ int16_t x0, int16_t y0,
+ mf_char character,
+ mf_pixel_callback_t callback,
+ void *state)
+{
+ struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font;
+ struct scaled_renderstate rstate;
+ uint8_t basewidth;
+
+ rstate.orig_callback = callback;
+ rstate.orig_state = state;
+ rstate.x_scale = sfont->x_scale;
+ rstate.y_scale = sfont->y_scale;
+ rstate.x0 = x0;
+ rstate.y0 = y0;
+
+ basewidth = sfont->basefont->render_character(sfont->basefont, 0, 0,
+ character, scaled_pixel_callback, &rstate);
+
+ return sfont->x_scale * basewidth;
+}
+
+void mf_scale_font(struct mf_scaledfont_s *newfont,
+ const struct mf_font_s *basefont,
+ uint8_t x_scale, uint8_t y_scale)
+{
+ newfont->font = *basefont;
+ newfont->basefont = basefont;
+
+ newfont->font.width *= x_scale;
+ newfont->font.height *= y_scale;
+ newfont->font.baseline_x *= x_scale;
+ newfont->font.baseline_y *= y_scale;
+ newfont->font.min_x_advance *= x_scale;
+ newfont->font.max_x_advance *= x_scale;
+ newfont->font.line_height *= y_scale;
+ newfont->font.character_width = &scaled_character_width;
+ newfont->font.render_character = &scaled_render_character;
+
+ newfont->x_scale = x_scale;
+ newfont->y_scale = y_scale;
+}
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h
index f660701..8c399d6 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_scaledfont.h
@@ -1,23 +1,23 @@
-/* Generate scaled (nearest-neighbor) fonts. This can be used for displaying
- * larger text without spending the memory required for including larger fonts.
- */
-
-#ifndef _MF_SCALEDFONT_H_
-#define _MF_SCALEDFONT_H_
-
-#include "mf_font.h"
-
-struct mf_scaledfont_s
-{
- struct mf_font_s font;
-
- const struct mf_font_s *basefont;
- uint8_t x_scale;
- uint8_t y_scale;
-};
-
-MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
- const struct mf_font_s *basefont,
- uint8_t x_scale, uint8_t y_scale);
-
-#endif
+/* Generate scaled (nearest-neighbor) fonts. This can be used for displaying
+ * larger text without spending the memory required for including larger fonts.
+ */
+
+#ifndef _MF_SCALEDFONT_H_
+#define _MF_SCALEDFONT_H_
+
+#include "mf_font.h"
+
+struct mf_scaledfont_s
+{
+ struct mf_font_s font;
+
+ const struct mf_font_s *basefont;
+ uint8_t x_scale;
+ uint8_t y_scale;
+};
+
+MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
+ const struct mf_font_s *basefont,
+ uint8_t x_scale, uint8_t y_scale);
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c
index 065d51c..c357d3a 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.c
@@ -1,357 +1,357 @@
-#include "mf_wordwrap.h"
-
-/* Returns true if the line can be broken at this character. */
-static bool is_wrap_space(uint16_t c)
-{
- return c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '-';
-}
-
-#if MF_USE_ADVANCED_WORDWRAP
-
-/* Represents a single word and the whitespace after it. */
-struct wordlen_s
-{
- int16_t word; /* Length of the word in pixels. */
- int16_t space; /* Length of the whitespace in pixels. */
- uint16_t chars; /* Number of characters in word + space, combined. */
-};
-
-/* Take the next word from the string and compute its width.
- * Returns true if the word ends in a linebreak. */
-static bool get_wordlen(const struct mf_font_s *font, mf_str *text,
- struct wordlen_s *result)
-{
- mf_char c;
- mf_str prev = *text;
-
- result->word = 0;
- result->space = 0;
- result->chars = 0;
-
- c = mf_getchar(text);
- while (c && !is_wrap_space(c))
- {
- result->chars++;
- result->word += mf_character_width(font, c);
-
- prev = *text;
- c = mf_getchar(text);
- }
-
- while (c && is_wrap_space(c))
- {
- result->chars++;
-
- if (c == ' ' || c == '-')
- result->space += mf_character_width(font, c);
- else if (c == '\t')
- result->space += mf_character_width(font, 'm') * MF_TABSIZE;
- else if (c == '\n') {
- /* Special case for newlines, skip the character then break. */
- prev = *text;
- break;
- }
-
- prev = *text;
- c = mf_getchar(text);
- }
-
- /* The last loop reads the first character of next word, put it back. */
- if (c)
- *text = prev;
-
- return (c == '\0' || c == '\n');
-}
-
-/* Represents the rendered length for a single line. */
-struct linelen_s
-{
- mf_str start; /* Start of the text for line. */
- uint16_t chars; /* Total number of characters on the line. */
- int16_t width; /* Total length of all words + whitespace on the line in pixels. */
- bool linebreak; /* True if line ends in a linebreak */
- struct wordlen_s last_word; /* Last word on the line. */
- struct wordlen_s last_word_2; /* Second to last word on the line. */
-};
-
-/* Append word onto the line if it fits. If it would overflow, don't add and
- * return false. */
-static bool append_word(const struct mf_font_s *font, int16_t width,
- struct linelen_s *current, mf_str *text)
-{
- mf_str tmp = *text;
- struct wordlen_s wordlen;
- bool linebreak;
-
- linebreak = get_wordlen(font, &tmp, &wordlen);
-
- if (current->width + wordlen.word <= width)
- {
- *text = tmp;
- current->last_word_2 = current->last_word;
- current->last_word = wordlen;
- current->linebreak = linebreak;
- current->chars += wordlen.chars;
- current->width += wordlen.word + wordlen.space;
- return true;
- }
- else
- {
- return false;
- }
-}
-
-/* Append a character to the line if it fits. */
-static bool append_char(const struct mf_font_s *font, int16_t width,
- struct linelen_s *current, mf_str *text)
-{
- mf_str tmp = *text;
- mf_char c;
- uint16_t w;
-
- c = mf_getchar(&tmp);
- w = mf_character_width(font, c);
-
- if (current->width + w <= width)
- {
- *text = tmp;
- current->chars++;
- current->width += w;
- return true;
- }
- else
- {
- return false;
- }
-}
-
-/*static int16_t abs16(int16_t x) { return (x > 0) ? x : -x; }*/
-static int32_t sq16(int16_t x) { return (int32_t)x * x; }
-
-/* Try to balance the lines by potentially moving one word from the previous
- * line to the the current one. */
-static void tune_lines(struct linelen_s *current, struct linelen_s *previous,
- int16_t max_width)
-{
- int16_t curw1, prevw1;
- int16_t curw2, prevw2;
- int32_t delta1, delta2;
-
- /* If the lines are rendered as is */
- curw1 = current->width - current->last_word.space;
- prevw1 = previous->width - previous->last_word.space;
- delta1 = sq16(max_width - prevw1) + sq16(max_width - curw1);
-
- /* If the last word is moved */
- curw2 = current->width + previous->last_word.word;
- prevw2 = previous->width - previous->last_word.word
- - previous->last_word.space
- - previous->last_word_2.space;
- delta2 = sq16(max_width - prevw2) + sq16(max_width - curw2);
-
- if (delta1 > delta2 && curw2 <= max_width)
- {
- /* Do the change. */
- uint16_t chars;
-
- chars = previous->last_word.chars;
- previous->chars -= chars;
- current->chars += chars;
- previous->width -= previous->last_word.word + previous->last_word.space;
- current->width += previous->last_word.word + previous->last_word.space;
- previous->last_word = previous->last_word_2;
-
- while (chars--) mf_rewind(¤t->start);
- }
-}
-
-void mf_wordwrap(const struct mf_font_s *font, int16_t width,
- mf_str text, mf_line_callback_t callback, void *state)
-{
- struct linelen_s current = { 0 };
- struct linelen_s previous = { 0 };
- bool full;
-
- current.start = text;
-
- while (*text)
- {
- full = !append_word(font, width, ¤t, &text);
-
- if (full || current.linebreak)
- {
- if (!current.chars)
- {
- /* We have a very long word. We must just cut it off at some
- * point. */
- while (append_char(font, width, ¤t, &text));
- }
-
- if (previous.chars)
- {
- /* Tune the length and dispatch the previous line. */
- if (!previous.linebreak && !current.linebreak)
- tune_lines(¤t, &previous, width);
-
- if (!callback(previous.start, previous.chars, state))
- return;
- }
-
- previous = current;
- current.start = text;
- current.chars = 0;
- current.width = 0;
- current.linebreak = false;
- current.last_word.word = 0;
- current.last_word.space = 0;
- current.last_word.chars = 0;
- }
- }
-
- /* Dispatch the last lines. */
- if (previous.chars)
- {
- if (!callback(previous.start, previous.chars, state))
- return;
- }
-
- if (current.chars)
- callback(current.start, current.chars, state);
-}
-
-void mf_text_draw_area(const struct mf_font_s *font, int16_t width,
- mf_str text,
- int *total_height_in_rows,
- int *max_pixels_per_row)
-{
- struct linelen_s current = { 0 };
- struct linelen_s previous = { 0 };
- bool full;
-
- current.start = text;
- *total_height_in_rows = 0;
- *max_pixels_per_row = 0;
-
- while (*text)
- {
- full = !append_word(font, width, ¤t, &text);
-
- if (full || current.linebreak)
- {
- if (!current.chars)
- {
- /* We have a very long word. We must just cut it off at some
- * point. */
- while (append_char(font, width, ¤t, &text));
- }
-
- if (previous.chars)
- {
- /* Tune the length and dispatch the previous line. */
- if (!previous.linebreak && !current.linebreak)
- tune_lines(¤t, &previous, width);
- *total_height_in_rows += 1;
- }
-
- if ( *max_pixels_per_row < current.width )
- *max_pixels_per_row = current.width;
- previous = current;
- current.start = text;
- current.chars = 0;
- current.width = 0;
- current.linebreak = false;
- current.last_word.word = 0;
- current.last_word.space = 0;
- current.last_word.chars = 0;
- }
- }
-
- /* Dispatch the last lines. */
- if (previous.chars)
- {
- if ( *max_pixels_per_row < previous.width )
- *max_pixels_per_row = previous.width;
- *total_height_in_rows += 1;
- }
-
- if (current.chars) {
- if ( *max_pixels_per_row < current.width )
- *max_pixels_per_row = current.width;
- *total_height_in_rows += 1;
- }
-
-}
-
-#else
-
-void mf_wordwrap(const struct mf_font_s *font, int16_t width,
- mf_str text, mf_line_callback_t callback, void *state)
-{
- mf_str orig = text;
- mf_str linestart;
-
- /* Current line width and character count */
- int16_t lw_cur = 0, cc_cur = 0;
-
- /* Previous wrap point */
- int16_t cc_prev;
- mf_str ls_prev;
-
- linestart = text;
-
- while (*text)
- {
- cc_prev = 0;
- ls_prev = text;
-
- while (*text)
- {
- mf_char c;
- int16_t new_width;
- mf_str tmp;
-
- tmp = text;
- c = mf_getchar(&text);
- new_width = lw_cur + mf_character_width(font, c);
-
- if (c == '\n')
- {
- cc_prev = cc_cur + 1;
- ls_prev = text;
- break;
- }
-
- if (new_width > width)
- {
- text = tmp;
- break;
- }
-
- cc_cur++;
- lw_cur = new_width;
-
- if (is_wrap_space(c))
- {
- cc_prev = cc_cur;
- ls_prev = text;
- }
- }
-
- /* Handle unbreakable words */
- if (cc_prev == 0)
- {
- cc_prev = cc_cur;
- ls_prev = text;
- }
-
- if (!callback(linestart, cc_prev, state))
- return;
-
- linestart = ls_prev;
- text = linestart;
- lw_cur = 0;
- cc_cur = 0;
- }
-}
-
-#endif
+#include "mf_wordwrap.h"
+
+/* Returns true if the line can be broken at this character. */
+static bool is_wrap_space(uint16_t c)
+{
+ return c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '-';
+}
+
+#if MF_USE_ADVANCED_WORDWRAP
+
+/* Represents a single word and the whitespace after it. */
+struct wordlen_s
+{
+ int16_t word; /* Length of the word in pixels. */
+ int16_t space; /* Length of the whitespace in pixels. */
+ uint16_t chars; /* Number of characters in word + space, combined. */
+};
+
+/* Take the next word from the string and compute its width.
+ * Returns true if the word ends in a linebreak. */
+static bool get_wordlen(const struct mf_font_s *font, mf_str *text,
+ struct wordlen_s *result)
+{
+ mf_char c;
+ mf_str prev = *text;
+
+ result->word = 0;
+ result->space = 0;
+ result->chars = 0;
+
+ c = mf_getchar(text);
+ while (c && !is_wrap_space(c))
+ {
+ result->chars++;
+ result->word += mf_character_width(font, c);
+
+ prev = *text;
+ c = mf_getchar(text);
+ }
+
+ while (c && is_wrap_space(c))
+ {
+ result->chars++;
+
+ if (c == ' ' || c == '-')
+ result->space += mf_character_width(font, c);
+ else if (c == '\t')
+ result->space += mf_character_width(font, 'm') * MF_TABSIZE;
+ else if (c == '\n') {
+ /* Special case for newlines, skip the character then break. */
+ prev = *text;
+ break;
+ }
+
+ prev = *text;
+ c = mf_getchar(text);
+ }
+
+ /* The last loop reads the first character of next word, put it back. */
+ if (c)
+ *text = prev;
+
+ return (c == '\0' || c == '\n');
+}
+
+/* Represents the rendered length for a single line. */
+struct linelen_s
+{
+ mf_str start; /* Start of the text for line. */
+ uint16_t chars; /* Total number of characters on the line. */
+ int16_t width; /* Total length of all words + whitespace on the line in pixels. */
+ bool linebreak; /* True if line ends in a linebreak */
+ struct wordlen_s last_word; /* Last word on the line. */
+ struct wordlen_s last_word_2; /* Second to last word on the line. */
+};
+
+/* Append word onto the line if it fits. If it would overflow, don't add and
+ * return false. */
+static bool append_word(const struct mf_font_s *font, int16_t width,
+ struct linelen_s *current, mf_str *text)
+{
+ mf_str tmp = *text;
+ struct wordlen_s wordlen;
+ bool linebreak;
+
+ linebreak = get_wordlen(font, &tmp, &wordlen);
+
+ if (current->width + wordlen.word <= width)
+ {
+ *text = tmp;
+ current->last_word_2 = current->last_word;
+ current->last_word = wordlen;
+ current->linebreak = linebreak;
+ current->chars += wordlen.chars;
+ current->width += wordlen.word + wordlen.space;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+/* Append a character to the line if it fits. */
+static bool append_char(const struct mf_font_s *font, int16_t width,
+ struct linelen_s *current, mf_str *text)
+{
+ mf_str tmp = *text;
+ mf_char c;
+ uint16_t w;
+
+ c = mf_getchar(&tmp);
+ w = mf_character_width(font, c);
+
+ if (current->width + w <= width)
+ {
+ *text = tmp;
+ current->chars++;
+ current->width += w;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+/*static int16_t abs16(int16_t x) { return (x > 0) ? x : -x; }*/
+static int32_t sq16(int16_t x) { return (int32_t)x * x; }
+
+/* Try to balance the lines by potentially moving one word from the previous
+ * line to the the current one. */
+static void tune_lines(struct linelen_s *current, struct linelen_s *previous,
+ int16_t max_width)
+{
+ int16_t curw1, prevw1;
+ int16_t curw2, prevw2;
+ int32_t delta1, delta2;
+
+ /* If the lines are rendered as is */
+ curw1 = current->width - current->last_word.space;
+ prevw1 = previous->width - previous->last_word.space;
+ delta1 = sq16(max_width - prevw1) + sq16(max_width - curw1);
+
+ /* If the last word is moved */
+ curw2 = current->width + previous->last_word.word;
+ prevw2 = previous->width - previous->last_word.word
+ - previous->last_word.space
+ - previous->last_word_2.space;
+ delta2 = sq16(max_width - prevw2) + sq16(max_width - curw2);
+
+ if (delta1 > delta2 && curw2 <= max_width)
+ {
+ /* Do the change. */
+ uint16_t chars;
+
+ chars = previous->last_word.chars;
+ previous->chars -= chars;
+ current->chars += chars;
+ previous->width -= previous->last_word.word + previous->last_word.space;
+ current->width += previous->last_word.word + previous->last_word.space;
+ previous->last_word = previous->last_word_2;
+
+ while (chars--) mf_rewind(¤t->start);
+ }
+}
+
+void mf_wordwrap(const struct mf_font_s *font, int16_t width,
+ mf_str text, mf_line_callback_t callback, void *state)
+{
+ struct linelen_s current = { 0 };
+ struct linelen_s previous = { 0 };
+ bool full;
+
+ current.start = text;
+
+ while (*text)
+ {
+ full = !append_word(font, width, ¤t, &text);
+
+ if (full || current.linebreak)
+ {
+ if (!current.chars)
+ {
+ /* We have a very long word. We must just cut it off at some
+ * point. */
+ while (append_char(font, width, ¤t, &text));
+ }
+
+ if (previous.chars)
+ {
+ /* Tune the length and dispatch the previous line. */
+ if (!previous.linebreak && !current.linebreak)
+ tune_lines(¤t, &previous, width);
+
+ if (!callback(previous.start, previous.chars, state))
+ return;
+ }
+
+ previous = current;
+ current.start = text;
+ current.chars = 0;
+ current.width = 0;
+ current.linebreak = false;
+ current.last_word.word = 0;
+ current.last_word.space = 0;
+ current.last_word.chars = 0;
+ }
+ }
+
+ /* Dispatch the last lines. */
+ if (previous.chars)
+ {
+ if (!callback(previous.start, previous.chars, state))
+ return;
+ }
+
+ if (current.chars)
+ callback(current.start, current.chars, state);
+}
+
+void mf_text_draw_area(const struct mf_font_s *font, int16_t width,
+ mf_str text,
+ int *total_height_in_rows,
+ int *max_pixels_per_row)
+{
+ struct linelen_s current = { 0 };
+ struct linelen_s previous = { 0 };
+ bool full;
+
+ current.start = text;
+ *total_height_in_rows = 0;
+ *max_pixels_per_row = 0;
+
+ while (*text)
+ {
+ full = !append_word(font, width, ¤t, &text);
+
+ if (full || current.linebreak)
+ {
+ if (!current.chars)
+ {
+ /* We have a very long word. We must just cut it off at some
+ * point. */
+ while (append_char(font, width, ¤t, &text));
+ }
+
+ if (previous.chars)
+ {
+ /* Tune the length and dispatch the previous line. */
+ if (!previous.linebreak && !current.linebreak)
+ tune_lines(¤t, &previous, width);
+ *total_height_in_rows += 1;
+ }
+
+ if ( *max_pixels_per_row < current.width )
+ *max_pixels_per_row = current.width;
+ previous = current;
+ current.start = text;
+ current.chars = 0;
+ current.width = 0;
+ current.linebreak = false;
+ current.last_word.word = 0;
+ current.last_word.space = 0;
+ current.last_word.chars = 0;
+ }
+ }
+
+ /* Dispatch the last lines. */
+ if (previous.chars)
+ {
+ if ( *max_pixels_per_row < previous.width )
+ *max_pixels_per_row = previous.width;
+ *total_height_in_rows += 1;
+ }
+
+ if (current.chars) {
+ if ( *max_pixels_per_row < current.width )
+ *max_pixels_per_row = current.width;
+ *total_height_in_rows += 1;
+ }
+
+}
+
+#else
+
+void mf_wordwrap(const struct mf_font_s *font, int16_t width,
+ mf_str text, mf_line_callback_t callback, void *state)
+{
+ mf_str orig = text;
+ mf_str linestart;
+
+ /* Current line width and character count */
+ int16_t lw_cur = 0, cc_cur = 0;
+
+ /* Previous wrap point */
+ int16_t cc_prev;
+ mf_str ls_prev;
+
+ linestart = text;
+
+ while (*text)
+ {
+ cc_prev = 0;
+ ls_prev = text;
+
+ while (*text)
+ {
+ mf_char c;
+ int16_t new_width;
+ mf_str tmp;
+
+ tmp = text;
+ c = mf_getchar(&text);
+ new_width = lw_cur + mf_character_width(font, c);
+
+ if (c == '\n')
+ {
+ cc_prev = cc_cur + 1;
+ ls_prev = text;
+ break;
+ }
+
+ if (new_width > width)
+ {
+ text = tmp;
+ break;
+ }
+
+ cc_cur++;
+ lw_cur = new_width;
+
+ if (is_wrap_space(c))
+ {
+ cc_prev = cc_cur;
+ ls_prev = text;
+ }
+ }
+
+ /* Handle unbreakable words */
+ if (cc_prev == 0)
+ {
+ cc_prev = cc_cur;
+ ls_prev = text;
+ }
+
+ if (!callback(linestart, cc_prev, state))
+ return;
+
+ linestart = ls_prev;
+ text = linestart;
+ lw_cur = 0;
+ cc_cur = 0;
+ }
+}
+
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h
rename to bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h
index d14eb66..ada7333 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/mcufont/decoder/mf_wordwrap.h
@@ -1,35 +1,35 @@
-/* Word wrapping algorithm with UTF-8 support. More than just a basic greedy
- * word-wrapper: it attempts to balance consecutive lines as pairs.
- */
-
-#ifndef _MF_WORDWRAP_H_
-#define _MF_WORDWRAP_H_
-
-#include "mf_rlefont.h"
-#include
-
-/* Callback function for handling each line.
- *
- * line: Pointer to the beginning of the string for this line.
- * count: Number of characters on the line.
- * state: Free variable that was passed to wordwrap().
- *
- * Returns: true to continue, false to stop after this line.
- */
-typedef bool (*mf_line_callback_t) (mf_str line, uint16_t count,
- void *state);
-
-/* Word wrap a piece of text. Calls the callback function for each line.
- *
- * font: Font to use for metrics.
- * width: Maximum line width in pixels.
- * text: Pointer to the start of the text to process.
- * state: Free variable for caller to use (can be NULL).
- */
-MF_EXTERN void mf_wordwrap(const struct mf_font_s *font, int16_t width,
- mf_str text, mf_line_callback_t callback, void *state);
-
-void mf_text_draw_area(const struct mf_font_s *font, int16_t width,
- mf_str text, int *total_height_in_rows,
- int *max_pixels_per_row);
-#endif
+/* Word wrapping algorithm with UTF-8 support. More than just a basic greedy
+ * word-wrapper: it attempts to balance consecutive lines as pairs.
+ */
+
+#ifndef _MF_WORDWRAP_H_
+#define _MF_WORDWRAP_H_
+
+#include "mf_rlefont.h"
+#include
+
+/* Callback function for handling each line.
+ *
+ * line: Pointer to the beginning of the string for this line.
+ * count: Number of characters on the line.
+ * state: Free variable that was passed to wordwrap().
+ *
+ * Returns: true to continue, false to stop after this line.
+ */
+typedef bool (*mf_line_callback_t) (mf_str line, uint16_t count,
+ void *state);
+
+/* Word wrap a piece of text. Calls the callback function for each line.
+ *
+ * font: Font to use for metrics.
+ * width: Maximum line width in pixels.
+ * text: Pointer to the start of the text to process.
+ * state: Free variable for caller to use (can be NULL).
+ */
+MF_EXTERN void mf_wordwrap(const struct mf_font_s *font, int16_t width,
+ mf_str text, mf_line_callback_t callback, void *state);
+
+void mf_text_draw_area(const struct mf_font_s *font, int16_t width,
+ mf_str text, int *total_height_in_rows,
+ int *max_pixels_per_row);
+#endif
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c b/bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c
rename to bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c
index bffb081..6869feb 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/rle_font_read.c
@@ -1,716 +1,716 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-/** Include Files */
-#include
-#include
-#include
-#include
-#include "FreeRTOS.h"
-#include "vg_lite.h"
-#include "buf_reader.h"
-#include "vg_lite_text.h"
-#include "vft_draw.h"
-#include "vft_debug.h"
-
-/** Macros */
-#define __COUNTOF(x) (sizeof(x)/sizeof(x[0]))
-#define MAX_SYSTEM_FONTS (8)
-
-#define RCD_ALLOC(x) _mem_allocate(x)
-#define RCD_FREE(x) _mem_free(x)
-
-#ifdef ENABLE_DEBUG_TRACE
-static int g_id;
-
-#define DBG_ID() (g_id)
-#define DBG_INC_ID() (g_id++)
-#define DBG_SET_ID(x) g_id = x
-#else
-
-#define DBG_ID() (0)
-#define DBG_INC_ID() (0)
-#define DBG_SET_ID(x)
-#endif
-
-#if APP_ENABLE_SDCARD
-#define sprintf_s snprintf
-#endif
-
-/** Data structures */
-typedef struct font_height_list {
- const char font_height;
- const char ref_font_height;
- const char ref_font_scale;
-} font_height_list_t;
-
-typedef struct font_info_internal {
- /* Variable shared between user and driver */
- vg_lite_font_params_t font_params;
- /* any additional variables internal to driver */
- int valid;
- /* Internal loaded raster font */
- struct mf_font_s *_raster_font;
- /* Internal loaded vector font */
- font_face_desc_t *_vector_font;
-}font_info_internal_t;
-
-/** Internal or external API prototypes */
-
-/** Globals */
-static font_info_internal_t s_device_fonts[MAX_SYSTEM_FONTS];
-
-/** Local function prototypes */
-int read_rle_font_header(bufferred_reader_t *f, struct mf_font_s* font);
-int read_rle_font_from_buffer(char *buf, int size, struct mf_font_s* font);
-int load_raster_font(char *data, int data_len, struct mf_font_s** font);
-
-int read_8b(bufferred_reader_t *f, uint8_t* pdata);
-int read_16b(bufferred_reader_t *f, uint16_t* pword);
-int read_32b(bufferred_reader_t *f, uint32_t* pword);
-int read_16b_blob(bufferred_reader_t *f, uint16_t** ary, uint32_t* ary_len);
-int read_8b_blob(bufferred_reader_t *f, uint8_t** ary, uint32_t* ary_len);
-int free_rle_font_memory(struct mf_font_s** font);
-vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font);
-vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height);
-
-/** Externs if any */
-
-/** Code section */
-vg_lite_font_t vg_lite_find_font(
- char *font_name,
- eFontWeight_t font_weight,
- eFontStretch_t font_stretch,
- eFontStyle_t font_style,
- int font_height);
-
-vg_lite_error_t vg_lite_register_font(vg_lite_font_t *font,
- vg_lite_font_params_t *params)
-{
- int i;
- int free_entry = VG_LITE_INVALID_FONT;
-
- if (font != NULL)
- *font = VG_LITE_INVALID_FONT;
-
- /* Check if font is already registered */
- for (i=0; iname,
- strlen(s_device_fonts[i].font_params.name)) == 0)
- {
- return VG_LITE_ALREADY_EXISTS;
- }
- } else {
- printf("Corrupt font table\n");
- return VG_LITE_INVALID_ARGUMENT;
- }
- }
-
- /* Check if list is completely full or not */
- if ( i == MAX_SYSTEM_FONTS && free_entry == VG_LITE_INVALID_FONT) {
- /* Font List descriptor exhausted */
- return VG_LITE_OUT_OF_RESOURCES;
- } else {
- /* Add new font in global table */
- memcpy(&s_device_fonts[free_entry].font_params, params, sizeof(vg_lite_font_params_t));
- s_device_fonts[free_entry].valid = 1;
-/*
- Loading font here leads to low run-time memory, we may need to characterize memory usage
- e.g. pure path test don't require font, eventhrough application registers them
-*/
-#if 0
- error = vg_lite_load_font_data(free_entry, params->font_height);
- if ( error != 0 ) {
- s_device_fonts[free_entry].valid = 0;
- return error;
- }
-#endif
- }
-
- if (font != NULL)
- *font = free_entry;
-
- return VG_LITE_SUCCESS;
-}
-
-int vg_lite_is_font_valid(vg_lite_font_t font)
-{
- if (font < MAX_SYSTEM_FONTS) {
- if (s_device_fonts[font].valid == 1)
- return 0;
- }
- return VG_LITE_INVALID_ARGUMENT;
-}
-
-int vg_lite_is_vector_font(vg_lite_font_t font)
-{
- if (font < MAX_SYSTEM_FONTS) {
- if (s_device_fonts[font].valid == 1)
- return (s_device_fonts[font].font_params.font_type ==
- eFontTypeVector);
- else
- return 0;
- }
- return VG_LITE_INVALID_ARGUMENT;;
-}
-
-vg_lite_error_t vg_lite_unregister_font(vg_lite_font_t font)
-{
- if (vg_lite_is_font_valid(font) != 0 ) {
- /* Font not found */
- return VG_LITE_INVALID_ARGUMENT;;
- }
-
- vg_lite_free_font_memory(font);
- s_device_fonts[font].valid = 0;
- return VG_LITE_SUCCESS;
-}
-
-char *vg_lite_get_font_name(vg_lite_font_t font)
-{
- if ( vg_lite_is_font_valid(font) != 0 ) {
- return NULL;
- }
-
- return (char *)s_device_fonts[font].font_params.name;
-}
-
-vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font)
-{
- if ( vg_lite_is_font_valid(font) != 0 ) {
- /* Font not found */
- return VG_LITE_INVALID_ARGUMENT;
- }
- switch (s_device_fonts[font].font_params.font_type) {
- case eFontTypeVector:
- if ( s_device_fonts[font]._vector_font != NULL ) {
- vft_unload(s_device_fonts[font]._vector_font);
- s_device_fonts[font]._vector_font = NULL;
- }
- break;
- case eFontTypeRaster:
- if ( s_device_fonts[font]._raster_font != NULL ) {
- free_rle_font_memory(&s_device_fonts[font]._raster_font);
- s_device_fonts[font]._raster_font = NULL;
- }
- break;
- }
-
- return VG_LITE_SUCCESS;
-}
-
-font_face_desc_t *_vg_lite_get_vector_font(vg_lite_font_t font)
-{
- if ( vg_lite_is_font_valid(font) != 0 ) {
- return NULL;
- }
-
- return s_device_fonts[font]._vector_font;
-}
-
-struct mf_font_s *_vg_lite_get_raster_font(vg_lite_font_t font)
-{
- if ( vg_lite_is_font_valid(font) != 0 ) {
- return NULL;
- }
-
- return s_device_fonts[font]._raster_font;
-}
-
-vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height)
-{
- if ( vg_lite_is_font_valid(font) != 0 ) {
- /* Font not found */
- return VG_LITE_INVALID_ARGUMENT;
- }
-
- switch (s_device_fonts[font].font_params.font_type) {
- case eFontTypeVector:
- if (s_device_fonts[font]._vector_font == NULL ) {
- //printf("Loading vector font : [%s]\n",
- // s_device_fonts[font].font_params.name);
- s_device_fonts[font]._vector_font =
- vft_load_from_buffer(
- s_device_fonts[font].font_params.data,
- s_device_fonts[font].font_params.data_len);
- if ( s_device_fonts[font]._vector_font == NULL ) {
- return VG_LITE_INVALID_ARGUMENT;
- }
- }
- return VG_LITE_SUCCESS;
- case eFontTypeRaster:
- if (s_device_fonts[font]._raster_font == NULL ) {
- //printf("Loading raster font : [%s]\n",
- // s_device_fonts[font].font_params.name);
- /* Raster fonts height should match */
- if ( font_height == s_device_fonts[font].font_params.font_height &&
- load_raster_font(
- s_device_fonts[font].font_params.data,
- s_device_fonts[font].font_params.data_len,
- &s_device_fonts[font]._raster_font) != 0)
- {
- return VG_LITE_INVALID_ARGUMENT;
- }
- }
- return VG_LITE_SUCCESS;
- }
- return VG_LITE_INVALID_ARGUMENT;
-}
-
-
-vg_lite_font_t vg_lite_find_font(
- char *font_name_list,
- eFontWeight_t font_weight,
- eFontStretch_t font_stretch,
- eFontStyle_t font_style,
- int font_height)
-{
- int i;
- char tmp_data;
- int font_found = 0;
- int end_pos = 0; /* End position of font name */
- char *font_name;
- /*
- printf("Font params: [%s],%d, %d, %d, %d\n",
- font_name_list,
- font_weight,
- font_stretch,
- font_style,
- font_height);
- */
-
- /* While probing font, if required font is found, then
- only keep that name in supplied font list */
-
- /* Split and extract font name one-by-one */
- font_name = font_name_list;
- while (font_found == 0 &&
- font_name[end_pos] != '\0')
- {
- tmp_data = '\0';
- /* Scan for seperator */
- while (font_name[end_pos] != '\0') {
- if (font_name[end_pos] == ',' || font_name[end_pos] == ' ' ||
- font_name[end_pos] == '\t')
- {
- tmp_data = font_name[end_pos];
- font_name[end_pos] = '\0';
- break;
- }
- end_pos++;
- }
-
- /* Search for exact font-name match */
- for (i=0; i<__COUNTOF(s_device_fonts); i++) {
- if (s_device_fonts[i].valid == 0)
- continue;
-
- /* For vector font only compare name */
- if (s_device_fonts[i].font_params.font_type == eFontTypeVector ) {
- if ( strlen(font_name) > 0 &&
- strcmp(font_name,
- s_device_fonts[i].font_params.name) == 0)
- {
- font_name[end_pos] = tmp_data; /* Restor delimeter */
- return i;
- }
- } else {
- /* For raster font compare all properties */
- if (s_device_fonts[i].font_params.font_weight == font_weight &&
- s_device_fonts[i].font_params.font_stretch == font_stretch &&
- s_device_fonts[i].font_params.font_style == font_style )
- {
- if ( strlen(font_name) > 0 &&
- strcmp(font_name,
- s_device_fonts[i].font_params.name) == 0)
- {
- font_name[end_pos] = tmp_data; /* Restor delimeter */
-
- if (s_device_fonts[i].font_params.font_height == font_height)
- {
- return i;
- }
- /* Update font_name_list to improve future searches */
- strncpy(font_name_list, font_name, strlen(font_name)+1);
- }
- }
- }
- }
- /* Continue searching for other font entries */
- font_name[end_pos] = tmp_data;
- font_name += (end_pos + 1);
- end_pos = 0;
- }
- printf("WARNING: [%s] Font not found\r\n",font_name_list);
-
- return VG_LITE_INVALID_FONT;
-}
-
-void vg_lite_text_init(void)
-{
- static int font_table_ready = 0;
-
- if (font_table_ready)
- return;
-
- /* Initialize font table */
- memset(s_device_fonts, 0, MAX_SYSTEM_FONTS * sizeof(font_info_internal_t));
- font_table_ready = 1;
-}
-
-/* Read-Write 8-bit unsigned int data */
-int read_8b(bufferred_reader_t * f, uint8_t* pdata)
-{
- bufferred_fread(pdata, 1, 1, f);
- TRACE_DBG(("%d) 8b: fp=%08x %d %d\r\n", DBG_INC_ID(),
- bufferred_ftell(f) - 1, 1, *pdata));
- return 1;
-}
-
-/* Read-Write 16-bit unsigned int data */
-int read_16b(bufferred_reader_t * f, uint16_t* pword)
-{
- uint8_t buf[4];
- uint16_t word;
-
- bufferred_fread(buf, 2, 1, f);
- word = 0; word += buf[1];
- word <<= 8; word += buf[0];
-
- TRACE_DBG(("%d) 16b: fp=%08x %d %d\r\n", DBG_INC_ID(),
- bufferred_ftell(f)-2, 2, word));
- *pword = word;
- return 2;
-}
-
-/* Read-write 32-bit unsigned int data */
-int read_32b(bufferred_reader_t * f, uint32_t* pword)
-{
- uint8_t buf[4];
- uint32_t word;
-
- bufferred_fread(buf, 4, 1, f);
- word = 0; word += buf[3];
- word <<= 8; word += buf[2];
- word <<= 8; word += buf[1];
- word <<= 8; word += buf[0];
-
- *pword = word;
- TRACE_DBG(("%d) 32b: fp=%08x %d %d\r\n", DBG_INC_ID(),
- bufferred_ftell(f) - 4, 4,
- word));
- return 4;
-}
-
-int read_16b_blob(bufferred_reader_t * f, uint16_t** ary, uint32_t* ary_len)
-{
- uint16_t blob_len = 0;
-
- *ary_len = 0;
- bufferred_fread(&blob_len, 1, sizeof(uint16_t), f);
- *ary = (uint16_t *)RCD_ALLOC(blob_len * sizeof(uint16_t)); /* Malloc must be aligned on 2 byte boundary */
- if (*ary == NULL) {
- TRACE_ERR(("ERROR: malloc failed\n"));;
- return VG_LITE_OUT_OF_MEMORY;
- }
- if ((((unsigned long)*ary) & 0x1) != 0) {
- TRACE_ERR(("ERROR: malloc pointer not 2 byte aligned\n"));;
- return VG_LITE_NOT_ALIGNED;
- }
- TRACE_DBG(("%d ) 16b_blob: fp=%08x %d\r\n", DBG_INC_ID(), bufferred_ftell(f)-2,
- (int)blob_len));
- bufferred_fread(*ary, 2, blob_len, f);
- *ary_len = blob_len * 2;
-
- return blob_len + 2; /* Actual bytes read from file */
-}
-
-int read_8b_blob(bufferred_reader_t * f, uint8_t** ary, uint32_t *ary_len)
-{
- uint16_t blob_len = 0;
- uint8_t* p_tmp = (uint8_t *)NULL;
- bufferred_fread(&blob_len, 1, sizeof(uint16_t), f);
- //TRACE_DBG(("%d) 8b_blob: %d\r\n", DBG_INC_ID(), blob_len));
- p_tmp = (uint8_t *)RCD_ALLOC(blob_len+1);
- if (p_tmp == NULL) {
- TRACE_ERR(("ERROR: malloc failed\n"));;
- return VG_LITE_OUT_OF_MEMORY;
- }
- TRACE_DBG(("%d ) 8b_blob: fp=%08x %d\r\n", DBG_INC_ID(), bufferred_ftell(f)-2,
- (int)blob_len));
- bufferred_fread(p_tmp, 1, blob_len, f);
- p_tmp[blob_len] = 0;
- *ary = p_tmp;
-
- return blob_len + 2; /* Actual bytes read from file */
-}
-
-#define EXIT_IF_NEGATIVE(param) if ((ret = param) < 0) return ret;
-
-int read_rle_font_header(bufferred_reader_t * f, struct mf_font_s* font)
-{
- int raw_header_offset = 0;
- struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)font;
- uint32_t size = 0;
- int ret = 0;
-
- TRACE_DBG(("** %s\r\n", __FUNCTION__));
- DBG_SET_ID(0);
-
- EXIT_IF_NEGATIVE(read_8b_blob(f, (uint8_t **)&font->full_name, &size));
- raw_header_offset += ret; /* font.full_name */
-
- EXIT_IF_NEGATIVE(read_8b_blob(f, (uint8_t **)&font->short_name, &size));
- raw_header_offset += ret; /* font.short_name */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->width));
- raw_header_offset += 1; /* font.width */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->height));
- raw_header_offset += 1; /* font.height */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->min_x_advance));
- raw_header_offset += 1; /* font.min_x_advance */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->max_x_advance));
- raw_header_offset += 1; /* font.max_x_advance */
-
- EXIT_IF_NEGATIVE(read_8b(f, (uint8_t *)&font->baseline_x));
- raw_header_offset += 1; /* font.baseline_x */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->baseline_y));
- raw_header_offset += 1; /* font.baseline_y */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->line_height));
- raw_header_offset += 1; /* font.line_height */
-
- EXIT_IF_NEGATIVE(read_8b(f, &font->flags));
- raw_header_offset += 1; /* font.flags */
-
- EXIT_IF_NEGATIVE(read_16b(f, &font->fallback_character));
- raw_header_offset += 2; /* font.fallback_character */
-
- EXIT_IF_NEGATIVE(read_8b(f, &(mfont->version)));
- raw_header_offset += 1; /* mf_rlefont_s.version */
-
- /* Other mf_rlefont_s variables */
- uint16_t value = 0;
- EXIT_IF_NEGATIVE(read_16b(f, &value)); //&mfont->dictionary_data_size));
- mfont->dictionary_data_size = value;
- raw_header_offset += 2; /* mf_rlefont_s.dictionary_data_size */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->dictionary_data_fp_offset));
- raw_header_offset += 4; /* mf_rlefont_s.dictionary_data_fp_offset */
-
- value = 0;
- EXIT_IF_NEGATIVE(read_16b(f, &value)); //mfont->dictionary_offsets_size));
- mfont->dictionary_offsets_size = value;
- raw_header_offset += 2; /* mf_rlefont_s.dictionary_data_size */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->dictionary_offsets_fp_offset));
- raw_header_offset += 4; /* mf_rlefont_s.dictionary_data_fp_offset */
-
- EXIT_IF_NEGATIVE(read_8b(f, &mfont->rle_entry_count));
- raw_header_offset += 1; /* mf_rlefont_s.rle_entry_count */
-
- EXIT_IF_NEGATIVE(read_8b(f, &mfont->dict_entry_count));
- raw_header_offset += 1; /* mf_rlefont_s.dict_entry_count */
-
- EXIT_IF_NEGATIVE(read_8b(f, &mfont->char_range_count));
- raw_header_offset += 1; /* mf_rlefont_s.char_range_count */
-
- mfont->char_ranges = (struct mf_rlefont_char_range_s *)RCD_ALLOC(sizeof(struct mf_rlefont_char_range_s)* mfont->char_range_count);
- memset(mfont->char_ranges, 0, sizeof(struct mf_rlefont_char_range_s) * mfont->char_range_count);
-
- /* Skip size of ranges */
- for (int r = 0; r < mfont->char_range_count; r++) {
- EXIT_IF_NEGATIVE(read_16b(f, &mfont->char_ranges[r].first_char));
- raw_header_offset += 2; /* mf_rlefont_s.char_ranges[r].first_char */
-
- EXIT_IF_NEGATIVE(read_16b(f, &mfont->char_ranges[r].char_count));
- raw_header_offset += 2; /* mf_rlefont_s.char_ranges[r].char_count */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_offsets_fp_offset));
- raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_fp_offset */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_offsets_size));
- raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_size */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_data_fp_offset));
- raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_fp_offset */
-
- EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_data_size));
- raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_size */
- }
- return raw_header_offset;
-}
-
-/* Writes a BMP file. The data is assumed to be 8-bit grayscale. */
-int read_rle_font_from_buffer(char *buff, int size, struct mf_font_s* font)
-{
- struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)font;
- bufferred_reader_t f_obj;
- bufferred_reader_t * f = &f_obj;
- int raw_header_offset = 0;
- int fp_offset;
- int ret;
-
- DBG_SET_ID(0);
-
- /* No need to dynamically allocate small descriptor */
- if ( bufferred_fopen(f, buff, size) < 0 ) {
- /* Font file open failed */
- return VG_LITE_INVALID_ARGUMENT;
- }
-
- raw_header_offset = read_rle_font_header(f, font);
- if (mfont->dictionary_data_fp_offset != raw_header_offset) {
- TRACE_ERR(("ERROR: dictonary offset is different"));
- }
- TRACE_DBG(("** %s\r\n", __FUNCTION__));
- DBG_SET_ID(0);
-
- /* Skip header portion */
- bufferred_fseek(f, raw_header_offset, SEEK_SET);
- /* Write dictionary entries */
- fp_offset = raw_header_offset;
- TRACE_DBG(("dictionary_data_fp_offset=%08x %08x\r\n",
- mfont->dictionary_data_fp_offset, bufferred_ftell(f)));
- //mfont->dictionary_data_fp_offset = fp_offset;
- EXIT_IF_NEGATIVE(read_8b_blob(f, &mfont->dictionary_data,
- &mfont->dictionary_data_size));
- fp_offset += mfont->dictionary_data_size + 2;
-
- //mfont->dictionary_offsets_fp_offset = fp_offset;
- TRACE_DBG(("dictionary_offsets_fp_offset=%08x %08x\r\n",
- mfont->dictionary_offsets_fp_offset, bufferred_ftell(f)));
- EXIT_IF_NEGATIVE(read_16b_blob(f, &mfont->dictionary_offsets,
- &mfont->dictionary_offsets_size));
- fp_offset += mfont->dictionary_offsets_size + 2;
-
- /* Write range entries */
- for (int r = 0; r < mfont->char_range_count; r++) {
- //mfont->char_ranges[r].glyph_offsets_fp_offset = fp_offset;
- TRACE_DBG(("mfont->char_ranges[%d].glyph_offsets=%08x %08x\r\n", r,
- mfont->char_ranges[r].glyph_offsets_fp_offset, bufferred_ftell(f)));
- EXIT_IF_NEGATIVE(read_16b_blob(f, &mfont->char_ranges[r].glyph_offsets,
- &mfont->char_ranges[r].glyph_offsets_size));
- fp_offset += mfont->char_ranges[r].glyph_offsets_size + 2;
-
- //mfont->char_ranges[r].glyph_data_fp_offset = fp_offset;
- TRACE_DBG(("mfont->char_ranges[%d].glyph_data_fp_offset=%08x %08x\r\n",
- r,
- mfont->char_ranges[r].glyph_data_fp_offset, bufferred_ftell(f)));
- EXIT_IF_NEGATIVE(read_8b_blob(f, &mfont->char_ranges[r].glyph_data,\
- &mfont->char_ranges[r].glyph_data_size));
- fp_offset += mfont->char_ranges[r].glyph_data_size + 2;
- }
-
- bufferred_fclose(f);
- return 0;
-}
-
-int load_raster_font(char *data, int data_len, struct mf_font_s** font)
-{
- int ret;
-
- /* Allocate font memory */
- *font = (struct mf_font_s*)RCD_ALLOC(sizeof(struct mf_rlefont_s));
- if (*font == NULL) {
- return VG_LITE_OUT_OF_MEMORY;
- }
- memset(*font, 0, sizeof(struct mf_rlefont_s));
-
- /* Load font from file */
- ret = read_rle_font_from_buffer(data,
- data_len, *font);
- if (ret < 0) {
- return ret;
- }
-
- /* Update generic char width pointers of mculib */
- uint8_t mf_rlefont_character_width(const struct mf_font_s* font,
- uint16_t character);
- uint8_t mf_rlefont_render_character(const struct mf_font_s* font,
- int16_t x0, int16_t y0,
- uint16_t character,
- mf_pixel_callback_t callback,
- void* state);
-
- (*font)->character_width = &mf_rlefont_character_width;
- (*font)->render_character = &mf_rlefont_render_character;
-
-
- return 0;
-}
-
-int free_rle_font_memory(struct mf_font_s** font)
-{
- struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)(*font);
-
- RCD_FREE(mfont->font.full_name);
- RCD_FREE(mfont->font.short_name);
- RCD_FREE(mfont->dictionary_data);
- RCD_FREE(mfont->dictionary_offsets);
- for (int r = 0; r < mfont->char_range_count; r++) {
- RCD_FREE(mfont->char_ranges[r].glyph_offsets);
- RCD_FREE(mfont->char_ranges[r].glyph_data);
- }
- #ifdef DEBUG_RESET_DATASTRUCTURE_ON_FREE
- memset(mfont->char_ranges);
- #endif
- RCD_FREE(mfont->char_ranges);
-
- #ifdef DEBUG_RESET_DATASTRUCTURE_ON_FREE
- memset(mfont);
- #endif
- RCD_FREE(mfont);
-
- *font = NULL;
- return 0;
-}
-
-void vg_lite_unload_font_data(void)
-{
- for(int i=0; i
+#include
+#include
+#include
+#include "FreeRTOS.h"
+#include "vg_lite.h"
+#include "buf_reader.h"
+#include "vg_lite_text.h"
+#include "vft_draw.h"
+#include "vft_debug.h"
+
+/** Macros */
+#define __COUNTOF(x) (sizeof(x)/sizeof(x[0]))
+#define MAX_SYSTEM_FONTS (8)
+
+#define RCD_ALLOC(x) _mem_allocate(x)
+#define RCD_FREE(x) _mem_free(x)
+
+#ifdef ENABLE_DEBUG_TRACE
+static int g_id;
+
+#define DBG_ID() (g_id)
+#define DBG_INC_ID() (g_id++)
+#define DBG_SET_ID(x) g_id = x
+#else
+
+#define DBG_ID() (0)
+#define DBG_INC_ID() (0)
+#define DBG_SET_ID(x)
+#endif
+
+#if APP_ENABLE_SDCARD
+#define sprintf_s snprintf
+#endif
+
+/** Data structures */
+typedef struct font_height_list {
+ const char font_height;
+ const char ref_font_height;
+ const char ref_font_scale;
+} font_height_list_t;
+
+typedef struct font_info_internal {
+ /* Variable shared between user and driver */
+ vg_lite_font_params_t font_params;
+ /* any additional variables internal to driver */
+ int valid;
+ /* Internal loaded raster font */
+ struct mf_font_s *_raster_font;
+ /* Internal loaded vector font */
+ font_face_desc_t *_vector_font;
+}font_info_internal_t;
+
+/** Internal or external API prototypes */
+
+/** Globals */
+static font_info_internal_t s_device_fonts[MAX_SYSTEM_FONTS];
+
+/** Local function prototypes */
+int read_rle_font_header(bufferred_reader_t *f, struct mf_font_s* font);
+int read_rle_font_from_buffer(char *buf, int size, struct mf_font_s* font);
+int load_raster_font(char *data, int data_len, struct mf_font_s** font);
+
+int read_8b(bufferred_reader_t *f, uint8_t* pdata);
+int read_16b(bufferred_reader_t *f, uint16_t* pword);
+int read_32b(bufferred_reader_t *f, uint32_t* pword);
+int read_16b_blob(bufferred_reader_t *f, uint16_t** ary, uint32_t* ary_len);
+int read_8b_blob(bufferred_reader_t *f, uint8_t** ary, uint32_t* ary_len);
+int free_rle_font_memory(struct mf_font_s** font);
+vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font);
+vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height);
+
+/** Externs if any */
+
+/** Code section */
+vg_lite_font_t vg_lite_find_font(
+ char *font_name,
+ eFontWeight_t font_weight,
+ eFontStretch_t font_stretch,
+ eFontStyle_t font_style,
+ int font_height);
+
+vg_lite_error_t vg_lite_register_font(vg_lite_font_t *font,
+ vg_lite_font_params_t *params)
+{
+ int i;
+ int free_entry = VG_LITE_INVALID_FONT;
+
+ if (font != NULL)
+ *font = VG_LITE_INVALID_FONT;
+
+ /* Check if font is already registered */
+ for (i=0; iname,
+ strlen(s_device_fonts[i].font_params.name)) == 0)
+ {
+ return VG_LITE_ALREADY_EXISTS;
+ }
+ } else {
+ printf("Corrupt font table\n");
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ }
+
+ /* Check if list is completely full or not */
+ if ( i == MAX_SYSTEM_FONTS && free_entry == VG_LITE_INVALID_FONT) {
+ /* Font List descriptor exhausted */
+ return VG_LITE_OUT_OF_RESOURCES;
+ } else {
+ /* Add new font in global table */
+ memcpy(&s_device_fonts[free_entry].font_params, params, sizeof(vg_lite_font_params_t));
+ s_device_fonts[free_entry].valid = 1;
+/*
+ Loading font here leads to low run-time memory, we may need to characterize memory usage
+ e.g. pure path test don't require font, eventhrough application registers them
+*/
+#if 0
+ error = vg_lite_load_font_data(free_entry, params->font_height);
+ if ( error != 0 ) {
+ s_device_fonts[free_entry].valid = 0;
+ return error;
+ }
+#endif
+ }
+
+ if (font != NULL)
+ *font = free_entry;
+
+ return VG_LITE_SUCCESS;
+}
+
+int vg_lite_is_font_valid(vg_lite_font_t font)
+{
+ if (font < MAX_SYSTEM_FONTS) {
+ if (s_device_fonts[font].valid == 1)
+ return 0;
+ }
+ return VG_LITE_INVALID_ARGUMENT;
+}
+
+int vg_lite_is_vector_font(vg_lite_font_t font)
+{
+ if (font < MAX_SYSTEM_FONTS) {
+ if (s_device_fonts[font].valid == 1)
+ return (s_device_fonts[font].font_params.font_type ==
+ eFontTypeVector);
+ else
+ return 0;
+ }
+ return VG_LITE_INVALID_ARGUMENT;;
+}
+
+vg_lite_error_t vg_lite_unregister_font(vg_lite_font_t font)
+{
+ if (vg_lite_is_font_valid(font) != 0 ) {
+ /* Font not found */
+ return VG_LITE_INVALID_ARGUMENT;;
+ }
+
+ vg_lite_free_font_memory(font);
+ s_device_fonts[font].valid = 0;
+ return VG_LITE_SUCCESS;
+}
+
+char *vg_lite_get_font_name(vg_lite_font_t font)
+{
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ return NULL;
+ }
+
+ return (char *)s_device_fonts[font].font_params.name;
+}
+
+vg_lite_error_t vg_lite_free_font_memory(vg_lite_font_t font)
+{
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ /* Font not found */
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ switch (s_device_fonts[font].font_params.font_type) {
+ case eFontTypeVector:
+ if ( s_device_fonts[font]._vector_font != NULL ) {
+ vft_unload(s_device_fonts[font]._vector_font);
+ s_device_fonts[font]._vector_font = NULL;
+ }
+ break;
+ case eFontTypeRaster:
+ if ( s_device_fonts[font]._raster_font != NULL ) {
+ free_rle_font_memory(&s_device_fonts[font]._raster_font);
+ s_device_fonts[font]._raster_font = NULL;
+ }
+ break;
+ }
+
+ return VG_LITE_SUCCESS;
+}
+
+font_face_desc_t *_vg_lite_get_vector_font(vg_lite_font_t font)
+{
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ return NULL;
+ }
+
+ return s_device_fonts[font]._vector_font;
+}
+
+struct mf_font_s *_vg_lite_get_raster_font(vg_lite_font_t font)
+{
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ return NULL;
+ }
+
+ return s_device_fonts[font]._raster_font;
+}
+
+vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height)
+{
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ /* Font not found */
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ switch (s_device_fonts[font].font_params.font_type) {
+ case eFontTypeVector:
+ if (s_device_fonts[font]._vector_font == NULL ) {
+ //printf("Loading vector font : [%s]\n",
+ // s_device_fonts[font].font_params.name);
+ s_device_fonts[font]._vector_font =
+ vft_load_from_buffer(
+ s_device_fonts[font].font_params.data,
+ s_device_fonts[font].font_params.data_len);
+ if ( s_device_fonts[font]._vector_font == NULL ) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ }
+ return VG_LITE_SUCCESS;
+ case eFontTypeRaster:
+ if (s_device_fonts[font]._raster_font == NULL ) {
+ //printf("Loading raster font : [%s]\n",
+ // s_device_fonts[font].font_params.name);
+ /* Raster fonts height should match */
+ if ( font_height == s_device_fonts[font].font_params.font_height &&
+ load_raster_font(
+ s_device_fonts[font].font_params.data,
+ s_device_fonts[font].font_params.data_len,
+ &s_device_fonts[font]._raster_font) != 0)
+ {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+ }
+ return VG_LITE_SUCCESS;
+ }
+ return VG_LITE_INVALID_ARGUMENT;
+}
+
+
+vg_lite_font_t vg_lite_find_font(
+ char *font_name_list,
+ eFontWeight_t font_weight,
+ eFontStretch_t font_stretch,
+ eFontStyle_t font_style,
+ int font_height)
+{
+ int i;
+ char tmp_data;
+ int font_found = 0;
+ int end_pos = 0; /* End position of font name */
+ char *font_name;
+ /*
+ printf("Font params: [%s],%d, %d, %d, %d\n",
+ font_name_list,
+ font_weight,
+ font_stretch,
+ font_style,
+ font_height);
+ */
+
+ /* While probing font, if required font is found, then
+ only keep that name in supplied font list */
+
+ /* Split and extract font name one-by-one */
+ font_name = font_name_list;
+ while (font_found == 0 &&
+ font_name[end_pos] != '\0')
+ {
+ tmp_data = '\0';
+ /* Scan for seperator */
+ while (font_name[end_pos] != '\0') {
+ if (font_name[end_pos] == ',' || font_name[end_pos] == ' ' ||
+ font_name[end_pos] == '\t')
+ {
+ tmp_data = font_name[end_pos];
+ font_name[end_pos] = '\0';
+ break;
+ }
+ end_pos++;
+ }
+
+ /* Search for exact font-name match */
+ for (i=0; i<__COUNTOF(s_device_fonts); i++) {
+ if (s_device_fonts[i].valid == 0)
+ continue;
+
+ /* For vector font only compare name */
+ if (s_device_fonts[i].font_params.font_type == eFontTypeVector ) {
+ if ( strlen(font_name) > 0 &&
+ strcmp(font_name,
+ s_device_fonts[i].font_params.name) == 0)
+ {
+ font_name[end_pos] = tmp_data; /* Restor delimeter */
+ return i;
+ }
+ } else {
+ /* For raster font compare all properties */
+ if (s_device_fonts[i].font_params.font_weight == font_weight &&
+ s_device_fonts[i].font_params.font_stretch == font_stretch &&
+ s_device_fonts[i].font_params.font_style == font_style )
+ {
+ if ( strlen(font_name) > 0 &&
+ strcmp(font_name,
+ s_device_fonts[i].font_params.name) == 0)
+ {
+ font_name[end_pos] = tmp_data; /* Restor delimeter */
+
+ if (s_device_fonts[i].font_params.font_height == font_height)
+ {
+ return i;
+ }
+ /* Update font_name_list to improve future searches */
+ strncpy(font_name_list, font_name, strlen(font_name)+1);
+ }
+ }
+ }
+ }
+ /* Continue searching for other font entries */
+ font_name[end_pos] = tmp_data;
+ font_name += (end_pos + 1);
+ end_pos = 0;
+ }
+ printf("WARNING: [%s] Font not found\r\n",font_name_list);
+
+ return VG_LITE_INVALID_FONT;
+}
+
+void vg_lite_text_init(void)
+{
+ static int font_table_ready = 0;
+
+ if (font_table_ready)
+ return;
+
+ /* Initialize font table */
+ memset(s_device_fonts, 0, MAX_SYSTEM_FONTS * sizeof(font_info_internal_t));
+ font_table_ready = 1;
+}
+
+/* Read-Write 8-bit unsigned int data */
+int read_8b(bufferred_reader_t * f, uint8_t* pdata)
+{
+ bufferred_fread(pdata, 1, 1, f);
+ TRACE_DBG(("%d) 8b: fp=%08x %d %d\r\n", DBG_INC_ID(),
+ bufferred_ftell(f) - 1, 1, *pdata));
+ return 1;
+}
+
+/* Read-Write 16-bit unsigned int data */
+int read_16b(bufferred_reader_t * f, uint16_t* pword)
+{
+ uint8_t buf[4];
+ uint16_t word;
+
+ bufferred_fread(buf, 2, 1, f);
+ word = 0; word += buf[1];
+ word <<= 8; word += buf[0];
+
+ TRACE_DBG(("%d) 16b: fp=%08x %d %d\r\n", DBG_INC_ID(),
+ bufferred_ftell(f)-2, 2, word));
+ *pword = word;
+ return 2;
+}
+
+/* Read-write 32-bit unsigned int data */
+int read_32b(bufferred_reader_t * f, uint32_t* pword)
+{
+ uint8_t buf[4];
+ uint32_t word;
+
+ bufferred_fread(buf, 4, 1, f);
+ word = 0; word += buf[3];
+ word <<= 8; word += buf[2];
+ word <<= 8; word += buf[1];
+ word <<= 8; word += buf[0];
+
+ *pword = word;
+ TRACE_DBG(("%d) 32b: fp=%08x %d %d\r\n", DBG_INC_ID(),
+ bufferred_ftell(f) - 4, 4,
+ word));
+ return 4;
+}
+
+int read_16b_blob(bufferred_reader_t * f, uint16_t** ary, uint32_t* ary_len)
+{
+ uint16_t blob_len = 0;
+
+ *ary_len = 0;
+ bufferred_fread(&blob_len, 1, sizeof(uint16_t), f);
+ *ary = (uint16_t *)RCD_ALLOC(blob_len * sizeof(uint16_t)); /* Malloc must be aligned on 2 byte boundary */
+ if (*ary == NULL) {
+ TRACE_ERR(("ERROR: malloc failed\n"));;
+ return VG_LITE_OUT_OF_MEMORY;
+ }
+ if ((((unsigned long)*ary) & 0x1) != 0) {
+ TRACE_ERR(("ERROR: malloc pointer not 2 byte aligned\n"));;
+ return VG_LITE_NOT_ALIGNED;
+ }
+ TRACE_DBG(("%d ) 16b_blob: fp=%08x %d\r\n", DBG_INC_ID(), bufferred_ftell(f)-2,
+ (int)blob_len));
+ bufferred_fread(*ary, 2, blob_len, f);
+ *ary_len = blob_len * 2;
+
+ return blob_len + 2; /* Actual bytes read from file */
+}
+
+int read_8b_blob(bufferred_reader_t * f, uint8_t** ary, uint32_t *ary_len)
+{
+ uint16_t blob_len = 0;
+ uint8_t* p_tmp = (uint8_t *)NULL;
+ bufferred_fread(&blob_len, 1, sizeof(uint16_t), f);
+ //TRACE_DBG(("%d) 8b_blob: %d\r\n", DBG_INC_ID(), blob_len));
+ p_tmp = (uint8_t *)RCD_ALLOC(blob_len+1);
+ if (p_tmp == NULL) {
+ TRACE_ERR(("ERROR: malloc failed\n"));;
+ return VG_LITE_OUT_OF_MEMORY;
+ }
+ TRACE_DBG(("%d ) 8b_blob: fp=%08x %d\r\n", DBG_INC_ID(), bufferred_ftell(f)-2,
+ (int)blob_len));
+ bufferred_fread(p_tmp, 1, blob_len, f);
+ p_tmp[blob_len] = 0;
+ *ary = p_tmp;
+
+ return blob_len + 2; /* Actual bytes read from file */
+}
+
+#define EXIT_IF_NEGATIVE(param) if ((ret = param) < 0) return ret;
+
+int read_rle_font_header(bufferred_reader_t * f, struct mf_font_s* font)
+{
+ int raw_header_offset = 0;
+ struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)font;
+ uint32_t size = 0;
+ int ret = 0;
+
+ TRACE_DBG(("** %s\r\n", __FUNCTION__));
+ DBG_SET_ID(0);
+
+ EXIT_IF_NEGATIVE(read_8b_blob(f, (uint8_t **)&font->full_name, &size));
+ raw_header_offset += ret; /* font.full_name */
+
+ EXIT_IF_NEGATIVE(read_8b_blob(f, (uint8_t **)&font->short_name, &size));
+ raw_header_offset += ret; /* font.short_name */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->width));
+ raw_header_offset += 1; /* font.width */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->height));
+ raw_header_offset += 1; /* font.height */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->min_x_advance));
+ raw_header_offset += 1; /* font.min_x_advance */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->max_x_advance));
+ raw_header_offset += 1; /* font.max_x_advance */
+
+ EXIT_IF_NEGATIVE(read_8b(f, (uint8_t *)&font->baseline_x));
+ raw_header_offset += 1; /* font.baseline_x */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->baseline_y));
+ raw_header_offset += 1; /* font.baseline_y */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->line_height));
+ raw_header_offset += 1; /* font.line_height */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &font->flags));
+ raw_header_offset += 1; /* font.flags */
+
+ EXIT_IF_NEGATIVE(read_16b(f, &font->fallback_character));
+ raw_header_offset += 2; /* font.fallback_character */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &(mfont->version)));
+ raw_header_offset += 1; /* mf_rlefont_s.version */
+
+ /* Other mf_rlefont_s variables */
+ uint16_t value = 0;
+ EXIT_IF_NEGATIVE(read_16b(f, &value)); //&mfont->dictionary_data_size));
+ mfont->dictionary_data_size = value;
+ raw_header_offset += 2; /* mf_rlefont_s.dictionary_data_size */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->dictionary_data_fp_offset));
+ raw_header_offset += 4; /* mf_rlefont_s.dictionary_data_fp_offset */
+
+ value = 0;
+ EXIT_IF_NEGATIVE(read_16b(f, &value)); //mfont->dictionary_offsets_size));
+ mfont->dictionary_offsets_size = value;
+ raw_header_offset += 2; /* mf_rlefont_s.dictionary_data_size */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->dictionary_offsets_fp_offset));
+ raw_header_offset += 4; /* mf_rlefont_s.dictionary_data_fp_offset */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &mfont->rle_entry_count));
+ raw_header_offset += 1; /* mf_rlefont_s.rle_entry_count */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &mfont->dict_entry_count));
+ raw_header_offset += 1; /* mf_rlefont_s.dict_entry_count */
+
+ EXIT_IF_NEGATIVE(read_8b(f, &mfont->char_range_count));
+ raw_header_offset += 1; /* mf_rlefont_s.char_range_count */
+
+ mfont->char_ranges = (struct mf_rlefont_char_range_s *)RCD_ALLOC(sizeof(struct mf_rlefont_char_range_s)* mfont->char_range_count);
+ memset(mfont->char_ranges, 0, sizeof(struct mf_rlefont_char_range_s) * mfont->char_range_count);
+
+ /* Skip size of ranges */
+ for (int r = 0; r < mfont->char_range_count; r++) {
+ EXIT_IF_NEGATIVE(read_16b(f, &mfont->char_ranges[r].first_char));
+ raw_header_offset += 2; /* mf_rlefont_s.char_ranges[r].first_char */
+
+ EXIT_IF_NEGATIVE(read_16b(f, &mfont->char_ranges[r].char_count));
+ raw_header_offset += 2; /* mf_rlefont_s.char_ranges[r].char_count */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_offsets_fp_offset));
+ raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_fp_offset */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_offsets_size));
+ raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_size */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_data_fp_offset));
+ raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_fp_offset */
+
+ EXIT_IF_NEGATIVE(read_32b(f, &mfont->char_ranges[r].glyph_data_size));
+ raw_header_offset += 4; /* mf_rlefont_s.char_ranges[r].glyph_offsets_size */
+ }
+ return raw_header_offset;
+}
+
+/* Writes a BMP file. The data is assumed to be 8-bit grayscale. */
+int read_rle_font_from_buffer(char *buff, int size, struct mf_font_s* font)
+{
+ struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)font;
+ bufferred_reader_t f_obj;
+ bufferred_reader_t * f = &f_obj;
+ int raw_header_offset = 0;
+ int fp_offset;
+ int ret;
+
+ DBG_SET_ID(0);
+
+ /* No need to dynamically allocate small descriptor */
+ if ( bufferred_fopen(f, buff, size) < 0 ) {
+ /* Font file open failed */
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ raw_header_offset = read_rle_font_header(f, font);
+ if (mfont->dictionary_data_fp_offset != raw_header_offset) {
+ TRACE_ERR(("ERROR: dictonary offset is different"));
+ }
+ TRACE_DBG(("** %s\r\n", __FUNCTION__));
+ DBG_SET_ID(0);
+
+ /* Skip header portion */
+ bufferred_fseek(f, raw_header_offset, SEEK_SET);
+ /* Write dictionary entries */
+ fp_offset = raw_header_offset;
+ TRACE_DBG(("dictionary_data_fp_offset=%08x %08x\r\n",
+ mfont->dictionary_data_fp_offset, bufferred_ftell(f)));
+ //mfont->dictionary_data_fp_offset = fp_offset;
+ EXIT_IF_NEGATIVE(read_8b_blob(f, &mfont->dictionary_data,
+ &mfont->dictionary_data_size));
+ fp_offset += mfont->dictionary_data_size + 2;
+
+ //mfont->dictionary_offsets_fp_offset = fp_offset;
+ TRACE_DBG(("dictionary_offsets_fp_offset=%08x %08x\r\n",
+ mfont->dictionary_offsets_fp_offset, bufferred_ftell(f)));
+ EXIT_IF_NEGATIVE(read_16b_blob(f, &mfont->dictionary_offsets,
+ &mfont->dictionary_offsets_size));
+ fp_offset += mfont->dictionary_offsets_size + 2;
+
+ /* Write range entries */
+ for (int r = 0; r < mfont->char_range_count; r++) {
+ //mfont->char_ranges[r].glyph_offsets_fp_offset = fp_offset;
+ TRACE_DBG(("mfont->char_ranges[%d].glyph_offsets=%08x %08x\r\n", r,
+ mfont->char_ranges[r].glyph_offsets_fp_offset, bufferred_ftell(f)));
+ EXIT_IF_NEGATIVE(read_16b_blob(f, &mfont->char_ranges[r].glyph_offsets,
+ &mfont->char_ranges[r].glyph_offsets_size));
+ fp_offset += mfont->char_ranges[r].glyph_offsets_size + 2;
+
+ //mfont->char_ranges[r].glyph_data_fp_offset = fp_offset;
+ TRACE_DBG(("mfont->char_ranges[%d].glyph_data_fp_offset=%08x %08x\r\n",
+ r,
+ mfont->char_ranges[r].glyph_data_fp_offset, bufferred_ftell(f)));
+ EXIT_IF_NEGATIVE(read_8b_blob(f, &mfont->char_ranges[r].glyph_data,\
+ &mfont->char_ranges[r].glyph_data_size));
+ fp_offset += mfont->char_ranges[r].glyph_data_size + 2;
+ }
+
+ bufferred_fclose(f);
+ return 0;
+}
+
+int load_raster_font(char *data, int data_len, struct mf_font_s** font)
+{
+ int ret;
+
+ /* Allocate font memory */
+ *font = (struct mf_font_s*)RCD_ALLOC(sizeof(struct mf_rlefont_s));
+ if (*font == NULL) {
+ return VG_LITE_OUT_OF_MEMORY;
+ }
+ memset(*font, 0, sizeof(struct mf_rlefont_s));
+
+ /* Load font from file */
+ ret = read_rle_font_from_buffer(data,
+ data_len, *font);
+ if (ret < 0) {
+ return ret;
+ }
+
+ /* Update generic char width pointers of mculib */
+ uint8_t mf_rlefont_character_width(const struct mf_font_s* font,
+ uint16_t character);
+ uint8_t mf_rlefont_render_character(const struct mf_font_s* font,
+ int16_t x0, int16_t y0,
+ uint16_t character,
+ mf_pixel_callback_t callback,
+ void* state);
+
+ (*font)->character_width = &mf_rlefont_character_width;
+ (*font)->render_character = &mf_rlefont_render_character;
+
+
+ return 0;
+}
+
+int free_rle_font_memory(struct mf_font_s** font)
+{
+ struct mf_rlefont_s* mfont = (struct mf_rlefont_s*)(*font);
+
+ RCD_FREE(mfont->font.full_name);
+ RCD_FREE(mfont->font.short_name);
+ RCD_FREE(mfont->dictionary_data);
+ RCD_FREE(mfont->dictionary_offsets);
+ for (int r = 0; r < mfont->char_range_count; r++) {
+ RCD_FREE(mfont->char_ranges[r].glyph_offsets);
+ RCD_FREE(mfont->char_ranges[r].glyph_data);
+ }
+ #ifdef DEBUG_RESET_DATASTRUCTURE_ON_FREE
+ memset(mfont->char_ranges);
+ #endif
+ RCD_FREE(mfont->char_ranges);
+
+ #ifdef DEBUG_RESET_DATASTRUCTURE_ON_FREE
+ memset(mfont);
+ #endif
+ RCD_FREE(mfont);
+
+ *font = NULL;
+ return 0;
+}
+
+void vg_lite_unload_font_data(void)
+{
+ for(int i=0; i
-#include
-#include "vg_lite_text.h"
-#include "vft_draw.h"
-#include "vft_debug.h"
-
-#ifdef ENABLE_DEBUG_TRACE
-
-/** Macros */
-
-/** Data structures */
-typedef enum path_type {
- PATH_DONE,
- PATH_CLOSE,
- MOVE_TO,
- MOVE_TO_REL,
- LINE_TO,
- LINE_TO_REL,
- QUAD_TO,
- QUAD_TO_REL,
- CUBI_TO,
- CUBI_TO_REL,
- NUM_PATH_CMD
-} path_type_t;
-
-/** Internal or external API prototypes */
-
-/** Globals */
-static const int data_count[] =
-{
- 0,
- 0,
- 2,
- 2,
- 2,
- 2,
- 4,
- 4,
- 6,
- 6
-};
-
-static char s_cmd_name[][16] =
-{
- {"PATH_DONE" },
- {"PATH_CLOSE" },
- {"MOVE_TO" },
- {"MOVE_TO_REL" },
- {"LINE_TO" },
- {"LINE_TO_REL" },
- {"QUAD_TO" },
- {"QUAD_TO_REL" },
- {"CUBI_TO" },
- {"CUBI_TO_REL" },
- {"NUM_PATH_CMD"},
-};
-
-
-/** Externs if any */
-
-/** Code section */
-void vfg_dbg_path_data(path_desc_t* path_data_desc, int offset)
-{
- float* draw_cmds;
-
- draw_cmds = &path_data_desc->draw_cmds[0];
-
- for (int i = 0; i < path_data_desc->num_draw_cmds; i++) {
- uint32_t cmd, j;
-
- cmd = *((uint32_t*)(&draw_cmds[i]));
- if (cmd < NUM_PATH_CMD) {
- TRACE_BIN(("BIN: %08x: %s(%d) [",
- offset + i * 4,
- s_cmd_name[cmd], cmd));
- for (j = 0; j < data_count[cmd]; j++) {
- TRACE_BIN((" %.2f", draw_cmds[i + j + 1]));
- }
- i += j;
- TRACE_BIN(("]\n"));
- }
- }
-}
-
-void vft_dbg_path(char *prefix, void *draw_cmds_args, int num_draw_cmds)
-{
- float* draw_cmds;
-
- draw_cmds = draw_cmds_args;
- int offset = 0;
- for (int i = 0; i < num_draw_cmds; i++) {
- uint32_t cmd, j;
-
- cmd = *((uint32_t*)(&draw_cmds[i]));
- if (cmd < NUM_PATH_CMD) {
- printf("BIN: %08x: %s(%d) [",
- offset + i * 4,
- s_cmd_name[cmd], cmd);
- for (j = 0; j < data_count[cmd]; j++) {
- printf(" %.2f", draw_cmds[i + j + 1]);
- }
- i += j;
- printf("]\n");
- }
- }
-}
-
-void vft_dbg_path_bounds(char *name, float *ary, int num_elements)
-{
- float* array_data;
-
- array_data = ary;
- printf("%s [",name);
- for (int i = 0; i < num_elements; i++) {
- printf(" %.2f", array_data[i]);
- }
- printf("]\n");
-}
-
-void vft_dbg_kern_desc(kern_desc_t* kern_desc, int num_kern_entries, int offset)
-{
- for (int i = 0; i < num_kern_entries; i++) {
- TRACE_BIN(("BIN: %08x: [%d] (u,k)=(%hu, %hu)\n",
- (int)(offset + i * sizeof(kern_desc_t)),
- i,
- kern_desc[i].unicode,
- kern_desc[i].kern));
- }
-}
-void vft_dbg_glyph_desc(glyph_desc_t* g, int offset)
-{
- glyph_desc_t _desc = *g; /* Temporary copy descriptor*/
-
- TRACE_BIN_FIELD_UINT16(unicode);
- TRACE_BIN_FIELD_UINT16(horiz_adv_x);
- TRACE_BIN_FIELD_UINT32(kern_num_entries);
- TRACE_BIN_FIELD_UINT32(kern_table_offset);
- TRACE_BIN_FIELD_FLOAT(path.bounds[0]);
- TRACE_BIN_FIELD_FLOAT(path.bounds[1]);
- TRACE_BIN_FIELD_FLOAT(path.bounds[2]);
- TRACE_BIN_FIELD_FLOAT(path.bounds[3]);
- TRACE_BIN_FIELD_UINT32(path.num_draw_cmds);
- TRACE_BIN_FIELD_UINT32(path.draw_cmds_offset);
-
-}
-
-/* TRACE values for debugging purpose */
-void vft_dbg_font_face_desc(font_face_desc_t* font_face, int offset)
-{
- font_face_desc_t _desc = *font_face; /* Temporary copy descriptor*/
-
- TRACE_INFO(("font-face-block\n"));
-
- TRACE_BIN_FIELD_STR(font_family_name); offset += sizeof(_desc.font_family_name);
- TRACE_BIN_FIELD_UINT16(units_per_em);
- TRACE_BIN_FIELD_UINT16(ascent);
- TRACE_BIN_FIELD_UINT16(descent);
- TRACE_BIN_FIELD_UINT16(vg_font);
- TRACE_BIN_FIELD_UINT32(num_glyphs);
-}
-
-void vft_dbg_matrix(char *name, vg_lite_matrix_t *mat)
-{
- printf("%s\n",name);
- printf(" %0.3f %0.3f %0.3f\n",
- mat->m[0][0],mat->m[0][1],mat->m[0][2]);
- printf(" %0.3f %0.3f %0.3f\n",
- mat->m[1][0],mat->m[1][1],mat->m[1][2]);
- printf(" %0.3f %0.3f %0.3f\n",
- mat->m[2][0],mat->m[1][1],mat->m[2][2]);
-}
-
-void vft_dbg_path_table(font_face_desc_t* font_face, int offset)
-{
- TRACE_INFO(("path-block\n"));
- for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
- glyph_desc_t* g = &font_face->glyphs[i];
- TRACE_BIN(("Glyph - path: '%c' unicode = %d\n", g->unicode, g->unicode));
- offset = g->path.draw_cmds_offset;
- vfg_dbg_path_data(&g->path, offset);
- }
-}
-
-void vft_dbg_kern_table(font_face_desc_t* font_face, int offset)
-{
- TRACE_INFO(("kern-block\n"));
- for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
- glyph_desc_t* g = &font_face->glyphs[i];
-
- TRACE_INFO(("Kern: '%c' unicode=%hu\n", g->unicode, g->unicode));
-
- vft_dbg_kern_desc(&g->kern_table[0],
- g->kern_num_entries,
- offset);
- offset += (g->kern_num_entries * sizeof(kern_desc_t));
- }
-}
-
-void vft_dbg_glyph_table(font_face_desc_t* font_face, int offset)
-{
- TRACE_INFO(("glyph-block\n"));
- for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
- glyph_desc_t* g = &font_face->glyphs[i];
- TRACE_INFO(("Glyph: '%c'\n", g->unicode));
- vft_dbg_glyph_desc(g, offset);
- offset += sizeof(glyph_desc_t);
- }
-}
-
-int g_offset = 0;
-
-void dbg_float_ary(char *name, float *ary, int count, int *disk_offset)
-{
- int i;
- int offset = *disk_offset;
- for (i=0; i
+#include
+#include "vg_lite_text.h"
+#include "vft_draw.h"
+#include "vft_debug.h"
+
+#ifdef ENABLE_DEBUG_TRACE
+
+/** Macros */
+
+/** Data structures */
+typedef enum path_type {
+ PATH_DONE,
+ PATH_CLOSE,
+ MOVE_TO,
+ MOVE_TO_REL,
+ LINE_TO,
+ LINE_TO_REL,
+ QUAD_TO,
+ QUAD_TO_REL,
+ CUBI_TO,
+ CUBI_TO_REL,
+ NUM_PATH_CMD
+} path_type_t;
+
+/** Internal or external API prototypes */
+
+/** Globals */
+static const int data_count[] =
+{
+ 0,
+ 0,
+ 2,
+ 2,
+ 2,
+ 2,
+ 4,
+ 4,
+ 6,
+ 6
+};
+
+static char s_cmd_name[][16] =
+{
+ {"PATH_DONE" },
+ {"PATH_CLOSE" },
+ {"MOVE_TO" },
+ {"MOVE_TO_REL" },
+ {"LINE_TO" },
+ {"LINE_TO_REL" },
+ {"QUAD_TO" },
+ {"QUAD_TO_REL" },
+ {"CUBI_TO" },
+ {"CUBI_TO_REL" },
+ {"NUM_PATH_CMD"},
+};
+
+
+/** Externs if any */
+
+/** Code section */
+void vfg_dbg_path_data(path_desc_t* path_data_desc, int offset)
+{
+ float* draw_cmds;
+
+ draw_cmds = &path_data_desc->draw_cmds[0];
+
+ for (int i = 0; i < path_data_desc->num_draw_cmds; i++) {
+ uint32_t cmd, j;
+
+ cmd = *((uint32_t*)(&draw_cmds[i]));
+ if (cmd < NUM_PATH_CMD) {
+ TRACE_BIN(("BIN: %08x: %s(%d) [",
+ offset + i * 4,
+ s_cmd_name[cmd], cmd));
+ for (j = 0; j < data_count[cmd]; j++) {
+ TRACE_BIN((" %.2f", draw_cmds[i + j + 1]));
+ }
+ i += j;
+ TRACE_BIN(("]\n"));
+ }
+ }
+}
+
+void vft_dbg_path(char *prefix, void *draw_cmds_args, int num_draw_cmds)
+{
+ float* draw_cmds;
+
+ draw_cmds = draw_cmds_args;
+ int offset = 0;
+ for (int i = 0; i < num_draw_cmds; i++) {
+ uint32_t cmd, j;
+
+ cmd = *((uint32_t*)(&draw_cmds[i]));
+ if (cmd < NUM_PATH_CMD) {
+ printf("BIN: %08x: %s(%d) [",
+ offset + i * 4,
+ s_cmd_name[cmd], cmd);
+ for (j = 0; j < data_count[cmd]; j++) {
+ printf(" %.2f", draw_cmds[i + j + 1]);
+ }
+ i += j;
+ printf("]\n");
+ }
+ }
+}
+
+void vft_dbg_path_bounds(char *name, float *ary, int num_elements)
+{
+ float* array_data;
+
+ array_data = ary;
+ printf("%s [",name);
+ for (int i = 0; i < num_elements; i++) {
+ printf(" %.2f", array_data[i]);
+ }
+ printf("]\n");
+}
+
+void vft_dbg_kern_desc(kern_desc_t* kern_desc, int num_kern_entries, int offset)
+{
+ for (int i = 0; i < num_kern_entries; i++) {
+ TRACE_BIN(("BIN: %08x: [%d] (u,k)=(%hu, %hu)\n",
+ (int)(offset + i * sizeof(kern_desc_t)),
+ i,
+ kern_desc[i].unicode,
+ kern_desc[i].kern));
+ }
+}
+void vft_dbg_glyph_desc(glyph_desc_t* g, int offset)
+{
+ glyph_desc_t _desc = *g; /* Temporary copy descriptor*/
+
+ TRACE_BIN_FIELD_UINT16(unicode);
+ TRACE_BIN_FIELD_UINT16(horiz_adv_x);
+ TRACE_BIN_FIELD_UINT32(kern_num_entries);
+ TRACE_BIN_FIELD_UINT32(kern_table_offset);
+ TRACE_BIN_FIELD_FLOAT(path.bounds[0]);
+ TRACE_BIN_FIELD_FLOAT(path.bounds[1]);
+ TRACE_BIN_FIELD_FLOAT(path.bounds[2]);
+ TRACE_BIN_FIELD_FLOAT(path.bounds[3]);
+ TRACE_BIN_FIELD_UINT32(path.num_draw_cmds);
+ TRACE_BIN_FIELD_UINT32(path.draw_cmds_offset);
+
+}
+
+/* TRACE values for debugging purpose */
+void vft_dbg_font_face_desc(font_face_desc_t* font_face, int offset)
+{
+ font_face_desc_t _desc = *font_face; /* Temporary copy descriptor*/
+
+ TRACE_INFO(("font-face-block\n"));
+
+ TRACE_BIN_FIELD_STR(font_family_name); offset += sizeof(_desc.font_family_name);
+ TRACE_BIN_FIELD_UINT16(units_per_em);
+ TRACE_BIN_FIELD_UINT16(ascent);
+ TRACE_BIN_FIELD_UINT16(descent);
+ TRACE_BIN_FIELD_UINT16(vg_font);
+ TRACE_BIN_FIELD_UINT32(num_glyphs);
+}
+
+void vft_dbg_matrix(char *name, vg_lite_matrix_t *mat)
+{
+ printf("%s\n",name);
+ printf(" %0.3f %0.3f %0.3f\n",
+ mat->m[0][0],mat->m[0][1],mat->m[0][2]);
+ printf(" %0.3f %0.3f %0.3f\n",
+ mat->m[1][0],mat->m[1][1],mat->m[1][2]);
+ printf(" %0.3f %0.3f %0.3f\n",
+ mat->m[2][0],mat->m[1][1],mat->m[2][2]);
+}
+
+void vft_dbg_path_table(font_face_desc_t* font_face, int offset)
+{
+ TRACE_INFO(("path-block\n"));
+ for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
+ glyph_desc_t* g = &font_face->glyphs[i];
+ TRACE_BIN(("Glyph - path: '%c' unicode = %d\n", g->unicode, g->unicode));
+ offset = g->path.draw_cmds_offset;
+ vfg_dbg_path_data(&g->path, offset);
+ }
+}
+
+void vft_dbg_kern_table(font_face_desc_t* font_face, int offset)
+{
+ TRACE_INFO(("kern-block\n"));
+ for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
+ glyph_desc_t* g = &font_face->glyphs[i];
+
+ TRACE_INFO(("Kern: '%c' unicode=%hu\n", g->unicode, g->unicode));
+
+ vft_dbg_kern_desc(&g->kern_table[0],
+ g->kern_num_entries,
+ offset);
+ offset += (g->kern_num_entries * sizeof(kern_desc_t));
+ }
+}
+
+void vft_dbg_glyph_table(font_face_desc_t* font_face, int offset)
+{
+ TRACE_INFO(("glyph-block\n"));
+ for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
+ glyph_desc_t* g = &font_face->glyphs[i];
+ TRACE_INFO(("Glyph: '%c'\n", g->unicode));
+ vft_dbg_glyph_desc(g, offset);
+ offset += sizeof(glyph_desc_t);
+ }
+}
+
+int g_offset = 0;
+
+void dbg_float_ary(char *name, float *ary, int count, int *disk_offset)
+{
+ int i;
+ int offset = *disk_offset;
+ for (i=0; iparam[0], count, &g_offset);
-
-#define DBG_INT_ARY(obj, param, count) \
- dbg_int_ary(#param, obj->param, count, &g_offset);
-
-#define DBG_FIELD(obj, param) \
- dbg_int_param(#param, obj->param, &g_offset)
-
-#define DBG_READ_32B(name, value, offset) \
- dbg_int_param_no_offset_update(name, value, offset)
-extern int g_offset;
-
-#define VFT_DBG_FONT_FACE_DESC(a,b) vft_dbg_font_face_desc(a,b)
-#define VFT_DBG_GLYPH_TABLE(a,b) vft_dbg_glyph_table(a,b)
-#define VFT_DBG_KERN_TABLE(a,b) vft_dbg_kern_table(a,b)
-#define VFT_DBG_PATH_TABLE(a,b) vft_dbg_path_table(a,b)
-
-static int g_offset = 0; /* Dummy just to solve build errors */
-#define DBG_TRACE(x)
-#define DBG_INC_OFFSET(x) g_offset += (x);
-#define DBG_OFFSET() (g_offset)
-
-/* Prorotypes */
-void vft_dbg_font_face_desc(font_face_desc_t* font_face, int offset);
-void vft_dbg_glyph_desc(glyph_desc_t* g, int offset);
-void vft_dbg_kern_desc(kern_desc_t* kern_desc, int num_kern_entries, int offset);
-void vfg_dbg_path_data(path_desc_t* path_data_desc, int offset);
-void vft_dbg_matrix(char *name, vg_lite_matrix_t *mat);
-void vft_dbg_path_table(font_face_desc_t* font_face, int offset);
-void vft_dbg_kern_table(font_face_desc_t* font_face, int offset);
-void vft_dbg_glyph_table(font_face_desc_t* font_face, int offset);
-
-void dbg_float_ary_no_offset_update(char *name, float *ary,
- int count, int disk_offset);
-void dbg_int_ary_no_offset_update(char *name, uint32_t *ary,
- int count, int disk_offset);
-void dbg_int_param_no_offset_update(char *name, uint32_t value, int disk_offset);
-
-#else
-/** Without -debug configuration */
-/* Macros */
-#define TRACE_DBG(x)
-#define TRACE_BIN(x)
-#define TRACE_WRN(x) printf x
-#define TRACE_INFO(x)
-#define TRACE_ERR(x) printf x
-
-#define DBG_READ_32B(a,b,c)
-#define DBG_TRACE(x)
-#define vft_dbg_glyph_desc(g,offset)
-#define dbg_float_ary_no_offset_update(a, b, c,d)
-#define dbg_int_ary_no_offset_update(a, b, c,d)
-#define vft_dbg_path_bounds(a,b,c)
-#define vft_dbg_path(a,b,c)
-
-#define VFT_DBG_FONT_FACE_DESC(a,b)
-#define VFT_DBG_GLYPH_TABLE(a,b)
-#define VFT_DBG_KERN_TABLE(a,b)
-#define VFT_DBG_PATH_TABLE(a,b)
-
-#define DBG_INC_OFFSET(x)
-#define DBG_OFFSET() (0)
-
-#endif
-
-#define TRACE_BIN_FIELD_STR(x) TRACE_BIN(("BIN: %08x: "#x"=%s\n",offset,_desc.x));
-#define TRACE_BIN_FIELD_UINT16(x) TRACE_BIN(("BIN: %08x: "#x"=%hu\n",offset,_desc.x)); offset += 2;
-#define TRACE_BIN_FIELD_UINT32(x) TRACE_BIN(("BIN: %08x: "#x"=%u\n",offset,_desc.x)); offset += 4;
-#define TRACE_BIN_FIELD_FLOAT(x) TRACE_BIN(("BIN: %08x: "#x"=%f\n",offset,_desc.x)); offset += 4;
-
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+//#define ENABLE_DEBUG_TRACE
+
+#ifdef ENABLE_DEBUG_TRACE
+/* With debug configuration */
+
+/* Macros */
+#define TRACE_DBG(x) printf x
+#define TRACE_BIN(x) // printf x /* Tracer for binary layout */
+#define TRACE_WRN(x) printf x
+#define TRACE_INFO(x) printf x
+#define TRACE_ERR(x) printf x
+#define DBG_ARY(obj, param, count) \
+ dbg_float_ary(#param, &obj->param[0], count, &g_offset);
+
+#define DBG_INT_ARY(obj, param, count) \
+ dbg_int_ary(#param, obj->param, count, &g_offset);
+
+#define DBG_FIELD(obj, param) \
+ dbg_int_param(#param, obj->param, &g_offset)
+
+#define DBG_READ_32B(name, value, offset) \
+ dbg_int_param_no_offset_update(name, value, offset)
+extern int g_offset;
+
+#define VFT_DBG_FONT_FACE_DESC(a,b) vft_dbg_font_face_desc(a,b)
+#define VFT_DBG_GLYPH_TABLE(a,b) vft_dbg_glyph_table(a,b)
+#define VFT_DBG_KERN_TABLE(a,b) vft_dbg_kern_table(a,b)
+#define VFT_DBG_PATH_TABLE(a,b) vft_dbg_path_table(a,b)
+
+static int g_offset = 0; /* Dummy just to solve build errors */
+#define DBG_TRACE(x)
+#define DBG_INC_OFFSET(x) g_offset += (x);
+#define DBG_OFFSET() (g_offset)
+
+/* Prorotypes */
+void vft_dbg_font_face_desc(font_face_desc_t* font_face, int offset);
+void vft_dbg_glyph_desc(glyph_desc_t* g, int offset);
+void vft_dbg_kern_desc(kern_desc_t* kern_desc, int num_kern_entries, int offset);
+void vfg_dbg_path_data(path_desc_t* path_data_desc, int offset);
+void vft_dbg_matrix(char *name, vg_lite_matrix_t *mat);
+void vft_dbg_path_table(font_face_desc_t* font_face, int offset);
+void vft_dbg_kern_table(font_face_desc_t* font_face, int offset);
+void vft_dbg_glyph_table(font_face_desc_t* font_face, int offset);
+
+void dbg_float_ary_no_offset_update(char *name, float *ary,
+ int count, int disk_offset);
+void dbg_int_ary_no_offset_update(char *name, uint32_t *ary,
+ int count, int disk_offset);
+void dbg_int_param_no_offset_update(char *name, uint32_t value, int disk_offset);
+
+#else
+/** Without -debug configuration */
+/* Macros */
+#define TRACE_DBG(x)
+#define TRACE_BIN(x)
+#define TRACE_WRN(x) printf x
+#define TRACE_INFO(x)
+#define TRACE_ERR(x) printf x
+
+#define DBG_READ_32B(a,b,c)
+#define DBG_TRACE(x)
+#define vft_dbg_glyph_desc(g,offset)
+#define dbg_float_ary_no_offset_update(a, b, c,d)
+#define dbg_int_ary_no_offset_update(a, b, c,d)
+#define vft_dbg_path_bounds(a,b,c)
+#define vft_dbg_path(a,b,c)
+
+#define VFT_DBG_FONT_FACE_DESC(a,b)
+#define VFT_DBG_GLYPH_TABLE(a,b)
+#define VFT_DBG_KERN_TABLE(a,b)
+#define VFT_DBG_PATH_TABLE(a,b)
+
+#define DBG_INC_OFFSET(x)
+#define DBG_OFFSET() (0)
+
+#endif
+
+#define TRACE_BIN_FIELD_STR(x) TRACE_BIN(("BIN: %08x: "#x"=%s\n",offset,_desc.x));
+#define TRACE_BIN_FIELD_UINT16(x) TRACE_BIN(("BIN: %08x: "#x"=%hu\n",offset,_desc.x)); offset += 2;
+#define TRACE_BIN_FIELD_UINT32(x) TRACE_BIN(("BIN: %08x: "#x"=%u\n",offset,_desc.x)); offset += 4;
+#define TRACE_BIN_FIELD_FLOAT(x) TRACE_BIN(("BIN: %08x: "#x"=%f\n",offset,_desc.x)); offset += 4;
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.c b/bsp/sdk_overlay/middleware/vglite/font/vft_draw.c
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.c
rename to bsp/sdk_overlay/middleware/vglite/font/vft_draw.c
index 3937e44..433c1a1 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/vft_draw.c
@@ -1,462 +1,462 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-/** Include Files */
-#include
-#include
-#include
-#include "vg_lite.h"
-#include "vg_lite_text.h"
-#include "vft_draw.h"
-#include "vft_debug.h"
-#include "FreeRTOS.h"
-
-/** Macros */
-#define VFT_ALLOC(x) _mem_allocate(x)
-#define VFT_FREE(x) _mem_free(x)
-#define READ_BIN_FIELD(x) memcpy(&g->x, (buf + offset), sizeof(g->x)); offset += sizeof(g->x)
-#define READ_BIN_FIELD_STR(x) READ_BIN_FIELD(x)
-#define READ_BIN_FIELD_UINT16(x) READ_BIN_FIELD(x)
-#define READ_BIN_FIELD_UINT32(x) READ_BIN_FIELD(x)
-#define READ_BIN_FIELD_FLOAT(x) READ_BIN_FIELD(x)
-#define READ_BIN_FIELD_DUMMY_POINTER(x) offset += 4;
-#define GLYPH_CACHE_SIZE 16
-#define ENABLE_TEXT_WRAP 0
-#define HALT_ALLOCATOR_ERROR 1
-
-/** Data structures */
-typedef struct glyph_cache_desc {
- vg_lite_path_t *h_path;
- glyph_desc_t *g;
- uint32_t use_count;
-}glyph_cache_desc_t;
-
-/** Internal or external API prototypes */
-
-/** Globals */
-static int g_glyph_cache_init_done = 0;
-static glyph_cache_desc_t g_glyph_cache[GLYPH_CACHE_SIZE];
-int g_total_bytes = 0;
-
-/** Externs if any */
-
-/* Internal API, not published to user */
-font_face_desc_t *_vg_lite_get_vector_font(vg_lite_font_t font_idx);
-void matrix_multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t *mult);
-
-void *_mem_allocate(int size)
-{
- char *buf = NULL;
-
- if ( size == 0 ) {
- printf("ERROR: HALT: Why allocating %d bytes\n", size);
-#if HALT_ALLOCATOR_ERROR
- while(1);
-#else
- return NULL;
-#endif
- }
-
- buf = pvPortMalloc(size);
- if (buf == NULL) {
- printf("ERROR: HALT: allocating %d bytes \"system out of memory\"\n", size);
-#if HALT_ALLOCATOR_ERROR
- while(1);
-#else
- return NULL;
-#endif
- }
- g_total_bytes += size;
- return buf;
-}
-
-void _mem_free(void *buf)
-{
- vPortFree(buf);
-}
-
-/** GLYPH CACHING Code */
-void glyph_cache_init(void)
-{
- if ( g_glyph_cache_init_done == 0 ) {
- memset(g_glyph_cache,0,sizeof(g_glyph_cache));
- g_glyph_cache_init_done = 1;
- }
-}
-
-void glyph_cache_free(void)
-{
- int i;
- for (i=0; iunicode ==
- g_glyph_cache[i].g->unicode )
- {
- g_glyph_cache[i].use_count++;
- return g_glyph_cache[i].h_path;
- }
- }
-
- /* Find least used descriptor */
- unused_idx = 0;
- for (i=1; ipath.num_draw_cmds*4,
- g->path.draw_cmds,
- g->path.bounds[0],
- g->path.bounds[1],
- g->path.bounds[2],
- g->path.bounds[3]);
- g_glyph_cache[unused_idx].g = g;
- g_glyph_cache[unused_idx].use_count = 1;
- return g_glyph_cache[unused_idx].h_path;
-}
-
-/** Render text using vector fonts */
-int vg_lite_vtf_draw_text(vg_lite_buffer_t *rt, int x, int y,
- vg_lite_blend_t blend,
- vg_lite_font_t font,
- vg_lite_matrix_t *matrix,
- vg_lite_font_attributes_t * attributes,
- char *text)
-{
- font_face_desc_t *font_face;
- glyph_desc_t* g1 = NULL;
- glyph_desc_t* g2;
- int error = 0;
- float font_scale = 1.0;
- int text_wrap = 0;
-
- font_face = (font_face_desc_t *)_vg_lite_get_vector_font(font);
-
- attributes->last_dx = 0;
- font_scale = ((1.0*attributes->font_height)/font_face->units_per_em);
-
- vg_lite_matrix_t mat;
-
- vg_lite_fill_t fill_rule = VG_LITE_FILL_NON_ZERO;
- vg_lite_color_t color = attributes->text_color;
-
- /* Compute size of tex in pixels
- * For center alignment adjust x position
- * Present parser has bug in encoding alignment value,
- * Once it is fixed following code will align text in center
- */
- if ( attributes->alignment == eTextAlignCenter ||
- attributes->alignment == eTextAlignRight ) {
- char *t2 = text;
- int dx = 0;
- uint16_t ug2; /* Unicode glyph */
- int kx;
-
- /* Case of center alignement */
- while (*t2 != '\0') {
- ug2 = *t2;
- kx = 0;
- g2 = vft_find_glyph(font_face, ug2);
- if (g1 != NULL && g2 != NULL) {
- kx = vft_glyph_distance(g1, g2);
- }
-
- dx += ((g2->horiz_adv_x + kx )* font_scale);
- t2++;
- }
-
- if ( attributes->alignment == eTextAlignCenter) {
- x -= (dx/2);
- } else if ( attributes->alignment == eTextAlignRight) {
- x -= (dx);
- }
- }
-
- /* Compute pixels that will cover this vector path */
- while (*text != '\0') {
- uint16_t ug2; /* Unicode glyph */
- int kx;
-
- if (text_wrap == 0) {
- vg_lite_identity(&mat);
- matrix_multiply(&mat, matrix);
- vg_lite_translate(x,y, &mat);
- vg_lite_scale(font_scale,font_scale, &mat); // 0.35 = height/units_per_em
- vg_lite_scale(-1.0,1.0, &mat);
- vg_lite_scale(-1.0,-1.0, &mat);
- text_wrap = 1;
- }
-
- /* Read unicode character */
- kx = 0;
- ug2 = *text;
- g2 = vft_find_glyph(font_face, ug2);
- if (g1 != NULL && g2 != NULL) {
- kx = vft_glyph_distance(g1, g2);
- }
-
-#if (ENABLE_TEXT_WRAP==1)
- /* Wrap text */
- if ( (x + attributes->last_dx + ((g2->horiz_adv_x + kx )* font_scale))
- >= (720 - 5) )
- {
- text_wrap = 0;
- attributes->last_dx = 0;
- y += (attributes->font_height + 1);
- continue;
- }
-#endif /* ENABLE_TEXT_WRAP */
-
- /* Compute glyph size in horizontal dimension */
- g1 = g2;
- text++;
-
- error = vg_lite_draw(rt, vft_cache_lookup(g2),
- fill_rule,
- &mat,
- blend,
- color);
- if ( error != VG_LITE_SUCCESS ) {
- break;
- }
-
- vg_lite_translate(g2->horiz_adv_x + kx, 0, &mat);
- attributes->last_dx += ((g2->horiz_adv_x + kx )* font_scale);
- }
-
- attributes->last_dx += 2; /* Space between 2 text strings */
-
- return 0;
-}
-
-void load_font_face(font_face_desc_t* font_face, uint8_t* buf, int font_face_offset)
-{
- font_face_desc_t* g = font_face;
- int offset = font_face_offset;
-
- READ_BIN_FIELD_STR(font_family_name);
- READ_BIN_FIELD_UINT16(units_per_em);
- READ_BIN_FIELD_UINT16(ascent);
- READ_BIN_FIELD_UINT16(descent);
- READ_BIN_FIELD_UINT16(vg_font);
- READ_BIN_FIELD_UINT32(num_glyphs);
-}
-
-void load_glyph_table(font_face_desc_t* font_face, uint8_t* buf, int glyph_table_offset)
-{
- int offset = glyph_table_offset;
-
- for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
- glyph_desc_t* g = &font_face->glyphs[i];
-
- memset(g, 0, sizeof(glyph_desc_t));
- READ_BIN_FIELD_UINT16(unicode);
- READ_BIN_FIELD_UINT16(horiz_adv_x);
- READ_BIN_FIELD_UINT32(kern_num_entries);
- READ_BIN_FIELD_UINT32(kern_table_offset);
- READ_BIN_FIELD_DUMMY_POINTER();
- READ_BIN_FIELD_FLOAT(path.bounds[0]);
- READ_BIN_FIELD_FLOAT(path.bounds[1]);
- READ_BIN_FIELD_FLOAT(path.bounds[2]);
- READ_BIN_FIELD_FLOAT(path.bounds[3]);
- READ_BIN_FIELD_UINT32(path.num_draw_cmds);
- READ_BIN_FIELD_UINT32(path.draw_cmds_offset);
- READ_BIN_FIELD_DUMMY_POINTER();
-
- font_face->glyphs[i].kern_table = (kern_desc_t *)(buf + font_face->glyphs[i].kern_table_offset);
- font_face->glyphs[i].path.draw_cmds = (float *)(buf + font_face->glyphs[i].path.draw_cmds_offset);
-
- TRACE_INFO(("Glyph: '%c'\n", g->unicode));
- vft_dbg_glyph_desc(g, d_offset);
- }
-}
-
-/* Load vector font ROM table from file */
-font_face_desc_t* vft_load_from_buffer(char* buf_base, int file_size)
-{
- font_face_desc_t* font_face = NULL;
- uint32_t* blk_hdr;
- //int error = 0;
-
- /* Setup internal memory pointers of font_face_desc_t */
- int font_face_offset = 0;
- int glyph_table_offset = 0;
- //int kern_table_offset = 0;
- //int path_data_offset = 0;
- int offset = 0;
-
- /* May be we can avoid this lookup */
- while (offset < file_size) {
- blk_hdr = (uint32_t*)(buf_base + offset);
- eFontBlock_t eType = (eFontBlock_t)((*blk_hdr) >> 24);
- int size = ((*blk_hdr) & ((1<<24)-1));
- TRACE_BIN(("BIN: %08x: block(%hu, %hu)\n",
- offset, eType, size));
- offset += BLK_HDR_SIZE;
-
- /* Check integrity of block and then only proceed */
- switch (eType) {
- case eFontFaceDesc:
- font_face_offset = offset;
- break;
- case eGlyphTableDesc:
- glyph_table_offset = offset;
- break;
- case eKernTableDesc:
- //kern_table_offset = offset;
- break;
- case eGlyphData:
- //path_data_offset = offset;
- break;
- default:
- case eUnkBlock:
- case eMaxBlock:
- return NULL;;
- }
- offset += size;
- }
-
- if (offset < 0 || offset > file_size) {
- printf("ERROR: Vector font file integrity error aborting..\n");
- return NULL;
- }
-
- /* Make structure binary compliant to reduce loading time */
- font_face = (font_face_desc_t*)(buf_base + font_face_offset);
- font_face->glyphs = (glyph_desc_t*)(buf_base + glyph_table_offset);
-
- VFT_DBG_FONT_FACE_DESC(font_face, font_face_offset);
- for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
- /* Update internal pointer from memory mapped file */
- font_face->glyphs[i].kern_table =
- (kern_desc_t*)(buf_base + font_face->glyphs[i].kern_table_offset);
- font_face->glyphs[i].path.draw_cmds =
- (float*)(buf_base +
- font_face->glyphs[i].path.draw_cmds_offset);
- /* Try to get these paramters from Binary object or attributes */
- //vg_lite_format_t data_format = VG_LITE_FP32; //VG_LITE_S16;
- //vg_lite_quality_t quality = VG_LITE_HIGH;
- }
- VFT_DBG_GLYPH_TABLE(font_face, glyph_table_offset);
-
- VFT_DBG_KERN_TABLE(font_face, kern_table_offset);
- VFT_DBG_PATH_TABLE(font_face, path_data_offset);
-
- return font_face;
-}
-
-/* Find glyph of given character from glyph table */
-glyph_desc_t* vft_find_glyph(font_face_desc_t* font_face, uint16_t ug2)
-{
- const int num_glyphs = font_face->num_glyphs;
- glyph_desc_t* glyphs = font_face->glyphs;
-
- /*
- * Present approach is slow linear search, this is ok in 1st prototype
- * Since glyph table is already sorted, we can have binary search
- */
- for (int i = 0; i < num_glyphs; i++) {
- if (glyphs[i].unicode == ug2) {
- return (glyph_desc_t*)&glyphs[i];
- }
- }
- return (glyph_desc_t*)&glyphs[0];;
-}
-
-/* Find distance between 2 glyph symbols */
-int vft_glyph_distance(glyph_desc_t* g1, glyph_desc_t* g2)
-{
- signed short kx = 0;
- uint16_t ug2 = g2->unicode;
- kern_desc_t* kern_table = &g1->kern_table[0];
-
- for (int i = 0; i < g1->kern_num_entries; i++) {
- if (kern_table[i].unicode == ug2) {
- signed short *pkx = (signed short *)&kern_table[i].kern;
- kx = *pkx;
- break;
- }
- }
-
- return kx;
-}
-
-/*
-* Get internal vector path of given glyph
-* This is internal function
-*/
-path_desc_t* vft_get_glyph_path(glyph_desc_t* g2)
-{
- return &g2->path;
-}
-
-/* Unload font face descriptor and all glyphs */
-void vft_unload(font_face_desc_t* font_face)
-{
- glyph_cache_free();
- //VFT_FREE(font_face);
-}
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+/** Include Files */
+#include
+#include
+#include
+#include "vg_lite.h"
+#include "vg_lite_text.h"
+#include "vft_draw.h"
+#include "vft_debug.h"
+#include "FreeRTOS.h"
+
+/** Macros */
+#define VFT_ALLOC(x) _mem_allocate(x)
+#define VFT_FREE(x) _mem_free(x)
+#define READ_BIN_FIELD(x) memcpy(&g->x, (buf + offset), sizeof(g->x)); offset += sizeof(g->x)
+#define READ_BIN_FIELD_STR(x) READ_BIN_FIELD(x)
+#define READ_BIN_FIELD_UINT16(x) READ_BIN_FIELD(x)
+#define READ_BIN_FIELD_UINT32(x) READ_BIN_FIELD(x)
+#define READ_BIN_FIELD_FLOAT(x) READ_BIN_FIELD(x)
+#define READ_BIN_FIELD_DUMMY_POINTER(x) offset += 4;
+#define GLYPH_CACHE_SIZE 16
+#define ENABLE_TEXT_WRAP 0
+#define HALT_ALLOCATOR_ERROR 1
+
+/** Data structures */
+typedef struct glyph_cache_desc {
+ vg_lite_path_t *h_path;
+ glyph_desc_t *g;
+ uint32_t use_count;
+}glyph_cache_desc_t;
+
+/** Internal or external API prototypes */
+
+/** Globals */
+static int g_glyph_cache_init_done = 0;
+static glyph_cache_desc_t g_glyph_cache[GLYPH_CACHE_SIZE];
+int g_total_bytes = 0;
+
+/** Externs if any */
+
+/* Internal API, not published to user */
+font_face_desc_t *_vg_lite_get_vector_font(vg_lite_font_t font_idx);
+void matrix_multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t *mult);
+
+void *_mem_allocate(int size)
+{
+ char *buf = NULL;
+
+ if ( size == 0 ) {
+ printf("ERROR: HALT: Why allocating %d bytes\n", size);
+#if HALT_ALLOCATOR_ERROR
+ while(1);
+#else
+ return NULL;
+#endif
+ }
+
+ buf = pvPortMalloc(size);
+ if (buf == NULL) {
+ printf("ERROR: HALT: allocating %d bytes \"system out of memory\"\n", size);
+#if HALT_ALLOCATOR_ERROR
+ while(1);
+#else
+ return NULL;
+#endif
+ }
+ g_total_bytes += size;
+ return buf;
+}
+
+void _mem_free(void *buf)
+{
+ vPortFree(buf);
+}
+
+/** GLYPH CACHING Code */
+void glyph_cache_init(void)
+{
+ if ( g_glyph_cache_init_done == 0 ) {
+ memset(g_glyph_cache,0,sizeof(g_glyph_cache));
+ g_glyph_cache_init_done = 1;
+ }
+}
+
+void glyph_cache_free(void)
+{
+ int i;
+ for (i=0; iunicode ==
+ g_glyph_cache[i].g->unicode )
+ {
+ g_glyph_cache[i].use_count++;
+ return g_glyph_cache[i].h_path;
+ }
+ }
+
+ /* Find least used descriptor */
+ unused_idx = 0;
+ for (i=1; ipath.num_draw_cmds*4,
+ g->path.draw_cmds,
+ g->path.bounds[0],
+ g->path.bounds[1],
+ g->path.bounds[2],
+ g->path.bounds[3]);
+ g_glyph_cache[unused_idx].g = g;
+ g_glyph_cache[unused_idx].use_count = 1;
+ return g_glyph_cache[unused_idx].h_path;
+}
+
+/** Render text using vector fonts */
+int vg_lite_vtf_draw_text(vg_lite_buffer_t *rt, int x, int y,
+ vg_lite_blend_t blend,
+ vg_lite_font_t font,
+ vg_lite_matrix_t *matrix,
+ vg_lite_font_attributes_t * attributes,
+ char *text)
+{
+ font_face_desc_t *font_face;
+ glyph_desc_t* g1 = NULL;
+ glyph_desc_t* g2;
+ int error = 0;
+ float font_scale = 1.0;
+ int text_wrap = 0;
+
+ font_face = (font_face_desc_t *)_vg_lite_get_vector_font(font);
+
+ attributes->last_dx = 0;
+ font_scale = ((1.0*attributes->font_height)/font_face->units_per_em);
+
+ vg_lite_matrix_t mat;
+
+ vg_lite_fill_t fill_rule = VG_LITE_FILL_NON_ZERO;
+ vg_lite_color_t color = attributes->text_color;
+
+ /* Compute size of tex in pixels
+ * For center alignment adjust x position
+ * Present parser has bug in encoding alignment value,
+ * Once it is fixed following code will align text in center
+ */
+ if ( attributes->alignment == eTextAlignCenter ||
+ attributes->alignment == eTextAlignRight ) {
+ char *t2 = text;
+ int dx = 0;
+ uint16_t ug2; /* Unicode glyph */
+ int kx;
+
+ /* Case of center alignement */
+ while (*t2 != '\0') {
+ ug2 = *t2;
+ kx = 0;
+ g2 = vft_find_glyph(font_face, ug2);
+ if (g1 != NULL && g2 != NULL) {
+ kx = vft_glyph_distance(g1, g2);
+ }
+
+ dx += ((g2->horiz_adv_x + kx )* font_scale);
+ t2++;
+ }
+
+ if ( attributes->alignment == eTextAlignCenter) {
+ x -= (dx/2);
+ } else if ( attributes->alignment == eTextAlignRight) {
+ x -= (dx);
+ }
+ }
+
+ /* Compute pixels that will cover this vector path */
+ while (*text != '\0') {
+ uint16_t ug2; /* Unicode glyph */
+ int kx;
+
+ if (text_wrap == 0) {
+ vg_lite_identity(&mat);
+ matrix_multiply(&mat, matrix);
+ vg_lite_translate(x,y, &mat);
+ vg_lite_scale(font_scale,font_scale, &mat); // 0.35 = height/units_per_em
+ vg_lite_scale(-1.0,1.0, &mat);
+ vg_lite_scale(-1.0,-1.0, &mat);
+ text_wrap = 1;
+ }
+
+ /* Read unicode character */
+ kx = 0;
+ ug2 = *text;
+ g2 = vft_find_glyph(font_face, ug2);
+ if (g1 != NULL && g2 != NULL) {
+ kx = vft_glyph_distance(g1, g2);
+ }
+
+#if (ENABLE_TEXT_WRAP==1)
+ /* Wrap text */
+ if ( (x + attributes->last_dx + ((g2->horiz_adv_x + kx )* font_scale))
+ >= (720 - 5) )
+ {
+ text_wrap = 0;
+ attributes->last_dx = 0;
+ y += (attributes->font_height + 1);
+ continue;
+ }
+#endif /* ENABLE_TEXT_WRAP */
+
+ /* Compute glyph size in horizontal dimension */
+ g1 = g2;
+ text++;
+
+ error = vg_lite_draw(rt, vft_cache_lookup(g2),
+ fill_rule,
+ &mat,
+ blend,
+ color);
+ if ( error != VG_LITE_SUCCESS ) {
+ break;
+ }
+
+ vg_lite_translate(g2->horiz_adv_x + kx, 0, &mat);
+ attributes->last_dx += ((g2->horiz_adv_x + kx )* font_scale);
+ }
+
+ attributes->last_dx += 2; /* Space between 2 text strings */
+
+ return 0;
+}
+
+void load_font_face(font_face_desc_t* font_face, uint8_t* buf, int font_face_offset)
+{
+ font_face_desc_t* g = font_face;
+ int offset = font_face_offset;
+
+ READ_BIN_FIELD_STR(font_family_name);
+ READ_BIN_FIELD_UINT16(units_per_em);
+ READ_BIN_FIELD_UINT16(ascent);
+ READ_BIN_FIELD_UINT16(descent);
+ READ_BIN_FIELD_UINT16(vg_font);
+ READ_BIN_FIELD_UINT32(num_glyphs);
+}
+
+void load_glyph_table(font_face_desc_t* font_face, uint8_t* buf, int glyph_table_offset)
+{
+ int offset = glyph_table_offset;
+
+ for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
+ glyph_desc_t* g = &font_face->glyphs[i];
+
+ memset(g, 0, sizeof(glyph_desc_t));
+ READ_BIN_FIELD_UINT16(unicode);
+ READ_BIN_FIELD_UINT16(horiz_adv_x);
+ READ_BIN_FIELD_UINT32(kern_num_entries);
+ READ_BIN_FIELD_UINT32(kern_table_offset);
+ READ_BIN_FIELD_DUMMY_POINTER();
+ READ_BIN_FIELD_FLOAT(path.bounds[0]);
+ READ_BIN_FIELD_FLOAT(path.bounds[1]);
+ READ_BIN_FIELD_FLOAT(path.bounds[2]);
+ READ_BIN_FIELD_FLOAT(path.bounds[3]);
+ READ_BIN_FIELD_UINT32(path.num_draw_cmds);
+ READ_BIN_FIELD_UINT32(path.draw_cmds_offset);
+ READ_BIN_FIELD_DUMMY_POINTER();
+
+ font_face->glyphs[i].kern_table = (kern_desc_t *)(buf + font_face->glyphs[i].kern_table_offset);
+ font_face->glyphs[i].path.draw_cmds = (float *)(buf + font_face->glyphs[i].path.draw_cmds_offset);
+
+ TRACE_INFO(("Glyph: '%c'\n", g->unicode));
+ vft_dbg_glyph_desc(g, d_offset);
+ }
+}
+
+/* Load vector font ROM table from file */
+font_face_desc_t* vft_load_from_buffer(char* buf_base, int file_size)
+{
+ font_face_desc_t* font_face = NULL;
+ uint32_t* blk_hdr;
+ //int error = 0;
+
+ /* Setup internal memory pointers of font_face_desc_t */
+ int font_face_offset = 0;
+ int glyph_table_offset = 0;
+ //int kern_table_offset = 0;
+ //int path_data_offset = 0;
+ int offset = 0;
+
+ /* May be we can avoid this lookup */
+ while (offset < file_size) {
+ blk_hdr = (uint32_t*)(buf_base + offset);
+ eFontBlock_t eType = (eFontBlock_t)((*blk_hdr) >> 24);
+ int size = ((*blk_hdr) & ((1<<24)-1));
+ TRACE_BIN(("BIN: %08x: block(%hu, %hu)\n",
+ offset, eType, size));
+ offset += BLK_HDR_SIZE;
+
+ /* Check integrity of block and then only proceed */
+ switch (eType) {
+ case eFontFaceDesc:
+ font_face_offset = offset;
+ break;
+ case eGlyphTableDesc:
+ glyph_table_offset = offset;
+ break;
+ case eKernTableDesc:
+ //kern_table_offset = offset;
+ break;
+ case eGlyphData:
+ //path_data_offset = offset;
+ break;
+ default:
+ case eUnkBlock:
+ case eMaxBlock:
+ return NULL;;
+ }
+ offset += size;
+ }
+
+ if (offset < 0 || offset > file_size) {
+ printf("ERROR: Vector font file integrity error aborting..\n");
+ return NULL;
+ }
+
+ /* Make structure binary compliant to reduce loading time */
+ font_face = (font_face_desc_t*)(buf_base + font_face_offset);
+ font_face->glyphs = (glyph_desc_t*)(buf_base + glyph_table_offset);
+
+ VFT_DBG_FONT_FACE_DESC(font_face, font_face_offset);
+ for (uint32_t i = 0; i < font_face->num_glyphs; i++) {
+ /* Update internal pointer from memory mapped file */
+ font_face->glyphs[i].kern_table =
+ (kern_desc_t*)(buf_base + font_face->glyphs[i].kern_table_offset);
+ font_face->glyphs[i].path.draw_cmds =
+ (float*)(buf_base +
+ font_face->glyphs[i].path.draw_cmds_offset);
+ /* Try to get these paramters from Binary object or attributes */
+ //vg_lite_format_t data_format = VG_LITE_FP32; //VG_LITE_S16;
+ //vg_lite_quality_t quality = VG_LITE_HIGH;
+ }
+ VFT_DBG_GLYPH_TABLE(font_face, glyph_table_offset);
+
+ VFT_DBG_KERN_TABLE(font_face, kern_table_offset);
+ VFT_DBG_PATH_TABLE(font_face, path_data_offset);
+
+ return font_face;
+}
+
+/* Find glyph of given character from glyph table */
+glyph_desc_t* vft_find_glyph(font_face_desc_t* font_face, uint16_t ug2)
+{
+ const int num_glyphs = font_face->num_glyphs;
+ glyph_desc_t* glyphs = font_face->glyphs;
+
+ /*
+ * Present approach is slow linear search, this is ok in 1st prototype
+ * Since glyph table is already sorted, we can have binary search
+ */
+ for (int i = 0; i < num_glyphs; i++) {
+ if (glyphs[i].unicode == ug2) {
+ return (glyph_desc_t*)&glyphs[i];
+ }
+ }
+ return (glyph_desc_t*)&glyphs[0];;
+}
+
+/* Find distance between 2 glyph symbols */
+int vft_glyph_distance(glyph_desc_t* g1, glyph_desc_t* g2)
+{
+ signed short kx = 0;
+ uint16_t ug2 = g2->unicode;
+ kern_desc_t* kern_table = &g1->kern_table[0];
+
+ for (int i = 0; i < g1->kern_num_entries; i++) {
+ if (kern_table[i].unicode == ug2) {
+ signed short *pkx = (signed short *)&kern_table[i].kern;
+ kx = *pkx;
+ break;
+ }
+ }
+
+ return kx;
+}
+
+/*
+* Get internal vector path of given glyph
+* This is internal function
+*/
+path_desc_t* vft_get_glyph_path(glyph_desc_t* g2)
+{
+ return &g2->path;
+}
+
+/* Unload font face descriptor and all glyphs */
+void vft_unload(font_face_desc_t* font_face)
+{
+ glyph_cache_free();
+ //VFT_FREE(font_face);
+}
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.h b/bsp/sdk_overlay/middleware/vglite/font/vft_draw.h
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.h
rename to bsp/sdk_overlay/middleware/vglite/font/vft_draw.h
index 39eb8f1..c309a80 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vft_draw.h
+++ b/bsp/sdk_overlay/middleware/vglite/font/vft_draw.h
@@ -1,119 +1,119 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-#ifndef _VFT_DRAW_H
-#define _VFT_DRAW_H
-
-#include
-
-typedef enum eFontBlkType {
- eUnkBlock,
- eFontFaceDesc,
- eGlyphTableDesc,
- eKernTableDesc,
- eGlyphData,
- eMaxBlock
-}eFontBlock_t;
-
-static const int32_t BLK_HDR_SIZE = 4;
-
-typedef struct path_descriptor {
- float bounds[4];
- uint32_t num_draw_cmds;
- uint32_t draw_cmds_offset;
- float* draw_cmds; /* NOTE: this will be used while loading table, DONT REMOVE */
-}path_desc_t;
-
-typedef struct kern_desc {
- uint16_t unicode;
- uint16_t kern;
-}kern_desc_t;
-
-typedef struct glyph_descriptor {
- uint16_t unicode; /* unicode name */
- uint16_t horiz_adv_x; /* Short to align to 32-bit boundry */
- uint32_t kern_num_entries;
- uint32_t kern_table_offset;
- kern_desc_t* kern_table; /* NOTE: this will be used while loading table, DONT REMOVE */
- path_desc_t path;
-}glyph_desc_t;
-
-typedef struct font_face_info {
- int8_t font_family_name[64];
- uint16_t units_per_em;
- uint16_t ascent;
- uint16_t descent;
- uint16_t vg_font;
- uint32_t num_glyphs;
- glyph_desc_t* glyphs; /* NOTE: this will be used while loading table, DONT REMOVE */
-}font_face_desc_t;
-
-//NOTE: No glyph caching at this time
-
-/* Load vector font ROM table from file */
-font_face_desc_t* vft_load(char* vcft_file_path);
-
-/* Find glyph of given character from glyph table */
-glyph_desc_t* vft_find_glyph(font_face_desc_t* font_face, uint16_t ug2);
-
-/* Find distance between 2 glyph symbols */
-int vft_glyph_distance(glyph_desc_t* g1, glyph_desc_t* g2);
-
-/*
-* Get internal vector path of given glyph
-* This is internal function
-*/
-path_desc_t* vft_get_glyph_path(glyph_desc_t* g2);
-
-/* Draw vector font based glyph on given x,y co-ordinate */
-void vft_draw_glyph(int x, int y, glyph_desc_t* g2);
-
-/* Compute horizotal pixels coverted by this path */
-int vft_compute_dx(glyph_desc_t* g2);
-
-/* Unload font face descriptor and all glyphs */
-void vft_unload(font_face_desc_t*);
-
-/* Draw string with vector font s*/
-int vg_lite_vtf_draw_text(vg_lite_buffer_t *rt, int x, int y,
- vg_lite_blend_t blend,
- vg_lite_font_t font,
- vg_lite_matrix_t *matrix,
- vg_lite_font_attributes_t * attributes,
- char *text);
-
-/* Internal memory allocator API */
-void *_mem_allocate(int size);
-void _mem_free(void *buf);
-
-vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height);
-font_face_desc_t* vft_load_from_buffer(char* buf_base, int file_size);
-void vg_lite_unload_font_data(void);
-
-#endif //!_VFT_DRAW_H
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#ifndef _VFT_DRAW_H
+#define _VFT_DRAW_H
+
+#include
+
+typedef enum eFontBlkType {
+ eUnkBlock,
+ eFontFaceDesc,
+ eGlyphTableDesc,
+ eKernTableDesc,
+ eGlyphData,
+ eMaxBlock
+}eFontBlock_t;
+
+static const int32_t BLK_HDR_SIZE = 4;
+
+typedef struct path_descriptor {
+ float bounds[4];
+ uint32_t num_draw_cmds;
+ uint32_t draw_cmds_offset;
+ float* draw_cmds; /* NOTE: this will be used while loading table, DONT REMOVE */
+}path_desc_t;
+
+typedef struct kern_desc {
+ uint16_t unicode;
+ uint16_t kern;
+}kern_desc_t;
+
+typedef struct glyph_descriptor {
+ uint16_t unicode; /* unicode name */
+ uint16_t horiz_adv_x; /* Short to align to 32-bit boundry */
+ uint32_t kern_num_entries;
+ uint32_t kern_table_offset;
+ kern_desc_t* kern_table; /* NOTE: this will be used while loading table, DONT REMOVE */
+ path_desc_t path;
+}glyph_desc_t;
+
+typedef struct font_face_info {
+ int8_t font_family_name[64];
+ uint16_t units_per_em;
+ uint16_t ascent;
+ uint16_t descent;
+ uint16_t vg_font;
+ uint32_t num_glyphs;
+ glyph_desc_t* glyphs; /* NOTE: this will be used while loading table, DONT REMOVE */
+}font_face_desc_t;
+
+//NOTE: No glyph caching at this time
+
+/* Load vector font ROM table from file */
+font_face_desc_t* vft_load(char* vcft_file_path);
+
+/* Find glyph of given character from glyph table */
+glyph_desc_t* vft_find_glyph(font_face_desc_t* font_face, uint16_t ug2);
+
+/* Find distance between 2 glyph symbols */
+int vft_glyph_distance(glyph_desc_t* g1, glyph_desc_t* g2);
+
+/*
+* Get internal vector path of given glyph
+* This is internal function
+*/
+path_desc_t* vft_get_glyph_path(glyph_desc_t* g2);
+
+/* Draw vector font based glyph on given x,y co-ordinate */
+void vft_draw_glyph(int x, int y, glyph_desc_t* g2);
+
+/* Compute horizotal pixels coverted by this path */
+int vft_compute_dx(glyph_desc_t* g2);
+
+/* Unload font face descriptor and all glyphs */
+void vft_unload(font_face_desc_t*);
+
+/* Draw string with vector font s*/
+int vg_lite_vtf_draw_text(vg_lite_buffer_t *rt, int x, int y,
+ vg_lite_blend_t blend,
+ vg_lite_font_t font,
+ vg_lite_matrix_t *matrix,
+ vg_lite_font_attributes_t * attributes,
+ char *text);
+
+/* Internal memory allocator API */
+void *_mem_allocate(int size);
+void _mem_free(void *buf);
+
+vg_lite_error_t vg_lite_load_font_data(vg_lite_font_t font, int font_height);
+font_face_desc_t* vft_load_from_buffer(char* buf_base, int file_size);
+void vg_lite_unload_font_data(void);
+
+#endif //!_VFT_DRAW_H
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c b/bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c
similarity index 97%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c
rename to bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c
index 5b433f7..3aefcea 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c
+++ b/bsp/sdk_overlay/middleware/vglite/font/vg_lite_text.c
@@ -1,359 +1,359 @@
-/****************************************************************************
-*
-* The MIT License (MIT)
-*
-* Copyright 2020 NXP
-* All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* 'Software'), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sub license, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject
-* to the following conditions:
-*
-* The above copyright notice and this permission notice (including the
-* next paragraph) shall be included in all copies or substantial
-* portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
-* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*****************************************************************************/
-
-/** Include Files */
-#include "vg_lite.h"
-#include "vg_lite_text.h"
-#include
-#include
-
-#include
-#include "vft_draw.h"
-
-/** Macros */
-
-/** Data structures */
-typedef struct {
- /* Font related parameters */
- vg_lite_font_attributes_t *attributes;
- vg_lite_buffer_t buffer;
- uint16_t width;
- uint16_t height;
- uint16_t y;
- const struct mf_font_s *rcd_font;
-} text_context_t;
-
-/** Internal or external API prototypes */
-struct mf_font_s *_vg_lite_get_raster_font(vg_lite_font_t font_idx);
-int vg_lite_is_font_valid(vg_lite_font_t font);
-
-/** Globals */
-vg_lite_font_attributes_t g_font_attribs;
-vg_lite_font_t g_last_font = VG_LITE_INVALID_FONT;
-int g_last_font_attrib_idx;
-
-/** Externs if any */
-
-/* Capture unique values of alpha */
-static unsigned int g_index_table[257];
-
-/* text_color is in ARGB8888 format */
-int init_256pallet_color_table(unsigned int bg_color, unsigned int fg_color)
-{
- int i;
- g_index_table[0] = 0; /* Background color */
- int fg_r = ((fg_color>>0)&0xff);
- int fg_g = ((fg_color>>8)&0xff);
- int fg_b = ((fg_color>>16)&0xff);
-
- int bg_r = ((bg_color>>0)&0xff);
- int bg_g = ((bg_color>>8)&0xff);
- int bg_b = ((bg_color>>16)&0xff);
-
- for (i=1; i<256; i++) {
- int r, g, b;
- int a = 0xff;
- register int mult, mult2;
-
- mult = ((i*1024)/256);
- mult2 = (((256-i)*1024)/256);
-
- /* Blend with white bg */
- r = ( ((bg_r * mult2)>>10) +((fg_r * mult)>>10) );
- g = ( ((bg_g * mult2)>>10) +((fg_g * mult)>>10) );
- b = ( ((bg_b * mult2)>>10) +((fg_b * mult)>>10) );
- g_index_table[i] = ((a) + (r<<8) + (g<<16)+(b<<24));
- }
- return 0;
-}
-
-/* Callback to write to a memory buffer. */
-static void pixel_callback(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
- void *state)
-{
- text_context_t *s = (text_context_t*)state;
- uint32_t pos;
- uint32_t value;
- uint32_t *raw_pixel_buffer = (uint32_t *)s->buffer.memory;
- int stride = s->buffer.stride;
-
- if (y < 0 || y >= s->height) return;
- if (x < 0 || x + count >= s->width) return;
-
- while (count--)
- {
- pos = (uint32_t)stride * y + x;
- value = g_index_table[alpha];
-
- raw_pixel_buffer[pos] = value;
-
- x++;
- }
-}
-
-/* Callback to render characters. */
-static uint8_t character_callback(int16_t x, int16_t y, mf_char character,
- void *state)
-{
- text_context_t *s = (text_context_t*)state;
- return mf_render_character(s->rcd_font, x, y, character, pixel_callback, state);
-}
-
-/* Callback to render lines. */
-static bool line_callback(const char *line, uint16_t count, void *state)
-{
- text_context_t *s = (text_context_t*)state;
-
- if (s->attributes->justify)
- {
- mf_render_justified(s->rcd_font, s->attributes->anchor, s->y,
- s->width - s->attributes->margin * 2,
- line, count, character_callback, state);
- }
- else
- {
- mf_render_aligned(s->rcd_font, s->attributes->anchor, s->y,
- (enum mf_align_t)s->attributes->alignment, line, count,
- character_callback, state);
- }
- s->y += s->rcd_font->line_height;
- return true;
-}
-
-/* Callback to just count the lines.
- * Used to decide the image height */
-bool count_lines(const char *line, uint16_t count, void *state)
-{
- int *linecount = (int*)state;
- (*linecount)++;
- return true;
-}
-
-vg_lite_error_t alloc_font_buffer(vg_lite_buffer_t *buffer, int width , int height)
-{
- vg_lite_error_t error;
-
- /* Align width to 16 pixels, heigh to 16 pixels */
- width = ((width+15)&(~15));
- height = ((height+15)&(~15));
-
- /* Allocate memory from VGLITE space */
- buffer->width = width;
- buffer->height = height;
- buffer->format = VG_LITE_ARGB8888;
- buffer->stride = 0;
- error = vg_lite_allocate(buffer);
- buffer->stride = width;
- buffer->tiled = VG_LITE_LINEAR;
-
- return error;
-}
-
-static vg_lite_error_t free_font_buffer(vg_lite_buffer_t *buffer)
-{
- vg_lite_error_t error;
-
- error = vg_lite_free(buffer);
-
- return error;
-}
-
-void matrix_multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t * mult)
-{
- vg_lite_matrix_t temp;
- int row, column;
-
- /* Process all rows. */
- for (row = 0; row < 3; row++) {
- /* Process all columns. */
- for (column = 0; column < 3; column++) {
- /* Compute matrix entry. */
- temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column])
- + (matrix->m[row][1] * mult->m[1][column])
- + (matrix->m[row][2] * mult->m[2][column]);
- }
- }
-
- /* Copy temporary matrix into result. */
- memcpy(matrix, &temp, sizeof(temp));
-}
-
-vg_lite_error_t vg_lite_draw_text(vg_lite_buffer_t *target,
- char *text,
- vg_lite_font_t font,
- int x,
- int y,
- vg_lite_matrix_t *matrix,
- vg_lite_blend_t blend,
- vg_lite_font_attributes_t *attributes)
-{
- vg_lite_error_t error;
- int height;
- text_context_t ctx_text;
- vg_lite_matrix_t m_text;
- int text_img_size = 0;
- font_face_desc_t* font_face = NULL;
- int text_width_in_pixels = 0;
- int tmpX;
-
- memset(&ctx_text, 0, sizeof(ctx_text));
- ctx_text.attributes = attributes;
-
- if ( vg_lite_is_font_valid(font) != 0 ) {
- return VG_LITE_INVALID_ARGUMENT;
- }
-
- error = vg_lite_load_font_data(font,
- attributes->font_height);
- if ( error != 0 ) {
- return VG_LITE_INVALID_ARGUMENT;
- }
-
- if(attributes->tspan_has_dx_dy != 0)
- {
- if ( x < 0 )
- x = attributes->last_x + attributes->last_dx;
- if ( y < 0 )
- y = attributes->last_y;
- }
-
- // Dynamic decision
- if ( attributes->is_vector_font == 0 ) {
- init_256pallet_color_table(attributes->bg_color, attributes->text_color);
-
- /* Application specifies actual font by reading proper rcd file */
- ctx_text.rcd_font = _vg_lite_get_raster_font(font);
-
- /* Count number of lines to decide font buffer size. */
- height = 0;
- mf_text_draw_area(ctx_text.rcd_font, attributes->width - 2 * attributes->margin,
- text, &height, &text_width_in_pixels);
- height *= attributes->font_height;
- height += 4;
-
- if( attributes->tspan_has_dx_dy == 0) {
- y -= attributes->font_height;
- }
-
- tmpX = x;
- if(attributes->alignment == eTextAlignCenter) {
- tmpX -= text_width_in_pixels/2;
- } else if(attributes->alignment == eTextAlignRight) {
- tmpX -= text_width_in_pixels;
- }
- /* Manually calculate X-offset for text-alignemnt; mcufont just
- * doesn't render half part(left-part) for center alignment and
- * full string skipped for right-alignment, So again set it to
- * left-alignment for font-attrib, as offsets are already
- * calculated and alignment handled in other way */
- attributes->alignment = 0;
-
- /* Allocate and initialize vg_lite_buffer that can hold font text
- * Note: ctx_text.width and ctx_text.height get used by internal
- * state of MF rendering engine. Based on amount of text to render
- * This buffer gets allocated, and buffer width gets aligned to
- * 16 pixel boundary
- */
- ctx_text.width = attributes->width;
- /* Memory optimization */
- ctx_text.width = text_width_in_pixels;
- /* Align width to 16 pixel boundary */
- if (ctx_text.width & 15) {
- ctx_text.width += 15;
- ctx_text.width &= (~15);
- }
-
- ctx_text.height = height;
- error = alloc_font_buffer(&ctx_text.buffer, ctx_text.width, ctx_text.height);
- if ( error != VG_LITE_SUCCESS) {
- printf("WARNING: alloc_font_buffer failed(%d).\r\n",error);
- }
- ctx_text.y = 2;
-
- /* Initialize vg_lite buffer with transperant color */
- /* Due to alignment requirement of vg_lite, font buffer can be larger */
- if ( ctx_text.buffer.format == VG_LITE_ARGB8888 )
- text_img_size = ctx_text.buffer.width * ctx_text.buffer.height * 4;
- else
- text_img_size = ctx_text.buffer.width * ctx_text.buffer.height;
- memset(ctx_text.buffer.memory, 0,
- text_img_size);
-
- /* Render font text into vg_lite_buffer */
- mf_wordwrap(ctx_text.rcd_font, attributes->width - 2 * attributes->margin,
- text, line_callback, &ctx_text);
-
- /* Draw font bitmap on render target */
- vg_lite_identity(&m_text);
- matrix_multiply(&m_text, matrix);
- vg_lite_translate(x, y, &m_text);
- vg_lite_scale(1.0, 1.0, &m_text);
- if ( ctx_text.buffer.format == VG_LITE_ARGB8888 )
- ctx_text.buffer.stride = ctx_text.width*4;
-
- error = vg_lite_blit(target, &ctx_text.buffer, &m_text, blend,
- 0, VG_LITE_FILTER_POINT);
- if ( error != VG_LITE_SUCCESS) {
- printf("WARNING: vg_lite_blit failed(%d).\r\n",error);
- }
-
- error = vg_lite_finish();
- if ( error != VG_LITE_SUCCESS) {
- printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
- }
-
- error = free_font_buffer(&ctx_text.buffer);
- if ( error != VG_LITE_SUCCESS) {
- printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
- }
- attributes->last_dx = text_width_in_pixels;
- } else {
- error = (vg_lite_error_t)vg_lite_vtf_draw_text(target,
- x, y,
- blend,
- font,
- matrix,
- attributes,
- text);
- /* Note: vg_lite_vtf_draw_text updates attributes->last_dx internally
- This assignment is just to keep code similar to rcd code */
- attributes->last_dx = attributes->last_dx;
-
- error = vg_lite_finish();
- if ( error != VG_LITE_SUCCESS) {
- printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
- }
-
- vft_unload(font_face);
- }
- attributes->last_x = x;
- attributes->last_y = y;
-
- return error;
-}
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2020 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* 'Software'), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sub license, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+*
+* The above copyright notice and this permission notice (including the
+* next paragraph) shall be included in all copies or substantial
+* portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+/** Include Files */
+#include "vg_lite.h"
+#include "vg_lite_text.h"
+#include
+#include
+
+#include
+#include "vft_draw.h"
+
+/** Macros */
+
+/** Data structures */
+typedef struct {
+ /* Font related parameters */
+ vg_lite_font_attributes_t *attributes;
+ vg_lite_buffer_t buffer;
+ uint16_t width;
+ uint16_t height;
+ uint16_t y;
+ const struct mf_font_s *rcd_font;
+} text_context_t;
+
+/** Internal or external API prototypes */
+struct mf_font_s *_vg_lite_get_raster_font(vg_lite_font_t font_idx);
+int vg_lite_is_font_valid(vg_lite_font_t font);
+
+/** Globals */
+vg_lite_font_attributes_t g_font_attribs;
+vg_lite_font_t g_last_font = VG_LITE_INVALID_FONT;
+int g_last_font_attrib_idx;
+
+/** Externs if any */
+
+/* Capture unique values of alpha */
+static unsigned int g_index_table[257];
+
+/* text_color is in ARGB8888 format */
+int init_256pallet_color_table(unsigned int bg_color, unsigned int fg_color)
+{
+ int i;
+ g_index_table[0] = 0; /* Background color */
+ int fg_r = ((fg_color>>0)&0xff);
+ int fg_g = ((fg_color>>8)&0xff);
+ int fg_b = ((fg_color>>16)&0xff);
+
+ int bg_r = ((bg_color>>0)&0xff);
+ int bg_g = ((bg_color>>8)&0xff);
+ int bg_b = ((bg_color>>16)&0xff);
+
+ for (i=1; i<256; i++) {
+ int r, g, b;
+ int a = 0xff;
+ register int mult, mult2;
+
+ mult = ((i*1024)/256);
+ mult2 = (((256-i)*1024)/256);
+
+ /* Blend with white bg */
+ r = ( ((bg_r * mult2)>>10) +((fg_r * mult)>>10) );
+ g = ( ((bg_g * mult2)>>10) +((fg_g * mult)>>10) );
+ b = ( ((bg_b * mult2)>>10) +((fg_b * mult)>>10) );
+ g_index_table[i] = ((a) + (r<<8) + (g<<16)+(b<<24));
+ }
+ return 0;
+}
+
+/* Callback to write to a memory buffer. */
+static void pixel_callback(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
+ void *state)
+{
+ text_context_t *s = (text_context_t*)state;
+ uint32_t pos;
+ uint32_t value;
+ uint32_t *raw_pixel_buffer = (uint32_t *)s->buffer.memory;
+ int stride = s->buffer.stride;
+
+ if (y < 0 || y >= s->height) return;
+ if (x < 0 || x + count >= s->width) return;
+
+ while (count--)
+ {
+ pos = (uint32_t)stride * y + x;
+ value = g_index_table[alpha];
+
+ raw_pixel_buffer[pos] = value;
+
+ x++;
+ }
+}
+
+/* Callback to render characters. */
+static uint8_t character_callback(int16_t x, int16_t y, mf_char character,
+ void *state)
+{
+ text_context_t *s = (text_context_t*)state;
+ return mf_render_character(s->rcd_font, x, y, character, pixel_callback, state);
+}
+
+/* Callback to render lines. */
+static bool line_callback(const char *line, uint16_t count, void *state)
+{
+ text_context_t *s = (text_context_t*)state;
+
+ if (s->attributes->justify)
+ {
+ mf_render_justified(s->rcd_font, s->attributes->anchor, s->y,
+ s->width - s->attributes->margin * 2,
+ line, count, character_callback, state);
+ }
+ else
+ {
+ mf_render_aligned(s->rcd_font, s->attributes->anchor, s->y,
+ (enum mf_align_t)s->attributes->alignment, line, count,
+ character_callback, state);
+ }
+ s->y += s->rcd_font->line_height;
+ return true;
+}
+
+/* Callback to just count the lines.
+ * Used to decide the image height */
+bool count_lines(const char *line, uint16_t count, void *state)
+{
+ int *linecount = (int*)state;
+ (*linecount)++;
+ return true;
+}
+
+vg_lite_error_t alloc_font_buffer(vg_lite_buffer_t *buffer, int width , int height)
+{
+ vg_lite_error_t error;
+
+ /* Align width to 16 pixels, heigh to 16 pixels */
+ width = ((width+15)&(~15));
+ height = ((height+15)&(~15));
+
+ /* Allocate memory from VGLITE space */
+ buffer->width = width;
+ buffer->height = height;
+ buffer->format = VG_LITE_ARGB8888;
+ buffer->stride = 0;
+ error = vg_lite_allocate(buffer);
+ buffer->stride = width;
+ buffer->tiled = VG_LITE_LINEAR;
+
+ return error;
+}
+
+static vg_lite_error_t free_font_buffer(vg_lite_buffer_t *buffer)
+{
+ vg_lite_error_t error;
+
+ error = vg_lite_free(buffer);
+
+ return error;
+}
+
+void matrix_multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t * mult)
+{
+ vg_lite_matrix_t temp;
+ int row, column;
+
+ /* Process all rows. */
+ for (row = 0; row < 3; row++) {
+ /* Process all columns. */
+ for (column = 0; column < 3; column++) {
+ /* Compute matrix entry. */
+ temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column])
+ + (matrix->m[row][1] * mult->m[1][column])
+ + (matrix->m[row][2] * mult->m[2][column]);
+ }
+ }
+
+ /* Copy temporary matrix into result. */
+ memcpy(matrix, &temp, sizeof(temp));
+}
+
+vg_lite_error_t vg_lite_draw_text(vg_lite_buffer_t *target,
+ char *text,
+ vg_lite_font_t font,
+ int x,
+ int y,
+ vg_lite_matrix_t *matrix,
+ vg_lite_blend_t blend,
+ vg_lite_font_attributes_t *attributes)
+{
+ vg_lite_error_t error;
+ int height;
+ text_context_t ctx_text;
+ vg_lite_matrix_t m_text;
+ int text_img_size = 0;
+ font_face_desc_t* font_face = NULL;
+ int text_width_in_pixels = 0;
+ int tmpX;
+
+ memset(&ctx_text, 0, sizeof(ctx_text));
+ ctx_text.attributes = attributes;
+
+ if ( vg_lite_is_font_valid(font) != 0 ) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ error = vg_lite_load_font_data(font,
+ attributes->font_height);
+ if ( error != 0 ) {
+ return VG_LITE_INVALID_ARGUMENT;
+ }
+
+ if(attributes->tspan_has_dx_dy != 0)
+ {
+ if ( x < 0 )
+ x = attributes->last_x + attributes->last_dx;
+ if ( y < 0 )
+ y = attributes->last_y;
+ }
+
+ // Dynamic decision
+ if ( attributes->is_vector_font == 0 ) {
+ init_256pallet_color_table(attributes->bg_color, attributes->text_color);
+
+ /* Application specifies actual font by reading proper rcd file */
+ ctx_text.rcd_font = _vg_lite_get_raster_font(font);
+
+ /* Count number of lines to decide font buffer size. */
+ height = 0;
+ mf_text_draw_area(ctx_text.rcd_font, attributes->width - 2 * attributes->margin,
+ text, &height, &text_width_in_pixels);
+ height *= attributes->font_height;
+ height += 4;
+
+ if( attributes->tspan_has_dx_dy == 0) {
+ y -= attributes->font_height;
+ }
+
+ tmpX = x;
+ if(attributes->alignment == eTextAlignCenter) {
+ tmpX -= text_width_in_pixels/2;
+ } else if(attributes->alignment == eTextAlignRight) {
+ tmpX -= text_width_in_pixels;
+ }
+ /* Manually calculate X-offset for text-alignemnt; mcufont just
+ * doesn't render half part(left-part) for center alignment and
+ * full string skipped for right-alignment, So again set it to
+ * left-alignment for font-attrib, as offsets are already
+ * calculated and alignment handled in other way */
+ attributes->alignment = 0;
+
+ /* Allocate and initialize vg_lite_buffer that can hold font text
+ * Note: ctx_text.width and ctx_text.height get used by internal
+ * state of MF rendering engine. Based on amount of text to render
+ * This buffer gets allocated, and buffer width gets aligned to
+ * 16 pixel boundary
+ */
+ ctx_text.width = attributes->width;
+ /* Memory optimization */
+ ctx_text.width = text_width_in_pixels;
+ /* Align width to 16 pixel boundary */
+ if (ctx_text.width & 15) {
+ ctx_text.width += 15;
+ ctx_text.width &= (~15);
+ }
+
+ ctx_text.height = height;
+ error = alloc_font_buffer(&ctx_text.buffer, ctx_text.width, ctx_text.height);
+ if ( error != VG_LITE_SUCCESS) {
+ printf("WARNING: alloc_font_buffer failed(%d).\r\n",error);
+ }
+ ctx_text.y = 2;
+
+ /* Initialize vg_lite buffer with transperant color */
+ /* Due to alignment requirement of vg_lite, font buffer can be larger */
+ if ( ctx_text.buffer.format == VG_LITE_ARGB8888 )
+ text_img_size = ctx_text.buffer.width * ctx_text.buffer.height * 4;
+ else
+ text_img_size = ctx_text.buffer.width * ctx_text.buffer.height;
+ memset(ctx_text.buffer.memory, 0,
+ text_img_size);
+
+ /* Render font text into vg_lite_buffer */
+ mf_wordwrap(ctx_text.rcd_font, attributes->width - 2 * attributes->margin,
+ text, line_callback, &ctx_text);
+
+ /* Draw font bitmap on render target */
+ vg_lite_identity(&m_text);
+ matrix_multiply(&m_text, matrix);
+ vg_lite_translate(x, y, &m_text);
+ vg_lite_scale(1.0, 1.0, &m_text);
+ if ( ctx_text.buffer.format == VG_LITE_ARGB8888 )
+ ctx_text.buffer.stride = ctx_text.width*4;
+
+ error = vg_lite_blit(target, &ctx_text.buffer, &m_text, blend,
+ 0, VG_LITE_FILTER_POINT);
+ if ( error != VG_LITE_SUCCESS) {
+ printf("WARNING: vg_lite_blit failed(%d).\r\n",error);
+ }
+
+ error = vg_lite_finish();
+ if ( error != VG_LITE_SUCCESS) {
+ printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
+ }
+
+ error = free_font_buffer(&ctx_text.buffer);
+ if ( error != VG_LITE_SUCCESS) {
+ printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
+ }
+ attributes->last_dx = text_width_in_pixels;
+ } else {
+ error = (vg_lite_error_t)vg_lite_vtf_draw_text(target,
+ x, y,
+ blend,
+ font,
+ matrix,
+ attributes,
+ text);
+ /* Note: vg_lite_vtf_draw_text updates attributes->last_dx internally
+ This assignment is just to keep code similar to rcd code */
+ attributes->last_dx = attributes->last_dx;
+
+ error = vg_lite_finish();
+ if ( error != VG_LITE_SUCCESS) {
+ printf("WARNING: vg_lite_finish failed(%d).\r\n",error);
+ }
+
+ vft_unload(font_face);
+ }
+ attributes->last_x = x;
+ attributes->last_y = y;
+
+ return error;
+}
diff --git a/bsp/sdk_overlay/middleware/vglite/inc/nxp_support.h b/bsp/sdk_overlay/middleware/vglite/inc/nxp_support.h
new file mode 100644
index 0000000..4d94c46
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/inc/nxp_support.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+*
+* The MIT License (MIT)
+*
+* Copyright 2023 NXP
+* All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to
+* deal in the Software without restriction, including without limitation the
+* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+* sell copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+* IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+#include
+#include
+
+#if (defined(__REDLIB__))
+float hypotf (float x, float y);
+#endif
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h b/bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h
rename to bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h
index 4ccbbce..e9ec29a 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h
+++ b/bsp/sdk_overlay/middleware/vglite/inc/vg_lite.h
@@ -25,7 +25,7 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
-* Copyright 2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+* Copyright 2022-2023 MicroEJ Corp. This file has been modified by MicroEJ Corp.
* 1. Add "vg_lite_get_scissor()"
*
*****************************************************************************/
@@ -44,7 +44,7 @@ extern "C" {
#include
#include
-#define VGLITE_RELEASE_VERSION 0x201000
+#define VGLITE_RELEASE_VERSION 0x03000f
#define VGLITE_HEADER_VERSION 6
@@ -613,7 +613,7 @@ extern "C" {
void *path; /*! Pointer to the physical description of the path. */
int8_t path_changed; /* Indicate whether path data is synced with command buffer (uploaded) or not. */
int8_t pdata_internal; /*! Indicate whether path data memory is allocated by driver. */
- vg_lite_stroke_conversion_t stroke_conversion; /*! Refer to the definition by vg_lite_stroke_conversion_t.*/
+ vg_lite_stroke_conversion_t *stroke_conversion; /*! Refer to the definition by vg_lite_stroke_conversion_t.*/
vg_lite_draw_path_type_t path_type; /*! Refer to the definition by vg_lite_draw_path_type_t. */
void *stroke_path_data; /*! Pointer to the physical description of the stroke path. */
int32_t stroke_path_size; /*! Number of bytes in the stroke path data. */
@@ -1913,20 +1913,6 @@ extern "C" {
*/
void vg_lite_rotate(vg_lite_float_t degrees, vg_lite_matrix_t *matrix);
- /*!
- @abstract projective transformation.
-
- @discussion
- set perspective matrix.
-
- @param degrees
- px: indicate w0 of perspective transformation matrix
- py: indicate w1 of perspective transformation matrix
- @param matrix
- Pointer to a vg_lite_matrix_t structure that will be rotated.
- */
- void vg_lite_perspective(vg_lite_float_t px, vg_lite_float_t py, vg_lite_matrix_t *matrix);
-
/*!
@abstract Set the command buffer size.
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h b/bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h
similarity index 90%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h
rename to bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h
index eb3b70a..33e4531 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h
+++ b/bsp/sdk_overlay/middleware/vglite/inc/vg_lite_hal.h
@@ -25,10 +25,6 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
-* Copyright 2020-2022 MicroEJ Corp. This file has been modified by MicroEJ Corp.
-* 1. Add callback mecanism to notify MicroEJ when a VGLite operation
-* is complete
-*
*****************************************************************************/
#ifndef _vg_lite_hal_h_
@@ -39,9 +35,7 @@
#include "vg_lite_kernel.h"
#define VGLITE_MEM_ALIGNMENT 128
-#if !defined(VG_DRIVER_SINGLE_THREAD)
#define TASK_LENGTH 8
-#endif /* not defined(VG_DRIVER_SINGLE_THREAD) */
#ifdef __cplusplus
extern "C" {
@@ -70,25 +64,7 @@ void vg_lite_hal_delay(uint32_t milliseconds);
The implementer should make sure that on exit of this function the power and clock to the VGLite graphics hardware is
turned on and stable.
*/
-#if defined(VG_DRIVER_SINGLE_THREAD)
-void vg_lite_hal_initialize(void);
-
-// added by MicroEJ
-#if _VG_LITE_IRQ_CALLBACK == 1
-typedef void (* vg_lite_irq_callback) (void);
-
-/*
- * @brief Registers a callback that will be called when the GPU IRQ is triggered
- * meaning that a VGLite operation is completed
- *
- * @param[in] cb: The callback to register
- */
-void vg_lite_hal_register_irq_callback(vg_lite_irq_callback cb);
-#endif /* _VG_LITE_IRQ_CALLBACK */
-
-#else
vg_lite_error_t vg_lite_hal_initialize(void);
-#endif /* VG_DRIVER_SINGLE_THREAD */
/*!
@brief Uninitialize the hardware.
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite_text.h b/bsp/sdk_overlay/middleware/vglite/inc/vg_lite_text.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/middleware/vglite/inc/vg_lite_text.h
rename to bsp/sdk_overlay/middleware/vglite/inc/vg_lite_text.h
diff --git a/bsp/sdk_overlay/middleware/vglite/middleware_vglite.cmake b/bsp/sdk_overlay/middleware/vglite/middleware_vglite.cmake
new file mode 100644
index 0000000..91f156e
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/middleware_vglite.cmake
@@ -0,0 +1,49 @@
+# Add set(CONFIG_USE_middleware_vglite true) in config.cmake to use this component
+
+include_guard(GLOBAL)
+message("${CMAKE_CURRENT_LIST_FILE} component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/vg_lite.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/vg_lite_image.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/vg_lite_matrix.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/vg_lite_path.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/nxp_support.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/vg_lite_flat.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/rtos/vg_lite_os.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/buf_reader.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/rle_font_read.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/vft_debug.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/vft_draw.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/vg_lite_text.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_bwfont.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_encoding.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_font.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_justify.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_kerning.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_rlefont.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_scaledfont.c
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder/mf_wordwrap.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLiteKernel/vg_lite_kernel.c
+ ${CMAKE_CURRENT_LIST_DIR}/VGLiteKernel/rtos/vg_lite_hal.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/inc
+ ${CMAKE_CURRENT_LIST_DIR}/font
+ ${CMAKE_CURRENT_LIST_DIR}/font/mcufont/decoder
+ ${CMAKE_CURRENT_LIST_DIR}/VGLite/rtos
+ ${CMAKE_CURRENT_LIST_DIR}/VGLiteKernel
+ ${CMAKE_CURRENT_LIST_DIR}/VGLiteKernel/rtos
+)
+
+if(CONFIG_USE_COMPONENT_CONFIGURATION)
+ message("===>Import configuration from ${CMAKE_CURRENT_LIST_FILE}")
+
+ target_compile_definitions(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ -DVG_COMMAND_CALL=1
+ -DVG_TARGET_FAST_CLEAR=0
+ )
+
+endif()
+
diff --git a/bsp/sdk_overlay/middleware/vglite/middleware_vglite_elementary.cmake b/bsp/sdk_overlay/middleware/vglite/middleware_vglite_elementary.cmake
new file mode 100644
index 0000000..d4fb308
--- /dev/null
+++ b/bsp/sdk_overlay/middleware/vglite/middleware_vglite_elementary.cmake
@@ -0,0 +1,29 @@
+# Add set(CONFIG_USE_middleware_vglite_elementary true) in config.cmake to use this component
+
+include_guard(GLOBAL)
+message("${CMAKE_CURRENT_LIST_FILE} component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_draw.c
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_init.c
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_object.c
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_os.c
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src/elm_text.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/inc
+ ${CMAKE_CURRENT_LIST_DIR}/elementary/src
+)
+
+if(CONFIG_USE_COMPONENT_CONFIGURATION)
+ message("===>Import configuration from ${CMAKE_CURRENT_LIST_FILE}")
+
+ target_compile_definitions(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ -DVG_RENDER_TEXT=1
+ -DRTOS
+ )
+
+endif()
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CODEOWNERS b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CODEOWNERS
new file mode 100644
index 0000000..540b2ae
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CODEOWNERS
@@ -0,0 +1,39 @@
+# Each line is a file pattern followed by one or more owners.
+
+# These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence,
+# @global-owner1 and @global-owner2 will be requested for
+# review when someone opens a pull request.
+* @FreeRTOS/pr-bar-raiser
+
+# Order is important; the last matching pattern takes the most
+# precedence. When someone opens a pull request that only
+# modifies JS files, only @js-owner and not the global
+# owner(s) will be requested for a review.
+# *.c FreeRTOS/pr-bar-raiser
+
+# You can also use email addresses if you prefer. They'll be
+# used to look up users just like we do for commit author
+# emails.
+# *.go docs@example.com
+
+# In this example, @doctocat owns any files in the build/logs
+# directory at the root of the repository and any of its
+# subdirectories.
+# /build/logs/ @doctocat
+
+# The `docs/*` pattern will match files like
+# `docs/getting-started.md` but not further nested files like
+# `docs/build-app/troubleshooting.md`.
+# docs/* docs@example.com
+
+# In this example, @octocat owns any file in an apps directory
+# anywhere in your repository.
+# apps/ @octocat
+
+# In this example, @doctocat owns any file in the `/docs`
+# directory in the root of your repository and any of its
+# subdirectories.
+# /docs/ @doctocat
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CONTRIBUTING.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CONTRIBUTING.md
new file mode 100644
index 0000000..ec5d6e5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/CONTRIBUTING.md
@@ -0,0 +1,70 @@
+# Contribution guidelines
+
+Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, code, or
+documentation, we welcome our community to be involved in this project.
+
+Please read through this document before submitting any issues or pull requests to ensure we are able to help you and all members of the community as effectively as possible.
+
+## Code of conduct
+This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
+For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
+opensource-codeofconduct@amazon.com with any additional questions or comments.
+
+
+## Security issue notifications
+If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
+
+
+## Submitting a bugs/feature request
+Have a bug to report or feature to request? Follow these steps:
+1. Search on the [FreeRTOS Community Support Forums](https://forums.freertos.org/) and [GitHub issue tracker](https://github.com/FreeRTOS/FreeRTOS/issues?utf8=%E2%9C%93&q=is%3Aissue) to be sure this hasn't been already reported or discussed.
+2. If your search turns up empty, create a new topic in the [forums](https://forums.freertos.org/) and work with the community to help clarify issues or refine the idea. Include as many of the details listed below.
+3. Once the community has had time to discuss and digest, we welcome you to create an [issue](https://github.com/FreeRTOS/FreeRTOS/issues) to report bugs or suggest features.
+
+When creating a new topic on the forums or filing an issue, please include as many relevant details as possible. Examples include:
+
+* A clear description of the situation - what you observe, what you expect, and your view on how the two differ.
+* A reproducible test case or sequence of steps.
+* The version of our code being used.
+* Any modifications you've made relevant to the bug.
+* Details of your environment or deployment. Highlight anything unusual.
+
+
+## Contributing via pull request
+Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
+
+1. You are working against the latest source on the *main* branch.
+2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
+3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
+
+To send us a pull request, please:
+
+1. Fork the repository.
+2. Modify the source; focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
+3. Follow the [coding style guide](https://www.FreeRTOS.org/FreeRTOS-Coding-Standard-and-Style-Guide.html).
+4. Commit to your fork using clear commit messages.
+5. Send us a pull request, answering any default questions in the pull request interface.
+ NOTE: Please make sure the default option (Allow edits from maintainers) is left checked.
+6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
+
+GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
+[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
+
+## Coding style
+* Please ensure that your code complies to the [FreeRTOS coding style guidelines](https://www.FreeRTOS.org/FreeRTOS-Coding-Standard-and-Style-Guide.html).
+
+
+## Getting your pull request merged
+All pull requests must be approved by our review team before it can be merged in. We appreciate your patience while pull requests are reviewed. The time it takes to review will depend on complexity and consideration of wider implications.
+
+
+## Finding contributions to work on
+Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), tackling open 'help wanted' issues is a great place to start.
+
+
+## Licensing
+The FreeRTOS kernel is released under the MIT open source license, the text of which can be found [here](https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS/License/license.txt)
+
+Additional license files can be found in the folders containing any supplementary libraries licensed by their respective copyright owners where applicable.
+
+We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/bug-report.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/bug-report.md
new file mode 100644
index 0000000..96f3595
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/bug-report.md
@@ -0,0 +1,40 @@
+---
+name: Bug report
+about: Create a report to help us improve FreeRTOS. This should only be used for confirmed
+ bugs. If you suspect something it is best to first discuss it on the FreeRTOS community
+ support forums linked below.
+title: "[BUG]"
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+A concise description of what the bug is.
+
+**Target**
+- Development board: [e.g. HiFive11 RevB]
+- Instruction Set Architecture: [e.g. RV32IMAC]
+- IDE and version: [e.g. Freedom Studio 4.12.0.2019-08-2]
+- Toolchain and version: [e.g. riscv64-unknown-elf-gcc-8.3.0-2019.08.0]
+
+**Host**
+- Host OS: [e.g. MacOS]
+- Version: [e.g. Mojave 10.14.6]
+
+**To Reproduce**
+- Use project ... and configure with ...
+- Run on ... and could observe ...
+
+**Expected behavior**
+A concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Additional context**
+Add any other context about the problem here.
+e.g. code snippet to reproduce the issue.
+e.g. stack trace, memory dump, debugger log, and many etc.
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/config.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..55777b0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,6 @@
+blank_issues_enabled: false
+contact_links:
+ - name: FreeRTOS Community Support Forum
+ url: https://forums.freertos.org/
+ about: Please ask and answer questions about FreeRTOS here.
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/documentation-issue.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/documentation-issue.md
new file mode 100644
index 0000000..e5c1a19
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/documentation-issue.md
@@ -0,0 +1,23 @@
+---
+name: Documentation issue
+about: Create a report to help us improve our documentation.
+title: "[DOC]"
+labels: documentation
+assignees: ''
+
+---
+
+**Describe the issue**
+Please describe the issue and expected clarification in concise language.
+
+**Reference**
+Please attach the URL at which you are experiencing the issue.
+
+**Screenshot**
+If applicable, please attach screenshot.
+
+**Browser**
+- Browser: [e.g. Chrome]
+- Version: [e.g. 80.0.3987.132]
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/feature_request.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..645f684
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,30 @@
+---
+name: Feature request
+about: Suggest a new feature for this project
+title: "[Feature Request] "
+labels: enhancement
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**How many devices will this feature impact?**
+Expected volume for your product.
+
+**What are your project timelines?**
+Timeline for milestones such as design completion, testing and validation, and production.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
+
+
+If you have the same (or similar) feature request, please upvote this issue with thumbs up 👍
+and use the comments section to provide answers to the questions above.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/SECURITY.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/SECURITY.md
new file mode 100644
index 0000000..b4049f2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/SECURITY.md
@@ -0,0 +1,5 @@
+## Reporting a Vulnerability
+
+If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security
+via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com.
+Please do **not** create a public github issue.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/actions/url_verifier.sh b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/actions/url_verifier.sh
new file mode 100755
index 0000000..f92d2df
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/actions/url_verifier.sh
@@ -0,0 +1,63 @@
+#!/bin/bash -
+
+PROJECT=$1
+echo "Verifying url links of: ${PROJECT}"
+if [ ! -d "$PROJECT" ]
+then
+ echo "Directory passed does not exist"
+ exit 2
+fi
+
+USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36"
+SCRIPT_RET=0
+
+set -o nounset # Treat unset variables as an error
+
+declare -A dict
+
+function test {
+ while IFS= read -r LINE; do
+ FILE=$(echo $LINE | cut -f 1 -d ':')
+ URL=$(echo $LINE | grep -IoE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')
+
+ # remove trailing / if it exists curl diferenciate between links with
+ # and without / at the end
+ # URL=`echo "$URL" | sed 's,/$,,'`
+ dict+=(["$URL"]="$FILE ")
+ done < <(grep -e 'https\?://' ${PROJECT} -RIa --exclude='*.exe' --exclude-dir=.git | tr '*' ' ')
+
+ for UNIQ_URL in ${!dict[@]} # loop urls
+ do
+ CURL_RES=$(curl -si --user-agent "$(USER_AGENT)" ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ')
+ RES=$?
+
+ if [ "${CURL_RES}" == '' -o "${CURL_RES}" != '200' ]
+ then
+ echo "URL is: ${UNIQ_URL}"
+ echo "File names: ${dict[$UNIQ_URL]}"
+ if [ "${CURL_RES}" == '' ] # curl returned an error
+ then
+ CURL_RES=$RES
+ SCRIPT_RET=1
+ echo ERROR: Result is: "${CURL_RES}"
+ elif [ "${CURL_RES}" == '403' ]
+ then
+ SCRIPT_RET=1
+ echo ERROR: Result is: "${CURL_RES}"
+ else
+ echo WARNING: Result is: "${CURL_RES}"
+ fi
+ echo "================================="
+ fi
+ done
+
+ if [ "${SCRIPT_RET}" -eq 0 ]
+ then
+ exit 0
+ else
+ exit 1
+ fi
+}
+
+test
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/lexicon.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/lexicon.txt
new file mode 100644
index 0000000..6e04c24
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/lexicon.txt
@@ -0,0 +1,3104 @@
+aa
+aaaa
+aarch
+aasr
+ab
+abetrg
+abi
+abis
+abm
+absr
+abtsz
+abttyp
+ac
+acc
+accah
+accal
+accau
+accbh
+accbl
+accbu
+aclk
+acpa
+acpc
+acr
+adb
+adc
+addi
+addr
+adtrg
+aeevt
+aerr
+aes
+afunction
+aic
+aircr
+aka
+al
+almien
+almv
+alt
+altera
+amd
+amessage
+aninterrupthandler
+ansi
+api
+apic
+apis
+app
+appnote
+apr
+apsr
+arblst
+aren
+arg
+armcc
+armv
+arp
+asa
+ascii
+asm
+asmlanguage
+asr
+aswtrg
+asy
+async
+atask
+atmega
+atmel
+attr
+attrib
+aug
+autobaud
+avioid
+avr
+aws
+axi
+backchain
+backlight
+backlighttimer
+backtrace
+backtraces
+barry
+basepri
+basetype
+baudrate
+bb
+bbbb
+bc
+bcpb
+bcpc
+bcr
+beene
+beevt
+behaviour
+beq
+berr
+bex
+bfextu
+bgie
+bic
+bics
+bisr
+bitfields
+bitmask
+bitmasks
+bitscanreverse
+bk
+bl
+blocklink
+bmr
+bna
+bodien
+bodsts
+boff
+borland
+boston
+bp
+bpl
+br
+brd
+brgr
+brp
+bsp
+bspiy
+bsr
+bswtrg
+bt
+btmr
+btr
+bufferable
+bx
+cacheability
+cacheable
+caf
+calg
+callinc
+callout
+callouts
+callreturn
+callsv
+cambridge
+canen
+canrx
+cantx
+cas
+cbc
+cbmc
+cbz
+cc
+cccc
+cchar
+cchartotx
+ccnt
+ccntr
+ccount
+ccp
+ccpn
+ccr
+cdc
+cdr
+cdt
+cdty
+cdtyr
+ce
+cee
+ceo
+cerr
+cf
+cfb
+cfbs
+cfg
+cfgbaudratereg
+cfgchannel
+cfgcs
+cfgdirectdrive
+cfginput
+cfginputfilter
+cfgmainoscillatorreg
+cfgmainoscstartuptime
+cfgmckreg
+cfgmessageacceptancemaskreg
+cfgmessagectrl
+cfgmessagectrlreg
+cfgmessagedatahigh
+cfgmessagedatalow
+cfgmessageidreg
+cfgmessagemodereg
+cfgmode
+cfgmodereg
+cfgopendrain
+cfgoutput
+cfgpcs
+cfgperiph
+cfgpio
+cfgpmc
+cfgpullup
+cfgsysclkdisablereg
+cfgsysclkenablereg
+cfgtimings
+ch
+channelid
+chdiv
+chdr
+cher
+chid
+chmode
+christian
+chrl
+chsr
+cidr
+cin
+cisr
+ckdiv
+ckey
+ckg
+ckgr
+cki
+cklo
+cko
+ckps
+cks
+cldiv
+clearalarmint
+clearit
+clearoutput
+clearrttincint
+cledtoflash
+clib
+clint
+clk
+clka
+clkb
+clkdis
+clken
+clki
+clkp
+clks
+clksta
+clkx
+closk
+clr
+clrstat
+cmcon
+cmd
+cmp
+cmr
+cmsis
+cmt
+cnte
+co
+coalescences
+codan
+codr
+col
+coldfire
+com
+comm
+comp
+compiletime
+compsel
+computefmcn
+conbits
+cond
+confg
+config
+configapic
+configapplication
+configassert
+configbenchmark
+configcall
+configcheck
+configclear
+configclint
+configcpu
+configdata
+configdbg
+configenable
+configenforce
+configgenerate
+configidle
+configinclude
+configinstall
+configinterrupt
+configinttimer
+configisr
+configkernel
+configlist
+configmax
+configmemmodel
+configminimal
+configmtime
+configmtimecmp
+confignum
+configoverride
+configpre
+configprecondition
+configprintf
+configqueue
+configrecord
+configrun
+configsetup
+configstack
+configsupport
+configtask
+configtick
+configtimer
+configtotal
+configunique
+configurator
+configureit
+configuse
+configxt
+configyield
+const
+coproc
+coprocessor
+coprocessors
+coreid
+coroutinehandle
+covfs
+cp
+cpacr
+cpas
+cpbs
+cpcdis
+cpcs
+cpcstop
+cpctrg
+cpd
+cpenable
+cpiv
+cpol
+cpp
+cprd
+cprdr
+cpre
+cprivilegedonlyaccessarray
+cpsid
+cpsie
+cpsr
+cpstored
+cpu
+cr
+crc
+crcb
+crcoroutine
+crdelay
+creadonlyarray
+creadwritearray
+createevent
+crend
+crgint
+croutine
+crqueue
+crstart
+crt
+crtv
+crxedchar
+crxlock
+csa
+csaat
+csas
+cse
+csl
+csr
+csrr
+csrs
+css
+cstackbuffer
+cstart
+cstatus
+ctaskwokenbypost
+ctaskwokenbyreceive
+ctcr
+ctor
+ctr
+ctrl
+cts
+ctsic
+ctx
+ctxlock
+ctype
+cupd
+cupdr
+cv
+cvaluetopost
+cvs
+cwgr
+cx
+cy
+cygnal
+dadr
+daemontaskmessage
+daif
+dat
+datar
+datas
+datasheet
+dataw
+datdef
+datlen
+datnb
+datproc
+datrdy
+dbgu
+dc
+dcd
+dcdic
+dcmr
+dcount
+dcr
+dddd
+de
+decnt
+deedmed
+defaulthandler
+defgroup
+denormal
+des
+devblogs
+di
+didn
+dir
+directdrive
+disablecan
+disablechannel
+disableep
+disableit
+disablemainoscillator
+disablepck
+disableperiphclock
+disablerx
+disabletx
+div
+divb
+dlybcs
+dlybct
+dlybs
+dma
+dmb
+docount
+doendh
+doendl
+doesn
+dohigh
+dolow
+dont
+dostarth
+dostartl
+downgrowing
+doxygen
+dpfpu
+dph
+dpl
+dplb
+dpr
+dpsw
+dptr
+dr
+drdy
+drfcs
+drived
+drpt
+drxd
+ds
+dsb
+dsnack
+dsp
+dspcontrol
+dspic
+dsr
+dsric
+dsync
+dtb
+dtf
+dtgle
+dtr
+dtrdis
+dtren
+dtxd
+dx
+dxt
+eabi
+eabortsleep
+eacces
+eaction
+eaddrinuse
+eaddrnotavail
+eae
+eagain
+ealready
+eax
+ebade
+ebadf
+eblocked
+ebook
+ebp
+ebusy
+ebx
+ec
+ecanceled
+ecb
+ecol
+ecr
+ecrs
+ecrsdv
+ecurrentstate
+edc
+edeleted
+edi
+eds
+edx
+ee
+eeee
+eevt
+eevtedg
+eexist
+ef
+efault
+efc
+effecti
+eflags
+efrhd
+eftype
+eg
+eic
+eilseq
+eincrement
+eind
+einprogress
+eintr
+einval
+einvalid
+eio
+eisconn
+eisdir
+ele
+elif
+emac
+emacb
+emaclite
+embarc
+emdc
+emdio
+empted
+emption
+emptive
+en
+ena
+enablecan
+enablechannel
+enableep
+enableit
+enablemainoscillator
+enablepck
+enableperiphclock
+enablerx
+enabletx
+enametoolong
+endbusres
+endcode
+endian
+endif
+endinit
+endint
+endrx
+endtx
+endverbatim
+enetrg
+enmfile
+enoaction
+enobufs
+enodev
+enoent
+enomedium
+enomem
+enoprotoopt
+enospc
+enotaskswaitingtimeout
+enotconn
+enotdir
+enotempty
+enotifyaction
+enotwaitingnotification
+entrypoint
+enums
+enxio
+eoc
+eoi
+eoicr
+eopnotsupp
+ep
+epage
+epc
+epclear
+epeds
+ependofwr
+epint
+epread
+epset
+epstall
+epstatus
+eptype
+epwrite
+eq
+eqif
+eqmk
+er
+eready
+erefck
+erl
+erofs
+erra
+errno
+errp
+errqueue
+erstl
+erunning
+erx
+erxck
+erxdv
+erxer
+esetbits
+esetvaluewithoutoverwrite
+esetvaluewithoverwrite
+esi
+esp
+espeche
+espipe
+espressif
+esr
+estandardsleep
+esuspended
+etaskconfirmsleepmodestatus
+etaskgetstate
+etaskstate
+ethernet
+etimedout
+etrcs
+etrgedg
+etrgs
+etx
+etxck
+etxen
+etxer
+eunatch
+europe
+eventbits
+eventclear
+eventgroup
+eventgrouphandle
+eventunblocked
+evt
+ewavr
+ewouldblock
+exc
+exccause
+excm
+exdev
+exid
+exl
+ext
+extrsm
+extrst
+fadd
+fadden
+faddr
+faq
+faqhelp
+favour
+fc
+fcmd
+fcr
+fcs
+fcse
+fcx
+fd
+fdiv
+fdr
+feb
+fedc
+ferr
+ff
+ffdr
+ffer
+fff
+ffff
+ffffff
+ffsr
+fful
+fi
+fidi
+fifo
+fina
+fiq
+fiqhandler
+firq
+fixme
+flashlite
+fmcn
+fmr
+fn
+fnsave
+fntr
+forceoutput
+forcestall
+fp
+fpccr
+fpga
+fpi
+fpr
+fpscr
+fpsr
+fpsw
+fpu
+fpul
+fputs
+frameless
+framepointer
+frdy
+freertos
+freertosconfig
+freertosintro
+freq
+fri
+frm
+frmsz
+fromisr
+fron
+frxt
+fsave
+fsden
+fsedge
+fsl
+fslen
+fsos
+fsr
+fto
+fujitsu
+functionname
+functionparameter
+functionpointers
+fvr
+fws
+fx
+gbr
+gc
+gcacc
+gcc
+gdb
+genration
+gens
+getalarmvalue
+getbaudrate
+getcfgpullup
+getchannelstatus
+getchar
+getconverteddatach
+geterrorcounter
+getfamilyid
+getinput
+getinputfilterstatus
+getinternalcounter
+getinterruptmaskstatus
+getinterruptstatus
+getlastconverteddata
+getmainclock
+getmainclockfreqreg
+getmainoscillatorreg
+getmasterclock
+getmckreg
+getmessageacceptancemaskreg
+getmessagedatahigh
+getmessagedatalow
+getmessageidreg
+getmessagemodereg
+getmessagestatus
+getmodereg
+getmultidriverstatus
+getoutputdata
+getoutputdatastatus
+getoutputstatus
+getoutputwritestatus
+getperiphclock
+getstate
+getstatus
+getsysclkstatusreg
+gettimestamp
+gic
+gics
+girq
+girqn
+github
+gl
+glb
+glbstate
+gm
+gmbh
+gmsk
+gnuc
+govre
+gp
+gpio
+gpl
+gpnvm
+gpta
+gre
+hackery
+hal
+hardwware
+hartid
+hclk
+hcs
+heapregion
+heapregions
+heapstats
+heep
+hl
+hrb
+hresp
+hrt
+html
+http
+https
+hw
+hwhsh
+hword
+hz
+iadr
+iadrsz
+iar
+ic
+iccarm
+iccbpr
+iccpmr
+iccr
+icerst
+icr
+icsr
+idataxr
+idcr
+idf
+idr
+idt
+idva
+idvb
+ie
+iecr
+ier
+ifdef
+ifdr
+ifer
+iff
+iflash
+ifndef
+ifsr
+ilm
+impl
+imr
+inack
+inb
+inc
+incstat
+indata
+ingroup
+init
+initabortrequest
+initialisation
+initialise
+initialised
+initialises
+initialising
+initmailboxregisters
+inittransferrequest
+initvector
+inlined
+inputdata
+inputenable
+inputfilter
+inputfilterdisable
+inputfilterenable
+inpw
+instate
+int
+intc
+intcon
+inte
+interrpts
+interruptcall
+interruptdisable
+interruptee
+interruptenable
+interruptnesting
+interruptpriorities
+interruptsources
+interruptstatus
+interwork
+intexc
+intfrcl
+inti
+intit
+intlevel
+intno
+intr
+inttm
+io
+iodefine
+ip
+ipl
+iplb
+ipr
+ipsr
+ir
+irda
+iret
+irq
+irqhandler
+irqs
+irxfcs
+isa
+isab
+isactive
+isb
+iscfgpullupstatusset
+iscr
+isfeasible
+isinputfilterset
+isinputset
+isinterruptmasked
+isinterruptset
+ismultidriverset
+isnextrxempty
+isnexttxempty
+iso
+isoerror
+isouputset
+isoutputdatastatusset
+isoutputset
+isoutputwriteset
+ispending
+isr
+isram
+isrcode
+isrs
+isrtick
+isrxempty
+isset
+isstatusset
+istxempty
+iter
+itmc
+itu
+ivr
+ivxr
+jan
+javier
+jefferson
+jframe
+jtag
+jtvic
+jul
+jun
+kbyte
+kbytes
+keil
+keymod
+keywxr
+khz
+konw
+ky
+lan
+lapic
+larrayindex
+lastxfer
+lcd
+lcdr
+lcol
+lcx
+lcycles
+ld
+ldaa
+ldata
+ldbdis
+ldbstop
+ldd
+ldflags
+ldm
+ldmia
+ldr
+ldra
+ldras
+ldrb
+ldrbs
+ldub
+len
+les
+lexpirecounters
+libc
+linkedlist
+linkr
+listcurrent
+listfirst
+listget
+listintroduction
+listis
+listitem
+listlist
+listsecond
+listset
+llb
+llio
+lly
+loadcontext
+loadnewseed
+loadseed
+locke
+locopt
+locoptsize
+lod
+loopback
+lovrs
+lowpowermode
+lowres
+lowtext
+lpm
+lpstart
+lr
+lsls
+lspen
+lspens
+ltd
+lu
+lw
+mabt
+mac
+mach
+macl
+macr
+mag
+mainclock
+mainf
+mainrdy
+mair
+malloc
+mam
+mame
+maskable
+maxlocoptsize
+mbits
+mc
+mcf
+mcfr
+mchp
+mck
+mcka
+mckb
+mckr
+mckrdy
+mclk
+mconfigintcoresw
+mcr
+mcu
+mddr
+mder
+mdh
+mdio
+mdl
+mdlc
+mdsr
+mec
+mem
+memcpy
+memmang
+memoryregion
+memset
+messagebuffer
+messagebufferamp
+messagebufferhandle
+messagebuffermanagement
+messsage
+mfcr
+mfd
+mfid
+mhz
+microblaze
+microcontroller
+microelectronics
+microsoft
+microsystems
+mide
+midva
+midvb
+mie
+mii
+mikroc
+min
+mingw
+minilistitem
+mips
+misadd
+misc
+misconfiguration
+miso
+misra
+mit
+mmcr
+mmi
+mmr
+mmu
+mno
+modereg
+moderegister
+modf
+modfdis
+mon
+mor
+mosc
+moscen
+moscs
+mosi
+mot
+motorola
+mov
+moveq
+movff
+movhi
+movne
+movs
+movw
+mpe
+mplab
+mpu
+mpuregionsettings
+mr
+mrdy
+mread
+mrs
+mrtr
+msb
+msbf
+msc
+msdis
+msen
+msp
+mspgcc
+msr
+mst
+mstr
+msvc
+mtcr
+mti
+mtime
+mtimecmp
+mtimemark
+mtimestamp
+mtioa
+mtiob
+mtvec
+mul
+muldiv
+multidriver
+multidriverdisable
+multidriverenable
+multidrvenable
+mutex
+mutexes
+mux
+muxes
+mv
+mve
+mvfaclo
+mvtacgu
+mvtachi
+mvtaclo
+mvtc
+mw
+mx
+myfunction
+myprintfunction
+myvariable
+mz
+nack
+nadler
+nand
+nanded
+nb
+nbc
+nbstop
+ncfgr
+ncpha
+ncr
+nebp
+ner
+newhandler
+newlib
+newlibandfreertos
+nfiq
+ngnre
+ngnrne
+ngre
+nios
+nirq
+nmi
+noblock
+nomatter
+noninfringement
+nonsecure
+noop
+nosavereg
+nostdint
+nov
+npcs
+nrst
+nrstl
+ns
+nsr
+nssr
+ntrst
+num
+nvic
+nvm
+nw
+ocr
+oct
+odataxr
+odr
+odsr
+oer
+ofb
+ok
+oldhandler
+oldnewthing
+oldvector
+op
+opb
+openocd
+openrtos
+opmod
+ops
+optimisation
+optimisations
+optimised
+ored
+org
+orr
+orrs
+os
+osc
+oscbypass
+oscen
+oscount
+osr
+othercoreid
+othewise
+outb
+outputdisable
+outputenable
+outputwrite
+outputwritedisable
+outputwriteenable
+overheadpage
+overheadstorage
+ovl
+ovly
+ovr
+ovre
+ovres
+ovrun
+owdr
+ower
+owsr
+padc
+pae
+paes
+pagen
+paic
+param
+partref
+pb
+pbuffer
+pc
+pcan
+pcb
+pcdr
+pcer
+pcformat
+pchead
+pck
+pckgr
+pckr
+pclath
+pclatu
+pclk
+pcname
+pcnametoquery
+pcp
+pcqueuegetname
+pcqueuename
+pcreadfrom
+pcreturn
+pcrxedmessage
+pcs
+pcsdec
+pcsr
+pcstringtosend
+pctail
+pctaskgethandle
+pctaskgetname
+pctaskname
+pctimergetname
+pctimername
+pcwritebuffer
+pcwriteto
+pcx
+pcxi
+pdbgu
+pdc
+pdfail
+pdfalse
+pdfreertos
+pdms
+pdpass
+pdr
+pdsr
+pdtrue
+pe
+peformed
+pendedfunction
+pendsv
+perf
+performcmd
+periph
+periphaenable
+periphbenable
+periphids
+perrst
+pfr
+pfre
+philips
+phy
+phya
+pic
+picnt
+pien
+piir
+pimr
+pio
+pioa
+piob
+pioenable
+pisr
+pitc
+pitdisableint
+piten
+pitenableint
+pitgetmode
+pitgetpiir
+pitgetpivr
+pitgetstatus
+pitien
+pitinit
+pitsetpiv
+piv
+pivr
+pl
+pll
+pllb
+pllcount
+plldivider
+pllmultiplier
+pllr
+pls
+pm
+pmc
+pmu
+pnextbuffer
+pong
+popa
+popm
+portallocate
+portalt
+portasm
+portasmadditional
+portassert
+portbase
+portbenchmark
+portbit
+portbyte
+portccpn
+portclear
+portcompiler
+portconfigure
+portcopy
+portcpacr
+portcpu
+portcritical
+portcsa
+portcu
+portdelete
+portdisable
+portdont
+porten
+portenable
+portenter
+portexit
+portexpected
+portforce
+portfpccr
+portfr
+portfreertos
+portget
+portglobal
+porthardware
+porthas
+portinital
+portinitial
+portinput
+portinstruction
+portipl
+portisr
+portitu
+portkernel
+portmacro
+portmax
+portminimal
+portmpu
+portmux
+portmx
+portno
+portnop
+portnum
+portnvic
+portpointer
+portpre
+portpreload
+portprivilege
+portpsw
+portreset
+portrestore
+portsave
+portscheduler
+portset
+portsofrware
+portstack
+portstart
+portsupporess
+portsuppress
+portsvc
+portswitch
+portsystem
+porttask
+porttick
+porttickisr
+porttimer
+porttotal
+porttrace
+porttracestamp
+porttrap
+portuse
+portusing
+portword
+portyield
+posix
+powerup
+ppage
+ppc
+ppdc
+ppio
+ppitc
+ppmc
+ppudr
+ppuer
+ppusr
+ppvdestination
+ppwm
+ppxidletaskstackbuffer
+ppxidletasktcbbuffer
+ppxtimertaskstackbuffer
+ppxtimertasktcbbuffer
+pr
+pragma
+pre
+prea
+preb
+preemtion
+preinc
+pres
+prescal
+prescalar
+prescale
+prescaled
+prescaler
+prid
+primask
+printf
+prio
+prioritised
+proc
+procdly
+procrst
+procs
+prodh
+prodl
+prog
+proge
+programmation
+projdefs
+propag
+prot
+protectmode
+proto
+prstc
+prttc
+prv
+prvaddcurrenttasktodelayedlist
+prvcheckinterfaces
+prvchecktaskswaitingtermination
+prvcopydatatoqueue
+prvcoroutineflashtask
+prvcoroutineflashworktask
+prvdeletetcb
+prvexitfunction
+prvgettimens
+prvheapinit
+prvidletask
+prvinitialisecoroutinelists
+prvinitialisemutex
+prvinitialisenewstreambuffer
+prvinitialisenewtimer
+prvinsertblockintofreelist
+prvlockqueue
+prvnotifyqueuesetcontainer
+prvportmalloc
+prvportresetpic
+prvprocesssimulatedinterrupts
+prvreadbytesfrombuffer
+prvsampletimenow
+prvsettickfrequencydefault
+prvsetupfpu
+prvsetupmpu
+prvsetuptimerinterrupt
+prvsleep
+prvstarttimens
+prvtaskexiterror
+prvtickcount
+prvtimercallback
+prvwritebytestobuffer
+prvwritemessagetobuffer
+prvyieldhandler
+ps
+psp
+pspi
+psplim
+psr
+pssc
+pstdby
+psw
+ptc
+ptcr
+ptdes
+pte
+pthread
+pthreads
+ptr
+ptsr
+ptwi
+ptz
+pucallocatedmemory
+pucbuffer
+puccurrentstackpointer
+pucdata
+pucmessagebufferstoragearea
+pucporttaskfpucontextbuffer
+pucqueuestorage
+pucqueuestoragebuffer
+pucstacklimit
+pucstackstart
+pucstartaddress
+pucstreambufferstoragearea
+pudp
+puladdend
+pulcallerstackaddress
+puldestination
+pulidletaskstacksize
+pullowercsa
+pullup
+pullupenable
+pulnotificationvalue
+pulparam
+pulpino
+pulpreviousnotificationvalue
+pulpreviousnotifyvalue
+pultcb
+pultimehigh
+pultimertaskstacksize
+pultotalruntime
+puluppercsa
+puon
+pusart
+pusha
+putchar
+puxstackbuffer
+puxvariabletoincrement
+pv
+pvbuffer
+pvcallbackref
+pvcomparand
+pvcontainer
+pvcreatedtask
+pvector
+pveventgroup
+pvexchange
+pvinterruptevent
+pvinterrupteventmutex
+pvitemtoqueue
+pvnewid
+pvowner
+pvparameter
+pvparameters
+pvportmalloc
+pvportmallocstack
+pvportrealloc
+pvreg
+pvrxdata
+pvtaskcode
+pvthread
+pvtimergettimerid
+pvtimerid
+pvtxdata
+pvvalue
+pvyieldevent
+pwdtc
+pwm
+pwmc
+pxblock
+pxblocktoinsert
+pxcallbackfunction
+pxcode
+pxcontainer
+pxcoroutinecode
+pxcoroutinewoken
+pxcrcb
+pxcreatedtask
+pxcurrentcoroutine
+pxcurrenttcb
+pxcurrenttcbconst
+pxcurrenttimerlist
+pxdelayedcoroutinelist
+pxdelayedtasklist
+pxend
+pxendofstack
+pxeventbits
+pxeventgroupbuffer
+pxeventlist
+pxeventlistitem
+pxfirsttcb
+pxhandler
+pxhead
+pxheapregions
+pxhigherprioritytaskwoken
+pxhookfunction
+pxidletasktcbbuffer
+pxindex
+pxitem
+pxiterator
+pxlist
+pxlistend
+pxlistitem
+pxlistwasempty
+pxmessage
+pxmutexbuffer
+pxmutexholder
+pxmutexholdertcb
+pxnewlistitem
+pxnewqueue
+pxnewtcb
+pxnewtimer
+pxnext
+pxnextfreeblock
+pxnexttcb
+pxoriginalsp
+pxoriginaltos
+pxoverflowdelayedcoroutinelist
+pxoverflowdelayedtasklist
+pxowner
+pxportinitialisestack
+pxprevious
+pxpreviouswaketime
+pxqueue
+pxqueuebuffer
+pxqueuesetcontainer
+pxramstack
+pxreadycoroutinelists
+pxreadytaskslists
+pxreceivecompletedcallback
+pxregions
+pxresult
+pxrxedmessage
+pxsemaphorebuffer
+pxsendcompletedcallback
+pxstack
+pxstackbase
+pxstackbuffer
+pxstaticmessagebuffer
+pxstaticqueue
+pxstaticstreambuffer
+pxstreambuffer
+pxstreambuffercreate
+pxstreambuffercreatestatic
+pxtagvalue
+pxtask
+pxtaskbuffer
+pxtaskcode
+pxtaskdefinition
+pxtaskin
+pxtaskstatus
+pxtaskstatusarray
+pxtasktag
+pxtasktodelete
+pxtasktoresume
+pxtasktosuspend
+pxtaskwoken
+pxtcb
+pxtcbofmutexholder
+pxthreadstate
+pxtickstowait
+pxtimeout
+pxtimer
+pxtimerbuffer
+pxtimerlistswereswitched
+pxtopofstack
+pxuartinstance
+pxunblockedtcb
+pxxramstack
+queuedefinition
+queuehandle
+queuemanagement
+queuepointers
+queuequeue
+queueregistryitem
+queuesend
+queueset
+queuesethandle
+queuesetmemberhandle
+queueunlocked
+ra
+ramarea
+rampz
+rasr
+rb
+rbar
+rbof
+rbqp
+rbsy
+rc
+rcb
+rcmr
+rcomp
+rcount
+rcr
+rdc
+rdr
+rdrf
+rdy
+readbit
+readme
+readvalue
+realise
+realloc
+rec
+receiveframe
+recognise
+recognised
+reent
+refcount
+reg
+rega
+regieters
+registerr
+registerselection
+registerset
+registerstatus
+regs
+regsiter
+reld
+repurpose
+reqflg
+resetep
+resetrx
+resettx
+ressetting
+ret
+reti
+rets
+retto
+revref
+rf
+rfe
+rfmr
+rhr
+ri
+richard
+riic
+ripl
+risc
+rja
+rk
+rl
+rlar
+rlce
+rle
+rles
+rlex
+rlt
+rm
+rmc
+rmii
+rmr
+rmwupe
+rncr
+rnpr
+rnr
+ro
+rom
+rousset
+rov
+rovr
+rp
+rpcs
+rpr
+rre
+rse
+rshr
+rslcx
+rsminpr
+rsr
+rst
+rstc
+rstep
+rstgetmode
+rstgetstatus
+rstissoftrstactive
+rstit
+rstnack
+rstrx
+rstsetmode
+rstsoftreset
+rststa
+rsttx
+rsttyp
+rsvd
+rtar
+rtc
+rte
+rti
+rtictl
+rtie
+rtifrc
+rtmr
+rtor
+rtos
+rtpres
+rts
+rtsdis
+rtsen
+rtsr
+rtt
+rttc
+rttclearalarmint
+rttclearrttincint
+rttgetalarmvalue
+rttgetstatus
+rttinc
+rttincien
+rttreadvalue
+rttrestart
+rttrst
+rttsetalarmint
+rttsetalarmvalue
+rttsetprescaler
+rttsetrttincint
+rttsettimebase
+rtvr
+rty
+rv
+rw
+rx
+rxbrk
+rxbuff
+rxbytecnt
+rxd
+rxdis
+rxen
+rxena
+rxoverwrite
+rxrdy
+rxready
+rxrsm
+rxsetup
+rxsusp
+rxsyn
+rxtdis
+rxten
+rxubr
+rxv
+sa
+sadr
+safertos
+sam
+saveall
+sbbytes
+sbflags
+sbreceive
+sbrk
+sbsend
+scall
+scb
+scbr
+scdr
+scer
+scf
+schedulercontrol
+sck
+scople
+scratchspace
+scsr
+sda
+sec
+secureconfiguse
+securecontext
+securecontextno
+secureinitfpccr
+secureinitnsacr
+secureinitscb
+seg
+sel
+semaphoredata
+semaphorehandle
+semphr
+senda
+sendframe
+serr
+setaddress
+setalarmint
+setalarmvalue
+setbaudrate
+setcryptokey
+setexceptionvector
+setinitializationvector
+setirdafilter
+setnextrx
+setnexttx
+setoutput
+setprioritygrouping
+setrtt
+setrttincint
+setrx
+setstate
+settimeguard
+settx
+sfr
+shtim
+si
+sig
+sigalrm
+sigalrms
+sigint
+sigmask
+signalled
+sigwait
+sil
+sizeof
+slowclock
+smod
+smp
+smr
+snprintf
+sodr
+sof
+sofint
+softregs
+softreset
+sp
+spck
+spd
+spdx
+sph
+spi
+spidis
+spien
+spiens
+spinlock
+spinlocks
+spiram
+spl
+sprintf
+spsr
+spu
+spurioushandler
+sqe
+sr
+sram
+src
+srcmp
+srctype
+srl
+srr
+ssc
+ssemaphoretake
+staa
+stackpointer
+stacksize
+stackspace
+stacktype
+startchannel
+startconversion
+startprocessing
+stat
+staticdont
+staticeventgroup
+staticmessagebuffer
+staticqueue
+staticsemaphore
+staticstreambuffer
+statictask
+statictimer
+stb
+std
+stdarg
+stderr
+stdin
+stdint
+stdout
+ste
+stk
+stm
+stmdb
+stmia
+stmicroelectronics
+stopchannel
+stpbrk
+str
+streambuffer
+streambufferdef
+streambufferhandle
+streambuffermanagement
+strlen
+struct
+sttbrk
+sttdly
+sttout
+sttto
+subkey
+sublicense
+supervisorcall
+susingpreemption
+suspendthread
+svacc
+svc
+svcne
+svdis
+sven
+svmst
+svr
+svread
+sw
+swhsh
+swi
+swinr
+swintr
+swrst
+swtich
+swtrg
+sxx
+synchro
+synchronisation
+synchronise
+synopsys
+sys
+sysc
+syscall
+syscalls
+syscon
+syst
+systemclock
+systick
+sysview
+sz
+szbuffer
+sznextbuffer
+tablat
+taskcode
+taskctrl
+taskdisable
+taskenable
+taskenter
+taskevent
+taskexit
+taskfunction
+taskhandle
+taskhookfunction
+tasknot
+tasknotifications
+taskparameters
+taskrecord
+taskreset
+taskscheduler
+taskselect
+taskstamp
+taskstampcount
+taskstatus
+taskutils
+taskyield
+tblpag
+tblptrh
+tblptrl
+tblptru
+tblptruh
+tblptrul
+tbqp
+tbr
+tbsy
+tc
+tcb
+tcbs
+tcclks
+tclk
+tcmr
+tcomp
+tcp
+tcr
+td
+tdes
+tdesmod
+tdr
+tdre
+te
+tec
+tempdata
+tempregister
+teof
+terminatethread
+tex
+tf
+tfmr
+tgo
+thalt
+therad
+thr
+threadstate
+thu
+tiao
+tickless
+tickrate
+tickrates
+ticktype
+ticsk
+tid
+tim
+timebase
+timebeginperiod
+timeendperiod
+timeguard
+timemark
+timercallbackfunction
+timerhandle
+timeslice
+timesliced
+timestp
+timfrz
+timrst
+tioa
+tiob
+tk
+tls
+tm
+tmcsr
+tmm
+tmp
+tmpdata
+tmr
+tmrctr
+tmrfirst
+tmrno
+tmrtimercontrol
+tncr
+tnpr
+tod
+todo
+toolchain
+tos
+tosh
+tosl
+tosu
+tovf
+tpcs
+tpf
+tpfr
+tpq
+tpr
+tpu
+traceevent
+transfert
+transmikt
+trapa
+tregister
+trg
+trgen
+trgsel
+tricore
+trmtimer
+trustzone
+tshr
+tskidle
+tskset
+tskstatic
+tsktaskcontrolblock
+tsktcb
+tsr
+tst
+tstart
+tstp
+ttgr
+ttm
+tue
+tund
+tundr
+tv
+twck
+twd
+twi
+tx
+txbufe
+txcomp
+txd
+txdis
+txempty
+txen
+txena
+txerr
+txpktrdy
+txrdy
+txready
+txsyn
+txtdis
+txten
+txubr
+txvc
+txvdis
+typedefed
+tzq
+uart
+uartlite
+ubasetype
+ubr
+uc
+ucarraytosend
+ucbufferstorage
+uccritialnesting
+uccriticalnesting
+ucdata
+ucdelayaborted
+ucflags
+ucforcedinterruptflags
+ucheap
+ucinterruptid
+uclocaltickcount
+ucmaxpriorityvalue
+ucmessageid
+ucnotifystate
+ucnotifyvalue
+uconekbyte
+ucparametertopass
+ucqueuestorage
+ucqueuetype
+ucrxdata
+ucstaticallyallocated
+ucstatictimerqueuestorage
+ucstatus
+ucstoragebuffer
+uctasksdeleted
+uctempfpubuffer
+uczero
+udp
+uf
+uint
+ul
+uladdress
+ulapsr
+ulavariable
+ulbitstoclear
+ulbitstoclearonentry
+ulbitstoclearonexit
+ulbitstoset
+ulcomparand
+ulcount
+ulcriticalnesting
+ulcurrentinterrupt
+ulcycles
+uldummy
+ulexchange
+ulhartid
+ulicr
+ulinterruptmask
+ulinterruptnesting
+ulistaskprivileged
+ull
+ullcriticalnesting
+ullnexttime
+ullporttaskhasfpucontext
+ulmair
+ulmask
+ulmatchvalueforonetick
+ulnumberofheapallocations
+ulnumberofheapfrees
+ulong
+ulparameter
+ulparameters
+ulpendinginterrupts
+ulporttaskhasdpfpucontext
+ulporttaskhasfpucontext
+ulportyieldpending
+ulr
+ulrbar
+ulreg
+ulreload
+ulreloadvalue
+ulreturnvalue
+ulrlar
+ulruntimecounter
+ulsecurestacksize
+ulsetinterruptmask
+ulstackdepth
+ulstatsaspercentage
+ulstoppedtimercompensation
+ultablebase
+ultaskgetidleruntimecounter
+ultaskgetidleruntimepercent
+ultaskhasfpucontext
+ultasknotifystateclear
+ultasknotifytake
+ultasknotifytakeindexed
+ultasknotifyvalueclear
+ultasknotifyvalueclearindexed
+ultaskswitchedintime
+ultaskswitchrequested
+ultotalmemoryallocations
+ultotalmemoryfrees
+ultotalruntime
+ultotalruntimediv
+ulusingfpu
+ulvalreceived
+ulvalue
+ulvar
+ulvartosend
+un
+und
+undadd
+undef
+underrun
+unhandled
+uni
+unicast
+unicore
+unre
+unsuspend
+updatechannel
+updown
+uppercontext
+upto
+urad
+urat
+uri
+ursten
+urstien
+ursts
+usa
+usart
+usb
+usbdiv
+usclockhz
+uscriticalnesting
+uselib
+usf
+usisrhigh
+usisrlow
+usmode
+usp
+usportcheckfreestackspace
+usprg
+usrio
+ussegmentselector
+usstackdepth
+usstackhighwatermark
+ut
+utf
+utilised
+utilises
+uxarraysize
+uxbasepriority
+uxbits
+uxbitstoclear
+uxbitstoset
+uxbitstowait
+uxbitstowaitfor
+uxcontrolbits
+uxcriticalnesting
+uxcurrenteventbits
+uxcurrentnumberoftasks
+uxcurrentpriority
+uxdeletedtaskswaitingcleanup
+uxeventgroupnumber
+uxeventqueuelength
+uxflashrates
+uxhandle
+uxhigherpriorityreadytasks
+uxindex
+uxindextoclear
+uxindextonotify
+uxindextowaiton
+uxinheritedpriority
+uxinitialcount
+uxitemsize
+uxitemssize
+uxledtoflash
+uxlength
+uxlistremove
+uxmaxcount
+uxmessageswaiting
+uxnewpriority
+uxoriginalpriority
+uxportcomparesetextram
+uxpriority
+uxprioritytouse
+uxqueue
+uxqueuelength
+uxqueuemessageswaiting
+uxqueuespacesavailable
+uxqueuetype
+uxreceived
+uxrecursivecallcount
+uxreturn
+uxsavedmaskvalue
+uxsavedtaskstackpointer
+uxschedulersuspended
+uxsemaphoregetcount
+uxsemaphoregetcountfromisr
+uxstate
+uxstreambuffernumber
+uxtaskgetnumberoftasks
+uxtaskgetstackhighwatermark
+uxtaskgetsystemstate
+uxtaskgettasknumber
+uxtasknumber
+uxtaskpriorityget
+uxtaskprioritygetfromisr
+uxtcbnumber
+uxtimergetreloadmode
+uxtimerincrementsforonetick
+uxtimernumber
+uxtopreadypriority
+uxtopusedpriority
+uxvariabletoincrement
+uxwantedbytes
+vacoroutine
+vadifferenttask
+vafunction
+val
+vanexampleinterruptserviceroutine
+vaninterrupthandler
+vaninterruptserviceroutine
+vanisr
+vanothertask
+vapplicationcleartimerinterrupt
+vapplicationexceptionregisterdump
+vapplicationfpusafeirqhandler
+vapplicationgetidletaskmemory
+vapplicationgettimertaskmemory
+vapplicationidlehook
+vapplicationirqhandler
+vapplicationmallocfailedhook
+vapplicationsetuptickinterrupt
+vapplicationsetupticktimerinterrupt
+vapplicationsetuptimerinterrupt
+vapplicationstackoverflowhook
+vapplicationtickhook
+var
+vatask
+vbacklighttimercallback
+vbr
+vbufferisr
+vcallbackfunction
+vclearinterruptmask
+vcoroutineschedule
+vddcore
+vec
+vectactive
+vega
+vely
+ver
+veventgroupclearbitscallback
+veventgroupdelete
+veventgroupsetbitscallback
+vflashcoroutine
+vfp
+vfunction
+vic
+vicvectaddr
+visr
+vkeypresseventhandler
+vkeypresseventinterrupthandler
+vldmia
+vldmiaeq
+vlistinitialise
+vlistinitialiseitem
+vlistinsert
+vlistinsertend
+vlisttask
+vmessagebufferdelete
+vnonpreemptivetick
+votherfunction
+voutputcharacter
+vpartesttoggleled
+vportallocatesecurecontext
+vportcloserunningthread
+vportcpuacquiremutex
+vportcpuacquiremutexintsdisabled
+vportcpuacquiremutexintsdisabledextram
+vportcpuacquiremutexintsdisabledinternal
+vportcpuacquiremutextimeout
+vportcpureleasemutex
+vportcpureleasemutexintsdisabled
+vportcpureleasemutexintsdisabledextram
+vportcpureleasemutexintsdisabledinternal
+vportdefineheapregions
+vportdeletethread
+vportendscheduler
+vportentercritical
+vportexceptionhandler
+vportexceptionhanlderentry
+vportexceptionsinstallhandlers
+vportexitcritical
+vportfree
+vportfreesecurecontext
+vportgetheapstats
+vportinitialiseblocks
+vportisrstartfirststask
+vportraisebasepri
+vportsetmpuregistersetone
+vportsetuptimerinterrupt
+vportstartfirststask
+vportsvchandler
+vporttaskentrypoint
+vporttaskusesdpfpu
+vporttaskusesfpu
+vporttickisr
+vportvalidateinterruptpriority
+vportyield
+vportyieldfromtick
+vportyieldprocessor
+vprocessinterface
+vqueueaddtoregistry
+vqueuedelete
+vqueueunregisterqueue
+vr
+vraiseprivilege
+vreceivingcoroutine
+vreg
+vresetprivilege
+vrestorecontextoffirsttask
+vrpm
+vsemaphorecreatebinary
+vsemaphoredelete
+vsendingcoroutine
+vsetbacklightstate
+vsoftwareinterruptentry
+vstartfirsttask
+vstmdb
+vstmdbeq
+vstreambufferdelete
+vtask
+vtaskallocatempuregions
+vtaskcode
+vtaskdelay
+vtaskdelayuntil
+vtaskdelete
+vtaskendscheduler
+vtaskentercritical
+vtaskexitcritical
+vtaskfunction
+vtaskgetinfo
+vtaskgetruntimestats
+vtasklist
+vtasknotify
+vtasknotifygivefromisr
+vtasknotifygiveindexedfromisr
+vtaskplaceoneventlist
+vtaskpriorityset
+vtaskremovefromunorderedeventlist
+vtaskresume
+vtaskresumefromisr
+vtasksetapplicationtasktag
+vtasksettasknumber
+vtasksettimeout
+vtasksettimeoutstate
+vtaskstartscheduler
+vtasksteptick
+vtasksuspend
+vtasksuspendall
+vtaskswitchcontext
+vtaskusesdpfpu
+vtickisr
+vtimercallback
+vtimerisr
+vtimersetreloadmode
+vtimersettimerid
+vtoggleled
+vtor
+vuart
+walter
+wasn
+watchpoint
+wavesel
+wavsel
+wdcr
+wdd
+wddbghlt
+wddis
+wde
+wderr
+wdfien
+wdg
+wdidlehlt
+wdie
+wdif
+wdmr
+wdp
+wdrproc
+wdrsten
+wdrstt
+wdsr
+wdt
+wdtc
+wdtgetperiod
+wdto
+wdtrestart
+wdtsetmode
+wdtsgettatus
+wdunf
+wdv
+westat
+wfi
+winavr
+wizc
+wl
+wo
+wol
+wperiodmin
+wreg
+writebit
+writting
+wu
+www
+wwwfreertos
+wxr
+xa
+xaa
+xaaaa
+xaaaaaaaa
+xabab
+xabac
+xactivetimerlist
+xaltregions
+xautoreload
+xavailableheapspaceinbytes
+xb
+xbacklighttimer
+xbankedstartscheduler
+xbb
+xbbbb
+xblocks
+xblocksize
+xblocktime
+xblocktimeticks
+xbufferlengthbytes
+xbuffersizebytes
+xbytesavailable
+xbytessent
+xbytestostoremessagelength
+xc
+xcallbackparameters
+xcallbackparameterstype
+xcalls
+xcc
+xcccc
+xcdcd
+xcdce
+xchal
+xchecktaskparameters
+xclearbitonexit
+xclearcountonexit
+xclearonexit
+xclib
+xcommandtime
+xcommsrxqueue
+xconsttickcount
+xcopyposition
+xcoroutinecreate
+xcoroutinepreviouslywoken
+xcoroutinequeue
+xcount
+xcreatedeventgroup
+xcrwokenbypost
+xd
+xdatalengthbytes
+xdd
+xdddd
+xdeadbeef
+xdelay
+xdelayedcoroutinelist
+xdelayedtasklist
+xdelaytime
+xe
+xea
+xeb
+xed
+xee
+xeeee
+xeeeeeeee
+xelapsedtime
+xend
+xer
+xeventbits
+xeventgropucreate
+xeventgropucreatestatic
+xeventgroup
+xeventgroupbuffer
+xeventgroupclearbits
+xeventgroupclearbitsfromisr
+xeventgroupcreate
+xeventgroupcreatestatic
+xeventgroupdelete
+xeventgroupgetbits
+xeventgroupgetbitsfromisr
+xeventgroupsetbits
+xeventgroupsetbitsfromisr
+xeventgroupsync
+xeventgroupwaitbits
+xeventlistitem
+xexpectedidletime
+xexpectedticks
+xexpiredtimer
+xf
+xfc
+xff
+xfff
+xfffa
+xfffb
+xfffc
+xfffcc
+xfffd
+xfffdc
+xfffe
+xffff
+xfffff
+xfffffc
+xfffffd
+xffffff
+xffffffe
+xfffffffd
+xfffffffel
+xffffffff
+xfffffffful
+xfirstlength
+xfrequency
+xfunctiontopend
+xgenericlistitem
+xgetfreestackspace
+xhandle
+xhead
+xheapbytescurrentlyallocated
+xheapbytescurrentlyheld
+xheapbyteshighwatermark
+xheapregions
+xhigherpriorittaskwoken
+xhigherprioritytaskwoken
+xhigherprioritytaskwokenbypost
+xidletaskhandle
+xilinx
+xindex
+xinheritanceoccurred
+xinsideinterrupt
+xintc
+xinterfacetoservice
+xinterruptcontroller
+xinterruptdescriptortable
+xisfeasable
+xisfeasible
+xisinsideisr
+xismessagebuffer
+xisprivileged
+xitemvalue
+xlasttime
+xlastwaketime
+xlength
+xlist
+xlistend
+xmair
+xmaxcount
+xmaxexpirycountbeforestopping
+xmaxheapbyteseverheld
+xmaxsize
+xmc
+xmessage
+xmessagebuffer
+xmessagebuffercreate
+xmessagebuffercreatestatic
+xmessagebufferisempty
+xmessagebufferisfull
+xmessagebuffernextlengthbytes
+xmessagebufferread
+xmessagebufferreceive
+xmessagebufferreceivecompletedfromisr
+xmessagebufferreceivefromisr
+xmessagebufferreset
+xmessagebuffersend
+xmessagebuffersendcompletedfromisr
+xmessagebuffersendfromisr
+xmessagebuffersizebytes
+xmessagebufferspaceavailable
+xmessagebufferspacesavailable
+xmessagebufferstruct
+xmessageid
+xmessagevalue
+xminimumeverfreebytesremaining
+xminsize
+xmpu
+xmpuctrlconst
+xmpusettings
+xmutex
+xmutexbuffer
+xmutexholder
+xn
+xnearstartscheduler
+xnewperiod
+xnewqueue
+xnextexpiretime
+xnextfreebyte
+xnexthead
+xnextmessagelength
+xnexttail
+xnexttaskunblocktime
+xnumberoffreeblocks
+xnumberofsuccessfulallocations
+xnumberofsuccessfulfrees
+xnumbertopost
+xnumofoverflows
+xoff
+xon
+xor
+xored
+xoverflowcount
+xpar
+xparameters
+xpendedcounts
+xpendedticks
+xpendingreadycoroutinelist
+xpendingreadylist
+xperiod
+xportgetcoreid
+xportgetfreeheapsize
+xportinstallinterrupthandler
+xportregistercinterrupthandler
+xportregisterdump
+xportstartfirsttask
+xportstartscheduler
+xpsr
+xqueue
+xqueueaddtoset
+xqueuebuffer
+xqueuecreate
+xqueuecreatemutex
+xqueuecreateset
+xqueuecreatestatic
+xqueuegenericsend
+xqueuegenericsendfromisr
+xqueuegetmutexholder
+xqueuegivefromisr
+xqueuegivemutexrecursive
+xqueueorsemaphore
+xqueueoverwrite
+xqueueoverwritefromisr
+xqueuepeek
+xqueuepeekfromisr
+xqueuereceive
+xqueuereceivefromisr
+xqueueregistryitem
+xqueueselectfromset
+xqueuesend
+xqueuesendfromisr
+xqueuesendtoback
+xqueuesendtobackfromisr
+xqueuesendtofromfromisr
+xqueuesendtofront
+xqueuesendtofrontfromisr
+xqueuesendtotofront
+xqueueset
+xqueuesizeinbytes
+xram
+xrbarconst
+xreceivedbytes
+xreceivedlength
+xregion
+xregions
+xregionssettings
+xregtest
+xrequiredspace
+xresult
+xreturn
+xreturned
+xrnrconst
+xrunningprivileged
+xrunprivileged
+xrxqueue
+xschedulerrunning
+xsecurecontext
+xsecurecontextconst
+xsecurecontexthandle
+xsemaphore
+xsemaphorebuffer
+xsemaphorecreatebinary
+xsemaphorecreatebinarystatic
+xsemaphorecreatecounting
+xsemaphorecreatecountingstatic
+xsemaphorecreateeventgroupstatic
+xsemaphorecreatemutex
+xsemaphorecreatemutexstatic
+xsemaphorecreaterecursivemutex
+xsemaphorecreaterecursivemutexstatic
+xsemaphoregetmutexholder
+xsemaphoregetmutexholderfromisr
+xsemaphoregive
+xsemaphoregivefromisr
+xsemaphoregivemutexrecursive
+xsemaphoregiverecursive
+xsemaphoretake
+xsemaphoretakefromisr
+xsemaphoretakemutexrecursive
+xsemaphoretakerecursive
+xshal
+xsize
+xsizeinbytes
+xsizeoflargestfreeblockinbytes
+xsizeofsmallestfreeblockinbytes
+xspace
+xstack
+xstacksize
+xstart
+xstatelistitem
+xstatic
+xstatictimerqueue
+xstreambuffer
+xstreambufferbytesavailable
+xstreambuffercreate
+xstreambuffercreatestatic
+xstreambufferisempty
+xstreambufferisfull
+xstreambuffernextmessagelengthbytes
+xstreambufferreceive
+xstreambufferreceivecompletedfromisr
+xstreambufferreceivefromisr
+xstreambufferreset
+xstreambuffersend
+xstreambuffersendcompletedfromisr
+xstreambuffersendfromisr
+xstreambuffersettriggerlevel
+xstreambuffersizebytes
+xstreambufferspacesavailable
+xstreambufferstruct
+xsuspendedtasklist
+xswithcrequired
+xt
+xtail
+xtal
+xtask
+xtaskabortdelay
+xtaskbuffer
+xtaskcallapplicationtaskhook
+xtaskcatchupticks
+xtaskcheckfortimeout
+xtaskcreate
+xtaskcreaterestricted
+xtaskcreaterestrictedstatic
+xtaskcreatestatic
+xtaskdelayuntil
+xtaskdetails
+xtaskendscheduler
+xtaskgetapplicationtasktag
+xtaskgetapplicationtasktagfromisr
+xtaskgetcurrenttaskhandle
+xtaskgethandle
+xtaskgetidletaskhandle
+xtaskgetschedulerstate
+xtaskgettickcount
+xtaskgettickcountfromisr
+xtaskhandle
+xtaskincrementtick
+xtasknofify
+xtasknofifyindexed
+xtasknotify
+xtasknotifyandquery
+xtasknotifyandqueryfromisr
+xtasknotifyandqueryindexed
+xtasknotifyandqueryindexedfromisr
+xtasknotifyfromisr
+xtasknotifygive
+xtasknotifygivefromisr
+xtasknotifygiveindexed
+xtasknotifygiveindexedfromisr
+xtasknotifyindex
+xtasknotifyindexed
+xtasknotifyindexedfromisr
+xtasknotifystateclear
+xtasknotifystateclearindexed
+xtasknotifytake
+xtasknotifywait
+xtasknotifywaitindexed
+xtasknumber
+xtaskremovefromeventlist
+xtaskresumeall
+xtaskresumefromisr
+xtaskswaitingforbits
+xtaskswaitingtermination
+xtaskswaitingtoreceive
+xtaskswaitingtosend
+xtasktodelete
+xtasktonotify
+xtasktoquery
+xtasktoresume
+xtasktosuspend
+xtaskwaitingtoreceive
+xtaskwaitingtosend
+xtaskwokenbyreceive
+xtbsp
+xtensa
+xtexcframe
+xthal
+xthreadstate
+xtickcount
+xtickstocatchup
+xtickstodelay
+xtickstowait
+xticktodelay
+xticktype
+xtimecaps
+xtimeincrement
+xtimenow
+xtimeonentering
+xtimeout
+xtimer
+xtimerbuffer
+xtimerchangeperiod
+xtimerchangeperiodfromisr
+xtimercreate
+xtimercreated
+xtimercreatestatic
+xtimerdelete
+xtimergetexpirytime
+xtimergetperiod
+xtimergetreloadmode
+xtimergettimerdaemontaskhandle
+xtimeristimeractive
+xtimerlistitem
+xtimerlistswereswitched
+xtimerparameters
+xtimerparameterstype
+xtimerpendfunctioncall
+xtimerpendfunctioncallfromisr
+xtimerperiod
+xtimerperiodinticks
+xtimerqueue
+xtimerreset
+xtimerresetfromisr
+xtimers
+xtimerstart
+xtimerstartfromisr
+xtimerstop
+xtimerstopfromisr
+xtimertaskhandle
+xtlsblock
+xtos
+xtriggerlevel
+xtriggerlevelbytes
+xuart
+xvalueofinsertion
+xvtorconst
+xwaitforallbits
+xwantedsize
+xwasdelayed
+xwritevalue
+xxr
+xyieldpending
+xzr
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/pull_request_template.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/pull_request_template.md
new file mode 100644
index 0000000..c3c8607
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/pull_request_template.md
@@ -0,0 +1,16 @@
+
+
+Description
+-----------
+
+
+Test Steps
+-----------
+
+
+Related Issue
+-----------
+
+
+
+By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/find_replace.sh b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/find_replace.sh
new file mode 100755
index 0000000..c7ee796
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/find_replace.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+old_text=$1
+new_text=$2
+echo "Old text: ${old_text}"
+echo "New text: ${new_text}"
+grep -rl "${old_text}" . | xargs gsed -i -e '1h;2,$H;$!d;g' -e "s/${old_text}/${new_text}/g"
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/kernel_checker.py b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/kernel_checker.py
new file mode 100755
index 0000000..e2b2c87
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/scripts/kernel_checker.py
@@ -0,0 +1,152 @@
+#!/usr/bin/env python3
+#/*
+# * FreeRTOS Kernel V10.5.0
+# * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+# *
+# * SPDX-License-Identifier: MIT
+# *
+# * Permission is hereby granted, free of charge, to any person obtaining a copy of
+# * this software and associated documentation files (the "Software"), to deal in
+# * the Software without restriction, including without limitation the rights to
+# * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+# * the Software, and to permit persons to whom the Software is furnished to do so,
+# * subject to the following conditions:
+# *
+# * The above copyright notice and this permission notice shall be included in all
+# * copies or substantial portions of the Software.
+# *
+# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+# * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+# * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+# *
+# * https://www.FreeRTOS.org
+# * https://github.com/FreeRTOS
+# *
+# */
+
+import os
+from common.header_checker import HeaderChecker
+
+#--------------------------------------------------------------------------------------------------
+# CONFIG
+#--------------------------------------------------------------------------------------------------
+KERNEL_IGNORED_FILES = [
+ 'FreeRTOS-openocd.c',
+ 'Makefile',
+ '.DS_Store'
+]
+
+KERNEL_IGNORED_EXTENSIONS = [
+ '.yml',
+ '.css',
+ '.idx',
+ '.md',
+ '.url',
+ '.sty',
+ '.0-rc2',
+ '.s82',
+ '.js',
+ '.out',
+ '.pack',
+ '.2',
+ '.1-kernel-only',
+ '.0-kernel-only',
+ '.0-rc1',
+ '.readme',
+ '.tex',
+ '.png',
+ '.bat',
+ '.sh',
+ '.txt',
+ '.cmake'
+]
+
+KERNEL_ASM_EXTENSIONS = [
+ '.s',
+ '.S',
+ '.src',
+ '.inc',
+ '.s26',
+ '.s43',
+ '.s79',
+ '.s85',
+ '.s87',
+ '.s90',
+ '.asm',
+ '.h'
+]
+
+KERNEL_PY_EXTENSIONS = [
+ '.py'
+]
+
+KERNEL_IGNORED_PATTERNS = [
+ r'.*\.git.*',
+ r'.*portable/IAR/AtmelSAM7S64/.*AT91SAM7.*',
+ r'.*portable/GCC/ARM7_AT91SAM7S/.*',
+ r'.*portable/MPLAB/PIC18F/stdio.h'
+]
+
+KERNEL_THIRD_PARTY_PATTERNS = [
+ r'.*portable/ThirdParty/GCC/Posix/port*',
+ r'.*portable/ThirdParty/*',
+ r'.*portable/IAR/AVR32_UC3/.*',
+ r'.*portable/GCC/AVR32_UC3/.*',
+]
+
+KERNEL_HEADER = [
+ '/*\n',
+ ' * FreeRTOS Kernel V10.5.0\n',
+ ' * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n',
+ ' *\n',
+ ' * SPDX-License-Identifier: MIT\n',
+ ' *\n',
+ ' * Permission is hereby granted, free of charge, to any person obtaining a copy of\n',
+ ' * this software and associated documentation files (the "Software"), to deal in\n',
+ ' * the Software without restriction, including without limitation the rights to\n',
+ ' * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n',
+ ' * the Software, and to permit persons to whom the Software is furnished to do so,\n',
+ ' * subject to the following conditions:\n',
+ ' *\n',
+ ' * The above copyright notice and this permission notice shall be included in all\n',
+ ' * copies or substantial portions of the Software.\n',
+ ' *\n',
+ ' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n',
+ ' * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n',
+ ' * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n',
+ ' * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n',
+ ' * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n',
+ ' * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n',
+ ' *\n',
+ ' * https://www.FreeRTOS.org\n',
+ ' * https://github.com/FreeRTOS\n',
+ ' *\n',
+ ' */\n',
+]
+
+def main():
+ parser = HeaderChecker.configArgParser()
+ args = parser.parse_args()
+
+ # Configure the checks then run
+ checker = HeaderChecker(KERNEL_HEADER,
+ ignored_files=KERNEL_IGNORED_FILES,
+ ignored_ext=KERNEL_IGNORED_EXTENSIONS,
+ ignored_patterns=KERNEL_IGNORED_PATTERNS,
+ third_party_patterns=KERNEL_THIRD_PARTY_PATTERNS,
+ py_ext=KERNEL_PY_EXTENSIONS,
+ asm_ext=KERNEL_ASM_EXTENSIONS)
+ checker.ignoreFile(os.path.split(__file__)[-1])
+
+ rc = checker.processArgs(args)
+ if rc:
+ checker.showHelp(__file__)
+
+ return rc
+
+if __name__ == '__main__':
+ exit(main())
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/uncrustify.cfg b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/uncrustify.cfg
new file mode 100644
index 0000000..3f4c40c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/uncrustify.cfg
@@ -0,0 +1,673 @@
+# Uncrustify-0.69.0
+
+newlines = auto # lf/crlf/cr/auto
+input_tab_size = 4 # unsigned number
+output_tab_size = 4 # unsigned number
+string_escape_char = 92 # unsigned number
+string_escape_char2 = 0 # unsigned number
+string_replace_tab_chars = false # true/false
+tok_split_gte = false # true/false
+disable_processing_cmt = " *INDENT-OFF*" # string
+enable_processing_cmt = " *INDENT-ON*" # string
+enable_digraphs = false # true/false
+utf8_bom = ignore # ignore/add/remove/force
+utf8_byte = false # true/false
+utf8_force = false # true/false
+sp_arith = force # ignore/add/remove/force
+sp_arith_additive = ignore # ignore/add/remove/force
+sp_assign = force # ignore/add/remove/force
+sp_cpp_lambda_assign = ignore # ignore/add/remove/force
+sp_cpp_lambda_paren = ignore # ignore/add/remove/force
+sp_assign_default = force # ignore/add/remove/force
+sp_before_assign = force # ignore/add/remove/force
+sp_after_assign = force # ignore/add/remove/force
+sp_enum_paren = ignore # ignore/add/remove/force
+sp_enum_assign = force # ignore/add/remove/force
+sp_enum_before_assign = force # ignore/add/remove/force
+sp_enum_after_assign = force # ignore/add/remove/force
+sp_enum_colon = ignore # ignore/add/remove/force
+sp_pp_concat = add # ignore/add/remove/force
+sp_pp_stringify = add # ignore/add/remove/force
+sp_before_pp_stringify = ignore # ignore/add/remove/force
+sp_bool = force # ignore/add/remove/force
+sp_compare = force # ignore/add/remove/force
+sp_inside_paren = force # ignore/add/remove/force
+sp_paren_paren = force # ignore/add/remove/force
+sp_cparen_oparen = ignore # ignore/add/remove/force
+sp_balance_nested_parens = false # true/false
+sp_paren_brace = force # ignore/add/remove/force
+sp_brace_brace = ignore # ignore/add/remove/force
+sp_before_ptr_star = force # ignore/add/remove/force
+sp_before_unnamed_ptr_star = force # ignore/add/remove/force
+sp_between_ptr_star = remove # ignore/add/remove/force
+sp_after_ptr_star = force # ignore/add/remove/force
+sp_after_ptr_block_caret = ignore # ignore/add/remove/force
+sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force
+sp_after_ptr_star_func = ignore # ignore/add/remove/force
+sp_ptr_star_paren = ignore # ignore/add/remove/force
+sp_before_ptr_star_func = ignore # ignore/add/remove/force
+sp_before_byref = force # ignore/add/remove/force
+sp_before_unnamed_byref = ignore # ignore/add/remove/force
+sp_after_byref = remove # ignore/add/remove/force
+sp_after_byref_func = remove # ignore/add/remove/force
+sp_before_byref_func = ignore # ignore/add/remove/force
+sp_after_type = force # ignore/add/remove/force
+sp_after_decltype = ignore # ignore/add/remove/force
+sp_before_template_paren = ignore # ignore/add/remove/force
+sp_template_angle = ignore # ignore/add/remove/force
+sp_before_angle = remove # ignore/add/remove/force
+sp_inside_angle = remove # ignore/add/remove/force
+sp_inside_angle_empty = ignore # ignore/add/remove/force
+sp_angle_colon = ignore # ignore/add/remove/force
+sp_after_angle = force # ignore/add/remove/force
+sp_angle_paren = ignore # ignore/add/remove/force
+sp_angle_paren_empty = ignore # ignore/add/remove/force
+sp_angle_word = ignore # ignore/add/remove/force
+sp_angle_shift = add # ignore/add/remove/force
+sp_permit_cpp11_shift = false # true/false
+sp_before_sparen = remove # ignore/add/remove/force
+sp_inside_sparen = force # ignore/add/remove/force
+sp_inside_sparen_open = ignore # ignore/add/remove/force
+sp_inside_sparen_close = ignore # ignore/add/remove/force
+sp_after_sparen = force # ignore/add/remove/force
+sp_sparen_brace = force # ignore/add/remove/force
+sp_invariant_paren = ignore # ignore/add/remove/force
+sp_after_invariant_paren = ignore # ignore/add/remove/force
+sp_special_semi = ignore # ignore/add/remove/force
+sp_before_semi = remove # ignore/add/remove/force
+sp_before_semi_for = remove # ignore/add/remove/force
+sp_before_semi_for_empty = add # ignore/add/remove/force
+sp_after_semi = add # ignore/add/remove/force
+sp_after_semi_for = force # ignore/add/remove/force
+sp_after_semi_for_empty = force # ignore/add/remove/force
+sp_before_square = remove # ignore/add/remove/force
+sp_before_squares = remove # ignore/add/remove/force
+sp_cpp_before_struct_binding = ignore # ignore/add/remove/force
+sp_inside_square = force # ignore/add/remove/force
+sp_inside_square_oc_array = ignore # ignore/add/remove/force
+sp_after_comma = force # ignore/add/remove/force
+sp_before_comma = remove # ignore/add/remove/force
+sp_after_mdatype_commas = ignore # ignore/add/remove/force
+sp_before_mdatype_commas = ignore # ignore/add/remove/force
+sp_between_mdatype_commas = ignore # ignore/add/remove/force
+sp_paren_comma = force # ignore/add/remove/force
+sp_before_ellipsis = ignore # ignore/add/remove/force
+sp_type_ellipsis = ignore # ignore/add/remove/force
+sp_type_question = ignore # ignore/add/remove/force
+sp_paren_ellipsis = ignore # ignore/add/remove/force
+sp_paren_qualifier = ignore # ignore/add/remove/force
+sp_paren_noexcept = ignore # ignore/add/remove/force
+sp_after_class_colon = ignore # ignore/add/remove/force
+sp_before_class_colon = ignore # ignore/add/remove/force
+sp_after_constr_colon = ignore # ignore/add/remove/force
+sp_before_constr_colon = ignore # ignore/add/remove/force
+sp_before_case_colon = remove # ignore/add/remove/force
+sp_after_operator = ignore # ignore/add/remove/force
+sp_after_operator_sym = ignore # ignore/add/remove/force
+sp_after_operator_sym_empty = ignore # ignore/add/remove/force
+sp_after_cast = force # ignore/add/remove/force
+sp_inside_paren_cast = force # ignore/add/remove/force
+sp_cpp_cast_paren = ignore # ignore/add/remove/force
+sp_sizeof_paren = remove # ignore/add/remove/force
+sp_sizeof_ellipsis = ignore # ignore/add/remove/force
+sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force
+sp_decltype_paren = ignore # ignore/add/remove/force
+sp_after_tag = ignore # ignore/add/remove/force
+sp_inside_braces_enum = force # ignore/add/remove/force
+sp_inside_braces_struct = force # ignore/add/remove/force
+sp_inside_braces_oc_dict = ignore # ignore/add/remove/force
+sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force
+sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force
+sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force
+sp_inside_braces = force # ignore/add/remove/force
+sp_inside_braces_empty = remove # ignore/add/remove/force
+sp_type_func = force # ignore/add/remove/force
+sp_type_brace_init_lst = ignore # ignore/add/remove/force
+sp_func_proto_paren = remove # ignore/add/remove/force
+sp_func_proto_paren_empty = ignore # ignore/add/remove/force
+sp_func_def_paren = remove # ignore/add/remove/force
+sp_func_def_paren_empty = ignore # ignore/add/remove/force
+sp_inside_fparens = remove # ignore/add/remove/force
+sp_inside_fparen = force # ignore/add/remove/force
+sp_inside_tparen = ignore # ignore/add/remove/force
+sp_after_tparen_close = ignore # ignore/add/remove/force
+sp_square_fparen = ignore # ignore/add/remove/force
+sp_fparen_brace = add # ignore/add/remove/force
+sp_fparen_brace_initializer = ignore # ignore/add/remove/force
+sp_fparen_dbrace = ignore # ignore/add/remove/force
+sp_func_call_paren = remove # ignore/add/remove/force
+sp_func_call_paren_empty = ignore # ignore/add/remove/force
+sp_func_call_user_paren = ignore # ignore/add/remove/force
+sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force
+sp_func_call_user_paren_paren = ignore # ignore/add/remove/force
+sp_func_class_paren = remove # ignore/add/remove/force
+sp_func_class_paren_empty = ignore # ignore/add/remove/force
+sp_return_paren = remove # ignore/add/remove/force
+sp_return_brace = ignore # ignore/add/remove/force
+sp_attribute_paren = remove # ignore/add/remove/force
+sp_defined_paren = remove # ignore/add/remove/force
+sp_throw_paren = ignore # ignore/add/remove/force
+sp_after_throw = ignore # ignore/add/remove/force
+sp_catch_paren = ignore # ignore/add/remove/force
+sp_oc_catch_paren = ignore # ignore/add/remove/force
+sp_oc_classname_paren = ignore # ignore/add/remove/force
+sp_version_paren = ignore # ignore/add/remove/force
+sp_scope_paren = ignore # ignore/add/remove/force
+sp_super_paren = remove # ignore/add/remove/force
+sp_this_paren = remove # ignore/add/remove/force
+sp_macro = force # ignore/add/remove/force
+sp_macro_func = force # ignore/add/remove/force
+sp_else_brace = ignore # ignore/add/remove/force
+sp_brace_else = ignore # ignore/add/remove/force
+sp_brace_typedef = force # ignore/add/remove/force
+sp_catch_brace = ignore # ignore/add/remove/force
+sp_oc_catch_brace = ignore # ignore/add/remove/force
+sp_brace_catch = ignore # ignore/add/remove/force
+sp_oc_brace_catch = ignore # ignore/add/remove/force
+sp_finally_brace = ignore # ignore/add/remove/force
+sp_brace_finally = ignore # ignore/add/remove/force
+sp_try_brace = ignore # ignore/add/remove/force
+sp_getset_brace = ignore # ignore/add/remove/force
+sp_word_brace = add # ignore/add/remove/force
+sp_word_brace_ns = add # ignore/add/remove/force
+sp_before_dc = remove # ignore/add/remove/force
+sp_after_dc = remove # ignore/add/remove/force
+sp_d_array_colon = ignore # ignore/add/remove/force
+sp_not = remove # ignore/add/remove/force
+sp_inv = remove # ignore/add/remove/force
+sp_addr = remove # ignore/add/remove/force
+sp_member = remove # ignore/add/remove/force
+sp_deref = remove # ignore/add/remove/force
+sp_sign = remove # ignore/add/remove/force
+sp_incdec = remove # ignore/add/remove/force
+sp_before_nl_cont = add # ignore/add/remove/force
+sp_after_oc_scope = ignore # ignore/add/remove/force
+sp_after_oc_colon = ignore # ignore/add/remove/force
+sp_before_oc_colon = ignore # ignore/add/remove/force
+sp_after_oc_dict_colon = ignore # ignore/add/remove/force
+sp_before_oc_dict_colon = ignore # ignore/add/remove/force
+sp_after_send_oc_colon = ignore # ignore/add/remove/force
+sp_before_send_oc_colon = ignore # ignore/add/remove/force
+sp_after_oc_type = ignore # ignore/add/remove/force
+sp_after_oc_return_type = ignore # ignore/add/remove/force
+sp_after_oc_at_sel = ignore # ignore/add/remove/force
+sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force
+sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force
+sp_before_oc_block_caret = ignore # ignore/add/remove/force
+sp_after_oc_block_caret = ignore # ignore/add/remove/force
+sp_after_oc_msg_receiver = ignore # ignore/add/remove/force
+sp_after_oc_property = ignore # ignore/add/remove/force
+sp_after_oc_synchronized = ignore # ignore/add/remove/force
+sp_cond_colon = force # ignore/add/remove/force
+sp_cond_colon_before = ignore # ignore/add/remove/force
+sp_cond_colon_after = ignore # ignore/add/remove/force
+sp_cond_question = force # ignore/add/remove/force
+sp_cond_question_before = ignore # ignore/add/remove/force
+sp_cond_question_after = ignore # ignore/add/remove/force
+sp_cond_ternary_short = ignore # ignore/add/remove/force
+sp_case_label = force # ignore/add/remove/force
+sp_range = ignore # ignore/add/remove/force
+sp_after_for_colon = ignore # ignore/add/remove/force
+sp_before_for_colon = ignore # ignore/add/remove/force
+sp_extern_paren = ignore # ignore/add/remove/force
+sp_cmt_cpp_start = ignore # ignore/add/remove/force
+sp_cmt_cpp_doxygen = false # true/false
+sp_cmt_cpp_qttr = false # true/false
+sp_endif_cmt = force # ignore/add/remove/force
+sp_after_new = ignore # ignore/add/remove/force
+sp_between_new_paren = ignore # ignore/add/remove/force
+sp_after_newop_paren = ignore # ignore/add/remove/force
+sp_inside_newop_paren = ignore # ignore/add/remove/force
+sp_inside_newop_paren_open = ignore # ignore/add/remove/force
+sp_inside_newop_paren_close = ignore # ignore/add/remove/force
+sp_before_tr_emb_cmt = force # ignore/add/remove/force
+sp_num_before_tr_emb_cmt = 1 # unsigned number
+sp_annotation_paren = ignore # ignore/add/remove/force
+sp_skip_vbrace_tokens = false # true/false
+sp_after_noexcept = ignore # ignore/add/remove/force
+sp_vala_after_translation = ignore # ignore/add/remove/force
+force_tab_after_define = false # true/false
+indent_columns = 4 # unsigned number
+indent_continue = 0 # number
+indent_continue_class_head = 0 # unsigned number
+indent_single_newlines = false # true/false
+indent_param = 0 # unsigned number
+indent_with_tabs = 0 # unsigned number
+indent_cmt_with_tabs = false # true/false
+indent_align_string = true # true/false
+indent_xml_string = 0 # unsigned number
+indent_brace = 0 # unsigned number
+indent_braces = false # true/false
+indent_braces_no_func = false # true/false
+indent_braces_no_class = false # true/false
+indent_braces_no_struct = false # true/false
+indent_brace_parent = false # true/false
+indent_paren_open_brace = false # true/false
+indent_cs_delegate_brace = false # true/false
+indent_cs_delegate_body = false # true/false
+indent_namespace = false # true/false
+indent_namespace_single_indent = false # true/false
+indent_namespace_level = 0 # unsigned number
+indent_namespace_limit = 0 # unsigned number
+indent_extern = false # true/false
+indent_class = true # true/false
+indent_class_colon = true # true/false
+indent_class_on_colon = false # true/false
+indent_constr_colon = false # true/false
+indent_ctor_init_leading = 2 # unsigned number
+indent_ctor_init = 0 # number
+indent_else_if = false # true/false
+indent_var_def_blk = 0 # number
+indent_var_def_cont = false # true/false
+indent_shift = false # true/false
+indent_func_def_force_col1 = false # true/false
+indent_func_call_param = false # true/false
+indent_func_def_param = false # true/false
+indent_func_proto_param = false # true/false
+indent_func_class_param = false # true/false
+indent_func_ctor_var_param = false # true/false
+indent_template_param = false # true/false
+indent_func_param_double = false # true/false
+indent_func_const = 0 # unsigned number
+indent_func_throw = 0 # unsigned number
+indent_member = 3 # unsigned number
+indent_member_single = false # true/false
+indent_sing_line_comments = 0 # unsigned number
+indent_relative_single_line_comments = false # true/false
+indent_switch_case = 4 # unsigned number
+indent_switch_pp = true # true/false
+indent_case_shift = 0 # unsigned number
+indent_case_brace = 3 # number
+indent_col1_comment = false # true/false
+indent_col1_multi_string_literal = false # true/false
+indent_label = 1 # number
+indent_access_spec = 1 # number
+indent_access_spec_body = false # true/false
+indent_paren_nl = false # true/false
+indent_paren_close = 0 # unsigned number
+indent_paren_after_func_def = false # true/false
+indent_paren_after_func_decl = false # true/false
+indent_paren_after_func_call = false # true/false
+indent_comma_paren = false # true/false
+indent_bool_paren = false # true/false
+indent_semicolon_for_paren = false # true/false
+indent_first_bool_expr = false # true/false
+indent_first_for_expr = false # true/false
+indent_square_nl = false # true/false
+indent_preserve_sql = false # true/false
+indent_align_assign = true # true/false
+indent_align_paren = true # true/false
+indent_oc_block = false # true/false
+indent_oc_block_msg = 0 # unsigned number
+indent_oc_msg_colon = 0 # unsigned number
+indent_oc_msg_prioritize_first_colon = true # true/false
+indent_oc_block_msg_xcode_style = false # true/false
+indent_oc_block_msg_from_keyword = false # true/false
+indent_oc_block_msg_from_colon = false # true/false
+indent_oc_block_msg_from_caret = false # true/false
+indent_oc_block_msg_from_brace = false # true/false
+indent_min_vbrace_open = 0 # unsigned number
+indent_vbrace_open_on_tabstop = false # true/false
+indent_token_after_brace = true # true/false
+indent_cpp_lambda_body = false # true/false
+indent_using_block = true # true/false
+indent_ternary_operator = 0 # unsigned number
+indent_off_after_return_new = false # true/false
+indent_single_after_return = false # true/false
+indent_ignore_asm_block = false # true/false
+nl_collapse_empty_body = false # true/false
+nl_assign_leave_one_liners = true # true/false
+nl_class_leave_one_liners = true # true/false
+nl_enum_leave_one_liners = false # true/false
+nl_getset_leave_one_liners = false # true/false
+nl_cs_property_leave_one_liners = false # true/false
+nl_func_leave_one_liners = false # true/false
+nl_cpp_lambda_leave_one_liners = false # true/false
+nl_if_leave_one_liners = false # true/false
+nl_while_leave_one_liners = false # true/false
+nl_for_leave_one_liners = false # true/false
+nl_oc_msg_leave_one_liner = false # true/false
+nl_oc_mdef_brace = ignore # ignore/add/remove/force
+nl_oc_block_brace = ignore # ignore/add/remove/force
+nl_oc_interface_brace = ignore # ignore/add/remove/force
+nl_oc_implementation_brace = ignore # ignore/add/remove/force
+nl_start_of_file = remove # ignore/add/remove/force
+nl_start_of_file_min = 0 # unsigned number
+nl_end_of_file = force # ignore/add/remove/force
+nl_end_of_file_min = 1 # unsigned number
+nl_assign_brace = add # ignore/add/remove/force
+nl_assign_square = ignore # ignore/add/remove/force
+nl_tsquare_brace = ignore # ignore/add/remove/force
+nl_after_square_assign = ignore # ignore/add/remove/force
+nl_fcall_brace = add # ignore/add/remove/force
+nl_enum_brace = force # ignore/add/remove/force
+nl_enum_class = ignore # ignore/add/remove/force
+nl_enum_class_identifier = ignore # ignore/add/remove/force
+nl_enum_identifier_colon = ignore # ignore/add/remove/force
+nl_enum_colon_type = ignore # ignore/add/remove/force
+nl_struct_brace = force # ignore/add/remove/force
+nl_union_brace = force # ignore/add/remove/force
+nl_if_brace = add # ignore/add/remove/force
+nl_brace_else = add # ignore/add/remove/force
+nl_elseif_brace = ignore # ignore/add/remove/force
+nl_else_brace = add # ignore/add/remove/force
+nl_else_if = ignore # ignore/add/remove/force
+nl_before_if_closing_paren = ignore # ignore/add/remove/force
+nl_brace_finally = ignore # ignore/add/remove/force
+nl_finally_brace = ignore # ignore/add/remove/force
+nl_try_brace = ignore # ignore/add/remove/force
+nl_getset_brace = force # ignore/add/remove/force
+nl_for_brace = add # ignore/add/remove/force
+nl_catch_brace = ignore # ignore/add/remove/force
+nl_oc_catch_brace = ignore # ignore/add/remove/force
+nl_brace_catch = ignore # ignore/add/remove/force
+nl_oc_brace_catch = ignore # ignore/add/remove/force
+nl_brace_square = ignore # ignore/add/remove/force
+nl_brace_fparen = ignore # ignore/add/remove/force
+nl_while_brace = add # ignore/add/remove/force
+nl_scope_brace = ignore # ignore/add/remove/force
+nl_unittest_brace = ignore # ignore/add/remove/force
+nl_version_brace = ignore # ignore/add/remove/force
+nl_using_brace = ignore # ignore/add/remove/force
+nl_brace_brace = ignore # ignore/add/remove/force
+nl_do_brace = add # ignore/add/remove/force
+nl_brace_while = ignore # ignore/add/remove/force
+nl_switch_brace = add # ignore/add/remove/force
+nl_synchronized_brace = ignore # ignore/add/remove/force
+nl_multi_line_cond = false # true/false
+nl_multi_line_define = true # true/false
+nl_before_case = true # true/false
+nl_after_case = true # true/false
+nl_case_colon_brace = ignore # ignore/add/remove/force
+nl_before_throw = ignore # ignore/add/remove/force
+nl_namespace_brace = ignore # ignore/add/remove/force
+nl_template_class = ignore # ignore/add/remove/force
+nl_class_brace = ignore # ignore/add/remove/force
+nl_class_init_args = ignore # ignore/add/remove/force
+nl_constr_init_args = ignore # ignore/add/remove/force
+nl_enum_own_lines = ignore # ignore/add/remove/force
+nl_func_type_name = remove # ignore/add/remove/force
+nl_func_type_name_class = ignore # ignore/add/remove/force
+nl_func_class_scope = ignore # ignore/add/remove/force
+nl_func_scope_name = ignore # ignore/add/remove/force
+nl_func_proto_type_name = remove # ignore/add/remove/force
+nl_func_paren = remove # ignore/add/remove/force
+nl_func_paren_empty = ignore # ignore/add/remove/force
+nl_func_def_paren = remove # ignore/add/remove/force
+nl_func_def_paren_empty = ignore # ignore/add/remove/force
+nl_func_call_paren = ignore # ignore/add/remove/force
+nl_func_call_paren_empty = ignore # ignore/add/remove/force
+nl_func_decl_start = remove # ignore/add/remove/force
+nl_func_def_start = remove # ignore/add/remove/force
+nl_func_decl_start_single = ignore # ignore/add/remove/force
+nl_func_def_start_single = ignore # ignore/add/remove/force
+nl_func_decl_start_multi_line = false # true/false
+nl_func_def_start_multi_line = false # true/false
+nl_func_decl_args = add # ignore/add/remove/force
+nl_func_def_args = add # ignore/add/remove/force
+nl_func_decl_args_multi_line = false # true/false
+nl_func_def_args_multi_line = false # true/false
+nl_func_decl_end = remove # ignore/add/remove/force
+nl_func_def_end = remove # ignore/add/remove/force
+nl_func_decl_end_single = ignore # ignore/add/remove/force
+nl_func_def_end_single = ignore # ignore/add/remove/force
+nl_func_decl_end_multi_line = false # true/false
+nl_func_def_end_multi_line = false # true/false
+nl_func_decl_empty = ignore # ignore/add/remove/force
+nl_func_def_empty = ignore # ignore/add/remove/force
+nl_func_call_empty = ignore # ignore/add/remove/force
+nl_func_call_start = ignore # ignore/add/remove/force
+nl_func_call_start_multi_line = false # true/false
+nl_func_call_args_multi_line = false # true/false
+nl_func_call_end_multi_line = false # true/false
+nl_oc_msg_args = false # true/false
+nl_fdef_brace = add # ignore/add/remove/force
+nl_fdef_brace_cond = ignore # ignore/add/remove/force
+nl_cpp_ldef_brace = ignore # ignore/add/remove/force
+nl_return_expr = ignore # ignore/add/remove/force
+nl_after_semicolon = true # true/false
+nl_paren_dbrace_open = ignore # ignore/add/remove/force
+nl_type_brace_init_lst = ignore # ignore/add/remove/force
+nl_type_brace_init_lst_open = ignore # ignore/add/remove/force
+nl_type_brace_init_lst_close = ignore # ignore/add/remove/force
+nl_after_brace_open = true # true/false
+nl_after_brace_open_cmt = false # true/false
+nl_after_vbrace_open = false # true/false
+nl_after_vbrace_open_empty = false # true/false
+nl_after_brace_close = true # true/false
+nl_after_vbrace_close = false # true/false
+nl_brace_struct_var = ignore # ignore/add/remove/force
+nl_define_macro = false # true/false
+nl_squeeze_paren_close = false # true/false
+nl_squeeze_ifdef = true # true/false
+nl_squeeze_ifdef_top_level = false # true/false
+nl_before_if = force # ignore/add/remove/force
+nl_after_if = force # ignore/add/remove/force
+nl_before_for = force # ignore/add/remove/force
+nl_after_for = force # ignore/add/remove/force
+nl_before_while = force # ignore/add/remove/force
+nl_after_while = force # ignore/add/remove/force
+nl_before_switch = force # ignore/add/remove/force
+nl_after_switch = force # ignore/add/remove/force
+nl_before_synchronized = ignore # ignore/add/remove/force
+nl_after_synchronized = ignore # ignore/add/remove/force
+nl_before_do = force # ignore/add/remove/force
+nl_after_do = force # ignore/add/remove/force
+nl_before_return = false # true/false
+nl_after_return = true # true/false
+nl_ds_struct_enum_cmt = false # true/false
+nl_ds_struct_enum_close_brace = false # true/false
+nl_class_colon = ignore # ignore/add/remove/force
+nl_constr_colon = ignore # ignore/add/remove/force
+nl_namespace_two_to_one_liner = false # true/false
+nl_create_if_one_liner = false # true/false
+nl_create_for_one_liner = false # true/false
+nl_create_while_one_liner = false # true/false
+nl_create_func_def_one_liner = false # true/false
+nl_split_if_one_liner = false # true/false
+nl_split_for_one_liner = false # true/false
+nl_split_while_one_liner = false # true/false
+nl_max = 4 # unsigned number
+nl_max_blank_in_func = 0 # unsigned number
+nl_before_func_body_proto = 0 # unsigned number
+nl_before_func_body_def = 0 # unsigned number
+nl_before_func_class_proto = 0 # unsigned number
+nl_before_func_class_def = 0 # unsigned number
+nl_after_func_proto = 0 # unsigned number
+nl_after_func_proto_group = 1 # unsigned number
+nl_after_func_class_proto = 0 # unsigned number
+nl_after_func_class_proto_group = 0 # unsigned number
+nl_class_leave_one_liner_groups = false # true/false
+nl_after_func_body = 0 # unsigned number
+nl_after_func_body_class = 2 # unsigned number
+nl_after_func_body_one_liner = 0 # unsigned number
+nl_func_var_def_blk = 1 # unsigned number
+nl_typedef_blk_start = 0 # unsigned number
+nl_typedef_blk_end = 0 # unsigned number
+nl_typedef_blk_in = 0 # unsigned number
+nl_var_def_blk_start = 0 # unsigned number
+nl_var_def_blk_end = 0 # unsigned number
+nl_var_def_blk_in = 0 # unsigned number
+nl_before_block_comment = 2 # unsigned number
+nl_before_c_comment = 0 # unsigned number
+nl_before_cpp_comment = 0 # unsigned number
+nl_after_multiline_comment = false # true/false
+nl_after_label_colon = false # true/false
+nl_after_struct = 0 # unsigned number
+nl_before_class = 0 # unsigned number
+nl_after_class = 0 # unsigned number
+nl_before_access_spec = 0 # unsigned number
+nl_after_access_spec = 0 # unsigned number
+nl_comment_func_def = 0 # unsigned number
+nl_after_try_catch_finally = 0 # unsigned number
+nl_around_cs_property = 0 # unsigned number
+nl_between_get_set = 0 # unsigned number
+nl_property_brace = ignore # ignore/add/remove/force
+nl_inside_namespace = 0 # unsigned number
+eat_blanks_after_open_brace = true # true/false
+eat_blanks_before_close_brace = true # true/false
+nl_remove_extra_newlines = 0 # unsigned number
+nl_after_annotation = ignore # ignore/add/remove/force
+nl_between_annotation = ignore # ignore/add/remove/force
+pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_bool = trail # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
+code_width = 0 # unsigned number
+ls_for_split_full = false # true/false
+ls_func_split_full = false # true/false
+ls_code_width = false # true/false
+align_keep_tabs = false # true/false
+align_with_tabs = false # true/false
+align_on_tabstop = false # true/false
+align_number_right = false # true/false
+align_keep_extra_space = false # true/false
+align_func_params = false # true/false
+align_func_params_span = 0 # unsigned number
+align_func_params_thresh = 0 # number
+align_func_params_gap = 0 # unsigned number
+align_constr_value_span = 0 # unsigned number
+align_constr_value_thresh = 0 # number
+align_constr_value_gap = 0 # unsigned number
+align_same_func_call_params = false # true/false
+align_same_func_call_params_span = 0 # unsigned number
+align_same_func_call_params_thresh = 0 # number
+align_var_def_span = 0 # unsigned number
+align_var_def_star_style = 0 # unsigned number
+align_var_def_amp_style = 1 # unsigned number
+align_var_def_thresh = 16 # number
+align_var_def_gap = 0 # unsigned number
+align_var_def_colon = false # true/false
+align_var_def_colon_gap = 0 # unsigned number
+align_var_def_attribute = false # true/false
+align_var_def_inline = false # true/false
+align_assign_span = 0 # unsigned number
+align_assign_func_proto_span = 0 # unsigned number
+align_assign_thresh = 12 # number
+align_assign_decl_func = 0 # unsigned number
+align_enum_equ_span = 0 # unsigned number
+align_enum_equ_thresh = 0 # number
+align_var_class_span = 0 # unsigned number
+align_var_class_thresh = 0 # number
+align_var_class_gap = 0 # unsigned number
+align_var_struct_span = 0 # unsigned number
+align_var_struct_thresh = 0 # number
+align_var_struct_gap = 0 # unsigned number
+align_struct_init_span = 3 # unsigned number
+align_typedef_span = 5 # unsigned number
+align_typedef_gap = 3 # unsigned number
+align_typedef_func = 0 # unsigned number
+align_typedef_star_style = 1 # unsigned number
+align_typedef_amp_style = 1 # unsigned number
+align_right_cmt_span = 3 # unsigned number
+align_right_cmt_gap = 0 # unsigned number
+align_right_cmt_mix = false # true/false
+align_right_cmt_same_level = false # true/false
+align_right_cmt_at_col = 0 # unsigned number
+align_func_proto_span = 0 # unsigned number
+align_func_proto_thresh = 0 # number
+align_func_proto_gap = 0 # unsigned number
+align_on_operator = false # true/false
+align_mix_var_proto = false # true/false
+align_single_line_func = false # true/false
+align_single_line_brace = false # true/false
+align_single_line_brace_gap = 0 # unsigned number
+align_oc_msg_spec_span = 0 # unsigned number
+align_nl_cont = true # true/false
+align_pp_define_together = false # true/false
+align_pp_define_span = 3 # unsigned number
+align_pp_define_gap = 4 # unsigned number
+align_left_shift = true # true/false
+align_asm_colon = false # true/false
+align_oc_msg_colon_span = 0 # unsigned number
+align_oc_msg_colon_first = false # true/false
+align_oc_decl_colon = false # true/false
+cmt_width = 0 # unsigned number
+cmt_reflow_mode = 0 # unsigned number
+cmt_convert_tab_to_spaces = false # true/false
+cmt_indent_multi = true # true/false
+cmt_c_group = false # true/false
+cmt_c_nl_start = false # true/false
+cmt_c_nl_end = false # true/false
+cmt_cpp_to_c = true # true/false
+cmt_cpp_group = false # true/false
+cmt_cpp_nl_start = false # true/false
+cmt_cpp_nl_end = false # true/false
+cmt_star_cont = true # true/false
+cmt_sp_before_star_cont = 0 # unsigned number
+cmt_sp_after_star_cont = 0 # unsigned number
+cmt_multi_check_last = true # true/false
+cmt_multi_first_len_minimum = 4 # unsigned number
+cmt_insert_file_header = "" # string
+cmt_insert_file_footer = "" # string
+cmt_insert_func_header = "" # string
+cmt_insert_class_header = "" # string
+cmt_insert_oc_msg_header = "" # string
+cmt_insert_before_preproc = false # true/false
+cmt_insert_before_inlines = true # true/false
+cmt_insert_before_ctor_dtor = false # true/false
+mod_full_brace_do = add # ignore/add/remove/force
+mod_full_brace_for = add # ignore/add/remove/force
+mod_full_brace_function = ignore # ignore/add/remove/force
+mod_full_brace_if = add # ignore/add/remove/force
+mod_full_brace_if_chain = false # true/false
+mod_full_brace_if_chain_only = false # true/false
+mod_full_brace_while = add # ignore/add/remove/force
+mod_full_brace_using = ignore # ignore/add/remove/force
+mod_full_brace_nl = 0 # unsigned number
+mod_full_brace_nl_block_rem_mlcond = false # true/false
+mod_paren_on_return = ignore # ignore/add/remove/force
+mod_pawn_semicolon = false # true/false
+mod_full_paren_if_bool = true # true/false
+mod_remove_extra_semicolon = true # true/false
+mod_add_long_function_closebrace_comment = 0 # unsigned number
+mod_add_long_namespace_closebrace_comment = 0 # unsigned number
+mod_add_long_class_closebrace_comment = 0 # unsigned number
+mod_add_long_switch_closebrace_comment = 0 # unsigned number
+mod_add_long_ifdef_endif_comment = 10 # unsigned number
+mod_add_long_ifdef_else_comment = 10 # unsigned number
+mod_sort_import = false # true/false
+mod_sort_using = false # true/false
+mod_sort_include = false # true/false
+mod_move_case_break = false # true/false
+mod_case_brace = remove # ignore/add/remove/force
+mod_remove_empty_return = true # true/false
+mod_enum_last_comma = ignore # ignore/add/remove/force
+mod_sort_oc_properties = false # true/false
+mod_sort_oc_property_class_weight = 0 # number
+mod_sort_oc_property_thread_safe_weight = 0 # number
+mod_sort_oc_property_readwrite_weight = 0 # number
+mod_sort_oc_property_reference_weight = 0 # number
+mod_sort_oc_property_getter_weight = 0 # number
+mod_sort_oc_property_setter_weight = 0 # number
+mod_sort_oc_property_nullability_weight = 0 # number
+pp_indent = force # ignore/add/remove/force
+pp_indent_at_level = true # true/false
+pp_indent_count = 4 # unsigned number
+pp_space = remove # ignore/add/remove/force
+pp_space_count = 0 # unsigned number
+pp_indent_region = 0 # number
+pp_region_indent_code = false # true/false
+pp_indent_if = 0 # number
+pp_if_indent_code = true # true/false
+pp_define_at_level = false # true/false
+pp_ignore_define_body = false # true/false
+pp_indent_case = true # true/false
+pp_indent_func_def = true # true/false
+pp_indent_extern = true # true/false
+pp_indent_brace = false # true/false
+include_category_0 = "" # string
+include_category_1 = "" # string
+include_category_2 = "" # string
+use_indent_func_call_param = true # true/false
+use_indent_continue_only_once = false # true/false
+indent_cpp_lambda_only_once = false # true/false
+use_options_overriding_for_qt_macros = true # true/false
+warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/auto-release.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/auto-release.yml
new file mode 100644
index 0000000..3bf820a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/auto-release.yml
@@ -0,0 +1,77 @@
+name: Kernel-Auto-Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ commit_id:
+ description: 'Commit ID'
+ required: true
+ default: 'HEAD'
+ version_number:
+ description: 'Version Number (Ex. 10.4.4)'
+ required: true
+ default: '10.4.4'
+ main_br_version:
+ description: "Version String for task.h on main branch (leave empty to leave as-is)."
+ required: false
+ default: ''
+
+jobs:
+ release-packager:
+ name: Release Packager
+ runs-on: ubuntu-latest
+ steps:
+ # Install python 3
+ - name: Tool Setup
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.7.10
+ architecture: x64
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ # Currently FreeRTOS/.github/scripts houses the release script. Download it for upcoming usage
+ - name: Checkout FreeRTOS Release Tools
+ uses: actions/checkout@v2
+ with:
+ repository: FreeRTOS/FreeRTOS
+ path: tools
+
+ # Simpler git auth if we use checkout action and forward the repo to release script
+ - name: Checkout FreeRTOS Kernel
+ uses: actions/checkout@v2
+ with:
+ path: local_kernel
+ fetch-depth: 0
+
+ - name: Configure git identity
+ run: |
+ git config --global user.name ${{ github.actor }}
+ git config --global user.email ${{ github.actor }}@users.noreply.github.com
+
+ - name: create a new branch that references commit id
+ working-directory: ./local_kernel
+ run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
+
+ - name: Generate SBOM
+ uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
+ with:
+ repo_path: ./local_kernel
+ source_path: ./
+
+ - name: commit SBOM file
+ working-directory: ./local_kernel
+ run: |
+ git add .
+ git commit -m 'Update SBOM'
+ git push -u origin ${{ github.event.inputs.version_number }}
+ echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
+
+ - name: Release
+ run: |
+ # Install deps and run
+ pip install -r ./tools/.github/scripts/release-requirements.txt
+ ./tools/.github/scripts/release.py FreeRTOS --kernel-repo-path=local_kernel --kernel-commit=${{ env.COMMIT_SHA }} --new-kernel-version=${{ github.event.inputs.version_number }} --new-kernel-main-br-version=${{ github.event.inputs.main_br_version }}
+ exit $?
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/ci.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/ci.yml
new file mode 100644
index 0000000..e3a622d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/ci.yml
@@ -0,0 +1,68 @@
+name: CI Checks
+on:
+ push:
+ branches: ["**"]
+ pull_request:
+ branches: [main]
+ workflow_dispatch:
+jobs:
+ spell-check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Parent Repo
+ uses: actions/checkout@v2
+ with:
+ ref: main
+ repository: aws/aws-iot-device-sdk-embedded-C
+ path: main
+ - name: Clone This Repo
+ uses: actions/checkout@v2
+ with:
+ path: ./kernel
+ - name: Install spell
+ run: |
+ sudo apt-get install spell
+ sudo apt-get install util-linux
+ - name: Check spelling
+ run: |
+ PATH=$PATH:main/tools/spell
+ # Make sure that the portable directory is not included in the spellcheck.
+ sed -i 's/find $DIRNAME/find $DIRNAME -not -path '*portable*'/g' main/tools/spell/find-unknown-comment-words
+ find-unknown-comment-words --directory kernel/ --lexicon ./kernel/.github/lexicon.txt
+ if [ "$?" = "0" ]; then
+ exit 0
+ else
+ exit 1
+ fi
+ formatting:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Uncrustify
+ run: sudo apt-get install uncrustify=0.69.0+dfsg1-1build1
+ - name: Run Uncrustify
+ run: |
+ uncrustify --version
+ find . portable/MemMang/* portable/Common/* \( -name portable \) -prune -false -o -iname "*.[hc]" -exec uncrustify --check -c .github/uncrustify.cfg {} +
+ - name: Check For Trailing Whitespace
+ run: |
+ set +e
+ grep --exclude="README.md" --exclude-dir="portable" -rnI -e "[[:blank:]]$" .
+ if [ "$?" = "0" ]; then
+ echo "Files have trailing whitespace."
+ exit 1
+ else
+ exit 0
+ fi
+
+ url-check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone This Repo
+ uses: actions/checkout@v2
+ with:
+ path: ./kernel
+ - name: URL Checker
+ run: |
+ bash kernel/.github/actions/url_verifier.sh kernel
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/git-secrets.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/git-secrets.yml
new file mode 100644
index 0000000..b78a79c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/git-secrets.yml
@@ -0,0 +1,24 @@
+name: git-secrets Check
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+jobs:
+ git-secrets:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: recursive
+ - name: Checkout awslabs/git-secrets
+ uses: actions/checkout@v2
+ with:
+ repository: awslabs/git-secrets
+ ref: master
+ path: git-secrets
+ - name: Install git-secrets
+ run: cd git-secrets && sudo make install && cd ..
+ - name: Run git-secrets
+ run: |
+ git-secrets --register-aws
+ git-secrets --scan
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/kernel-checks.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/kernel-checks.yml
new file mode 100644
index 0000000..7087bb8
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/kernel-checks.yml
@@ -0,0 +1,72 @@
+name: Kernel-Checker
+
+on: [push, pull_request]
+
+jobs:
+ kernel-checker:
+ name: FreeRTOS Kernel Header Checks
+ runs-on: ubuntu-latest
+ steps:
+ # Install python 3
+ - name: Tool Setup
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.7.10
+ architecture: x64
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ # There is shared code, hosted by FreeRTOS/FreeRTOS, with deps needed by header checker
+ - name: Checkout FreeRTOS Tools
+ uses: actions/checkout@v2
+ with:
+ repository: FreeRTOS/FreeRTOS
+ ref: main
+ path: tools
+
+ # Checkout user pull request changes
+ - name: Checkout Pull Request
+ uses: actions/checkout@v2
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ path: inspect
+
+ # Collect all affected files
+ - name: Collecting changed files
+ uses: lots0logs/gh-action-get-changed-files@2.1.4
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+
+ # Run checks
+ - name: Check File Headers
+ run: |
+ mv tools/.github/scripts/common inspect/.github/scripts
+ pip install -r inspect/.github/scripts/common/requirements.txt
+ cd inspect
+ .github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
+ exit $?
+ build-checker:
+ name: FreeRTOS Posix Build Check
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout the parent repository
+ uses: actions/checkout@v2
+ with:
+ ref: main
+ repository: FreeRTOS/FreeRTOS
+ submodules: 'recursive'
+ fetch-depth: 1
+ path: ./workspace
+ - name: Checkout the current repository
+ uses: actions/checkout@v2
+ with:
+ path: ./workspace/FreeRTOS/Source
+ - name: Posix Build Checker
+ run: |
+ bash workspace/.github/scripts/posix_build_checker.sh workspace
+ - name: Install lib pcap dev
+ run: |
+ sudo apt-get install libpcap-dev
+ - name: Posix Network Build Checker
+ run: |
+ bash workspace/.github/scripts/posix_network_build_checker.sh workspace
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/unit-tests.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/unit-tests.yml
new file mode 100644
index 0000000..0039e5b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/.github/workflows/unit-tests.yml
@@ -0,0 +1,54 @@
+name: CMock Unit Tests
+on: [push, pull_request]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Parent Repository
+ uses: actions/checkout@v2
+ with:
+ ref: main
+ repository: FreeRTOS/FreeRTOS
+ submodules: 'recursive'
+ fetch-depth: 1
+ - name: Clone This Repo
+ uses: actions/checkout@v2
+ with:
+ path: ./FreeRTOS/Source
+
+ - name: Setup Python
+ uses: actions/setup-python@master
+ with:
+ python-version: 3.8
+
+ - name: Install packages
+ run: |
+ sudo apt-get install lcov cflow ruby doxygen build-essential unifdef
+ - name: Run Unit Tests with ENABLE_SANITIZER=1
+ run: |
+ make -C FreeRTOS/Test/CMock clean
+ make -C FreeRTOS/Test/CMock ENABLE_SANITIZER=1 run_col_formatted
+ - name: Run Unit Tests for coverage
+ run: |
+ make -C FreeRTOS/Test/CMock clean
+ make -C FreeRTOS/Test/CMock lcovhtml
+ lcov --config-file FreeRTOS/Test/CMock/lcovrc --summary FreeRTOS/Test/CMock/build/cmock_test.info > FreeRTOS/Test/CMock/build/cmock_test_summary.txt
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3.1.0
+ with:
+ files: ${{ github.workspace }}/FreeRTOS/Test/CMock/build/cmock_test.info
+ root_dir: ${{ github.workspace }}/FreeRTOS/Source
+ flags: unittests
+ fail_ci_if_error: false
+ verbose: false
+ - name: Archive code coverage data
+ uses: actions/upload-artifact@v2
+ with:
+ name: coverage-data
+ path: FreeRTOS/Test/CMock/build/cmock_test*
+ - name: Archive code coverage html report
+ uses: actions/upload-artifact@v2
+ with:
+ name: coverage-report
+ path: FreeRTOS/Test/CMock/build/coverage
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/CMakeLists.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/CMakeLists.txt
new file mode 100644
index 0000000..5b048d2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/CMakeLists.txt
@@ -0,0 +1,208 @@
+cmake_minimum_required(VERSION 3.15)
+
+# User is responsible to set two mandatory options:
+# FREERTOS_CONFIG_FILE_DIRECTORY
+# FREERTOS_PORT
+#
+# User can choose which heap implementation to use (either the implementations
+# included with FreeRTOS [1..5] or a custom implementation ) by providing the
+# option FREERTOS_HEAP. If the option is not set, the cmake will default to
+# using heap_4.c.
+
+# Absolute path to FreeRTOS config file directory
+set(FREERTOS_CONFIG_FILE_DIRECTORY "" CACHE STRING "Absolute path to the directory with FreeRTOSConfig.h")
+
+if(NOT FREERTOS_CONFIG_FILE_DIRECTORY)
+ message(FATAL_ERROR " FreeRTOSConfig.h file directory not specified. Please specify absolute path to it from top-level CMake file:\n"
+ " set(FREERTOS_CONFIG_FILE_DIRECTORY CACHE STRING \"\")\n"
+ " or from CMake command line option:\n"
+ " -DFREERTOS_CONFIG_FILE_DIRECTORY='/absolute_path/to/FreeRTOSConfig.h/directory'")
+elseif(NOT EXISTS ${FREERTOS_CONFIG_FILE_DIRECTORY}/FreeRTOSConfig.h)
+ message(FATAL_ERROR " FreeRTOSConfig.h file not found in the directory specified (${FREERTOS_CONFIG_FILE_DIRECTORY})\n"
+ " Please specify absolute path to it from top-level CMake file:\n"
+ " set(FREERTOS_CONFIG_FILE_DIRECTORY CACHE STRING \"\")\n"
+ " or from CMake command line option:\n"
+ " -DFREERTOS_CONFIG_FILE_DIRECTORY='/absolute_path/to/FreeRTOSConfig.h/directory'")
+endif()
+
+# Heap number or absolute path to custom heap implementation provided by user
+set(FREERTOS_HEAP "4" CACHE STRING "FreeRTOS heap model number. 1 .. 5. Or absolute path to custom heap source file")
+
+# FreeRTOS port option
+set(FREERTOS_PORT "" CACHE STRING "FreeRTOS port name")
+
+if(NOT FREERTOS_PORT)
+ message(FATAL_ERROR " FREERTOS_PORT is not set. Please specify it from top-level CMake file (example):\n"
+ " set(FREERTOS_PORT GCC_ARM_CM4F CACHE STRING \"\")\n"
+ " or from CMake command line option:\n"
+ " -DFREERTOS_PORT=GCC_ARM_CM4F\n"
+ " \n"
+ " Available port options:\n"
+ " BCC_16BIT_DOS_FLSH186 - Compiller: BCC Target: 16 bit DOS Flsh186\n"
+ " BCC_16BIT_DOS_PC - Compiller: BCC Target: 16 bit DOS PC\n"
+ " CCS_ARM_CM3 - Compiller: CCS Target: ARM Cortex-M3\n"
+ " CCS_ARM_CM4F - Compiller: CCS Target: ARM Cortex-M4 with FPU\n"
+ " CCS_ARM_CR4 - Compiller: CCS Target: ARM Cortex-R4\n"
+ " CCS_MSP430X - Compiller: CCS Target: MSP430X\n"
+ " CODEWARRIOR_COLDFIRE_V1 - Compiller: CoreWarrior Target: ColdFire V1\n"
+ " CODEWARRIOR_COLDFIRE_V2 - Compiller: CoreWarrior Target: ColdFire V2\n"
+ " CODEWARRIOR_HCS12 - Compiller: CoreWarrior Target: HCS12\n"
+ " GCC_ARM_CA9 - Compiller: GCC Target: ARM Cortex-A9\n"
+ " GCC_ARM_CA53_64_BIT - Compiller: GCC Target: ARM Cortex-A53 64 bit\n"
+ " GCC_ARM_CA53_64_BIT_SRE - Compiller: GCC Target: ARM Cortex-A53 64 bit SRE\n"
+ " GCC_ARM_CM0 - Compiller: GCC Target: ARM Cortex-M0\n"
+ " GCC_ARM_CM3 - Compiller: GCC Target: ARM Cortex-M3\n"
+ " GCC_ARM_CM3_MPU - Compiller: GCC Target: ARM Cortex-M3 with MPU\n"
+ " GCC_ARM_CM4_MPU - Compiller: GCC Target: ARM Cortex-M4 with MPU\n"
+ " GCC_ARM_CM4F - Compiller: GCC Target: ARM Cortex-M4 with FPU\n"
+ " GCC_ARM_CM7 - Compiller: GCC Target: ARM Cortex-M7\n"
+ " GCC_ARM_CM23_NONSECURE - Compiller: GCC Target: ARM Cortex-M23 non-secure\n"
+ " GCC_ARM_CM23_SECURE - Compiller: GCC Target: ARM Cortex-M23 secure\n"
+ " GCC_ARM_CM23_NTZ_NONSECURE - Compiller: GCC Target: ARM Cortex-M23 non-trustzone non-secure\n"
+ " GCC_ARM_CM33_NONSECURE - Compiller: GCC Target: ARM Cortex-M33 non-secure\n"
+ " GCC_ARM_CM33_SECURE - Compiller: GCC Target: ARM Cortex-M33 secure\n"
+ " GCC_ARM_CM33_NTZ_NONSECURE - Compiller: GCC Target: ARM Cortex-M33 non-trustzone non-secure\n"
+ " GCC_ARM_CM33_TFM - Compiller: GCC Target: ARM Cortex-M33 non-secure for TF-M\n"
+ " GCC_ARM_CM55_NONSECURE - Compiller: GCC Target: ARM Cortex-M55 non-secure\n"
+ " GCC_ARM_CM55_SECURE - Compiller: GCC Target: ARM Cortex-M55 secure\n"
+ " GCC_ARM_CM55_NTZ_NONSECURE - Compiller: GCC Target: ARM Cortex-M55 non-trustzone non-secure\n"
+ " GCC_ARM_CM55_TFM - Compiller: GCC Target: ARM Cortex-M55 non-secure for TF-M\n"
+ " GCC_ARM_CM85_NONSECURE - Compiller: GCC Target: ARM Cortex-M85 non-secure\n"
+ " GCC_ARM_CM85_SECURE - Compiller: GCC Target: ARM Cortex-M85 secure\n"
+ " GCC_ARM_CM85_NTZ_NONSECURE - Compiller: GCC Target: ARM Cortex-M85 non-trustzone non-secure\n"
+ " GCC_ARM_CM85_TFM - Compiller: GCC Target: ARM Cortex-M85 non-secure for TF-M\n"
+ " GCC_ARM_CR5 - Compiller: GCC Target: ARM Cortex-R5\n"
+ " GCC_ARM_CRX_NOGIC - Compiller: GCC Target: ARM Cortex-Rx no GIC\n"
+ " GCC_ARM7_AT91FR40008 - Compiller: GCC Target: ARM7 Atmel AT91R40008\n"
+ " GCC_ARM7_AT91SAM7S - Compiller: GCC Target: ARM7 Atmel AT91SAM7S\n"
+ " GCC_ARM7_LPC2000 - Compiller: GCC Target: ARM7 LPC2000\n"
+ " GCC_ARM7_LPC23XX - Compiller: GCC Target: ARM7 LPC23xx\n"
+ " GCC_ATMEGA323 - Compiller: GCC Target: ATMega323\n"
+ " GCC_AVR32_UC3 - Compiller: GCC Target: AVR32 UC3\n"
+ " GCC_COLDFIRE_V2 - Compiller: GCC Target: ColdFire V2\n"
+ " GCC_CORTUS_APS3 - Compiller: GCC Target: CORTUS APS3\n"
+ " GCC_H8S2329 - Compiller: GCC Target: H8S2329\n"
+ " GCC_HCS12 - Compiller: GCC Target: HCS12\n"
+ " GCC_IA32_FLAT - Compiller: GCC Target: IA32 flat\n"
+ " GCC_MICROBLAZE - Compiller: GCC Target: MicroBlaze\n"
+ " GCC_MICROBLAZE_V8 - Compiller: GCC Target: MicroBlaze V8\n"
+ " GCC_MICROBLAZE_V9 - Compiller: GCC Target: MicroBlaze V9\n"
+ " GCC_MSP430F449 - Compiller: GCC Target: MSP430F449\n"
+ " GCC_NIOSII - Compiller: GCC Target: NiosII\n"
+ " GCC_PPC405_XILINX - Compiller: GCC Target: Xilinx PPC405\n"
+ " GCC_PPC440_XILINX - Compiller: GCC Target: Xilinx PPC440\n"
+ " GCC_RISC_V - Compiller: GCC Target: RISC-V\n"
+ " GCC_RISC_V_PULPINO_VEGA_RV32M1RM - Compiller: GCC Target: RISC-V Pulpino Vega RV32M1RM\n"
+ " GCC_RL78 - Compiller: GCC Target: Renesas RL78\n"
+ " GCC_RX100 - Compiller: GCC Target: Renesas RX100\n"
+ " GCC_RX200 - Compiller: GCC Target: Renesas RX200\n"
+ " GCC_RX600 - Compiller: GCC Target: Renesas RX600\n"
+ " GCC_RX600_V2 - Compiller: GCC Target: Renesas RX600 v2\n"
+ " GCC_RX700_V3_DPFPU - Compiller: GCC Target: Renesas RX700 v3 with DPFPU\n"
+ " GCC_STR75X - Compiller: GCC Target: STR75x\n"
+ " GCC_TRICORE_1782 - Compiller: GCC Target: TriCore 1782\n"
+ " GCC_ARC_EM_HS - Compiller: GCC Target: DesignWare ARC EM HS\n"
+ " GCC_ARC_V1 - Compiller: GCC Target: DesignWare ARC v1\n"
+ " GCC_ATMEGA - Compiller: GCC Target: ATmega\n"
+ " GCC_POSIX - Compiller: GCC Target: Posix\n"
+ " GCC_RP2040 - Compiller: GCC Target: RP2040 ARM Cortex-M0+\n"
+ " GCC_XTENSA_ESP32 - Compiller: GCC Target: Xtensa ESP32\n"
+ " GCC_AVRDX - Compiller: GCC Target: AVRDx\n"
+ " GCC_AVR_MEGA0 - Compiller: GCC Target: AVR Mega0\n"
+ " IAR_78K0K - Compiller: IAR Target: Renesas 78K0K\n"
+ " IAR_ARM_CA5_NOGIC - Compiller: IAR Target: ARM Cortex-A5 no GIC\n"
+ " IAR_ARM_CA9 - Compiller: IAR Target: ARM Cortex-A9\n"
+ " IAR_ARM_CM0 - Compiller: IAR Target: ARM Cortex-M0\n"
+ " IAR_ARM_CM3 - Compiller: IAR Target: ARM Cortex-M3\n"
+ " IAR_ARM_CM4F - Compiller: IAR Target: ARM Cortex-M4 with FPU\n"
+ " IAR_ARM_CM4F_MPU - Compiller: IAR Target: ARM Cortex-M4 with FPU and MPU\n"
+ " IAR_ARM_CM7 - Compiller: IAR Target: ARM Cortex-M7\n"
+ " IAR_ARM_CM23_NONSECURE - Compiller: IAR Target: ARM Cortex-M23 non-secure\n"
+ " IAR_ARM_CM23_SECURE - Compiller: IAR Target: ARM Cortex-M23 secure\n"
+ " IAR_ARM_CM23_NTZ_NONSECURE - Compiller: IAR Target: ARM Cortex-M23 non-trustzone non-secure\n"
+ " IAR_ARM_CM33_NONSECURE - Compiller: IAR Target: ARM Cortex-M33 non-secure\n"
+ " IAR_ARM_CM33_SECURE - Compiller: IAR Target: ARM Cortex-M33 secure\n"
+ " IAR_ARM_CM33_NTZ_NONSECURE - Compiller: IAR Target: ARM Cortex-M33 non-trustzone non-secure\n"
+ " IAR_ARM_CM55_NONSECURE - Compiller: IAR Target: ARM Cortex-M55 non-secure\n"
+ " IAR_ARM_CM55_SECURE - Compiller: IAR Target: ARM Cortex-M55 secure\n"
+ " IAR_ARM_CM55_NTZ_NONSECURE - Compiller: IAR Target: ARM Cortex-M55 non-trustzone non-secure\n"
+ " IAR_ARM_CM85_NONSECURE - Compiller: IAR Target: ARM Cortex-M85 non-secure\n"
+ " IAR_ARM_CM85_SECURE - Compiller: IAR Target: ARM Cortex-M85 secure\n"
+ " IAR_ARM_CM85_NTZ_NONSECURE - Compiller: IAR Target: ARM Cortex-M85 non-trustzone non-secure\n"
+ " IAR_ARM_CRX_NOGIC - Compiller: IAR Target: ARM Cortex-Rx no GIC\n"
+ " IAR_ATMEGA323 - Compiller: IAR Target: ATMega323\n"
+ " IAR_ATMEL_SAM7S64 - Compiller: IAR Target: Atmel SAM7S64\n"
+ " IAR_ATMEL_SAM9XE - Compiller: IAR Target: Atmel SAM9XE\n"
+ " IAR_AVR_AVRDX - Compiller: IAR Target: AVRDx\n"
+ " IAR_AVR_MEGA0 - Compiller: IAR Target: AVR Mega0\n"
+ " IAR_AVR32_UC3 - Compiller: IAR Target: AVR32 UC3\n"
+ " IAR_LPC2000 - Compiller: IAR Target: LPC2000\n"
+ " IAR_MSP430 - Compiller: IAR Target: MSP430\n"
+ " IAR_MSP430X - Compiller: IAR Target: MSP430X\n"
+ " IAR_RISC_V - Compiller: IAR Target: RISC-V\n"
+ " IAR_RL78 - Compiller: IAR Target: Renesas RL78\n"
+ " IAR_RX100 - Compiller: IAR Target: Renesas RX100\n"
+ " IAR_RX600 - Compiller: IAR Target: Renesas RX600\n"
+ " IAR_RX700_V3_DPFPU - Compiller: IAR Target: Renesas RX700 v3 with DPFPU\n"
+ " IAR_RX_V2 - Compiller: IAR Target: Renesas RX v2\n"
+ " IAR_STR71X - Compiller: IAR Target: STR71x\n"
+ " IAR_STR75X - Compiller: IAR Target: STR75x\n"
+ " IAR_STR91X - Compiller: IAR Target: STR91x\n"
+ " IAR_V850ES_FX3 - Compiller: IAR Target: Renesas V850ES/Fx3\n"
+ " IAR_V850ES_HX3 - Compiller: IAR Target: Renesas V850ES/Hx3\n"
+ " MIKROC_ARM_CM4F - Compiller: MikroC Target: ARM Cortex-M4 with FPU\n"
+ " MPLAB_PIC18F - Compiller: MPLAB Target: PIC18F\n"
+ " MPLAB_PIC24 - Compiller: MPLAB Target: PIC24\n"
+ " MPLAB_PIC32MEC14XX - Compiller: MPLAB Target: PIC32MEC14xx\n"
+ " MPLAB_PIC32MX - Compiller: MPLAB Target: PIC32MX\n"
+ " MPLAB_PIC32MZ - Compiller: MPLAB Target: PIC32MZ\n"
+ " MSVC_MINGW - Compiller: MSVC or MinGW Target: x86\n"
+ " OWATCOM_16BIT_DOS_FLSH186 - Compiller: Open Watcom Target: 16 bit DOS Flsh186\n"
+ " OWATCOM_16BIT_DOS_PC - Compiller: Open Watcom Target: 16 bit DOS PC\n"
+ " PARADIGM_TERN_EE_LARGE - Compiller: Paradigm Target: Tern EE large\n"
+ " PARADIGM_TERN_EE_SMALL - Compiller: Paradigm Target: Tern EE small\n"
+ " RENESAS_RX100 - Compiller: Renesas Target: RX100\n"
+ " RENESAS_RX200 - Compiller: Renesas Target: RX200\n"
+ " RENESAS_RX600 - Compiller: Renesas Target: RX600\n"
+ " RENESAS_RX600_V2 - Compiller: Renesas Target: RX600 v2\n"
+ " RENESAS_RX700_V3_DPFPU - Compiller: Renesas Target: RX700 v3 with DPFPU\n"
+ " RENESAS_SH2A_FPU - Compiller: Renesas Target: SH2A with FPU\n"
+ " ROWLEY_MSP430F449 - Compiller: Rowley Target: MSP430F449\n"
+ " RVDS_ARM_CA9 - Compiller: RVDS Target: ARM Cortex-A9\n"
+ " RVDS_ARM_CM0 - Compiller: RVDS Target: ARM Cortex-M0\n"
+ " RVDS_ARM_CM3 - Compiller: RVDS Target: ARM Cortex-M3\n"
+ " RVDS_ARM_CM4_MPU - Compiller: RVDS Target: ARM Cortex-M4 with MPU\n"
+ " RVDS_ARM_CM4F - Compiller: RVDS Target: ARM Cortex-M4 with FPU\n"
+ " RVDS_ARM_CM7 - Compiller: RVDS Target: ARM Cortex-M7\n"
+ " RVDS_ARM7_LPC21XX - Compiller: RVDS Target: ARM7 LPC21xx\n"
+ " SDCC_CYGNAL - Compiller: SDCC Target: Cygnal\n"
+ " SOFTUNE_MB91460 - Compiller: Softune Target: MB91460\n"
+ " SOFTUNE_MB96340 - Compiller: Softune Target: MB96340\n"
+ " TASKING_ARM_CM4F - Compiller: Tasking Target: ARM Cortex-M4 with FPU\n"
+ " CDK_THEAD_CK802 - Compiller: CDK Target: T-head CK802\n"
+ " XCC_XTENSA - Compiller: XCC Target: Xtensa\n"
+ " WIZC_PIC18 - Compiller: WizC Target: PIC18")
+endif()
+
+add_subdirectory(portable)
+
+add_library(freertos_kernel STATIC
+ croutine.c
+ event_groups.c
+ list.c
+ queue.c
+ stream_buffer.c
+ tasks.c
+ timers.c
+
+ # If FREERTOS_HEAP is digit between 1 .. 5 - it is heap number, otherwise - it is path to custom heap source file
+ $>,${FREERTOS_HEAP},portable/MemMang/heap_${FREERTOS_HEAP}.c>
+)
+
+target_include_directories(freertos_kernel
+ PUBLIC
+ include
+ ${FREERTOS_CONFIG_FILE_DIRECTORY}
+)
+
+target_link_libraries(freertos_kernel freertos_kernel_port)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/ChangeLogKSDK.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/ChangeLogKSDK.txt
new file mode 100644
index 0000000..91a0697
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/ChangeLogKSDK.txt
@@ -0,0 +1,52 @@
+/**
+@page rtos_log RTOS Change Log
+
+@section FreeRTOS kernel for MCUXpresso SDK.
+The current version is FreeRTOS kernel 10.4.3-LTS-Patch-2 Original package is available at github.com/FreeRTOS/FreeRTOS-Kernel.
+
+ - 10.5.1_rev0
+ - update amazon freertos version
+
+ - 10.4.3_rev1
+ - Apply CM33 security fix from 10.4.3-LTS-Patch-2. See rtos\freertos\freertos_kernel\History.txt
+ - Apply CM33 security fix from 10.4.3-LTS-Patch-1. See rtos\freertos\freertos_kernel\History.txt
+
+ - 10.4.3_rev0
+ - update amazon freertos version.
+
+ - 10.4.3_rev0
+ - update amazon freertos version.
+
+ - 9.0.0_rev3
+ - New features:
+ - Tickless idle mode support for Cortex-A7. Add fsl_tickless_epit.c and fsl_tickless_generic.h in portable/IAR/ARM_CA9 folder.
+ - Enabled float context saving in IAR for Cortex-A7. Added configUSE_TASK_FPU_SUPPORT macros. Modified port.c and portmacro.h in portable/IAR/ARM_CA9 folder.
+ - Other changes:
+ - Transformed ARM_CM core specific tickless low power support into generic form under freertos/Source/portable/low_power_tickless/.
+
+ - 9.0.0_rev2
+ - New features:
+ - Enabled MCUXpresso thread aware debugging. Add freertos_tasks_c_additions.h and configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H and configFRTOS_MEMORY_SCHEME macros.
+
+ - 9.0.0_rev1
+ - New features:
+ - Enabled -flto optimization in GCC by adding __attribute__((used)) for vTaskSwitchContext.
+ - Enabled KDS Task Aware Debugger. Apply FreeRTOS patch to enable configRECORD_STACK_HIGH_ADDRESS macro. Modified files are task.c and FreeRTOS.h.
+
+ - 9.0.0_rev0
+ - New features:
+ - Example freertos_sem_static.
+ - Static allocation support RTOS driver wrappers.
+ - Other changes:
+ - Tickless idle rework. Support for different timers is in separated files (fsl_tickless_systick.c, fsl_tickless_lptmr.c).
+ - Removed configuration option configSYSTICK_USE_LOW_POWER_TIMER. Low power timer is now selected by linking of apropriate file fsl_tickless_lptmr.c.
+ - Removed configOVERRIDE_DEFAULT_TICK_CONFIGURATION in RVDS port. Use of __attribute__((weak)) is the preferred solution. Not same as _weak!
+
+ - 8.2.3
+ - New features:
+ - Tickless idle mode support.
+ - Added template application for Kinetis Expert (KEx) tool (template_application).
+ - Other changes:
+ - Folder structure reduction. Keep only Kinetis related parts.
+
+*/
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/GitHub-FreeRTOS-Kernel-Home.url b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/GitHub-FreeRTOS-Kernel-Home.url
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/GitHub-FreeRTOS-Kernel-Home.url
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/GitHub-FreeRTOS-Kernel-Home.url
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/History.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/History.txt
similarity index 89%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/History.txt
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/History.txt
index f91df9f..544b0bf 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/History.txt
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/History.txt
@@ -1,2855 +1,3057 @@
-Documentation and download available at https://www.FreeRTOS.org/
-
-Changes between FreeRTOS V10.4.3 LTS Patch 1 and FreeRTOS V10.4.3 LTS Patch 2
-
- + ARMv7-M and ARMv8-M MPU ports – prevent non-kernel code from calling the
- internal functions xPortRaisePrivilege and vPortResetPrivilege by changing
- them to macros.
-
-Changes between FreeRTOS V10.4.3 and FreeRTOS V10.4.3 LTS Patch 1 released September 10 2021
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.4.5.html
-
- + ARMv8-M secure-side port: Tasks that call secure functions from the
- non-secure side of an ARMv8-M MCU (ARM Cortex-M23 and Cortex-M33) have two
- contexts – one on the non-secure side and one on the secure-side. Previous
- versions of the FreeRTOS ARMv8-M secure-side ports allocated the structures
- that reference secure-side contexts at run time. Now the structures are
- allocated statically at compile time. The change necessitates the
- introduction of the secureconfigMAX_SECURE_CONTEXTS configuration constant,
- which sets the number of statically allocated secure contexts.
- secureconfigMAX_SECURE_CONTEXTS defaults to 8 if left undefined.
- Applications that only use FreeRTOS code on the non-secure side, such as
- those running third-party code on the secure side, are not affected by
- this change.
-
-
-Changes between FreeRTOS V10.4.2 and FreeRTOS V10.4.3 released December 14 2020
-
- V10.4.3 is included in the 202012.00 LTS release. Learn more at https:/freertos.org/lts-libraries.html
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
-
- + Changes to improve robustness and consistency for buffer allocation in
- the heap, queue and stream buffer.
- + The following functions can no longer be called from unprivileged code.
- - xTaskCreateRestricted
- - xTaskCreateRestrictedStatic
- - vTaskAllocateMPURegions
-
-
-Changes between FreeRTOS V10.4.1 and FreeRTOS V10.4.2 released November 10 2020
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
-
- + Fix an issue in the ARMv8-M ports that caused BASEPRI to be masked
- between the first task starting to execute and that task making
- a FreeRTOS API call.
- + Introduced xTaskDelayUntil(), which is functionally equivalent to
- vTaskDelayUntil(), with the addition of returning a value to
- indicating whether or not the function placed the calling task into
- the Blocked state or not.
- + Update WolfSSL to 4.5.0 and add the FIPS ready demo.
- + Add support for ESP IDF 4.2 to ThirdParty Xtensa port.
- + Re-introduce uxTopUsedPriority to support OpenOCD debugging.
- + Convert most dependent libraries in FreeRTOS/FreeRTOS to submodules.
- + Various general maintenance and improvements to MISRA compliance.
-
-
-Changes between FreeRTOS V10.4.0 and FreeRTOS V10.4.1 released September 17 2020
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
-
- + Fixed an incorrectly named parameter that prevented the
- ulTaskNotifyTakeIndexed macro compiling, and the name space clash in the
- test code that prevented this error causing test failures.
-
-
-Changes between FreeRTOS V10.3.1 and FreeRTOS V10.4.0 released September 10 2020
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
-
- Major enhancements:
-
- + Task notifications: Prior to FreeRTOS V10.4.0 each created task had a
- single direct to task notification. From FreeRTOS V10.4.0 each task has
- an array of notifications. The direct to task notification API has been
- extended with API functions postfixed with "Indexed" to enable the API to
- operate on a task notification at any array index. See
- https://www.freertos.org/RTOS-task-notifications.html for more information.
- + Kernel ports that support memory protection units (MPUs): The ARMv7-M and
- ARMv8-M MPU ports now support a privilege access only heap. The ARMv7-M
- MPU ports now support devices that have 16 MPU regions, have the ability
- to override default memory attributes for privileged code and data
- regions, and have the ability to place the FreeRTOS kernel code outside of
- the Flash memory. The ARMv8-M MPU ports now support tickless idle mode.
- See https://www.freertos.org/FreeRTOS-MPU-memory-protection-unit.html
- for more information.
-
- Additional noteworthy updates:
-
- + Code formatting is now automated to facilitate the increase in
- collaborative development in Git. The auto-formated code is not identical
- to the original formatting conventions. Most notably spaces are now used
- in place of tabs.
- + The prototypes for callback functions (those that start with "Application",
- such as vApplicationStackOverflowHook()) are now in the FreeRTOS header
- files, removing the need for application writers to add prototypes into
- the C files in which they define the functions.
- + New Renesas RXv3 port layer.
- + Updates to the Synopsys ARC code, including support for EM and HS cores,
- and updated BSP.
- + Added new POSIX port layer that allows FreeRTOS to run on Linux hosts in
- the same way the Windows port layer enables FreeRTOS to run on Windows
- hosts.
- + Many other minor optimisations and enhancements. For full details
- see https://github.com/FreeRTOS/FreeRTOS-Kernel/commits/master
-
-
-Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
-
- + ./FreeRTOS-Labs directory was removed from this file. The libraries it
- contained are now available as a separate download.
-
-Changes between FreeRTOS V10.2.1 and FreeRTOS V10.3.0 released February 7 2020
-
- See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
-
- New and updated kernel ports:
-
- + Added RISC-V port for the IAR compiler.
- + Update the Windows simulator port to use a synchronous object to prevent
- a user reported error whereby a task continues to run for a short time
- after being moved to the Blocked state. Note we were not able to
- replicate the reported issue and it likely depends on your CPU model.
- + Correct alignment of stack top in RISC-V port when
- configISR_STACK_SIZE_WORDS is defined to a non zero value, which causes
- the interrupt stack to be statically allocated.
- + The RISC-V machine timer compare register can now be for any HART, whereas
- previously it was always assumed FreeRTOS was running on HART 0.
- + Update the sequence used to update the 64-bit machine timer
- compare register on 32-bit cores to match that suggested in RISC-V
- documentation.
- + Added tickless low power modes into the ARM, IAR and GCC Cortex-M0 compiler
- ports.
- + Updated the behaviour of the ARMv7-M MPU (Memory Protection Unit) ports to
- match that of the ARMv8-M ports whereby privilege escalations can only
- originate from within the kernel's own memory segment. Added
- configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY configuration constant.
- + Update existing MPU ports to correctly disable the MPU before it is
- updated.
- + Added contributed port and demo application for a T-Head (formally C-SKY)
- microcontroller.
-
- New API functions:
-
- + Added the vPortGetHeapStats() API function which returns information on
- the heap_4 and heap_5 state.
- + Added xTaskCatchUpTicks(), which corrects the tick count value after the
- application code has held interrupts disabled for an extended period.
- + Added xTaskNotifyValueClear() API function.
- + Added uxTimerGetReloadMode() API function.
-
- Other miscellaneous changes:
- + Change type of uxPendedTicks from UBaseType_t to TickType_t to ensure it
- has the same type as variables with which it is compared to, and therefore
- also renamed the variable xPendingTicks.
- + Update Keil projects that use the MPU so memory regions come from linker
- script (scatter file) variables instead of being hard coded.
- + Added LPC51U68 Cortex-M0+ demos for GCC (MCUXpresso), Keil and IAR
- compilers.
- + Added CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube demo.
- + Added LPC54018 MPU demo.
- + Rename xTaskGetIdleRunTimeCounter() to ulTaskGetIdleRunTimeCounter().
-
-
-Changes between FreeRTOS V10.2.1 and FreeRTOS V10.2.0 released May 13 2019:
-
- + Added ARM Cortex-M23 port layer to complement the pre-existing ARM
- Cortex-M33 port layer.
- + The RISC-V port now automatically switches between 32-bit and 64-bit
- cores.
- + Introduced the portMEMORY_BARRIER macro to prevent instruction re-ordering
- when GCC link time optimisation is used.
- + Introduced the portDONT_DISCARD macro to the ARMv8-M ports to try and
- prevent the secure side builds from removing symbols required by the
- non secure side build.
- + Introduced the portARCH_NAME to provide additional data to select semi-
- automated build environments.
- + Cortex-M33 and Cortex-M23 ports now correctly disable the MPU before
- updating the MPU registers.
-
- + Added Nuvoton NuMaker-PFM-M2351 ARM Cortex-M23 demo.
- + Added LPC55S69 ARM Cortex-M33 demo.
- + Added an STM32 dual core AMP stress test demo.
-
-
-Changes between FreeRTOS V10.1.1 and FreeRTOS V10.2.0 released February 25 2019:
-
- + Added GCC RISC-V MCU port with three separate demo applications.
- + Included pre-existing ARM Cortex-M33 (ARMv8-M) GCC/ARMclang and IAR ports
- with Keil simulator demo.
- + Update the method used to detect if a timer is active. Previously the
- timer was deemed to be inactive if it was not referenced from a list.
- However, when a timer is updated it is temporarily removed from, then
- re-added to a list, so now the timer's active status is stored separately.
- + Add vTimerSetReloadMode(), xTaskGetIdleRunTimeCounter(), and
- xTaskGetApplicationTaskTagFromISR() API functions.
- + Updated third party Xtensa port so it is MIT licensed.
- + Added configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H to the Renesas
- compiler RX600v2 port to enable switching between platform.h and
- iodefine.h includes within that port's port.c file.
- + Removed the 'FromISR' functions from the MPU ports as ISRs run privileged
- anyway.
- + Added uxTaskGetStackHighWaterMark2() function to enable the return type to
- be changed without breaking backward compatibility.
- uxTaskGetStackHighWaterMark() returns a UBaseType_t as always,
- uxTaskGetStackHighWaterMark2() returns configSTACK_DEPTH_TYPE to allow the
- user to determine the return type.
- + Fixed issues in memory protected ports related to different combinations
- of static memory only and dynamic memory only builds. As a result the
- definition of tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE became more
- complex and was moved to FreeRTOS.h with a table explaining its definition.
- + Added a 'get task tag from ISR' function.
- + Change the method used to determine if a timer is active or not from just
- seeing if it is referenced from the active timer list to storing its
- active state explicitly. The change prevents the timer reporting that it
- is inactive while it is being moved from one list to another.
- + The pcName parameter passed into the task create functions can be NULL,
- previously a name had to be provided.
- + When using tickless idle, prvResetNextTaskUnblockTime() is now only called
- in xTaskRemoveFromEventList() if the scheduler is not suspended.
- + Introduced portHAS_STACK_OVERFLOW_CHECKING, which should be set to 1 for
- FreeRTOS ports that run on architectures that have stack limit registers.
-
-
-Changes between FreeRTOS V10.1.0 and FreeRTOS V10.1.1 released 7 September 2018
-
- + Reverted a few structure name changes that broke several kernel aware
- debugger plug-ins.
- + Updated to the latest trace recorder code.
- + Fixed some formatting in the FreeRTOS+TCP TCP/IP stack code.
- + Reverted moving some variables from file to function scope as doing so
- broke debug scenarios that require the static qualifier to be removed.
-
-Changes between FreeRTOS V10.0.1 and FreeRTOS V10.1.0 released 22 August 2018
-
- FreeRTOS Kernel Changes:
-
- + Update lint checked MISRA compliance to use the latest MISRA standard, was
- previously using the original MISRA standard.
- + Updated all object handles (TaskHandle_t, QueueHandle_t, etc.) to be
- unique types instead of void pointers, improving type safety. (this was
- attempted some years back but had to be backed out due to bugs in some
- debuggers). Note this required the pvContainer member of a ListItem_t
- struct to be renamed - set configENABLE_BACKWARD_COMPATIBILITY to 1 if
- this causes an issue.
- + Added configUSE_POSIX_ERRNO to enable per task POSIX style errno
- functionality in a more user friendly way - previously the generic thread
- local storage feature was used for this purpose.
- + Added Xtensa port and demo application for the XCC compiler.
- + Changed the implementation of vPortEndScheduler() for the Win32 port to
- simply call exit( 0 ).
- + Bug fix in vPortEnableInterrupt() for the GCC Microblaze port to protect
- the read modify write access to an internal Microblaze register.
- + Fix minor niggles when the MPU is used with regards to prototype
- differences, static struct size differences, etc.
- + The usStackHighWaterMark member of the TaskStatus_t structure now has type
- configSTACK_DEPTH_TYPE in place of uint16_t - that change should have been
- made when the configSTACK_DEPTH_TYPE type (which gets around the previous
- 16-bit limit on stack size specifications) was introduced.
- + Added the xMessageBufferNextLengthBytes() API function and likewise stream
- buffer equivalent.
- + Introduce configMESSAGE_BUFFER_LENGTH_TYPE to allow the number of bytes
- used to hold the length of a message in the message buffer to be reduced.
- configMESSAGE_BUFFER_LENGTH_TYPE default to size_t, but if, for example,
- messages can never be more than 255 bytes it could be set to uint8_t,
- saving 3 bytes each time a message is written into the message buffer
- (assuming sizeof( size_t ) is 4).
- + Updated the StaticTimer_t structure to ensure it matches the size of the
- Timer_t structure when the size of TaskFunction_t does not equal the size
- of void *.
- + Update various Xilinx demos to use 2018.1 version of the SDK tools.
- + Various updates to demo tasks to maintain test coverage.
- + FreeRTOS+UDP was removed in FreeRTOS V10.1.0 as it was replaced by
- FreeRTOS+TCP, which was brought into the main download in FreeRTOS
- V10.0.0. FreeRTOS+TCP can be configured as a UDP only stack, and
- FreeRTOS+UDP does not contain the patches applied to FreeRTOS+TCP.
-
- FreeRTOS+TCP Changes:
-
- + Multiple security improvements and fixes in packet parsing routines, DNS
- caching, and TCP sequence number and ID generation.
- + Disable NBNS and LLMNR by default.
- + Add TCP hang protection by default.
-
- We thank Ori Karliner of Zimperium zLabs Team for reporting these issues.
-
-
-Changes between FreeRTOS V10.0.0 and FreeRTOS V10.0.1, released December 20 2017
-
- + Fix position of "#if defined( __cplusplus )" in stream_buffer.h.
- + Correct declarations of MPU_xQueuePeek() and MPU_xQueueSemaphoreTake() in
- mpu_prototypes.h.
- + Correct formatting in vTaskList() helper function when it prints the state
- of the currently executing task.
- + Introduce #error if stream_buffer.c is built without
- configUSE_TASK_NOTIFICATIONS set to 1.
- + Update FreeRTOS+TCP to V2.0.0
- - Improve the formatting of text that displays the available netword
- interfaces when FreeRTOS+TCP is used on Windows with WinPCap.
- - Introduce ipconfigSOCKET_HAS_USER_WAKE_CALLBACK option to enable a user
- definable callback to execute when data arrives on a socket.
-
-Changes between FreeRTOS V9.0.1 and FreeRTOS V10.0.0:
-
- The FreeRTOS kernel is now MIT licensed: https://www.FreeRTOS.org/license
-
- New Features and components:
-
- + Stream Buffers - see https://www.FreeRTOS.org/RTOS-stream-buffer-example.html
- + Message Buffers - see https://www.FreeRTOS.org//RTOS-message-buffer-example.html
- + Move FreeRTOS+TCP into the main repository, along with the basic Win32
- TCP demo FreeRTOS_Plus_TCP_Minimal_Windows_Simulator.
-
- New ports or demos:
-
- + Added demo for TI SimpleLink CC3220 MCU.
- + Added MPU and non MPU projects for Microchip CEC and MEC 17xx and 51xx
- MCUs.
- + Added CORTEX_MPU_Static_Simulator_Keil_GCC demo to test static allocation
- in the MPU port.
-
- Fixes or enhancements:
-
- + Cortex-M ports push additional register prior to calling
- vTaskSwitchContext to ensure 8-byte alignment is maintained. Only
- important if a user defined tick hook function performs an operation that
- requires 8-byte alignment.
- + Optimisations to the implementation of the standard tickless idle mode on
- Cortex-M devices.
- + Improvements to the Win32 port including using higher priority threads.
- + Ensure interrupt stack alignment on PIC32 ports.
- + Updated GCC TriCore port to build with later compiler versions.
- + Update mpu_wrappers.c to support static allocation.
- + The uxNumberOfItems member of List_t is now volatile - solving an issue
- when the IAR compiler was used with maximum optimization.
- + Introduced configRECORD_STACK_HIGH_ADDRESS. When set to 1 the stack start
- address is saved into each task's TCB (assuming stack grows down).
- + Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow user defined
- functionality, and user defined initialisation, to be added to FreeRTOS's
- tasks.c source file. When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is
- set to 1 a user provided header file called freertos_task_c_additions.h
- will be included at the bottom of tasks.c. Functions defined in that
- header file can call freertos_tasks_c_additions_init(), which in turn
- calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(), if it is defined.
- FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in FreeRTOSConfig.h.
- + Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x ) which can be
- defined by a user in FreeRTOSConfig.h. The macro is called before
- assessing whether to enter tickless idle mode or not. If the macro sets
- x to zero then tickless idle mode will not be entered. This allows users
- to abort tickless idle mode entry before the tickless idle function is
- even called - previously it was only possible to abort from within the
- tickless idle function itself.
- + Added configPRINTF(), which can be defined by users to allow all libraries
- to use the same print formatter.
- + Introduced configMAX() and configMIN() macros which default to standard
- max( x, y ) and min( x, y ) macro behaviour, but can be overridden if the
- application writer defines the same macros in FreeRTOSConfig.h.
- + Corrected the definition of StaticTask_t in the case where
- INCLUDE_xTaskAbortDelay is set to 1.
- + Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME, both of
- which can be defined to strings in FreeRTOSConfig.h to change the default
- names of the timer service and idle tasks respectively.
- + Only fill the stack of a newly created task with a known value if stack
- checking, or high water mark checking/viewing, is in use - removing the
- dependency on memset() in other cases.
- + Introduced xTaskCreateRestrictedStatic() so static allocation can be used
- with the MPU.
- + Ensure suspended tasks cannot be unsuspended by a received task
- notification.
- + Fix race condition in vTaskSetTimeOutState().
- + Updated trace recorder files to the latest version.
-
-Changes since FreeRTOS V9.0.0:
-
- + Priority dis-inheritance behaviour has been enhanced in the case where a
- task that attempted to take a mutex that was held by a lower priority task
- timed out before it was able to obtain the mutex (causing the task that
- holds the mutex to have its priority raised, then lowered again, in
- accordance with the priority inheritance protocol).
- + Split the overloaded xQueueGenericReceive() function into three separate
- dedicated functions.
- + Allow the default human readable text names given to the Idle and Timer
- tasks to be overridden by defining the configIDLE_TASK_NAME and
- configTIMER_SERVICE_TASK_NAME definitions respectively in FreeRTOSConfig.h.
- + Introduced configINITIAL_TICK_COUNT to allow the tick count to take a
- value of than than 0 when the system boots. This can be useful for
- testing purposes - although setting configUSE_16_BIT_TICKS to 1 can also
- be used to test frequent tick overflows.
- + Ensure the Cortex-M SysTick count is cleared to zero before starting the
- first task.
- + Add configASSERT() into ARM Cortex-M ports to check the number of priority
- bit settings.
- + Clear the 'control' register before starting ARM Cortex-M4F ports in case
- the FPU is used before the scheduler is started. This just saves a few
- bytes on the main stack as it prevents space being left for a later save
- of FPU registers.
- + Added xSemaphoreGetMutexHolderFromISR().
- + Corrected use of portNVIC_PENDSVSET to portNVIC_PENDSVSET_BIT in MPU ports.
- + Introduced configSTACK_DEPTH_TYPE to allow users to change the type used
- to specify the stack size when using xTaskCreate(). For historic reasons,
- when FreeRTOS was only used on small MCUs, the type was set to uint16_t,
- but that can be too restrictive when FreeRTOS is used on larger
- processors. configSTACK_DEPTH_TYPE defaults to uint16_t.
- xTaskCreateStatic(), being a newer function, used a uint32_t.
- + Increase the priority of the Windows threads used by the Win32 port. As
- all the threads run on the same core, and the threads run with very high
- priority, there is a risk that the host will become unresponsive, so also
- prevent the Windows port executing on single core hosts.
-
-Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
-
- See https://www.FreeRTOS.org/FreeRTOS-V9.html
-
- RTOS kernel updates:
-
- + The prototype of the new xTaskCreateStatic() API function was modified to
- remove a parameter and improve compatibility with other new
- "CreateStatic()" API functions. The stack size parameter in
- xTaskCreateStatic() is now uint32_t, which changes the prototype of the
- callback functions. See the following URL:
- https://www.FreeRTOS.org/xTaskCreateStatic.html
- + GCC ARM Cortex-A port: Introduced the configUSE_TASK_FPU_SUPPORT
- constant. When configUSE_TASK_FPU_SUPPORT is set to 2 every task is
- automatically given a floating point (FPU) context.
- + GCC ARM Cortex-A port: It is now possible to automatically save and
- restore all floating point (FPU) registers on entry to each potentially
- nested interrupt by defining vApplicationFPUSafeIRQHandler() instead of
- vApplicationIRQHandler().
- + All ARM Cortex-M3/4F/7 ports: Clear the least significant bit of the task
- entry address placed onto the stack of a task when the task is created for
- strict compliance with the ARM Cortex-M3/4/7 architecture documentation
- (no noticeable effect unless using the QMEU emulator).
- + Added GCC and Keil ARM Cortex-M4F MPU ports - previously the MPU was only
- supported on ARM Cortex-M3.
- + ARM Cortex-M3/4F MPU ports: Update to fully support the FreeRTOS V9.0.0
- API (other than static object creation) and added the
- FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC demo application to
- demonstrate how to use the updated MPU port.
- + All ARM Cortex-M3/4F/7 ports: Add additional barrier instructions to the
- default low power tickless implementation.
- + All ARM Cortex-M0 ports: Prevent an item being left on the stack of the
- first task that executes.
- + Win32 ports: Reduce the amount of stack used and change the way Windows
- threads are deleted to increase the maximum execution time.
- + Add an ARM Cortex-M4F port for the MikroC compiler. Ensure to read the
- documentation page for this port before use.
- + MPS430X IAR port: Update to be compatible with the latest EW430 tools
- release.
- + IAR32 GCC port: Correct vPortExitCritical() when
- configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY.
- + For consistency vTaskGetTaskInfo() now has the alias vTaskGetInfo(),
- xTaskGetTaskHandle() now has the alias xTaskGetHandle() and
- pcQueueGetQueueName() now has an alias pcQueueGetName().
- + Fix various errors in comments and compiler warnings.
-
- Demo application updates:
-
- + Update Atmel Studio projects to use Atmel Studio 7.
- + Update Xilinx SDK projects to use the 2016.1 version of the SDK.
- + Remove dependency on legacy IO libraries from the PIC32 demos.
- + Move the Xilinx UltraScale Cortex-R5 demo into the main distribution.
- + Update the MSP432 libraries to the latest version.
- + Add Microchip CEC1302 (ARM Cortex-M4F) demos for GCC, Keil and MikroC
- compilers.
- + Move the Atmel SAMA5D2 demo into the main distribution.
-
-Changes between FreeRTOS V9.0.0rc1 and FreeRTOS V9.0.0rc2 (release candidate 2)
-released March 30 2016:
-
- NOTE - See https://www.FreeRTOS.org/FreeRTOS-V9.html for details
-
- + The functions that create RTOS objects using static memory allocation have
- been simplified and will not revert to using dynamic allocation if a
- buffer is passed into a function as NULL.
- + Introduced the configSUPPORT_DYNAMIC_ALLOCATION configuration constant to
- allow a FreeRTOS application to be built without a heap even being being
- defined. The Win32 example located in the
- /FreeRTOS/demo/WIN32-MSVC-Static-Allocation-Only directory is provided as
- a reference for projects that do not include a FreeRTOS heap.
- + Minor run-time optimisations.
- + Two new low power tickless implementations that target Silicon Labs EFM32
- microcontrollers.
- + Addition of the xTimerGetPeriod() and xTimerGetExpireTime() API functions.
-
-Changes between FreeRTOS V8.2.3 and FreeRTOS V9.0.0rc1 (release candidate 1)
-released February 19 2016:
-
- RTOS Kernel Updates:
-
- + Major new feature - tasks, semaphores, queues, timers and event groups can
- now be created using statically allocated memory, so without any calls to
- pvPortMalloc().
- + Major new features - Added the xTaskAbortDelay() API function which allows
- one task to force another task to immediately leave the Blocked state,
- even if the event the blocked task is waiting for has not occurred, or the
- blocked task's timeout has not expired.
- + Updates necessary to allow FreeRTOS to run on 64-bit architectures.
- + Added vApplicationDaemonTaskStartupHook() which executes when the RTOS
- daemon task (which used to be called the timer service task) starts
- running. This is useful if the application includes initialisation code
- that would benefit from executing after the scheduler has been started.
- + Added the xTaskGetTaskHandle() API function, which obtains a task handle
- from the task's name. xTaskGetTaskHandle() uses multiple string compare
- operations, so it is recommended that it is called only once per task.
- The handle returned by xTaskGetTaskHandle() can then be stored locally for
- later re-use.
- + Added the pcQueueGetQueueName() API function, which obtains the name of
- a queue from the queue's handle.
- + Tickless idling (for low power applications) can now also be used when
- configUSE_PREEMPTION is 0.
- + If one task deletes another task, then the stack and TCB of the deleted
- task is now freed immediately. If a task deletes itself, then the stack
- and TCB of the deleted task are freed by the Idle task as before.
- + If a task notification is used to unblock a task from an ISR, but the
- xHigherPriorityTaskWoken parameter is not used, then pend a context switch
- that will then occur during the next tick interrupt.
- + Heap_1.c and Heap_2.c now use the configAPPLICATION_ALLOCATED_HEAP
- settings, which previously was only used by heap_4.c.
- configAPPLICATION_ALLOCATED_HEAP allows the application writer to declare
- the array that will be used as the FreeRTOS heap, and in-so-doing, place
- the heap at a specific memory location.
- + TaskStatus_t structures are used to obtain details of a task.
- TaskStatus_t now includes the bae address of the task's stack.
- + Added the vTaskGetTaskInfo() API function, which returns a TaskStatus_t
- structure that contains information about a single task. Previously this
- information could only be obtained for all the tasks at once, as an array
- of TaskStatus_t structures.
- + Added the uxSemaphoreGetCount() API function.
- + Replicate previous Cortex-M4F and Cortex-M7 optimisations in some
- Cortex-M3 port layers.
-
- Demo Application Updates:
-
- Further demo applications will be added prior to the final FreeRTOS V9
- release.
-
- + Updated SAM4L Atmel Studio project to use Atmel Studio 7.
- + Added ARM Cortex-A53 64-bit port.
- + Added a port and demo for the ARM Cortex-A53 64-bit cores on the Xilinx
- Ultrascale MPSoC.
- + Added Cortex-M7 SAME70 GCC demo.
- + Added EFM32 Giant and Wonder Gecko demos.
-
-
-Changes between V8.2.2 and V8.2.3 released October 16, 2015
-
- RTOS kernel updates:
-
- + Fix bug identified in a modification made in V8.2.2 to the software timer
- code that allows tickless low power applications to sleep indefinitely
- when software timers are used.
- + Simplify and improve efficiency of stack overflow checking.
- + Add xTaskNotifyStateClear() API function.
- + New IAR and GCC Cortex-R ports for microprocessors that do not use an ARM
- generic interrupt controller (GIC).
- + New PIC32MEC14xx port.
- + Add support for PIC32MZ EF parts (with floating point) into the PIC32MZ
- port.
- + Zynq7000 port layer now declares the functions that setup and clear the
- tick interrupt as weak symbols so they can be overridden by the
- application, and uses a global XScuGic object so the same object can be
- used by the application code.
- + Introduced configUSE_TASK_FPU_SUPPORT, although the PIC32MZ EF port is
- currently the only port that uses it.
- + Updates to RL78 and 78K0 IAR port layers to improve support for
- combinations of memory models.
- + Minor updates to heap_5.c to remove compiler warnings generated by some
- compilers.
- + License simplifications. See /FreeRTOS/License/license.txt in the
- official distribution.
-
- FreeRTOS+ updates:
-
- + Update directory names to use WolfSSL instead of CyaSSL, inline with
- WolfSSL's re-branding.
- + Update to latest WolfSSL code.
- + Update to latest FreeRTOS+Trace recorder code.
- + Add in the FreeRTOS+Trace recorder library required for streaming trace.
-
- Demo application changes:
-
- + Add demo applications for Renesas RZ/T (Cortex-R), PIC32MZ EF (PIC32 with
- floating point hardware), PIC32MEC14xx, RX71M, RX113 and RX231.
- + General tidy up of spelling and compiler warnings.
-
-
-Changes between V8.2.1 and V8.2.2 released August 12, 2015
-
- RTOS kernel updates:
-
- + Added Intel IA32/x86 32-bit port.
- + General maintenance.
- + PRIVILEGED_FUNCTION and PRIVILEGED_DATA macros, which are used in memory
- protected systems, have been added to the newer event group and software
- timer functions.
- + Add the errno definitions used by FreeRTOS+ components into projdefs.h.
- + Remove the restriction that prevented tick-less idle implementations
- waiting indefinitely when software timers were used in the same
- application.
- + Introduce xTaskNotifyAndQueryFromISR() as the interrupt safe version of
- xTaskNotifyAndQuery().
- + Add additional NOPs to the MSP430X port layers to ensure strict compliance
- with the hardware documentation.
- + Microblaze port: Added option for port optimised task selection.
- + Microblaze port: Previously tasks inherited the exception enable state
- at the time the task was created. Now all tasks are created with
- exceptions enabled if the Microblaze design supports exceptions.
- + Windows port: Add additional safe guards to ensure the correct start up
- sequence and thread switching timing.
- + Windows port: Improve the implementation of the port optimised task
- selection assembly code.
- + Update heap_4 and heap_5 to allow use on 64-bit processors.
- + Simplify the code that creates a queue.
- + General improved tick-less idle behaviour.
- + Ensure none of the variables in the common kernel files are initialised to
- anything other than zero.
- + Correct calculation of xHeapStructSize in heap_4 and heap_5.
-
- Demo application updates:
-
- + Added demo project for the new IA32/x86 port that targets the Galileo
- hardware.
- + Added MSP430FR5969 demos (previously provided as a separate download).
- + Added FreeRTOS BSP repository for automatic creation of FreeRTOS
- applications in the Xilinx SDK.
- + Added Atmel Studio / GCC project for the SAMV71 (ARM Cortex-M7)
- + Update Xilinx SDK projects to use version 2015.2 of the SDK.
- + Remove Microblaze demos that were using obsolete tools.
- + Add MSP43FR5969 IAR and CCS demos.
-
- FreeRTOS+ Updates:
-
- + Updated FreeRTOS+Trace recorder library, which requires an update to the
- FreeRTOS+Trace application.
- + Added Reliance Edge source code and demo application. Reliance edge is
- a fail safe transactional file system ideal for applications that require
- file storage, and especially when high reliability is essential.
- + Introduce configAPPLICATION_PROVIDES_cOutputBuffer to allow FreeRTOS+CLI
- users to place the output buffer at a fixed memory address.
- + Improve the NetworkInterface.c file provided for the Windows port of
- FreeRTOS+UDP.
-
-Changes between V8.2.0 and V8.2.1 released 24th March 2015.
-
- RTOS kernel updates:
-
- + Added user definable and flexible thread local storage facility.
- + Added vTimerSetTimerID() API function to complement the pvTimerGetTimerID()
- function to allow the timer's ID to be used as timer local storage.
- + Fixed a potential issue related to the use of queue sets from an ISR.
- + Some updates to the Xilinx Microblaze GCC port.
- + Added ARM Cortex-M4F port for Texas Instruments Code Composer Studio.
- + Added ARM Cortex-M7 r0p1 port layer for IAR, GCC and Keil which contains a
- minor errata work around. All other ARM Cortex-M7 core revisions should
- use the ARM Cortex-M4F port.
- + Exclude the whole of croutine.c if configUSE_CO_ROUTINES is set to 0.
- + Change some data types from uint32_t to size_t in preparation for 64-bit
- Windows port.
- + Update the PIC32 port to remove deprecation warnings output by the latest
- XC32 compilers.
- + Fix bug when xQueueOverwrite() and xQueueOverwrite() from ISR are used to
- overwrite items in two queues that are part of the same set.
-
- Demo application updates:
-
- + Added demo application for TI's ARM Cortex-M4F based MSP432
- microcontroller using IAR, Keil and CCS compilers.
- + Added demo application for STM32F ARM Cortex-M7 based microcontroller
- using IAR and Keil.
- + Added demo application for Atmel SAMV71 ARM Cortex-M7 based
- microcontroller using IAR and Keil.
- + Added Microblaze demo that uses the 2014.4 version of the Xilinx SDK and
- runs on the KC705 evaluation board (Kintex FPGA).
-
-Changes between V8.1.2 and V8.2.0 released 16th January 2015
-
- Changes between release candidate 1 and the official release are restricted
- to maintenance only.
-
- Significant RTOS kernel updates:
-
- + MAJOR NEW FEATURE! Task notifications. Please see the following URL for
- details: https://www.FreeRTOS.org/RTOS-task-notifications.html
- + NEW HEADER FILE REQUIRED! Obsolete definitions have been separated into
- a new header file called FreeRTOS/Source/include/deprecated_definitions.h.
- This header file must be present to build. Note some of the obsolete
- definitions are still used by very old demo application projects.
-
- Other RTOS kernel updates:
-
- + Made xSemaphoreGiveFromISR() a function rather than a macro that calls
- xQueueGenericSendFromISR(). This allows for major performance
- enhancements at the expense of some additional code size if both functions
- are used in the same application. NOTE: In most uses cases such use of
- a semaphore can now be replaced with a task notification which is smaller
- and faster still.
- + The TCB is now always allocated such that the task's stack grows away from
- the TCB (improves debugging of stack overflows as the overflow will not
- overwrite the task's name).
- + GCC, IAR and Keil Cortex-M4F ports now use more inlining (performance
- enhancements at the cost of a little additional code space).
- + Queues are now allocated with a single call to pvPortMalloc() which
- allocates both the queue structure and the queue storage area.
- + Introduced a new critical section macro for reading the tick count that
- defines away to nothing in cases where the width of the tick allows the
- tick count to be read atomically (performance benefits - especially when
- optimisation is on).
- + Introduced configAPPLICATION_ALLOCATED_HEAP in heap_4.c to allow the
- application writer to provide their own heap array - and in so doing
- control the location of the heap.
- + Introduced configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES which, when set, will
- include known values in both list and list item structures. The values
- are intended to assist debugging. If the values get overwritten then it
- is likely application code has written over RAM used by the kernel.
- + configASSERT()s in all Cortex-M ports used to test the lowest 5 bits of
- the interrupt control register to detect taskENTER_CRITICAL() being called
- from an interrupt. This has been changed to test all 8 bits.
- + Introduced uxTaskPriorityGetFromISR().
- + Microblze V8 port now tests XPAR_MICROBLAZE_0_USE_FPU for inequality to 0
- rather than equality to 1, and 2 and 3 are also valid values.
- + Cortex-A5 GIC-less port no longer passes the address of the interrupting
- peripheral into the interrupt handler.
- + Fix an issue in FreeRTOS-MPU where an attempt was made to free the stack
- belonging to a task when the task was deleted, even when the stack was
- allocated statically.
- + Utility (helper) functions that format task statistic information into
- human readable tables now pad task names with spaces to ensure columns
- line up correctly even where task name lengths vary greatly.
- + Update FreeRTOS+Trace recorder library to version 2.7.0.
-
- Demo application updates:
-
- + Added two new standard demo task sets: IntSemTest and TaskNotify.
- + Added port and demo application for Atmel SAMA5D4 Cortex-A5 MPU.
- + Added demo application for Altera Cyclone V Cortex-A9 MPU.
- + Updated Zynq demo to use version 2014.4 of Xilinx's SDK and added in
- demo tasks for new RTOS features.
- + Updated Atmel SAM4E and SAM4S demos to include a lot of additional test
- and demo tasks.
- + Fixed a corner case issue in Atmel SAM4L low power tickless
- implementation, and added button interrupt handling.
- + Make the interrupt queue tests more tolerant to heave CPU loads.
- + Updated MSVC FreeRTOS simulator demo to include the latest standard test
- and demo tasks.
- + Updated MingW/Eclipse FreeRTOS simulator demo to match the FreeRTOS MSVC
- simulator demo.
- + Updated all demos that use FreeRTOS+Trace to work with the latest trace
- recorder code.
-
-
-Changes between V8.1.1 and V8.1.2 released September 2nd 2014
-
- Move the defaulting of configUSE_PORT_OPTIMISED_TASK_SELECTION into the
- individual port layers where necessary so it does not affect ports that do
- not support the definition.
-
-Changes between V8.1.0 and V8.1.1 released August 29th 2014
-
- By popular requests - a minor patch to V8.1.0 to re-instate the ability to
- give a mutex type semaphore (with priority inheritance) from an interrupt
- handler.
-
-Changes between V8.0.1 and V8.1.0 released August 26th 2014
-
- FreeRTOS scheduler, kernel, demo and test updates:
-
- + Improved the priority inheritance algorithms to assist integration with
- off the shelf middleware that may hold multiple mutexes simultaneously.
- + Introduce heap_5.c, which is similar to heap_4.c but allows the heap to
- span multiple non-contiguous memory regions.
- + Updated all Cortex-A9 ports to help trap a couple of common usage errors -
- the first being when a task incorrectly attempts to exit its implementing
- function and the second being when a non interrupt safe API function is
- called from an interrupt.
- + Update all Cortex-A9 ports to remove obsolete mode switches prior to
- restoring a task context.
- + configUSE_PORT_OPTIMISED_TASK_SELECTION now defaults to 1 instead of 0.
- + Update all Cortex-M3/4F ports to trap a non interrupt safe API function
- being called from an interrupt handler.
- + Simplify the alignment checks in heap_4.c.
- + Update the MSVC Windows simulator demo to use heap_5.c in place of
- heap_4.c to ensure end users have an example to refer to.
- + Updated standard demo test code to test the new priority inheritance
- algorithms.
- + Updated the standard demo tasks to make use of stdint and the FreeRTOS
- specific typedefs that were introduced in FreeRTOS V8.0.0.
- + Introduce the pdMS_TO_TICKS() macro as a more user friendly and intuitive
- alternative to pdTICKS_PER_MS - both of which can be used to convert a
- time specified in milliseconds to a time specified in RTOS ticks.
- + Fix a bug in the Tasking compiler's Cortex-M port that resulted in an
- incorrect value being written to the basepri register. This only effects
- users of the Tasking compiler.
- + Update the Zynq demo to use version 2014.2 of the SDK and add in an lwIP
- example that demonstrates lwIP being used with both its raw and sockets
- interfaces.
- + Updated the CCS Cortex-R4 port to enable it to be built with the latest
- CCS compiler.
-
- New ports and demo applications:
-
- + Two Renesas RX64M ports (RXv2 core) and demos introduced, one for the GCC
- compiler and one for the Renesas compiler. Both demos use e2 studio.
- + Generic IAR Cortex-A5 port (without any reliance on a GIC) introduced.
- The new port is demonstrated on an Atmel SAMA5D3 XPlained board.
-
- FreeRTOS+ component updates:
-
- + Update CyaSSL to the latest version.
- + Updated the FreeRTOS+ components supplied directly by Real Time Engineers
- Ltd. to make use of stdint and the FreeRTOS specific typedefs that were
- introduced in FreeRTOS V8.0.0.
- + Rework and simplify the FreeRTOS+FAT SL RAM disk driver.
-
- Miscellaneous updates and maintenance:
-
- + Update the IAR and DS-5/ARM RZ demos to target the official RZ RSK
- hardware in place of the previously targeted Renesas internal (not
- publicly available) hardware.
- + Various other maintenance tasks.
-
-
-Changes between V8.0.0 and V8.0.1 released 2nd May 2014
-
- + Minor fixes to the event group functionality that was released in V8.0.0.
- The 'clear bits from ISR' functionality is now implemented using a
- deferred interrupt callback instead of a function, and the 'wait bits' and
- 'task sync' functions now correctly clear internal control bits before
- returning a value in every possible path through the respective functions.
- + Ensure the updating of internal control data is protected by a critical
- section after a task is deleted or suspended.
- + Minor fixes to FreeRTOS+FAT SL - namely seeking beyond the end of a file
- when the offset was not a multiple of the sector size.
- + Ensure Cortex-A9 system registers are only ever accessed as 32-bit values,
- even when only the lest significant byte of the register is implemented.
-
- Other updates:
-
- + Updated the XMC4200 IAR project so it links with version 7.x of the IAR
- tools.
- + Add RL78L1C demo.
- + Add pcTimerGetName() API function.
- + Call _reclaim_reent() when a task is deleted if configUSE_NEWLIB_REENTRANT
- is defined.
-
-Changes between V7.6.0 and V8.0.0 released 19th Feb 2014
-
- https://www.FreeRTOS.org/upgrading-to-FreeRTOS-V8.html
-
- FreeRTOS V8.x.x is a drop-in compatible replacement for FreeRTOS V7.x.x,
- although a change to the type used to reference character strings may result
- in application code generating a few (easily clearable) compiler warnings
- after the upgrade, and an updated typedef naming convention means use of the
- old typedef names is now discouraged.
- See https://www.FreeRTOS.org/upgrading-to-FreeRTOS-V8.html for full
- information.
-
- New features and functionality:
-
- + Event groups - see https://www.FreeRTOS.org/FreeRTOS-Event-Groups.html
- + Centralised deferred interrupt processing - see
- https://www.FreeRTOS.org/xTimerPendFunctionCallFromISR.html
-
- Other updates:
-
- + Previously, when a task left the Blocked state, a context switch was
- performed if the priority of the unblocked task was greater than or equal
- to the priority of the Running task. Now a context switch is only
- performed if the priority of the unblocked task is greater than the
- priority of the Running task.
- + New low power tickless demonstration project that targets the ST STM32L
- microcontroller - see
- https://www.FreeRTOS.org/STM32L-discovery-low-power-tickless-RTOS-demo.html
- + Add xPortGetMinimumEverFreeHeapSize() to heap_4.c.
- + Small change to the tickless low power implementation on the SAM4L to
- ensure the alarm value (compare match value) cannot be set to zero when a
- tickless period is exited due to an interrupt originating from a source
- other than the RTOS tick.
- + Update the GCC/Eclipse Win32 simulator demo to make better use of Eclipse
- resource filters and match the functionality of the MSVC equivalent.
- + xTaskIsTaskSuspended() is no longer a public function. Use
- eTaskGetState() in its place.
- + Improved trace macros, including tracing of heap usage.
- + Remove one level of indirection when accepting interrupts on the PIC32MZ.
- + Add Cortex-A9 GCC port layer.
- + Add Xilinx Zynq demo application.
-
-
-Changes between V7.5.3 and V7.6.0 released 18th November 2013
-
- V7.6.0 changes some behaviour when the co-operative scheduler is used (when
- configUSE_PREEMPTION is set to 0). It is important to note that the
- behaviour of the pre-emptive scheduler is unchanged - the following
- description only applies when configUSE_PREEMPTION is set to 0:
-
- WHEN configUSE_PREEMPTION IS SET TO 0 (which is in a small minority of
- cases) a context switch will now only occur when a task places itself into
- the Blocked state, or explicitly calls taskYIELD(). This differs from
- previous versions, where a context switch would also occur when implicitly
- moving a higher priority task out of the Blocked state. For example,
- previously, WHEN PREEMPTION WAS TURNED OFF, if task A unblocks task B by
- writing to a queue, then the scheduler would switch to the higher priority
- task. Now, WHEN PREEMPTION IS TURNED OFF, if task A unblocks task B by
- writing to a queue, task B will not start running until task A enters the
- Blocked state or task A calls taskYIELD(). [If configUSE_PREEMPTION is not
- set to 0, so the normal pre-emptive scheduler is being used, then task B
- will start running immediately that it is moved out of the Blocked state].
-
- Other changes:
-
- + Added a port layer and a demo project for the new PIC32MZ architecture.
- + Update the PIC32MX port layer to re-introduce some ehb instructions that
- were previously removed, add the ability to catch interrupt stack
- overflows (previously only task stack overflows were trapped), and also
- add the ability to catch an application task incorrectly attempting to
- return from its implementing function.
- + Make dramatic improvements to the performance of the Win32 simulator port
- layer.
- + Ensure tasks that are blocked indefinitely report their state as Blocked
- instead of Suspended.
- + Slight improvement to the Cortex-M4F port layers where previously one
- register was inadvertently being saved twice.
- + Introduce the xSemaphoreCreateBinary() API function to ensure consistency
- in the semantics of how each semaphore type is created. It is no longer
- recommended to use vSemaphoreCreateBinary() (the version prefixed with a
- 'v'), although it will remain in the code for backward compatibility.
- + Update the Cortex-M0 port layers to allow the scheduler to be started
- without using the SVC handler.
- + Added a build configuration to the PIC32MX MPLAB X demo project that
- targets the PIC32 USB II starter kit. Previously all the build
- configurations required the Explorer 16 hardware.
- + Some of the standard demo tasks have been updated to ensure they execute
- correctly with the updated co-operative scheduling behaviour.
- + Added comprehensive demo for the Atmel SAM4E, including use of
- FreeRTOS+UDP, FreeRTOS+FAT SL and FreeRTOS+CLI.
-
- FreeRTOS+ Changes:
-
- + Minor maintenance on FreeRTOS+UDP.
-
-Changes between V7.5.2 and V7.5.3 released October 14 2013
-
- Kernel changes:
-
- + Prior to V7.5.x yields requested from the tick hook would occur in the
- same tick interrupt - revert to that original behaviour.
- + New API function uxQueueSpacesAvailable().
- + Introduced the prvTaskExitError() function to Cortex-M0, Cortex-M3/4
- and Cortex-M4F ports. prvTaskExitError() is used to trap tasks that
- attempt to return from their implementing functions (tasks should call
- vTaskDelete( NULL ); if they want to exit).
- + The Cortex-M0 version of portSET_INTERRUPT_MASK_FROM_ISR and
- portCLEAR_INTERRUPT_MASK_FROM_ISR are now fully nestable.
- + Improved behaviour and robustness of the default Cortex-M tickless idle
- behaviour.
- + Add workaround for silicon errata PMU_CM001 in Infineon XMC4000 devices to
- all Cortex-M4F ports.
- + Add Cortex-M0 port for Keil.
- + Updated Cortus port.
- + Ensure _impure_ptr is initialised before the scheduler is started.
- Previously it was not set until the first context switch.
-
- FreeRTOS+ changes:
-
- + Update FreeRTOS+UDP to V1.0.1 - including direct integration of the
- FreeRTOS+Nabto task, improvements to the DHCP behaviour, and a correction
- to the test that prevents the network event hook being called on the first
- network down event. The FreeRTOS+UDP change history is maintained
- separately.
- + Correct the __NVIC_PRIO_BITS setting in the LPC18xx.h header files
- provided in the NXP CMSIS library, then update the interrupts used by the
- LPC18xx demos accordingly.
- + Replace double quotes (") with single quotes (') in FreeRTOS+CLI help
- strings to ensure the strings can be used with the JSON descriptions used
- in the FreeRTOS+Nabto demos.
-
- Demo and miscellaneous changes:
-
- + Added demo for the Atmel SAMD20 Cortex-M0+. The demo includes
- FreeRTOS+CLI
- + Added a demo for the Infineon Cortex-M0 that can be built with the IAR
- Keil and GCC tools.
- + Updated the Infineon XMC4000 demos for IAR, Keil, GCC and Tasking tools,
- with additional build configurations to directly support the XMC4200 and
- XMC4400 devices, in addition to the previously supported XMC4500.
- + Updated the demo application.
- + Added additional trace macros traceMALLOC and traceFREE to track heap
- usage.
-
-Changes between V7.5.0 and V7.5.2 released July 24 2013
-
- V7.5.2 makes the new Cortex-M vPortCheckInterruptPriority() function
- compatible with the STM32 standard peripheral driver library, and adds
- an extra critical section to the default low power tickless mode
- implementation. Only users of the STM32 peripheral library or the default
- tickless implementation need update from version 7.5.0.
-
-Changes between V7.4.2 and V7.5.0 released July 19 2013
-
- V7.5.0 is a major upgrade that includes multiple scheduling and efficiency
- improvements, and some new API functions.
-
- Compatibility information for FreeRTOS users:
- FreeRTOS V7.5.0 is backward compatible with FreeRTOS V7.4.0 with one
- exception; the vTaskList() and vTaskGetRunTimeStats() functions are now
- considered legacy, having been replaced by the single uxTaskGetSystemState()
- function. configUSE_STATS_FORMATTING_FUNCTIONS must be set to 1 in
- FreeRTOSConfig.h for vTaskList() and vTaskGetRunTimeStats() to be
- available.
-
- Compatibility information for FreeRTOS port writers:
- vTaskIncrementTick() is now called xTaskIncrementTick() (because it now
- returns a value).
-
- Headline changes:
-
- + Multiple scheduling and efficiency improvements.
- + Core kernel files now pass PC-Lint V8 static checking without outputting
- any warnings (information on the test conditions will follow).
-
- New API functions:
-
- + uxTaskGetSystemState() https://www.FreeRTOS.org/uxTaskGetSystemState.html
- + xQueueOverwrite() https://www.FreeRTOS.org/xQueueOverwrite.html
- + xQueueOverwriteFromISR()
- + xQueuePeekFromISR()
-
- The following ports and demos, which were previously available separately,
- are now incorporated into the main FreeRTOS zip file download:
-
- + ARM Cortex-A9 IAR
- + ARM Cortex-A9 ARM compiler
- + Renesas RZ
- + Microsemi SmartFusion2
-
- New FreeRTOSConfig.h settings
- https://freertos.org/a00110.html
-
- + configUSE_TIME_SLICING
- + configUSE_NEWLIB_REENTRANT
- + configUSE_STATS_FORMATTING_FUNCTIONS
- + configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
-
- Other changes:
-
- + (MPU port only) The configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
- options provides a mechanism that allows application writers to execute
- certain functions in privileged mode even when a task is running in user
- mode.
- + Ports that support interrupt nesting now include a configASSERT() that
- will trigger if an interrupt safe FreeRTOS function is called from an
- interrupt that has a priority designated as above the maximum system/API
- call interrupt priority.
- + The included FreeRTOS+Trace recorder code has been updated to the latest
- version, and the demo applications that use the trace recorder code have
- been updated accordingly.
- + The FreeRTOS Windows Simulator (MSVC version only) has been updated to
- include a new basic 'blinky' build option in addition to the original
- comprehensive build option.
- + Improve RAM usage efficiency of heap_4.c and heap_2.c.
- + Prevent heap_4.c from attempting to free memory blocks that were not
- allocated by heap_4.c, or have already been freed.
- + As FreeRTOS now comes with FreeRTOS+FAT SL (donated by HCC) the Chan FATfs
- files have been removed from FreeRTOS/Demo/Common.
- + Fix build error when R4 port is build in co-operative mode.
- + Multiple port and demo application maintenance activities.
-
-Changes between V7.4.1 and V7.4.2 released May 1 2013
-
- NOTE: There are no changes in the FreeRTOS kernel between V7.4.1 and V7.4.2
-
- + Added FreeRTOS+FAT SL source code and demo project. The demo project
- runs in the FreeRTOS Windows simulator for easy and hardware independent
- experimentation and evaluation. See https://www.FreeRTOS.org/fat_sl
-
-Changes between V7.4.0 and V7.4.1 released April 18 2013
-
- + To ensure strict conformance with the spec and ensure compatibility with
- future chips data and instruction barrier instructions have been added to
- the yield macros of Cortex-M and Cortex-R port layers. For efficiency
- the Cortex-M port layer "yield" and "yield" from ISR are now implemented
- separately as the barrier instructions are not required in the ISR case.
- + Added FreeRTOS+UDP into main download.
- + Reorganised the FreeRTOS+ directory so it now matches the FreeRTOS
- directory with Source and Demo subdirectories.
- + Implemented the Berkeley sockets select() function in FreeRTOS+UDP.
- + Changed (unsigned) casting in calls to standard library functions with
- (size_t) casting.
- + Added the Atmel SAM4L and Renesas RX100 demos that demonstrates the
- tickless (tick suppression) low power FreeRTOS features.
- + Add a new RL78 IAR demo that targets numerous new RL78 chips and
- evaluation boards.
- + Adjusted stack alignment on RX200 ports to ensure an assert was not
- falsely triggered when configASSERT() is defined.
- + Updated the Cortex_M4F_Infineon_XMC4500_IAR demo to build with the latest
- version of EWARM.
- + Corrected header comments in the het.c and het.h files (RM48/TMS570 demo).
-
-
-Changes between V7.3.0 and V7.4.0 released February 20 2013
-
- + New feature: Queue sets. See:
- https://www.FreeRTOS.org/Pend-on-multiple-rtos-objects.html
- + Overhauled the default tickless idle mode implementation provided with the
- ARM Cortex-M3 port layers.
- + Enhanced tickless support in the core kernel code with the introduction of
- the configEXPECTED_IDLE_TIME_BEFORE_SLEEP macro and the
- eTaskConfirmSleepModeStatus() function.
- + Added the QueueSet.c common demo/test file. Several demo applications
- have been updated to use the new demo/test tasks.
- + Removed reliance on the PLIB libraries from the MPLAB PIC32 port layer and
- demo applications.
- + Added the FreeRTOS+Trace recorder code to the MSVC Win32 demo.
- + Renamed eTaskStateGet() to eTaskGetState() for consistency, and added a
- pre-processor macro for backward compatibility with the previous name.
- + Updated functions implemented in the core queue.c source file to allow
- queue.h to be included from the .c file directly (this prevents compiler
- warnings that were generated by some compilers).
- + Updated the CCS Cortex-R4 port layer to replace the CLZ assembler function
- with the CLZ compiler intrinsic that is provided by the latest versions of
- the CCS ARM compiler.
- + Updated all heap_x.c implementations to replace the structure that was
- used to ensure the start of the heap was aligned with a more portable
- direct C code implementation.
- + Added support for PIC24 devices that include EDS.
- + Minor optimisations to the PIC32 port layer.
- + Minor changes to tasks.c that allow the state viewer plug-ins to display
- additional information.
- + Bug fix: Update prvProcessReceivedCommands() in timers.c to remove an
- issue that could occur if the priority of the timer daemon task was set
- below the priority of tasks that used timer services.
- + Update the FreeRTOS+Trace recorder code to the latest version.
-
-Changes between V7.2.0 and V7.3.0 released October 31 2012
-
- + Added ability to override the default scheduler task selection mechanism
- with implementations that make use of architecture specific instructions.
- + Added ability to suppress tick interrupts during idle time, and in so
- doing, provide the ability to make use of architecture specific low power
- functionality.
- + Added the portSUPPRESS_TICKS_AND_SLEEP() macro and vTaskStepTick() helper
- function.
- + Added the configSYSTICK_CLOCK_HZ configuration constant.
- + Reworked the Cortex-M3 and Cortex-M4F port layers for GCC, Keil and IAR to
- directly support basic power saving functionality.
- + Added hooks to allow basic power saving to be augmented in the application
- by making use of chip specific functionality.
- + Minor change to allow mutex type semaphores to be used from interrupts
- (which would not be a normal usage model for a mutex).
- + Change the behaviour of the interrupt safe interrupt mask save and restore
- macros in the Cortex-M ports. The save macro now returns the previous
- mask value. The restore macro now uses the previous mask value. These
- changes are not necessary for the kernel's own implementation, and are
- made purely because the macros were being used by application writers.
- + Added eTaskStateGet() API function.
- + Added port specific optimisations to the PIC32 port layer, and updated the
- PIC32 demo applications to make use of this new feature.
- + Added port specific optimisations to the Win32 simulator port.
- + Added new ports and demo applications for the TI Hercules RM48 and TMS570
- safety microcontrollers.
- + Added SAM3 demos targeting the ATSAM3S-EK2 and ATSAM3X-EK evaluation
- boards.
- + Updated the PIC32 MPLAB X project to manually set the compiler include
- paths instead of using the IDE entry box following reports that the
- include paths were somehow being deleted.
- + Improved character handling in FreeRTOS+CLI.
-
-Changes between V7.1.1 and V7.2.0 released 14 August 2012
-
- FreeRTOS V7.2.0 is backward compatible with FreeRTOS V7.1.2.
-
- + Added a FreeRTOS+ sub-directory. The directory contains some FreeRTOS+
- source code, and example projects that use the FreeRTOS Win32 simulator.
- + Added a new example heap allocation implementation (heap_4.c) that
- includes memory block coalescence.
- + Added a demo that targets the Atmel SAM4S Cortex-M4 based microcontroller.
- The demo is preconfigured to build using the free Atmel Studio 6 IDE and
- GCC compiler.
- + Added xSemaphoreTakeFromISR() implementation.
- + The last parameter in ISR safe FreeRTOS queue and semaphore functions
- (xHigherPriorityTaskWoken) is now optional and can be set to NULL if it
- is not required.
- + Update the IAR and MSP430X ports to clear all lower power mode bits before
- exiting the tick interrupt [bug fix].
- + Allow xQueueReset() to be used, even when the queues event lists are not
- empty.
- + Added a vQueueDelete() handler for the FreeRTOS MPU port (this was
- previously missing).
- + Updated the vPortSVCHandler() functions in the FreeRTOS MPU port layer to
- ensure it compiles with the latest ARM GCC compilers from Linaro.
- + Updated the prvReadGP() function in the NIOS II port to ensure the compiler
- can choose any register for the functions parameter (required at high
- compiler optimisation levels).
- + Add #error macros into the Keil and IAR Cortex-M ports to ensure they
- cannot be built if the user has set configMAX_SYSCALL_INTERRUPT_PRIORITY
- to 0.
- + Added comments in the FreeRTOSConfig.h files associated with Cortex-M3 and
- Cortex-M4 demos stating that the configMAX_SYSCALL_INTERRUPT_PRIORITY
- parameter must not be set to 0.
- + Introduce new INCLUDE_xQueueGetMutexHolder configuration constant
- (defaulted to 0).
- + Added two new list handling macros - for internal use only in upcoming new
- products.
- + Removed all mention of the legacy vTaskStartTrace and ulTaskEndTrace
- macros. FreeRTOS+Trace supersedes the legacy trace.
- + Added a configASSERT() into the vPortFree() function in heap_1.c as it is
- invalid for the function to be called.
- + Made the xRxLock and xTxLock members of the queue structure volatile.
- This is probably not necessary, and is included as a precautionary
- measure.
- + Modify the assert() that checks to see if the priority passed into an
- xTaskCreate() function is within valid bounds to permit the assert to be
- used in the FreeRTOS MPU port.
- + The software timer service (daemon) task is now created in a way that
- to ensure compatibility with FreeRTOS MPU.
-
-Changes between V7.1.0 and V7.1.1 released May 1 2012
-
- New ports:
-
- The following ports are brand new:
- + Cortex-M3 Tasking
-
- The following ports have been available as separate downloads for a number
- of months, but are now included in the main FreeRTOS download.
- + Cortex-M0 IAR
- + Cortex-M0 GCC
- + Cortex-M4F GCC (with full floating point support)
-
-
- New demos:
-
- The following demos are brand new:
- + Renesas RX63N RDK (Renesas compiler)
-
- The following demos have been available as separate downloads for a number
- of months, but are now included in the main FreeRTOS download.
- + NXP LPC1114 GCC/LPCXpresso
- + ST STM32F0518 IAR
- + Infineon XMC4500 GCC/Atollic
- + Infineon XMC4500 IAR
- + Infineon XMC4500 Keil
- + Infineon XMC4500 Tasking
-
-
- Kernel miscellaneous / maintenance:
-
- + Introduced the portSETUP_TCB() macro to remove the requirement for the
- Windows simulator to use the traceTASK_CREATE() macro, leaving the trace
- macro available for use by FreeRTOS+Trace (https://www.FreeRTOS.org/trace).
- + Added a new trace macro, traceMOVE_TASK_TO_READY_STATE(), to allow future
- FreeRTOS+Trace versions to provide even more information to users.
- + Updated the FreeRTOS MPU port to be correct for changes that were
- introduced in FreeRTOS V7.1.0.
- + Introduced the xQueueReset() API function.
- + Introduced the xSemaphoreGetMutexHolder() API function.
- + Tidy up various port implementations to add the static key word where
- appropriate, and remove obsolete code.
- + Slight change to the initial stack frame given to the RX600 ports to allow
- them to be used in the Eclipse based E2Studio IDE without confusing GDB.
- + Correct the alignment given to the initial stack of Cortex-M4F tasks.
- + Added a NOP following each DINT instruction on MSP430 devices for strict
- conformance with the instructions on using DINT.
- + Changed the implementation of thread deletes in the Win32 port to prevent
- the port making use of the traceTASK_DELETE() trace macros - leaving this
- macro free for use by FreeRTOS+Trace.
- + Made some benign changes to the RX600 Renesas compiler port layer to
- ensure the code can be built to a library without essential code being
- removed by the linker.
- + Reverted the change in the name of the uxTaskNumber variable made in
- V7.1.0 as it broke the IAR plug-in.
-
-
- Demo miscellaneous / maintenance:
-
- + The command interpreter has now been formally released as FreeRTOS+CLI,
- and been moved out of the main FreeRTOS download, to instead be available
- from the FreeRTOS+ Ecosystem site https://www.FreeRTOS.org/plus.
- + flash_timer.c/h has been added to the list of standard demo tasks. This
- performs the same functionality as the flash.c tasks, but using software
- timers in place of tasks.
- + Upgraded the PIC32 demo as follows: Changes to how the library functions
- are called necessitated by the new compiler version, addition of MPLAB X
- project with PIC32MX360, PIC32MX460 and PIC32MX795 configurations,
- addition of simply blinky demo, updated FreeRTOSConfig.h to include more
- parameters, addition of hook function stubs.
- + The MSP430X IAR and CCS demos have been updated to ensure the power
- settings are correct for the configured CPU frequency.
- + Rowley CrossWorks projects have been updated to correct the "multiple
- definition of ..." warnings introduced when the toolchain was updated.
- + Updated various FreeRTOSConfig.h header files associated with projects
- that build with Eclipse to include a #error statement informing the user
- that the CreateProjectDirectoryStructure.bat batch file needs to be
- executed before the projects can be opened.
- + Renamed directories that included "CCS4" in their name to remove the '4'
- and instead just be "CCS". This is because the demo was updated and
- tested to also work with later Code Composer Studio versions.
- + Updated the TCP/IP periodic timer frequency in numerous uIP demos to be
- 50ms instead of 500ms.
-
-Changes between V7.0.2 and V7.1.0 released December 13 2011
-
- New ports:
-
- + Cortex-M4F IAR port.
- + Cortex-M4F Keil/RVDS port.
- + TriCore GCC port.
-
- New demos:
-
- + NXP LPC4350 using the Keil MDK, and demonstrated on a Hitex development
- board.
- + ST STM32F407 using the IAR Embedded Workbench for ARM, and demonstrated on
- the IAR STM32F407ZG-SK starter kit.
- + Infineon TriCore TC1782, using the GCC compiler, demonstrated on the
- TriBoard TC1782 evaluation board.
- + Renesas RX630, using the Renesas compiler and HEW, demonstrated on an
- RX630 RSK (Renesas Starter Kit).
-
- Miscellaneous / maintenance:
-
- + Removed all calls to printf() from the K60/IAR Kinetis demo so the project
- can execute stand alone - without being connected to the debugger.
- + Completed the command interpreter framework. Command handlers now receive
- the entire command string, giving them direct access to parameters.
- Utility functions are provided to check the number of parameters, and
- return parameter sub-strings.
- + The previously documented fix for the bug in xTaskResumeFromISR() that
- effected (only) ports supporting interrupt nesting has now been
- incorporated into the main release.
- + The portALIGNMENT_ASSERT_pxCurrentTCB() definition has been added to allow
- specific ports to skip the second stack alignment check when a task is
- created. This is because the second check is not appropriate for some
- ports - including the new TriCore port where the checked pointer does not
- actually point to a stack.
- + The portCLEAN_UP_TCB() macro has been added to allow port specific clean
- up when a task is deleted - again this is required by the TriCore port.
- + Various other minor changes to ensure warning free builds on a growing
- number of microcontroller and toolchain platforms. This includes a
- (benign) correction to the prototype of the
- vApplicationStackOverflowHook() definition found in lots of recent demos.
-
- Trace system:
-
- + The legacy trace mechanism has been completely removed - it has been
- obsolete for the years since the trace macros were introduced. The
- configuration constant configUSE_TRACE_FACILITY is now used to optionally
- include additional queue and task information. The additional information
- is intended to make the trace mechanism more generic, and allow the trace
- output to provide more information. When configUSE_TRACE_FACILITY is set
- to 1:
- - the queue structure includes an additional member to hold the queue
- type, which can be base, mutex, counting semaphore, binary semaphore
- or recursive mutex.
- - the queue structure includes an additional member to hold a queue
- number. A trace tool can set and query the queue number for its own
- purposes. The kernel does not use the queue number itself.
- - the TCB structure includes an additional member to hold a task number
- number. A trace tool can set and query the task number for its own
- purposes. The kernel does not use the task number itself.
- + Queues and all types of semaphores are now automatically allocated their
- type as they are created.
- + Added two new trace macros - traceTASK_PRIORITY_INHERIT() and
- traskTASK_PRIORITY_DISINHERIT().
- + Updated the traceQUEUE_CREATE_FAILED() macro to take a parameter that
- indicates the type of queue, mutex, or semaphore that failed to be
- created.
- + The position from which traceCREATE_MUTEX() is called has been moved from
- after the call to xQueueGenericSend() [within the same function] to before
- the call. This ensures the trace events occur in the correct order.
- + The value passed into tracePRIORITY_SET() has been corrected for the case
- where vTaskPrioritySet() is called with a null parameter.
-
-Changes between V7.0.1 and V7.0.2 released September 20 2011
-
- New ports:
-
- + The official FreeRTOS Renesas RX200 port and demo application have been
- incorporated into the main FreeRTOS zip file download.
- + The official FreeRTOS Renesas RL78 port and demo application have been
- incorporated into the main FreeRTOS zip file download.
- + The official FreeRTOS Freescale Kinetis K60 tower demo application has
- been incorporated into the main FreeRTOS zip file download. This includes
- an embedded web server example.
- + A new Microblaze V8 port layer has been created to replace the older, now
- deprecated, port layer. The V8 port supports V8.x of the Microblaze IP,
- including exceptions, caches, and the floating point unit. A new
- Microblaze demo has also been added to demonstrate the new Microblaze V8
- port layer. The demo application was created using V13.1 of the Xilinx
- EDK, and includes a basic embedded web server that uses lwIP V1.4.0.
- + The official FreeRTOS Fujitsu FM3 MB9A310 demo application has been
- incorporated into the main FreeRTOS zip file download. Projects are
- provided for both the IAR and Keil toolchains.
-
-
- API additions:
-
- + xTaskGetIdleTaskHandle() has been added.
- + xTaskGetTimerDaemonTaskHandle() has been added.
- + pcTaskGetTaskName() has been added.
- + vSemaphoreDelete() macro has been added to make it obvious how to delete
- a semaphore. In previous versions vQueueDelete() had to be used.
- + vTaskCleanUpResources() has been removed. It has been obsolete for a
- while.
- + portPOINTER_SIZE_TYPE has been introduced to prevent compiler warnings
- being generated when the size of a pointer does not match the size of
- the stack type. This will (has already) be used in new ports, but will
- not be retrofitted to existing ports until the existing port itself is
- updated.
-
- Other updates and news:
-
- + The core files have all been modified to tighten the coding standard even
- further. These are style, not functional changes.
- + All ARM7 port layers have been slightly modified to prevent erroneous
- assert() failures when tasks are created and configASSERT() is defined.
- + All ARM IAR projects have been updated to build with the latest V6.2.x
- versions of the IAR Embedded Workbench for ARM tools (EWARM). This was
- necessary due to a change in the way EWARM uses the CMSIS libraries.
- + The PIC32 port layer has been updated in preparation for V2 of the C32
- compiler.
- + The old Virtex-4 Microblaze demo has been marked as deprecated. Please
- use the brand new Spartan-6 port and demo in its place.
- + The bones of a new generic command interpreter is located in
- FreeRTOS/Demo/Common/Utils/CommandInterpreter.c. This is still a work in
- progress, and not documented. It is however already in use. It will be
- documented in full when the projects that are already using it are
- completed.
- + A couple of new standard demos have been included. First, a version of
- flop.c called sp_flop.c. This is similar to flop.c, but uses single
- precision floats in place of double precision doubles. This allows the
- for testing ports to processors that have only single precision floating
- point units, and revert to using emulated calculations whenever a double
- is used. Second, comtest_strings.c has been included to allow the test
- of UART drivers when an entire string is transmitted at once. The
- previous comtest.c only used single character transmission and reception.
- + lwIP V1.4.0 is now included in the FreeRTOS/Demo/Common directory, and
- used by a couple of new demos.
-
-Changes between V7.0.0 and V7.0.1 released May 13 2011
-
- + Added a Fujitsu FM3 demo application for both the IAR and Keil tool
- chains.
- + Added a SmartFusion demo application for all of the IAR, Keil and
- SoftConsole (GCC/Eclipse) tool chains.
- + Updated the RX600 port and demo applications to take into account the
- different semantics required when using the latest (V1.0.2.0) version of
- the Renesas compiler.
- + Modified the RX600 Ethernet driver slightly to make it more robust under
- heavy load, and updated the uIP handling task to make use of the FreeRTOS
- software timers.
- + Slightly changed the PIC32 port layer to move an ehb instruction in line
- with the recommendations of the MIPS core manual, and ensure 8 byte stack
- alignment is truly always obtained.
- + Changed the behaviour when tasks are suspended before the scheduler has
- been started. Before, there needed to be at least one task that was not
- in the suspended state. This is no longer the case.
-
-Changes between V6.1.1 and V7.0.0 released April 8 2011
-
- FreeRTOS V7.0.0 is backward compatible with FreeRTOS V6.x.x
-
- Main changes:
-
- + Introduced a new software timer implementation.
- + Introduced a new common demo application file to exercise the new timer
- implementation.
- + Updated the Win32/MSVC simulator project to include the new software timer
- demo tasks and software timer tick hook test. Much simpler software timer
- demonstrations are included in the demo projects for both of the new ports
- (MSP430X with CCS4 and STM32 with TrueStudio).
- + Various enhancements to the kernel implementation in tasks.c. These are
- transparent to users and do not effect the pre-existing API.
- + Added calls to configASSERT() within the kernel code. configASSERT() is
- functionally equivalent to the standard C assert() macro, but does not
- rely on the compiler providing assert.h.
-
- Other changes:
-
- + Updated the MSP430X IAR port and demo project to include support for the
- medium memory model.
- + Added a demo project for the MSP430X that targets the MSP430X Discovery
- board and uses the Code Composer Studio 4 tools. This demo includes use
- of the new software timer implementation.
- + Added an STM32F100RB demo project that targets the STM32 Discovery Board
- and uses the TrueStudio Eclipse based IDE from Atollic.
- + Removed some compiler warnings from the PSoC demo application.
- + Updated the PIC32 port layer to ensure the
- configMAX_SYSCALL_INTERRUPT_PRIORITY constant works as expected no matter
- what its value is (within the valid range set by the microcontroller
- kernel).
- + Updated the PIC24, dsPIC and PIC32 projects so they work with the latest
- MPLAB compiler versions from Microchip.
- + Various cosmetic changes to prepare for a standards compliance statement
- that will be published after the software release.
-
-
-Changes between V6.1.0 and V6.1.1 released January 14 2011
-
- + Added two new Windows simulator ports. One uses the free Microsoft Visual
- Studio 2010 express edition, and the other the free MingW/Eclipse
- environment. Demo projects are provided for both.
- + Added three demo projects for the PSoC 5 (CYAC5588). These are for the
- GCC, Keil, and RVDS build tools, and all use the PSoC Creator IDE.
- + Added a demo for the low power STM32L152 microcontroller using the IAR
- Embedded Workbench.
- + Added a new port for the MSP430X core using the IAR Embedded Workbench.
- + Updated all the RX62N demo projects that target the Renesas Demonstration
- Kit (RDK) to take into account the revered LED wiring on later hardware
- revisions, and the new J-Link debug interface DLL.
- + Updated all the RX62N demo projects so the IO page served by the example
- embedded web server works with all web browsers.
- + Updated the Red Suite projects to work with the up coming Red Suite
- release, and to use a more recent version of the CMSIS libraries.
- + Added the traceTAKE_MUTEX_RECURSIVE_FAILED() trace macro.
- + Removed the (pointless) parameter from the traceTASK_CREATE_FAILED()
- trace macro.
- + Introduced the portALT_GET_RUN_TIME_COUNTER_VALUE() macro to compliment
- the already existing portGET_RUN_TIME_COUNTER_VALUE(). This allows for
- more flexibility in how the time base for the run time statistics feature
- can be implemented.
- + Added a "cpsie i" instruction before the "svc 0" instruction used to start
- the scheduler in each of the Cortex M3 ports. This is to ensure that
- interrupts are globally enabled prior to the "svc 0" instruction being
- executed in cases where interrupts are left disabled by the C start up
- code.
- + Slight optimisation in the run time stats calculation.
-
-Changes between V6.0.5 and V6.1.0 released October 6 2010
-
- + Added xTaskGetTickCountFromISR() function.
- + Modified vTaskSuspend() to allow tasks that have just been created to be
- immediately suspended even when the kernel has not been started. This
- allows them to effectively start in the Suspended state - a feature that
- has been asked for on numerous occasions to assist with initialisation
- procedures.
- + Added ports for the Renesas RX62N using IAR, GCC and Renesas tool suites.
- + Added a STM32F103 demo application that uses the Rowley tools.
- + Under specific conditions xFreeBytesRemaining within heap_2.c could end up
- with an incorrect value. This has been fixed.
- + xTaskCreateGeneric() has a parameter that can be used to pass the handle
- of the task just created out to the calling task. The assignment to this
- parameter has been moved to ensure it is assigned prior to the newly
- created having any possibility of executing. This takes into account the
- case where the assignment is made to a global variable that is accessed by
- the newly created task.
- + Fixed some build time compiler warnings in various FreeTCPIP (based on
- uIP) files.
- + Fixed some build time compiler warnings in Demo/Common/Minimal/IntQueue.c.
-
-Changes between V6.0.4 and V6.0.5 released May 17 2010
-
- + Added port and demo application for the Cortus APS3 processor.
-
-Changes between V6.0.3 and V6.0.4 released March 14 2010
-
- + All the contributed files that were located in the Demo/Unsupported_Demos
- directory have been removed. These files are instead now available in the
- new Community Contributions section of the FreeRTOS website. See
- https://www.FreeRTOS.org/RTOS-contributed-ports.html
- + The project file located in the Demo/CORTEX_STM32F107_GCC_Rowley directory
- has been upgraded to use V2.x of the Rowley Crossworks STM32 support
- package.
- + An initial Energy Micro EFM32 demo has been included. This will be
- updated over the coming months to make better use of the low power modes
- the EFM32 provides.
-
-Changes between V6.0.2 and V6.0.3 released February 26 2010
-
- + SuperH SH7216 (SH2A-FPU) port and demo application added.
- + Slight modification made to the default implementation of
- pvPortMallocAligned() and vPortFreeAligned() macros so by default they
- just call pvPortMalloc() and vPortFree(). The macros are only needed to
- be defined when a memory protection unit (MPU) is being used - and then
- only depending on other configuration settings.
-
-Changes between V6.0.1 and V6.0.2 released January 9th 2010
-
- + Changed all GCC ARM 7 ports to use 0 as the SWI instruction parameter.
- Previously the parameter was blank and therefore only an implicit 0 but
- newer GCC releases do not permit this.
- + Updated IAR SAM7S and SAM7X ports to work with IAR V5.40.
- + Changed the stack alignment requirement for PIC32 from 4 bytes to 8 bytes.
- + Updated prvListTaskWithinSingleList() is it works on processors where the
- stack grows up from low memory.
- + Corrected some comments.
- + Updated the startup file for the RVDS LPC21xx demo.
-
-Changes between V6.0.0 and V6.0.1 released November 15th 2009
-
- + Altered pxPortInitialiseStack() for all Cortex-M3 ports to ensure the
- stack pointer is where the compiler expects it to be when a task first
- starts executing.
-
- The following minor changes only effect the Cortex-M3 MPU port:
-
- + portRESET_PRIVILEGE() assembly macro updated to include a clobber list.
- + Added prototypes for all the privileged function wrappers to ensure no
- compile time warnings are generated no matter what the warning level
- setting.
- + Corrected the name of portSVC_prvRaisePrivilege to
- portSVC_RAISE_PRIVILEGE.
- + Added conditional compilation into xTaskGenericCreate() to prevent some
- compilers issuing warnings when portPRIVILEGE_BIT is defined as zero.
-
-
-Changes between V5.4.2 and V6.0.0 released October 16th 2009
-
- FreeRTOS V6 is backward compatible with FreeRTOS V5.x.
-
- Main changes:
-
- + FreeRTOS V6 is the first version to include memory protection unit (MPU)
- support. Two ports now exist for the Cortex M3, the standard FreeRTOS
- which does not include MPU support, and FreeRTOS-MPU which does.
- + xTaskCreateRestricted() and vTaskAllocateMPURegions() API functions added
- in support of FreeRTOS-MPU.
- + Wording for the GPL exception has been (hopefully) clarified. Also the
- license.txt file included in the download has been fixed (the previous
- version contained some corruption).
-
- Other changes:
-
- + New API function xPortGetFreeHeapSize() added to heap_1.c and heap_2.c.
- + ARM7 GCC demo interrupt service routines wrappers have been modified to
- call the C portion using an __asm statement. This prevents the function
- call being inlined at higher optimisation levels.
- + ARM7 ports now automatically set the THUMB bit if necessary when
- setting up the initial stack of a task - removing the need for
- THUMB_INTERWORK to be defined. This also allows THUMB mode and ARM mode
- tasks to be mixed more easily.
- + All ARM7/9 ports now have portBYTE_ALIGNMENT set to 8 by default.
- + Various demo application project files have been updated to be up to date
- with the latest IDE versions.
- + The linker scripts used with command line GCC demos have been updated to
- include an eh_frame section to allow their use with the latest Yagarto
- release. Likewise the demo makefiles have been updated to include
- command line options to reduce or eliminate the eh_frame section all
- together.
- + The definition of portBYTE_ALIGNMENT_MASK has been moved out of the
- various memory allocation files and into the common portable.h header
- file.
- + Removed unnecessary use of portLONG, portSHORT and portCHAR.
- + Added LM3Sxxxx demo for Rowley CrossWorks.
- + Posix simulator has been upgraded - see the corresponding WEB page on the
- FreeRTOS.org site.
-
-
-Changes between V5.4.1 and V5.4.2 released August 9th 2009
-
- + Added a new port and demo app for the Altera Nios2 soft core.
- + Added LPC1768 demo for IAR.
- + Added a USB CDC demo to all LPC1768 demos (Code Red, CrossWorks and IAR).
- + Changed clock frequency of LPC1768 demos to 99MHz.
-
-Changes between V5.4.0 and V5.4.1 released July 25th 2009
-
- + New hook function added. vApplicationMallocFailedHook() is (optionally)
- called if pvPortMalloc() returns NULL.
- + Additional casting added to xTaskCheckForTimeOut(). This prevents
- problems that can arise should configUSE_16_BIT_TICKS be set to 1 on a
- 32 bit architecture (which would probably be a mistake, anyway).
- + Corrected the parameter passed to NVIC_SetPriority() to set the MAC
- interrupt priority in both LPC1768 demos.
- + Decreased the default setting of configMINIMAL_STACK_SIZE in the PIC32
- demo application to ensure the heap space was not completely consumed
- before the scheduler was started.
-
-Changes between V5.3.1 and V5.4.0 released July 13th 2009
-
- + Added Virtex5 / PPC440 port and demos.
- + Replaced the LPC1766 Red Suite demo with an LPC1768 Red Suite demo. The
- original demo was configured to use engineering samples of the CPU. The
- new demo has an improved Ethernet driver.
- + Added LPC1768 Rowley demo with zero copy Ethernet driver.
- + Reworked byte alignment code to ensure 8 byte alignment works correctly.
- + Set configUSE_16_BIT_TICKS to 0 in the PPC405 demo projects.
- + Changed the initial stack setup for the PPC405 to ensure the small data
- area pointers are setup correctly.
-
-Changes between V5.3.0 and V5.3.1 released June 21st 2009
-
- + Added ColdFire V1 MCF51CN128 port and WEB server demo.
- + Added STM32 Connectivity Line STM32107 Cortex M3 WEB server demo.
- + Changed the Cortex M3 port.c asm statements to __asm so it can be
- compiled using Rowley CrossWorks V2 in its default configuration.
- + Updated the Posix/Linux simulator contributed port.
-
-Changes between V5.2.0 and V5.3.0 released June 1st 2009
-
- Main changes:
-
- + Added new (optional) feature that gathers statistics on the amount of CPU
- time used by each task.
- + Added a new demo application for the Atmel AT91SAM3U Cortex-M3 based
- microcontroller.
- + Added a new demo application for the NXP LPC1766 Cortex-M3 based
- microcontroller.
- + Added a contributed port/demo that allows FreeRTOS to be 'simulated' in a
- Linux environment.
-
- Minor changes:
- + Updated the Stellaris uIP WEB server demos to include the new run time
- statistics gathering feature - and include a served WEB page that
- presents the information in a tabular format.
- + Added in the lwIP port layer for the Coldfire MCF52259.
- + Updated the CrossWorks LPC2368 WEB server to include an image in the
- served content.
- + Changed some of the timing in the initialisation of the LPC2368 MAC to
- permit its use on all part revisions.
- + Minor modifications to the core uIP code to remove some compiler warnings.
- + Added xTaskGetApplicationTaskTag() function and updated the OpenWatcom
- demo to make use of the new function.
- + Added contributed demos for AVR32 AP7000, STM32 Primer 2 and STM32 using
- Rowley Crossworks.
- + Heap_1.c and Heap_2.c used to define structures for the purpose of data
- alignment. These have been converted to unions to save a few bytes of
- RAM that would otherwise be wasted.
- + Remove the call to strncpy() used to copy the task name into the TCB when
- the maximum task name is configured to be 1 byte long.
-
-Changes between V5.1.2 and V5.2.0 released March 14th 2009
-
- + Optimised the queue send and receive functions (also used by semaphores).
- + Replaced the standard critical sections used to protect BIOS calls in the
- PC port to instead use scheduler locks. This is because the BIOS calls
- always return with interrupts enabled.
- + Corrected unclosed comments in boot.s.
-
-Changes between V5.1.1 and V5.1.2 released February 9th 2009
-
- + Added NEC V850ES port and demo.
- + Added NEC 78K0R port and demo.
- + Added MCF52259 port and demo.
- + Added the AT91SAM9XE port and demo.
- + Updated the MCF52233 FEC driver to work around a silicon bug that
- prevents the part auto negotiating some network parameters.
- + Minor modifications to the MCF52233 makefile to permit it to be used
- on Linux hosts.
- + Updated the STM32 primer files to allow them to be built with the latest
- version of the RIDE tools.
- + Updated the threads.js Java script used for kernel aware debugging in
- the Rowley CrossWorks IDE.
-
-
-Changes between V5.1.0 and V5.1.1 released November 20, 2008
-
- + Added Coldfire MCF52233 WEB server demo using GCC and Eclipse.
- + Added IAR MSP430 port and demo.
- + Corrected several compiler time issues that had crept in as tool versions
- change.
- + Included FreeRTOS-uIP - a faster uIP. This is not yet complete.
-
-Changes between V5.0.4 and V5.1.0 released October 24, 2008
-
- + Added a new port and demo application for the ColdFire V2 core using the
- CodeWarrior development tools.
- + Replaced the ARM7 demo that used the old (and now no longer supported)
- Keil compiler with a new port that uses the new Keil/RVDS combo.
- + Stack overflow checking now works for stacks that grow up from low
- memory (PIC24 and dsPIC).
- + BUG FIX - set the PIC32 definition of portSTACK_GROWTH to the correct
- value of -1.
- + MSP430 port layers have been updated to permit tasks to place the
- microcontroller into power down modes 1 to 3. The demo applications have
- likewise been updated to demonstrate the new feature.
- + Replaced the two separate MSP430/Rowley port layers with a single and more
- flexible version.
- + Added more contributed ports, including ports for NEC and SAM9
- microcontrollers.
- + Changed the linker script used in the LPC2368 Eclipse demo.
-
-Changes between V5.0.3 and V5.0.4 released September 22, 2008
-
- + Completely re-written port for ColdFire GCC.
- + Bug fix: All Cortex M3 ports have a minor change to the code that sets
- the pending interrupt.
- + Some header files require that FreeRTOS.h be included prior to their
- inclusion. #error message have been added to all such header file
- informing users to the cause of the compilation error should the headers
- not be included in the correct order.
-
-Changes between V5.0.2 and V5.0.3 released July 31, 2008
-
- Changes relating to the Cortex M3:
-
- + Added configMAX_SYSCALL_INTERRUPT_PRIORITY usage to all the Cortex M3
- ports and demos. See the port documentation pages on the FreeRTOS.org
- WEB site for full usage information.
- + Improved efficiency of Cortex M3 port even further.
- + Ensure the Cortex M3 port works no matter where the vector table is
- located.
- + Added the IntQTimer demo/test tasks to a demo project for each CM3 port
- (Keil, GCC and IAR) to test the new configMAX_SYSCALL_INTERRUPT_PRIORITY
- functionality.
- + Added the mainINCLUDE_WEB_SERVER definition to the LM3SXXXX IAR and Keil
- projects to allow the WEB server to be conditionally excluded from the
- build and therefore allow use of the KickStart (code size limited)
- compiler version.
-
- Other changes:
-
- + Moved the PIC24 and dsPIC versions of vPortYield() from the C file to
- an assembly file to allow use with all MPLAB compiler versions. This also
- allows the omit-frame-pointer optimisation to be turned off.
-
-Changes between V5.0.0 and V5.0.2 released May 30, 2008
-
- + Updated the PIC32 port to allow queue API calls to be used from
- interrupts above the kernel interrupt priority, and to allow full
- interrupt nesting. Task stack usages has also been reduced.
- + Added a new PowerPC port that demonstrates how the trace macros can be
- used to allow the use of a floating point co-processor. The
- traceTASK_SWITCHED_OUT() and traceTASK_SWITCHED_INT() macros are used to
- save and restore the floating point context respectively for those tasks
- that actually use floating point operations.
- + BUG FIX: The first PPC405 port contained a bug in that it did not leave
- adequate space above the stack for the backchain to be saved when a task
- started to execute for the first time.
- + Updated queue.c to add in the means to allow interrupt nesting and for
- queue API functions to be called from interrupts that have a priority
- above the kernel priority. This is only supported on PIC32 ports thus
- far.
- + Fixed the compiler warnings that were generated when the latest version
- of WinAVR was used.
- + Remove all inline usage of 'inline' from the core kernel code.
- + Added the queue registry feature. The queue registry is provided as a
- means for kernel aware debuggers to locate queue definitions. It has no
- purpose unless you are using a kernel aware debugger. The queue registry
- will only be used when configQUEUE_REGISTRY_SIZE is greater than zero.
- + Added the ST Cortex-M3 drivers into the Demo/Common/Drivers directory to
- prevent them from having to be included in multiple demos.
- + Added a Keil STM32 demo application.
- + Changed the blocktim.c test files as it is no longer legitimate for all
- ports to call queue API functions from within a critical section.
- + Added the IntQueue.c test file to test the calling of queue API functions
- from different interrupt priority levels, and test interrupt nesting.
-
-Changes between V5.0.0 and V5.0.1
-
- + V5.0.1 was a customer specific release.
-
-Changes between V4.8.0 and V5.0.0 released April 15, 2008
-
- *** VERY IMPORTANT INFORMATION ON UPGRADING TO FREERTOS.ORG V5.0.0 ***
-
- The parameters to the functions xQueueSendFromISR(), xQueueSendToFrontFromISR(),
- xQueueSendToBackFromISR() and xSemaphoreGiveFromISR() have changed. You must
- update all calls to these functions to use the new calling convention! Your
- compiler might not issue any type mismatch warnings!
-
-
- Other changes:
-
- + Support added for the new Luminary Micro LM3S3768 and LM3S3748 Cortex-M3
- microcontrollers.
- + New task hook feature added.
- + PowerPC demo updated to use version 10.1 of the Xilinx EDK.
- + Efficiency gains within the PIC32 port layer.
-
-Changes between V4.7.2 and V4.8.0 released March 26 2008
-
- + Added a Virtex4 PowerPC 405 port and demo application.
- + Added optional stack overflow checking and new
- uxTaskGetStackHighWaterMark() function.
- + Added new xQueueIsQueueEmptyFromISR(), xQueueIsQueueFullFromISR() and
- uxQueueMessagesWaitingFromISR() API functions.
- + Efficiency improvements to the Cortex-M3 port layer. NOTE: This
- requires that an SVC handler be installed in the application.
- + Efficiency improvements to the queue send and receive functions.
- + Added new trace macros. These are application definable to provide
- a flexible trace facility.
- + Implemented the configKERNEL_INTERRUPT_PRIORITY within the Keil Cortex
- M3 port layer (bringing it up to the same standard as the IAR and GCC
- versions).
- + Ports that used the arm-stellaris-eabi-gcc tools have been converted to
- use the arm-non-eabi-gcc tools.
-
-Changes between V4.7.1 and V4.7.2 released February 21, 2008
-
- + Added Fujitsu MB91460 port and demo.
- + Added Fujitsu MB96340 port and demo.
- + Tidied up the capitalisation of include files to facilitate builds on
- Linux hosts.
- + Removed some redundant casting that was generating warnings - but was
- included to remove warnings on other compilers.
-
-Changes between V4.7.0 and V4.7.1 released February 3, 2008
-
- + Updated all IAR ARM projects to use V5.11 of the IAR Embedded Workbench
- for ARM.
- + Introduced recursive semaphore feature.
- + Updated LPC2368 demos to take into account silicon bugs in old chip
- revisions.
- + Updated STR9 uIP port to manually set the net mask and gateway addresses.
- + Updating demos to allow more to run with the co-operative scheduler.
- + Fixed co-operative scheduler behaviour upon the occurrence of a tick
- interrupt while the scheduler was suspended.
- + Updated documentation contained within semphr.h.
- + ARM7 GCC ports no longer use the IRQ attribute.
-
-Changes between V4.6.1 and V4.7.0 released December 6, 2007
-
- + Introduced the counting semaphore macros and demo source files. The
- Open Watcom PC project has been updated to include the new demo. See
- the online documentation for more information.
- + Introduced the 'alternative' queue handling API and demo source files.
- The Open Watcom PC project has been updated to include the new demo
- source files. See the online documentation for more information.
- + Added AT91SAM7X Eclipse demo project.
- + Added the STM32 primer demo project for the GCC compiler and Ride IDE.
- + Removed the .lock files that were mistakenly included in the V4.6.1
- eclipse workspaces.
-
-Changes between V4.6.0 and V4.6.1 released November 5 2007
-
- + Added support for the MIPS M4K based PIC32.
- + Added 'extern "C"' to all the header files to facilitate use with C++.
-
-Changes between V4.5.0 and V4.6.0 released October 28 2007
-
- + Changed the method used to force a context switch within an ISR for the
- ARM7/9 GCC ports only. The portENTER_SWITCHING_ISR() and
- portEXIT_SWITCHING_ISR() macros are no longer supported. This is to
- ensure correct behaviour no matter which GCC version is used, with or
- without the -fomit-frame-pointer option, and at all optimisation levels.
- + Corrected the prototype for xQueueGenericSend() within queue.h.
-
-Changes between V4.4.0 and V4.5.0 released September 17 2007
-
- + Added the xQueueSendToFront(), xQueueSendToBack() and xQueuePeek()
- functionality. These should now be used in preference to the old
- xQueueSend() function - which is maintained for backward compatibility.
- + Added Mutex functionality. The behaviour of mutexes is subtly different
- to the already existing binary semaphores as mutexes automatically
- include a priority inheritance mechanism.
- + Added the GenQTest.c and QPeek.c to test and demonstrate the behaviour
- of the new functionality.
- + Updated the LM3Sxxxx and PC ports to include the new GenQTest.c and
- QPeek.c files.
- + Updated the GCC port for the Cortex M3 to include the
- configKERNEL_INTERRUPT_PRIORITY functionality. This was previously only
- included in the IAR port.
- + Optimised the GCC and IAR port layer code - specifically the context
- switch code.
- + Consolidated the LM3Sxxxx EK demos for all development tools into a
- single project that automatically detects which version of the EK the
- application is executing on.
- + Added Eclipse support for LM3Sxxxx evaluation kits.
- + Added Eclipse support for the Keil LPC2368 evaluation kit.
- + Added the Demo/Drivers directory to hold code that is common to multiple
- demo application projects.
- + Included some minor bug fixes in the uIP 1.0 code.
- + Added an lwIP demo for the STR9 - thanks ST for assistance.
- + Updated the AVR32 port to ensure correct behaviour with full compiler
- optimisation.
- + Included binaries for OpenOCD FTDI and parallel port interfaces.
-
-Changes between V4.4.0 and V4.3.1 released July 31, 2007
-
- + Added AVR32 UC3B demo application.
- + Updated AVR32 UC3A port and demo applications.
- + Added IAR lwIP demo for AVR32 UC3A.
- + Updated listGET_OWNER_OF_NEXT_ENTRY() to assist compiler optimisation
- (thanks Niu Yong for making the suggestion).
- + Added xTaskGetSchedulerState() API function.
- + BUG FIX: Corrected behaviour when tasks that are blocked indefinitely
- have their block time adjusted (within xQueueSend() and xQueueReceive()),
- and are the subject of a call the vTaskResume() when they are not
- actually in the Suspended state (thanks Dan Searles for reporting the
- issues).
-
-
-Changes between V4.3.0 and V4.3.1 released June 11, 2007
-
- + Added STMicroelectronics STM32 Cortex-M3 demo application.
- + Updated ustdlib.c for the GCC LM3S6965 demo.
-
-Changes between V4.2.1 and V4.3.0 released June 5, 2007
-
- + Introduced configKERNEL_INTERRUPT_PRIORITY to the IAR Cortex-M3, PIC24
- and dsPIC ports. See the LM3S6965 and PIC24 demo application
- documentation pages for more information.
- + Updated the PIC24 and dsPIC demos to build with V3.0 of the PIC30 GCC
- tools, and changed the demo applications.
- + Added demos for the new Ethernet and CAN enabled Luminary Micro Stellaris
- microcontrollers.
- + Corrected bug in uIP the demos that prevented frames of approximately 1480
- bytes and over from being transmitted.
- + Included the LPC2368/uIP/Rowley demo into the main FreeRTOS.org
- download.
- + Update to WizC PIC18 port to permit its use with version 14 of the
- compiler. Thanks Marcel!
-
-Changes between V4.2.1 and V4.2.0 released April 2, 2007
-
- + Added AVR32 AT32UC3A ports for GCC and IAR.
- + Added -fomit-frame-pointer option to lwIP SAM7X demo makefile.
- + Moved location of call to LCD_Init() in STR9 demo to ensure it is only
- called after the scheduler has been started.
-
-Changes between V4.1.3 and V4.2.0 released February 8, 2007
-
- + Changes to both task.c and queue.c as a result of testing performed on
- the SafeRTOS code base.
- + Added Cortex-M3 LM3S811 demos for GCC and IAR tools.
-
-Changes between V4.1.2 and V4.1.3 released November 19, 2006
-
- + Added STR750 ARM7 port using the Raisonance RIDE/GCC tools.
- + Added -fomit-frame-pointer option to Rowley ARM7 demos as work around
- to GCC bug at some optimisation levels.
- + Altered the way the heap is defined in the LM3S811 Keil demo to prevent
- the RAM usage from counting toward the code size limit calculation.
- + CO-ROUTINE BUG FIX: Removed the call to prvIsQueueEmpty from within
- xQueueCRReceive as it exited with interrupts enabled. Thanks Paul Katz.
- + Tasks that block on events with a timeout of portMAX_DELAY are now
- blocked indefinitely if configINCLUDE_vTaskSuspend is defined.
- Previously portMAX_DELAY was just the longest block time possible. This
- is still the case if configINCLUDE_vTaskSuspend is not defined.
- + Minor changes to some demo application files.
-
-Changes between V4.1.1 and V4.1.2 released October 21, 2006
-
- + Added 16bit PIC ports and demos.
- + Added STR750 port and demo.
-
-
-Changes between V4.1.0 and V4.1.1 released September 24, 2006
-
- + Added the Luminary Micro Stellaris LM3S811 demo application.
-
-Changes between V4.0.5 and V4.1.0 released August 28, 2006
-
- + Prior to V4.1.0, under certain documented circumstances, it was possible
- for xQueueSend() and xQueueReceive() to return without having completed
- and without their block time expiring. The block time effectively
- stated a maximum block time, and the return value of the function needed
- to be checked to determine the reason for returning. This is no longer
- the case as the functions will only return once the block time has
- expired or they are able to complete their operation. It is therefore no
- longer necessary to wrap calls within loops.
- + Changed the critical section handling in the IAR AVR port to correct the
- behaviour when used with later compiler versions.
- + Added the LPC2138 CrossWorks demo into the zip file. Previously this was
- only available as a separate download.
- + Modified the AVR demo applications to demonstrate the use of co-routines.
-
-Changes between V4.0.4 and V4.0.5 released August 13, 2006
-
- + Introduced API function xTaskResumeFromISR(). Same functionality as
- xTaskResume(), but can be called from within an interrupt service routine.
- + Optimised vListInsert() in the case when the wake time is the maximum
- tick count value.
- + Bug fix: The 'value' of the event list item is updated when the priority
- of a task is changed. Previously only the priority of the TCB itself was
- changed.
- + vTaskPrioritySet() and vTaskResume() no longer use the event list item.
- This has not been necessary since V4.0.1 when the xMissedYield handling
- was added.
- + Lowered the PCLK setting on the ARM9 STR9 demo from 96MHz to 48MHz.
- + When ending the scheduler - do not try to attempt a context switch when
- deleting the current task.
- + SAM7X EMAC drivers: Corrected the Rx frame length mask when obtaining
- the length from the rx descriptor.
-
-
-Changes between V4.0.3 and V4.0.4 released June 22, 2006
-
- + Added a port and demo application for the STR9 ARM9 based processors from
- ST.
- + Slight optimisation to the vTaskPrioritySet() function.
- + Included the latest uIP version (1.0) in the demo/common/ethernet
- directory.
-
-Changes between V4.0.2 and V4.0.3 released June 7, 2006
-
- + Added a port and demo application for the Cortex-M3 target using the IAR
- development tools.
- + The ARM Cortex-m3 Rowley projects have been updated to use V1.6 of the
- CrossStudio tools.
- + The heap size defined for the lwIP Rowley demo has been reduced so that
- the project will link correctly when using the command line GCC tools
- also. The makefile has also been modified to allow debugging.
- + The lwIP Rowley demo not includes a 'kernel aware' debug window.
- + The uIP Rowley project has been updated to build with V1.6 of CrossWorks.
- + The second set of tasks in the blockQ demo were created the wrong way
- around (inconsistent to the description in the file). This has been
- corrected.
-
-Changes between V4.0.1 and V4.0.2 released May 28, 2006
-
- + Port and demo application added for the Tern Ethernet Engine controller.
- + Port and demo application added for MC9S12 using GCC, thanks to
- Jefferson "imajeff" Smith.
- + The function vTaskList() now suspends the scheduler rather than disabling
- interrupts during the creation of the task list.
- + Allow a task to delete itself by passing in its own handle. Previously
- this could only be done by passing in NULL.
- + Corrected the value passed to the WDG_PeriodValueConfig() library
- function in the STR71x demo.
- + The tick hook function is now called only within a tick isr. Previously
- it was also called when the tick function was called during the scheduler
- unlocking process.
- + The EMAC driver in the SAM7X lwIP demo has been made more robust as per
- the thread: https://sourceforge.net/forum/message.php?msg_id=3714405
- + In the PC ports: Add function prvSetTickFrequencyDefault() to set the
- DOS tick back to its proper value when the scheduler exits. Thanks
- Raynald!
- + In the Borland x86 ports there was a mistake in the portFIRST_CONTEXT
- macro where the BP register was not popped from the stack correctly. The
- BP value would never get used so this did not cause a problem, but it has
- been corrected all the same.
-
-
-Changes between V4.0.0 and V4.0.1 released April 7 2006
-
- + Improved the ARM CORTEX M3 ports so they now only have to service
- pendSV interrupts.
- + Added a Luminary Micro port and demo for use with Rowley CrossWorks.
- + Added the xMissedYield handling to tasks.c.
-
-Changes between V3.2.4 and V4.0.0
-
- Major changes:
-
- + Added new RTOS port for Luminary Micros ARM CORTEX M3 microcontrollers.
- + Added new co-routine functionality.
-
- Other kernel changes:
-
- + An optional tick hook call is now included in the tick function.
- + Introduced the xMiniListItem structure and removed the list pxHead
- member in order to reduce RAM usage.
- + Added the following definitions to the FreeRTOSConfig.h file included
- with every port:
- configUSE_TICK_HOOK
- configUSE_CO_ROUTINES
- configMAX_CO_ROUTINE_PRIORITIES
- + The volatile qualification has been changed on the list members to allow
- the task.c code to be tidied up a bit.
- + The scheduler can now be started even if no tasks have been created!
- This is to allow co-routines to run when there are no tasks.
- + A task being woken by an event will now preempt the currently running task
- even if its priority is only equal to the currently running task.
-
- Port and demo application changes:
-
- + Updated the WinAVR demo to compile with the latest version of WinAVR
- with no warnings generated.
- + Changed the WinAVR makefile to make chars signed - needed for the
- co-routine code if BaseType_t is set to char.
- + Added new demo application file crflash.c. This demonstrates co-routine
- functionality including passing data between co-routines.
- + Added new demo application file crhook.c. This demonstrates co-routine
- and tick hook functionality including passing data between and ISR and
- a co-routine.
- + Some NOP's were missing following stmdb{}^ instructions in various ARM7
- ports. These have been added.
- + Updated the Open Watcom PC demo project to include the crflash and crhook
- demo co-routines as an example of their use.
- + Updated the H8S demo to compile with the latest version of GCC.
- + Updated the SAM7X EMAC drivers to take into account the hardware errata
- regarding lost packets.
- + Changed the default MAC address used by some WEB server demos as the
- original addresses used was not liked by some routers.
- + Modified the SAM7X/IAR startup code slightly to prevent it hanging on
- some systems when the code is executed using a j-link debugger. The
- j-link macro file configures the PLL before the code executes so
- attempting to configure it again in the startup code was causing a
- problem for some user. Now a check is performed first to see if the
- PLL is already set up.
- + GCC port now contain all assembler code in a single asm block rather than
- individual blocks as before.
- + GCC LPC2000 code now explicitly uses R0 rather than letting the assembler
- choose the register to use as a temporary register during the context
- switch.
- + Added portNOP() macro.
- + The compare match load value on LPC2000 ports now has 1 added to correct
- the value used.
- + The minimal stack depth has been increased slightly on the WIZC PIC18
- port.
-
-Changes between V3.2.3 and V3.2.4
-
- + Modified the GCC ARM7 port layer to allow use with GCC V4.0.0 and above.
- Many thanks to Glen Biagioni for the provided update.
- + Added a new Microblaze port and demo application.
- + Modified the SAM7X EMAC demo to default to use the MII interface rather
- than the RMII interface.
- + Modified the startup sequence of the SAM7X demo slightly to allow the
- EMAC longer to auto negotiate.
-
-Changes between V3.2.2 and V3.2.3
-
- + Added MII interface support to the SAM7X EMAC peripheral driver.
- Previously versions worked with the RMII interface only.
- + Added command line GCC support to the SAM7X lwIP demo. Previously the
- project could only be built using the CrossWorks IDE. Modifications to
- this end include the addition of a standard makefile and linker script to
- the download, and some adjustments to the stacks allocated to each task.
- + Changed the page returned by the lwIP WEB server demo to display the
- task status table rather than the TCP/IP statistics.
- + Corrected the capitalisation of some header file includes and makefile
- dependencies to facilitate use on Linux host computers.
- + The various LPC2000 ports had a mistake in the timer setup where the
- prescale value was written to T0_PC instead of T0_PR. This would have
- no effect unless a prescale value was actually required. This has been
- corrected.
-
-Changes between V3.2.1 and V3.2.2 - Released 23 September, 2005
-
- + Added an IAR port for the Philips LPC2129
- + The Atmel ARM7 IAR demo project files are now saved in the IAR Embedded
- Workbench V4.30a format.
- + Updated the J-Link macro file included with the SAM7X uIP demo project
- to allow the demo board to be reset over the J-Link.
-
-Changes between V3.2.0 and V3.2.1 - Released 1 September, 2005
-
- + Added lwIP demo for AT91SAM7X using Rowley tools.
- + Added uIP demo for AT91SAM7X using IAR tools.
- + Added function xTaskGetCurrentTaskHandle().
- + Renamed events.h to mevents.h to prevent it conflicting with the events.h
- generated automatically by the HCS12 processor expert utility. events.h
- is only used by the PC demo application.
- + Both PIC18 ports now initialise the TBLPTRU to 0 as this is the value
- expected by the compiler, and the compilers do not write to this
- register.
- + The HCS12 banked model demo now creates the 'suicide' tasks immediately
- prior to starting the scheduler. These tasks should be the last tasks to
- get started in order for the test to function correctly.
-
-Changes between V3.1.1 and V3.2.0 - Released 29 June, 2005
-
- V3.2.0 introduces two new MSP430 ports and corrects a minor kernel
- issues. Thanks to Ares.qi for his input.
-
- + Added two MSP430 ports that use the Rowley CrossWorks development tools.
- One port just mirrors the existing GCC port. The other port was provided
- by Milos Prokic. Thanks!
- + V3.2.0 corrects the behavior when vTaskPrioritySet() or vTaskResume()
- are called while the scheduler is locked (by a call to
- vTaskSuspendAll()). When this is done the subject task now starts to
- execute immediately when the scheduler is unlocked if it has the highest
- priority that is ready to run. Previously there was a possibility that
- the task would not run until the next RTOS tick or call to portYIELD().
- + Another similar small correction ensures that in the case where more than
- one task is blocked on a semaphore or queue, the task with the highest
- priority is guaranteed to be unblocked first.
- + Added a couple of more test tasks to the PC demo which cover the points
- above.
-
-Changes between V3.1.0 and V3.1.1 - Released 21st June, 2005
-
- This release updates the HCS12 port. The common kernel code
- remains unchanged.
-
- + Updated the HCS12 port to support banking and introduced a demo
- application for the MC9S12DP256. The new demo application is
- located in the Demo/HCS12_CodeWarrior_banked directory.
- + The name of the directory containing the MC9S12F32 demo application
- has been changed to Demo/HCS12_CodeWarrior_small (as in 'small'
- memory model).
- + MC9S12F32 demo updated slightly to use the PLL. The CPU speed for the
- demo application is now 24MHz. Previously it was 8MHz.
- + The demo application file Demo/Common/Minimal/death.c has a slight
- alteration to prevent it using floating point variables.
-
-
-Changes between V3.0.0 and V3.1.0 - Released 11th June, 2005
-
- + Added new ports for ST Microsystems STR71x, and Freescale HCS12
- microcontrollers. Currently the HCS12 port is limited to the small
- memory model. Large memory models will be supported in the next
- release.
- + PIC18 wizC port updated. Thanks to Marcel van Lieshout for his
- continuing contribution.
- + The accuracy of the AVR port timer setup has been improved. Thanks to
- Thomas Krutmann for this contribution.
- + Added a new conditional compilation macro configIDLE_SHOULD_YIELD.
- See the WEB documentation for details.
- + Updated the CrossWorks uIP demo to build with V1.4 of CrossWorks.
- + Slight modification to the SAM7 release build configuration to correct
- an include path definition.
- + Updated the MPLAB PIC18 documentation to provide extra details on linker
- file configuration.
-
-Changes between V3.0.0 and V2.6.1 - Released 23rd April, 2005
-
- V3.0.0 includes many enhancements, so this history list is broken into
- subsections as follows:
-
- API changes
- New ports
- Directory name changes
- Kernel and miscellaneous changes changes
-
- - API changes
-
- + Each port now defines BaseType_t as the data type that is most
- efficient for that architecture. The type BaseType_t is used
- extensively in API calls necessitating the following changes to the
- FreeRTOS API function prototypes.
-
- See the "New for V3.0.0" section of the FreeRTOS online
- documentation for full details of API changes.
-
- - New ports
-
- + The AT91FR40008 ARM7 port contributed by John Feller is now included
- in the download (thanks John!).
- + The PIC18 port for the wizC/fedC compiler contributed by Marcel van
- Lieshout is now included in the download (thanks Marcel!).
- + The IAR port for the AVR microcontroller has been upgraded to V3.0.0
- and is now a supported port.
-
- - Directory name changes
-
- For consistency, and to allow integration of the new ports, the
- following directory names have been changed.
-
- + The source/portable/GCC/ARM7 directory has been renamed
- source/portable/GCC/ARM7_LPC2000 so it is compatible with the naming
- of other GCC ARM7 ports.
- + The Demo/PIC directory has been renamed Demo/PIC18_MPLAB to
- accommodate the wizC/fedC PIC port.
- + The demo applications for the two AVR ports no longer share the same
- directory. The WinAVR demo is in the Demo/AVR_ATMega323_WinAVR
- directory and the IAR port in the Demo/AVR_ATMega323_IAR directory.
-
-
- - Kernel and miscellaneous changes changes
-
- See the "New for V3.0.0" section of the FreeRTOS online
- documentation for more information.
-
- + Previously 'portmacro.h' contained some user editable definitions
- relating to the user application, and some fixed definitions relating
- specifically to the port being used. The application specific
- definitions have been removed from 'portmacro.h' and placed inside a
- new header file called 'FreeRTOSConfig.h'. 'portmacro.h' should now
- never be modified by the user. A 'FreeRTOSConfig.h' is now included
- in each of FreeRTOS/Demo subdirectories - as it's settings relate to
- the demo application rather than being specific to the port.
- + Introduced configUSE_IDLE_HOOK in idle task.
- + The idle task will yield when another idle priority task is ready to
- run. Previously the idle task would run to the end of its time slice
- regardless.
- + The idle task is now created when the scheduler is started. This
- requires less stack than the previous scheme where it was created upon
- creation of the first application task.
- + The function usPortCheckFreeStackSpace() has been renamed
- usTaskCheckFreeStackSpace() and moved from the portable layer to
- tasks.c.
- + Corrected spelling of portMINMAL_STACK_SIZE to portMINIMAL_STACK_SIZE.
- + The portheap.c file included with the AVR port has been deleted. The
- AVR demo now uses the standard heap1 sample memory allocator.
- + The GCC AVR port is now build using the standard make utility. The
- batch files used previously have been deleted. This means a recent
- version of WinAVR is required in order to create a binary suitable for
- source level debugging.
- + vTaskStartScheduler() no longer takes the configUSE_PREEMPTION
- constant as a parameter. Instead the constant is used directly within
- tasks.c and no parameter is required.
- + The header file 'FreeRTOS.h' has been created and is used to include
- 'projdefs.h', 'FreeRTOSConfig.h' and 'portable.h' in the necessary
- order. FreeRTOS.h can now be included in place of these other
- headers.
- + The header file 'errors.h' has been deleted. The definitions it
- contained are now located within 'projdefs.h'.
- + pvPortMalloc() now takes a size_t parameter as per the ANSI malloc().
- Previously an unsigned short was used.
- + When resuming the scheduler a yield is performed if either a tick has
- been missed, or a task is moved from the pending ready list into a
- ready list. Previously a yield was not performed on this second
- condition.
- + In heap1.c an overflow check has been added to ensure the next free
- byte variable does not wrap around.
- + Introduced the portTASK_FUNCTION() and portTASK_FUNCTION_PROTO()
- macros.
- + The MPLAB PIC port now saved the TABLAT register in interrupt service
- routines.
-
-Changes between V2.6.0 and V2.6.1 - Released Feb 22, 2005
-
- This version adds support for the H8 processor.
-
- Other changes:
-
- + tskMAX_TASK_NAME_LEN removed from the task.h header and added to each
- individual portmacro.h file as portMAX_TASK_NAME_LEN. This allows RAM
- limited ports to allocate fewer characters to the task name.
- + AVR port - Replaced the inb() and outb() functions with direct memory
- access. This allows the port to be built with the 20050414 build of
- WinAVR.
- + GCC LPC2106 port - removed the 'static' from the definition of
- vNonPreemptiveTick() to allow the demo to link when using the cooperative
- scheduler.
- + GCC LPC2106 port - Corrected the optimisation options in the batch files
- ROM_THUMB.bat, RAM_THUMB.bat, ROM_ARM.bat and RAM_ARM.bat. The lower case
- -o is replaced by an uppercase -O.
- + Tasks.c - The strcpy call has been removed when copying across the task
- name into the TCB.
- + Updated the trace visualisation to always be 4 byte aligned so it can be
- used on ARM architectures.
- + There are now two tracecon executables (that convert the trace file binary
- into an ASCII file). One for big endian targets and one for little endian
- targets.
- + Added ucTasksDeleted variable to prevent vTaskSuspendAll() being called
- too often in the idle task.
- + SAM7 USB driver - Replaced the duplicated RX_DATA_BK0 in the interrupt
- mask with the RX_DATA_BK1.
-
-
-Changes between V2.5.5 and V2.6.0 - Released January 16, 2005
-
- + Added the API function vTaskDelayUntil(). The demo app file
- Demo/Common/Minimal/flash.c has been updated to demonstrate its use.
- + Added INCLUDE_vTaskDelay conditional compilation.
- + Changed the name of the Demo/ARM7_AtmelSAM7S64_IAR directory to
- Demo/ARM7_AT91SAM7S64_IAR for consistency.
- + Modified the AT91SAM7S USB driver to allow descriptors that have
- a length that is an exact multiple of the FIFO to be transmitted.
-
-Changes between V2.5.4 and V2.5.5 - Released January 3, 2005
-
- This version adds support for the Atmel SAM7 ARM7 microcontrollers
- along with the IAR development tools.
-
- Other changes:
-
- + Renamed the Demo/ARM7 directory to Demo/ARM7_LPC2106_GCC.
- + Renamed the Demo/ARM7_Keil directory to Demo/ARM7_LPC2129_Keil.
- + Modified the Philips ARM7 serial interrupt service routines to only
- process one interrupt per call. This seems to enable the ISR to
- operate more quickly.
- + Removed the 'far' keyword from the Open Watcom portable layer source
- files. This allows their use with V1.3 of Open Watcom.
- + Minor modifications to the SDCC build files to allow their use under
- Linux. Thanks to Frieder Ferlemann for this contribution.
- + Small change to sTaskCreate() to allow a context switch even when
- pxCreatedTask is NULL. Thanks to Kamil for this contribution.
- + inline keyword removed from vTaskSwitchContext() and VTaskIncrementTick()
- definitions.
-
-Changes between V2.5.3 and V2.5.4 - Released Dec 1, 2004
-
- This is an important maintenance release.
-
- The function cTaskResumeAll() has been modified so it can be used safely
- prior to the kernel being initialised. This was an issue as
- cTaskResumeAll() is called from pvPortMalloc(). Thanks to Daniel Braun
- for highlighting this issue.
-
-Changes between V2.5.2 and V2.5.3 - Released Nov 2, 2004
-
- The critical section handling functions have been changed for the GCC ARM7
- port. Some optimisation levels use the stack differently to others. This
- means the interrupt flags cannot always be stored on the stack and are
- instead now stored in a variable, which is then saved as part of the
- tasks context. This allows the GCC ARM7 port to be used at all
- optimisation levels - including -Os.
-
- Other minor changes:
-
- + MSP430 definition of usCriticalNesting now uses the volatile qualifier.
- This is probably not required but added just in case.
-
-Changes between V2.5.1 and V2.5.2 - Released Oct 26, 2004
-
- + Added the Keil ARM7 port.
- + Slight modification to comtest.c to make the delay periods more random.
- This creates a better test condition.
-
-Changes between V2.5.0 and V2.5.1 - Released Oct 9, 2004
-
- + Added the MSP430 port.
- + Extra comments added to the GCC ARM7 port.c and portISR.c files.
- + The memory pool allocated within heap_1.c has been placed within a
- structure to ensure correct memory alignment on 32bit systems.
- + Within the GCC ARM7 serial drivers an extra check is made to ensure
- the post to the queue was successful if then attempting immediately
- retrieve the posted character.
- + Changed the name of the constant portTICKS_PER_MS to portTICK_PERIOD_MS
- as the old name was misleading.
-
-
-Changes between V2.4.2 and V2.5.0 - Released Aug 12, 2004
-
- The RTOS source code download now includes three separate memory allocation
- schemes - so you can choose the most appropriate for your application.
- These are found in the Source/Portable/MemMang directory. The demo
- application projects have also been updated to demonstrate the new schemes.
- See the "Memory Management" page of the API documentation for more details.
-
- + Added heap_1.c, heap_2.c and heap_3.c in the Source/Portable/MemMang
- directory.
- + Replaced the portheap.c files for each demo application with one of the
- new memory allocation files.
- + Updated the portmacro.h file for each demo application to include the
- constants required for the new memory allocators: portTOTAL_HEAP_SIZE and
- portBYTE_ALIGNMENT.
- + Added a new test to the ARM7 demo application that tests the operation
- of the heap_2 memory allocator.
-
-
-Changes between V2.4.1 and V2.4.2 - Released July 14, 2004
-
- + The ARM7 port now supports THUMB mode.
- + Modification to the ARM7 demo application serial port driver.
-
-Changes between V2.4.0 and V2.4.1 - Released July 2, 2004
-
- + Rationalised the ARM7 port version of portEXIT_CRITICAL() -
- improvements provided by Bill Knight.
- + Made demo serial driver more complete and robust.
-
-
-Changes between V2.4.0 and V2.3.1 - Released June 30, 2004
-
- + Added the first ARM7 port - thanks to Bill Knight for the assistance
- provided.
- + Added extra files to the Demo/Common/Minimal directory. These are
- equivalent to their Demo/Common/Full counterparts but with the
- calls to the functions defined in print.c removed.
- + Added TABLAT to the list of registers saved as part of a PIC18 context.
-
-Changes between V2.3.0 and V2.3.1 - Released June 25, 2004
-
- + Changed the way the vector table is defined to be more portable.
- + Corrected the definitions of SPH and SPL in portmacro.s90.
- The previous definitions prevented V2.3.0 operating if the iom323.h
- header file was included in portmacro.s90.
-
-Changes between V2.2.0 and V2.3.0 - Released June 19, 2004
-
- + Added an AVR port that uses the IAR compiler.
- + Explicit use of 'signed' qualifier on plain char types.
- + Modified the Open Watcom project files to use 'signed' as the
- default char type.
- + Changed odd calculation of initial pxTopOfStack value when
- portSTACK_GROWTH < 0.
- + Added inline qualifier to context switch functions within task.c.
- Ports that do not support the (non ANSI) inline keyword have the
- inline #define'd away in their respective portmacro.h files.
-
-Changes between V2.1.1 and V2.2.0 - Released May 18, 2004
-
- + Added Cygnal 8051 port.
- + PCLATU and PCLATH are now saved as part of the PIC18 context. This
- allows function pointers to be used within tasks. Thanks to Javier
- Espeche for the enhancement.
- + Minor changes to demo application files to reduce stack usage.
- + Minor changes to prevent compiler warnings when compiling the new port.
-
-Changes between V2.1.0 and V2.1.1 - Released March 12, 2004
-
- + Bug fix - pxCurrentTCB is now initialised before the call to
- prvInitialiseTaskLists(). Previously pxCurrentTCB could be accessed
- while null during the initialisation sequence. Thanks to Giuseppe
- Franco for the correction.
-
-Changes between V2.0.0 and V2.1.0 - Released Feb 29, 2004
-
- V2.1.0 has significant reworks that greatly reduce the amount of time
- the kernel has interrupts disabled. The first section of modifications
- listed here must be taken into account by users. The second section
- are related to the kernel implementation and as such are transparent.
-
- Section1 :
-
- + The typedef TickType_t has been introduced. All delay times should
- now use a variable of type TickType_t in place of the unsigned long's
- used previously. API function prototypes have been updated
- appropriately.
- + The configuration macro USE_16_BIT_TICKS has been introduced. If set
- to 1 TickType_t is defined as an unsigned short. If set to 0
- TickType_t is defined as an unsigned long. See the configuration
- section of the API documentation for more details.
- + The configuration macro INCLUDE_vTaskSuspendAll is now obsolete.
- + vTaskResumeAll() has been renamed cTaskResumeAll() as it now returns a
- value (see the API documentation).
- + ulTaskGetTickCount() has been renamed xTaskGetTickCount() as the type
- it returns now depends on the USE_16_BIT_TICKS definition.
- + cQueueReceive() must now >never< be used from within an ISR. Use the new
- cQueueReceiveFromISR() function instead.
-
- Section 2:
-
- + A mechanism has been introduced that allows a queue to be accessed by
- a task and ISR simultaneously.
- + A "pending ready" queue has been introduced that enables interrupts to
- be processed when the scheduler is suspended.
- + The list implementation has been improved to provide faster item
- removal.
- + The scheduler now makes use of the scheduler suspend mechanism in places
- where previously interrupts were disabled.
-
-Changes between V1.2.6 and V2.0.0 - Released Jan 31, 2004
-
- + Introduced new API functions:
- vTaskPriorityGet ()
- vTaskPrioritySet ()
- vTaskSuspend ()
- vTaskResume ()
- vTaskSuspendAll ()
- vTaskResumeAll ()
- + Added conditional compilation options that allow the components of the
- kernel that are unused by an application to be excluded from the build.
- See the Configuration section on the WEB site for more information (on
- the API pages). The macros have been added to each portmacro.h file (
- sometimes called prtmacro.h).
- + Rearranged tasks.c.
- + Added demo application file dynamic.c.
- + Updated the PC demo application to make use of dynamic.c.
- + Updated the documentation contained in the kernel header files.
- + Creating a task now causes a context switch if the task being created
- has a higher priority than the calling task - assuming the kernel is
- running.
- + vTaskDelete() now only causes a context switch if the calling task is
- the task being deleted.
-
-Changes between V1.2.5 and V1.2.6 - Released December 31, 2003
-
- Barring the change to the interrupt vector (PIC port) these are minor
- enhancements.
-
- + The interrupt vector used for the PIC master ISR has been changed from
- 0x18 to 0x08 - where it should have always been. The incorrect address
- still works but probably executes a number of NOP's before getting to the
- ISR.
- + Changed the baud rate used by the AVR demo application to 38400. This
- has an error percentage of less than one percent with an 8MHz clock.
- + Raised the priority of the Rx task in demo\full\comtest.c. This only
- affects the Flashlite and PC ports. This was done to prevent the Rx
- buffer becoming full.
- + Reverted the Flashlite COM port driver back so it does not use the DMA.
- The DMA appears to miss characters under stress. The Borland Flashlite
- port was also calculating a register value incorrectly resulting in the
- wrong DMA source address being used. The same code worked fine when
- compiling with Open Watcom. Other minor enhancements were made to the
- interrupt handling.
- + Modified the PIC serial Rx ISR to check for and clear overrun errors.
- Overrun errors seem to prevent any further characters being received.
- + The PIC demo projects now have some optimisation switched on.
-
-
-Changes between V1.2.4 and V1.2.5
-
- Small fix made to the PIC specific port.c file described below.
-
- + Introduced portGLOBAL_INTERRUPT_FLAG definition to test the global
- interrupt flag setting. Using the two bits defined within
- portINITAL_INTERRUPT_STATE was causing the w register to get clobbered
- before the test was performed.
-
-Changes between V1.2.3 and V1.2.4
-
- V1.2.4 contains a release version of the PIC18 port.
- An optional exception has been included with the GPL. See the licensing
- section of www.FreeRTOS.org for details.
-
- + The function xPortInitMinimal() has been renamed to
- xSerialPortInitMinimal() and the function xPortInit() has been renamed
- to xSerialPortInit().
- + The function sSerialPutChar() has been renamed cSerialPutChar() and
- the function return type chaned to portCHAR.
- + The integer and flop tasks now include calls to tskYIELD(), allowing
- them to be used with the cooperative scheduler.
- + All the demo applications now use the integer and comtest tasks when the
- cooperative scheduler is being used. Previously they were only used with
- the preemptive scheduler.
- + Minor changes made to operation of minimal versions of comtest.c and
- integer.c.
- + The ATMega port definition of portCPU_CLOSK_HZ definition changed to
- 8MHz base 10, previously it base 16.
-
-
-
-Changes between V1.2.2a and V1.2.3
-
- The only change of any significance is to the license, which has changed
- from the Open Software License to the GNU GPL.
-
- The zip file also contains a pre-release version of the PIC18 port. This
- has not yet completed testing and as such does not constitute part of the
- V1.2.3 release. It is still however covered by the GNU GPL.
-
- There are minor source code changes to accommodate the PIC C compiler.
- These mainly involve more explicit casting.
-
- + sTaskCreate() has been modified slightly to make use of the
- portSTACK_GROWTH macro. This is required for the PIC port where the
- stack grows in the opposite direction to the other existing ports.
- + prvCheckTasksWaitingTermination() has been modified slightly to bring
- the decrementing of usCurrentNumberOfTasks within the critical section,
- where it should have been since the creation of an eight bit port.
-
-Changes between V1.2.2 and V1.2.2a
-
- The makefile and buildcoff.bat files included with the AVR demo application
- have been modified for use with the September 2003 build of WinAVR. No
- source files have changed.
-
-Changes between V1.2.1 and V1.2.2
-
- There are only minor changes here to allow the PC and Flashlite 186 ports
- to use the Borland V4.52 compiler, as supplied with the Flashlite 186
- development kit.
-
- + Introduced a BCC directory under source\portable. This contains all the
- files specific to the Borland compiler port.
- + Corrected the macro naming of portMS_PER_TICK to portTICKS_PER_MS.
- + Modified comtest.c to increase the rate at which the string is
- transmitted and received on the serial port. The Flashlite 186 demo
- app baud rate has also been increased.
- + The values of the constants used in both integer.c files have been
- increased to force the Borland compiler to use 32 bit values. The
- Borland optimiser placed the previous values in 16 bit registers, and in
- So doing invalidated the test.
-
-Changes between V1.2.0 and V1.2.1
-
- This version includes some minor changes to the list implementation aimed
- at improving the context switch time - with is now approximately 10% faster.
- Changes include the removal of some null pointer assignment checks. These
- were redundant where the scheduler uses the list functions, but means any
- user application choosing to use the same list functions must now check
- that no NULL pointers are passed as a parameter.
-
- The Flashlite 186 serial port driver has also been modified to use a DMA
- channel for transmissions. The serial driver is fully functional but still
- under development. Flashlite users may prefer to use V1.2.0 for now.
-
- Details:
-
- + Changed the baud rate for the ATMega323 serial test from 19200 to 57600.
- + Use vSerialPutString() instead of single character puts in
- Demo\Full\Comtest.c. This allows the use of the flashlite DMA serial
- driver. Also the check variable only stops incrementing after two
- consecutive failures.
- + semtest.c creates four tasks, two of which operate at the idle priority.
- The tasks that operate at the idle priority now use a lower expected
- count than those running at a higher priority. This prevents the low
- priority tasks from signalling an error because they have not been
- scheduled enough time for each of them to count the shared variable to
- the higher original value.
- + The flashlite 186 serial driver now uses a DMA channel for transmissions.
- + Removed the volatile modifier from the list function parameters. This was
- only ever included to prevent compiler warnings. Now warnings are
- removed by casting parameters where the calls are made.
- + prvListGetOwnerOfNextEntry() and prvListGetOwnerOfHeadEntry() have been
- removed from list.c and added as macros in list.h.
- + usNumberOfItems has been added to the list structure. This removes the
- need for a pointer comparison when checking if a list is empty, and so
- is slightly faster.
- + Removed the NULL check in vListRemove(). This makes the call faster but
- necessitates any application code utilising the list implementation to
- ensure NULL pointers are not passed.
- + Renamed portTICKS_PER_MS definition to portMS_PER_TICK (milli seconds
- per tick). This is what it always should have been.
-
-Changes between V1.01 and V1.2.0
-
- The majority of these changes were made to accommodate the 8bit AVR port.
- The scheduler workings have not changed, but some of the data types used
- have been made more friendly to an eight bit environment.
-
- Details:
-
- + Changed the version numbering format.
- + Added AVR port.
- + Split the directory demo\common into demo\common\minimal and
- demo\common\full. The files in the full directory are for systems with
- a display (currently PC and Flashlite 186 demo's). The files in the
- minimal directory are for systems with limited RAM and no display
- (currently MegaAVR).
- + Minor changes to demo application function prototypes to make more use
- of 8bit data types.
- + Within the scheduler itself the following functions have slightly
- modified declarations to make use of 8bit data types where possible:
- xQueueCreate(),
- sQueueReceive(),
- sQUeueReceive(),
- usQueueMessageWaiting(),
- sQueueSendFromISR(),
- sSemaphoreTake(),
- sSemaphoreGive(),
- sSemaphoreGiveFromISR(),
- sTaskCreate(),
- sTaskMoveFromEventList().
-
- Where the return type has changed the function name has also changed in
- accordance with the naming convention. For example
- usQueueMessageWaiting() has become ucQueueMessageWaiting().
- + The definition tskMAX_PRIORITIES has been moved from task.h to
- portmacro.h and renamed portMAX_PRIORITIES. This allows different
- ports to allocate a different maximum number of priorities.
- + By default the trace facility is off, previously USE_TRACE_FACILITY
- was defined.
- + comtest.c now uses a psuedo random delay between sends. This allows for
- better testing as the interrupts do not arrive at regular intervals.
- + Minor change to the Flashlite serial port driver. The driver is written
- to demonstrate the scheduler and is not written to be efficient.
-
-
-
-Changes between V1.00 and V1.01
-
- These changes improve the ports. The scheduler itself has not changed.
-
- Improved context switch mechanism used when performing a context
- switch from an ISR (both the tick ISR and the serial comms ISR's within
- the demo application). The new mechanism is faster and uses less stack.
-
- The assembler file portasm.asm has been replaced by a header file
- portasm.h. This includes a few assembler macro definitions.
-
- All saving and restoring of registers onto/off of the stack is now handled
- by the compiler. This means the initial stack setup for a task has to
- mimic the stack used by the compiler, which is different for debug and
- release builds.
-
- Slightly changed the operation of the demo application, details below.
-
- Details:
-
- + portSWITCH_CONTEXT() replaced by vPortFirstContext().
- + pxPortInitialiseStack() modified to replicate the stack used by the
- compiler.
- + portasm.asm file removed.
- + portasm.h introduced. This contains macro definitions for
- portSWITCH_CONTEXT() and portFIRST_CONTEXT().
- + Context switch from ISR now uses the compiler generated interrupt
- mechanism. This is done simply by calling portSWITCH_CONTEXT and leaving
- the save/restore to compiler generated code.
- + Calls to taskYIELD() during ISR's have been replaced by calling the
- simpler and faster portSWITCH_CONTEXT().
- + The Flashlite 186 port now uses 186 instruction set (used to use 80x86
- instructions only).
- + The blocking queue tasks within the demo application did not operate
- quite as described. This has been corrected.
- + The priority of the comtest Rx task within the demo application has been
- lowered. Received characters are now processed (read from the queue) at
- the idle priority, allowing low priority tasks to run evenly at times of
- a high communications overhead.
- + Prevent the call to kbhit() in main.c for debug builds as the debugger
- seems to have problems stepping over the call. This if for the PC port
- only.
-
-
-
+Documentation and download available at https://www.FreeRTOS.org/
+
+Changes between FreeRTOS V10.5.0 and FreeRTOS V10.5.1 released November 16 2022
+
+ + Updating the version in the manifest.yml file to be accurate.
+
+Changes between FreeRTOS V10.4.6 and FreeRTOS V10.5.0 released September 16 2022
+
+ + ARMv7-M and ARMv8-M MPU ports: It was possible for a third party that
+ already independently gained the ability to execute injected code to
+ read from or write to arbitrary addresses by passing a negative argument
+ as the xIndex parameter to pvTaskGetThreadLocalStoragePointer() or
+ vTaskSetThreadLocalStoragePointer respectively. A check has been added to
+ ensure that passing a negative argument as the xIndex parameter does not
+ cause arbitrary read or write.
+ We thank Certibit Consulting, LLC for reporting this issue.
+ + ARMv7-M and ARMv8-M MPU ports: It was possible for an unprivileged task
+ to invoke any function with privilege by passing it as a parameter to
+ MPU_xTaskCreate, MPU_xTaskCreateStatic, MPU_xTimerCreate,
+ MPU_xTimerCreateStatic, or MPU_xTimerPendFunctionCall. MPU_xTaskCreate
+ and MPU_xTaskCreateStatic have been updated to only allow creation of
+ unprivileged tasks. MPU_xTimerCreate, MPU_xTimerCreateStatic and
+ MPU_xTimerPendFunctionCall APIs have been removed.
+ We thank Huazhong University of Science and Technology for reporting
+ this issue.
+ + ARMv7-M and ARMv8-M MPU ports: It was possible for a third party that
+ already independently gained the ability to execute injected code to
+ achieve further privilege escalation by branching directly inside a
+ FreeRTOS MPU API wrapper function with a manually crafted stack frame.
+ The local stack variable `xRunningPrivileged` has been removed so that
+ a manually crafted stack frame cannot be used for privilege escalation
+ by branching directly inside a FreeRTOS MPU API wrapper.
+ We thank Certibit Consulting, LLC, Huazhong University of Science and
+ Technology and the SecLab team at Northeastern University for reporting
+ this issue.
+ + ARMv7-M MPU ports: It was possible to configure overlapping memory
+ protection unit (MPU) regions such that an unprivileged task could access
+ privileged data. The kernel now uses highest numbered MPU regions for
+ kernel protections to prevent such MPU configurations.
+ We thank the SecLab team at Northeastern University for reporting this
+ issue.
+ + Add support for ARM Cortex-M55.
+ + Add support for ARM Cortex-M85. Contributed by @gbrtth.
+ + Add vectored mode interrupt support to the RISC-V port.
+ + Add support for RV32E extension (Embedded Profile) in RISC-V GCC port.
+ Contributed by @Limoto.
+ + Heap improvements:
+ - Add a check to heap_2 to track if a memory block is allocated to
+ the application or not. The MSB of the size field is used for this
+ purpose. The same check already exists in heap_4 and heap_5. This
+ check prevents double free errors.
+ - Add a new flag configHEAP_CLEAR_MEMORY_ON_FREE to heap_2, heap_4
+ and heap_5. If the flag is set in FreeRTOSConfig.h then memory freed using
+ vPortFree() is automatically cleared to zero.
+ - Add a new API pvPortCalloc to heap_2, heap_4 and heap_5 which has the same
+ signature as the standard library calloc function.
+ - Update the pointer types to portPOINTER_SIZE_TYPE. Contributed by
+ @Octaviarius.
+ + Add the ability to override send and receive completed callbacks for each
+ instance of a stream buffer or message buffer. Earlier there could be
+ one send and one receive callback for all instances of stream and message
+ buffers. Having separate callbacks per instance allows different message
+ and stream buffers to be used differently - for example, some for inter core
+ communication and others for same core communication.
+ The feature can be controlled by setting the configuration option
+ configUSE_SB_COMPLETED_CALLBACK in FreeRTOSConfig.h. When the option is set to 1,
+ APIs xStreamBufferCreateWithCallback() or xStreamBufferCreateStaticWithCallback()
+ (and likewise APIs for message buffer) can be used to create a stream buffer
+ or message buffer instance with application provided callback overrides. When
+ the option is set to 0, then the default callbacks as defined by
+ sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
+ backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
+ functionality is currently not supported for MPU enabled ports.
+ + Generalize the FreeRTOS's Thread Local Storage (TLS) support so that it
+ is not tied to newlib and can be used with other c-runtime libraries also.
+ The default behavior for newlib support is kept same for backward
+ compatibility.
+ + Add support to build and link FreeRTOS using CMake build system. Contributed
+ by @yhsb2k.
+ + Add support to generate Software Bill of Materials (SBOM) for every release.
+ + Add support for 16 MPU regions to the GCC Cortex-M33 ports.
+ + Add ARM Cortex-M7 r0p0/r0p1 Errata 837070 workaround to ARM CM4 MPU ports.
+ The application writer needs to define configENABLE_ERRATA_837070_WORKAROUND
+ when using CM4 MPU ports on a Cortex-M7 r0p0/r0p1 core.
+ + Add configSYSTICK_CLOCK_HZ to Cortex-M0 ports. This is needed to support
+ the case when the SysTick timer is not clocked from the same source as the CPU.
+ + Add hardware stack protection support to MicroBlazeV9 port. This ensures that
+ the CPU immediately raises Stack Protection Violation exception as soon as any
+ task violates its stack limits. Contributed by @uecasm.
+ + Introduce the configUSE_MINI_LIST_ITEM configuration option. When this
+ option is set to 1, ListItem_t and MiniLitItem_t remain separate types.
+ However, when configUSE_MINI_LIST_ITEM == 0, MiniLitItem_t and ListItem_t
+ are both typedefs of the same struct xLIST_ITEM. This addresses some issues
+ observed when strict-aliasing and link time optimization are enabled.
+ To maintain backwards compatibility, configUSE_MINI_LIST_ITEM defaults to 1.
+ + Simplify prvInitialiseNewTask to memset newly allocated TCB structures
+ to zero, and remove code that set individual structure members to zero.
+ + Add prototype for prvPortYieldFromISR to the POSIX port so that it builds
+ without any warning with -Wmissing-prototypes compiler option.
+ + Add top of stack and end of stack to the task info report obtained using
+ vTaskGetInfo(). Contributed by @shreyasbharath.
+ + Add a cap to the cRxLock and cTxLock members of the queue data structure.
+ These locks count the number items received and sent to the queue while
+ the queue was locked. These are later used to unblock tasks waiting on
+ the queue when the queue is unlocked. This PR caps the values of the
+ cRxLock and cTxLock to the number of tasks in the system because we cannot
+ unblock more tasks than there are in the system. Note that the same assert
+ could still be triggered is the application creates more than 127 tasks.
+ + Changed uxAutoReload parameter in timer functions to xAutoReload. The
+ type is now BaseType_t. This matches the type of pdTRUE and pdFALSE.
+ The new function xTimerGetAutoReload() provides the auto-reload state as
+ a BaseType_t. The legacy function uxTimerGetAutoReload is retained with the
+ original UBaseType_t return value.
+ + Fix support for user implementations of tickless idle that call
+ vTaskStepTick() with xExpectedIdleTime ticks to step. The new code
+ ensures xTickCount reaches xNextTaskUnblockTime inside xTaskIncrementTick()
+ instead of inside vTaskStepTick(). This fixes the typical case where a task
+ wakes up one tick late and a rare case assertion failure when xTickCount\
+ rolls over. Contributed by @jefftenney.
+ + Fix deadlock in event groups when pvPortMalloc and vPortFree functions
+ are protected with a mutex. Contributed by @clemenskresser.
+ + Fix a warning in tasks.c when compiled with -Wduplicated-branches
+ GCC option. Contributed by @pierrenoel-bouteville-act.
+ + Fix compilation error in tasks.c when configSUPPORT_DYNAMIC_ALLOCATION
+ is set to zero. Contributed by @rdpoor.
+ + Fix prvWriteMessageToBuffer() function in stream_buffer.c so that it correctly
+ copies length on big endian platforms too.
+ + Remove the need for INCLUDE_vTaskSuspend to be set to 1
+ when configUSE_TICKLESS_IDLE is enabled. Contributed by @pramithkv.
+ + Update the RL78 IAR port to the latest version of IAR which uses the
+ industry standard ELF format as opposed to earlier UBROF object format.
+ Contributed by @felipe-iar.
+ + Add tick type is atomic flag when tick count is 16-bit to PIC24 port. This
+ allows the PIC24 family of 16 bit processors to read the tick count without
+ a critical section when the tick count is also 16 bits.
+ + Fix offset-out-of-range errors for GCC CM3/CM4 mpu ports when
+ Link Time Optimization is enabled. Contributed by @niniemann.
+ + Remove #error when RISC-V port is compiled on a 64-bit RISC-V platform.
+ Contributed by @cmdrf.
+ + Fix ullPortInterruptNesting alignment in Cortex-A53 port so that it is
+ 8-byte aligned. This fixes the unaligned access exception. Contributed
+ by @Atomar25.
+ + Fix Interrupt Handler Register Function and Exception Process in NiosII
+ Port. Contributed by @ghost.
+ + Change FreeRTOS IRQ Handler for Cortex-A53 SRE port to store and restore
+ interrupt acknowledge register. This ensures that the SRE port behavior
+ matches the Memory Mapped IO port. Contributed by @sviaunxp.
+ + Update the uncrustify config file to match the version of the uncrustify
+ used in the CI Action. Also, pin the version of uncrustify in CI. Contributed
+ by @swaldhoer.
+
+Changes between FreeRTOS V10.4.5 and FreeRTOS V10.4.6 released November 12 2021
+
+ + ARMv7-M and ARMv8-M MPU ports – prevent non-kernel code from calling the
+ internal functions xPortRaisePrivilege and vPortResetPrivilege by changing
+ them to macros.
+ + Introduce a new config configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS which
+ enables developers to prevent critical sections from unprivileged tasks.
+ It defaults to 1 for backward compatibility. Application should set it to
+ 0 to disable critical sections from unprivileged tasks.
+
+Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.4.5.html
+
+ + Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define
+ the type used to hold run time statistic counters. Defaults to uint32_t
+ for backward compatibility. #define configRUN_TIME_COUNTER_TYPE to a type
+ (for example, uint64_t) in FreeRTOSConfig.h to override the default.
+ + Introduce ulTaskGetIdleRunTimePercent() to complement the pre-existing
+ ulTaskGetIdleRunTimeCounter(). Whereas the pre-existing function returns
+ the raw run time counter value, the new function returns the percentage of
+ the entire run time consumed by the idle task. Note the amount of idle
+ time is only a good measure of the slack time in a system if there are no
+ other tasks executing at the idle priority, tickless idle is not used, and
+ configIDLE_SHOULD_YIELD is set to 0.
+ + ARMv8-M secure-side port: Tasks that call secure functions from the
+ non-secure side of an ARMv8-M MCU (ARM Cortex-M23 and Cortex-M33) have two
+ contexts - one on the non-secure side and one on the secure-side. Previous
+ versions of the FreeRTOS ARMv8-M secure-side ports allocated the structures
+ that reference secure-side contexts at run time. Now the structures are
+ allocated statically at compile time. The change necessitates the
+ introduction of the secureconfigMAX_SECURE_CONTEXTS configuration constant,
+ which sets the number of statically allocated secure contexts.
+ secureconfigMAX_SECURE_CONTEXTS defaults to 8 if left undefined.
+ Applications that only use FreeRTOS code on the non-secure side, such as
+ those running third-party code on the secure side, are not affected by
+ this change.
+
+Changes between FreeRTOS V10.4.3 and FreeRTOS V10.4.4 released May 28 2021
+ + Minor performance improvements to xTaskIncrementTick() achieved by providing
+ macro versions of uxListRemove() and vListInsertEnd().
+ + Minor refactor of timers.c that obsoletes the need for the
+ tmrCOMMAND_START_DONT_TRACE macro and removes the need for timers.c to
+ post to its own event queue. A consequence of this change is that auto-
+ reload timers that miss their intended next execution time will execute
+ again immediately rather than executing again the next time the command
+ queue is processed. (thanks Jeff Tenney).
+ + Fix a race condition in the message buffer implementation. The
+ underlying cause was that length and data bytes are written and read as
+ two distinct operations, which both modify the size of the buffer. If a
+ context switch occurs after adding or removing the length bytes, but
+ before adding or removing the data bytes, then another task may observe
+ the message buffer in an invalid state.
+ + The xTaskCreate() and xTaskCreateStatic() functions accept a task priority
+ as an input parameter. The priority has always been silently capped to
+ (configMAX_PRIORITIES - 1) should it be set to a value above that priority.
+ Now values above that priority will also trigger a configASSERT() failure.
+ + Replace configASSERT( pcQueueName ) in vQueueAddToRegistry with a NULL
+ pointer check.
+ + Introduce the configSTACK_ALLOCATION_FROM_SEPARATE_HEAP configuration
+ constant that enables the stack allocated to tasks to come from a heap other
+ than the heap used by other memory allocations. This enables stacks to be
+ placed within special regions, such as fast tightly coupled memory.
+ + If there is an attempt to add the same queue or semaphore handle to the
+ queue registry more than once then prior versions would create two separate
+ entries. Now if this is done the first entry is overwritten rather than
+ duplicated.
+ + Update the ESP32 port and TF-M (Trusted Firmware M)code to the latest from
+ their respective repositories.
+ + Correct a build error in the POSIX port.
+ + Additional minor formatting updates, including replacing tabs with spaces
+ in more files.
+ + Other minor updates include adding additional configASSERT() checks and
+ correcting and improving code comments.
+ + Go look at the smp branch to see the progress towards the Symetric
+ Multiprocessing Kernel. https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/smp
+
+Changes between FreeRTOS V10.4.2 and FreeRTOS V10.4.3 released December 14 2020
+
+ V10.4.3 is included in the 202012.00 LTS release. Learn more at https:/freertos.org/lts-libraries.html
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
+
+ + Changes to improve robustness and consistency for buffer allocation in
+ the heap, queue and stream buffer.
+ + The following functions can no longer be called from unprivileged code.
+ - xTaskCreateRestricted
+ - xTaskCreateRestrictedStatic
+ - vTaskAllocateMPURegions
+
+
+Changes between FreeRTOS V10.4.1 and FreeRTOS V10.4.2 released November 10 2020
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
+
+ + Fix an issue in the ARMv8-M ports that caused BASEPRI to be masked
+ between the first task starting to execute and that task making
+ a FreeRTOS API call.
+ + Introduced xTaskDelayUntil(), which is functionally equivalent to
+ vTaskDelayUntil(), with the addition of returning a value to
+ indicating whether or not the function placed the calling task into
+ the Blocked state or not.
+ + Update WolfSSL to 4.5.0 and add the FIPS ready demo.
+ + Add support for ESP IDF 4.2 to ThirdParty Xtensa port.
+ + Re-introduce uxTopUsedPriority to support OpenOCD debugging.
+ + Convert most dependent libraries in FreeRTOS/FreeRTOS to submodules.
+ + Various general maintenance and improvements to MISRA compliance.
+
+
+Changes between FreeRTOS V10.4.0 and FreeRTOS V10.4.1 released September 17 2020
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
+
+ + Fixed an incorrectly named parameter that prevented the
+ ulTaskNotifyTakeIndexed macro compiling, and the name space clash in the
+ test code that prevented this error causing test failures.
+
+
+Changes between FreeRTOS V10.3.1 and FreeRTOS V10.4.0 released September 10 2020
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html
+
+ Major enhancements:
+
+ + Task notifications: Prior to FreeRTOS V10.4.0 each created task had a
+ single direct to task notification. From FreeRTOS V10.4.0 each task has
+ an array of notifications. The direct to task notification API has been
+ extended with API functions postfixed with "Indexed" to enable the API to
+ operate on a task notification at any array index. See
+ https://www.freertos.org/RTOS-task-notifications.html for more information.
+ + Kernel ports that support memory protection units (MPUs): The ARMv7-M and
+ ARMv8-M MPU ports now support a privilege access only heap. The ARMv7-M
+ MPU ports now support devices that have 16 MPU regions, have the ability
+ to override default memory attributes for privileged code and data
+ regions, and have the ability to place the FreeRTOS kernel code outside of
+ the Flash memory. The ARMv8-M MPU ports now support tickless idle mode.
+ See https://www.freertos.org/FreeRTOS-MPU-memory-protection-unit.html
+ for more information.
+
+ Additional noteworthy updates:
+
+ + Code formatting is now automated to facilitate the increase in
+ collaborative development in Git. The auto-formated code is not identical
+ to the original formatting conventions. Most notably spaces are now used
+ in place of tabs.
+ + The prototypes for callback functions (those that start with "Application",
+ such as vApplicationStackOverflowHook()) are now in the FreeRTOS header
+ files, removing the need for application writers to add prototypes into
+ the C files in which they define the functions.
+ + New Renesas RXv3 port layer.
+ + Updates to the Synopsys ARC code, including support for EM and HS cores,
+ and updated BSP.
+ + Added new POSIX port layer that allows FreeRTOS to run on Linux hosts in
+ the same way the Windows port layer enables FreeRTOS to run on Windows
+ hosts.
+ + Many other minor optimisations and enhancements. For full details
+ see https://github.com/FreeRTOS/FreeRTOS-Kernel/commits/main
+
+
+Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
+
+ + ./FreeRTOS-Labs directory was removed from this file. The libraries it
+ contained are now available as a separate download.
+
+Changes between FreeRTOS V10.2.1 and FreeRTOS V10.3.0 released February 7 2020
+
+ See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
+
+ New and updated kernel ports:
+
+ + Added RISC-V port for the IAR compiler.
+ + Update the Windows simulator port to use a synchronous object to prevent
+ a user reported error whereby a task continues to run for a short time
+ after being moved to the Blocked state. Note we were not able to
+ replicate the reported issue and it likely depends on your CPU model.
+ + Correct alignment of stack top in RISC-V port when
+ configISR_STACK_SIZE_WORDS is defined to a non zero value, which causes
+ the interrupt stack to be statically allocated.
+ + The RISC-V machine timer compare register can now be for any HART, whereas
+ previously it was always assumed FreeRTOS was running on HART 0.
+ + Update the sequence used to update the 64-bit machine timer
+ compare register on 32-bit cores to match that suggested in RISC-V
+ documentation.
+ + Added tickless low power modes into the ARM, IAR and GCC Cortex-M0 compiler
+ ports.
+ + Updated the behaviour of the ARMv7-M MPU (Memory Protection Unit) ports to
+ match that of the ARMv8-M ports whereby privilege escalations can only
+ originate from within the kernel's own memory segment. Added
+ configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY configuration constant.
+ + Update existing MPU ports to correctly disable the MPU before it is
+ updated.
+ + Added contributed port and demo application for a T-Head (formally C-SKY)
+ microcontroller.
+
+ New API functions:
+
+ + Added the vPortGetHeapStats() API function which returns information on
+ the heap_4 and heap_5 state.
+ + Added xTaskCatchUpTicks(), which corrects the tick count value after the
+ application code has held interrupts disabled for an extended period.
+ + Added xTaskNotifyValueClear() API function.
+ + Added uxTimerGetReloadMode() API function.
+
+ Other miscellaneous changes:
+ + Change type of uxPendedTicks from UBaseType_t to TickType_t to ensure it
+ has the same type as variables with which it is compared to, and therefore
+ also renamed the variable xPendingTicks.
+ + Update Keil projects that use the MPU so memory regions come from linker
+ script (scatter file) variables instead of being hard coded.
+ + Added LPC51U68 Cortex-M0+ demos for GCC (MCUXpresso), Keil and IAR
+ compilers.
+ + Added CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube demo.
+ + Added LPC54018 MPU demo.
+ + Rename xTaskGetIdleRunTimeCounter() to ulTaskGetIdleRunTimeCounter().
+
+
+Changes between FreeRTOS V10.2.1 and FreeRTOS V10.2.0 released May 13 2019:
+
+ + Added ARM Cortex-M23 port layer to complement the pre-existing ARM
+ Cortex-M33 port layer.
+ + The RISC-V port now automatically switches between 32-bit and 64-bit
+ cores.
+ + Introduced the portMEMORY_BARRIER macro to prevent instruction re-ordering
+ when GCC link time optimisation is used.
+ + Introduced the portDONT_DISCARD macro to the ARMv8-M ports to try and
+ prevent the secure side builds from removing symbols required by the
+ non secure side build.
+ + Introduced the portARCH_NAME to provide additional data to select semi-
+ automated build environments.
+ + Cortex-M33 and Cortex-M23 ports now correctly disable the MPU before
+ updating the MPU registers.
+
+ + Added Nuvoton NuMaker-PFM-M2351 ARM Cortex-M23 demo.
+ + Added LPC55S69 ARM Cortex-M33 demo.
+ + Added an STM32 dual core AMP stress test demo.
+
+
+Changes between FreeRTOS V10.1.1 and FreeRTOS V10.2.0 released February 25 2019:
+
+ + Added GCC RISC-V MCU port with three separate demo applications.
+ + Included pre-existing ARM Cortex-M33 (ARMv8-M) GCC/ARMclang and IAR ports
+ with Keil simulator demo.
+ + Update the method used to detect if a timer is active. Previously the
+ timer was deemed to be inactive if it was not referenced from a list.
+ However, when a timer is updated it is temporarily removed from, then
+ re-added to a list, so now the timer's active status is stored separately.
+ + Add vTimerSetReloadMode(), xTaskGetIdleRunTimeCounter(), and
+ xTaskGetApplicationTaskTagFromISR() API functions.
+ + Updated third party Xtensa port so it is MIT licensed.
+ + Added configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H to the Renesas
+ compiler RX600v2 port to enable switching between platform.h and
+ iodefine.h includes within that port's port.c file.
+ + Removed the 'FromISR' functions from the MPU ports as ISRs run privileged
+ anyway.
+ + Added uxTaskGetStackHighWaterMark2() function to enable the return type to
+ be changed without breaking backward compatibility.
+ uxTaskGetStackHighWaterMark() returns a UBaseType_t as always,
+ uxTaskGetStackHighWaterMark2() returns configSTACK_DEPTH_TYPE to allow the
+ user to determine the return type.
+ + Fixed issues in memory protected ports related to different combinations
+ of static memory only and dynamic memory only builds. As a result the
+ definition of tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE became more
+ complex and was moved to FreeRTOS.h with a table explaining its definition.
+ + Added a 'get task tag from ISR' function.
+ + Change the method used to determine if a timer is active or not from just
+ seeing if it is referenced from the active timer list to storing its
+ active state explicitly. The change prevents the timer reporting that it
+ is inactive while it is being moved from one list to another.
+ + The pcName parameter passed into the task create functions can be NULL,
+ previously a name had to be provided.
+ + When using tickless idle, prvResetNextTaskUnblockTime() is now only called
+ in xTaskRemoveFromEventList() if the scheduler is not suspended.
+ + Introduced portHAS_STACK_OVERFLOW_CHECKING, which should be set to 1 for
+ FreeRTOS ports that run on architectures that have stack limit registers.
+
+
+Changes between FreeRTOS V10.1.0 and FreeRTOS V10.1.1 released 7 September 2018
+
+ + Reverted a few structure name changes that broke several kernel aware
+ debugger plug-ins.
+ + Updated to the latest trace recorder code.
+ + Fixed some formatting in the FreeRTOS+TCP TCP/IP stack code.
+ + Reverted moving some variables from file to function scope as doing so
+ broke debug scenarios that require the static qualifier to be removed.
+
+Changes between FreeRTOS V10.0.1 and FreeRTOS V10.1.0 released 22 August 2018
+
+ FreeRTOS Kernel Changes:
+
+ + Update lint checked MISRA compliance to use the latest MISRA standard, was
+ previously using the original MISRA standard.
+ + Updated all object handles (TaskHandle_t, QueueHandle_t, etc.) to be
+ unique types instead of void pointers, improving type safety. (this was
+ attempted some years back but had to be backed out due to bugs in some
+ debuggers). Note this required the pvContainer member of a ListItem_t
+ struct to be renamed - set configENABLE_BACKWARD_COMPATIBILITY to 1 if
+ this causes an issue.
+ + Added configUSE_POSIX_ERRNO to enable per task POSIX style errno
+ functionality in a more user friendly way - previously the generic thread
+ local storage feature was used for this purpose.
+ + Added Xtensa port and demo application for the XCC compiler.
+ + Changed the implementation of vPortEndScheduler() for the Win32 port to
+ simply call exit( 0 ).
+ + Bug fix in vPortEnableInterrupt() for the GCC Microblaze port to protect
+ the read modify write access to an internal Microblaze register.
+ + Fix minor niggles when the MPU is used with regards to prototype
+ differences, static struct size differences, etc.
+ + The usStackHighWaterMark member of the TaskStatus_t structure now has type
+ configSTACK_DEPTH_TYPE in place of uint16_t - that change should have been
+ made when the configSTACK_DEPTH_TYPE type (which gets around the previous
+ 16-bit limit on stack size specifications) was introduced.
+ + Added the xMessageBufferNextLengthBytes() API function and likewise stream
+ buffer equivalent.
+ + Introduce configMESSAGE_BUFFER_LENGTH_TYPE to allow the number of bytes
+ used to hold the length of a message in the message buffer to be reduced.
+ configMESSAGE_BUFFER_LENGTH_TYPE default to size_t, but if, for example,
+ messages can never be more than 255 bytes it could be set to uint8_t,
+ saving 3 bytes each time a message is written into the message buffer
+ (assuming sizeof( size_t ) is 4).
+ + Updated the StaticTimer_t structure to ensure it matches the size of the
+ Timer_t structure when the size of TaskFunction_t does not equal the size
+ of void *.
+ + Update various Xilinx demos to use 2018.1 version of the SDK tools.
+ + Various updates to demo tasks to maintain test coverage.
+ + FreeRTOS+UDP was removed in FreeRTOS V10.1.0 as it was replaced by
+ FreeRTOS+TCP, which was brought into the main download in FreeRTOS
+ V10.0.0. FreeRTOS+TCP can be configured as a UDP only stack, and
+ FreeRTOS+UDP does not contain the patches applied to FreeRTOS+TCP.
+
+ FreeRTOS+TCP Changes:
+
+ + Multiple security improvements and fixes in packet parsing routines, DNS
+ caching, and TCP sequence number and ID generation.
+ + Disable NBNS and LLMNR by default.
+ + Add TCP hang protection by default.
+
+ We thank Ori Karliner of Zimperium zLabs Team for reporting these issues.
+
+
+Changes between FreeRTOS V10.0.0 and FreeRTOS V10.0.1, released December 20 2017
+
+ + Fix position of "#if defined( __cplusplus )" in stream_buffer.h.
+ + Correct declarations of MPU_xQueuePeek() and MPU_xQueueSemaphoreTake() in
+ mpu_prototypes.h.
+ + Correct formatting in vTaskList() helper function when it prints the state
+ of the currently executing task.
+ + Introduce #error if stream_buffer.c is built without
+ configUSE_TASK_NOTIFICATIONS set to 1.
+ + Update FreeRTOS+TCP to V2.0.0
+ - Improve the formatting of text that displays the available netword
+ interfaces when FreeRTOS+TCP is used on Windows with WinPCap.
+ - Introduce ipconfigSOCKET_HAS_USER_WAKE_CALLBACK option to enable a user
+ definable callback to execute when data arrives on a socket.
+
+Changes between FreeRTOS V9.0.1 and FreeRTOS V10.0.0:
+
+ The FreeRTOS kernel is now MIT licensed: https://www.FreeRTOS.org/license
+
+ New Features and components:
+
+ + Stream Buffers - see https://www.FreeRTOS.org/RTOS-stream-buffer-example.html
+ + Message Buffers - see https://www.FreeRTOS.org//RTOS-message-buffer-example.html
+ + Move FreeRTOS+TCP into the main repository, along with the basic Win32
+ TCP demo FreeRTOS_Plus_TCP_Minimal_Windows_Simulator.
+
+ New ports or demos:
+
+ + Added demo for TI SimpleLink CC3220 MCU.
+ + Added MPU and non MPU projects for Microchip CEC and MEC 17xx and 51xx
+ MCUs.
+ + Added CORTEX_MPU_Static_Simulator_Keil_GCC demo to test static allocation
+ in the MPU port.
+
+ Fixes or enhancements:
+
+ + Cortex-M ports push additional register prior to calling
+ vTaskSwitchContext to ensure 8-byte alignment is maintained. Only
+ important if a user defined tick hook function performs an operation that
+ requires 8-byte alignment.
+ + Optimisations to the implementation of the standard tickless idle mode on
+ Cortex-M devices.
+ + Improvements to the Win32 port including using higher priority threads.
+ + Ensure interrupt stack alignment on PIC32 ports.
+ + Updated GCC TriCore port to build with later compiler versions.
+ + Update mpu_wrappers.c to support static allocation.
+ + The uxNumberOfItems member of List_t is now volatile - solving an issue
+ when the IAR compiler was used with maximum optimization.
+ + Introduced configRECORD_STACK_HIGH_ADDRESS. When set to 1 the stack start
+ address is saved into each task's TCB (assuming stack grows down).
+ + Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow user defined
+ functionality, and user defined initialisation, to be added to FreeRTOS's
+ tasks.c source file. When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is
+ set to 1 a user provided header file called freertos_task_c_additions.h
+ will be included at the bottom of tasks.c. Functions defined in that
+ header file can call freertos_tasks_c_additions_init(), which in turn
+ calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(), if it is defined.
+ FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in FreeRTOSConfig.h.
+ + Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x ) which can be
+ defined by a user in FreeRTOSConfig.h. The macro is called before
+ assessing whether to enter tickless idle mode or not. If the macro sets
+ x to zero then tickless idle mode will not be entered. This allows users
+ to abort tickless idle mode entry before the tickless idle function is
+ even called - previously it was only possible to abort from within the
+ tickless idle function itself.
+ + Added configPRINTF(), which can be defined by users to allow all libraries
+ to use the same print formatter.
+ + Introduced configMAX() and configMIN() macros which default to standard
+ max( x, y ) and min( x, y ) macro behaviour, but can be overridden if the
+ application writer defines the same macros in FreeRTOSConfig.h.
+ + Corrected the definition of StaticTask_t in the case where
+ INCLUDE_xTaskAbortDelay is set to 1.
+ + Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME, both of
+ which can be defined to strings in FreeRTOSConfig.h to change the default
+ names of the timer service and idle tasks respectively.
+ + Only fill the stack of a newly created task with a known value if stack
+ checking, or high water mark checking/viewing, is in use - removing the
+ dependency on memset() in other cases.
+ + Introduced xTaskCreateRestrictedStatic() so static allocation can be used
+ with the MPU.
+ + Ensure suspended tasks cannot be unsuspended by a received task
+ notification.
+ + Fix race condition in vTaskSetTimeOutState().
+ + Updated trace recorder files to the latest version.
+
+Changes since FreeRTOS V9.0.0:
+
+ + Priority dis-inheritance behaviour has been enhanced in the case where a
+ task that attempted to take a mutex that was held by a lower priority task
+ timed out before it was able to obtain the mutex (causing the task that
+ holds the mutex to have its priority raised, then lowered again, in
+ accordance with the priority inheritance protocol).
+ + Split the overloaded xQueueGenericReceive() function into three separate
+ dedicated functions.
+ + Allow the default human readable text names given to the Idle and Timer
+ tasks to be overridden by defining the configIDLE_TASK_NAME and
+ configTIMER_SERVICE_TASK_NAME definitions respectively in FreeRTOSConfig.h.
+ + Introduced configINITIAL_TICK_COUNT to allow the tick count to take a
+ value of than than 0 when the system boots. This can be useful for
+ testing purposes - although setting configUSE_16_BIT_TICKS to 1 can also
+ be used to test frequent tick overflows.
+ + Ensure the Cortex-M SysTick count is cleared to zero before starting the
+ first task.
+ + Add configASSERT() into ARM Cortex-M ports to check the number of priority
+ bit settings.
+ + Clear the 'control' register before starting ARM Cortex-M4F ports in case
+ the FPU is used before the scheduler is started. This just saves a few
+ bytes on the main stack as it prevents space being left for a later save
+ of FPU registers.
+ + Added xSemaphoreGetMutexHolderFromISR().
+ + Corrected use of portNVIC_PENDSVSET to portNVIC_PENDSVSET_BIT in MPU ports.
+ + Introduced configSTACK_DEPTH_TYPE to allow users to change the type used
+ to specify the stack size when using xTaskCreate(). For historic reasons,
+ when FreeRTOS was only used on small MCUs, the type was set to uint16_t,
+ but that can be too restrictive when FreeRTOS is used on larger
+ processors. configSTACK_DEPTH_TYPE defaults to uint16_t.
+ xTaskCreateStatic(), being a newer function, used a uint32_t.
+ + Increase the priority of the Windows threads used by the Win32 port. As
+ all the threads run on the same core, and the threads run with very high
+ priority, there is a risk that the host will become unresponsive, so also
+ prevent the Windows port executing on single core hosts.
+
+Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
+
+ See https://www.FreeRTOS.org/FreeRTOS-V9.html
+
+ RTOS kernel updates:
+
+ + The prototype of the new xTaskCreateStatic() API function was modified to
+ remove a parameter and improve compatibility with other new
+ "CreateStatic()" API functions. The stack size parameter in
+ xTaskCreateStatic() is now uint32_t, which changes the prototype of the
+ callback functions. See the following URL:
+ https://www.FreeRTOS.org/xTaskCreateStatic.html
+ + GCC ARM Cortex-A port: Introduced the configUSE_TASK_FPU_SUPPORT
+ constant. When configUSE_TASK_FPU_SUPPORT is set to 2 every task is
+ automatically given a floating point (FPU) context.
+ + GCC ARM Cortex-A port: It is now possible to automatically save and
+ restore all floating point (FPU) registers on entry to each potentially
+ nested interrupt by defining vApplicationFPUSafeIRQHandler() instead of
+ vApplicationIRQHandler().
+ + All ARM Cortex-M3/4F/7 ports: Clear the least significant bit of the task
+ entry address placed onto the stack of a task when the task is created for
+ strict compliance with the ARM Cortex-M3/4/7 architecture documentation
+ (no noticeable effect unless using the QMEU emulator).
+ + Added GCC and Keil ARM Cortex-M4F MPU ports - previously the MPU was only
+ supported on ARM Cortex-M3.
+ + ARM Cortex-M3/4F MPU ports: Update to fully support the FreeRTOS V9.0.0
+ API (other than static object creation) and added the
+ FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC demo application to
+ demonstrate how to use the updated MPU port.
+ + All ARM Cortex-M3/4F/7 ports: Add additional barrier instructions to the
+ default low power tickless implementation.
+ + All ARM Cortex-M0 ports: Prevent an item being left on the stack of the
+ first task that executes.
+ + Win32 ports: Reduce the amount of stack used and change the way Windows
+ threads are deleted to increase the maximum execution time.
+ + Add an ARM Cortex-M4F port for the MikroC compiler. Ensure to read the
+ documentation page for this port before use.
+ + MPS430X IAR port: Update to be compatible with the latest EW430 tools
+ release.
+ + IAR32 GCC port: Correct vPortExitCritical() when
+ configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY.
+ + For consistency vTaskGetTaskInfo() now has the alias vTaskGetInfo(),
+ xTaskGetTaskHandle() now has the alias xTaskGetHandle() and
+ pcQueueGetQueueName() now has an alias pcQueueGetName().
+ + Fix various errors in comments and compiler warnings.
+
+ Demo application updates:
+
+ + Update Atmel Studio projects to use Atmel Studio 7.
+ + Update Xilinx SDK projects to use the 2016.1 version of the SDK.
+ + Remove dependency on legacy IO libraries from the PIC32 demos.
+ + Move the Xilinx UltraScale Cortex-R5 demo into the main distribution.
+ + Update the MSP432 libraries to the latest version.
+ + Add Microchip CEC1302 (ARM Cortex-M4F) demos for GCC, Keil and MikroC
+ compilers.
+ + Move the Atmel SAMA5D2 demo into the main distribution.
+
+Changes between FreeRTOS V9.0.0rc1 and FreeRTOS V9.0.0rc2 (release candidate 2)
+released March 30 2016:
+
+ NOTE - See https://www.FreeRTOS.org/FreeRTOS-V9.html for details
+
+ + The functions that create RTOS objects using static memory allocation have
+ been simplified and will not revert to using dynamic allocation if a
+ buffer is passed into a function as NULL.
+ + Introduced the configSUPPORT_DYNAMIC_ALLOCATION configuration constant to
+ allow a FreeRTOS application to be built without a heap even being being
+ defined. The Win32 example located in the
+ /FreeRTOS/demo/WIN32-MSVC-Static-Allocation-Only directory is provided as
+ a reference for projects that do not include a FreeRTOS heap.
+ + Minor run-time optimisations.
+ + Two new low power tickless implementations that target Silicon Labs EFM32
+ microcontrollers.
+ + Addition of the xTimerGetPeriod() and xTimerGetExpireTime() API functions.
+
+Changes between FreeRTOS V8.2.3 and FreeRTOS V9.0.0rc1 (release candidate 1)
+released February 19 2016:
+
+ RTOS Kernel Updates:
+
+ + Major new feature - tasks, semaphores, queues, timers and event groups can
+ now be created using statically allocated memory, so without any calls to
+ pvPortMalloc().
+ + Major new features - Added the xTaskAbortDelay() API function which allows
+ one task to force another task to immediately leave the Blocked state,
+ even if the event the blocked task is waiting for has not occurred, or the
+ blocked task's timeout has not expired.
+ + Updates necessary to allow FreeRTOS to run on 64-bit architectures.
+ + Added vApplicationDaemonTaskStartupHook() which executes when the RTOS
+ daemon task (which used to be called the timer service task) starts
+ running. This is useful if the application includes initialisation code
+ that would benefit from executing after the scheduler has been started.
+ + Added the xTaskGetTaskHandle() API function, which obtains a task handle
+ from the task's name. xTaskGetTaskHandle() uses multiple string compare
+ operations, so it is recommended that it is called only once per task.
+ The handle returned by xTaskGetTaskHandle() can then be stored locally for
+ later re-use.
+ + Added the pcQueueGetQueueName() API function, which obtains the name of
+ a queue from the queue's handle.
+ + Tickless idling (for low power applications) can now also be used when
+ configUSE_PREEMPTION is 0.
+ + If one task deletes another task, then the stack and TCB of the deleted
+ task is now freed immediately. If a task deletes itself, then the stack
+ and TCB of the deleted task are freed by the Idle task as before.
+ + If a task notification is used to unblock a task from an ISR, but the
+ xHigherPriorityTaskWoken parameter is not used, then pend a context switch
+ that will then occur during the next tick interrupt.
+ + Heap_1.c and Heap_2.c now use the configAPPLICATION_ALLOCATED_HEAP
+ settings, which previously was only used by heap_4.c.
+ configAPPLICATION_ALLOCATED_HEAP allows the application writer to declare
+ the array that will be used as the FreeRTOS heap, and in-so-doing, place
+ the heap at a specific memory location.
+ + TaskStatus_t structures are used to obtain details of a task.
+ TaskStatus_t now includes the bae address of the task's stack.
+ + Added the vTaskGetTaskInfo() API function, which returns a TaskStatus_t
+ structure that contains information about a single task. Previously this
+ information could only be obtained for all the tasks at once, as an array
+ of TaskStatus_t structures.
+ + Added the uxSemaphoreGetCount() API function.
+ + Replicate previous Cortex-M4F and Cortex-M7 optimisations in some
+ Cortex-M3 port layers.
+
+ Demo Application Updates:
+
+ Further demo applications will be added prior to the final FreeRTOS V9
+ release.
+
+ + Updated SAM4L Atmel Studio project to use Atmel Studio 7.
+ + Added ARM Cortex-A53 64-bit port.
+ + Added a port and demo for the ARM Cortex-A53 64-bit cores on the Xilinx
+ Ultrascale MPSoC.
+ + Added Cortex-M7 SAME70 GCC demo.
+ + Added EFM32 Giant and Wonder Gecko demos.
+
+
+Changes between V8.2.2 and V8.2.3 released October 16, 2015
+
+ RTOS kernel updates:
+
+ + Fix bug identified in a modification made in V8.2.2 to the software timer
+ code that allows tickless low power applications to sleep indefinitely
+ when software timers are used.
+ + Simplify and improve efficiency of stack overflow checking.
+ + Add xTaskNotifyStateClear() API function.
+ + New IAR and GCC Cortex-R ports for microprocessors that do not use an ARM
+ generic interrupt controller (GIC).
+ + New PIC32MEC14xx port.
+ + Add support for PIC32MZ EF parts (with floating point) into the PIC32MZ
+ port.
+ + Zynq7000 port layer now declares the functions that setup and clear the
+ tick interrupt as weak symbols so they can be overridden by the
+ application, and uses a global XScuGic object so the same object can be
+ used by the application code.
+ + Introduced configUSE_TASK_FPU_SUPPORT, although the PIC32MZ EF port is
+ currently the only port that uses it.
+ + Updates to RL78 and 78K0 IAR port layers to improve support for
+ combinations of memory models.
+ + Minor updates to heap_5.c to remove compiler warnings generated by some
+ compilers.
+ + License simplifications. See /FreeRTOS/License/license.txt in the
+ official distribution.
+
+ FreeRTOS+ updates:
+
+ + Update directory names to use WolfSSL instead of CyaSSL, inline with
+ WolfSSL's re-branding.
+ + Update to latest WolfSSL code.
+ + Update to latest FreeRTOS+Trace recorder code.
+ + Add in the FreeRTOS+Trace recorder library required for streaming trace.
+
+ Demo application changes:
+
+ + Add demo applications for Renesas RZ/T (Cortex-R), PIC32MZ EF (PIC32 with
+ floating point hardware), PIC32MEC14xx, RX71M, RX113 and RX231.
+ + General tidy up of spelling and compiler warnings.
+
+
+Changes between V8.2.1 and V8.2.2 released August 12, 2015
+
+ RTOS kernel updates:
+
+ + Added Intel IA32/x86 32-bit port.
+ + General maintenance.
+ + PRIVILEGED_FUNCTION and PRIVILEGED_DATA macros, which are used in memory
+ protected systems, have been added to the newer event group and software
+ timer functions.
+ + Add the errno definitions used by FreeRTOS+ components into projdefs.h.
+ + Remove the restriction that prevented tick-less idle implementations
+ waiting indefinitely when software timers were used in the same
+ application.
+ + Introduce xTaskNotifyAndQueryFromISR() as the interrupt safe version of
+ xTaskNotifyAndQuery().
+ + Add additional NOPs to the MSP430X port layers to ensure strict compliance
+ with the hardware documentation.
+ + Microblaze port: Added option for port optimised task selection.
+ + Microblaze port: Previously tasks inherited the exception enable state
+ at the time the task was created. Now all tasks are created with
+ exceptions enabled if the Microblaze design supports exceptions.
+ + Windows port: Add additional safe guards to ensure the correct start up
+ sequence and thread switching timing.
+ + Windows port: Improve the implementation of the port optimised task
+ selection assembly code.
+ + Update heap_4 and heap_5 to allow use on 64-bit processors.
+ + Simplify the code that creates a queue.
+ + General improved tick-less idle behaviour.
+ + Ensure none of the variables in the common kernel files are initialised to
+ anything other than zero.
+ + Correct calculation of xHeapStructSize in heap_4 and heap_5.
+
+ Demo application updates:
+
+ + Added demo project for the new IA32/x86 port that targets the Galileo
+ hardware.
+ + Added MSP430FR5969 demos (previously provided as a separate download).
+ + Added FreeRTOS BSP repository for automatic creation of FreeRTOS
+ applications in the Xilinx SDK.
+ + Added Atmel Studio / GCC project for the SAMV71 (ARM Cortex-M7)
+ + Update Xilinx SDK projects to use version 2015.2 of the SDK.
+ + Remove Microblaze demos that were using obsolete tools.
+ + Add MSP43FR5969 IAR and CCS demos.
+
+ FreeRTOS+ Updates:
+
+ + Updated FreeRTOS+Trace recorder library, which requires an update to the
+ FreeRTOS+Trace application.
+ + Added Reliance Edge source code and demo application. Reliance edge is
+ a fail safe transactional file system ideal for applications that require
+ file storage, and especially when high reliability is essential.
+ + Introduce configAPPLICATION_PROVIDES_cOutputBuffer to allow FreeRTOS+CLI
+ users to place the output buffer at a fixed memory address.
+ + Improve the NetworkInterface.c file provided for the Windows port of
+ FreeRTOS+UDP.
+
+Changes between V8.2.0 and V8.2.1 released 24th March 2015.
+
+ RTOS kernel updates:
+
+ + Added user definable and flexible thread local storage facility.
+ + Added vTimerSetTimerID() API function to complement the pvTimerGetTimerID()
+ function to allow the timer's ID to be used as timer local storage.
+ + Fixed a potential issue related to the use of queue sets from an ISR.
+ + Some updates to the Xilinx Microblaze GCC port.
+ + Added ARM Cortex-M4F port for Texas Instruments Code Composer Studio.
+ + Added ARM Cortex-M7 r0p1 port layer for IAR, GCC and Keil which contains a
+ minor errata work around. All other ARM Cortex-M7 core revisions should
+ use the ARM Cortex-M4F port.
+ + Exclude the whole of croutine.c if configUSE_CO_ROUTINES is set to 0.
+ + Change some data types from uint32_t to size_t in preparation for 64-bit
+ Windows port.
+ + Update the PIC32 port to remove deprecation warnings output by the latest
+ XC32 compilers.
+ + Fix bug when xQueueOverwrite() and xQueueOverwrite() from ISR are used to
+ overwrite items in two queues that are part of the same set.
+
+ Demo application updates:
+
+ + Added demo application for TI's ARM Cortex-M4F based MSP432
+ microcontroller using IAR, Keil and CCS compilers.
+ + Added demo application for STM32F ARM Cortex-M7 based microcontroller
+ using IAR and Keil.
+ + Added demo application for Atmel SAMV71 ARM Cortex-M7 based
+ microcontroller using IAR and Keil.
+ + Added Microblaze demo that uses the 2014.4 version of the Xilinx SDK and
+ runs on the KC705 evaluation board (Kintex FPGA).
+
+Changes between V8.1.2 and V8.2.0 released 16th January 2015
+
+ Changes between release candidate 1 and the official release are restricted
+ to maintenance only.
+
+ Significant RTOS kernel updates:
+
+ + MAJOR NEW FEATURE! Task notifications. Please see the following URL for
+ details: https://www.FreeRTOS.org/RTOS-task-notifications.html
+ + NEW HEADER FILE REQUIRED! Obsolete definitions have been separated into
+ a new header file called FreeRTOS/Source/include/deprecated_definitions.h.
+ This header file must be present to build. Note some of the obsolete
+ definitions are still used by very old demo application projects.
+
+ Other RTOS kernel updates:
+
+ + Made xSemaphoreGiveFromISR() a function rather than a macro that calls
+ xQueueGenericSendFromISR(). This allows for major performance
+ enhancements at the expense of some additional code size if both functions
+ are used in the same application. NOTE: In most uses cases such use of
+ a semaphore can now be replaced with a task notification which is smaller
+ and faster still.
+ + The TCB is now always allocated such that the task's stack grows away from
+ the TCB (improves debugging of stack overflows as the overflow will not
+ overwrite the task's name).
+ + GCC, IAR and Keil Cortex-M4F ports now use more inlining (performance
+ enhancements at the cost of a little additional code space).
+ + Queues are now allocated with a single call to pvPortMalloc() which
+ allocates both the queue structure and the queue storage area.
+ + Introduced a new critical section macro for reading the tick count that
+ defines away to nothing in cases where the width of the tick allows the
+ tick count to be read atomically (performance benefits - especially when
+ optimisation is on).
+ + Introduced configAPPLICATION_ALLOCATED_HEAP in heap_4.c to allow the
+ application writer to provide their own heap array - and in so doing
+ control the location of the heap.
+ + Introduced configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES which, when set, will
+ include known values in both list and list item structures. The values
+ are intended to assist debugging. If the values get overwritten then it
+ is likely application code has written over RAM used by the kernel.
+ + configASSERT()s in all Cortex-M ports used to test the lowest 5 bits of
+ the interrupt control register to detect taskENTER_CRITICAL() being called
+ from an interrupt. This has been changed to test all 8 bits.
+ + Introduced uxTaskPriorityGetFromISR().
+ + Microblze V8 port now tests XPAR_MICROBLAZE_0_USE_FPU for inequality to 0
+ rather than equality to 1, and 2 and 3 are also valid values.
+ + Cortex-A5 GIC-less port no longer passes the address of the interrupting
+ peripheral into the interrupt handler.
+ + Fix an issue in FreeRTOS-MPU where an attempt was made to free the stack
+ belonging to a task when the task was deleted, even when the stack was
+ allocated statically.
+ + Utility (helper) functions that format task statistic information into
+ human readable tables now pad task names with spaces to ensure columns
+ line up correctly even where task name lengths vary greatly.
+ + Update FreeRTOS+Trace recorder library to version 2.7.0.
+
+ Demo application updates:
+
+ + Added two new standard demo task sets: IntSemTest and TaskNotify.
+ + Added port and demo application for Atmel SAMA5D4 Cortex-A5 MPU.
+ + Added demo application for Altera Cyclone V Cortex-A9 MPU.
+ + Updated Zynq demo to use version 2014.4 of Xilinx's SDK and added in
+ demo tasks for new RTOS features.
+ + Updated Atmel SAM4E and SAM4S demos to include a lot of additional test
+ and demo tasks.
+ + Fixed a corner case issue in Atmel SAM4L low power tickless
+ implementation, and added button interrupt handling.
+ + Make the interrupt queue tests more tolerant to heave CPU loads.
+ + Updated MSVC FreeRTOS simulator demo to include the latest standard test
+ and demo tasks.
+ + Updated MingW/Eclipse FreeRTOS simulator demo to match the FreeRTOS MSVC
+ simulator demo.
+ + Updated all demos that use FreeRTOS+Trace to work with the latest trace
+ recorder code.
+
+
+Changes between V8.1.1 and V8.1.2 released September 2nd 2014
+
+ Move the defaulting of configUSE_PORT_OPTIMISED_TASK_SELECTION into the
+ individual port layers where necessary so it does not affect ports that do
+ not support the definition.
+
+Changes between V8.1.0 and V8.1.1 released August 29th 2014
+
+ By popular requests - a minor patch to V8.1.0 to re-instate the ability to
+ give a mutex type semaphore (with priority inheritance) from an interrupt
+ handler.
+
+Changes between V8.0.1 and V8.1.0 released August 26th 2014
+
+ FreeRTOS scheduler, kernel, demo and test updates:
+
+ + Improved the priority inheritance algorithms to assist integration with
+ off the shelf middleware that may hold multiple mutexes simultaneously.
+ + Introduce heap_5.c, which is similar to heap_4.c but allows the heap to
+ span multiple non-contiguous memory regions.
+ + Updated all Cortex-A9 ports to help trap a couple of common usage errors -
+ the first being when a task incorrectly attempts to exit its implementing
+ function and the second being when a non interrupt safe API function is
+ called from an interrupt.
+ + Update all Cortex-A9 ports to remove obsolete mode switches prior to
+ restoring a task context.
+ + configUSE_PORT_OPTIMISED_TASK_SELECTION now defaults to 1 instead of 0.
+ + Update all Cortex-M3/4F ports to trap a non interrupt safe API function
+ being called from an interrupt handler.
+ + Simplify the alignment checks in heap_4.c.
+ + Update the MSVC Windows simulator demo to use heap_5.c in place of
+ heap_4.c to ensure end users have an example to refer to.
+ + Updated standard demo test code to test the new priority inheritance
+ algorithms.
+ + Updated the standard demo tasks to make use of stdint and the FreeRTOS
+ specific typedefs that were introduced in FreeRTOS V8.0.0.
+ + Introduce the pdMS_TO_TICKS() macro as a more user friendly and intuitive
+ alternative to pdTICKS_PER_MS - both of which can be used to convert a
+ time specified in milliseconds to a time specified in RTOS ticks.
+ + Fix a bug in the Tasking compiler's Cortex-M port that resulted in an
+ incorrect value being written to the basepri register. This only effects
+ users of the Tasking compiler.
+ + Update the Zynq demo to use version 2014.2 of the SDK and add in an lwIP
+ example that demonstrates lwIP being used with both its raw and sockets
+ interfaces.
+ + Updated the CCS Cortex-R4 port to enable it to be built with the latest
+ CCS compiler.
+
+ New ports and demo applications:
+
+ + Two Renesas RX64M ports (RXv2 core) and demos introduced, one for the GCC
+ compiler and one for the Renesas compiler. Both demos use e2 studio.
+ + Generic IAR Cortex-A5 port (without any reliance on a GIC) introduced.
+ The new port is demonstrated on an Atmel SAMA5D3 XPlained board.
+
+ FreeRTOS+ component updates:
+
+ + Update CyaSSL to the latest version.
+ + Updated the FreeRTOS+ components supplied directly by Real Time Engineers
+ Ltd. to make use of stdint and the FreeRTOS specific typedefs that were
+ introduced in FreeRTOS V8.0.0.
+ + Rework and simplify the FreeRTOS+FAT SL RAM disk driver.
+
+ Miscellaneous updates and maintenance:
+
+ + Update the IAR and DS-5/ARM RZ demos to target the official RZ RSK
+ hardware in place of the previously targeted Renesas internal (not
+ publicly available) hardware.
+ + Various other maintenance tasks.
+
+
+Changes between V8.0.0 and V8.0.1 released 2nd May 2014
+
+ + Minor fixes to the event group functionality that was released in V8.0.0.
+ The 'clear bits from ISR' functionality is now implemented using a
+ deferred interrupt callback instead of a function, and the 'wait bits' and
+ 'task sync' functions now correctly clear internal control bits before
+ returning a value in every possible path through the respective functions.
+ + Ensure the updating of internal control data is protected by a critical
+ section after a task is deleted or suspended.
+ + Minor fixes to FreeRTOS+FAT SL - namely seeking beyond the end of a file
+ when the offset was not a multiple of the sector size.
+ + Ensure Cortex-A9 system registers are only ever accessed as 32-bit values,
+ even when only the lest significant byte of the register is implemented.
+
+ Other updates:
+
+ + Updated the XMC4200 IAR project so it links with version 7.x of the IAR
+ tools.
+ + Add RL78L1C demo.
+ + Add pcTimerGetName() API function.
+ + Call _reclaim_reent() when a task is deleted if configUSE_NEWLIB_REENTRANT
+ is defined.
+
+Changes between V7.6.0 and V8.0.0 released 19th Feb 2014
+
+ https://www.FreeRTOS.org/upgrading-to-FreeRTOS-V8.html
+
+ FreeRTOS V8.x.x is a drop-in compatible replacement for FreeRTOS V7.x.x,
+ although a change to the type used to reference character strings may result
+ in application code generating a few (easily clearable) compiler warnings
+ after the upgrade, and an updated typedef naming convention means use of the
+ old typedef names is now discouraged.
+ See https://www.FreeRTOS.org/upgrading-to-FreeRTOS-V8.html for full
+ information.
+
+ New features and functionality:
+
+ + Event groups - see https://www.FreeRTOS.org/FreeRTOS-Event-Groups.html
+ + Centralised deferred interrupt processing - see
+ https://www.FreeRTOS.org/xTimerPendFunctionCallFromISR.html
+
+ Other updates:
+
+ + Previously, when a task left the Blocked state, a context switch was
+ performed if the priority of the unblocked task was greater than or equal
+ to the priority of the Running task. Now a context switch is only
+ performed if the priority of the unblocked task is greater than the
+ priority of the Running task.
+ + New low power tickless demonstration project that targets the ST STM32L
+ microcontroller - see
+ https://www.FreeRTOS.org/STM32L-discovery-low-power-tickless-RTOS-demo.html
+ + Add xPortGetMinimumEverFreeHeapSize() to heap_4.c.
+ + Small change to the tickless low power implementation on the SAM4L to
+ ensure the alarm value (compare match value) cannot be set to zero when a
+ tickless period is exited due to an interrupt originating from a source
+ other than the RTOS tick.
+ + Update the GCC/Eclipse Win32 simulator demo to make better use of Eclipse
+ resource filters and match the functionality of the MSVC equivalent.
+ + xTaskIsTaskSuspended() is no longer a public function. Use
+ eTaskGetState() in its place.
+ + Improved trace macros, including tracing of heap usage.
+ + Remove one level of indirection when accepting interrupts on the PIC32MZ.
+ + Add Cortex-A9 GCC port layer.
+ + Add Xilinx Zynq demo application.
+
+
+Changes between V7.5.3 and V7.6.0 released 18th November 2013
+
+ V7.6.0 changes some behaviour when the co-operative scheduler is used (when
+ configUSE_PREEMPTION is set to 0). It is important to note that the
+ behaviour of the pre-emptive scheduler is unchanged - the following
+ description only applies when configUSE_PREEMPTION is set to 0:
+
+ WHEN configUSE_PREEMPTION IS SET TO 0 (which is in a small minority of
+ cases) a context switch will now only occur when a task places itself into
+ the Blocked state, or explicitly calls taskYIELD(). This differs from
+ previous versions, where a context switch would also occur when implicitly
+ moving a higher priority task out of the Blocked state. For example,
+ previously, WHEN PREEMPTION WAS TURNED OFF, if task A unblocks task B by
+ writing to a queue, then the scheduler would switch to the higher priority
+ task. Now, WHEN PREEMPTION IS TURNED OFF, if task A unblocks task B by
+ writing to a queue, task B will not start running until task A enters the
+ Blocked state or task A calls taskYIELD(). [If configUSE_PREEMPTION is not
+ set to 0, so the normal pre-emptive scheduler is being used, then task B
+ will start running immediately that it is moved out of the Blocked state].
+
+ Other changes:
+
+ + Added a port layer and a demo project for the new PIC32MZ architecture.
+ + Update the PIC32MX port layer to re-introduce some ehb instructions that
+ were previously removed, add the ability to catch interrupt stack
+ overflows (previously only task stack overflows were trapped), and also
+ add the ability to catch an application task incorrectly attempting to
+ return from its implementing function.
+ + Make dramatic improvements to the performance of the Win32 simulator port
+ layer.
+ + Ensure tasks that are blocked indefinitely report their state as Blocked
+ instead of Suspended.
+ + Slight improvement to the Cortex-M4F port layers where previously one
+ register was inadvertently being saved twice.
+ + Introduce the xSemaphoreCreateBinary() API function to ensure consistency
+ in the semantics of how each semaphore type is created. It is no longer
+ recommended to use vSemaphoreCreateBinary() (the version prefixed with a
+ 'v'), although it will remain in the code for backward compatibility.
+ + Update the Cortex-M0 port layers to allow the scheduler to be started
+ without using the SVC handler.
+ + Added a build configuration to the PIC32MX MPLAB X demo project that
+ targets the PIC32 USB II starter kit. Previously all the build
+ configurations required the Explorer 16 hardware.
+ + Some of the standard demo tasks have been updated to ensure they execute
+ correctly with the updated co-operative scheduling behaviour.
+ + Added comprehensive demo for the Atmel SAM4E, including use of
+ FreeRTOS+UDP, FreeRTOS+FAT SL and FreeRTOS+CLI.
+
+ FreeRTOS+ Changes:
+
+ + Minor maintenance on FreeRTOS+UDP.
+
+Changes between V7.5.2 and V7.5.3 released October 14 2013
+
+ Kernel changes:
+
+ + Prior to V7.5.x yields requested from the tick hook would occur in the
+ same tick interrupt - revert to that original behaviour.
+ + New API function uxQueueSpacesAvailable().
+ + Introduced the prvTaskExitError() function to Cortex-M0, Cortex-M3/4
+ and Cortex-M4F ports. prvTaskExitError() is used to trap tasks that
+ attempt to return from their implementing functions (tasks should call
+ vTaskDelete( NULL ); if they want to exit).
+ + The Cortex-M0 version of portSET_INTERRUPT_MASK_FROM_ISR and
+ portCLEAR_INTERRUPT_MASK_FROM_ISR are now fully nestable.
+ + Improved behaviour and robustness of the default Cortex-M tickless idle
+ behaviour.
+ + Add workaround for silicon errata PMU_CM001 in Infineon XMC4000 devices to
+ all Cortex-M4F ports.
+ + Add Cortex-M0 port for Keil.
+ + Updated Cortus port.
+ + Ensure _impure_ptr is initialised before the scheduler is started.
+ Previously it was not set until the first context switch.
+
+ FreeRTOS+ changes:
+
+ + Update FreeRTOS+UDP to V1.0.1 - including direct integration of the
+ FreeRTOS+Nabto task, improvements to the DHCP behaviour, and a correction
+ to the test that prevents the network event hook being called on the first
+ network down event. The FreeRTOS+UDP change history is maintained
+ separately.
+ + Correct the __NVIC_PRIO_BITS setting in the LPC18xx.h header files
+ provided in the NXP CMSIS library, then update the interrupts used by the
+ LPC18xx demos accordingly.
+ + Replace double quotes (") with single quotes (') in FreeRTOS+CLI help
+ strings to ensure the strings can be used with the JSON descriptions used
+ in the FreeRTOS+Nabto demos.
+
+ Demo and miscellaneous changes:
+
+ + Added demo for the Atmel SAMD20 Cortex-M0+. The demo includes
+ FreeRTOS+CLI
+ + Added a demo for the Infineon Cortex-M0 that can be built with the IAR
+ Keil and GCC tools.
+ + Updated the Infineon XMC4000 demos for IAR, Keil, GCC and Tasking tools,
+ with additional build configurations to directly support the XMC4200 and
+ XMC4400 devices, in addition to the previously supported XMC4500.
+ + Updated the demo application.
+ + Added additional trace macros traceMALLOC and traceFREE to track heap
+ usage.
+
+Changes between V7.5.0 and V7.5.2 released July 24 2013
+
+ V7.5.2 makes the new Cortex-M vPortCheckInterruptPriority() function
+ compatible with the STM32 standard peripheral driver library, and adds
+ an extra critical section to the default low power tickless mode
+ implementation. Only users of the STM32 peripheral library or the default
+ tickless implementation need update from version 7.5.0.
+
+Changes between V7.4.2 and V7.5.0 released July 19 2013
+
+ V7.5.0 is a major upgrade that includes multiple scheduling and efficiency
+ improvements, and some new API functions.
+
+ Compatibility information for FreeRTOS users:
+ FreeRTOS V7.5.0 is backward compatible with FreeRTOS V7.4.0 with one
+ exception; the vTaskList() and vTaskGetRunTimeStats() functions are now
+ considered legacy, having been replaced by the single uxTaskGetSystemState()
+ function. configUSE_STATS_FORMATTING_FUNCTIONS must be set to 1 in
+ FreeRTOSConfig.h for vTaskList() and vTaskGetRunTimeStats() to be
+ available.
+
+ Compatibility information for FreeRTOS port writers:
+ vTaskIncrementTick() is now called xTaskIncrementTick() (because it now
+ returns a value).
+
+ Headline changes:
+
+ + Multiple scheduling and efficiency improvements.
+ + Core kernel files now pass PC-Lint V8 static checking without outputting
+ any warnings (information on the test conditions will follow).
+
+ New API functions:
+
+ + uxTaskGetSystemState() https://www.FreeRTOS.org/uxTaskGetSystemState.html
+ + xQueueOverwrite() https://www.FreeRTOS.org/xQueueOverwrite.html
+ + xQueueOverwriteFromISR()
+ + xQueuePeekFromISR()
+
+ The following ports and demos, which were previously available separately,
+ are now incorporated into the main FreeRTOS zip file download:
+
+ + ARM Cortex-A9 IAR
+ + ARM Cortex-A9 ARM compiler
+ + Renesas RZ
+ + Microsemi SmartFusion2
+
+ New FreeRTOSConfig.h settings
+ https://freertos.org/a00110.html
+
+ + configUSE_TIME_SLICING
+ + configUSE_NEWLIB_REENTRANT
+ + configUSE_STATS_FORMATTING_FUNCTIONS
+ + configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
+
+ Other changes:
+
+ + (MPU port only) The configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
+ options provides a mechanism that allows application writers to execute
+ certain functions in privileged mode even when a task is running in user
+ mode.
+ + Ports that support interrupt nesting now include a configASSERT() that
+ will trigger if an interrupt safe FreeRTOS function is called from an
+ interrupt that has a priority designated as above the maximum system/API
+ call interrupt priority.
+ + The included FreeRTOS+Trace recorder code has been updated to the latest
+ version, and the demo applications that use the trace recorder code have
+ been updated accordingly.
+ + The FreeRTOS Windows Simulator (MSVC version only) has been updated to
+ include a new basic 'blinky' build option in addition to the original
+ comprehensive build option.
+ + Improve RAM usage efficiency of heap_4.c and heap_2.c.
+ + Prevent heap_4.c from attempting to free memory blocks that were not
+ allocated by heap_4.c, or have already been freed.
+ + As FreeRTOS now comes with FreeRTOS+FAT SL (donated by HCC) the Chan FATfs
+ files have been removed from FreeRTOS/Demo/Common.
+ + Fix build error when R4 port is build in co-operative mode.
+ + Multiple port and demo application maintenance activities.
+
+Changes between V7.4.1 and V7.4.2 released May 1 2013
+
+ NOTE: There are no changes in the FreeRTOS kernel between V7.4.1 and V7.4.2
+
+ + Added FreeRTOS+FAT SL source code and demo project. The demo project
+ runs in the FreeRTOS Windows simulator for easy and hardware independent
+ experimentation and evaluation. See https://www.FreeRTOS.org/fat_sl
+
+Changes between V7.4.0 and V7.4.1 released April 18 2013
+
+ + To ensure strict conformance with the spec and ensure compatibility with
+ future chips data and instruction barrier instructions have been added to
+ the yield macros of Cortex-M and Cortex-R port layers. For efficiency
+ the Cortex-M port layer "yield" and "yield" from ISR are now implemented
+ separately as the barrier instructions are not required in the ISR case.
+ + Added FreeRTOS+UDP into main download.
+ + Reorganised the FreeRTOS+ directory so it now matches the FreeRTOS
+ directory with Source and Demo subdirectories.
+ + Implemented the Berkeley sockets select() function in FreeRTOS+UDP.
+ + Changed (unsigned) casting in calls to standard library functions with
+ (size_t) casting.
+ + Added the Atmel SAM4L and Renesas RX100 demos that demonstrates the
+ tickless (tick suppression) low power FreeRTOS features.
+ + Add a new RL78 IAR demo that targets numerous new RL78 chips and
+ evaluation boards.
+ + Adjusted stack alignment on RX200 ports to ensure an assert was not
+ falsely triggered when configASSERT() is defined.
+ + Updated the Cortex_M4F_Infineon_XMC4500_IAR demo to build with the latest
+ version of EWARM.
+ + Corrected header comments in the het.c and het.h files (RM48/TMS570 demo).
+
+
+Changes between V7.3.0 and V7.4.0 released February 20 2013
+
+ + New feature: Queue sets. See:
+ https://www.FreeRTOS.org/Pend-on-multiple-rtos-objects.html
+ + Overhauled the default tickless idle mode implementation provided with the
+ ARM Cortex-M3 port layers.
+ + Enhanced tickless support in the core kernel code with the introduction of
+ the configEXPECTED_IDLE_TIME_BEFORE_SLEEP macro and the
+ eTaskConfirmSleepModeStatus() function.
+ + Added the QueueSet.c common demo/test file. Several demo applications
+ have been updated to use the new demo/test tasks.
+ + Removed reliance on the PLIB libraries from the MPLAB PIC32 port layer and
+ demo applications.
+ + Added the FreeRTOS+Trace recorder code to the MSVC Win32 demo.
+ + Renamed eTaskStateGet() to eTaskGetState() for consistency, and added a
+ pre-processor macro for backward compatibility with the previous name.
+ + Updated functions implemented in the core queue.c source file to allow
+ queue.h to be included from the .c file directly (this prevents compiler
+ warnings that were generated by some compilers).
+ + Updated the CCS Cortex-R4 port layer to replace the CLZ assembler function
+ with the CLZ compiler intrinsic that is provided by the latest versions of
+ the CCS ARM compiler.
+ + Updated all heap_x.c implementations to replace the structure that was
+ used to ensure the start of the heap was aligned with a more portable
+ direct C code implementation.
+ + Added support for PIC24 devices that include EDS.
+ + Minor optimisations to the PIC32 port layer.
+ + Minor changes to tasks.c that allow the state viewer plug-ins to display
+ additional information.
+ + Bug fix: Update prvProcessReceivedCommands() in timers.c to remove an
+ issue that could occur if the priority of the timer daemon task was set
+ below the priority of tasks that used timer services.
+ + Update the FreeRTOS+Trace recorder code to the latest version.
+
+Changes between V7.2.0 and V7.3.0 released October 31 2012
+
+ + Added ability to override the default scheduler task selection mechanism
+ with implementations that make use of architecture specific instructions.
+ + Added ability to suppress tick interrupts during idle time, and in so
+ doing, provide the ability to make use of architecture specific low power
+ functionality.
+ + Added the portSUPPRESS_TICKS_AND_SLEEP() macro and vTaskStepTick() helper
+ function.
+ + Added the configSYSTICK_CLOCK_HZ configuration constant.
+ + Reworked the Cortex-M3 and Cortex-M4F port layers for GCC, Keil and IAR to
+ directly support basic power saving functionality.
+ + Added hooks to allow basic power saving to be augmented in the application
+ by making use of chip specific functionality.
+ + Minor change to allow mutex type semaphores to be used from interrupts
+ (which would not be a normal usage model for a mutex).
+ + Change the behaviour of the interrupt safe interrupt mask save and restore
+ macros in the Cortex-M ports. The save macro now returns the previous
+ mask value. The restore macro now uses the previous mask value. These
+ changes are not necessary for the kernel's own implementation, and are
+ made purely because the macros were being used by application writers.
+ + Added eTaskStateGet() API function.
+ + Added port specific optimisations to the PIC32 port layer, and updated the
+ PIC32 demo applications to make use of this new feature.
+ + Added port specific optimisations to the Win32 simulator port.
+ + Added new ports and demo applications for the TI Hercules RM48 and TMS570
+ safety microcontrollers.
+ + Added SAM3 demos targeting the ATSAM3S-EK2 and ATSAM3X-EK evaluation
+ boards.
+ + Updated the PIC32 MPLAB X project to manually set the compiler include
+ paths instead of using the IDE entry box following reports that the
+ include paths were somehow being deleted.
+ + Improved character handling in FreeRTOS+CLI.
+
+Changes between V7.1.1 and V7.2.0 released 14 August 2012
+
+ FreeRTOS V7.2.0 is backward compatible with FreeRTOS V7.1.2.
+
+ + Added a FreeRTOS+ sub-directory. The directory contains some FreeRTOS+
+ source code, and example projects that use the FreeRTOS Win32 simulator.
+ + Added a new example heap allocation implementation (heap_4.c) that
+ includes memory block coalescence.
+ + Added a demo that targets the Atmel SAM4S Cortex-M4 based microcontroller.
+ The demo is preconfigured to build using the free Atmel Studio 6 IDE and
+ GCC compiler.
+ + Added xSemaphoreTakeFromISR() implementation.
+ + The last parameter in ISR safe FreeRTOS queue and semaphore functions
+ (xHigherPriorityTaskWoken) is now optional and can be set to NULL if it
+ is not required.
+ + Update the IAR and MSP430X ports to clear all lower power mode bits before
+ exiting the tick interrupt [bug fix].
+ + Allow xQueueReset() to be used, even when the queues event lists are not
+ empty.
+ + Added a vQueueDelete() handler for the FreeRTOS MPU port (this was
+ previously missing).
+ + Updated the vPortSVCHandler() functions in the FreeRTOS MPU port layer to
+ ensure it compiles with the latest ARM GCC compilers from Linaro.
+ + Updated the prvReadGP() function in the NIOS II port to ensure the compiler
+ can choose any register for the functions parameter (required at high
+ compiler optimisation levels).
+ + Add #error macros into the Keil and IAR Cortex-M ports to ensure they
+ cannot be built if the user has set configMAX_SYSCALL_INTERRUPT_PRIORITY
+ to 0.
+ + Added comments in the FreeRTOSConfig.h files associated with Cortex-M3 and
+ Cortex-M4 demos stating that the configMAX_SYSCALL_INTERRUPT_PRIORITY
+ parameter must not be set to 0.
+ + Introduce new INCLUDE_xQueueGetMutexHolder configuration constant
+ (defaulted to 0).
+ + Added two new list handling macros - for internal use only in upcoming new
+ products.
+ + Removed all mention of the legacy vTaskStartTrace and ulTaskEndTrace
+ macros. FreeRTOS+Trace supersedes the legacy trace.
+ + Added a configASSERT() into the vPortFree() function in heap_1.c as it is
+ invalid for the function to be called.
+ + Made the xRxLock and xTxLock members of the queue structure volatile.
+ This is probably not necessary, and is included as a precautionary
+ measure.
+ + Modify the assert() that checks to see if the priority passed into an
+ xTaskCreate() function is within valid bounds to permit the assert to be
+ used in the FreeRTOS MPU port.
+ + The software timer service (daemon) task is now created in a way that
+ to ensure compatibility with FreeRTOS MPU.
+
+Changes between V7.1.0 and V7.1.1 released May 1 2012
+
+ New ports:
+
+ The following ports are brand new:
+ + Cortex-M3 Tasking
+
+ The following ports have been available as separate downloads for a number
+ of months, but are now included in the main FreeRTOS download.
+ + Cortex-M0 IAR
+ + Cortex-M0 GCC
+ + Cortex-M4F GCC (with full floating point support)
+
+
+ New demos:
+
+ The following demos are brand new:
+ + Renesas RX63N RDK (Renesas compiler)
+
+ The following demos have been available as separate downloads for a number
+ of months, but are now included in the main FreeRTOS download.
+ + NXP LPC1114 GCC/LPCXpresso
+ + ST STM32F0518 IAR
+ + Infineon XMC4500 GCC/Atollic
+ + Infineon XMC4500 IAR
+ + Infineon XMC4500 Keil
+ + Infineon XMC4500 Tasking
+
+
+ Kernel miscellaneous / maintenance:
+
+ + Introduced the portSETUP_TCB() macro to remove the requirement for the
+ Windows simulator to use the traceTASK_CREATE() macro, leaving the trace
+ macro available for use by FreeRTOS+Trace (https://www.FreeRTOS.org/trace).
+ + Added a new trace macro, traceMOVE_TASK_TO_READY_STATE(), to allow future
+ FreeRTOS+Trace versions to provide even more information to users.
+ + Updated the FreeRTOS MPU port to be correct for changes that were
+ introduced in FreeRTOS V7.1.0.
+ + Introduced the xQueueReset() API function.
+ + Introduced the xSemaphoreGetMutexHolder() API function.
+ + Tidy up various port implementations to add the static key word where
+ appropriate, and remove obsolete code.
+ + Slight change to the initial stack frame given to the RX600 ports to allow
+ them to be used in the Eclipse based E2Studio IDE without confusing GDB.
+ + Correct the alignment given to the initial stack of Cortex-M4F tasks.
+ + Added a NOP following each DINT instruction on MSP430 devices for strict
+ conformance with the instructions on using DINT.
+ + Changed the implementation of thread deletes in the Win32 port to prevent
+ the port making use of the traceTASK_DELETE() trace macros - leaving this
+ macro free for use by FreeRTOS+Trace.
+ + Made some benign changes to the RX600 Renesas compiler port layer to
+ ensure the code can be built to a library without essential code being
+ removed by the linker.
+ + Reverted the change in the name of the uxTaskNumber variable made in
+ V7.1.0 as it broke the IAR plug-in.
+
+
+ Demo miscellaneous / maintenance:
+
+ + The command interpreter has now been formally released as FreeRTOS+CLI,
+ and been moved out of the main FreeRTOS download, to instead be available
+ from the FreeRTOS+ Ecosystem site https://www.FreeRTOS.org/plus.
+ + flash_timer.c/h has been added to the list of standard demo tasks. This
+ performs the same functionality as the flash.c tasks, but using software
+ timers in place of tasks.
+ + Upgraded the PIC32 demo as follows: Changes to how the library functions
+ are called necessitated by the new compiler version, addition of MPLAB X
+ project with PIC32MX360, PIC32MX460 and PIC32MX795 configurations,
+ addition of simply blinky demo, updated FreeRTOSConfig.h to include more
+ parameters, addition of hook function stubs.
+ + The MSP430X IAR and CCS demos have been updated to ensure the power
+ settings are correct for the configured CPU frequency.
+ + Rowley CrossWorks projects have been updated to correct the "multiple
+ definition of ..." warnings introduced when the toolchain was updated.
+ + Updated various FreeRTOSConfig.h header files associated with projects
+ that build with Eclipse to include a #error statement informing the user
+ that the CreateProjectDirectoryStructure.bat batch file needs to be
+ executed before the projects can be opened.
+ + Renamed directories that included "CCS4" in their name to remove the '4'
+ and instead just be "CCS". This is because the demo was updated and
+ tested to also work with later Code Composer Studio versions.
+ + Updated the TCP/IP periodic timer frequency in numerous uIP demos to be
+ 50ms instead of 500ms.
+
+Changes between V7.0.2 and V7.1.0 released December 13 2011
+
+ New ports:
+
+ + Cortex-M4F IAR port.
+ + Cortex-M4F Keil/RVDS port.
+ + TriCore GCC port.
+
+ New demos:
+
+ + NXP LPC4350 using the Keil MDK, and demonstrated on a Hitex development
+ board.
+ + ST STM32F407 using the IAR Embedded Workbench for ARM, and demonstrated on
+ the IAR STM32F407ZG-SK starter kit.
+ + Infineon TriCore TC1782, using the GCC compiler, demonstrated on the
+ TriBoard TC1782 evaluation board.
+ + Renesas RX630, using the Renesas compiler and HEW, demonstrated on an
+ RX630 RSK (Renesas Starter Kit).
+
+ Miscellaneous / maintenance:
+
+ + Removed all calls to printf() from the K60/IAR Kinetis demo so the project
+ can execute stand alone - without being connected to the debugger.
+ + Completed the command interpreter framework. Command handlers now receive
+ the entire command string, giving them direct access to parameters.
+ Utility functions are provided to check the number of parameters, and
+ return parameter sub-strings.
+ + The previously documented fix for the bug in xTaskResumeFromISR() that
+ effected (only) ports supporting interrupt nesting has now been
+ incorporated into the main release.
+ + The portALIGNMENT_ASSERT_pxCurrentTCB() definition has been added to allow
+ specific ports to skip the second stack alignment check when a task is
+ created. This is because the second check is not appropriate for some
+ ports - including the new TriCore port where the checked pointer does not
+ actually point to a stack.
+ + The portCLEAN_UP_TCB() macro has been added to allow port specific clean
+ up when a task is deleted - again this is required by the TriCore port.
+ + Various other minor changes to ensure warning free builds on a growing
+ number of microcontroller and toolchain platforms. This includes a
+ (benign) correction to the prototype of the
+ vApplicationStackOverflowHook() definition found in lots of recent demos.
+
+ Trace system:
+
+ + The legacy trace mechanism has been completely removed - it has been
+ obsolete for the years since the trace macros were introduced. The
+ configuration constant configUSE_TRACE_FACILITY is now used to optionally
+ include additional queue and task information. The additional information
+ is intended to make the trace mechanism more generic, and allow the trace
+ output to provide more information. When configUSE_TRACE_FACILITY is set
+ to 1:
+ - the queue structure includes an additional member to hold the queue
+ type, which can be base, mutex, counting semaphore, binary semaphore
+ or recursive mutex.
+ - the queue structure includes an additional member to hold a queue
+ number. A trace tool can set and query the queue number for its own
+ purposes. The kernel does not use the queue number itself.
+ - the TCB structure includes an additional member to hold a task number
+ number. A trace tool can set and query the task number for its own
+ purposes. The kernel does not use the task number itself.
+ + Queues and all types of semaphores are now automatically allocated their
+ type as they are created.
+ + Added two new trace macros - traceTASK_PRIORITY_INHERIT() and
+ traskTASK_PRIORITY_DISINHERIT().
+ + Updated the traceQUEUE_CREATE_FAILED() macro to take a parameter that
+ indicates the type of queue, mutex, or semaphore that failed to be
+ created.
+ + The position from which traceCREATE_MUTEX() is called has been moved from
+ after the call to xQueueGenericSend() [within the same function] to before
+ the call. This ensures the trace events occur in the correct order.
+ + The value passed into tracePRIORITY_SET() has been corrected for the case
+ where vTaskPrioritySet() is called with a null parameter.
+
+Changes between V7.0.1 and V7.0.2 released September 20 2011
+
+ New ports:
+
+ + The official FreeRTOS Renesas RX200 port and demo application have been
+ incorporated into the main FreeRTOS zip file download.
+ + The official FreeRTOS Renesas RL78 port and demo application have been
+ incorporated into the main FreeRTOS zip file download.
+ + The official FreeRTOS Freescale Kinetis K60 tower demo application has
+ been incorporated into the main FreeRTOS zip file download. This includes
+ an embedded web server example.
+ + A new Microblaze V8 port layer has been created to replace the older, now
+ deprecated, port layer. The V8 port supports V8.x of the Microblaze IP,
+ including exceptions, caches, and the floating point unit. A new
+ Microblaze demo has also been added to demonstrate the new Microblaze V8
+ port layer. The demo application was created using V13.1 of the Xilinx
+ EDK, and includes a basic embedded web server that uses lwIP V1.4.0.
+ + The official FreeRTOS Fujitsu FM3 MB9A310 demo application has been
+ incorporated into the main FreeRTOS zip file download. Projects are
+ provided for both the IAR and Keil toolchains.
+
+
+ API additions:
+
+ + xTaskGetIdleTaskHandle() has been added.
+ + xTaskGetTimerDaemonTaskHandle() has been added.
+ + pcTaskGetTaskName() has been added.
+ + vSemaphoreDelete() macro has been added to make it obvious how to delete
+ a semaphore. In previous versions vQueueDelete() had to be used.
+ + vTaskCleanUpResources() has been removed. It has been obsolete for a
+ while.
+ + portPOINTER_SIZE_TYPE has been introduced to prevent compiler warnings
+ being generated when the size of a pointer does not match the size of
+ the stack type. This will (has already) be used in new ports, but will
+ not be retrofitted to existing ports until the existing port itself is
+ updated.
+
+ Other updates and news:
+
+ + The core files have all been modified to tighten the coding standard even
+ further. These are style, not functional changes.
+ + All ARM7 port layers have been slightly modified to prevent erroneous
+ assert() failures when tasks are created and configASSERT() is defined.
+ + All ARM IAR projects have been updated to build with the latest V6.2.x
+ versions of the IAR Embedded Workbench for ARM tools (EWARM). This was
+ necessary due to a change in the way EWARM uses the CMSIS libraries.
+ + The PIC32 port layer has been updated in preparation for V2 of the C32
+ compiler.
+ + The old Virtex-4 Microblaze demo has been marked as deprecated. Please
+ use the brand new Spartan-6 port and demo in its place.
+ + The bones of a new generic command interpreter is located in
+ FreeRTOS/Demo/Common/Utils/CommandInterpreter.c. This is still a work in
+ progress, and not documented. It is however already in use. It will be
+ documented in full when the projects that are already using it are
+ completed.
+ + A couple of new standard demos have been included. First, a version of
+ flop.c called sp_flop.c. This is similar to flop.c, but uses single
+ precision floats in place of double precision doubles. This allows the
+ for testing ports to processors that have only single precision floating
+ point units, and revert to using emulated calculations whenever a double
+ is used. Second, comtest_strings.c has been included to allow the test
+ of UART drivers when an entire string is transmitted at once. The
+ previous comtest.c only used single character transmission and reception.
+ + lwIP V1.4.0 is now included in the FreeRTOS/Demo/Common directory, and
+ used by a couple of new demos.
+
+Changes between V7.0.0 and V7.0.1 released May 13 2011
+
+ + Added a Fujitsu FM3 demo application for both the IAR and Keil tool
+ chains.
+ + Added a SmartFusion demo application for all of the IAR, Keil and
+ SoftConsole (GCC/Eclipse) tool chains.
+ + Updated the RX600 port and demo applications to take into account the
+ different semantics required when using the latest (V1.0.2.0) version of
+ the Renesas compiler.
+ + Modified the RX600 Ethernet driver slightly to make it more robust under
+ heavy load, and updated the uIP handling task to make use of the FreeRTOS
+ software timers.
+ + Slightly changed the PIC32 port layer to move an ehb instruction in line
+ with the recommendations of the MIPS core manual, and ensure 8 byte stack
+ alignment is truly always obtained.
+ + Changed the behaviour when tasks are suspended before the scheduler has
+ been started. Before, there needed to be at least one task that was not
+ in the suspended state. This is no longer the case.
+
+Changes between V6.1.1 and V7.0.0 released April 8 2011
+
+ FreeRTOS V7.0.0 is backward compatible with FreeRTOS V6.x.x
+
+ Main changes:
+
+ + Introduced a new software timer implementation.
+ + Introduced a new common demo application file to exercise the new timer
+ implementation.
+ + Updated the Win32/MSVC simulator project to include the new software timer
+ demo tasks and software timer tick hook test. Much simpler software timer
+ demonstrations are included in the demo projects for both of the new ports
+ (MSP430X with CCS4 and STM32 with TrueStudio).
+ + Various enhancements to the kernel implementation in tasks.c. These are
+ transparent to users and do not effect the pre-existing API.
+ + Added calls to configASSERT() within the kernel code. configASSERT() is
+ functionally equivalent to the standard C assert() macro, but does not
+ rely on the compiler providing assert.h.
+
+ Other changes:
+
+ + Updated the MSP430X IAR port and demo project to include support for the
+ medium memory model.
+ + Added a demo project for the MSP430X that targets the MSP430X Discovery
+ board and uses the Code Composer Studio 4 tools. This demo includes use
+ of the new software timer implementation.
+ + Added an STM32F100RB demo project that targets the STM32 Discovery Board
+ and uses the TrueStudio Eclipse based IDE from Atollic.
+ + Removed some compiler warnings from the PSoC demo application.
+ + Updated the PIC32 port layer to ensure the
+ configMAX_SYSCALL_INTERRUPT_PRIORITY constant works as expected no matter
+ what its value is (within the valid range set by the microcontroller
+ kernel).
+ + Updated the PIC24, dsPIC and PIC32 projects so they work with the latest
+ MPLAB compiler versions from Microchip.
+ + Various cosmetic changes to prepare for a standards compliance statement
+ that will be published after the software release.
+
+
+Changes between V6.1.0 and V6.1.1 released January 14 2011
+
+ + Added two new Windows simulator ports. One uses the free Microsoft Visual
+ Studio 2010 express edition, and the other the free MingW/Eclipse
+ environment. Demo projects are provided for both.
+ + Added three demo projects for the PSoC 5 (CYAC5588). These are for the
+ GCC, Keil, and RVDS build tools, and all use the PSoC Creator IDE.
+ + Added a demo for the low power STM32L152 microcontroller using the IAR
+ Embedded Workbench.
+ + Added a new port for the MSP430X core using the IAR Embedded Workbench.
+ + Updated all the RX62N demo projects that target the Renesas Demonstration
+ Kit (RDK) to take into account the revered LED wiring on later hardware
+ revisions, and the new J-Link debug interface DLL.
+ + Updated all the RX62N demo projects so the IO page served by the example
+ embedded web server works with all web browsers.
+ + Updated the Red Suite projects to work with the up coming Red Suite
+ release, and to use a more recent version of the CMSIS libraries.
+ + Added the traceTAKE_MUTEX_RECURSIVE_FAILED() trace macro.
+ + Removed the (pointless) parameter from the traceTASK_CREATE_FAILED()
+ trace macro.
+ + Introduced the portALT_GET_RUN_TIME_COUNTER_VALUE() macro to compliment
+ the already existing portGET_RUN_TIME_COUNTER_VALUE(). This allows for
+ more flexibility in how the time base for the run time statistics feature
+ can be implemented.
+ + Added a "cpsie i" instruction before the "svc 0" instruction used to start
+ the scheduler in each of the Cortex M3 ports. This is to ensure that
+ interrupts are globally enabled prior to the "svc 0" instruction being
+ executed in cases where interrupts are left disabled by the C start up
+ code.
+ + Slight optimisation in the run time stats calculation.
+
+Changes between V6.0.5 and V6.1.0 released October 6 2010
+
+ + Added xTaskGetTickCountFromISR() function.
+ + Modified vTaskSuspend() to allow tasks that have just been created to be
+ immediately suspended even when the kernel has not been started. This
+ allows them to effectively start in the Suspended state - a feature that
+ has been asked for on numerous occasions to assist with initialisation
+ procedures.
+ + Added ports for the Renesas RX62N using IAR, GCC and Renesas tool suites.
+ + Added a STM32F103 demo application that uses the Rowley tools.
+ + Under specific conditions xFreeBytesRemaining within heap_2.c could end up
+ with an incorrect value. This has been fixed.
+ + xTaskCreateGeneric() has a parameter that can be used to pass the handle
+ of the task just created out to the calling task. The assignment to this
+ parameter has been moved to ensure it is assigned prior to the newly
+ created having any possibility of executing. This takes into account the
+ case where the assignment is made to a global variable that is accessed by
+ the newly created task.
+ + Fixed some build time compiler warnings in various FreeTCPIP (based on
+ uIP) files.
+ + Fixed some build time compiler warnings in Demo/Common/Minimal/IntQueue.c.
+
+Changes between V6.0.4 and V6.0.5 released May 17 2010
+
+ + Added port and demo application for the Cortus APS3 processor.
+
+Changes between V6.0.3 and V6.0.4 released March 14 2010
+
+ + All the contributed files that were located in the Demo/Unsupported_Demos
+ directory have been removed. These files are instead now available in the
+ new Community Contributions section of the FreeRTOS website. See
+ https://www.FreeRTOS.org/RTOS-contributed-ports.html
+ + The project file located in the Demo/CORTEX_STM32F107_GCC_Rowley directory
+ has been upgraded to use V2.x of the Rowley Crossworks STM32 support
+ package.
+ + An initial Energy Micro EFM32 demo has been included. This will be
+ updated over the coming months to make better use of the low power modes
+ the EFM32 provides.
+
+Changes between V6.0.2 and V6.0.3 released February 26 2010
+
+ + SuperH SH7216 (SH2A-FPU) port and demo application added.
+ + Slight modification made to the default implementation of
+ pvPortMallocAligned() and vPortFreeAligned() macros so by default they
+ just call pvPortMalloc() and vPortFree(). The macros are only needed to
+ be defined when a memory protection unit (MPU) is being used - and then
+ only depending on other configuration settings.
+
+Changes between V6.0.1 and V6.0.2 released January 9th 2010
+
+ + Changed all GCC ARM 7 ports to use 0 as the SWI instruction parameter.
+ Previously the parameter was blank and therefore only an implicit 0 but
+ newer GCC releases do not permit this.
+ + Updated IAR SAM7S and SAM7X ports to work with IAR V5.40.
+ + Changed the stack alignment requirement for PIC32 from 4 bytes to 8 bytes.
+ + Updated prvListTaskWithinSingleList() is it works on processors where the
+ stack grows up from low memory.
+ + Corrected some comments.
+ + Updated the startup file for the RVDS LPC21xx demo.
+
+Changes between V6.0.0 and V6.0.1 released November 15th 2009
+
+ + Altered pxPortInitialiseStack() for all Cortex-M3 ports to ensure the
+ stack pointer is where the compiler expects it to be when a task first
+ starts executing.
+
+ The following minor changes only effect the Cortex-M3 MPU port:
+
+ + portRESET_PRIVILEGE() assembly macro updated to include a clobber list.
+ + Added prototypes for all the privileged function wrappers to ensure no
+ compile time warnings are generated no matter what the warning level
+ setting.
+ + Corrected the name of portSVC_prvRaisePrivilege to
+ portSVC_RAISE_PRIVILEGE.
+ + Added conditional compilation into xTaskGenericCreate() to prevent some
+ compilers issuing warnings when portPRIVILEGE_BIT is defined as zero.
+
+
+Changes between V5.4.2 and V6.0.0 released October 16th 2009
+
+ FreeRTOS V6 is backward compatible with FreeRTOS V5.x.
+
+ Main changes:
+
+ + FreeRTOS V6 is the first version to include memory protection unit (MPU)
+ support. Two ports now exist for the Cortex M3, the standard FreeRTOS
+ which does not include MPU support, and FreeRTOS-MPU which does.
+ + xTaskCreateRestricted() and vTaskAllocateMPURegions() API functions added
+ in support of FreeRTOS-MPU.
+ + Wording for the GPL exception has been (hopefully) clarified. Also the
+ license.txt file included in the download has been fixed (the previous
+ version contained some corruption).
+
+ Other changes:
+
+ + New API function xPortGetFreeHeapSize() added to heap_1.c and heap_2.c.
+ + ARM7 GCC demo interrupt service routines wrappers have been modified to
+ call the C portion using an __asm statement. This prevents the function
+ call being inlined at higher optimisation levels.
+ + ARM7 ports now automatically set the THUMB bit if necessary when
+ setting up the initial stack of a task - removing the need for
+ THUMB_INTERWORK to be defined. This also allows THUMB mode and ARM mode
+ tasks to be mixed more easily.
+ + All ARM7/9 ports now have portBYTE_ALIGNMENT set to 8 by default.
+ + Various demo application project files have been updated to be up to date
+ with the latest IDE versions.
+ + The linker scripts used with command line GCC demos have been updated to
+ include an eh_frame section to allow their use with the latest Yagarto
+ release. Likewise the demo makefiles have been updated to include
+ command line options to reduce or eliminate the eh_frame section all
+ together.
+ + The definition of portBYTE_ALIGNMENT_MASK has been moved out of the
+ various memory allocation files and into the common portable.h header
+ file.
+ + Removed unnecessary use of portLONG, portSHORT and portCHAR.
+ + Added LM3Sxxxx demo for Rowley CrossWorks.
+ + Posix simulator has been upgraded - see the corresponding WEB page on the
+ FreeRTOS.org site.
+
+
+Changes between V5.4.1 and V5.4.2 released August 9th 2009
+
+ + Added a new port and demo app for the Altera Nios2 soft core.
+ + Added LPC1768 demo for IAR.
+ + Added a USB CDC demo to all LPC1768 demos (Code Red, CrossWorks and IAR).
+ + Changed clock frequency of LPC1768 demos to 99MHz.
+
+Changes between V5.4.0 and V5.4.1 released July 25th 2009
+
+ + New hook function added. vApplicationMallocFailedHook() is (optionally)
+ called if pvPortMalloc() returns NULL.
+ + Additional casting added to xTaskCheckForTimeOut(). This prevents
+ problems that can arise should configUSE_16_BIT_TICKS be set to 1 on a
+ 32 bit architecture (which would probably be a mistake, anyway).
+ + Corrected the parameter passed to NVIC_SetPriority() to set the MAC
+ interrupt priority in both LPC1768 demos.
+ + Decreased the default setting of configMINIMAL_STACK_SIZE in the PIC32
+ demo application to ensure the heap space was not completely consumed
+ before the scheduler was started.
+
+Changes between V5.3.1 and V5.4.0 released July 13th 2009
+
+ + Added Virtex5 / PPC440 port and demos.
+ + Replaced the LPC1766 Red Suite demo with an LPC1768 Red Suite demo. The
+ original demo was configured to use engineering samples of the CPU. The
+ new demo has an improved Ethernet driver.
+ + Added LPC1768 Rowley demo with zero copy Ethernet driver.
+ + Reworked byte alignment code to ensure 8 byte alignment works correctly.
+ + Set configUSE_16_BIT_TICKS to 0 in the PPC405 demo projects.
+ + Changed the initial stack setup for the PPC405 to ensure the small data
+ area pointers are setup correctly.
+
+Changes between V5.3.0 and V5.3.1 released June 21st 2009
+
+ + Added ColdFire V1 MCF51CN128 port and WEB server demo.
+ + Added STM32 Connectivity Line STM32107 Cortex M3 WEB server demo.
+ + Changed the Cortex M3 port.c asm statements to __asm so it can be
+ compiled using Rowley CrossWorks V2 in its default configuration.
+ + Updated the Posix/Linux simulator contributed port.
+
+Changes between V5.2.0 and V5.3.0 released June 1st 2009
+
+ Main changes:
+
+ + Added new (optional) feature that gathers statistics on the amount of CPU
+ time used by each task.
+ + Added a new demo application for the Atmel AT91SAM3U Cortex-M3 based
+ microcontroller.
+ + Added a new demo application for the NXP LPC1766 Cortex-M3 based
+ microcontroller.
+ + Added a contributed port/demo that allows FreeRTOS to be 'simulated' in a
+ Linux environment.
+
+ Minor changes:
+ + Updated the Stellaris uIP WEB server demos to include the new run time
+ statistics gathering feature - and include a served WEB page that
+ presents the information in a tabular format.
+ + Added in the lwIP port layer for the Coldfire MCF52259.
+ + Updated the CrossWorks LPC2368 WEB server to include an image in the
+ served content.
+ + Changed some of the timing in the initialisation of the LPC2368 MAC to
+ permit its use on all part revisions.
+ + Minor modifications to the core uIP code to remove some compiler warnings.
+ + Added xTaskGetApplicationTaskTag() function and updated the OpenWatcom
+ demo to make use of the new function.
+ + Added contributed demos for AVR32 AP7000, STM32 Primer 2 and STM32 using
+ Rowley Crossworks.
+ + Heap_1.c and Heap_2.c used to define structures for the purpose of data
+ alignment. These have been converted to unions to save a few bytes of
+ RAM that would otherwise be wasted.
+ + Remove the call to strncpy() used to copy the task name into the TCB when
+ the maximum task name is configured to be 1 byte long.
+
+Changes between V5.1.2 and V5.2.0 released March 14th 2009
+
+ + Optimised the queue send and receive functions (also used by semaphores).
+ + Replaced the standard critical sections used to protect BIOS calls in the
+ PC port to instead use scheduler locks. This is because the BIOS calls
+ always return with interrupts enabled.
+ + Corrected unclosed comments in boot.s.
+
+Changes between V5.1.1 and V5.1.2 released February 9th 2009
+
+ + Added NEC V850ES port and demo.
+ + Added NEC 78K0R port and demo.
+ + Added MCF52259 port and demo.
+ + Added the AT91SAM9XE port and demo.
+ + Updated the MCF52233 FEC driver to work around a silicon bug that
+ prevents the part auto negotiating some network parameters.
+ + Minor modifications to the MCF52233 makefile to permit it to be used
+ on Linux hosts.
+ + Updated the STM32 primer files to allow them to be built with the latest
+ version of the RIDE tools.
+ + Updated the threads.js Java script used for kernel aware debugging in
+ the Rowley CrossWorks IDE.
+
+
+Changes between V5.1.0 and V5.1.1 released November 20, 2008
+
+ + Added Coldfire MCF52233 WEB server demo using GCC and Eclipse.
+ + Added IAR MSP430 port and demo.
+ + Corrected several compiler time issues that had crept in as tool versions
+ change.
+ + Included FreeRTOS-uIP - a faster uIP. This is not yet complete.
+
+Changes between V5.0.4 and V5.1.0 released October 24, 2008
+
+ + Added a new port and demo application for the ColdFire V2 core using the
+ CodeWarrior development tools.
+ + Replaced the ARM7 demo that used the old (and now no longer supported)
+ Keil compiler with a new port that uses the new Keil/RVDS combo.
+ + Stack overflow checking now works for stacks that grow up from low
+ memory (PIC24 and dsPIC).
+ + BUG FIX - set the PIC32 definition of portSTACK_GROWTH to the correct
+ value of -1.
+ + MSP430 port layers have been updated to permit tasks to place the
+ microcontroller into power down modes 1 to 3. The demo applications have
+ likewise been updated to demonstrate the new feature.
+ + Replaced the two separate MSP430/Rowley port layers with a single and more
+ flexible version.
+ + Added more contributed ports, including ports for NEC and SAM9
+ microcontrollers.
+ + Changed the linker script used in the LPC2368 Eclipse demo.
+
+Changes between V5.0.3 and V5.0.4 released September 22, 2008
+
+ + Completely re-written port for ColdFire GCC.
+ + Bug fix: All Cortex M3 ports have a minor change to the code that sets
+ the pending interrupt.
+ + Some header files require that FreeRTOS.h be included prior to their
+ inclusion. #error message have been added to all such header file
+ informing users to the cause of the compilation error should the headers
+ not be included in the correct order.
+
+Changes between V5.0.2 and V5.0.3 released July 31, 2008
+
+ Changes relating to the Cortex M3:
+
+ + Added configMAX_SYSCALL_INTERRUPT_PRIORITY usage to all the Cortex M3
+ ports and demos. See the port documentation pages on the FreeRTOS.org
+ WEB site for full usage information.
+ + Improved efficiency of Cortex M3 port even further.
+ + Ensure the Cortex M3 port works no matter where the vector table is
+ located.
+ + Added the IntQTimer demo/test tasks to a demo project for each CM3 port
+ (Keil, GCC and IAR) to test the new configMAX_SYSCALL_INTERRUPT_PRIORITY
+ functionality.
+ + Added the mainINCLUDE_WEB_SERVER definition to the LM3SXXXX IAR and Keil
+ projects to allow the WEB server to be conditionally excluded from the
+ build and therefore allow use of the KickStart (code size limited)
+ compiler version.
+
+ Other changes:
+
+ + Moved the PIC24 and dsPIC versions of vPortYield() from the C file to
+ an assembly file to allow use with all MPLAB compiler versions. This also
+ allows the omit-frame-pointer optimisation to be turned off.
+
+Changes between V5.0.0 and V5.0.2 released May 30, 2008
+
+ + Updated the PIC32 port to allow queue API calls to be used from
+ interrupts above the kernel interrupt priority, and to allow full
+ interrupt nesting. Task stack usages has also been reduced.
+ + Added a new PowerPC port that demonstrates how the trace macros can be
+ used to allow the use of a floating point co-processor. The
+ traceTASK_SWITCHED_OUT() and traceTASK_SWITCHED_INT() macros are used to
+ save and restore the floating point context respectively for those tasks
+ that actually use floating point operations.
+ + BUG FIX: The first PPC405 port contained a bug in that it did not leave
+ adequate space above the stack for the backchain to be saved when a task
+ started to execute for the first time.
+ + Updated queue.c to add in the means to allow interrupt nesting and for
+ queue API functions to be called from interrupts that have a priority
+ above the kernel priority. This is only supported on PIC32 ports thus
+ far.
+ + Fixed the compiler warnings that were generated when the latest version
+ of WinAVR was used.
+ + Remove all inline usage of 'inline' from the core kernel code.
+ + Added the queue registry feature. The queue registry is provided as a
+ means for kernel aware debuggers to locate queue definitions. It has no
+ purpose unless you are using a kernel aware debugger. The queue registry
+ will only be used when configQUEUE_REGISTRY_SIZE is greater than zero.
+ + Added the ST Cortex-M3 drivers into the Demo/Common/Drivers directory to
+ prevent them from having to be included in multiple demos.
+ + Added a Keil STM32 demo application.
+ + Changed the blocktim.c test files as it is no longer legitimate for all
+ ports to call queue API functions from within a critical section.
+ + Added the IntQueue.c test file to test the calling of queue API functions
+ from different interrupt priority levels, and test interrupt nesting.
+
+Changes between V5.0.0 and V5.0.1
+
+ + V5.0.1 was a customer specific release.
+
+Changes between V4.8.0 and V5.0.0 released April 15, 2008
+
+ *** VERY IMPORTANT INFORMATION ON UPGRADING TO FREERTOS.ORG V5.0.0 ***
+
+ The parameters to the functions xQueueSendFromISR(), xQueueSendToFrontFromISR(),
+ xQueueSendToBackFromISR() and xSemaphoreGiveFromISR() have changed. You must
+ update all calls to these functions to use the new calling convention! Your
+ compiler might not issue any type mismatch warnings!
+
+
+ Other changes:
+
+ + Support added for the new Luminary Micro LM3S3768 and LM3S3748 Cortex-M3
+ microcontrollers.
+ + New task hook feature added.
+ + PowerPC demo updated to use version 10.1 of the Xilinx EDK.
+ + Efficiency gains within the PIC32 port layer.
+
+Changes between V4.7.2 and V4.8.0 released March 26 2008
+
+ + Added a Virtex4 PowerPC 405 port and demo application.
+ + Added optional stack overflow checking and new
+ uxTaskGetStackHighWaterMark() function.
+ + Added new xQueueIsQueueEmptyFromISR(), xQueueIsQueueFullFromISR() and
+ uxQueueMessagesWaitingFromISR() API functions.
+ + Efficiency improvements to the Cortex-M3 port layer. NOTE: This
+ requires that an SVC handler be installed in the application.
+ + Efficiency improvements to the queue send and receive functions.
+ + Added new trace macros. These are application definable to provide
+ a flexible trace facility.
+ + Implemented the configKERNEL_INTERRUPT_PRIORITY within the Keil Cortex
+ M3 port layer (bringing it up to the same standard as the IAR and GCC
+ versions).
+ + Ports that used the arm-stellaris-eabi-gcc tools have been converted to
+ use the arm-non-eabi-gcc tools.
+
+Changes between V4.7.1 and V4.7.2 released February 21, 2008
+
+ + Added Fujitsu MB91460 port and demo.
+ + Added Fujitsu MB96340 port and demo.
+ + Tidied up the capitalisation of include files to facilitate builds on
+ Linux hosts.
+ + Removed some redundant casting that was generating warnings - but was
+ included to remove warnings on other compilers.
+
+Changes between V4.7.0 and V4.7.1 released February 3, 2008
+
+ + Updated all IAR ARM projects to use V5.11 of the IAR Embedded Workbench
+ for ARM.
+ + Introduced recursive semaphore feature.
+ + Updated LPC2368 demos to take into account silicon bugs in old chip
+ revisions.
+ + Updated STR9 uIP port to manually set the net mask and gateway addresses.
+ + Updating demos to allow more to run with the co-operative scheduler.
+ + Fixed co-operative scheduler behaviour upon the occurrence of a tick
+ interrupt while the scheduler was suspended.
+ + Updated documentation contained within semphr.h.
+ + ARM7 GCC ports no longer use the IRQ attribute.
+
+Changes between V4.6.1 and V4.7.0 released December 6, 2007
+
+ + Introduced the counting semaphore macros and demo source files. The
+ Open Watcom PC project has been updated to include the new demo. See
+ the online documentation for more information.
+ + Introduced the 'alternative' queue handling API and demo source files.
+ The Open Watcom PC project has been updated to include the new demo
+ source files. See the online documentation for more information.
+ + Added AT91SAM7X Eclipse demo project.
+ + Added the STM32 primer demo project for the GCC compiler and Ride IDE.
+ + Removed the .lock files that were mistakenly included in the V4.6.1
+ eclipse workspaces.
+
+Changes between V4.6.0 and V4.6.1 released November 5 2007
+
+ + Added support for the MIPS M4K based PIC32.
+ + Added 'extern "C"' to all the header files to facilitate use with C++.
+
+Changes between V4.5.0 and V4.6.0 released October 28 2007
+
+ + Changed the method used to force a context switch within an ISR for the
+ ARM7/9 GCC ports only. The portENTER_SWITCHING_ISR() and
+ portEXIT_SWITCHING_ISR() macros are no longer supported. This is to
+ ensure correct behaviour no matter which GCC version is used, with or
+ without the -fomit-frame-pointer option, and at all optimisation levels.
+ + Corrected the prototype for xQueueGenericSend() within queue.h.
+
+Changes between V4.4.0 and V4.5.0 released September 17 2007
+
+ + Added the xQueueSendToFront(), xQueueSendToBack() and xQueuePeek()
+ functionality. These should now be used in preference to the old
+ xQueueSend() function - which is maintained for backward compatibility.
+ + Added Mutex functionality. The behaviour of mutexes is subtly different
+ to the already existing binary semaphores as mutexes automatically
+ include a priority inheritance mechanism.
+ + Added the GenQTest.c and QPeek.c to test and demonstrate the behaviour
+ of the new functionality.
+ + Updated the LM3Sxxxx and PC ports to include the new GenQTest.c and
+ QPeek.c files.
+ + Updated the GCC port for the Cortex M3 to include the
+ configKERNEL_INTERRUPT_PRIORITY functionality. This was previously only
+ included in the IAR port.
+ + Optimised the GCC and IAR port layer code - specifically the context
+ switch code.
+ + Consolidated the LM3Sxxxx EK demos for all development tools into a
+ single project that automatically detects which version of the EK the
+ application is executing on.
+ + Added Eclipse support for LM3Sxxxx evaluation kits.
+ + Added Eclipse support for the Keil LPC2368 evaluation kit.
+ + Added the Demo/Drivers directory to hold code that is common to multiple
+ demo application projects.
+ + Included some minor bug fixes in the uIP 1.0 code.
+ + Added an lwIP demo for the STR9 - thanks ST for assistance.
+ + Updated the AVR32 port to ensure correct behaviour with full compiler
+ optimisation.
+ + Included binaries for OpenOCD FTDI and parallel port interfaces.
+
+Changes between V4.4.0 and V4.3.1 released July 31, 2007
+
+ + Added AVR32 UC3B demo application.
+ + Updated AVR32 UC3A port and demo applications.
+ + Added IAR lwIP demo for AVR32 UC3A.
+ + Updated listGET_OWNER_OF_NEXT_ENTRY() to assist compiler optimisation
+ (thanks Niu Yong for making the suggestion).
+ + Added xTaskGetSchedulerState() API function.
+ + BUG FIX: Corrected behaviour when tasks that are blocked indefinitely
+ have their block time adjusted (within xQueueSend() and xQueueReceive()),
+ and are the subject of a call the vTaskResume() when they are not
+ actually in the Suspended state (thanks Dan Searles for reporting the
+ issues).
+
+
+Changes between V4.3.0 and V4.3.1 released June 11, 2007
+
+ + Added STMicroelectronics STM32 Cortex-M3 demo application.
+ + Updated ustdlib.c for the GCC LM3S6965 demo.
+
+Changes between V4.2.1 and V4.3.0 released June 5, 2007
+
+ + Introduced configKERNEL_INTERRUPT_PRIORITY to the IAR Cortex-M3, PIC24
+ and dsPIC ports. See the LM3S6965 and PIC24 demo application
+ documentation pages for more information.
+ + Updated the PIC24 and dsPIC demos to build with V3.0 of the PIC30 GCC
+ tools, and changed the demo applications.
+ + Added demos for the new Ethernet and CAN enabled Luminary Micro Stellaris
+ microcontrollers.
+ + Corrected bug in uIP the demos that prevented frames of approximately 1480
+ bytes and over from being transmitted.
+ + Included the LPC2368/uIP/Rowley demo into the main FreeRTOS.org
+ download.
+ + Update to WizC PIC18 port to permit its use with version 14 of the
+ compiler. Thanks Marcel!
+
+Changes between V4.2.1 and V4.2.0 released April 2, 2007
+
+ + Added AVR32 AT32UC3A ports for GCC and IAR.
+ + Added -fomit-frame-pointer option to lwIP SAM7X demo makefile.
+ + Moved location of call to LCD_Init() in STR9 demo to ensure it is only
+ called after the scheduler has been started.
+
+Changes between V4.1.3 and V4.2.0 released February 8, 2007
+
+ + Changes to both task.c and queue.c as a result of testing performed on
+ the SafeRTOS code base.
+ + Added Cortex-M3 LM3S811 demos for GCC and IAR tools.
+
+Changes between V4.1.2 and V4.1.3 released November 19, 2006
+
+ + Added STR750 ARM7 port using the Raisonance RIDE/GCC tools.
+ + Added -fomit-frame-pointer option to Rowley ARM7 demos as work around
+ to GCC bug at some optimisation levels.
+ + Altered the way the heap is defined in the LM3S811 Keil demo to prevent
+ the RAM usage from counting toward the code size limit calculation.
+ + CO-ROUTINE BUG FIX: Removed the call to prvIsQueueEmpty from within
+ xQueueCRReceive as it exited with interrupts enabled. Thanks Paul Katz.
+ + Tasks that block on events with a timeout of portMAX_DELAY are now
+ blocked indefinitely if configINCLUDE_vTaskSuspend is defined.
+ Previously portMAX_DELAY was just the longest block time possible. This
+ is still the case if configINCLUDE_vTaskSuspend is not defined.
+ + Minor changes to some demo application files.
+
+Changes between V4.1.1 and V4.1.2 released October 21, 2006
+
+ + Added 16bit PIC ports and demos.
+ + Added STR750 port and demo.
+
+
+Changes between V4.1.0 and V4.1.1 released September 24, 2006
+
+ + Added the Luminary Micro Stellaris LM3S811 demo application.
+
+Changes between V4.0.5 and V4.1.0 released August 28, 2006
+
+ + Prior to V4.1.0, under certain documented circumstances, it was possible
+ for xQueueSend() and xQueueReceive() to return without having completed
+ and without their block time expiring. The block time effectively
+ stated a maximum block time, and the return value of the function needed
+ to be checked to determine the reason for returning. This is no longer
+ the case as the functions will only return once the block time has
+ expired or they are able to complete their operation. It is therefore no
+ longer necessary to wrap calls within loops.
+ + Changed the critical section handling in the IAR AVR port to correct the
+ behaviour when used with later compiler versions.
+ + Added the LPC2138 CrossWorks demo into the zip file. Previously this was
+ only available as a separate download.
+ + Modified the AVR demo applications to demonstrate the use of co-routines.
+
+Changes between V4.0.4 and V4.0.5 released August 13, 2006
+
+ + Introduced API function xTaskResumeFromISR(). Same functionality as
+ xTaskResume(), but can be called from within an interrupt service routine.
+ + Optimised vListInsert() in the case when the wake time is the maximum
+ tick count value.
+ + Bug fix: The 'value' of the event list item is updated when the priority
+ of a task is changed. Previously only the priority of the TCB itself was
+ changed.
+ + vTaskPrioritySet() and vTaskResume() no longer use the event list item.
+ This has not been necessary since V4.0.1 when the xMissedYield handling
+ was added.
+ + Lowered the PCLK setting on the ARM9 STR9 demo from 96MHz to 48MHz.
+ + When ending the scheduler - do not try to attempt a context switch when
+ deleting the current task.
+ + SAM7X EMAC drivers: Corrected the Rx frame length mask when obtaining
+ the length from the rx descriptor.
+
+
+Changes between V4.0.3 and V4.0.4 released June 22, 2006
+
+ + Added a port and demo application for the STR9 ARM9 based processors from
+ ST.
+ + Slight optimisation to the vTaskPrioritySet() function.
+ + Included the latest uIP version (1.0) in the demo/common/ethernet
+ directory.
+
+Changes between V4.0.2 and V4.0.3 released June 7, 2006
+
+ + Added a port and demo application for the Cortex-M3 target using the IAR
+ development tools.
+ + The ARM Cortex-m3 Rowley projects have been updated to use V1.6 of the
+ CrossStudio tools.
+ + The heap size defined for the lwIP Rowley demo has been reduced so that
+ the project will link correctly when using the command line GCC tools
+ also. The makefile has also been modified to allow debugging.
+ + The lwIP Rowley demo not includes a 'kernel aware' debug window.
+ + The uIP Rowley project has been updated to build with V1.6 of CrossWorks.
+ + The second set of tasks in the blockQ demo were created the wrong way
+ around (inconsistent to the description in the file). This has been
+ corrected.
+
+Changes between V4.0.1 and V4.0.2 released May 28, 2006
+
+ + Port and demo application added for the Tern Ethernet Engine controller.
+ + Port and demo application added for MC9S12 using GCC, thanks to
+ Jefferson "imajeff" Smith.
+ + The function vTaskList() now suspends the scheduler rather than disabling
+ interrupts during the creation of the task list.
+ + Allow a task to delete itself by passing in its own handle. Previously
+ this could only be done by passing in NULL.
+ + Corrected the value passed to the WDG_PeriodValueConfig() library
+ function in the STR71x demo.
+ + The tick hook function is now called only within a tick isr. Previously
+ it was also called when the tick function was called during the scheduler
+ unlocking process.
+ + The EMAC driver in the SAM7X lwIP demo has been made more robust as per
+ the thread: https://sourceforge.net/forum/message.php?msg_id=3714405
+ + In the PC ports: Add function prvSetTickFrequencyDefault() to set the
+ DOS tick back to its proper value when the scheduler exits. Thanks
+ Raynald!
+ + In the Borland x86 ports there was a mistake in the portFIRST_CONTEXT
+ macro where the BP register was not popped from the stack correctly. The
+ BP value would never get used so this did not cause a problem, but it has
+ been corrected all the same.
+
+
+Changes between V4.0.0 and V4.0.1 released April 7 2006
+
+ + Improved the ARM CORTEX M3 ports so they now only have to service
+ pendSV interrupts.
+ + Added a Luminary Micro port and demo for use with Rowley CrossWorks.
+ + Added the xMissedYield handling to tasks.c.
+
+Changes between V3.2.4 and V4.0.0
+
+ Major changes:
+
+ + Added new RTOS port for Luminary Micros ARM CORTEX M3 microcontrollers.
+ + Added new co-routine functionality.
+
+ Other kernel changes:
+
+ + An optional tick hook call is now included in the tick function.
+ + Introduced the xMiniListItem structure and removed the list pxHead
+ member in order to reduce RAM usage.
+ + Added the following definitions to the FreeRTOSConfig.h file included
+ with every port:
+ configUSE_TICK_HOOK
+ configUSE_CO_ROUTINES
+ configMAX_CO_ROUTINE_PRIORITIES
+ + The volatile qualification has been changed on the list members to allow
+ the task.c code to be tidied up a bit.
+ + The scheduler can now be started even if no tasks have been created!
+ This is to allow co-routines to run when there are no tasks.
+ + A task being woken by an event will now preempt the currently running task
+ even if its priority is only equal to the currently running task.
+
+ Port and demo application changes:
+
+ + Updated the WinAVR demo to compile with the latest version of WinAVR
+ with no warnings generated.
+ + Changed the WinAVR makefile to make chars signed - needed for the
+ co-routine code if BaseType_t is set to char.
+ + Added new demo application file crflash.c. This demonstrates co-routine
+ functionality including passing data between co-routines.
+ + Added new demo application file crhook.c. This demonstrates co-routine
+ and tick hook functionality including passing data between and ISR and
+ a co-routine.
+ + Some NOP's were missing following stmdb{}^ instructions in various ARM7
+ ports. These have been added.
+ + Updated the Open Watcom PC demo project to include the crflash and crhook
+ demo co-routines as an example of their use.
+ + Updated the H8S demo to compile with the latest version of GCC.
+ + Updated the SAM7X EMAC drivers to take into account the hardware errata
+ regarding lost packets.
+ + Changed the default MAC address used by some WEB server demos as the
+ original addresses used was not liked by some routers.
+ + Modified the SAM7X/IAR startup code slightly to prevent it hanging on
+ some systems when the code is executed using a j-link debugger. The
+ j-link macro file configures the PLL before the code executes so
+ attempting to configure it again in the startup code was causing a
+ problem for some user. Now a check is performed first to see if the
+ PLL is already set up.
+ + GCC port now contain all assembler code in a single asm block rather than
+ individual blocks as before.
+ + GCC LPC2000 code now explicitly uses R0 rather than letting the assembler
+ choose the register to use as a temporary register during the context
+ switch.
+ + Added portNOP() macro.
+ + The compare match load value on LPC2000 ports now has 1 added to correct
+ the value used.
+ + The minimal stack depth has been increased slightly on the WIZC PIC18
+ port.
+
+Changes between V3.2.3 and V3.2.4
+
+ + Modified the GCC ARM7 port layer to allow use with GCC V4.0.0 and above.
+ Many thanks to Glen Biagioni for the provided update.
+ + Added a new Microblaze port and demo application.
+ + Modified the SAM7X EMAC demo to default to use the MII interface rather
+ than the RMII interface.
+ + Modified the startup sequence of the SAM7X demo slightly to allow the
+ EMAC longer to auto negotiate.
+
+Changes between V3.2.2 and V3.2.3
+
+ + Added MII interface support to the SAM7X EMAC peripheral driver.
+ Previously versions worked with the RMII interface only.
+ + Added command line GCC support to the SAM7X lwIP demo. Previously the
+ project could only be built using the CrossWorks IDE. Modifications to
+ this end include the addition of a standard makefile and linker script to
+ the download, and some adjustments to the stacks allocated to each task.
+ + Changed the page returned by the lwIP WEB server demo to display the
+ task status table rather than the TCP/IP statistics.
+ + Corrected the capitalisation of some header file includes and makefile
+ dependencies to facilitate use on Linux host computers.
+ + The various LPC2000 ports had a mistake in the timer setup where the
+ prescale value was written to T0_PC instead of T0_PR. This would have
+ no effect unless a prescale value was actually required. This has been
+ corrected.
+
+Changes between V3.2.1 and V3.2.2 - Released 23 September, 2005
+
+ + Added an IAR port for the Philips LPC2129
+ + The Atmel ARM7 IAR demo project files are now saved in the IAR Embedded
+ Workbench V4.30a format.
+ + Updated the J-Link macro file included with the SAM7X uIP demo project
+ to allow the demo board to be reset over the J-Link.
+
+Changes between V3.2.0 and V3.2.1 - Released 1 September, 2005
+
+ + Added lwIP demo for AT91SAM7X using Rowley tools.
+ + Added uIP demo for AT91SAM7X using IAR tools.
+ + Added function xTaskGetCurrentTaskHandle().
+ + Renamed events.h to mevents.h to prevent it conflicting with the events.h
+ generated automatically by the HCS12 processor expert utility. events.h
+ is only used by the PC demo application.
+ + Both PIC18 ports now initialise the TBLPTRU to 0 as this is the value
+ expected by the compiler, and the compilers do not write to this
+ register.
+ + The HCS12 banked model demo now creates the 'suicide' tasks immediately
+ prior to starting the scheduler. These tasks should be the last tasks to
+ get started in order for the test to function correctly.
+
+Changes between V3.1.1 and V3.2.0 - Released 29 June, 2005
+
+ V3.2.0 introduces two new MSP430 ports and corrects a minor kernel
+ issues. Thanks to Ares.qi for his input.
+
+ + Added two MSP430 ports that use the Rowley CrossWorks development tools.
+ One port just mirrors the existing GCC port. The other port was provided
+ by Milos Prokic. Thanks!
+ + V3.2.0 corrects the behavior when vTaskPrioritySet() or vTaskResume()
+ are called while the scheduler is locked (by a call to
+ vTaskSuspendAll()). When this is done the subject task now starts to
+ execute immediately when the scheduler is unlocked if it has the highest
+ priority that is ready to run. Previously there was a possibility that
+ the task would not run until the next RTOS tick or call to portYIELD().
+ + Another similar small correction ensures that in the case where more than
+ one task is blocked on a semaphore or queue, the task with the highest
+ priority is guaranteed to be unblocked first.
+ + Added a couple of more test tasks to the PC demo which cover the points
+ above.
+
+Changes between V3.1.0 and V3.1.1 - Released 21st June, 2005
+
+ This release updates the HCS12 port. The common kernel code
+ remains unchanged.
+
+ + Updated the HCS12 port to support banking and introduced a demo
+ application for the MC9S12DP256. The new demo application is
+ located in the Demo/HCS12_CodeWarrior_banked directory.
+ + The name of the directory containing the MC9S12F32 demo application
+ has been changed to Demo/HCS12_CodeWarrior_small (as in 'small'
+ memory model).
+ + MC9S12F32 demo updated slightly to use the PLL. The CPU speed for the
+ demo application is now 24MHz. Previously it was 8MHz.
+ + The demo application file Demo/Common/Minimal/death.c has a slight
+ alteration to prevent it using floating point variables.
+
+
+Changes between V3.0.0 and V3.1.0 - Released 11th June, 2005
+
+ + Added new ports for ST Microsystems STR71x, and Freescale HCS12
+ microcontrollers. Currently the HCS12 port is limited to the small
+ memory model. Large memory models will be supported in the next
+ release.
+ + PIC18 wizC port updated. Thanks to Marcel van Lieshout for his
+ continuing contribution.
+ + The accuracy of the AVR port timer setup has been improved. Thanks to
+ Thomas Krutmann for this contribution.
+ + Added a new conditional compilation macro configIDLE_SHOULD_YIELD.
+ See the WEB documentation for details.
+ + Updated the CrossWorks uIP demo to build with V1.4 of CrossWorks.
+ + Slight modification to the SAM7 release build configuration to correct
+ an include path definition.
+ + Updated the MPLAB PIC18 documentation to provide extra details on linker
+ file configuration.
+
+Changes between V3.0.0 and V2.6.1 - Released 23rd April, 2005
+
+ V3.0.0 includes many enhancements, so this history list is broken into
+ subsections as follows:
+
+ API changes
+ New ports
+ Directory name changes
+ Kernel and miscellaneous changes changes
+
+ - API changes
+
+ + Each port now defines BaseType_t as the data type that is most
+ efficient for that architecture. The type BaseType_t is used
+ extensively in API calls necessitating the following changes to the
+ FreeRTOS API function prototypes.
+
+ See the "New for V3.0.0" section of the FreeRTOS online
+ documentation for full details of API changes.
+
+ - New ports
+
+ + The AT91FR40008 ARM7 port contributed by John Feller is now included
+ in the download (thanks John!).
+ + The PIC18 port for the wizC/fedC compiler contributed by Marcel van
+ Lieshout is now included in the download (thanks Marcel!).
+ + The IAR port for the AVR microcontroller has been upgraded to V3.0.0
+ and is now a supported port.
+
+ - Directory name changes
+
+ For consistency, and to allow integration of the new ports, the
+ following directory names have been changed.
+
+ + The source/portable/GCC/ARM7 directory has been renamed
+ source/portable/GCC/ARM7_LPC2000 so it is compatible with the naming
+ of other GCC ARM7 ports.
+ + The Demo/PIC directory has been renamed Demo/PIC18_MPLAB to
+ accommodate the wizC/fedC PIC port.
+ + The demo applications for the two AVR ports no longer share the same
+ directory. The WinAVR demo is in the Demo/AVR_ATMega323_WinAVR
+ directory and the IAR port in the Demo/AVR_ATMega323_IAR directory.
+
+
+ - Kernel and miscellaneous changes changes
+
+ See the "New for V3.0.0" section of the FreeRTOS online
+ documentation for more information.
+
+ + Previously 'portmacro.h' contained some user editable definitions
+ relating to the user application, and some fixed definitions relating
+ specifically to the port being used. The application specific
+ definitions have been removed from 'portmacro.h' and placed inside a
+ new header file called 'FreeRTOSConfig.h'. 'portmacro.h' should now
+ never be modified by the user. A 'FreeRTOSConfig.h' is now included
+ in each of FreeRTOS/Demo subdirectories - as it's settings relate to
+ the demo application rather than being specific to the port.
+ + Introduced configUSE_IDLE_HOOK in idle task.
+ + The idle task will yield when another idle priority task is ready to
+ run. Previously the idle task would run to the end of its time slice
+ regardless.
+ + The idle task is now created when the scheduler is started. This
+ requires less stack than the previous scheme where it was created upon
+ creation of the first application task.
+ + The function usPortCheckFreeStackSpace() has been renamed
+ usTaskCheckFreeStackSpace() and moved from the portable layer to
+ tasks.c.
+ + Corrected spelling of portMINMAL_STACK_SIZE to portMINIMAL_STACK_SIZE.
+ + The portheap.c file included with the AVR port has been deleted. The
+ AVR demo now uses the standard heap1 sample memory allocator.
+ + The GCC AVR port is now build using the standard make utility. The
+ batch files used previously have been deleted. This means a recent
+ version of WinAVR is required in order to create a binary suitable for
+ source level debugging.
+ + vTaskStartScheduler() no longer takes the configUSE_PREEMPTION
+ constant as a parameter. Instead the constant is used directly within
+ tasks.c and no parameter is required.
+ + The header file 'FreeRTOS.h' has been created and is used to include
+ 'projdefs.h', 'FreeRTOSConfig.h' and 'portable.h' in the necessary
+ order. FreeRTOS.h can now be included in place of these other
+ headers.
+ + The header file 'errors.h' has been deleted. The definitions it
+ contained are now located within 'projdefs.h'.
+ + pvPortMalloc() now takes a size_t parameter as per the ANSI malloc().
+ Previously an unsigned short was used.
+ + When resuming the scheduler a yield is performed if either a tick has
+ been missed, or a task is moved from the pending ready list into a
+ ready list. Previously a yield was not performed on this second
+ condition.
+ + In heap1.c an overflow check has been added to ensure the next free
+ byte variable does not wrap around.
+ + Introduced the portTASK_FUNCTION() and portTASK_FUNCTION_PROTO()
+ macros.
+ + The MPLAB PIC port now saved the TABLAT register in interrupt service
+ routines.
+
+Changes between V2.6.0 and V2.6.1 - Released Feb 22, 2005
+
+ This version adds support for the H8 processor.
+
+ Other changes:
+
+ + tskMAX_TASK_NAME_LEN removed from the task.h header and added to each
+ individual portmacro.h file as portMAX_TASK_NAME_LEN. This allows RAM
+ limited ports to allocate fewer characters to the task name.
+ + AVR port - Replaced the inb() and outb() functions with direct memory
+ access. This allows the port to be built with the 20050414 build of
+ WinAVR.
+ + GCC LPC2106 port - removed the 'static' from the definition of
+ vNonPreemptiveTick() to allow the demo to link when using the cooperative
+ scheduler.
+ + GCC LPC2106 port - Corrected the optimisation options in the batch files
+ ROM_THUMB.bat, RAM_THUMB.bat, ROM_ARM.bat and RAM_ARM.bat. The lower case
+ -o is replaced by an uppercase -O.
+ + Tasks.c - The strcpy call has been removed when copying across the task
+ name into the TCB.
+ + Updated the trace visualisation to always be 4 byte aligned so it can be
+ used on ARM architectures.
+ + There are now two tracecon executables (that convert the trace file binary
+ into an ASCII file). One for big endian targets and one for little endian
+ targets.
+ + Added ucTasksDeleted variable to prevent vTaskSuspendAll() being called
+ too often in the idle task.
+ + SAM7 USB driver - Replaced the duplicated RX_DATA_BK0 in the interrupt
+ mask with the RX_DATA_BK1.
+
+
+Changes between V2.5.5 and V2.6.0 - Released January 16, 2005
+
+ + Added the API function vTaskDelayUntil(). The demo app file
+ Demo/Common/Minimal/flash.c has been updated to demonstrate its use.
+ + Added INCLUDE_vTaskDelay conditional compilation.
+ + Changed the name of the Demo/ARM7_AtmelSAM7S64_IAR directory to
+ Demo/ARM7_AT91SAM7S64_IAR for consistency.
+ + Modified the AT91SAM7S USB driver to allow descriptors that have
+ a length that is an exact multiple of the FIFO to be transmitted.
+
+Changes between V2.5.4 and V2.5.5 - Released January 3, 2005
+
+ This version adds support for the Atmel SAM7 ARM7 microcontrollers
+ along with the IAR development tools.
+
+ Other changes:
+
+ + Renamed the Demo/ARM7 directory to Demo/ARM7_LPC2106_GCC.
+ + Renamed the Demo/ARM7_Keil directory to Demo/ARM7_LPC2129_Keil.
+ + Modified the Philips ARM7 serial interrupt service routines to only
+ process one interrupt per call. This seems to enable the ISR to
+ operate more quickly.
+ + Removed the 'far' keyword from the Open Watcom portable layer source
+ files. This allows their use with V1.3 of Open Watcom.
+ + Minor modifications to the SDCC build files to allow their use under
+ Linux. Thanks to Frieder Ferlemann for this contribution.
+ + Small change to sTaskCreate() to allow a context switch even when
+ pxCreatedTask is NULL. Thanks to Kamil for this contribution.
+ + inline keyword removed from vTaskSwitchContext() and VTaskIncrementTick()
+ definitions.
+
+Changes between V2.5.3 and V2.5.4 - Released Dec 1, 2004
+
+ This is an important maintenance release.
+
+ The function cTaskResumeAll() has been modified so it can be used safely
+ prior to the kernel being initialised. This was an issue as
+ cTaskResumeAll() is called from pvPortMalloc(). Thanks to Daniel Braun
+ for highlighting this issue.
+
+Changes between V2.5.2 and V2.5.3 - Released Nov 2, 2004
+
+ The critical section handling functions have been changed for the GCC ARM7
+ port. Some optimisation levels use the stack differently to others. This
+ means the interrupt flags cannot always be stored on the stack and are
+ instead now stored in a variable, which is then saved as part of the
+ tasks context. This allows the GCC ARM7 port to be used at all
+ optimisation levels - including -Os.
+
+ Other minor changes:
+
+ + MSP430 definition of usCriticalNesting now uses the volatile qualifier.
+ This is probably not required but added just in case.
+
+Changes between V2.5.1 and V2.5.2 - Released Oct 26, 2004
+
+ + Added the Keil ARM7 port.
+ + Slight modification to comtest.c to make the delay periods more random.
+ This creates a better test condition.
+
+Changes between V2.5.0 and V2.5.1 - Released Oct 9, 2004
+
+ + Added the MSP430 port.
+ + Extra comments added to the GCC ARM7 port.c and portISR.c files.
+ + The memory pool allocated within heap_1.c has been placed within a
+ structure to ensure correct memory alignment on 32bit systems.
+ + Within the GCC ARM7 serial drivers an extra check is made to ensure
+ the post to the queue was successful if then attempting immediately
+ retrieve the posted character.
+ + Changed the name of the constant portTICKS_PER_MS to portTICK_PERIOD_MS
+ as the old name was misleading.
+
+
+Changes between V2.4.2 and V2.5.0 - Released Aug 12, 2004
+
+ The RTOS source code download now includes three separate memory allocation
+ schemes - so you can choose the most appropriate for your application.
+ These are found in the Source/Portable/MemMang directory. The demo
+ application projects have also been updated to demonstrate the new schemes.
+ See the "Memory Management" page of the API documentation for more details.
+
+ + Added heap_1.c, heap_2.c and heap_3.c in the Source/Portable/MemMang
+ directory.
+ + Replaced the portheap.c files for each demo application with one of the
+ new memory allocation files.
+ + Updated the portmacro.h file for each demo application to include the
+ constants required for the new memory allocators: portTOTAL_HEAP_SIZE and
+ portBYTE_ALIGNMENT.
+ + Added a new test to the ARM7 demo application that tests the operation
+ of the heap_2 memory allocator.
+
+
+Changes between V2.4.1 and V2.4.2 - Released July 14, 2004
+
+ + The ARM7 port now supports THUMB mode.
+ + Modification to the ARM7 demo application serial port driver.
+
+Changes between V2.4.0 and V2.4.1 - Released July 2, 2004
+
+ + Rationalised the ARM7 port version of portEXIT_CRITICAL() -
+ improvements provided by Bill Knight.
+ + Made demo serial driver more complete and robust.
+
+
+Changes between V2.4.0 and V2.3.1 - Released June 30, 2004
+
+ + Added the first ARM7 port - thanks to Bill Knight for the assistance
+ provided.
+ + Added extra files to the Demo/Common/Minimal directory. These are
+ equivalent to their Demo/Common/Full counterparts but with the
+ calls to the functions defined in print.c removed.
+ + Added TABLAT to the list of registers saved as part of a PIC18 context.
+
+Changes between V2.3.0 and V2.3.1 - Released June 25, 2004
+
+ + Changed the way the vector table is defined to be more portable.
+ + Corrected the definitions of SPH and SPL in portmacro.s90.
+ The previous definitions prevented V2.3.0 operating if the iom323.h
+ header file was included in portmacro.s90.
+
+Changes between V2.2.0 and V2.3.0 - Released June 19, 2004
+
+ + Added an AVR port that uses the IAR compiler.
+ + Explicit use of 'signed' qualifier on plain char types.
+ + Modified the Open Watcom project files to use 'signed' as the
+ default char type.
+ + Changed odd calculation of initial pxTopOfStack value when
+ portSTACK_GROWTH < 0.
+ + Added inline qualifier to context switch functions within task.c.
+ Ports that do not support the (non ANSI) inline keyword have the
+ inline #define'd away in their respective portmacro.h files.
+
+Changes between V2.1.1 and V2.2.0 - Released May 18, 2004
+
+ + Added Cygnal 8051 port.
+ + PCLATU and PCLATH are now saved as part of the PIC18 context. This
+ allows function pointers to be used within tasks. Thanks to Javier
+ Espeche for the enhancement.
+ + Minor changes to demo application files to reduce stack usage.
+ + Minor changes to prevent compiler warnings when compiling the new port.
+
+Changes between V2.1.0 and V2.1.1 - Released March 12, 2004
+
+ + Bug fix - pxCurrentTCB is now initialised before the call to
+ prvInitialiseTaskLists(). Previously pxCurrentTCB could be accessed
+ while null during the initialisation sequence. Thanks to Giuseppe
+ Franco for the correction.
+
+Changes between V2.0.0 and V2.1.0 - Released Feb 29, 2004
+
+ V2.1.0 has significant reworks that greatly reduce the amount of time
+ the kernel has interrupts disabled. The first section of modifications
+ listed here must be taken into account by users. The second section
+ are related to the kernel implementation and as such are transparent.
+
+ Section1 :
+
+ + The typedef TickType_t has been introduced. All delay times should
+ now use a variable of type TickType_t in place of the unsigned long's
+ used previously. API function prototypes have been updated
+ appropriately.
+ + The configuration macro USE_16_BIT_TICKS has been introduced. If set
+ to 1 TickType_t is defined as an unsigned short. If set to 0
+ TickType_t is defined as an unsigned long. See the configuration
+ section of the API documentation for more details.
+ + The configuration macro INCLUDE_vTaskSuspendAll is now obsolete.
+ + vTaskResumeAll() has been renamed cTaskResumeAll() as it now returns a
+ value (see the API documentation).
+ + ulTaskGetTickCount() has been renamed xTaskGetTickCount() as the type
+ it returns now depends on the USE_16_BIT_TICKS definition.
+ + cQueueReceive() must now >never< be used from within an ISR. Use the new
+ cQueueReceiveFromISR() function instead.
+
+ Section 2:
+
+ + A mechanism has been introduced that allows a queue to be accessed by
+ a task and ISR simultaneously.
+ + A "pending ready" queue has been introduced that enables interrupts to
+ be processed when the scheduler is suspended.
+ + The list implementation has been improved to provide faster item
+ removal.
+ + The scheduler now makes use of the scheduler suspend mechanism in places
+ where previously interrupts were disabled.
+
+Changes between V1.2.6 and V2.0.0 - Released Jan 31, 2004
+
+ + Introduced new API functions:
+ vTaskPriorityGet ()
+ vTaskPrioritySet ()
+ vTaskSuspend ()
+ vTaskResume ()
+ vTaskSuspendAll ()
+ vTaskResumeAll ()
+ + Added conditional compilation options that allow the components of the
+ kernel that are unused by an application to be excluded from the build.
+ See the Configuration section on the WEB site for more information (on
+ the API pages). The macros have been added to each portmacro.h file (
+ sometimes called prtmacro.h).
+ + Rearranged tasks.c.
+ + Added demo application file dynamic.c.
+ + Updated the PC demo application to make use of dynamic.c.
+ + Updated the documentation contained in the kernel header files.
+ + Creating a task now causes a context switch if the task being created
+ has a higher priority than the calling task - assuming the kernel is
+ running.
+ + vTaskDelete() now only causes a context switch if the calling task is
+ the task being deleted.
+
+Changes between V1.2.5 and V1.2.6 - Released December 31, 2003
+
+ Barring the change to the interrupt vector (PIC port) these are minor
+ enhancements.
+
+ + The interrupt vector used for the PIC master ISR has been changed from
+ 0x18 to 0x08 - where it should have always been. The incorrect address
+ still works but probably executes a number of NOP's before getting to the
+ ISR.
+ + Changed the baud rate used by the AVR demo application to 38400. This
+ has an error percentage of less than one percent with an 8MHz clock.
+ + Raised the priority of the Rx task in demo\full\comtest.c. This only
+ affects the Flashlite and PC ports. This was done to prevent the Rx
+ buffer becoming full.
+ + Reverted the Flashlite COM port driver back so it does not use the DMA.
+ The DMA appears to miss characters under stress. The Borland Flashlite
+ port was also calculating a register value incorrectly resulting in the
+ wrong DMA source address being used. The same code worked fine when
+ compiling with Open Watcom. Other minor enhancements were made to the
+ interrupt handling.
+ + Modified the PIC serial Rx ISR to check for and clear overrun errors.
+ Overrun errors seem to prevent any further characters being received.
+ + The PIC demo projects now have some optimisation switched on.
+
+
+Changes between V1.2.4 and V1.2.5
+
+ Small fix made to the PIC specific port.c file described below.
+
+ + Introduced portGLOBAL_INTERRUPT_FLAG definition to test the global
+ interrupt flag setting. Using the two bits defined within
+ portINITAL_INTERRUPT_STATE was causing the w register to get clobbered
+ before the test was performed.
+
+Changes between V1.2.3 and V1.2.4
+
+ V1.2.4 contains a release version of the PIC18 port.
+ An optional exception has been included with the GPL. See the licensing
+ section of www.FreeRTOS.org for details.
+
+ + The function xPortInitMinimal() has been renamed to
+ xSerialPortInitMinimal() and the function xPortInit() has been renamed
+ to xSerialPortInit().
+ + The function sSerialPutChar() has been renamed cSerialPutChar() and
+ the function return type chaned to portCHAR.
+ + The integer and flop tasks now include calls to tskYIELD(), allowing
+ them to be used with the cooperative scheduler.
+ + All the demo applications now use the integer and comtest tasks when the
+ cooperative scheduler is being used. Previously they were only used with
+ the preemptive scheduler.
+ + Minor changes made to operation of minimal versions of comtest.c and
+ integer.c.
+ + The ATMega port definition of portCPU_CLOSK_HZ definition changed to
+ 8MHz base 10, previously it base 16.
+
+
+
+Changes between V1.2.2a and V1.2.3
+
+ The only change of any significance is to the license, which has changed
+ from the Open Software License to the GNU GPL.
+
+ The zip file also contains a pre-release version of the PIC18 port. This
+ has not yet completed testing and as such does not constitute part of the
+ V1.2.3 release. It is still however covered by the GNU GPL.
+
+ There are minor source code changes to accommodate the PIC C compiler.
+ These mainly involve more explicit casting.
+
+ + sTaskCreate() has been modified slightly to make use of the
+ portSTACK_GROWTH macro. This is required for the PIC port where the
+ stack grows in the opposite direction to the other existing ports.
+ + prvCheckTasksWaitingTermination() has been modified slightly to bring
+ the decrementing of usCurrentNumberOfTasks within the critical section,
+ where it should have been since the creation of an eight bit port.
+
+Changes between V1.2.2 and V1.2.2a
+
+ The makefile and buildcoff.bat files included with the AVR demo application
+ have been modified for use with the September 2003 build of WinAVR. No
+ source files have changed.
+
+Changes between V1.2.1 and V1.2.2
+
+ There are only minor changes here to allow the PC and Flashlite 186 ports
+ to use the Borland V4.52 compiler, as supplied with the Flashlite 186
+ development kit.
+
+ + Introduced a BCC directory under source\portable. This contains all the
+ files specific to the Borland compiler port.
+ + Corrected the macro naming of portMS_PER_TICK to portTICKS_PER_MS.
+ + Modified comtest.c to increase the rate at which the string is
+ transmitted and received on the serial port. The Flashlite 186 demo
+ app baud rate has also been increased.
+ + The values of the constants used in both integer.c files have been
+ increased to force the Borland compiler to use 32 bit values. The
+ Borland optimiser placed the previous values in 16 bit registers, and in
+ So doing invalidated the test.
+
+Changes between V1.2.0 and V1.2.1
+
+ This version includes some minor changes to the list implementation aimed
+ at improving the context switch time - with is now approximately 10% faster.
+ Changes include the removal of some null pointer assignment checks. These
+ were redundant where the scheduler uses the list functions, but means any
+ user application choosing to use the same list functions must now check
+ that no NULL pointers are passed as a parameter.
+
+ The Flashlite 186 serial port driver has also been modified to use a DMA
+ channel for transmissions. The serial driver is fully functional but still
+ under development. Flashlite users may prefer to use V1.2.0 for now.
+
+ Details:
+
+ + Changed the baud rate for the ATMega323 serial test from 19200 to 57600.
+ + Use vSerialPutString() instead of single character puts in
+ Demo\Full\Comtest.c. This allows the use of the flashlite DMA serial
+ driver. Also the check variable only stops incrementing after two
+ consecutive failures.
+ + semtest.c creates four tasks, two of which operate at the idle priority.
+ The tasks that operate at the idle priority now use a lower expected
+ count than those running at a higher priority. This prevents the low
+ priority tasks from signalling an error because they have not been
+ scheduled enough time for each of them to count the shared variable to
+ the higher original value.
+ + The flashlite 186 serial driver now uses a DMA channel for transmissions.
+ + Removed the volatile modifier from the list function parameters. This was
+ only ever included to prevent compiler warnings. Now warnings are
+ removed by casting parameters where the calls are made.
+ + prvListGetOwnerOfNextEntry() and prvListGetOwnerOfHeadEntry() have been
+ removed from list.c and added as macros in list.h.
+ + usNumberOfItems has been added to the list structure. This removes the
+ need for a pointer comparison when checking if a list is empty, and so
+ is slightly faster.
+ + Removed the NULL check in vListRemove(). This makes the call faster but
+ necessitates any application code utilising the list implementation to
+ ensure NULL pointers are not passed.
+ + Renamed portTICKS_PER_MS definition to portMS_PER_TICK (milli seconds
+ per tick). This is what it always should have been.
+
+Changes between V1.01 and V1.2.0
+
+ The majority of these changes were made to accommodate the 8bit AVR port.
+ The scheduler workings have not changed, but some of the data types used
+ have been made more friendly to an eight bit environment.
+
+ Details:
+
+ + Changed the version numbering format.
+ + Added AVR port.
+ + Split the directory demo\common into demo\common\minimal and
+ demo\common\full. The files in the full directory are for systems with
+ a display (currently PC and Flashlite 186 demo's). The files in the
+ minimal directory are for systems with limited RAM and no display
+ (currently MegaAVR).
+ + Minor changes to demo application function prototypes to make more use
+ of 8bit data types.
+ + Within the scheduler itself the following functions have slightly
+ modified declarations to make use of 8bit data types where possible:
+ xQueueCreate(),
+ sQueueReceive(),
+ sQUeueReceive(),
+ usQueueMessageWaiting(),
+ sQueueSendFromISR(),
+ sSemaphoreTake(),
+ sSemaphoreGive(),
+ sSemaphoreGiveFromISR(),
+ sTaskCreate(),
+ sTaskMoveFromEventList().
+
+ Where the return type has changed the function name has also changed in
+ accordance with the naming convention. For example
+ usQueueMessageWaiting() has become ucQueueMessageWaiting().
+ + The definition tskMAX_PRIORITIES has been moved from task.h to
+ portmacro.h and renamed portMAX_PRIORITIES. This allows different
+ ports to allocate a different maximum number of priorities.
+ + By default the trace facility is off, previously USE_TRACE_FACILITY
+ was defined.
+ + comtest.c now uses a psuedo random delay between sends. This allows for
+ better testing as the interrupts do not arrive at regular intervals.
+ + Minor change to the Flashlite serial port driver. The driver is written
+ to demonstrate the scheduler and is not written to be efficient.
+
+
+
+Changes between V1.00 and V1.01
+
+ These changes improve the ports. The scheduler itself has not changed.
+
+ Improved context switch mechanism used when performing a context
+ switch from an ISR (both the tick ISR and the serial comms ISR's within
+ the demo application). The new mechanism is faster and uses less stack.
+
+ The assembler file portasm.asm has been replaced by a header file
+ portasm.h. This includes a few assembler macro definitions.
+
+ All saving and restoring of registers onto/off of the stack is now handled
+ by the compiler. This means the initial stack setup for a task has to
+ mimic the stack used by the compiler, which is different for debug and
+ release builds.
+
+ Slightly changed the operation of the demo application, details below.
+
+ Details:
+
+ + portSWITCH_CONTEXT() replaced by vPortFirstContext().
+ + pxPortInitialiseStack() modified to replicate the stack used by the
+ compiler.
+ + portasm.asm file removed.
+ + portasm.h introduced. This contains macro definitions for
+ portSWITCH_CONTEXT() and portFIRST_CONTEXT().
+ + Context switch from ISR now uses the compiler generated interrupt
+ mechanism. This is done simply by calling portSWITCH_CONTEXT and leaving
+ the save/restore to compiler generated code.
+ + Calls to taskYIELD() during ISR's have been replaced by calling the
+ simpler and faster portSWITCH_CONTEXT().
+ + The Flashlite 186 port now uses 186 instruction set (used to use 80x86
+ instructions only).
+ + The blocking queue tasks within the demo application did not operate
+ quite as described. This has been corrected.
+ + The priority of the comtest Rx task within the demo application has been
+ lowered. Received characters are now processed (read from the queue) at
+ the idle priority, allowing low priority tasks to run evenly at times of
+ a high communications overhead.
+ + Prevent the call to kbhit() in main.c for debug builds as the debugger
+ seems to have problems stepping over the call. This if for the PC port
+ only.
+
+
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/LICENSE.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/LICENSE.md
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/LICENSE.md
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/LICENSE.md
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/Quick_Start_Guide.url b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/Quick_Start_Guide.url
similarity index 96%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/Quick_Start_Guide.url
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/Quick_Start_Guide.url
index ebefebd..0aa68ed 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/Quick_Start_Guide.url
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/Quick_Start_Guide.url
@@ -1,5 +1,5 @@
-[InternetShortcut]
-URL=https://www.FreeRTOS.org/FreeRTOS-quick-start-guide.html
-IDList=
-[{000214A0-0000-0000-C000-000000000046}]
-Prop3=19,2
+[InternetShortcut]
+URL=https://www.FreeRTOS.org/FreeRTOS-quick-start-guide.html
+IDList=
+[{000214A0-0000-0000-C000-000000000046}]
+Prop3=19,2
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/README.md b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/README.md
new file mode 100644
index 0000000..52d78dd
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/README.md
@@ -0,0 +1,39 @@
+## Getting started
+This repository contains FreeRTOS kernel source/header files and kernel ports only. This repository is referenced as a submodule in [FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS) repository, which contains pre-configured demo application projects under ```FreeRTOS/Demo``` directory.
+
+The easiest way to use FreeRTOS is to start with one of the pre-configured demo application projects. That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.FreeRTOS.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links.
+
+Additionally, for FreeRTOS kernel feature information refer to the [Developer Documentation](https://www.FreeRTOS.org/features.html), and [API Reference](https://www.FreeRTOS.org/a00106.html).
+
+### Getting help
+If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org).
+
+## Cloning this repository
+
+To clone using HTTPS:
+```
+git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git
+```
+Using SSH:
+```
+git clone git@github.com:FreeRTOS/FreeRTOS-Kernel.git
+```
+
+## Repository structure
+- The root of this repository contains the three files that are common to
+every port - list.c, queue.c and tasks.c. The kernel is contained within these
+three files. croutine.c implements the optional co-routine functionality - which
+is normally only used on very memory limited systems.
+
+- The ```./portable``` directory contains the files that are specific to a particular microcontroller and/or compiler.
+See the readme file in the ```./portable``` directory for more information.
+
+- The ```./include``` directory contains the real time kernel header files.
+
+### Code Formatting
+FreeRTOS files are formatted using the "uncrustify" tool. The configuration file used by uncrustify can be found in the [FreeRTOS/FreeRTOS repository](https://github.com/FreeRTOS/FreeRTOS/blob/main/tools/uncrustify.cfg).
+
+### Spelling
+*lexicon.txt* contains words that are not traditionally found in an English dictionary. It is used by the spellchecker to verify the various jargon, variable names, and other odd words used in the FreeRTOS code base. If your pull request fails to pass the spelling and you believe this is a mistake, then add the word to *lexicon.txt*.
+Note that only the FreeRTOS Kernel source files are checked for proper spelling, the portable section is ignored.
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/SW-Content-Register.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/SW-Content-Register.txt
new file mode 100644
index 0000000..0b0cce5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/SW-Content-Register.txt
@@ -0,0 +1,8 @@
+Release Name: FreeRTOS kernel
+Release Version: 10.5.0
+Outgoing License: MIT
+License File: LICENSE.md
+Format: source code
+Description: Open source RTOS kernel for small devices
+Origin: Amazon (MIT)
+Url: https://aws.amazon.com/freertos/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/croutine.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/croutine.c
new file mode 100644
index 0000000..9e58334
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/croutine.c
@@ -0,0 +1,363 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#include "FreeRTOS.h"
+#include "task.h"
+#include "croutine.h"
+
+/* Remove the whole file is co-routines are not being used. */
+#if ( configUSE_CO_ROUTINES != 0 )
+
+/*
+ * Some kernel aware debuggers require data to be viewed to be global, rather
+ * than file scope.
+ */
+ #ifdef portREMOVE_STATIC_QUALIFIER
+ #define static
+ #endif
+
+
+/* Lists for ready and blocked co-routines. --------------------*/
+ static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
+ static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
+ static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
+ static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
+ static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
+ static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
+
+/* Other file private variables. --------------------------------*/
+ CRCB_t * pxCurrentCoRoutine = NULL;
+ static UBaseType_t uxTopCoRoutineReadyPriority = 0;
+ static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
+
+/* The initial state of the co-routine when it is created. */
+ #define corINITIAL_STATE ( 0 )
+
+/*
+ * Place the co-routine represented by pxCRCB into the appropriate ready queue
+ * for the priority. It is inserted at the end of the list.
+ *
+ * This macro accesses the co-routine ready lists and therefore must not be
+ * used from within an ISR.
+ */
+ #define prvAddCoRoutineToReadyQueue( pxCRCB ) \
+ { \
+ if( ( pxCRCB )->uxPriority > uxTopCoRoutineReadyPriority ) \
+ { \
+ uxTopCoRoutineReadyPriority = ( pxCRCB )->uxPriority; \
+ } \
+ vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ ( pxCRCB )->uxPriority ] ), &( ( pxCRCB )->xGenericListItem ) ); \
+ }
+
+/*
+ * Utility to ready all the lists used by the scheduler. This is called
+ * automatically upon the creation of the first co-routine.
+ */
+ static void prvInitialiseCoRoutineLists( void );
+
+/*
+ * Co-routines that are readied by an interrupt cannot be placed directly into
+ * the ready lists (there is no mutual exclusion). Instead they are placed in
+ * in the pending ready list in order that they can later be moved to the ready
+ * list by the co-routine scheduler.
+ */
+ static void prvCheckPendingReadyList( void );
+
+/*
+ * Macro that looks at the list of co-routines that are currently delayed to
+ * see if any require waking.
+ *
+ * Co-routines are stored in the queue in the order of their wake time -
+ * meaning once one co-routine has been found whose timer has not expired
+ * we need not look any further down the list.
+ */
+ static void prvCheckDelayedList( void );
+
+/*-----------------------------------------------------------*/
+
+ BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
+ UBaseType_t uxPriority,
+ UBaseType_t uxIndex )
+ {
+ BaseType_t xReturn;
+ CRCB_t * pxCoRoutine;
+
+ /* Allocate the memory that will store the co-routine control block. */
+ pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
+
+ if( pxCoRoutine )
+ {
+ /* If pxCurrentCoRoutine is NULL then this is the first co-routine to
+ * be created and the co-routine data structures need initialising. */
+ if( pxCurrentCoRoutine == NULL )
+ {
+ pxCurrentCoRoutine = pxCoRoutine;
+ prvInitialiseCoRoutineLists();
+ }
+
+ /* Check the priority is within limits. */
+ if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
+ {
+ uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
+ }
+
+ /* Fill out the co-routine control block from the function parameters. */
+ pxCoRoutine->uxState = corINITIAL_STATE;
+ pxCoRoutine->uxPriority = uxPriority;
+ pxCoRoutine->uxIndex = uxIndex;
+ pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;
+
+ /* Initialise all the other co-routine control block parameters. */
+ vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
+ vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );
+
+ /* Set the co-routine control block as a link back from the ListItem_t.
+ * This is so we can get back to the containing CRCB from a generic item
+ * in a list. */
+ listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
+ listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
+
+ /* Event lists are always in priority order. */
+ listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
+
+ /* Now the co-routine has been initialised it can be added to the ready
+ * list at the correct priority. */
+ prvAddCoRoutineToReadyQueue( pxCoRoutine );
+
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ return xReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
+ List_t * pxEventList )
+ {
+ TickType_t xTimeToWake;
+
+ /* Calculate the time to wake - this may overflow but this is
+ * not a problem. */
+ xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
+
+ /* We must remove ourselves from the ready list before adding
+ * ourselves to the blocked list as the same list item is used for
+ * both lists. */
+ ( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
+
+ /* The list item will be inserted in wake time order. */
+ listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );
+
+ if( xTimeToWake < xCoRoutineTickCount )
+ {
+ /* Wake time has overflowed. Place this item in the
+ * overflow list. */
+ vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
+ }
+ else
+ {
+ /* The wake time has not overflowed, so we can use the
+ * current block list. */
+ vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
+ }
+
+ if( pxEventList )
+ {
+ /* Also add the co-routine to an event list. If this is done then the
+ * function must be called with interrupts disabled. */
+ vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
+ }
+ }
+/*-----------------------------------------------------------*/
+
+ static void prvCheckPendingReadyList( void )
+ {
+ /* Are there any co-routines waiting to get moved to the ready list? These
+ * are co-routines that have been readied by an ISR. The ISR cannot access
+ * the ready lists itself. */
+ while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE )
+ {
+ CRCB_t * pxUnblockedCRCB;
+
+ /* The pending ready list can be accessed by an ISR. */
+ portDISABLE_INTERRUPTS();
+ {
+ pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyCoRoutineList ) );
+ ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
+ }
+ portENABLE_INTERRUPTS();
+
+ ( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
+ prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
+ }
+ }
+/*-----------------------------------------------------------*/
+
+ static void prvCheckDelayedList( void )
+ {
+ CRCB_t * pxCRCB;
+
+ xPassedTicks = xTaskGetTickCount() - xLastTickCount;
+
+ while( xPassedTicks )
+ {
+ xCoRoutineTickCount++;
+ xPassedTicks--;
+
+ /* If the tick count has overflowed we need to swap the ready lists. */
+ if( xCoRoutineTickCount == 0 )
+ {
+ List_t * pxTemp;
+
+ /* Tick count has overflowed so we need to swap the delay lists. If there are
+ * any items in pxDelayedCoRoutineList here then there is an error! */
+ pxTemp = pxDelayedCoRoutineList;
+ pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
+ pxOverflowDelayedCoRoutineList = pxTemp;
+ }
+
+ /* See if this tick has made a timeout expire. */
+ while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE )
+ {
+ pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );
+
+ if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )
+ {
+ /* Timeout not yet expired. */
+ break;
+ }
+
+ portDISABLE_INTERRUPTS();
+ {
+ /* The event could have occurred just before this critical
+ * section. If this is the case then the generic list item will
+ * have been moved to the pending ready list and the following
+ * line is still valid. Also the pvContainer parameter will have
+ * been set to NULL so the following lines are also valid. */
+ ( void ) uxListRemove( &( pxCRCB->xGenericListItem ) );
+
+ /* Is the co-routine waiting on an event also? */
+ if( pxCRCB->xEventListItem.pxContainer )
+ {
+ ( void ) uxListRemove( &( pxCRCB->xEventListItem ) );
+ }
+ }
+ portENABLE_INTERRUPTS();
+
+ prvAddCoRoutineToReadyQueue( pxCRCB );
+ }
+ }
+
+ xLastTickCount = xCoRoutineTickCount;
+ }
+/*-----------------------------------------------------------*/
+
+ void vCoRoutineSchedule( void )
+ {
+ /* Only run a co-routine after prvInitialiseCoRoutineLists() has been
+ * called. prvInitialiseCoRoutineLists() is called automatically when a
+ * co-routine is created. */
+ if( pxDelayedCoRoutineList != NULL )
+ {
+ /* See if any co-routines readied by events need moving to the ready lists. */
+ prvCheckPendingReadyList();
+
+ /* See if any delayed co-routines have timed out. */
+ prvCheckDelayedList();
+
+ /* Find the highest priority queue that contains ready co-routines. */
+ while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
+ {
+ if( uxTopCoRoutineReadyPriority == 0 )
+ {
+ /* No more co-routines to check. */
+ return;
+ }
+
+ --uxTopCoRoutineReadyPriority;
+ }
+
+ /* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
+ * of the same priority get an equal share of the processor time. */
+ listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
+
+ /* Call the co-routine. */
+ ( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
+ }
+ }
+/*-----------------------------------------------------------*/
+
+ static void prvInitialiseCoRoutineLists( void )
+ {
+ UBaseType_t uxPriority;
+
+ for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
+ {
+ vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
+ }
+
+ vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 );
+ vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 );
+ vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList );
+
+ /* Start with pxDelayedCoRoutineList using list1 and the
+ * pxOverflowDelayedCoRoutineList using list2. */
+ pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
+ pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
+ }
+/*-----------------------------------------------------------*/
+
+ BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList )
+ {
+ CRCB_t * pxUnblockedCRCB;
+ BaseType_t xReturn;
+
+ /* This function is called from within an interrupt. It can only access
+ * event lists and the pending ready list. This function assumes that a
+ * check has already been made to ensure pxEventList is not empty. */
+ pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
+ ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
+ vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
+
+ if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
+ {
+ xReturn = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
+
+ return xReturn;
+ }
+
+#endif /* configUSE_CO_ROUTINES == 0 */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/event_groups.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/event_groups.c
new file mode 100644
index 0000000..9313455
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/event_groups.c
@@ -0,0 +1,778 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
+ * all the API functions to use the MPU wrappers. That should only be done when
+ * task.h is included from an application file. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* FreeRTOS includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+#include "timers.h"
+#include "event_groups.h"
+
+/* Lint e961, e750 and e9021 are suppressed as a MISRA exception justified
+ * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+ * for the header files above, but not in this file, in order to generate the
+ * correct privileged Vs unprivileged linkage and placement. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021 See comment above. */
+
+/* The following bit fields convey control information in a task's event list
+ * item value. It is important they don't clash with the
+ * taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
+#if configUSE_16_BIT_TICKS == 1
+ #define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
+ #define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
+ #define eventWAIT_FOR_ALL_BITS 0x0400U
+ #define eventEVENT_BITS_CONTROL_BYTES 0xff00U
+#else
+ #define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
+ #define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
+ #define eventWAIT_FOR_ALL_BITS 0x04000000UL
+ #define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
+#endif
+
+typedef struct EventGroupDef_t
+{
+ EventBits_t uxEventBits;
+ List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxEventGroupNumber;
+ #endif
+
+ #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
+ #endif
+} EventGroup_t;
+
+/*-----------------------------------------------------------*/
+
+/*
+ * Test the bits set in uxCurrentEventBits to see if the wait condition is met.
+ * The wait condition is defined by xWaitForAllBits. If xWaitForAllBits is
+ * pdTRUE then the wait condition is met if all the bits set in uxBitsToWaitFor
+ * are also set in uxCurrentEventBits. If xWaitForAllBits is pdFALSE then the
+ * wait condition is met if any of the bits set in uxBitsToWait for are also set
+ * in uxCurrentEventBits.
+ */
+static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xWaitForAllBits ) PRIVILEGED_FUNCTION;
+
+/*-----------------------------------------------------------*/
+
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+ EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer )
+ {
+ EventGroup_t * pxEventBits;
+
+ /* A StaticEventGroup_t object must be provided. */
+ configASSERT( pxEventGroupBuffer );
+
+ #if ( configASSERT_DEFINED == 1 )
+ {
+ /* Sanity check that the size of the structure used to declare a
+ * variable of type StaticEventGroup_t equals the size of the real
+ * event group structure. */
+ volatile size_t xSize = sizeof( StaticEventGroup_t );
+ configASSERT( xSize == sizeof( EventGroup_t ) );
+ } /*lint !e529 xSize is referenced if configASSERT() is defined. */
+ #endif /* configASSERT_DEFINED */
+
+ /* The user has provided a statically allocated event group - use it. */
+ pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 !e9087 EventGroup_t and StaticEventGroup_t are deliberately aliased for data hiding purposes and guaranteed to have the same size and alignment requirement - checked by configASSERT(). */
+
+ if( pxEventBits != NULL )
+ {
+ pxEventBits->uxEventBits = 0;
+ vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
+
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ {
+ /* Both static and dynamic allocation can be used, so note that
+ * this event group was created statically in case the event group
+ * is later deleted. */
+ pxEventBits->ucStaticallyAllocated = pdTRUE;
+ }
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+
+ traceEVENT_GROUP_CREATE( pxEventBits );
+ }
+ else
+ {
+ /* xEventGroupCreateStatic should only ever be called with
+ * pxEventGroupBuffer pointing to a pre-allocated (compile time
+ * allocated) StaticEventGroup_t variable. */
+ traceEVENT_GROUP_CREATE_FAILED();
+ }
+
+ return pxEventBits;
+ }
+
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+
+ EventGroupHandle_t xEventGroupCreate( void )
+ {
+ EventGroup_t * pxEventBits;
+
+ /* Allocate the event group. Justification for MISRA deviation as
+ * follows: pvPortMalloc() always ensures returned memory blocks are
+ * aligned per the requirements of the MCU stack. In this case
+ * pvPortMalloc() must return a pointer that is guaranteed to meet the
+ * alignment requirements of the EventGroup_t structure - which (if you
+ * follow it through) is the alignment requirements of the TickType_t type
+ * (EventBits_t being of TickType_t itself). Therefore, whenever the
+ * stack alignment requirements are greater than or equal to the
+ * TickType_t alignment requirements the cast is safe. In other cases,
+ * where the natural word size of the architecture is less than
+ * sizeof( TickType_t ), the TickType_t variables will be accessed in two
+ * or more reads operations, and the alignment requirements is only that
+ * of each individual read. */
+ pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) ); /*lint !e9087 !e9079 see comment above. */
+
+ if( pxEventBits != NULL )
+ {
+ pxEventBits->uxEventBits = 0;
+ vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
+
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ {
+ /* Both static and dynamic allocation can be used, so note this
+ * event group was allocated statically in case the event group is
+ * later deleted. */
+ pxEventBits->ucStaticallyAllocated = pdFALSE;
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
+
+ traceEVENT_GROUP_CREATE( pxEventBits );
+ }
+ else
+ {
+ traceEVENT_GROUP_CREATE_FAILED(); /*lint !e9063 Else branch only exists to allow tracing and does not generate code if trace macros are not defined. */
+ }
+
+ return pxEventBits;
+ }
+
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
+EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ const EventBits_t uxBitsToWaitFor,
+ TickType_t xTicksToWait )
+{
+ EventBits_t uxOriginalBitValue, uxReturn;
+ EventGroup_t * pxEventBits = xEventGroup;
+ BaseType_t xAlreadyYielded;
+ BaseType_t xTimeoutOccurred = pdFALSE;
+
+ configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+ configASSERT( uxBitsToWaitFor != 0 );
+ #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+ {
+ configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
+ }
+ #endif
+
+ vTaskSuspendAll();
+ {
+ uxOriginalBitValue = pxEventBits->uxEventBits;
+
+ ( void ) xEventGroupSetBits( xEventGroup, uxBitsToSet );
+
+ if( ( ( uxOriginalBitValue | uxBitsToSet ) & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ {
+ /* All the rendezvous bits are now set - no need to block. */
+ uxReturn = ( uxOriginalBitValue | uxBitsToSet );
+
+ /* Rendezvous always clear the bits. They will have been cleared
+ * already unless this is the only task in the rendezvous. */
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+
+ xTicksToWait = 0;
+ }
+ else
+ {
+ if( xTicksToWait != ( TickType_t ) 0 )
+ {
+ traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor );
+
+ /* Store the bits that the calling task is waiting for in the
+ * task's event list item so the kernel knows when a match is
+ * found. Then enter the blocked state. */
+ vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | eventCLEAR_EVENTS_ON_EXIT_BIT | eventWAIT_FOR_ALL_BITS ), xTicksToWait );
+
+ /* This assignment is obsolete as uxReturn will get set after
+ * the task unblocks, but some compilers mistakenly generate a
+ * warning about uxReturn being returned without being set if the
+ * assignment is omitted. */
+ uxReturn = 0;
+ }
+ else
+ {
+ /* The rendezvous bits were not set, but no block time was
+ * specified - just return the current event bit value. */
+ uxReturn = pxEventBits->uxEventBits;
+ xTimeoutOccurred = pdTRUE;
+ }
+ }
+ }
+ xAlreadyYielded = xTaskResumeAll();
+
+ if( xTicksToWait != ( TickType_t ) 0 )
+ {
+ if( xAlreadyYielded == pdFALSE )
+ {
+ portYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* The task blocked to wait for its required bits to be set - at this
+ * point either the required bits were set or the block time expired. If
+ * the required bits were set they will have been stored in the task's
+ * event list item, and they should now be retrieved then cleared. */
+ uxReturn = uxTaskResetEventItemValue();
+
+ if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
+ {
+ /* The task timed out, just return the current event bit value. */
+ taskENTER_CRITICAL();
+ {
+ uxReturn = pxEventBits->uxEventBits;
+
+ /* Although the task got here because it timed out before the
+ * bits it was waiting for were set, it is possible that since it
+ * unblocked another task has set the bits. If this is the case
+ * then it needs to clear the bits before exiting. */
+ if( ( uxReturn & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ {
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ taskEXIT_CRITICAL();
+
+ xTimeoutOccurred = pdTRUE;
+ }
+ else
+ {
+ /* The task unblocked because the bits were set. */
+ }
+
+ /* Control bits might be set as the task had blocked should not be
+ * returned. */
+ uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
+ }
+
+ traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred );
+
+ /* Prevent compiler warnings when trace macros are not used. */
+ ( void ) xTimeoutOccurred;
+
+ return uxReturn;
+}
+/*-----------------------------------------------------------*/
+
+EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xClearOnExit,
+ const BaseType_t xWaitForAllBits,
+ TickType_t xTicksToWait )
+{
+ EventGroup_t * pxEventBits = xEventGroup;
+ EventBits_t uxReturn, uxControlBits = 0;
+ BaseType_t xWaitConditionMet, xAlreadyYielded;
+ BaseType_t xTimeoutOccurred = pdFALSE;
+
+ /* Check the user is not attempting to wait on the bits used by the kernel
+ * itself, and that at least one bit is being requested. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+ configASSERT( uxBitsToWaitFor != 0 );
+ #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+ {
+ configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
+ }
+ #endif
+
+ vTaskSuspendAll();
+ {
+ const EventBits_t uxCurrentEventBits = pxEventBits->uxEventBits;
+
+ /* Check to see if the wait condition is already met or not. */
+ xWaitConditionMet = prvTestWaitCondition( uxCurrentEventBits, uxBitsToWaitFor, xWaitForAllBits );
+
+ if( xWaitConditionMet != pdFALSE )
+ {
+ /* The wait condition has already been met so there is no need to
+ * block. */
+ uxReturn = uxCurrentEventBits;
+ xTicksToWait = ( TickType_t ) 0;
+
+ /* Clear the wait bits if requested to do so. */
+ if( xClearOnExit != pdFALSE )
+ {
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else if( xTicksToWait == ( TickType_t ) 0 )
+ {
+ /* The wait condition has not been met, but no block time was
+ * specified, so just return the current value. */
+ uxReturn = uxCurrentEventBits;
+ xTimeoutOccurred = pdTRUE;
+ }
+ else
+ {
+ /* The task is going to block to wait for its required bits to be
+ * set. uxControlBits are used to remember the specified behaviour of
+ * this call to xEventGroupWaitBits() - for use when the event bits
+ * unblock the task. */
+ if( xClearOnExit != pdFALSE )
+ {
+ uxControlBits |= eventCLEAR_EVENTS_ON_EXIT_BIT;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ if( xWaitForAllBits != pdFALSE )
+ {
+ uxControlBits |= eventWAIT_FOR_ALL_BITS;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Store the bits that the calling task is waiting for in the
+ * task's event list item so the kernel knows when a match is
+ * found. Then enter the blocked state. */
+ vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | uxControlBits ), xTicksToWait );
+
+ /* This is obsolete as it will get set after the task unblocks, but
+ * some compilers mistakenly generate a warning about the variable
+ * being returned without being set if it is not done. */
+ uxReturn = 0;
+
+ traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor );
+ }
+ }
+ xAlreadyYielded = xTaskResumeAll();
+
+ if( xTicksToWait != ( TickType_t ) 0 )
+ {
+ if( xAlreadyYielded == pdFALSE )
+ {
+ portYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* The task blocked to wait for its required bits to be set - at this
+ * point either the required bits were set or the block time expired. If
+ * the required bits were set they will have been stored in the task's
+ * event list item, and they should now be retrieved then cleared. */
+ uxReturn = uxTaskResetEventItemValue();
+
+ if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
+ {
+ taskENTER_CRITICAL();
+ {
+ /* The task timed out, just return the current event bit value. */
+ uxReturn = pxEventBits->uxEventBits;
+
+ /* It is possible that the event bits were updated between this
+ * task leaving the Blocked state and running again. */
+ if( prvTestWaitCondition( uxReturn, uxBitsToWaitFor, xWaitForAllBits ) != pdFALSE )
+ {
+ if( xClearOnExit != pdFALSE )
+ {
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ xTimeoutOccurred = pdTRUE;
+ }
+ taskEXIT_CRITICAL();
+ }
+ else
+ {
+ /* The task unblocked because the bits were set. */
+ }
+
+ /* The task blocked so control bits may have been set. */
+ uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
+ }
+
+ traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred );
+
+ /* Prevent compiler warnings when trace macros are not used. */
+ ( void ) xTimeoutOccurred;
+
+ return uxReturn;
+}
+/*-----------------------------------------------------------*/
+
+EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear )
+{
+ EventGroup_t * pxEventBits = xEventGroup;
+ EventBits_t uxReturn;
+
+ /* Check the user is not attempting to clear the bits used by the kernel
+ * itself. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+
+ taskENTER_CRITICAL();
+ {
+ traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear );
+
+ /* The value returned is the event group value prior to the bits being
+ * cleared. */
+ uxReturn = pxEventBits->uxEventBits;
+
+ /* Clear the bits. */
+ pxEventBits->uxEventBits &= ~uxBitsToClear;
+ }
+ taskEXIT_CRITICAL();
+
+ return uxReturn;
+}
+/*-----------------------------------------------------------*/
+
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
+
+ BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear )
+ {
+ BaseType_t xReturn;
+
+ traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
+
+ return xReturn;
+ }
+
+#endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
+{
+ UBaseType_t uxSavedInterruptStatus;
+ EventGroup_t const * const pxEventBits = xEventGroup;
+ EventBits_t uxReturn;
+
+ uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ {
+ uxReturn = pxEventBits->uxEventBits;
+ }
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+
+ return uxReturn;
+} /*lint !e818 EventGroupHandle_t is a typedef used in other functions to so can't be pointer to const. */
+/*-----------------------------------------------------------*/
+
+EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet )
+{
+ ListItem_t * pxListItem;
+ ListItem_t * pxNext;
+ ListItem_t const * pxListEnd;
+ List_t const * pxList;
+ EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
+ EventGroup_t * pxEventBits = xEventGroup;
+ BaseType_t xMatchFound = pdFALSE;
+
+ /* Check the user is not attempting to set the bits used by the kernel
+ * itself. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+
+ pxList = &( pxEventBits->xTasksWaitingForBits );
+ pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+ vTaskSuspendAll();
+ {
+ traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
+
+ pxListItem = listGET_HEAD_ENTRY( pxList );
+
+ /* Set the bits. */
+ pxEventBits->uxEventBits |= uxBitsToSet;
+
+ /* See if the new bit value should unblock any tasks. */
+ while( pxListItem != pxListEnd )
+ {
+ pxNext = listGET_NEXT( pxListItem );
+ uxBitsWaitedFor = listGET_LIST_ITEM_VALUE( pxListItem );
+ xMatchFound = pdFALSE;
+
+ /* Split the bits waited for from the control bits. */
+ uxControlBits = uxBitsWaitedFor & eventEVENT_BITS_CONTROL_BYTES;
+ uxBitsWaitedFor &= ~eventEVENT_BITS_CONTROL_BYTES;
+
+ if( ( uxControlBits & eventWAIT_FOR_ALL_BITS ) == ( EventBits_t ) 0 )
+ {
+ /* Just looking for single bit being set. */
+ if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) != ( EventBits_t ) 0 )
+ {
+ xMatchFound = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) == uxBitsWaitedFor )
+ {
+ /* All bits are set. */
+ xMatchFound = pdTRUE;
+ }
+ else
+ {
+ /* Need all bits to be set, but not all the bits were set. */
+ }
+
+ if( xMatchFound != pdFALSE )
+ {
+ /* The bits match. Should the bits be cleared on exit? */
+ if( ( uxControlBits & eventCLEAR_EVENTS_ON_EXIT_BIT ) != ( EventBits_t ) 0 )
+ {
+ uxBitsToClear |= uxBitsWaitedFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Store the actual event flag value in the task's event list
+ * item before removing the task from the event list. The
+ * eventUNBLOCKED_DUE_TO_BIT_SET bit is set so the task knows
+ * that is was unblocked due to its required bits matching, rather
+ * than because it timed out. */
+ vTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
+ }
+
+ /* Move onto the next list item. Note pxListItem->pxNext is not
+ * used here as the list item may have been removed from the event list
+ * and inserted into the ready/pending reading list. */
+ pxListItem = pxNext;
+ }
+
+ /* Clear any bits that matched when the eventCLEAR_EVENTS_ON_EXIT_BIT
+ * bit was set in the control word. */
+ pxEventBits->uxEventBits &= ~uxBitsToClear;
+ }
+ ( void ) xTaskResumeAll();
+
+ return pxEventBits->uxEventBits;
+}
+/*-----------------------------------------------------------*/
+
+void vEventGroupDelete( EventGroupHandle_t xEventGroup )
+{
+ EventGroup_t * pxEventBits = xEventGroup;
+ const List_t * pxTasksWaitingForBits;
+
+ configASSERT( pxEventBits );
+
+ pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
+
+ vTaskSuspendAll();
+ {
+ traceEVENT_GROUP_DELETE( xEventGroup );
+
+ while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
+ {
+ /* Unblock the task, returning 0 as the event list is being deleted
+ * and cannot therefore have any bits set. */
+ configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
+ vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
+ }
+ }
+ ( void ) xTaskResumeAll();
+
+ #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
+ {
+ /* The event group can only have been allocated dynamically - free
+ * it again. */
+ vPortFree( pxEventBits );
+ }
+ #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ {
+ /* The event group could have been allocated statically or
+ * dynamically, so check before attempting to free the memory. */
+ if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
+ {
+ vPortFree( pxEventBits );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+}
+/*-----------------------------------------------------------*/
+
+/* For internal use only - execute a 'set bits' command that was pended from
+ * an interrupt. */
+void vEventGroupSetBitsCallback( void * pvEventGroup,
+ const uint32_t ulBitsToSet )
+{
+ ( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
+}
+/*-----------------------------------------------------------*/
+
+/* For internal use only - execute a 'clear bits' command that was pended from
+ * an interrupt. */
+void vEventGroupClearBitsCallback( void * pvEventGroup,
+ const uint32_t ulBitsToClear )
+{
+ ( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
+}
+/*-----------------------------------------------------------*/
+
+static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xWaitForAllBits )
+{
+ BaseType_t xWaitConditionMet = pdFALSE;
+
+ if( xWaitForAllBits == pdFALSE )
+ {
+ /* Task only has to wait for one bit within uxBitsToWaitFor to be
+ * set. Is one already set? */
+ if( ( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0 )
+ {
+ xWaitConditionMet = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ /* Task has to wait for all the bits in uxBitsToWaitFor to be set.
+ * Are they set already? */
+ if( ( uxCurrentEventBits & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ {
+ xWaitConditionMet = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+
+ return xWaitConditionMet;
+}
+/*-----------------------------------------------------------*/
+
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
+
+ BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ BaseType_t * pxHigherPriorityTaskWoken )
+ {
+ BaseType_t xReturn;
+
+ traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
+
+ return xReturn;
+ }
+
+#endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+
+ UBaseType_t uxEventGroupGetNumber( void * xEventGroup )
+ {
+ UBaseType_t xReturn;
+ EventGroup_t const * pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
+
+ if( xEventGroup == NULL )
+ {
+ xReturn = 0;
+ }
+ else
+ {
+ xReturn = pxEventBits->uxEventGroupNumber;
+ }
+
+ return xReturn;
+ }
+
+#endif /* configUSE_TRACE_FACILITY */
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+
+ void vEventGroupSetNumber( void * xEventGroup,
+ UBaseType_t uxEventGroupNumber )
+ {
+ ( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
+ }
+
+#endif /* configUSE_TRACE_FACILITY */
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/FreeRTOS.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/FreeRTOS.h
new file mode 100644
index 0000000..7ca6e36
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/FreeRTOS.h
@@ -0,0 +1,1476 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ * 1 tab == 4 spaces!
+ *
+ * Copyright 2019 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * 1. Patch for SystemView support
+ */
+
+#ifndef INC_FREERTOS_H
+#define INC_FREERTOS_H
+
+/*
+ * Include the generic headers required for the FreeRTOS port being used.
+ */
+#include
+
+/*
+ * If stdint.h cannot be located then:
+ * + If using GCC ensure the -nostdint options is *not* being used.
+ * + Ensure the project's include path includes the directory in which your
+ * compiler stores stdint.h.
+ * + Set any compiler options necessary for it to support C99, as technically
+ * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any
+ * other way).
+ * + The FreeRTOS download includes a simple stdint.h definition that can be
+ * used in cases where none is provided by the compiler. The files only
+ * contains the typedefs required to build FreeRTOS. Read the instructions
+ * in FreeRTOS/source/stdint.readme for more information.
+ */
+#include /* READ COMMENT ABOVE. */
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/* Application specific configuration options. */
+#include "FreeRTOSConfig.h"
+
+/* Basic FreeRTOS definitions. */
+#include "projdefs.h"
+
+/* Definitions specific to the port being used. */
+#include "portable.h"
+
+/* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */
+#ifndef configUSE_NEWLIB_REENTRANT
+ #define configUSE_NEWLIB_REENTRANT 0
+#endif
+
+/* Required if struct _reent is used. */
+#if ( configUSE_NEWLIB_REENTRANT == 1 )
+
+/* Note Newlib support has been included by popular demand, but is not
+ * used by the FreeRTOS maintainers themselves. FreeRTOS is not
+ * responsible for resulting newlib operation. User must be familiar with
+ * newlib and must provide system-wide implementations of the necessary
+ * stubs. Be warned that (at the time of writing) the current newlib design
+ * implements a system-wide malloc() that must be provided with locks.
+ *
+ * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
+ * for additional information. */
+ #include
+
+ #define configUSE_C_RUNTIME_TLS_SUPPORT 1
+
+ #ifndef configTLS_BLOCK_TYPE
+ #define configTLS_BLOCK_TYPE struct _reent
+ #endif
+
+ #ifndef configINIT_TLS_BLOCK
+ #define configINIT_TLS_BLOCK( xTLSBlock ) _REENT_INIT_PTR( &( xTLSBlock ) )
+ #endif
+
+ #ifndef configSET_TLS_BLOCK
+ #define configSET_TLS_BLOCK( xTLSBlock ) _impure_ptr = &( xTLSBlock )
+ #endif
+
+ #ifndef configDEINIT_TLS_BLOCK
+ #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
+ #endif
+#endif /* if ( configUSE_NEWLIB_REENTRANT == 1 ) */
+
+#ifndef configUSE_C_RUNTIME_TLS_SUPPORT
+ #define configUSE_C_RUNTIME_TLS_SUPPORT 0
+#endif
+
+#if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+
+ #ifndef configTLS_BLOCK_TYPE
+ #error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
+ #endif
+
+ #ifndef configINIT_TLS_BLOCK
+ #error Missing definition: configINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
+ #endif
+
+ #ifndef configSET_TLS_BLOCK
+ #error Missing definition: configSET_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
+ #endif
+
+ #ifndef configDEINIT_TLS_BLOCK
+ #error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
+ #endif
+#endif /* if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) ) */
+
+/*
+ * Check all the required application specific macros have been defined.
+ * These macros are application specific and (as downloaded) are defined
+ * within FreeRTOSConfig.h.
+ */
+
+#ifndef configMINIMAL_STACK_SIZE
+ #error Missing definition: configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h. configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task. Refer to the demo project provided for your port for a suitable value.
+#endif
+
+#ifndef configMAX_PRIORITIES
+ #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#if configMAX_PRIORITIES < 1
+ #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
+#endif
+
+#ifndef configUSE_PREEMPTION
+ #error Missing definition: configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#ifndef configUSE_IDLE_HOOK
+ #error Missing definition: configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#ifndef configUSE_TICK_HOOK
+ #error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#ifndef configUSE_16_BIT_TICKS
+ #error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#ifndef configUSE_CO_ROUTINES
+ #define configUSE_CO_ROUTINES 0
+#endif
+
+#ifndef INCLUDE_vTaskPrioritySet
+ #define INCLUDE_vTaskPrioritySet 0
+#endif
+
+#ifndef INCLUDE_uxTaskPriorityGet
+ #define INCLUDE_uxTaskPriorityGet 0
+#endif
+
+#ifndef INCLUDE_vTaskDelete
+ #define INCLUDE_vTaskDelete 0
+#endif
+
+#ifndef INCLUDE_vTaskSuspend
+ #define INCLUDE_vTaskSuspend 0
+#endif
+
+#ifdef INCLUDE_xTaskDelayUntil
+ #ifdef INCLUDE_vTaskDelayUntil
+
+/* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
+ * compatibility is maintained if only one or the other is defined, but
+ * there is a conflict if both are defined. */
+ #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
+ #endif
+#endif
+
+#ifndef INCLUDE_xTaskDelayUntil
+ #ifdef INCLUDE_vTaskDelayUntil
+
+/* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
+ * the project's FreeRTOSConfig.h probably pre-dates the introduction of
+ * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
+ * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
+ */
+ #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
+ #endif
+#endif
+
+#ifndef INCLUDE_xTaskDelayUntil
+ #define INCLUDE_xTaskDelayUntil 0
+#endif
+
+#ifndef INCLUDE_vTaskDelay
+ #define INCLUDE_vTaskDelay 0
+#endif
+
+#ifndef INCLUDE_xTaskGetIdleTaskHandle
+ #define INCLUDE_xTaskGetIdleTaskHandle 0
+#endif
+
+#ifndef INCLUDE_xTaskAbortDelay
+ #define INCLUDE_xTaskAbortDelay 0
+#endif
+
+#ifndef INCLUDE_xQueueGetMutexHolder
+ #define INCLUDE_xQueueGetMutexHolder 0
+#endif
+
+#ifndef INCLUDE_xSemaphoreGetMutexHolder
+ #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
+#endif
+
+#ifndef INCLUDE_xTaskGetHandle
+ #define INCLUDE_xTaskGetHandle 0
+#endif
+
+#ifndef INCLUDE_uxTaskGetStackHighWaterMark
+ #define INCLUDE_uxTaskGetStackHighWaterMark 0
+#endif
+
+#ifndef INCLUDE_uxTaskGetStackHighWaterMark2
+ #define INCLUDE_uxTaskGetStackHighWaterMark2 0
+#endif
+
+#ifndef INCLUDE_pxTaskGetStackStart
+ #define INCLUDE_pxTaskGetStackStart 0
+#endif
+
+#ifndef INCLUDE_eTaskGetState
+ #define INCLUDE_eTaskGetState 0
+#endif
+
+#ifndef INCLUDE_xTaskResumeFromISR
+ #define INCLUDE_xTaskResumeFromISR 1
+#endif
+
+#ifndef INCLUDE_xTimerPendFunctionCall
+ #define INCLUDE_xTimerPendFunctionCall 0
+#endif
+
+#ifndef INCLUDE_xTaskGetSchedulerState
+ #define INCLUDE_xTaskGetSchedulerState 0
+#endif
+
+#ifndef INCLUDE_xTaskGetCurrentTaskHandle
+ #define INCLUDE_xTaskGetCurrentTaskHandle 1
+#endif
+
+#if configUSE_CO_ROUTINES != 0
+ #ifndef configMAX_CO_ROUTINE_PRIORITIES
+ #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
+ #endif
+#endif
+
+#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
+ #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
+#endif
+
+#ifndef configUSE_APPLICATION_TASK_TAG
+ #define configUSE_APPLICATION_TASK_TAG 0
+#endif
+
+#ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
+ #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
+#endif
+
+#ifndef configUSE_RECURSIVE_MUTEXES
+ #define configUSE_RECURSIVE_MUTEXES 0
+#endif
+
+#ifndef configUSE_MUTEXES
+ #define configUSE_MUTEXES 0
+#endif
+
+#ifndef configUSE_TIMERS
+ #define configUSE_TIMERS 0
+#endif
+
+#ifndef configUSE_COUNTING_SEMAPHORES
+ #define configUSE_COUNTING_SEMAPHORES 0
+#endif
+
+#ifndef configUSE_ALTERNATIVE_API
+ #define configUSE_ALTERNATIVE_API 0
+#endif
+
+#ifndef portCRITICAL_NESTING_IN_TCB
+ #define portCRITICAL_NESTING_IN_TCB 0
+#endif
+
+#ifndef configMAX_TASK_NAME_LEN
+ #define configMAX_TASK_NAME_LEN 16
+#endif
+
+#ifndef configIDLE_SHOULD_YIELD
+ #define configIDLE_SHOULD_YIELD 1
+#endif
+
+#if configMAX_TASK_NAME_LEN < 1
+ #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
+#endif
+
+#ifndef configASSERT
+ #define configASSERT( x )
+ #define configASSERT_DEFINED 0
+#else
+ #define configASSERT_DEFINED 1
+#endif
+
+/* configPRECONDITION should be defined as configASSERT.
+ * The CBMC proofs need a way to track assumptions and assertions.
+ * A configPRECONDITION statement should express an implicit invariant or
+ * assumption made. A configASSERT statement should express an invariant that must
+ * hold explicit before calling the code. */
+#ifndef configPRECONDITION
+ #define configPRECONDITION( X ) configASSERT( X )
+ #define configPRECONDITION_DEFINED 0
+#else
+ #define configPRECONDITION_DEFINED 1
+#endif
+
+#ifndef portMEMORY_BARRIER
+ #define portMEMORY_BARRIER()
+#endif
+
+#ifndef portSOFTWARE_BARRIER
+ #define portSOFTWARE_BARRIER()
+#endif
+
+/* The timers module relies on xTaskGetSchedulerState(). */
+#if configUSE_TIMERS == 1
+
+ #ifndef configTIMER_TASK_PRIORITY
+ #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
+ #endif /* configTIMER_TASK_PRIORITY */
+
+ #ifndef configTIMER_QUEUE_LENGTH
+ #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
+ #endif /* configTIMER_QUEUE_LENGTH */
+
+ #ifndef configTIMER_TASK_STACK_DEPTH
+ #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
+ #endif /* configTIMER_TASK_STACK_DEPTH */
+
+#endif /* configUSE_TIMERS */
+
+#ifndef portSET_INTERRUPT_MASK_FROM_ISR
+ #define portSET_INTERRUPT_MASK_FROM_ISR() 0
+#endif
+
+#ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
+ #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
+#endif
+
+#ifndef portCLEAN_UP_TCB
+ #define portCLEAN_UP_TCB( pxTCB ) ( void ) ( pxTCB )
+#endif
+
+#ifndef portPRE_TASK_DELETE_HOOK
+ #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
+#endif
+
+#ifndef portSETUP_TCB
+ #define portSETUP_TCB( pxTCB ) ( void ) ( pxTCB )
+#endif
+
+#ifndef configQUEUE_REGISTRY_SIZE
+ #define configQUEUE_REGISTRY_SIZE 0U
+#endif
+
+#if ( configQUEUE_REGISTRY_SIZE < 1 )
+ #define vQueueAddToRegistry( xQueue, pcName )
+ #define vQueueUnregisterQueue( xQueue )
+ #define pcQueueGetName( xQueue )
+#endif
+
+#ifndef configUSE_MINI_LIST_ITEM
+ #define configUSE_MINI_LIST_ITEM 1
+#endif
+
+#ifndef portPOINTER_SIZE_TYPE
+ #define portPOINTER_SIZE_TYPE uint32_t
+#endif
+
+/* Remove any unused trace macros. */
+#ifndef traceSTART
+
+/* Used to perform any necessary initialisation - for example, open a file
+ * into which trace is to be written. */
+ #define traceSTART()
+#endif
+
+#ifndef traceEND
+
+/* Use to close a trace, for example close a file into which trace has been
+ * written. */
+ #define traceEND()
+#endif
+
+#ifndef traceTASK_SWITCHED_IN
+
+/* Called after a task has been selected to run. pxCurrentTCB holds a pointer
+ * to the task control block of the selected task. */
+ #define traceTASK_SWITCHED_IN()
+#endif
+
+#ifndef traceINCREASE_TICK_COUNT
+
+/* Called before stepping the tick count after waking from tickless idle
+ * sleep. */
+ #define traceINCREASE_TICK_COUNT( x )
+#endif
+
+#ifndef traceLOW_POWER_IDLE_BEGIN
+ /* Called immediately before entering tickless idle. */
+ #define traceLOW_POWER_IDLE_BEGIN()
+#endif
+
+#ifndef traceLOW_POWER_IDLE_END
+ /* Called when returning to the Idle task after a tickless idle. */
+ #define traceLOW_POWER_IDLE_END()
+#endif
+
+#ifndef traceTASK_SWITCHED_OUT
+
+/* Called before a task has been selected to run. pxCurrentTCB holds a pointer
+ * to the task control block of the task being switched out. */
+ #define traceTASK_SWITCHED_OUT()
+#endif
+
+#ifndef traceTASK_PRIORITY_INHERIT
+
+/* Called when a task attempts to take a mutex that is already held by a
+ * lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
+ * that holds the mutex. uxInheritedPriority is the priority the mutex holder
+ * will inherit (the priority of the task that is attempting to obtain the
+ * muted. */
+ #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
+#endif
+
+#ifndef traceTASK_PRIORITY_DISINHERIT
+
+/* Called when a task releases a mutex, the holding of which had resulted in
+ * the task inheriting the priority of a higher priority task.
+ * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
+ * mutex. uxOriginalPriority is the task's configured (base) priority. */
+ #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
+#endif
+
+#ifndef traceBLOCKING_ON_QUEUE_RECEIVE
+
+/* Task is about to block because it cannot read from a
+ * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
+ * upon which the read was attempted. pxCurrentTCB points to the TCB of the
+ * task that attempted the read. */
+ #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
+#endif
+
+#ifndef traceBLOCKING_ON_QUEUE_PEEK
+
+/* Task is about to block because it cannot read from a
+ * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
+ * upon which the read was attempted. pxCurrentTCB points to the TCB of the
+ * task that attempted the read. */
+ #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )
+#endif
+
+#ifndef traceBLOCKING_ON_QUEUE_SEND
+
+/* Task is about to block because it cannot write to a
+ * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
+ * upon which the write was attempted. pxCurrentTCB points to the TCB of the
+ * task that attempted the write. */
+ #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
+#endif
+
+#ifndef configCHECK_FOR_STACK_OVERFLOW
+ #define configCHECK_FOR_STACK_OVERFLOW 0
+#endif
+
+#ifndef configRECORD_STACK_HIGH_ADDRESS
+ #define configRECORD_STACK_HIGH_ADDRESS 0
+#endif
+
+#ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H
+ #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
+#endif
+
+/* The following event macros are embedded in the kernel API calls. */
+
+#ifndef traceMOVED_TASK_TO_READY_STATE
+ #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
+#endif
+
+#ifndef tracePOST_MOVED_TASK_TO_READY_STATE
+ #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
+#endif
+
+#ifndef traceREADDED_TASK_TO_READY_STATE
+ #define traceREADDED_TASK_TO_READY_STATE( pxTCB ) traceMOVED_TASK_TO_READY_STATE( pxTCB )
+#endif
+
+#ifndef traceMOVED_TASK_TO_DELAYED_LIST
+ #define traceMOVED_TASK_TO_DELAYED_LIST()
+#endif
+
+#ifndef traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST
+ #define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST()
+#endif
+
+#ifndef traceMOVED_TASK_TO_SUSPENDED_LIST
+ #define traceMOVED_TASK_TO_SUSPENDED_LIST( pxTCB )
+#endif
+
+#ifndef traceQUEUE_CREATE
+ #define traceQUEUE_CREATE( pxNewQueue )
+#endif
+
+#ifndef traceQUEUE_CREATE_FAILED
+ #define traceQUEUE_CREATE_FAILED( ucQueueType )
+#endif
+
+#ifndef traceCREATE_MUTEX
+ #define traceCREATE_MUTEX( pxNewQueue )
+#endif
+
+#ifndef traceCREATE_MUTEX_FAILED
+ #define traceCREATE_MUTEX_FAILED()
+#endif
+
+#ifndef traceGIVE_MUTEX_RECURSIVE
+ #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
+#endif
+
+#ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
+ #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
+#endif
+
+#ifndef traceTAKE_MUTEX_RECURSIVE
+ #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
+#endif
+
+#ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
+ #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
+#endif
+
+#ifndef traceCREATE_COUNTING_SEMAPHORE
+ #define traceCREATE_COUNTING_SEMAPHORE()
+#endif
+
+#ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
+ #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
+#endif
+
+#ifndef traceQUEUE_SET_SEND
+ #define traceQUEUE_SET_SEND traceQUEUE_SEND
+#endif
+
+#ifndef traceQUEUE_SEND
+ #define traceQUEUE_SEND( pxQueue )
+#endif
+
+#ifndef traceQUEUE_SEND_FAILED
+ #define traceQUEUE_SEND_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_RECEIVE
+ #define traceQUEUE_RECEIVE( pxQueue )
+#endif
+
+#ifndef traceQUEUE_PEEK
+ #define traceQUEUE_PEEK( pxQueue )
+#endif
+
+#ifndef traceQUEUE_PEEK_FAILED
+ #define traceQUEUE_PEEK_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_PEEK_FROM_ISR
+ #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
+#endif
+
+#ifndef traceQUEUE_RECEIVE_FAILED
+ #define traceQUEUE_RECEIVE_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_SEND_FROM_ISR
+ #define traceQUEUE_SEND_FROM_ISR( pxQueue )
+#endif
+
+#ifndef traceQUEUE_SEND_FROM_ISR_FAILED
+ #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_RECEIVE_FROM_ISR
+ #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
+#endif
+
+#ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
+ #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
+ #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
+#endif
+
+#ifndef traceQUEUE_DELETE
+ #define traceQUEUE_DELETE( pxQueue )
+#endif
+
+#ifndef traceTASK_CREATE
+ #define traceTASK_CREATE( pxNewTCB )
+#endif
+
+#ifndef traceTASK_CREATE_FAILED
+ #define traceTASK_CREATE_FAILED()
+#endif
+
+#ifndef traceTASK_DELETE
+ #define traceTASK_DELETE( pxTaskToDelete )
+#endif
+
+#ifndef traceTASK_DELAY_UNTIL
+ #define traceTASK_DELAY_UNTIL( x )
+#endif
+
+#ifndef traceTASK_DELAY
+ #define traceTASK_DELAY()
+#endif
+
+#ifndef traceTASK_PRIORITY_SET
+ #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
+#endif
+
+#ifndef traceTASK_SUSPEND
+ #define traceTASK_SUSPEND( pxTaskToSuspend )
+#endif
+
+#ifndef traceTASK_RESUME
+ #define traceTASK_RESUME( pxTaskToResume )
+#endif
+
+#ifndef traceTASK_RESUME_FROM_ISR
+ #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
+#endif
+
+#ifndef traceTASK_INCREMENT_TICK
+ #define traceTASK_INCREMENT_TICK( xTickCount )
+#endif
+
+#ifndef traceTIMER_CREATE
+ #define traceTIMER_CREATE( pxNewTimer )
+#endif
+
+#ifndef traceTIMER_CREATE_FAILED
+ #define traceTIMER_CREATE_FAILED()
+#endif
+
+#ifndef traceTIMER_COMMAND_SEND
+ #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
+#endif
+
+#ifndef traceTIMER_EXPIRED
+ #define traceTIMER_EXPIRED( pxTimer )
+#endif
+
+#ifndef traceTIMER_COMMAND_RECEIVED
+ #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
+#endif
+
+#ifndef traceMALLOC
+ #define traceMALLOC( pvAddress, uiSize )
+#endif
+
+#ifndef traceFREE
+ #define traceFREE( pvAddress, uiSize )
+#endif
+
+#ifndef traceEVENT_GROUP_CREATE
+ #define traceEVENT_GROUP_CREATE( xEventGroup )
+#endif
+
+#ifndef traceEVENT_GROUP_CREATE_FAILED
+ #define traceEVENT_GROUP_CREATE_FAILED()
+#endif
+
+#ifndef traceEVENT_GROUP_SYNC_BLOCK
+ #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
+#endif
+
+#ifndef traceEVENT_GROUP_SYNC_END
+ #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) ( xTimeoutOccurred )
+#endif
+
+#ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
+ #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
+#endif
+
+#ifndef traceEVENT_GROUP_WAIT_BITS_END
+ #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) ( xTimeoutOccurred )
+#endif
+
+#ifndef traceEVENT_GROUP_CLEAR_BITS
+ #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
+#endif
+
+#ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
+ #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
+#endif
+
+#ifndef traceEVENT_GROUP_SET_BITS
+ #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
+#endif
+
+#ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
+ #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
+#endif
+
+#ifndef traceEVENT_GROUP_DELETE
+ #define traceEVENT_GROUP_DELETE( xEventGroup )
+#endif
+
+#ifndef tracePEND_FUNC_CALL
+ #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )
+#endif
+
+#ifndef tracePEND_FUNC_CALL_FROM_ISR
+ #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )
+#endif
+
+#ifndef traceQUEUE_REGISTRY_ADD
+ #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
+#endif
+
+#ifndef traceTASK_NOTIFY_TAKE_BLOCK
+ #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )
+#endif
+
+#ifndef traceTASK_NOTIFY_TAKE
+ #define traceTASK_NOTIFY_TAKE( uxIndexToWait )
+#endif
+
+#ifndef traceTASK_NOTIFY_WAIT_BLOCK
+ #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )
+#endif
+
+#ifndef traceTASK_NOTIFY_WAIT
+ #define traceTASK_NOTIFY_WAIT( uxIndexToWait )
+#endif
+
+#ifndef traceTASK_NOTIFY
+ #define traceTASK_NOTIFY( uxIndexToNotify )
+#endif
+
+#ifndef traceTASK_NOTIFY_FROM_ISR
+ #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
+#endif
+
+#ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
+ #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
+#endif
+
+#ifndef traceISR_EXIT_TO_SCHEDULER
+ #define traceISR_EXIT_TO_SCHEDULER()
+#endif
+
+#ifndef traceISR_EXIT
+ #define traceISR_EXIT()
+#endif
+
+#ifndef traceISR_ENTER
+ #define traceISR_ENTER()
+#endif
+
+#ifndef traceSTREAM_BUFFER_CREATE_FAILED
+ #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
+ #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_CREATE
+ #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_DELETE
+ #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_RESET
+ #define traceSTREAM_BUFFER_RESET( xStreamBuffer )
+#endif
+
+#ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
+ #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_SEND
+ #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )
+#endif
+
+#ifndef traceSTREAM_BUFFER_SEND_FAILED
+ #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_SEND_FROM_ISR
+ #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )
+#endif
+
+#ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
+ #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_RECEIVE
+ #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )
+#endif
+
+#ifndef traceSTREAM_BUFFER_RECEIVE_FAILED
+ #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )
+#endif
+
+#ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR
+ #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
+#endif
+
+#ifndef configGENERATE_RUN_TIME_STATS
+ #define configGENERATE_RUN_TIME_STATS 0
+#endif
+
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
+
+ #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
+ #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.
+ #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
+
+ #ifndef portGET_RUN_TIME_COUNTER_VALUE
+ #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
+ #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information.
+ #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
+ #endif /* portGET_RUN_TIME_COUNTER_VALUE */
+
+#endif /* configGENERATE_RUN_TIME_STATS */
+
+#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
+ #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
+#endif
+
+#ifndef configUSE_MALLOC_FAILED_HOOK
+ #define configUSE_MALLOC_FAILED_HOOK 0
+#endif
+
+#ifndef portPRIVILEGE_BIT
+ #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
+#endif
+
+#ifndef portYIELD_WITHIN_API
+ #define portYIELD_WITHIN_API portYIELD
+#endif
+
+#ifndef portSUPPRESS_TICKS_AND_SLEEP
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
+#endif
+
+#ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
+ #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
+#endif
+
+#if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
+ #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
+#endif
+
+#ifndef configUSE_TICKLESS_IDLE
+ #define configUSE_TICKLESS_IDLE 0
+#endif
+
+#ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
+ #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configPRE_SLEEP_PROCESSING
+ #define configPRE_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configPOST_SLEEP_PROCESSING
+ #define configPOST_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configUSE_QUEUE_SETS
+ #define configUSE_QUEUE_SETS 0
+#endif
+
+#ifndef portTASK_USES_FLOATING_POINT
+ #define portTASK_USES_FLOATING_POINT()
+#endif
+
+#ifndef portALLOCATE_SECURE_CONTEXT
+ #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
+#endif
+
+#ifndef portDONT_DISCARD
+ #define portDONT_DISCARD
+#endif
+
+#ifndef configUSE_TIME_SLICING
+ #define configUSE_TIME_SLICING 1
+#endif
+
+#ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
+ #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
+#endif
+
+#ifndef configUSE_STATS_FORMATTING_FUNCTIONS
+ #define configUSE_STATS_FORMATTING_FUNCTIONS 0
+#endif
+
+#ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
+#endif
+
+#ifndef configUSE_TRACE_FACILITY
+ #define configUSE_TRACE_FACILITY 0
+#endif
+
+#ifndef mtCOVERAGE_TEST_MARKER
+ #define mtCOVERAGE_TEST_MARKER()
+#endif
+
+#ifndef mtCOVERAGE_TEST_DELAY
+ #define mtCOVERAGE_TEST_DELAY()
+#endif
+
+#ifndef portASSERT_IF_IN_ISR
+ #define portASSERT_IF_IN_ISR()
+#endif
+
+#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
+#endif
+
+#ifndef configAPPLICATION_ALLOCATED_HEAP
+ #define configAPPLICATION_ALLOCATED_HEAP 0
+#endif
+
+#ifndef configUSE_TASK_NOTIFICATIONS
+ #define configUSE_TASK_NOTIFICATIONS 1
+#endif
+
+#ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
+ #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
+#endif
+
+#if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
+ #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
+#endif
+
+#ifndef configUSE_POSIX_ERRNO
+ #define configUSE_POSIX_ERRNO 0
+#endif
+
+#ifndef configUSE_SB_COMPLETED_CALLBACK
+
+/* By default per-instance callbacks are not enabled for stream buffer or message buffer. */
+ #define configUSE_SB_COMPLETED_CALLBACK 0
+#endif
+
+#ifndef portTICK_TYPE_IS_ATOMIC
+ #define portTICK_TYPE_IS_ATOMIC 0
+#endif
+
+#ifndef configSUPPORT_STATIC_ALLOCATION
+ /* Defaults to 0 for backward compatibility. */
+ #define configSUPPORT_STATIC_ALLOCATION 0
+#endif
+
+#ifndef configSUPPORT_DYNAMIC_ALLOCATION
+ /* Defaults to 1 for backward compatibility. */
+ #define configSUPPORT_DYNAMIC_ALLOCATION 1
+#endif
+
+#if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
+ #error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
+#endif
+
+#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
+ #if ( ( configUSE_TRACE_FACILITY != 1 ) && ( configGENERATE_RUN_TIME_STATS != 1 ) )
+ #error configUSE_STATS_FORMATTING_FUNCTIONS is 1 but the functions it enables are not used because neither configUSE_TRACE_FACILITY or configGENERATE_RUN_TIME_STATS are 1. Set configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h.
+ #endif
+#endif
+
+#ifndef configSTACK_DEPTH_TYPE
+
+/* Defaults to uint16_t for backward compatibility, but can be overridden
+ * in FreeRTOSConfig.h if uint16_t is too restrictive. */
+ #define configSTACK_DEPTH_TYPE uint16_t
+#endif
+
+#ifndef configRUN_TIME_COUNTER_TYPE
+
+/* Defaults to uint32_t for backward compatibility, but can be overridden in
+ * FreeRTOSConfig.h if uint32_t is too restrictive. */
+
+ #define configRUN_TIME_COUNTER_TYPE uint32_t
+#endif
+
+#ifndef configMESSAGE_BUFFER_LENGTH_TYPE
+
+/* Defaults to size_t for backward compatibility, but can be overridden
+ * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
+ * in a size_t. */
+ #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
+#endif
+
+/* Sanity check the configuration. */
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
+ #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
+#endif
+
+#if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
+ #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
+#endif
+
+#ifndef configINITIAL_TICK_COUNT
+ #define configINITIAL_TICK_COUNT 0
+#endif
+
+#if ( portTICK_TYPE_IS_ATOMIC == 0 )
+
+/* Either variables of tick type cannot be read atomically, or
+ * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
+ * the tick count is returned to the standard critical section macros. */
+ #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
+#else
+
+/* The tick type can be read atomically, so critical sections used when the
+ * tick count is returned can be defined away. */
+ #define portTICK_TYPE_ENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) ( x )
+#endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
+
+/* Definitions to allow backward compatibility with FreeRTOS versions prior to
+ * V8 if desired. */
+#ifndef configENABLE_BACKWARD_COMPATIBILITY
+ #define configENABLE_BACKWARD_COMPATIBILITY 1
+#endif
+
+#ifndef configPRINTF
+
+/* configPRINTF() was not defined, so define it away to nothing. To use
+ * configPRINTF() then define it as follows (where MyPrintFunction() is
+ * provided by the application writer):
+ *
+ * void MyPrintFunction(const char *pcFormat, ... );
+ #define configPRINTF( X ) MyPrintFunction X
+ *
+ * Then call like a standard printf() function, but placing brackets around
+ * all parameters so they are passed as a single parameter. For example:
+ * configPRINTF( ("Value = %d", MyVariable) ); */
+ #define configPRINTF( X )
+#endif
+
+#ifndef configMAX
+
+/* The application writer has not provided their own MAX macro, so define
+ * the following generic implementation. */
+ #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
+#endif
+
+#ifndef configMIN
+
+/* The application writer has not provided their own MIN macro, so define
+ * the following generic implementation. */
+ #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
+#endif
+
+#if configENABLE_BACKWARD_COMPATIBILITY == 1
+ #define eTaskStateGet eTaskGetState
+ #define portTickType TickType_t
+ #define xTaskHandle TaskHandle_t
+ #define xQueueHandle QueueHandle_t
+ #define xSemaphoreHandle SemaphoreHandle_t
+ #define xQueueSetHandle QueueSetHandle_t
+ #define xQueueSetMemberHandle QueueSetMemberHandle_t
+ #define xTimeOutType TimeOut_t
+ #define xMemoryRegion MemoryRegion_t
+ #define xTaskParameters TaskParameters_t
+ #define xTaskStatusType TaskStatus_t
+ #define xTimerHandle TimerHandle_t
+ #define xCoRoutineHandle CoRoutineHandle_t
+ #define pdTASK_HOOK_CODE TaskHookFunction_t
+ #define portTICK_RATE_MS portTICK_PERIOD_MS
+ #define pcTaskGetTaskName pcTaskGetName
+ #define pcTimerGetTimerName pcTimerGetName
+ #define pcQueueGetQueueName pcQueueGetName
+ #define vTaskGetTaskInfo vTaskGetInfo
+ #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
+
+/* Backward compatibility within the scheduler code only - these definitions
+ * are not really required but are included for completeness. */
+ #define tmrTIMER_CALLBACK TimerCallbackFunction_t
+ #define pdTASK_CODE TaskFunction_t
+ #define xListItem ListItem_t
+ #define xList List_t
+
+/* For libraries that break the list data hiding, and access list structure
+ * members directly (which is not supposed to be done). */
+ #define pxContainer pvContainer
+#endif /* configENABLE_BACKWARD_COMPATIBILITY */
+
+#if ( configUSE_ALTERNATIVE_API != 0 )
+ #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0
+#endif
+
+/* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
+ * if floating point hardware is otherwise supported by the FreeRTOS port in use.
+ * This constant is not supported by all FreeRTOS ports that include floating
+ * point support. */
+#ifndef configUSE_TASK_FPU_SUPPORT
+ #define configUSE_TASK_FPU_SUPPORT 1
+#endif
+
+/* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is
+ * currently used in ARMv8M ports. */
+#ifndef configENABLE_MPU
+ #define configENABLE_MPU 0
+#endif
+
+/* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is
+ * currently used in ARMv8M ports. */
+#ifndef configENABLE_FPU
+ #define configENABLE_FPU 1
+#endif
+
+/* Set configENABLE_MVE to 1 to enable MVE support and 0 to disable it. This is
+ * currently used in ARMv8M ports. */
+#ifndef configENABLE_MVE
+ #define configENABLE_MVE 0
+#endif
+
+/* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
+ * This is currently used in ARMv8M ports. */
+#ifndef configENABLE_TRUSTZONE
+ #define configENABLE_TRUSTZONE 1
+#endif
+
+/* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on
+ * the Secure Side only. */
+#ifndef configRUN_FREERTOS_SECURE_ONLY
+ #define configRUN_FREERTOS_SECURE_ONLY 0
+#endif
+
+#ifndef configRUN_ADDITIONAL_TESTS
+ #define configRUN_ADDITIONAL_TESTS 0
+#endif
+
+
+/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
+ * dynamically allocated RAM, in which case when any task is deleted it is known
+ * that both the task's stack and TCB need to be freed. Sometimes the
+ * FreeRTOSConfig.h settings only allow a task to be created using statically
+ * allocated RAM, in which case when any task is deleted it is known that neither
+ * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h
+ * settings allow a task to be created using either statically or dynamically
+ * allocated RAM, in which case a member of the TCB is used to record whether the
+ * stack and/or TCB were allocated statically or dynamically, so when a task is
+ * deleted the RAM that was allocated dynamically is freed again and no attempt is
+ * made to free the RAM that was allocated statically.
+ * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a
+ * task to be created using either statically or dynamically allocated RAM. Note
+ * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with
+ * a statically allocated stack and a dynamically allocated TCB.
+ *
+ * The following table lists various combinations of portUSING_MPU_WRAPPERS,
+ * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and
+ * when it is possible to have both static and dynamic allocation:
+ * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
+ * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free |
+ * | | | | | | Static Possible | |
+ * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
+ * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No |
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
+ * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes |
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
+ * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
+ * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | |
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
+ * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No |
+ * | | | | xTaskCreateRestrictedStatic | | | |
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
+ * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
+ * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | |
+ * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
+ * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
+ * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | |
+ * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | |
+ * | | | | xTaskCreateRestrictedStatic | | | |
+ * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
+ */
+#define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \
+ ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \
+ ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )
+
+/*
+ * In line with software engineering best practice, FreeRTOS implements a strict
+ * data hiding policy, so the real structures used by FreeRTOS to maintain the
+ * state of tasks, queues, semaphores, etc. are not accessible to the application
+ * code. However, if the application writer wants to statically allocate such
+ * an object then the size of the object needs to be known. Dummy structures
+ * that are guaranteed to have the same size and alignment requirements of the
+ * real objects are used for this purpose. The dummy list and list item
+ * structures below are used for inclusion in such a dummy structure.
+ */
+struct xSTATIC_LIST_ITEM
+{
+ #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
+ TickType_t xDummy1;
+ #endif
+ TickType_t xDummy2;
+ void * pvDummy3[ 4 ];
+ #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
+ TickType_t xDummy4;
+ #endif
+};
+typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
+
+#if ( configUSE_MINI_LIST_ITEM == 1 )
+ /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
+ struct xSTATIC_MINI_LIST_ITEM
+ {
+ #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
+ TickType_t xDummy1;
+ #endif
+ TickType_t xDummy2;
+ void * pvDummy3[ 2 ];
+ };
+ typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
+#else /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
+ typedef struct xSTATIC_LIST_ITEM StaticMiniListItem_t;
+#endif /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
+
+/* See the comments above the struct xSTATIC_LIST_ITEM definition. */
+typedef struct xSTATIC_LIST
+{
+ #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
+ TickType_t xDummy1;
+ #endif
+ UBaseType_t uxDummy2;
+ void * pvDummy3;
+ StaticMiniListItem_t xDummy4;
+ #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
+ TickType_t xDummy5;
+ #endif
+} StaticList_t;
+
+/*
+ * In line with software engineering best practice, especially when supplying a
+ * library that is likely to change in future versions, FreeRTOS implements a
+ * strict data hiding policy. This means the Task structure used internally by
+ * FreeRTOS is not accessible to application code. However, if the application
+ * writer wants to statically allocate the memory required to create a task then
+ * the size of the task object needs to be known. The StaticTask_t structure
+ * below is provided for this purpose. Its sizes and alignment requirements are
+ * guaranteed to match those of the genuine structure, no matter which
+ * architecture is being used, and no matter how the values in FreeRTOSConfig.h
+ * are set. Its contents are somewhat obfuscated in the hope users will
+ * recognise that it would be unwise to make direct use of the structure members.
+ */
+typedef struct xSTATIC_TCB
+{
+ void * pxDummy1;
+ #if ( portUSING_MPU_WRAPPERS == 1 )
+ xMPU_SETTINGS xDummy2;
+ #endif
+ StaticListItem_t xDummy3[ 2 ];
+ UBaseType_t uxDummy5;
+ void * pxDummy6;
+ uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
+ #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
+ void * pxDummy8;
+ #endif
+ #if ( portCRITICAL_NESTING_IN_TCB == 1 )
+ UBaseType_t uxDummy9;
+ #endif
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxDummy10[ 2 ];
+ #endif
+ #if ( configUSE_MUTEXES == 1 )
+ UBaseType_t uxDummy12[ 2 ];
+ #endif
+ #if ( configUSE_APPLICATION_TASK_TAG == 1 )
+ void * pxDummy14;
+ #endif
+ #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
+ void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
+ #endif
+ #if ( configGENERATE_RUN_TIME_STATS == 1 )
+ configRUN_TIME_COUNTER_TYPE ulDummy16;
+ #endif
+ #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+ configTLS_BLOCK_TYPE xDummy17;
+ #endif
+ #if ( configUSE_TASK_NOTIFICATIONS == 1 )
+ uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
+ uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
+ #endif
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ uint8_t uxDummy20;
+ #endif
+
+ #if ( INCLUDE_xTaskAbortDelay == 1 )
+ uint8_t ucDummy21;
+ #endif
+ #if ( configUSE_POSIX_ERRNO == 1 )
+ int iDummy22;
+ #endif
+} StaticTask_t;
+
+/*
+ * In line with software engineering best practice, especially when supplying a
+ * library that is likely to change in future versions, FreeRTOS implements a
+ * strict data hiding policy. This means the Queue structure used internally by
+ * FreeRTOS is not accessible to application code. However, if the application
+ * writer wants to statically allocate the memory required to create a queue
+ * then the size of the queue object needs to be known. The StaticQueue_t
+ * structure below is provided for this purpose. Its sizes and alignment
+ * requirements are guaranteed to match those of the genuine structure, no
+ * matter which architecture is being used, and no matter how the values in
+ * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope
+ * users will recognise that it would be unwise to make direct use of the
+ * structure members.
+ */
+typedef struct xSTATIC_QUEUE
+{
+ void * pvDummy1[ 3 ];
+
+ union
+ {
+ void * pvDummy2;
+ UBaseType_t uxDummy2;
+ } u;
+
+ StaticList_t xDummy3[ 2 ];
+ UBaseType_t uxDummy4[ 3 ];
+ uint8_t ucDummy5[ 2 ];
+
+ #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ uint8_t ucDummy6;
+ #endif
+
+ #if ( configUSE_QUEUE_SETS == 1 )
+ void * pvDummy7;
+ #endif
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxDummy8;
+ uint8_t ucDummy9;
+ #endif
+} StaticQueue_t;
+typedef StaticQueue_t StaticSemaphore_t;
+
+/*
+ * In line with software engineering best practice, especially when supplying a
+ * library that is likely to change in future versions, FreeRTOS implements a
+ * strict data hiding policy. This means the event group structure used
+ * internally by FreeRTOS is not accessible to application code. However, if
+ * the application writer wants to statically allocate the memory required to
+ * create an event group then the size of the event group object needs to be
+ * know. The StaticEventGroup_t structure below is provided for this purpose.
+ * Its sizes and alignment requirements are guaranteed to match those of the
+ * genuine structure, no matter which architecture is being used, and no matter
+ * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
+ * obfuscated in the hope users will recognise that it would be unwise to make
+ * direct use of the structure members.
+ */
+typedef struct xSTATIC_EVENT_GROUP
+{
+ TickType_t xDummy1;
+ StaticList_t xDummy2;
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxDummy3;
+ #endif
+
+ #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ uint8_t ucDummy4;
+ #endif
+} StaticEventGroup_t;
+
+/*
+ * In line with software engineering best practice, especially when supplying a
+ * library that is likely to change in future versions, FreeRTOS implements a
+ * strict data hiding policy. This means the software timer structure used
+ * internally by FreeRTOS is not accessible to application code. However, if
+ * the application writer wants to statically allocate the memory required to
+ * create a software timer then the size of the queue object needs to be known.
+ * The StaticTimer_t structure below is provided for this purpose. Its sizes
+ * and alignment requirements are guaranteed to match those of the genuine
+ * structure, no matter which architecture is being used, and no matter how the
+ * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in
+ * the hope users will recognise that it would be unwise to make direct use of
+ * the structure members.
+ */
+typedef struct xSTATIC_TIMER
+{
+ void * pvDummy1;
+ StaticListItem_t xDummy2;
+ TickType_t xDummy3;
+ void * pvDummy5;
+ TaskFunction_t pvDummy6;
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxDummy7;
+ #endif
+ uint8_t ucDummy8;
+} StaticTimer_t;
+
+/*
+ * In line with software engineering best practice, especially when supplying a
+ * library that is likely to change in future versions, FreeRTOS implements a
+ * strict data hiding policy. This means the stream buffer structure used
+ * internally by FreeRTOS is not accessible to application code. However, if
+ * the application writer wants to statically allocate the memory required to
+ * create a stream buffer then the size of the stream buffer object needs to be
+ * known. The StaticStreamBuffer_t structure below is provided for this
+ * purpose. Its size and alignment requirements are guaranteed to match those
+ * of the genuine structure, no matter which architecture is being used, and
+ * no matter how the values in FreeRTOSConfig.h are set. Its contents are
+ * somewhat obfuscated in the hope users will recognise that it would be unwise
+ * to make direct use of the structure members.
+ */
+typedef struct xSTATIC_STREAM_BUFFER
+{
+ size_t uxDummy1[ 4 ];
+ void * pvDummy2[ 3 ];
+ uint8_t ucDummy3;
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxDummy4;
+ #endif
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ void * pvDummy5[ 2 ];
+ #endif
+} StaticStreamBuffer_t;
+
+/* Message buffers are built on stream buffers. */
+typedef StaticStreamBuffer_t StaticMessageBuffer_t;
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* INC_FREERTOS_H */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/StackMacros.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/StackMacros.h
similarity index 86%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/StackMacros.h
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/StackMacros.h
index 0f37c4d..6ec5063 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/StackMacros.h
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/StackMacros.h
@@ -1,32 +1,34 @@
-/*
- * FreeRTOS Kernel V10.4.3 LTS Patch 2
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
-
-
-#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
- #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
-#endif
-
-#include "stack_macros.h"
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
+ #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in a future release.
+#endif
+
+#include "stack_macros.h"
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/atomic.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/atomic.h
new file mode 100644
index 0000000..a7866ed
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/atomic.h
@@ -0,0 +1,419 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/**
+ * @file atomic.h
+ * @brief FreeRTOS atomic operation support.
+ *
+ * This file implements atomic functions by disabling interrupts globally.
+ * Implementations with architecture specific atomic instructions can be
+ * provided under each compiler directory.
+ */
+
+#ifndef ATOMIC_H
+#define ATOMIC_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include atomic.h"
+#endif
+
+/* Standard includes. */
+#include
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/*
+ * Port specific definitions -- entering/exiting critical section.
+ * Refer template -- ./lib/FreeRTOS/portable/Compiler/Arch/portmacro.h
+ *
+ * Every call to ATOMIC_EXIT_CRITICAL() must be closely paired with
+ * ATOMIC_ENTER_CRITICAL().
+ *
+ */
+#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
+
+/* Nested interrupt scheme is supported in this port. */
+ #define ATOMIC_ENTER_CRITICAL() \
+ UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
+
+ #define ATOMIC_EXIT_CRITICAL() \
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
+
+#else
+
+/* Nested interrupt scheme is NOT supported in this port. */
+ #define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
+ #define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
+
+#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
+
+/*
+ * Port specific definition -- "always inline".
+ * Inline is compiler specific, and may not always get inlined depending on your
+ * optimization level. Also, inline is considered as performance optimization
+ * for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
+ * instead of resulting error, simply define it away.
+ */
+#ifndef portFORCE_INLINE
+ #define portFORCE_INLINE
+#endif
+
+#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
+#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
+
+/*----------------------------- Swap && CAS ------------------------------*/
+
+/**
+ * Atomic compare-and-swap
+ *
+ * @brief Performs an atomic compare-and-swap operation on the specified values.
+ *
+ * @param[in, out] pulDestination Pointer to memory location from where value is
+ * to be loaded and checked.
+ * @param[in] ulExchange If condition meets, write this value to memory.
+ * @param[in] ulComparand Swap condition.
+ *
+ * @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
+ *
+ * @note This function only swaps *pulDestination with ulExchange, if previous
+ * *pulDestination value equals ulComparand.
+ */
+static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
+ uint32_t ulExchange,
+ uint32_t ulComparand )
+{
+ uint32_t ulReturnValue;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ if( *pulDestination == ulComparand )
+ {
+ *pulDestination = ulExchange;
+ ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
+ }
+ else
+ {
+ ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
+ }
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulReturnValue;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic swap (pointers)
+ *
+ * @brief Atomically sets the address pointed to by *ppvDestination to the value
+ * of *pvExchange.
+ *
+ * @param[in, out] ppvDestination Pointer to memory location from where a pointer
+ * value is to be loaded and written back to.
+ * @param[in] pvExchange Pointer value to be written to *ppvDestination.
+ *
+ * @return The initial value of *ppvDestination.
+ */
+static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
+ void * pvExchange )
+{
+ void * pReturnValue;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ pReturnValue = *ppvDestination;
+ *ppvDestination = pvExchange;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return pReturnValue;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic compare-and-swap (pointers)
+ *
+ * @brief Performs an atomic compare-and-swap operation on the specified pointer
+ * values.
+ *
+ * @param[in, out] ppvDestination Pointer to memory location from where a pointer
+ * value is to be loaded and checked.
+ * @param[in] pvExchange If condition meets, write this value to memory.
+ * @param[in] pvComparand Swap condition.
+ *
+ * @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
+ *
+ * @note This function only swaps *ppvDestination with pvExchange, if previous
+ * *ppvDestination value equals pvComparand.
+ */
+static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
+ void * pvExchange,
+ void * pvComparand )
+{
+ uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ if( *ppvDestination == pvComparand )
+ {
+ *ppvDestination = pvExchange;
+ ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
+ }
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulReturnValue;
+}
+
+
+/*----------------------------- Arithmetic ------------------------------*/
+
+/**
+ * Atomic add
+ *
+ * @brief Atomically adds count to the value of the specified pointer points to.
+ *
+ * @param[in,out] pulAddend Pointer to memory location from where value is to be
+ * loaded and written back to.
+ * @param[in] ulCount Value to be added to *pulAddend.
+ *
+ * @return previous *pulAddend value.
+ */
+static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
+ uint32_t ulCount )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulAddend;
+ *pulAddend += ulCount;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic subtract
+ *
+ * @brief Atomically subtracts count from the value of the specified pointer
+ * pointers to.
+ *
+ * @param[in,out] pulAddend Pointer to memory location from where value is to be
+ * loaded and written back to.
+ * @param[in] ulCount Value to be subtract from *pulAddend.
+ *
+ * @return previous *pulAddend value.
+ */
+static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
+ uint32_t ulCount )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulAddend;
+ *pulAddend -= ulCount;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic increment
+ *
+ * @brief Atomically increments the value of the specified pointer points to.
+ *
+ * @param[in,out] pulAddend Pointer to memory location from where value is to be
+ * loaded and written back to.
+ *
+ * @return *pulAddend value before increment.
+ */
+static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulAddend;
+ *pulAddend += 1;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic decrement
+ *
+ * @brief Atomically decrements the value of the specified pointer points to
+ *
+ * @param[in,out] pulAddend Pointer to memory location from where value is to be
+ * loaded and written back to.
+ *
+ * @return *pulAddend value before decrement.
+ */
+static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulAddend;
+ *pulAddend -= 1;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+
+/*----------------------------- Bitwise Logical ------------------------------*/
+
+/**
+ * Atomic OR
+ *
+ * @brief Performs an atomic OR operation on the specified values.
+ *
+ * @param [in, out] pulDestination Pointer to memory location from where value is
+ * to be loaded and written back to.
+ * @param [in] ulValue Value to be ORed with *pulDestination.
+ *
+ * @return The original value of *pulDestination.
+ */
+static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
+ uint32_t ulValue )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulDestination;
+ *pulDestination |= ulValue;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic AND
+ *
+ * @brief Performs an atomic AND operation on the specified values.
+ *
+ * @param [in, out] pulDestination Pointer to memory location from where value is
+ * to be loaded and written back to.
+ * @param [in] ulValue Value to be ANDed with *pulDestination.
+ *
+ * @return The original value of *pulDestination.
+ */
+static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
+ uint32_t ulValue )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulDestination;
+ *pulDestination &= ulValue;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic NAND
+ *
+ * @brief Performs an atomic NAND operation on the specified values.
+ *
+ * @param [in, out] pulDestination Pointer to memory location from where value is
+ * to be loaded and written back to.
+ * @param [in] ulValue Value to be NANDed with *pulDestination.
+ *
+ * @return The original value of *pulDestination.
+ */
+static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
+ uint32_t ulValue )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulDestination;
+ *pulDestination = ~( ulCurrent & ulValue );
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+/*-----------------------------------------------------------*/
+
+/**
+ * Atomic XOR
+ *
+ * @brief Performs an atomic XOR operation on the specified values.
+ *
+ * @param [in, out] pulDestination Pointer to memory location from where value is
+ * to be loaded and written back to.
+ * @param [in] ulValue Value to be XORed with *pulDestination.
+ *
+ * @return The original value of *pulDestination.
+ */
+static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
+ uint32_t ulValue )
+{
+ uint32_t ulCurrent;
+
+ ATOMIC_ENTER_CRITICAL();
+ {
+ ulCurrent = *pulDestination;
+ *pulDestination ^= ulValue;
+ }
+ ATOMIC_EXIT_CRITICAL();
+
+ return ulCurrent;
+}
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* ATOMIC_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/croutine.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/croutine.h
new file mode 100644
index 0000000..4edf47b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/croutine.h
@@ -0,0 +1,753 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef CO_ROUTINE_H
+#define CO_ROUTINE_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include croutine.h"
+#endif
+
+#include "list.h"
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/* Used to hide the implementation of the co-routine control block. The
+ * control block structure however has to be included in the header due to
+ * the macro implementation of the co-routine functionality. */
+typedef void * CoRoutineHandle_t;
+
+/* Defines the prototype to which co-routine functions must conform. */
+typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
+ UBaseType_t );
+
+typedef struct corCoRoutineControlBlock
+{
+ crCOROUTINE_CODE pxCoRoutineFunction;
+ ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
+ ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */
+ UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
+ UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
+ uint16_t uxState; /*< Used internally by the co-routine implementation. */
+} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */
+
+/**
+ * croutine. h
+ * @code{c}
+ * BaseType_t xCoRoutineCreate(
+ * crCOROUTINE_CODE pxCoRoutineCode,
+ * UBaseType_t uxPriority,
+ * UBaseType_t uxIndex
+ * );
+ * @endcode
+ *
+ * Create a new co-routine and add it to the list of co-routines that are
+ * ready to run.
+ *
+ * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine
+ * functions require special syntax - see the co-routine section of the WEB
+ * documentation for more information.
+ *
+ * @param uxPriority The priority with respect to other co-routines at which
+ * the co-routine will run.
+ *
+ * @param uxIndex Used to distinguish between different co-routines that
+ * execute the same function. See the example below and the co-routine section
+ * of the WEB documentation for further information.
+ *
+ * @return pdPASS if the co-routine was successfully created and added to a ready
+ * list, otherwise an error code defined with ProjDefs.h.
+ *
+ * Example usage:
+ * @code{c}
+ * // Co-routine to be created.
+ * void vFlashCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * // This may not be necessary for const variables.
+ * static const char cLedToFlash[ 2 ] = { 5, 6 };
+ * static const TickType_t uxFlashRates[ 2 ] = { 200, 400 };
+ *
+ * // Must start every co-routine with a call to crSTART();
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // This co-routine just delays for a fixed period, then toggles
+ * // an LED. Two co-routines are created using this function, so
+ * // the uxIndex parameter is used to tell the co-routine which
+ * // LED to flash and how int32_t to delay. This assumes xQueue has
+ * // already been created.
+ * vParTestToggleLED( cLedToFlash[ uxIndex ] );
+ * crDELAY( xHandle, uxFlashRates[ uxIndex ] );
+ * }
+ *
+ * // Must end every co-routine with a call to crEND();
+ * crEND();
+ * }
+ *
+ * // Function that creates two co-routines.
+ * void vOtherFunction( void )
+ * {
+ * uint8_t ucParameterToPass;
+ * TaskHandle_t xHandle;
+ *
+ * // Create two co-routines at priority 0. The first is given index 0
+ * // so (from the code above) toggles LED 5 every 200 ticks. The second
+ * // is given index 1 so toggles LED 6 every 400 ticks.
+ * for( uxIndex = 0; uxIndex < 2; uxIndex++ )
+ * {
+ * xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );
+ * }
+ * }
+ * @endcode
+ * \defgroup xCoRoutineCreate xCoRoutineCreate
+ * \ingroup Tasks
+ */
+BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
+ UBaseType_t uxPriority,
+ UBaseType_t uxIndex );
+
+
+/**
+ * croutine. h
+ * @code{c}
+ * void vCoRoutineSchedule( void );
+ * @endcode
+ *
+ * Run a co-routine.
+ *
+ * vCoRoutineSchedule() executes the highest priority co-routine that is able
+ * to run. The co-routine will execute until it either blocks, yields or is
+ * preempted by a task. Co-routines execute cooperatively so one
+ * co-routine cannot be preempted by another, but can be preempted by a task.
+ *
+ * If an application comprises of both tasks and co-routines then
+ * vCoRoutineSchedule should be called from the idle task (in an idle task
+ * hook).
+ *
+ * Example usage:
+ * @code{c}
+ * // This idle task hook will schedule a co-routine each time it is called.
+ * // The rest of the idle task will execute between co-routine calls.
+ * void vApplicationIdleHook( void )
+ * {
+ * vCoRoutineSchedule();
+ * }
+ *
+ * // Alternatively, if you do not require any other part of the idle task to
+ * // execute, the idle task hook can call vCoRoutineSchedule() within an
+ * // infinite loop.
+ * void vApplicationIdleHook( void )
+ * {
+ * for( ;; )
+ * {
+ * vCoRoutineSchedule();
+ * }
+ * }
+ * @endcode
+ * \defgroup vCoRoutineSchedule vCoRoutineSchedule
+ * \ingroup Tasks
+ */
+void vCoRoutineSchedule( void );
+
+/**
+ * croutine. h
+ * @code{c}
+ * crSTART( CoRoutineHandle_t xHandle );
+ * @endcode
+ *
+ * This macro MUST always be called at the start of a co-routine function.
+ *
+ * Example usage:
+ * @code{c}
+ * // Co-routine to be created.
+ * void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * static int32_t ulAVariable;
+ *
+ * // Must start every co-routine with a call to crSTART();
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Co-routine functionality goes here.
+ * }
+ *
+ * // Must end every co-routine with a call to crEND();
+ * crEND();
+ * }
+ * @endcode
+ * \defgroup crSTART crSTART
+ * \ingroup Tasks
+ */
+#define crSTART( pxCRCB ) \
+ switch( ( ( CRCB_t * ) ( pxCRCB ) )->uxState ) { \
+ case 0:
+
+/**
+ * croutine. h
+ * @code{c}
+ * crEND();
+ * @endcode
+ *
+ * This macro MUST always be called at the end of a co-routine function.
+ *
+ * Example usage:
+ * @code{c}
+ * // Co-routine to be created.
+ * void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * static int32_t ulAVariable;
+ *
+ * // Must start every co-routine with a call to crSTART();
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Co-routine functionality goes here.
+ * }
+ *
+ * // Must end every co-routine with a call to crEND();
+ * crEND();
+ * }
+ * @endcode
+ * \defgroup crSTART crSTART
+ * \ingroup Tasks
+ */
+#define crEND() }
+
+/*
+ * These macros are intended for internal use by the co-routine implementation
+ * only. The macros should not be used directly by application writers.
+ */
+#define crSET_STATE0( xHandle ) \
+ ( ( CRCB_t * ) ( xHandle ) )->uxState = ( __LINE__ * 2 ); return; \
+ case ( __LINE__ * 2 ):
+#define crSET_STATE1( xHandle ) \
+ ( ( CRCB_t * ) ( xHandle ) )->uxState = ( ( __LINE__ * 2 ) + 1 ); return; \
+ case ( ( __LINE__ * 2 ) + 1 ):
+
+/**
+ * croutine. h
+ * @code{c}
+ * crDELAY( CoRoutineHandle_t xHandle, TickType_t xTicksToDelay );
+ * @endcode
+ *
+ * Delay a co-routine for a fixed period of time.
+ *
+ * crDELAY can only be called from the co-routine function itself - not
+ * from within a function called by the co-routine function. This is because
+ * co-routines do not maintain their own stack.
+ *
+ * @param xHandle The handle of the co-routine to delay. This is the xHandle
+ * parameter of the co-routine function.
+ *
+ * @param xTickToDelay The number of ticks that the co-routine should delay
+ * for. The actual amount of time this equates to is defined by
+ * configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant portTICK_PERIOD_MS
+ * can be used to convert ticks to milliseconds.
+ *
+ * Example usage:
+ * @code{c}
+ * // Co-routine to be created.
+ * void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * // This may not be necessary for const variables.
+ * // We are to delay for 200ms.
+ * static const xTickType xDelayTime = 200 / portTICK_PERIOD_MS;
+ *
+ * // Must start every co-routine with a call to crSTART();
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Delay for 200ms.
+ * crDELAY( xHandle, xDelayTime );
+ *
+ * // Do something here.
+ * }
+ *
+ * // Must end every co-routine with a call to crEND();
+ * crEND();
+ * }
+ * @endcode
+ * \defgroup crDELAY crDELAY
+ * \ingroup Tasks
+ */
+#define crDELAY( xHandle, xTicksToDelay ) \
+ if( ( xTicksToDelay ) > 0 ) \
+ { \
+ vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
+ } \
+ crSET_STATE0( ( xHandle ) );
+
+/**
+ * @code{c}
+ * crQUEUE_SEND(
+ * CoRoutineHandle_t xHandle,
+ * QueueHandle_t pxQueue,
+ * void *pvItemToQueue,
+ * TickType_t xTicksToWait,
+ * BaseType_t *pxResult
+ * )
+ * @endcode
+ *
+ * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
+ * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
+ *
+ * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas
+ * xQueueSend() and xQueueReceive() can only be used from tasks.
+ *
+ * crQUEUE_SEND can only be called from the co-routine function itself - not
+ * from within a function called by the co-routine function. This is because
+ * co-routines do not maintain their own stack.
+ *
+ * See the co-routine section of the WEB documentation for information on
+ * passing data between tasks and co-routines and between ISR's and
+ * co-routines.
+ *
+ * @param xHandle The handle of the calling co-routine. This is the xHandle
+ * parameter of the co-routine function.
+ *
+ * @param pxQueue The handle of the queue on which the data will be posted.
+ * The handle is obtained as the return value when the queue is created using
+ * the xQueueCreate() API function.
+ *
+ * @param pvItemToQueue A pointer to the data being posted onto the queue.
+ * The number of bytes of each queued item is specified when the queue is
+ * created. This number of bytes is copied from pvItemToQueue into the queue
+ * itself.
+ *
+ * @param xTickToDelay The number of ticks that the co-routine should block
+ * to wait for space to become available on the queue, should space not be
+ * available immediately. The actual amount of time this equates to is defined
+ * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
+ * portTICK_PERIOD_MS can be used to convert ticks to milliseconds (see example
+ * below).
+ *
+ * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
+ * data was successfully posted onto the queue, otherwise it will be set to an
+ * error defined within ProjDefs.h.
+ *
+ * Example usage:
+ * @code{c}
+ * // Co-routine function that blocks for a fixed period then posts a number onto
+ * // a queue.
+ * static void prvCoRoutineFlashTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * static BaseType_t xNumberToPost = 0;
+ * static BaseType_t xResult;
+ *
+ * // Co-routines must begin with a call to crSTART().
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // This assumes the queue has already been created.
+ * crQUEUE_SEND( xHandle, xCoRoutineQueue, &xNumberToPost, NO_DELAY, &xResult );
+ *
+ * if( xResult != pdPASS )
+ * {
+ * // The message was not posted!
+ * }
+ *
+ * // Increment the number to be posted onto the queue.
+ * xNumberToPost++;
+ *
+ * // Delay for 100 ticks.
+ * crDELAY( xHandle, 100 );
+ * }
+ *
+ * // Co-routines must end with a call to crEND().
+ * crEND();
+ * }
+ * @endcode
+ * \defgroup crQUEUE_SEND crQUEUE_SEND
+ * \ingroup Tasks
+ */
+#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
+ { \
+ *( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
+ if( *( pxResult ) == errQUEUE_BLOCKED ) \
+ { \
+ crSET_STATE0( ( xHandle ) ); \
+ *pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \
+ } \
+ if( *pxResult == errQUEUE_YIELD ) \
+ { \
+ crSET_STATE1( ( xHandle ) ); \
+ *pxResult = pdPASS; \
+ } \
+ }
+
+/**
+ * croutine. h
+ * @code{c}
+ * crQUEUE_RECEIVE(
+ * CoRoutineHandle_t xHandle,
+ * QueueHandle_t pxQueue,
+ * void *pvBuffer,
+ * TickType_t xTicksToWait,
+ * BaseType_t *pxResult
+ * )
+ * @endcode
+ *
+ * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
+ * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
+ *
+ * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas
+ * xQueueSend() and xQueueReceive() can only be used from tasks.
+ *
+ * crQUEUE_RECEIVE can only be called from the co-routine function itself - not
+ * from within a function called by the co-routine function. This is because
+ * co-routines do not maintain their own stack.
+ *
+ * See the co-routine section of the WEB documentation for information on
+ * passing data between tasks and co-routines and between ISR's and
+ * co-routines.
+ *
+ * @param xHandle The handle of the calling co-routine. This is the xHandle
+ * parameter of the co-routine function.
+ *
+ * @param pxQueue The handle of the queue from which the data will be received.
+ * The handle is obtained as the return value when the queue is created using
+ * the xQueueCreate() API function.
+ *
+ * @param pvBuffer The buffer into which the received item is to be copied.
+ * The number of bytes of each queued item is specified when the queue is
+ * created. This number of bytes is copied into pvBuffer.
+ *
+ * @param xTickToDelay The number of ticks that the co-routine should block
+ * to wait for data to become available from the queue, should data not be
+ * available immediately. The actual amount of time this equates to is defined
+ * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
+ * portTICK_PERIOD_MS can be used to convert ticks to milliseconds (see the
+ * crQUEUE_SEND example).
+ *
+ * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
+ * data was successfully retrieved from the queue, otherwise it will be set to
+ * an error code as defined within ProjDefs.h.
+ *
+ * Example usage:
+ * @code{c}
+ * // A co-routine receives the number of an LED to flash from a queue. It
+ * // blocks on the queue until the number is received.
+ * static void prvCoRoutineFlashWorkTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // Variables in co-routines must be declared static if they must maintain value across a blocking call.
+ * static BaseType_t xResult;
+ * static UBaseType_t uxLEDToFlash;
+ *
+ * // All co-routines must start with a call to crSTART().
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Wait for data to become available on the queue.
+ * crQUEUE_RECEIVE( xHandle, xCoRoutineQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
+ *
+ * if( xResult == pdPASS )
+ * {
+ * // We received the LED to flash - flash it!
+ * vParTestToggleLED( uxLEDToFlash );
+ * }
+ * }
+ *
+ * crEND();
+ * }
+ * @endcode
+ * \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
+ * \ingroup Tasks
+ */
+#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
+ { \
+ *( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
+ if( *( pxResult ) == errQUEUE_BLOCKED ) \
+ { \
+ crSET_STATE0( ( xHandle ) ); \
+ *( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), 0 ); \
+ } \
+ if( *( pxResult ) == errQUEUE_YIELD ) \
+ { \
+ crSET_STATE1( ( xHandle ) ); \
+ *( pxResult ) = pdPASS; \
+ } \
+ }
+
+/**
+ * croutine. h
+ * @code{c}
+ * crQUEUE_SEND_FROM_ISR(
+ * QueueHandle_t pxQueue,
+ * void *pvItemToQueue,
+ * BaseType_t xCoRoutinePreviouslyWoken
+ * )
+ * @endcode
+ *
+ * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
+ * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
+ * functions used by tasks.
+ *
+ * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
+ * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
+ * xQueueReceiveFromISR() can only be used to pass data between a task and and
+ * ISR.
+ *
+ * crQUEUE_SEND_FROM_ISR can only be called from an ISR to send data to a queue
+ * that is being used from within a co-routine.
+ *
+ * See the co-routine section of the WEB documentation for information on
+ * passing data between tasks and co-routines and between ISR's and
+ * co-routines.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param xCoRoutinePreviouslyWoken This is included so an ISR can post onto
+ * the same queue multiple times from a single interrupt. The first call
+ * should always pass in pdFALSE. Subsequent calls should pass in
+ * the value returned from the previous call.
+ *
+ * @return pdTRUE if a co-routine was woken by posting onto the queue. This is
+ * used by the ISR to determine if a context switch may be required following
+ * the ISR.
+ *
+ * Example usage:
+ * @code{c}
+ * // A co-routine that blocks on a queue waiting for characters to be received.
+ * static void vReceivingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * char cRxedChar;
+ * BaseType_t xResult;
+ *
+ * // All co-routines must start with a call to crSTART().
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Wait for data to become available on the queue. This assumes the
+ * // queue xCommsRxQueue has already been created!
+ * crQUEUE_RECEIVE( xHandle, xCommsRxQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );
+ *
+ * // Was a character received?
+ * if( xResult == pdPASS )
+ * {
+ * // Process the character here.
+ * }
+ * }
+ *
+ * // All co-routines must end with a call to crEND().
+ * crEND();
+ * }
+ *
+ * // An ISR that uses a queue to send characters received on a serial port to
+ * // a co-routine.
+ * void vUART_ISR( void )
+ * {
+ * char cRxedChar;
+ * BaseType_t xCRWokenByPost = pdFALSE;
+ *
+ * // We loop around reading characters until there are none left in the UART.
+ * while( UART_RX_REG_NOT_EMPTY() )
+ * {
+ * // Obtain the character from the UART.
+ * cRxedChar = UART_RX_REG;
+ *
+ * // Post the character onto a queue. xCRWokenByPost will be pdFALSE
+ * // the first time around the loop. If the post causes a co-routine
+ * // to be woken (unblocked) then xCRWokenByPost will be set to pdTRUE.
+ * // In this manner we can ensure that if more than one co-routine is
+ * // blocked on the queue only one is woken by this ISR no matter how
+ * // many characters are posted to the queue.
+ * xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
+ * }
+ * }
+ * @endcode
+ * \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
+ * \ingroup Tasks
+ */
+#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) \
+ xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )
+
+
+/**
+ * croutine. h
+ * @code{c}
+ * crQUEUE_SEND_FROM_ISR(
+ * QueueHandle_t pxQueue,
+ * void *pvBuffer,
+ * BaseType_t * pxCoRoutineWoken
+ * )
+ * @endcode
+ *
+ * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
+ * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
+ * functions used by tasks.
+ *
+ * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
+ * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
+ * xQueueReceiveFromISR() can only be used to pass data between a task and and
+ * ISR.
+ *
+ * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data
+ * from a queue that is being used from within a co-routine (a co-routine
+ * posted to the queue).
+ *
+ * See the co-routine section of the WEB documentation for information on
+ * passing data between tasks and co-routines and between ISR's and
+ * co-routines.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvBuffer A pointer to a buffer into which the received item will be
+ * placed. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from the queue into
+ * pvBuffer.
+ *
+ * @param pxCoRoutineWoken A co-routine may be blocked waiting for space to become
+ * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a
+ * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise
+ * *pxCoRoutineWoken will remain unchanged.
+ *
+ * @return pdTRUE an item was successfully received from the queue, otherwise
+ * pdFALSE.
+ *
+ * Example usage:
+ * @code{c}
+ * // A co-routine that posts a character to a queue then blocks for a fixed
+ * // period. The character is incremented each time.
+ * static void vSendingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
+ * {
+ * // cChar holds its value while this co-routine is blocked and must therefore
+ * // be declared static.
+ * static char cCharToTx = 'a';
+ * BaseType_t xResult;
+ *
+ * // All co-routines must start with a call to crSTART().
+ * crSTART( xHandle );
+ *
+ * for( ;; )
+ * {
+ * // Send the next character to the queue.
+ * crQUEUE_SEND( xHandle, xCoRoutineQueue, &cCharToTx, NO_DELAY, &xResult );
+ *
+ * if( xResult == pdPASS )
+ * {
+ * // The character was successfully posted to the queue.
+ * }
+ * else
+ * {
+ * // Could not post the character to the queue.
+ * }
+ *
+ * // Enable the UART Tx interrupt to cause an interrupt in this
+ * // hypothetical UART. The interrupt will obtain the character
+ * // from the queue and send it.
+ * ENABLE_RX_INTERRUPT();
+ *
+ * // Increment to the next character then block for a fixed period.
+ * // cCharToTx will maintain its value across the delay as it is
+ * // declared static.
+ * cCharToTx++;
+ * if( cCharToTx > 'x' )
+ * {
+ * cCharToTx = 'a';
+ * }
+ * crDELAY( 100 );
+ * }
+ *
+ * // All co-routines must end with a call to crEND().
+ * crEND();
+ * }
+ *
+ * // An ISR that uses a queue to receive characters to send on a UART.
+ * void vUART_ISR( void )
+ * {
+ * char cCharToTx;
+ * BaseType_t xCRWokenByPost = pdFALSE;
+ *
+ * while( UART_TX_REG_EMPTY() )
+ * {
+ * // Are there any characters in the queue waiting to be sent?
+ * // xCRWokenByPost will automatically be set to pdTRUE if a co-routine
+ * // is woken by the post - ensuring that only a single co-routine is
+ * // woken no matter how many times we go around this loop.
+ * if( crQUEUE_RECEIVE_FROM_ISR( pxQueue, &cCharToTx, &xCRWokenByPost ) )
+ * {
+ * SEND_CHARACTER( cCharToTx );
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
+ * \ingroup Tasks
+ */
+#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) \
+ xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )
+
+/*
+ * This function is intended for internal use by the co-routine macros only.
+ * The macro nature of the co-routine implementation requires that the
+ * prototype appears here. The function should not be used by application
+ * writers.
+ *
+ * Removes the current co-routine from its ready list and places it in the
+ * appropriate delayed list.
+ */
+void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
+ List_t * pxEventList );
+
+/*
+ * This function is intended for internal use by the queue implementation only.
+ * The function should not be used by application writers.
+ *
+ * Removes the highest priority co-routine from the event list and places it in
+ * the pending ready list.
+ */
+BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* CO_ROUTINE_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/deprecated_definitions.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/deprecated_definitions.h
new file mode 100644
index 0000000..6ca125b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/deprecated_definitions.h
@@ -0,0 +1,281 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef DEPRECATED_DEFINITIONS_H
+#define DEPRECATED_DEFINITIONS_H
+
+
+/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
+ * pre-processor definition was used to ensure the pre-processor found the correct
+ * portmacro.h file for the port being used. That scheme was deprecated in favour
+ * of setting the compiler's include path such that it found the correct
+ * portmacro.h file - removing the need for the constant and allowing the
+ * portmacro.h file to be located anywhere in relation to the port being used. The
+ * definitions below remain in the code for backward compatibility only. New
+ * projects should not use them. */
+
+#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
+ #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
+ typedef void ( __interrupt __far * pxISR )();
+#endif
+
+#ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
+ #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
+ typedef void ( __interrupt __far * pxISR )();
+#endif
+
+#ifdef GCC_MEGA_AVR
+ #include "../portable/GCC/ATMega323/portmacro.h"
+#endif
+
+#ifdef IAR_MEGA_AVR
+ #include "../portable/IAR/ATMega323/portmacro.h"
+#endif
+
+#ifdef MPLAB_PIC24_PORT
+ #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
+#endif
+
+#ifdef MPLAB_DSPIC_PORT
+ #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
+#endif
+
+#ifdef MPLAB_PIC18F_PORT
+ #include "../../Source/portable/MPLAB/PIC18F/portmacro.h"
+#endif
+
+#ifdef MPLAB_PIC32MX_PORT
+ #include "../../Source/portable/MPLAB/PIC32MX/portmacro.h"
+#endif
+
+#ifdef _FEDPICC
+ #include "libFreeRTOS/Include/portmacro.h"
+#endif
+
+#ifdef SDCC_CYGNAL
+ #include "../../Source/portable/SDCC/Cygnal/portmacro.h"
+#endif
+
+#ifdef GCC_ARM7
+ #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
+#endif
+
+#ifdef GCC_ARM7_ECLIPSE
+ #include "portmacro.h"
+#endif
+
+#ifdef ROWLEY_LPC23xx
+ #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
+#endif
+
+#ifdef IAR_MSP430
+ #include "..\..\Source\portable\IAR\MSP430\portmacro.h"
+#endif
+
+#ifdef GCC_MSP430
+ #include "../../Source/portable/GCC/MSP430F449/portmacro.h"
+#endif
+
+#ifdef ROWLEY_MSP430
+ #include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
+#endif
+
+#ifdef ARM7_LPC21xx_KEIL_RVDS
+ #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
+#endif
+
+#ifdef SAM7_GCC
+ #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
+#endif
+
+#ifdef SAM7_IAR
+ #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
+#endif
+
+#ifdef SAM9XE_IAR
+ #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
+#endif
+
+#ifdef LPC2000_IAR
+ #include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
+#endif
+
+#ifdef STR71X_IAR
+ #include "..\..\Source\portable\IAR\STR71x\portmacro.h"
+#endif
+
+#ifdef STR75X_IAR
+ #include "..\..\Source\portable\IAR\STR75x\portmacro.h"
+#endif
+
+#ifdef STR75X_GCC
+ #include "..\..\Source\portable\GCC\STR75x\portmacro.h"
+#endif
+
+#ifdef STR91X_IAR
+ #include "..\..\Source\portable\IAR\STR91x\portmacro.h"
+#endif
+
+#ifdef GCC_H8S
+ #include "../../Source/portable/GCC/H8S2329/portmacro.h"
+#endif
+
+#ifdef GCC_AT91FR40008
+ #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
+#endif
+
+#ifdef RVDS_ARMCM3_LM3S102
+ #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
+#endif
+
+#ifdef GCC_ARMCM3_LM3S102
+ #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
+#endif
+
+#ifdef GCC_ARMCM3
+ #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
+#endif
+
+#ifdef IAR_ARM_CM3
+ #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
+#endif
+
+#ifdef IAR_ARMCM3_LM
+ #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
+#endif
+
+#ifdef HCS12_CODE_WARRIOR
+ #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
+#endif
+
+#ifdef MICROBLAZE_GCC
+ #include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
+#endif
+
+#ifdef TERN_EE
+ #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
+#endif
+
+#ifdef GCC_HCS12
+ #include "../../Source/portable/GCC/HCS12/portmacro.h"
+#endif
+
+#ifdef GCC_MCF5235
+ #include "../../Source/portable/GCC/MCF5235/portmacro.h"
+#endif
+
+#ifdef COLDFIRE_V2_GCC
+ #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
+#endif
+
+#ifdef COLDFIRE_V2_CODEWARRIOR
+ #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
+#endif
+
+#ifdef GCC_PPC405
+ #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
+#endif
+
+#ifdef GCC_PPC440
+ #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
+#endif
+
+#ifdef _16FX_SOFTUNE
+ #include "..\..\Source\portable\Softune\MB96340\portmacro.h"
+#endif
+
+#ifdef BCC_INDUSTRIAL_PC_PORT
+
+/* A short file name has to be used in place of the normal
+ * FreeRTOSConfig.h when using the Borland compiler. */
+ #include "frconfig.h"
+ #include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
+ typedef void ( __interrupt __far * pxISR )();
+#endif
+
+#ifdef BCC_FLASH_LITE_186_PORT
+
+/* A short file name has to be used in place of the normal
+ * FreeRTOSConfig.h when using the Borland compiler. */
+ #include "frconfig.h"
+ #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
+ typedef void ( __interrupt __far * pxISR )();
+#endif
+
+#ifdef __GNUC__
+ #ifdef __AVR32_AVR32A__
+ #include "portmacro.h"
+ #endif
+#endif
+
+#ifdef __ICCAVR32__
+ #ifdef __CORE__
+ #if __CORE__ == __AVR32A__
+ #include "portmacro.h"
+ #endif
+ #endif
+#endif
+
+#ifdef __91467D
+ #include "portmacro.h"
+#endif
+
+#ifdef __96340
+ #include "portmacro.h"
+#endif
+
+
+#ifdef __IAR_V850ES_Fx3__
+ #include "../../Source/portable/IAR/V850ES/portmacro.h"
+#endif
+
+#ifdef __IAR_V850ES_Jx3__
+ #include "../../Source/portable/IAR/V850ES/portmacro.h"
+#endif
+
+#ifdef __IAR_V850ES_Jx3_L__
+ #include "../../Source/portable/IAR/V850ES/portmacro.h"
+#endif
+
+#ifdef __IAR_V850ES_Jx2__
+ #include "../../Source/portable/IAR/V850ES/portmacro.h"
+#endif
+
+#ifdef __IAR_V850ES_Hx2__
+ #include "../../Source/portable/IAR/V850ES/portmacro.h"
+#endif
+
+#ifdef __IAR_78K0R_Kx3__
+ #include "../../Source/portable/IAR/78K0R/portmacro.h"
+#endif
+
+#ifdef __IAR_78K0R_Kx3L__
+ #include "../../Source/portable/IAR/78K0R/portmacro.h"
+#endif
+
+#endif /* DEPRECATED_DEFINITIONS_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/event_groups.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/event_groups.h
new file mode 100644
index 0000000..275f316
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/event_groups.h
@@ -0,0 +1,783 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef EVENT_GROUPS_H
+#define EVENT_GROUPS_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
+#endif
+
+/* FreeRTOS includes. */
+#include "timers.h"
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/**
+ * An event group is a collection of bits to which an application can assign a
+ * meaning. For example, an application may create an event group to convey
+ * the status of various CAN bus related events in which bit 0 might mean "A CAN
+ * message has been received and is ready for processing", bit 1 might mean "The
+ * application has queued a message that is ready for sending onto the CAN
+ * network", and bit 2 might mean "It is time to send a SYNC message onto the
+ * CAN network" etc. A task can then test the bit values to see which events
+ * are active, and optionally enter the Blocked state to wait for a specified
+ * bit or a group of specified bits to be active. To continue the CAN bus
+ * example, a CAN controlling task can enter the Blocked state (and therefore
+ * not consume any processing time) until either bit 0, bit 1 or bit 2 are
+ * active, at which time the bit that was actually active would inform the task
+ * which action it had to take (process a received message, send a message, or
+ * send a SYNC).
+ *
+ * The event groups implementation contains intelligence to avoid race
+ * conditions that would otherwise occur were an application to use a simple
+ * variable for the same purpose. This is particularly important with respect
+ * to when a bit within an event group is to be cleared, and when bits have to
+ * be set and then tested atomically - as is the case where event groups are
+ * used to create a synchronisation point between multiple tasks (a
+ * 'rendezvous').
+ */
+
+
+
+/**
+ * event_groups.h
+ *
+ * Type by which event groups are referenced. For example, a call to
+ * xEventGroupCreate() returns an EventGroupHandle_t variable that can then
+ * be used as a parameter to other event group functions.
+ *
+ * \defgroup EventGroupHandle_t EventGroupHandle_t
+ * \ingroup EventGroup
+ */
+struct EventGroupDef_t;
+typedef struct EventGroupDef_t * EventGroupHandle_t;
+
+/*
+ * The type that holds event bits always matches TickType_t - therefore the
+ * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
+ * 32 bits if set to 0.
+ *
+ * \defgroup EventBits_t EventBits_t
+ * \ingroup EventGroup
+ */
+typedef TickType_t EventBits_t;
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventGroupHandle_t xEventGroupCreate( void );
+ * @endcode
+ *
+ * Create a new event group.
+ *
+ * Internally, within the FreeRTOS implementation, event groups use a [small]
+ * block of memory, in which the event group's structure is stored. If an event
+ * groups is created using xEventGroupCreate() then the required memory is
+ * automatically dynamically allocated inside the xEventGroupCreate() function.
+ * (see https://www.FreeRTOS.org/a00111.html). If an event group is created
+ * using xEventGroupCreateStatic() then the application writer must instead
+ * provide the memory that will get used by the event group.
+ * xEventGroupCreateStatic() therefore allows an event group to be created
+ * without using any dynamic memory allocation.
+ *
+ * Although event groups are not related to ticks, for internal implementation
+ * reasons the number of bits available for use in an event group is dependent
+ * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
+ * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
+ * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
+ * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
+ * event bits within an event group.
+ *
+ * @return If the event group was created then a handle to the event group is
+ * returned. If there was insufficient FreeRTOS heap available to create the
+ * event group then NULL is returned. See https://www.FreeRTOS.org/a00111.html
+ *
+ * Example usage:
+ * @code{c}
+ * // Declare a variable to hold the created event group.
+ * EventGroupHandle_t xCreatedEventGroup;
+ *
+ * // Attempt to create the event group.
+ * xCreatedEventGroup = xEventGroupCreate();
+ *
+ * // Was the event group created successfully?
+ * if( xCreatedEventGroup == NULL )
+ * {
+ * // The event group was not created because there was insufficient
+ * // FreeRTOS heap available.
+ * }
+ * else
+ * {
+ * // The event group was created.
+ * }
+ * @endcode
+ * \defgroup xEventGroupCreate xEventGroupCreate
+ * \ingroup EventGroup
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer );
+ * @endcode
+ *
+ * Create a new event group.
+ *
+ * Internally, within the FreeRTOS implementation, event groups use a [small]
+ * block of memory, in which the event group's structure is stored. If an event
+ * groups is created using xEventGroupCreate() then the required memory is
+ * automatically dynamically allocated inside the xEventGroupCreate() function.
+ * (see https://www.FreeRTOS.org/a00111.html). If an event group is created
+ * using xEventGroupCreateStatic() then the application writer must instead
+ * provide the memory that will get used by the event group.
+ * xEventGroupCreateStatic() therefore allows an event group to be created
+ * without using any dynamic memory allocation.
+ *
+ * Although event groups are not related to ticks, for internal implementation
+ * reasons the number of bits available for use in an event group is dependent
+ * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
+ * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
+ * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
+ * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
+ * event bits within an event group.
+ *
+ * @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type
+ * StaticEventGroup_t, which will be then be used to hold the event group's data
+ * structures, removing the need for the memory to be allocated dynamically.
+ *
+ * @return If the event group was created then a handle to the event group is
+ * returned. If pxEventGroupBuffer was NULL then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * // StaticEventGroup_t is a publicly accessible structure that has the same
+ * // size and alignment requirements as the real event group structure. It is
+ * // provided as a mechanism for applications to know the size of the event
+ * // group (which is dependent on the architecture and configuration file
+ * // settings) without breaking the strict data hiding policy by exposing the
+ * // real event group internals. This StaticEventGroup_t variable is passed
+ * // into the xSemaphoreCreateEventGroupStatic() function and is used to store
+ * // the event group's data structures
+ * StaticEventGroup_t xEventGroupBuffer;
+ *
+ * // Create the event group without dynamically allocating any memory.
+ * xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
+ * @endcode
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ * const EventBits_t uxBitsToWaitFor,
+ * const BaseType_t xClearOnExit,
+ * const BaseType_t xWaitForAllBits,
+ * const TickType_t xTicksToWait );
+ * @endcode
+ *
+ * [Potentially] block to wait for one or more bits to be set within a
+ * previously created event group.
+ *
+ * This function cannot be called from an interrupt.
+ *
+ * @param xEventGroup The event group in which the bits are being tested. The
+ * event group must have previously been created using a call to
+ * xEventGroupCreate().
+ *
+ * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
+ * inside the event group. For example, to wait for bit 0 and/or bit 2 set
+ * uxBitsToWaitFor to 0x05. To wait for bits 0 and/or bit 1 and/or bit 2 set
+ * uxBitsToWaitFor to 0x07. Etc.
+ *
+ * @param xClearOnExit If xClearOnExit is set to pdTRUE then any bits within
+ * uxBitsToWaitFor that are set within the event group will be cleared before
+ * xEventGroupWaitBits() returns if the wait condition was met (if the function
+ * returns for a reason other than a timeout). If xClearOnExit is set to
+ * pdFALSE then the bits set in the event group are not altered when the call to
+ * xEventGroupWaitBits() returns.
+ *
+ * @param xWaitForAllBits If xWaitForAllBits is set to pdTRUE then
+ * xEventGroupWaitBits() will return when either all the bits in uxBitsToWaitFor
+ * are set or the specified block time expires. If xWaitForAllBits is set to
+ * pdFALSE then xEventGroupWaitBits() will return when any one of the bits set
+ * in uxBitsToWaitFor is set or the specified block time expires. The block
+ * time is specified by the xTicksToWait parameter.
+ *
+ * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
+ * for one/all (depending on the xWaitForAllBits value) of the bits specified by
+ * uxBitsToWaitFor to become set. A value of portMAX_DELAY can be used to block
+ * indefinitely (provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
+ *
+ * @return The value of the event group at the time either the bits being waited
+ * for became set, or the block time expired. Test the return value to know
+ * which bits were set. If xEventGroupWaitBits() returned because its timeout
+ * expired then not all the bits being waited for will be set. If
+ * xEventGroupWaitBits() returned because the bits it was waiting for were set
+ * then the returned value is the event group value before any bits were
+ * automatically cleared in the case that xClearOnExit parameter was set to
+ * pdTRUE.
+ *
+ * Example usage:
+ * @code{c}
+ * #define BIT_0 ( 1 << 0 )
+ * #define BIT_4 ( 1 << 4 )
+ *
+ * void aFunction( EventGroupHandle_t xEventGroup )
+ * {
+ * EventBits_t uxBits;
+ * const TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
+ *
+ * // Wait a maximum of 100ms for either bit 0 or bit 4 to be set within
+ * // the event group. Clear the bits before exiting.
+ * uxBits = xEventGroupWaitBits(
+ * xEventGroup, // The event group being tested.
+ * BIT_0 | BIT_4, // The bits within the event group to wait for.
+ * pdTRUE, // BIT_0 and BIT_4 should be cleared before returning.
+ * pdFALSE, // Don't wait for both bits, either bit will do.
+ * xTicksToWait ); // Wait a maximum of 100ms for either bit to be set.
+ *
+ * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+ * {
+ * // xEventGroupWaitBits() returned because both bits were set.
+ * }
+ * else if( ( uxBits & BIT_0 ) != 0 )
+ * {
+ * // xEventGroupWaitBits() returned because just BIT_0 was set.
+ * }
+ * else if( ( uxBits & BIT_4 ) != 0 )
+ * {
+ * // xEventGroupWaitBits() returned because just BIT_4 was set.
+ * }
+ * else
+ * {
+ * // xEventGroupWaitBits() returned because xTicksToWait ticks passed
+ * // without either BIT_0 or BIT_4 becoming set.
+ * }
+ * }
+ * @endcode
+ * \defgroup xEventGroupWaitBits xEventGroupWaitBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xClearOnExit,
+ const BaseType_t xWaitForAllBits,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
+ * @endcode
+ *
+ * Clear bits within an event group. This function cannot be called from an
+ * interrupt.
+ *
+ * @param xEventGroup The event group in which the bits are to be cleared.
+ *
+ * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear
+ * in the event group. For example, to clear bit 3 only, set uxBitsToClear to
+ * 0x08. To clear bit 3 and bit 0 set uxBitsToClear to 0x09.
+ *
+ * @return The value of the event group before the specified bits were cleared.
+ *
+ * Example usage:
+ * @code{c}
+ * #define BIT_0 ( 1 << 0 )
+ * #define BIT_4 ( 1 << 4 )
+ *
+ * void aFunction( EventGroupHandle_t xEventGroup )
+ * {
+ * EventBits_t uxBits;
+ *
+ * // Clear bit 0 and bit 4 in xEventGroup.
+ * uxBits = xEventGroupClearBits(
+ * xEventGroup, // The event group being updated.
+ * BIT_0 | BIT_4 );// The bits being cleared.
+ *
+ * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+ * {
+ * // Both bit 0 and bit 4 were set before xEventGroupClearBits() was
+ * // called. Both will now be clear (not set).
+ * }
+ * else if( ( uxBits & BIT_0 ) != 0 )
+ * {
+ * // Bit 0 was set before xEventGroupClearBits() was called. It will
+ * // now be clear.
+ * }
+ * else if( ( uxBits & BIT_4 ) != 0 )
+ * {
+ * // Bit 4 was set before xEventGroupClearBits() was called. It will
+ * // now be clear.
+ * }
+ * else
+ * {
+ * // Neither bit 0 nor bit 4 were set in the first place.
+ * }
+ * }
+ * @endcode
+ * \defgroup xEventGroupClearBits xEventGroupClearBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ * @code{c}
+ * BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
+ * @endcode
+ *
+ * A version of xEventGroupClearBits() that can be called from an interrupt.
+ *
+ * Setting bits in an event group is not a deterministic operation because there
+ * are an unknown number of tasks that may be waiting for the bit or bits being
+ * set. FreeRTOS does not allow nondeterministic operations to be performed
+ * while interrupts are disabled, so protects event groups that are accessed
+ * from tasks by suspending the scheduler rather than disabling interrupts. As
+ * a result event groups cannot be accessed directly from an interrupt service
+ * routine. Therefore xEventGroupClearBitsFromISR() sends a message to the
+ * timer task to have the clear operation performed in the context of the timer
+ * task.
+ *
+ * @note If this function returns pdPASS then the timer task is ready to run
+ * and a portYIELD_FROM_ISR(pdTRUE) should be executed to perform the needed
+ * clear on the event group. This behavior is different from
+ * xEventGroupSetBitsFromISR because the parameter xHigherPriorityTaskWoken is
+ * not present.
+ *
+ * @param xEventGroup The event group in which the bits are to be cleared.
+ *
+ * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.
+ * For example, to clear bit 3 only, set uxBitsToClear to 0x08. To clear bit 3
+ * and bit 0 set uxBitsToClear to 0x09.
+ *
+ * @return If the request to execute the function was posted successfully then
+ * pdPASS is returned, otherwise pdFALSE is returned. pdFALSE will be returned
+ * if the timer service queue was full.
+ *
+ * Example usage:
+ * @code{c}
+ * #define BIT_0 ( 1 << 0 )
+ * #define BIT_4 ( 1 << 4 )
+ *
+ * // An event group which it is assumed has already been created by a call to
+ * // xEventGroupCreate().
+ * EventGroupHandle_t xEventGroup;
+ *
+ * void anInterruptHandler( void )
+ * {
+ * // Clear bit 0 and bit 4 in xEventGroup.
+ * xResult = xEventGroupClearBitsFromISR(
+ * xEventGroup, // The event group being updated.
+ * BIT_0 | BIT_4 ); // The bits being set.
+ *
+ * if( xResult == pdPASS )
+ * {
+ * // The message was posted successfully.
+ * portYIELD_FROM_ISR(pdTRUE);
+ * }
+ * }
+ * @endcode
+ * \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
+ * \ingroup EventGroup
+ */
+#if ( configUSE_TRACE_FACILITY == 1 )
+ BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
+#else
+ #define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) \
+ xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToClear ), NULL )
+#endif
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
+ * @endcode
+ *
+ * Set bits within an event group.
+ * This function cannot be called from an interrupt. xEventGroupSetBitsFromISR()
+ * is a version that can be called from an interrupt.
+ *
+ * Setting bits in an event group will automatically unblock tasks that are
+ * blocked waiting for the bits.
+ *
+ * @param xEventGroup The event group in which the bits are to be set.
+ *
+ * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
+ * For example, to set bit 3 only, set uxBitsToSet to 0x08. To set bit 3
+ * and bit 0 set uxBitsToSet to 0x09.
+ *
+ * @return The value of the event group at the time the call to
+ * xEventGroupSetBits() returns. There are two reasons why the returned value
+ * might have the bits specified by the uxBitsToSet parameter cleared. First,
+ * if setting a bit results in a task that was waiting for the bit leaving the
+ * blocked state then it is possible the bit will be cleared automatically
+ * (see the xClearBitOnExit parameter of xEventGroupWaitBits()). Second, any
+ * unblocked (or otherwise Ready state) task that has a priority above that of
+ * the task that called xEventGroupSetBits() will execute and may change the
+ * event group value before the call to xEventGroupSetBits() returns.
+ *
+ * Example usage:
+ * @code{c}
+ * #define BIT_0 ( 1 << 0 )
+ * #define BIT_4 ( 1 << 4 )
+ *
+ * void aFunction( EventGroupHandle_t xEventGroup )
+ * {
+ * EventBits_t uxBits;
+ *
+ * // Set bit 0 and bit 4 in xEventGroup.
+ * uxBits = xEventGroupSetBits(
+ * xEventGroup, // The event group being updated.
+ * BIT_0 | BIT_4 );// The bits being set.
+ *
+ * if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+ * {
+ * // Both bit 0 and bit 4 remained set when the function returned.
+ * }
+ * else if( ( uxBits & BIT_0 ) != 0 )
+ * {
+ * // Bit 0 remained set when the function returned, but bit 4 was
+ * // cleared. It might be that bit 4 was cleared automatically as a
+ * // task that was waiting for bit 4 was removed from the Blocked
+ * // state.
+ * }
+ * else if( ( uxBits & BIT_4 ) != 0 )
+ * {
+ * // Bit 4 remained set when the function returned, but bit 0 was
+ * // cleared. It might be that bit 0 was cleared automatically as a
+ * // task that was waiting for bit 0 was removed from the Blocked
+ * // state.
+ * }
+ * else
+ * {
+ * // Neither bit 0 nor bit 4 remained set. It might be that a task
+ * // was waiting for both of the bits to be set, and the bits were
+ * // cleared as the task left the Blocked state.
+ * }
+ * }
+ * @endcode
+ * \defgroup xEventGroupSetBits xEventGroupSetBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ * @code{c}
+ * BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * A version of xEventGroupSetBits() that can be called from an interrupt.
+ *
+ * Setting bits in an event group is not a deterministic operation because there
+ * are an unknown number of tasks that may be waiting for the bit or bits being
+ * set. FreeRTOS does not allow nondeterministic operations to be performed in
+ * interrupts or from critical sections. Therefore xEventGroupSetBitsFromISR()
+ * sends a message to the timer task to have the set operation performed in the
+ * context of the timer task - where a scheduler lock is used in place of a
+ * critical section.
+ *
+ * @param xEventGroup The event group in which the bits are to be set.
+ *
+ * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
+ * For example, to set bit 3 only, set uxBitsToSet to 0x08. To set bit 3
+ * and bit 0 set uxBitsToSet to 0x09.
+ *
+ * @param pxHigherPriorityTaskWoken As mentioned above, calling this function
+ * will result in a message being sent to the timer daemon task. If the
+ * priority of the timer daemon task is higher than the priority of the
+ * currently running task (the task the interrupt interrupted) then
+ * *pxHigherPriorityTaskWoken will be set to pdTRUE by
+ * xEventGroupSetBitsFromISR(), indicating that a context switch should be
+ * requested before the interrupt exits. For that reason
+ * *pxHigherPriorityTaskWoken must be initialised to pdFALSE. See the
+ * example code below.
+ *
+ * @return If the request to execute the function was posted successfully then
+ * pdPASS is returned, otherwise pdFALSE is returned. pdFALSE will be returned
+ * if the timer service queue was full.
+ *
+ * Example usage:
+ * @code{c}
+ * #define BIT_0 ( 1 << 0 )
+ * #define BIT_4 ( 1 << 4 )
+ *
+ * // An event group which it is assumed has already been created by a call to
+ * // xEventGroupCreate().
+ * EventGroupHandle_t xEventGroup;
+ *
+ * void anInterruptHandler( void )
+ * {
+ * BaseType_t xHigherPriorityTaskWoken, xResult;
+ *
+ * // xHigherPriorityTaskWoken must be initialised to pdFALSE.
+ * xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Set bit 0 and bit 4 in xEventGroup.
+ * xResult = xEventGroupSetBitsFromISR(
+ * xEventGroup, // The event group being updated.
+ * BIT_0 | BIT_4 // The bits being set.
+ * &xHigherPriorityTaskWoken );
+ *
+ * // Was the message posted successfully?
+ * if( xResult == pdPASS )
+ * {
+ * // If xHigherPriorityTaskWoken is now set to pdTRUE then a context
+ * // switch should be requested. The macro used is port specific and
+ * // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
+ * // refer to the documentation page for the port being used.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ * }
+ * }
+ * @endcode
+ * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
+ * \ingroup EventGroup
+ */
+#if ( configUSE_TRACE_FACILITY == 1 )
+ BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+#else
+ #define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) \
+ xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToSet ), ( pxHigherPriorityTaskWoken ) )
+#endif
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
+ * const EventBits_t uxBitsToSet,
+ * const EventBits_t uxBitsToWaitFor,
+ * TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Atomically set bits within an event group, then wait for a combination of
+ * bits to be set within the same event group. This functionality is typically
+ * used to synchronise multiple tasks, where each task has to wait for the other
+ * tasks to reach a synchronisation point before proceeding.
+ *
+ * This function cannot be used from an interrupt.
+ *
+ * The function will return before its block time expires if the bits specified
+ * by the uxBitsToWait parameter are set, or become set within that time. In
+ * this case all the bits specified by uxBitsToWait will be automatically
+ * cleared before the function returns.
+ *
+ * @param xEventGroup The event group in which the bits are being tested. The
+ * event group must have previously been created using a call to
+ * xEventGroupCreate().
+ *
+ * @param uxBitsToSet The bits to set in the event group before determining
+ * if, and possibly waiting for, all the bits specified by the uxBitsToWait
+ * parameter are set.
+ *
+ * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
+ * inside the event group. For example, to wait for bit 0 and bit 2 set
+ * uxBitsToWaitFor to 0x05. To wait for bits 0 and bit 1 and bit 2 set
+ * uxBitsToWaitFor to 0x07. Etc.
+ *
+ * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
+ * for all of the bits specified by uxBitsToWaitFor to become set.
+ *
+ * @return The value of the event group at the time either the bits being waited
+ * for became set, or the block time expired. Test the return value to know
+ * which bits were set. If xEventGroupSync() returned because its timeout
+ * expired then not all the bits being waited for will be set. If
+ * xEventGroupSync() returned because all the bits it was waiting for were
+ * set then the returned value is the event group value before any bits were
+ * automatically cleared.
+ *
+ * Example usage:
+ * @code{c}
+ * // Bits used by the three tasks.
+ * #define TASK_0_BIT ( 1 << 0 )
+ * #define TASK_1_BIT ( 1 << 1 )
+ * #define TASK_2_BIT ( 1 << 2 )
+ *
+ * #define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
+ *
+ * // Use an event group to synchronise three tasks. It is assumed this event
+ * // group has already been created elsewhere.
+ * EventGroupHandle_t xEventBits;
+ *
+ * void vTask0( void *pvParameters )
+ * {
+ * EventBits_t uxReturn;
+ * TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
+ *
+ * for( ;; )
+ * {
+ * // Perform task functionality here.
+ *
+ * // Set bit 0 in the event flag to note this task has reached the
+ * // sync point. The other two tasks will set the other two bits defined
+ * // by ALL_SYNC_BITS. All three tasks have reached the synchronisation
+ * // point when all the ALL_SYNC_BITS are set. Wait a maximum of 100ms
+ * // for this to happen.
+ * uxReturn = xEventGroupSync( xEventBits, TASK_0_BIT, ALL_SYNC_BITS, xTicksToWait );
+ *
+ * if( ( uxReturn & ALL_SYNC_BITS ) == ALL_SYNC_BITS )
+ * {
+ * // All three tasks reached the synchronisation point before the call
+ * // to xEventGroupSync() timed out.
+ * }
+ * }
+ * }
+ *
+ * void vTask1( void *pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Perform task functionality here.
+ *
+ * // Set bit 1 in the event flag to note this task has reached the
+ * // synchronisation point. The other two tasks will set the other two
+ * // bits defined by ALL_SYNC_BITS. All three tasks have reached the
+ * // synchronisation point when all the ALL_SYNC_BITS are set. Wait
+ * // indefinitely for this to happen.
+ * xEventGroupSync( xEventBits, TASK_1_BIT, ALL_SYNC_BITS, portMAX_DELAY );
+ *
+ * // xEventGroupSync() was called with an indefinite block time, so
+ * // this task will only reach here if the synchronisation was made by all
+ * // three tasks, so there is no need to test the return value.
+ * }
+ * }
+ *
+ * void vTask2( void *pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Perform task functionality here.
+ *
+ * // Set bit 2 in the event flag to note this task has reached the
+ * // synchronisation point. The other two tasks will set the other two
+ * // bits defined by ALL_SYNC_BITS. All three tasks have reached the
+ * // synchronisation point when all the ALL_SYNC_BITS are set. Wait
+ * // indefinitely for this to happen.
+ * xEventGroupSync( xEventBits, TASK_2_BIT, ALL_SYNC_BITS, portMAX_DELAY );
+ *
+ * // xEventGroupSync() was called with an indefinite block time, so
+ * // this task will only reach here if the synchronisation was made by all
+ * // three tasks, so there is no need to test the return value.
+ * }
+ * }
+ *
+ * @endcode
+ * \defgroup xEventGroupSync xEventGroupSync
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ const EventBits_t uxBitsToWaitFor,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );
+ * @endcode
+ *
+ * Returns the current value of the bits in an event group. This function
+ * cannot be used from an interrupt.
+ *
+ * @param xEventGroup The event group being queried.
+ *
+ * @return The event group bits at the time xEventGroupGetBits() was called.
+ *
+ * \defgroup xEventGroupGetBits xEventGroupGetBits
+ * \ingroup EventGroup
+ */
+#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( ( xEventGroup ), 0 )
+
+/**
+ * event_groups.h
+ * @code{c}
+ * EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
+ * @endcode
+ *
+ * A version of xEventGroupGetBits() that can be called from an ISR.
+ *
+ * @param xEventGroup The event group being queried.
+ *
+ * @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
+ *
+ * \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ * @code{c}
+ * void xEventGroupDelete( EventGroupHandle_t xEventGroup );
+ * @endcode
+ *
+ * Delete an event group that was previously created by a call to
+ * xEventGroupCreate(). Tasks that are blocked on the event group will be
+ * unblocked and obtain 0 as the event group's value.
+ *
+ * @param xEventGroup The event group being deleted.
+ */
+void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
+
+/* For internal use only. */
+void vEventGroupSetBitsCallback( void * pvEventGroup,
+ const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
+void vEventGroupClearBitsCallback( void * pvEventGroup,
+ const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
+
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxEventGroupGetNumber( void * xEventGroup ) PRIVILEGED_FUNCTION;
+ void vEventGroupSetNumber( void * xEventGroup,
+ UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
+#endif
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* EVENT_GROUPS_H */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/freertos_tasks_c_additions.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/freertos_tasks_c_additions.h
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/freertos_tasks_c_additions.h
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/freertos_tasks_c_additions.h
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/list.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/list.h
new file mode 100644
index 0000000..e366319
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/list.h
@@ -0,0 +1,503 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+ * This is the list implementation used by the scheduler. While it is tailored
+ * heavily for the schedulers needs, it is also available for use by
+ * application code.
+ *
+ * list_ts can only store pointers to list_item_ts. Each ListItem_t contains a
+ * numeric value (xItemValue). Most of the time the lists are sorted in
+ * ascending item value order.
+ *
+ * Lists are created already containing one list item. The value of this
+ * item is the maximum possible that can be stored, it is therefore always at
+ * the end of the list and acts as a marker. The list member pxHead always
+ * points to this marker - even though it is at the tail of the list. This
+ * is because the tail contains a wrap back pointer to the true head of
+ * the list.
+ *
+ * In addition to it's value, each list item contains a pointer to the next
+ * item in the list (pxNext), a pointer to the list it is in (pxContainer)
+ * and a pointer to back to the object that contains it. These later two
+ * pointers are included for efficiency of list manipulation. There is
+ * effectively a two way link between the object containing the list item and
+ * the list item itself.
+ *
+ *
+ * \page ListIntroduction List Implementation
+ * \ingroup FreeRTOSIntro
+ */
+
+
+#ifndef LIST_H
+#define LIST_H
+
+#ifndef INC_FREERTOS_H
+ #error "FreeRTOS.h must be included before list.h"
+#endif
+
+/*
+ * The list structure members are modified from within interrupts, and therefore
+ * by rights should be declared volatile. However, they are only modified in a
+ * functionally atomic way (within critical sections of with the scheduler
+ * suspended) and are either passed by reference into a function or indexed via
+ * a volatile variable. Therefore, in all use cases tested so far, the volatile
+ * qualifier can be omitted in order to provide a moderate performance
+ * improvement without adversely affecting functional behaviour. The assembly
+ * instructions generated by the IAR, ARM and GCC compilers when the respective
+ * compiler's options were set for maximum optimisation has been inspected and
+ * deemed to be as intended. That said, as compiler technology advances, and
+ * especially if aggressive cross module optimisation is used (a use case that
+ * has not been exercised to any great extend) then it is feasible that the
+ * volatile qualifier will be needed for correct optimisation. It is expected
+ * that a compiler removing essential code because, without the volatile
+ * qualifier on the list structure members and with aggressive cross module
+ * optimisation, the compiler deemed the code unnecessary will result in
+ * complete and obvious failure of the scheduler. If this is ever experienced
+ * then the volatile qualifier can be inserted in the relevant places within the
+ * list structures by simply defining configLIST_VOLATILE to volatile in
+ * FreeRTOSConfig.h (as per the example at the bottom of this comment block).
+ * If configLIST_VOLATILE is not defined then the preprocessor directives below
+ * will simply #define configLIST_VOLATILE away completely.
+ *
+ * To use volatile list structure members then add the following line to
+ * FreeRTOSConfig.h (without the quotes):
+ * "#define configLIST_VOLATILE volatile"
+ */
+#ifndef configLIST_VOLATILE
+ #define configLIST_VOLATILE
+#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/* Macros that can be used to place known values within the list structures,
+ * then check that the known values do not get corrupted during the execution of
+ * the application. These may catch the list data structures being overwritten in
+ * memory. They will not catch data errors caused by incorrect configuration or
+ * use of FreeRTOS.*/
+#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
+ /* Define the macros to do nothing. */
+ #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
+ #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
+ #define listFIRST_LIST_INTEGRITY_CHECK_VALUE
+ #define listSECOND_LIST_INTEGRITY_CHECK_VALUE
+ #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
+ #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
+ #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
+ #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
+ #define listTEST_LIST_ITEM_INTEGRITY( pxItem )
+ #define listTEST_LIST_INTEGRITY( pxList )
+#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
+ /* Define macros that add new members into the list structures. */
+ #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
+ #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
+ #define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
+ #define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
+
+/* Define macros that set the new structure members to known values. */
+ #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
+ #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
+ #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
+ #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
+
+/* Define macros that will assert if one of the structure members does not
+ * contain its expected value. */
+ #define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
+ #define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
+#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
+
+
+/*
+ * Definition of the only type of object that a list can contain.
+ */
+struct xLIST;
+struct xLIST_ITEM
+{
+ listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in ascending order. */
+ struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
+ struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
+ void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
+ struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
+ listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+};
+typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
+
+#if ( configUSE_MINI_LIST_ITEM == 1 )
+ struct xMINI_LIST_ITEM
+ {
+ listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ configLIST_VOLATILE TickType_t xItemValue;
+ struct xLIST_ITEM * configLIST_VOLATILE pxNext;
+ struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
+ };
+ typedef struct xMINI_LIST_ITEM MiniListItem_t;
+#else
+ typedef struct xLIST_ITEM MiniListItem_t;
+#endif
+
+/*
+ * Definition of the type of queue used by the scheduler.
+ */
+typedef struct xLIST
+{
+ listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ volatile UBaseType_t uxNumberOfItems;
+ ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
+ MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
+ listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+} List_t;
+
+/*
+ * Access macro to set the owner of a list item. The owner of a list item
+ * is the object (usually a TCB) that contains the list item.
+ *
+ * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
+ * \ingroup LinkedList
+ */
+#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
+
+/*
+ * Access macro to get the owner of a list item. The owner of a list item
+ * is the object (usually a TCB) that contains the list item.
+ *
+ * \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
+ * \ingroup LinkedList
+ */
+#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
+
+/*
+ * Access macro to set the value of the list item. In most cases the value is
+ * used to sort the list in ascending order.
+ *
+ * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
+ * \ingroup LinkedList
+ */
+#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
+
+/*
+ * Access macro to retrieve the value of the list item. The value can
+ * represent anything - for example the priority of a task, or the time at
+ * which a task should be unblocked.
+ *
+ * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
+ * \ingroup LinkedList
+ */
+#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
+
+/*
+ * Access macro to retrieve the value of the list item at the head of a given
+ * list.
+ *
+ * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
+ * \ingroup LinkedList
+ */
+#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
+
+/*
+ * Return the list item at the head of the list.
+ *
+ * \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
+ * \ingroup LinkedList
+ */
+#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
+
+/*
+ * Return the next list item.
+ *
+ * \page listGET_NEXT listGET_NEXT
+ * \ingroup LinkedList
+ */
+#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
+
+/*
+ * Return the list item that marks the end of the list
+ *
+ * \page listGET_END_MARKER listGET_END_MARKER
+ * \ingroup LinkedList
+ */
+#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
+
+/*
+ * Access macro to determine if a list contains any items. The macro will
+ * only have the value true if the list is empty.
+ *
+ * \page listLIST_IS_EMPTY listLIST_IS_EMPTY
+ * \ingroup LinkedList
+ */
+#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
+
+/*
+ * Access macro to return the number of items in the list.
+ */
+#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
+
+/*
+ * Access function to obtain the owner of the next entry in a list.
+ *
+ * The list member pxIndex is used to walk through a list. Calling
+ * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
+ * and returns that entry's pxOwner parameter. Using multiple calls to this
+ * function it is therefore possible to move through every item contained in
+ * a list.
+ *
+ * The pxOwner parameter of a list item is a pointer to the object that owns
+ * the list item. In the scheduler this is normally a task control block.
+ * The pxOwner parameter effectively creates a two way link between the list
+ * item and its owner.
+ *
+ * @param pxTCB pxTCB is set to the address of the owner of the next list item.
+ * @param pxList The list from which the next item owner is to be returned.
+ *
+ * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
+ * \ingroup LinkedList
+ */
+#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
+ { \
+ List_t * const pxConstList = ( pxList ); \
+ /* Increment the index to the next item and return the item, ensuring */ \
+ /* we don't return the marker used at the end of the list. */ \
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
+ if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
+ { \
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
+ } \
+ ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
+ }
+
+/*
+ * Version of uxListRemove() that does not return a value. Provided as a slight
+ * optimisation for xTaskIncrementTick() by being inline.
+ *
+ * Remove an item from a list. The list item has a pointer to the list that
+ * it is in, so only the list item need be passed into the function.
+ *
+ * @param uxListRemove The item to be removed. The item will remove itself from
+ * the list pointed to by it's pxContainer parameter.
+ *
+ * @return The number of items that remain in the list after the list item has
+ * been removed.
+ *
+ * \page listREMOVE_ITEM listREMOVE_ITEM
+ * \ingroup LinkedList
+ */
+#define listREMOVE_ITEM( pxItemToRemove ) \
+ { \
+ /* The list item knows which list it is in. Obtain the list from the list \
+ * item. */ \
+ List_t * const pxList = ( pxItemToRemove )->pxContainer; \
+ \
+ ( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
+ ( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
+ /* Make sure the index is left pointing to a valid item. */ \
+ if( pxList->pxIndex == ( pxItemToRemove ) ) \
+ { \
+ pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
+ } \
+ \
+ ( pxItemToRemove )->pxContainer = NULL; \
+ ( pxList->uxNumberOfItems )--; \
+ }
+
+/*
+ * Inline version of vListInsertEnd() to provide slight optimisation for
+ * xTaskIncrementTick().
+ *
+ * Insert a list item into a list. The item will be inserted in a position
+ * such that it will be the last item within the list returned by multiple
+ * calls to listGET_OWNER_OF_NEXT_ENTRY.
+ *
+ * The list member pxIndex is used to walk through a list. Calling
+ * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
+ * Placing an item in a list using vListInsertEnd effectively places the item
+ * in the list position pointed to by pxIndex. This means that every other
+ * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
+ * the pxIndex parameter again points to the item being inserted.
+ *
+ * @param pxList The list into which the item is to be inserted.
+ *
+ * @param pxNewListItem The list item to be inserted into the list.
+ *
+ * \page listINSERT_END listINSERT_END
+ * \ingroup LinkedList
+ */
+#define listINSERT_END( pxList, pxNewListItem ) \
+ { \
+ ListItem_t * const pxIndex = ( pxList )->pxIndex; \
+ \
+ /* Only effective when configASSERT() is also defined, these tests may catch \
+ * the list data structures being overwritten in memory. They will not catch \
+ * data errors caused by incorrect configuration or use of FreeRTOS. */ \
+ listTEST_LIST_INTEGRITY( ( pxList ) ); \
+ listTEST_LIST_ITEM_INTEGRITY( ( pxNewListItem ) ); \
+ \
+ /* Insert a new list item into ( pxList ), but rather than sort the list, \
+ * makes the new list item the last item to be removed by a call to \
+ * listGET_OWNER_OF_NEXT_ENTRY(). */ \
+ ( pxNewListItem )->pxNext = pxIndex; \
+ ( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
+ \
+ pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
+ pxIndex->pxPrevious = ( pxNewListItem ); \
+ \
+ /* Remember which list the item is in. */ \
+ ( pxNewListItem )->pxContainer = ( pxList ); \
+ \
+ ( ( pxList )->uxNumberOfItems )++; \
+ }
+
+/*
+ * Access function to obtain the owner of the first entry in a list. Lists
+ * are normally sorted in ascending item value order.
+ *
+ * This function returns the pxOwner member of the first item in the list.
+ * The pxOwner parameter of a list item is a pointer to the object that owns
+ * the list item. In the scheduler this is normally a task control block.
+ * The pxOwner parameter effectively creates a two way link between the list
+ * item and its owner.
+ *
+ * @param pxList The list from which the owner of the head item is to be
+ * returned.
+ *
+ * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
+ * \ingroup LinkedList
+ */
+#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
+
+/*
+ * Check to see if a list item is within a list. The list item maintains a
+ * "container" pointer that points to the list it is in. All this macro does
+ * is check to see if the container and the list match.
+ *
+ * @param pxList The list we want to know if the list item is within.
+ * @param pxListItem The list item we want to know if is in the list.
+ * @return pdTRUE if the list item is in the list, otherwise pdFALSE.
+ */
+#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
+
+/*
+ * Return the list a list item is contained within (referenced from).
+ *
+ * @param pxListItem The list item being queried.
+ * @return A pointer to the List_t object that references the pxListItem
+ */
+#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
+
+/*
+ * This provides a crude means of knowing if a list has been initialised, as
+ * pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
+ * function.
+ */
+#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
+
+/*
+ * Must be called before a list is used! This initialises all the members
+ * of the list structure and inserts the xListEnd item into the list as a
+ * marker to the back of the list.
+ *
+ * @param pxList Pointer to the list being initialised.
+ *
+ * \page vListInitialise vListInitialise
+ * \ingroup LinkedList
+ */
+void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
+
+/*
+ * Must be called before a list item is used. This sets the list container to
+ * null so the item does not think that it is already contained in a list.
+ *
+ * @param pxItem Pointer to the list item being initialised.
+ *
+ * \page vListInitialiseItem vListInitialiseItem
+ * \ingroup LinkedList
+ */
+void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
+
+/*
+ * Insert a list item into a list. The item will be inserted into the list in
+ * a position determined by its item value (ascending item value order).
+ *
+ * @param pxList The list into which the item is to be inserted.
+ *
+ * @param pxNewListItem The item that is to be placed in the list.
+ *
+ * \page vListInsert vListInsert
+ * \ingroup LinkedList
+ */
+void vListInsert( List_t * const pxList,
+ ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
+
+/*
+ * Insert a list item into a list. The item will be inserted in a position
+ * such that it will be the last item within the list returned by multiple
+ * calls to listGET_OWNER_OF_NEXT_ENTRY.
+ *
+ * The list member pxIndex is used to walk through a list. Calling
+ * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
+ * Placing an item in a list using vListInsertEnd effectively places the item
+ * in the list position pointed to by pxIndex. This means that every other
+ * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
+ * the pxIndex parameter again points to the item being inserted.
+ *
+ * @param pxList The list into which the item is to be inserted.
+ *
+ * @param pxNewListItem The list item to be inserted into the list.
+ *
+ * \page vListInsertEnd vListInsertEnd
+ * \ingroup LinkedList
+ */
+void vListInsertEnd( List_t * const pxList,
+ ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
+
+/*
+ * Remove an item from a list. The list item has a pointer to the list that
+ * it is in, so only the list item need be passed into the function.
+ *
+ * @param uxListRemove The item to be removed. The item will remove itself from
+ * the list pointed to by it's pxContainer parameter.
+ *
+ * @return The number of items that remain in the list after the list item has
+ * been removed.
+ *
+ * \page uxListRemove uxListRemove
+ * \ingroup LinkedList
+ */
+UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* ifndef LIST_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/message_buffer.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/message_buffer.h
new file mode 100644
index 0000000..24d59e2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/message_buffer.h
@@ -0,0 +1,856 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+/*
+ * Message buffers build functionality on top of FreeRTOS stream buffers.
+ * Whereas stream buffers are used to send a continuous stream of data from one
+ * task or interrupt to another, message buffers are used to send variable
+ * length discrete messages from one task or interrupt to another. Their
+ * implementation is light weight, making them particularly suited for interrupt
+ * to task and core to core communication scenarios.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xMessageBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xMessageBufferRead()) inside a critical section and set the receive
+ * timeout to 0.
+ *
+ * Message buffers hold variable length messages. To enable that, when a
+ * message is written to the message buffer an additional sizeof( size_t ) bytes
+ * are also written to store the message's length (that happens internally, with
+ * the API function). sizeof( size_t ) is typically 4 bytes on a 32-bit
+ * architecture, so writing a 10 byte message to a message buffer on a 32-bit
+ * architecture will actually reduce the available space in the message buffer
+ * by 14 bytes (10 byte are used by the message, and 4 bytes to hold the length
+ * of the message).
+ */
+
+#ifndef FREERTOS_MESSAGE_BUFFER_H
+#define FREERTOS_MESSAGE_BUFFER_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include message_buffer.h"
+#endif
+
+/* Message buffers are built onto of stream buffers. */
+#include "stream_buffer.h"
+
+/* *INDENT-OFF* */
+#if defined( __cplusplus )
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/**
+ * Type by which message buffers are referenced. For example, a call to
+ * xMessageBufferCreate() returns an MessageBufferHandle_t variable that can
+ * then be used as a parameter to xMessageBufferSend(), xMessageBufferReceive(),
+ * etc. Message buffer is essentially built as a stream buffer hence its handle
+ * is also set to same type as a stream buffer handle.
+ */
+typedef StreamBufferHandle_t MessageBufferHandle_t;
+
+/*-----------------------------------------------------------*/
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * MessageBufferHandle_t xMessageBufferCreate( size_t xBufferSizeBytes );
+ * @endcode
+ *
+ * Creates a new message buffer using dynamically allocated memory. See
+ * xMessageBufferCreateStatic() for a version that uses statically allocated
+ * memory (memory that is allocated at compile time).
+ *
+ * configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
+ * FreeRTOSConfig.h for xMessageBufferCreate() to be available.
+ *
+ * @param xBufferSizeBytes The total number of bytes (not messages) the message
+ * buffer will be able to hold at any one time. When a message is written to
+ * the message buffer an additional sizeof( size_t ) bytes are also written to
+ * store the message's length. sizeof( size_t ) is typically 4 bytes on a
+ * 32-bit architecture, so on most 32-bit architectures a 10 byte message will
+ * take up 14 bytes of message buffer space.
+ *
+ * @param pxSendCompletedCallback Callback invoked when a send operation to the
+ * message buffer is complete. If the parameter is NULL or xMessageBufferCreate()
+ * is called without the parameter, then it will use the default implementation
+ * provided by sbSEND_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when a receive operation from
+ * the message buffer is complete. If the parameter is NULL or xMessageBufferCreate()
+ * is called without the parameter, it will use the default implementation provided
+ * by sbRECEIVE_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @return If NULL is returned, then the message buffer cannot be created
+ * because there is insufficient heap memory available for FreeRTOS to allocate
+ * the message buffer data structures and storage area. A non-NULL value being
+ * returned indicates that the message buffer has been created successfully -
+ * the returned value should be stored as the handle to the created message
+ * buffer.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * void vAFunction( void )
+ * {
+ * MessageBufferHandle_t xMessageBuffer;
+ * const size_t xMessageBufferSizeBytes = 100;
+ *
+ * // Create a message buffer that can hold 100 bytes. The memory used to hold
+ * // both the message buffer structure and the messages themselves is allocated
+ * // dynamically. Each message added to the buffer consumes an additional 4
+ * // bytes which are used to hold the length of the message.
+ * xMessageBuffer = xMessageBufferCreate( xMessageBufferSizeBytes );
+ *
+ * if( xMessageBuffer == NULL )
+ * {
+ * // There was not enough heap memory space available to create the
+ * // message buffer.
+ * }
+ * else
+ * {
+ * // The message buffer was created successfully and can now be used.
+ * }
+ *
+ * @endcode
+ * \defgroup xMessageBufferCreate xMessageBufferCreate
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferCreate( xBufferSizeBytes ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, pdTRUE, NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xMessageBufferCreateWithCallback( xBufferSizeBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, pdTRUE, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * MessageBufferHandle_t xMessageBufferCreateStatic( size_t xBufferSizeBytes,
+ * uint8_t *pucMessageBufferStorageArea,
+ * StaticMessageBuffer_t *pxStaticMessageBuffer );
+ * @endcode
+ * Creates a new message buffer using statically allocated memory. See
+ * xMessageBufferCreate() for a version that uses dynamically allocated memory.
+ *
+ * @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
+ * pucMessageBufferStorageArea parameter. When a message is written to the
+ * message buffer an additional sizeof( size_t ) bytes are also written to store
+ * the message's length. sizeof( size_t ) is typically 4 bytes on a 32-bit
+ * architecture, so on most 32-bit architecture a 10 byte message will take up
+ * 14 bytes of message buffer space. The maximum number of bytes that can be
+ * stored in the message buffer is actually (xBufferSizeBytes - 1).
+ *
+ * @param pucMessageBufferStorageArea Must point to a uint8_t array that is at
+ * least xBufferSizeBytes big. This is the array to which messages are
+ * copied when they are written to the message buffer.
+ *
+ * @param pxStaticMessageBuffer Must point to a variable of type
+ * StaticMessageBuffer_t, which will be used to hold the message buffer's data
+ * structure.
+ *
+ * @param pxSendCompletedCallback Callback invoked when a new message is sent to the message buffer.
+ * If the parameter is NULL or xMessageBufferCreate() is called without the parameter, then it will use the default
+ * implementation provided by sbSEND_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when a message is read from a
+ * message buffer. If the parameter is NULL or xMessageBufferCreate() is called without the parameter, it will
+ * use the default implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @return If the message buffer is created successfully then a handle to the
+ * created message buffer is returned. If either pucMessageBufferStorageArea or
+ * pxStaticmessageBuffer are NULL then NULL is returned.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * // Used to dimension the array used to hold the messages. The available space
+ * // will actually be one less than this, so 999.
+ #define STORAGE_SIZE_BYTES 1000
+ *
+ * // Defines the memory that will actually hold the messages within the message
+ * // buffer.
+ * static uint8_t ucStorageBuffer[ STORAGE_SIZE_BYTES ];
+ *
+ * // The variable used to hold the message buffer structure.
+ * StaticMessageBuffer_t xMessageBufferStruct;
+ *
+ * void MyFunction( void )
+ * {
+ * MessageBufferHandle_t xMessageBuffer;
+ *
+ * xMessageBuffer = xMessageBufferCreateStatic( sizeof( ucStorageBuffer ),
+ * ucStorageBuffer,
+ * &xMessageBufferStruct );
+ *
+ * // As neither the pucMessageBufferStorageArea or pxStaticMessageBuffer
+ * // parameters were NULL, xMessageBuffer will not be NULL, and can be used to
+ * // reference the created message buffer in other message buffer API calls.
+ *
+ * // Other code that uses the message buffer can go here.
+ * }
+ *
+ * @endcode
+ * \defgroup xMessageBufferCreateStatic xMessageBufferCreateStatic
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferCreateStatic( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, pdTRUE, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xMessageBufferCreateStaticWithCallback( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, pdTRUE, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * size_t xMessageBufferSend( MessageBufferHandle_t xMessageBuffer,
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Sends a discrete message to the message buffer. The message can be any
+ * length that fits within the buffer's free space, and is copied into the
+ * buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xMessageBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xMessageBufferRead()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xMessageBufferSend() to write to a message buffer from a task. Use
+ * xMessageBufferSendFromISR() to write to a message buffer from an interrupt
+ * service routine (ISR).
+ *
+ * @param xMessageBuffer The handle of the message buffer to which a message is
+ * being sent.
+ *
+ * @param pvTxData A pointer to the message that is to be copied into the
+ * message buffer.
+ *
+ * @param xDataLengthBytes The length of the message. That is, the number of
+ * bytes to copy from pvTxData into the message buffer. When a message is
+ * written to the message buffer an additional sizeof( size_t ) bytes are also
+ * written to store the message's length. sizeof( size_t ) is typically 4 bytes
+ * on a 32-bit architecture, so on most 32-bit architecture setting
+ * xDataLengthBytes to 20 will reduce the free space in the message buffer by 24
+ * bytes (20 bytes of message data and 4 bytes to hold the message length).
+ *
+ * @param xTicksToWait The maximum amount of time the calling task should remain
+ * in the Blocked state to wait for enough space to become available in the
+ * message buffer, should the message buffer have insufficient space when
+ * xMessageBufferSend() is called. The calling task will never block if
+ * xTicksToWait is zero. The block time is specified in tick periods, so the
+ * absolute time it represents is dependent on the tick frequency. The macro
+ * pdMS_TO_TICKS() can be used to convert a time specified in milliseconds into
+ * a time specified in ticks. Setting xTicksToWait to portMAX_DELAY will cause
+ * the task to wait indefinitely (without timing out), provided
+ * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h. Tasks do not use any
+ * CPU time when they are in the Blocked state.
+ *
+ * @return The number of bytes written to the message buffer. If the call to
+ * xMessageBufferSend() times out before there was enough space to write the
+ * message into the message buffer then zero is returned. If the call did not
+ * time out then xDataLengthBytes is returned.
+ *
+ * Example use:
+ * @code{c}
+ * void vAFunction( MessageBufferHandle_t xMessageBuffer )
+ * {
+ * size_t xBytesSent;
+ * uint8_t ucArrayToSend[] = { 0, 1, 2, 3 };
+ * char *pcStringToSend = "String to send";
+ * const TickType_t x100ms = pdMS_TO_TICKS( 100 );
+ *
+ * // Send an array to the message buffer, blocking for a maximum of 100ms to
+ * // wait for enough space to be available in the message buffer.
+ * xBytesSent = xMessageBufferSend( xMessageBuffer, ( void * ) ucArrayToSend, sizeof( ucArrayToSend ), x100ms );
+ *
+ * if( xBytesSent != sizeof( ucArrayToSend ) )
+ * {
+ * // The call to xMessageBufferSend() times out before there was enough
+ * // space in the buffer for the data to be written.
+ * }
+ *
+ * // Send the string to the message buffer. Return immediately if there is
+ * // not enough space in the buffer.
+ * xBytesSent = xMessageBufferSend( xMessageBuffer, ( void * ) pcStringToSend, strlen( pcStringToSend ), 0 );
+ *
+ * if( xBytesSent != strlen( pcStringToSend ) )
+ * {
+ * // The string could not be added to the message buffer because there was
+ * // not enough free space in the buffer.
+ * }
+ * }
+ * @endcode
+ * \defgroup xMessageBufferSend xMessageBufferSend
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferSend( xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait ) \
+ xStreamBufferSend( ( xMessageBuffer ), ( pvTxData ), ( xDataLengthBytes ), ( xTicksToWait ) )
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * size_t xMessageBufferSendFromISR( MessageBufferHandle_t xMessageBuffer,
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * Interrupt safe version of the API function that sends a discrete message to
+ * the message buffer. The message can be any length that fits within the
+ * buffer's free space, and is copied into the buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xMessageBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xMessageBufferRead()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xMessageBufferSend() to write to a message buffer from a task. Use
+ * xMessageBufferSendFromISR() to write to a message buffer from an interrupt
+ * service routine (ISR).
+ *
+ * @param xMessageBuffer The handle of the message buffer to which a message is
+ * being sent.
+ *
+ * @param pvTxData A pointer to the message that is to be copied into the
+ * message buffer.
+ *
+ * @param xDataLengthBytes The length of the message. That is, the number of
+ * bytes to copy from pvTxData into the message buffer. When a message is
+ * written to the message buffer an additional sizeof( size_t ) bytes are also
+ * written to store the message's length. sizeof( size_t ) is typically 4 bytes
+ * on a 32-bit architecture, so on most 32-bit architecture setting
+ * xDataLengthBytes to 20 will reduce the free space in the message buffer by 24
+ * bytes (20 bytes of message data and 4 bytes to hold the message length).
+ *
+ * @param pxHigherPriorityTaskWoken It is possible that a message buffer will
+ * have a task blocked on it waiting for data. Calling
+ * xMessageBufferSendFromISR() can make data available, and so cause a task that
+ * was waiting for data to leave the Blocked state. If calling
+ * xMessageBufferSendFromISR() causes a task to leave the Blocked state, and the
+ * unblocked task has a priority higher than the currently executing task (the
+ * task that was interrupted), then, internally, xMessageBufferSendFromISR()
+ * will set *pxHigherPriorityTaskWoken to pdTRUE. If
+ * xMessageBufferSendFromISR() sets this value to pdTRUE, then normally a
+ * context switch should be performed before the interrupt is exited. This will
+ * ensure that the interrupt returns directly to the highest priority Ready
+ * state task. *pxHigherPriorityTaskWoken should be set to pdFALSE before it
+ * is passed into the function. See the code example below for an example.
+ *
+ * @return The number of bytes actually written to the message buffer. If the
+ * message buffer didn't have enough free space for the message to be stored
+ * then 0 is returned, otherwise xDataLengthBytes is returned.
+ *
+ * Example use:
+ * @code{c}
+ * // A message buffer that has already been created.
+ * MessageBufferHandle_t xMessageBuffer;
+ *
+ * void vAnInterruptServiceRoutine( void )
+ * {
+ * size_t xBytesSent;
+ * char *pcStringToSend = "String to send";
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Initialised to pdFALSE.
+ *
+ * // Attempt to send the string to the message buffer.
+ * xBytesSent = xMessageBufferSendFromISR( xMessageBuffer,
+ * ( void * ) pcStringToSend,
+ * strlen( pcStringToSend ),
+ * &xHigherPriorityTaskWoken );
+ *
+ * if( xBytesSent != strlen( pcStringToSend ) )
+ * {
+ * // The string could not be added to the message buffer because there was
+ * // not enough free space in the buffer.
+ * }
+ *
+ * // If xHigherPriorityTaskWoken was set to pdTRUE inside
+ * // xMessageBufferSendFromISR() then a task that has a priority above the
+ * // priority of the currently executing task was unblocked and a context
+ * // switch should be performed to ensure the ISR returns to the unblocked
+ * // task. In most FreeRTOS ports this is done by simply passing
+ * // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
+ * // variables value, and perform the context switch if necessary. Check the
+ * // documentation for the port in use for port specific instructions.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ * }
+ * @endcode
+ * \defgroup xMessageBufferSendFromISR xMessageBufferSendFromISR
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferSendFromISR( xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken ) \
+ xStreamBufferSendFromISR( ( xMessageBuffer ), ( pvTxData ), ( xDataLengthBytes ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * size_t xMessageBufferReceive( MessageBufferHandle_t xMessageBuffer,
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Receives a discrete message from a message buffer. Messages can be of
+ * variable length and are copied out of the buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xMessageBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xMessageBufferRead()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xMessageBufferReceive() to read from a message buffer from a task. Use
+ * xMessageBufferReceiveFromISR() to read from a message buffer from an
+ * interrupt service routine (ISR).
+ *
+ * @param xMessageBuffer The handle of the message buffer from which a message
+ * is being received.
+ *
+ * @param pvRxData A pointer to the buffer into which the received message is
+ * to be copied.
+ *
+ * @param xBufferLengthBytes The length of the buffer pointed to by the pvRxData
+ * parameter. This sets the maximum length of the message that can be received.
+ * If xBufferLengthBytes is too small to hold the next message then the message
+ * will be left in the message buffer and 0 will be returned.
+ *
+ * @param xTicksToWait The maximum amount of time the task should remain in the
+ * Blocked state to wait for a message, should the message buffer be empty.
+ * xMessageBufferReceive() will return immediately if xTicksToWait is zero and
+ * the message buffer is empty. The block time is specified in tick periods, so
+ * the absolute time it represents is dependent on the tick frequency. The
+ * macro pdMS_TO_TICKS() can be used to convert a time specified in milliseconds
+ * into a time specified in ticks. Setting xTicksToWait to portMAX_DELAY will
+ * cause the task to wait indefinitely (without timing out), provided
+ * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h. Tasks do not use any
+ * CPU time when they are in the Blocked state.
+ *
+ * @return The length, in bytes, of the message read from the message buffer, if
+ * any. If xMessageBufferReceive() times out before a message became available
+ * then zero is returned. If the length of the message is greater than
+ * xBufferLengthBytes then the message will be left in the message buffer and
+ * zero is returned.
+ *
+ * Example use:
+ * @code{c}
+ * void vAFunction( MessageBuffer_t xMessageBuffer )
+ * {
+ * uint8_t ucRxData[ 20 ];
+ * size_t xReceivedBytes;
+ * const TickType_t xBlockTime = pdMS_TO_TICKS( 20 );
+ *
+ * // Receive the next message from the message buffer. Wait in the Blocked
+ * // state (so not using any CPU processing time) for a maximum of 100ms for
+ * // a message to become available.
+ * xReceivedBytes = xMessageBufferReceive( xMessageBuffer,
+ * ( void * ) ucRxData,
+ * sizeof( ucRxData ),
+ * xBlockTime );
+ *
+ * if( xReceivedBytes > 0 )
+ * {
+ * // A ucRxData contains a message that is xReceivedBytes long. Process
+ * // the message here....
+ * }
+ * }
+ * @endcode
+ * \defgroup xMessageBufferReceive xMessageBufferReceive
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferReceive( xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait ) \
+ xStreamBufferReceive( ( xMessageBuffer ), ( pvRxData ), ( xBufferLengthBytes ), ( xTicksToWait ) )
+
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * size_t xMessageBufferReceiveFromISR( MessageBufferHandle_t xMessageBuffer,
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * An interrupt safe version of the API function that receives a discrete
+ * message from a message buffer. Messages can be of variable length and are
+ * copied out of the buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xMessageBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xMessageBufferRead()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xMessageBufferReceive() to read from a message buffer from a task. Use
+ * xMessageBufferReceiveFromISR() to read from a message buffer from an
+ * interrupt service routine (ISR).
+ *
+ * @param xMessageBuffer The handle of the message buffer from which a message
+ * is being received.
+ *
+ * @param pvRxData A pointer to the buffer into which the received message is
+ * to be copied.
+ *
+ * @param xBufferLengthBytes The length of the buffer pointed to by the pvRxData
+ * parameter. This sets the maximum length of the message that can be received.
+ * If xBufferLengthBytes is too small to hold the next message then the message
+ * will be left in the message buffer and 0 will be returned.
+ *
+ * @param pxHigherPriorityTaskWoken It is possible that a message buffer will
+ * have a task blocked on it waiting for space to become available. Calling
+ * xMessageBufferReceiveFromISR() can make space available, and so cause a task
+ * that is waiting for space to leave the Blocked state. If calling
+ * xMessageBufferReceiveFromISR() causes a task to leave the Blocked state, and
+ * the unblocked task has a priority higher than the currently executing task
+ * (the task that was interrupted), then, internally,
+ * xMessageBufferReceiveFromISR() will set *pxHigherPriorityTaskWoken to pdTRUE.
+ * If xMessageBufferReceiveFromISR() sets this value to pdTRUE, then normally a
+ * context switch should be performed before the interrupt is exited. That will
+ * ensure the interrupt returns directly to the highest priority Ready state
+ * task. *pxHigherPriorityTaskWoken should be set to pdFALSE before it is
+ * passed into the function. See the code example below for an example.
+ *
+ * @return The length, in bytes, of the message read from the message buffer, if
+ * any.
+ *
+ * Example use:
+ * @code{c}
+ * // A message buffer that has already been created.
+ * MessageBuffer_t xMessageBuffer;
+ *
+ * void vAnInterruptServiceRoutine( void )
+ * {
+ * uint8_t ucRxData[ 20 ];
+ * size_t xReceivedBytes;
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Initialised to pdFALSE.
+ *
+ * // Receive the next message from the message buffer.
+ * xReceivedBytes = xMessageBufferReceiveFromISR( xMessageBuffer,
+ * ( void * ) ucRxData,
+ * sizeof( ucRxData ),
+ * &xHigherPriorityTaskWoken );
+ *
+ * if( xReceivedBytes > 0 )
+ * {
+ * // A ucRxData contains a message that is xReceivedBytes long. Process
+ * // the message here....
+ * }
+ *
+ * // If xHigherPriorityTaskWoken was set to pdTRUE inside
+ * // xMessageBufferReceiveFromISR() then a task that has a priority above the
+ * // priority of the currently executing task was unblocked and a context
+ * // switch should be performed to ensure the ISR returns to the unblocked
+ * // task. In most FreeRTOS ports this is done by simply passing
+ * // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
+ * // variables value, and perform the context switch if necessary. Check the
+ * // documentation for the port in use for port specific instructions.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ * }
+ * @endcode
+ * \defgroup xMessageBufferReceiveFromISR xMessageBufferReceiveFromISR
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferReceiveFromISR( xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken ) \
+ xStreamBufferReceiveFromISR( ( xMessageBuffer ), ( pvRxData ), ( xBufferLengthBytes ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * void vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ *
+ * Deletes a message buffer that was previously created using a call to
+ * xMessageBufferCreate() or xMessageBufferCreateStatic(). If the message
+ * buffer was created using dynamic memory (that is, by xMessageBufferCreate()),
+ * then the allocated memory is freed.
+ *
+ * A message buffer handle must not be used after the message buffer has been
+ * deleted.
+ *
+ * @param xMessageBuffer The handle of the message buffer to be deleted.
+ *
+ */
+#define vMessageBufferDelete( xMessageBuffer ) \
+ vStreamBufferDelete( xMessageBuffer )
+
+/**
+ * message_buffer.h
+ * @code{c}
+ * BaseType_t xMessageBufferIsFull( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ *
+ * Tests to see if a message buffer is full. A message buffer is full if it
+ * cannot accept any more messages, of any size, until space is made available
+ * by a message being removed from the message buffer.
+ *
+ * @param xMessageBuffer The handle of the message buffer being queried.
+ *
+ * @return If the message buffer referenced by xMessageBuffer is full then
+ * pdTRUE is returned. Otherwise pdFALSE is returned.
+ */
+#define xMessageBufferIsFull( xMessageBuffer ) \
+ xStreamBufferIsFull( xMessageBuffer )
+
+/**
+ * message_buffer.h
+ * @code{c}
+ * BaseType_t xMessageBufferIsEmpty( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ *
+ * Tests to see if a message buffer is empty (does not contain any messages).
+ *
+ * @param xMessageBuffer The handle of the message buffer being queried.
+ *
+ * @return If the message buffer referenced by xMessageBuffer is empty then
+ * pdTRUE is returned. Otherwise pdFALSE is returned.
+ *
+ */
+#define xMessageBufferIsEmpty( xMessageBuffer ) \
+ xStreamBufferIsEmpty( xMessageBuffer )
+
+/**
+ * message_buffer.h
+ * @code{c}
+ * BaseType_t xMessageBufferReset( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ *
+ * Resets a message buffer to its initial empty state, discarding any message it
+ * contained.
+ *
+ * A message buffer can only be reset if there are no tasks blocked on it.
+ *
+ * @param xMessageBuffer The handle of the message buffer being reset.
+ *
+ * @return If the message buffer was reset then pdPASS is returned. If the
+ * message buffer could not be reset because either there was a task blocked on
+ * the message queue to wait for space to become available, or to wait for a
+ * a message to be available, then pdFAIL is returned.
+ *
+ * \defgroup xMessageBufferReset xMessageBufferReset
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferReset( xMessageBuffer ) \
+ xStreamBufferReset( xMessageBuffer )
+
+
+/**
+ * message_buffer.h
+ * @code{c}
+ * size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ * Returns the number of bytes of free space in the message buffer.
+ *
+ * @param xMessageBuffer The handle of the message buffer being queried.
+ *
+ * @return The number of bytes that can be written to the message buffer before
+ * the message buffer would be full. When a message is written to the message
+ * buffer an additional sizeof( size_t ) bytes are also written to store the
+ * message's length. sizeof( size_t ) is typically 4 bytes on a 32-bit
+ * architecture, so if xMessageBufferSpacesAvailable() returns 10, then the size
+ * of the largest message that can be written to the message buffer is 6 bytes.
+ *
+ * \defgroup xMessageBufferSpaceAvailable xMessageBufferSpaceAvailable
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferSpaceAvailable( xMessageBuffer ) \
+ xStreamBufferSpacesAvailable( xMessageBuffer )
+#define xMessageBufferSpacesAvailable( xMessageBuffer ) \
+ xStreamBufferSpacesAvailable( xMessageBuffer ) /* Corrects typo in original macro name. */
+
+/**
+ * message_buffer.h
+ * @code{c}
+ * size_t xMessageBufferNextLengthBytes( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ * Returns the length (in bytes) of the next message in a message buffer.
+ * Useful if xMessageBufferReceive() returned 0 because the size of the buffer
+ * passed into xMessageBufferReceive() was too small to hold the next message.
+ *
+ * @param xMessageBuffer The handle of the message buffer being queried.
+ *
+ * @return The length (in bytes) of the next message in the message buffer, or 0
+ * if the message buffer is empty.
+ *
+ * \defgroup xMessageBufferNextLengthBytes xMessageBufferNextLengthBytes
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferNextLengthBytes( xMessageBuffer ) \
+ xStreamBufferNextMessageLengthBytes( xMessageBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xMessageBufferSendCompletedFromISR( MessageBufferHandle_t xMessageBuffer, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * For advanced users only.
+ *
+ * The sbSEND_COMPLETED() macro is called from within the FreeRTOS APIs when
+ * data is sent to a message buffer or stream buffer. If there was a task that
+ * was blocked on the message or stream buffer waiting for data to arrive then
+ * the sbSEND_COMPLETED() macro sends a notification to the task to remove it
+ * from the Blocked state. xMessageBufferSendCompletedFromISR() does the same
+ * thing. It is provided to enable application writers to implement their own
+ * version of sbSEND_COMPLETED(), and MUST NOT BE USED AT ANY OTHER TIME.
+ *
+ * See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
+ * additional information.
+ *
+ * @param xMessageBuffer The handle of the stream buffer to which data was
+ * written.
+ *
+ * @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
+ * initialised to pdFALSE before it is passed into
+ * xMessageBufferSendCompletedFromISR(). If calling
+ * xMessageBufferSendCompletedFromISR() removes a task from the Blocked state,
+ * and the task has a priority above the priority of the currently running task,
+ * then *pxHigherPriorityTaskWoken will get set to pdTRUE indicating that a
+ * context switch should be performed before exiting the ISR.
+ *
+ * @return If a task was removed from the Blocked state then pdTRUE is returned.
+ * Otherwise pdFALSE is returned.
+ *
+ * \defgroup xMessageBufferSendCompletedFromISR xMessageBufferSendCompletedFromISR
+ * \ingroup StreamBufferManagement
+ */
+#define xMessageBufferSendCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
+ xStreamBufferSendCompletedFromISR( ( xMessageBuffer ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xMessageBufferReceiveCompletedFromISR( MessageBufferHandle_t xMessageBuffer, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * For advanced users only.
+ *
+ * The sbRECEIVE_COMPLETED() macro is called from within the FreeRTOS APIs when
+ * data is read out of a message buffer or stream buffer. If there was a task
+ * that was blocked on the message or stream buffer waiting for data to arrive
+ * then the sbRECEIVE_COMPLETED() macro sends a notification to the task to
+ * remove it from the Blocked state. xMessageBufferReceiveCompletedFromISR()
+ * does the same thing. It is provided to enable application writers to
+ * implement their own version of sbRECEIVE_COMPLETED(), and MUST NOT BE USED AT
+ * ANY OTHER TIME.
+ *
+ * See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
+ * additional information.
+ *
+ * @param xMessageBuffer The handle of the stream buffer from which data was
+ * read.
+ *
+ * @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
+ * initialised to pdFALSE before it is passed into
+ * xMessageBufferReceiveCompletedFromISR(). If calling
+ * xMessageBufferReceiveCompletedFromISR() removes a task from the Blocked state,
+ * and the task has a priority above the priority of the currently running task,
+ * then *pxHigherPriorityTaskWoken will get set to pdTRUE indicating that a
+ * context switch should be performed before exiting the ISR.
+ *
+ * @return If a task was removed from the Blocked state then pdTRUE is returned.
+ * Otherwise pdFALSE is returned.
+ *
+ * \defgroup xMessageBufferReceiveCompletedFromISR xMessageBufferReceiveCompletedFromISR
+ * \ingroup StreamBufferManagement
+ */
+#define xMessageBufferReceiveCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
+ xStreamBufferReceiveCompletedFromISR( ( xMessageBuffer ), ( pxHigherPriorityTaskWoken ) )
+
+/* *INDENT-OFF* */
+#if defined( __cplusplus )
+ } /* extern "C" */
+#endif
+/* *INDENT-ON* */
+
+#endif /* !defined( FREERTOS_MESSAGE_BUFFER_H ) */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_prototypes.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_prototypes.h
new file mode 100644
index 0000000..8e19ea0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_prototypes.h
@@ -0,0 +1,264 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+ * When the MPU is used the standard (non MPU) API functions are mapped to
+ * equivalents that start "MPU_", the prototypes for which are defined in this
+ * header files. This will cause the application code to call the MPU_ version
+ * which wraps the non-MPU version with privilege promoting then demoting code,
+ * so the kernel code always runs will full privileges.
+ */
+
+
+#ifndef MPU_PROTOTYPES_H
+#define MPU_PROTOTYPES_H
+
+/* MPU versions of task.h API functions. */
+BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const uint16_t usStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const uint32_t ulStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
+ const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskGetInfo( TaskHandle_t xTask,
+ TaskStatus_t * pxTaskStatus,
+ BaseType_t xGetFreeStackSpace,
+ eTaskState eState ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskPrioritySet( TaskHandle_t xTask,
+ UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
+TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
+char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
+ TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL;
+TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
+ BaseType_t xIndex,
+ void * pvValue ) FREERTOS_SYSTEM_CALL;
+void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
+ BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
+ void * pvParameter ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
+ const UBaseType_t uxArraySize,
+ configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
+configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
+configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ uint32_t ulValue,
+ eNotifyAction eAction,
+ uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
+ uint32_t ulBitsToClearOnEntry,
+ uint32_t ulBitsToClearOnExit,
+ uint32_t * pulNotificationValue,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
+ BaseType_t xClearCountOnExit,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
+ UBaseType_t uxIndexToClear ) FREERTOS_SYSTEM_CALL;
+uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
+ UBaseType_t uxIndexToClear,
+ uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
+ TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
+void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
+
+/* MPU versions of queue.h API functions. */
+BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
+ const void * const pvItemToQueue,
+ TickType_t xTicksToWait,
+ const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
+ StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount,
+ StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL;
+void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
+ const char * pcName ) FREERTOS_SYSTEM_CALL;
+void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
+QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ uint8_t * pucQueueStorage,
+ StaticQueue_t * pxStaticQueue,
+ const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
+QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
+QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
+ const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
+ BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
+void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
+ UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+
+/* MPU versions of timers.h API functions. */
+TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
+ const TickType_t xTimerPeriodInTicks,
+ const UBaseType_t uxAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
+TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
+ const TickType_t xTimerPeriodInTicks,
+ const UBaseType_t uxAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction,
+ StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
+void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
+ void * pvNewID ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
+ void * pvParameter1,
+ uint32_t ulParameter2,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
+ const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+
+/* MPU versions of event_group.h API functions. */
+EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
+EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
+EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xClearOnExit,
+ const BaseType_t xWaitForAllBits,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
+EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
+EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ const EventBits_t uxBitsToWaitFor,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
+UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
+
+/* MPU versions of message/stream_buffer.h API functions. */
+size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
+ const void * pvTxData,
+ size_t xDataLengthBytes,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
+ void * pvRxData,
+ size_t xBufferLengthBytes,
+ TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
+ size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
+StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
+ size_t xTriggerLevelBytes,
+ BaseType_t xIsMessageBuffer,
+ StreamBufferCallbackFunction_t pxSendCompletedCallback,
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL;
+StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
+ size_t xTriggerLevelBytes,
+ BaseType_t xIsMessageBuffer,
+ uint8_t * const pucStreamBufferStorageArea,
+ StaticStreamBuffer_t * const pxStaticStreamBuffer,
+ StreamBufferCallbackFunction_t pxSendCompletedCallback,
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL;
+
+
+
+#endif /* MPU_PROTOTYPES_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_wrappers.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_wrappers.h
new file mode 100644
index 0000000..0a26d88
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/mpu_wrappers.h
@@ -0,0 +1,184 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef MPU_WRAPPERS_H
+#define MPU_WRAPPERS_H
+
+/* This file redefines API functions to be called through a wrapper macro, but
+ * only for ports that are using the MPU. */
+#if ( portUSING_MPU_WRAPPERS == 1 )
+
+/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
+ * included from queue.c or task.c to prevent it from having an effect within
+ * those files. */
+ #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/*
+ * Map standard (non MPU) API functions to equivalents that start
+ * "MPU_". This will cause the application code to call the MPU_
+ * version, which wraps the non-MPU version with privilege promoting
+ * then demoting code, so the kernel code always runs will full
+ * privileges.
+ */
+
+/* Map standard task.h API functions to the MPU equivalents. */
+ #define xTaskCreate MPU_xTaskCreate
+ #define xTaskCreateStatic MPU_xTaskCreateStatic
+ #define vTaskDelete MPU_vTaskDelete
+ #define vTaskDelay MPU_vTaskDelay
+ #define xTaskDelayUntil MPU_xTaskDelayUntil
+ #define xTaskAbortDelay MPU_xTaskAbortDelay
+ #define uxTaskPriorityGet MPU_uxTaskPriorityGet
+ #define eTaskGetState MPU_eTaskGetState
+ #define vTaskGetInfo MPU_vTaskGetInfo
+ #define vTaskPrioritySet MPU_vTaskPrioritySet
+ #define vTaskSuspend MPU_vTaskSuspend
+ #define vTaskResume MPU_vTaskResume
+ #define vTaskSuspendAll MPU_vTaskSuspendAll
+ #define xTaskResumeAll MPU_xTaskResumeAll
+ #define xTaskGetTickCount MPU_xTaskGetTickCount
+ #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
+ #define pcTaskGetName MPU_pcTaskGetName
+ #define xTaskGetHandle MPU_xTaskGetHandle
+ #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
+ #define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
+ #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
+ #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
+ #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
+ #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
+ #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
+ #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
+ #define uxTaskGetSystemState MPU_uxTaskGetSystemState
+ #define vTaskList MPU_vTaskList
+ #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
+ #define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
+ #define ulTaskGetIdleRunTimePercent MPU_ulTaskGetIdleRunTimePercent
+ #define xTaskGenericNotify MPU_xTaskGenericNotify
+ #define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
+ #define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
+ #define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
+ #define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
+ #define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
+
+ #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
+ #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
+ #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
+ #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
+
+/* Map standard queue.h API functions to the MPU equivalents. */
+ #define xQueueGenericSend MPU_xQueueGenericSend
+ #define xQueueReceive MPU_xQueueReceive
+ #define xQueuePeek MPU_xQueuePeek
+ #define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
+ #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
+ #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
+ #define vQueueDelete MPU_vQueueDelete
+ #define xQueueCreateMutex MPU_xQueueCreateMutex
+ #define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
+ #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
+ #define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
+ #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
+ #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
+ #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
+ #define xQueueGenericCreate MPU_xQueueGenericCreate
+ #define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
+ #define xQueueCreateSet MPU_xQueueCreateSet
+ #define xQueueAddToSet MPU_xQueueAddToSet
+ #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
+ #define xQueueSelectFromSet MPU_xQueueSelectFromSet
+ #define xQueueGenericReset MPU_xQueueGenericReset
+
+ #if ( configQUEUE_REGISTRY_SIZE > 0 )
+ #define vQueueAddToRegistry MPU_vQueueAddToRegistry
+ #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
+ #define pcQueueGetName MPU_pcQueueGetName
+ #endif
+
+/* Map standard timer.h API functions to the MPU equivalents. */
+ #define pvTimerGetTimerID MPU_pvTimerGetTimerID
+ #define vTimerSetTimerID MPU_vTimerSetTimerID
+ #define xTimerIsTimerActive MPU_xTimerIsTimerActive
+ #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
+ #define pcTimerGetName MPU_pcTimerGetName
+ #define vTimerSetReloadMode MPU_vTimerSetReloadMode
+ #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
+ #define xTimerGetPeriod MPU_xTimerGetPeriod
+ #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
+ #define xTimerGenericCommand MPU_xTimerGenericCommand
+
+/* Map standard event_group.h API functions to the MPU equivalents. */
+ #define xEventGroupCreate MPU_xEventGroupCreate
+ #define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
+ #define xEventGroupWaitBits MPU_xEventGroupWaitBits
+ #define xEventGroupClearBits MPU_xEventGroupClearBits
+ #define xEventGroupSetBits MPU_xEventGroupSetBits
+ #define xEventGroupSync MPU_xEventGroupSync
+ #define vEventGroupDelete MPU_vEventGroupDelete
+
+/* Map standard message/stream_buffer.h API functions to the MPU
+ * equivalents. */
+ #define xStreamBufferSend MPU_xStreamBufferSend
+ #define xStreamBufferReceive MPU_xStreamBufferReceive
+ #define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
+ #define vStreamBufferDelete MPU_vStreamBufferDelete
+ #define xStreamBufferIsFull MPU_xStreamBufferIsFull
+ #define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
+ #define xStreamBufferReset MPU_xStreamBufferReset
+ #define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
+ #define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
+ #define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
+ #define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
+ #define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
+
+
+/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
+ * macro so applications can place data in privileged access sections
+ * (useful when using statically allocated objects). */
+ #define PRIVILEGED_FUNCTION
+ #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
+ #define FREERTOS_SYSTEM_CALL
+
+ #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
+
+/* Ensure API functions go in the privileged execution section. */
+ #define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
+ #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
+ #define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
+
+ #endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
+
+#else /* portUSING_MPU_WRAPPERS */
+
+ #define PRIVILEGED_FUNCTION
+ #define PRIVILEGED_DATA
+ #define FREERTOS_SYSTEM_CALL
+
+#endif /* portUSING_MPU_WRAPPERS */
+
+
+#endif /* MPU_WRAPPERS_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/portable.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/portable.h
new file mode 100644
index 0000000..a69e637
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/portable.h
@@ -0,0 +1,238 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*-----------------------------------------------------------
+* Portable layer API. Each function must be defined for each port.
+*----------------------------------------------------------*/
+
+#ifndef PORTABLE_H
+#define PORTABLE_H
+
+/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
+ * pre-processor definition was used to ensure the pre-processor found the correct
+ * portmacro.h file for the port being used. That scheme was deprecated in favour
+ * of setting the compiler's include path such that it found the correct
+ * portmacro.h file - removing the need for the constant and allowing the
+ * portmacro.h file to be located anywhere in relation to the port being used.
+ * Purely for reasons of backward compatibility the old method is still valid, but
+ * to make it clear that new projects should not use it, support for the port
+ * specific constants has been moved into the deprecated_definitions.h header
+ * file. */
+#include "deprecated_definitions.h"
+
+/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
+ * did not result in a portmacro.h header file being included - and it should be
+ * included here. In this case the path to the correct portmacro.h header file
+ * must be set in the compiler's include path. */
+#ifndef portENTER_CRITICAL
+ #include "portmacro.h"
+#endif
+
+#if portBYTE_ALIGNMENT == 32
+ #define portBYTE_ALIGNMENT_MASK ( 0x001f )
+#elif portBYTE_ALIGNMENT == 16
+ #define portBYTE_ALIGNMENT_MASK ( 0x000f )
+#elif portBYTE_ALIGNMENT == 8
+ #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
+#elif portBYTE_ALIGNMENT == 4
+ #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
+#elif portBYTE_ALIGNMENT == 2
+ #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
+#elif portBYTE_ALIGNMENT == 1
+ #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
+#else /* if portBYTE_ALIGNMENT == 32 */
+ #error "Invalid portBYTE_ALIGNMENT definition"
+#endif /* if portBYTE_ALIGNMENT == 32 */
+
+#ifndef portUSING_MPU_WRAPPERS
+ #define portUSING_MPU_WRAPPERS 0
+#endif
+
+#ifndef portNUM_CONFIGURABLE_REGIONS
+ #define portNUM_CONFIGURABLE_REGIONS 1
+#endif
+
+#ifndef portHAS_STACK_OVERFLOW_CHECKING
+ #define portHAS_STACK_OVERFLOW_CHECKING 0
+#endif
+
+#ifndef portARCH_NAME
+ #define portARCH_NAME NULL
+#endif
+
+#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
+ /* Defaults to 0 for backward compatibility. */
+ #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
+#endif
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+#include "mpu_wrappers.h"
+
+/*
+ * Setup the stack of a new task so it is ready to be placed under the
+ * scheduler control. The registers have to be placed on the stack in
+ * the order that the port expects to find them.
+ *
+ */
+#if ( portUSING_MPU_WRAPPERS == 1 )
+ #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ StackType_t * pxEndOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters,
+ BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
+ #else
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters,
+ BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
+ #endif
+#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
+ #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ StackType_t * pxEndOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters ) PRIVILEGED_FUNCTION;
+ #else
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters ) PRIVILEGED_FUNCTION;
+ #endif
+#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
+
+/* Used by heap_5.c to define the start address and size of each memory region
+ * that together comprise the total FreeRTOS heap space. */
+typedef struct HeapRegion
+{
+ uint8_t * pucStartAddress;
+ size_t xSizeInBytes;
+} HeapRegion_t;
+
+/* Used to pass information about the heap out of vPortGetHeapStats(). */
+typedef struct xHeapStats
+{
+ size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
+ size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
+ size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
+ size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
+ size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
+ size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
+ size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
+} HeapStats_t;
+
+/*
+ * Used to define multiple heap regions for use by heap_5.c. This function
+ * must be called before any calls to pvPortMalloc() - not creating a task,
+ * queue, semaphore, mutex, software timer, event group, etc. will result in
+ * pvPortMalloc being called.
+ *
+ * pxHeapRegions passes in an array of HeapRegion_t structures - each of which
+ * defines a region of memory that can be used as the heap. The array is
+ * terminated by a HeapRegions_t structure that has a size of 0. The region
+ * with the lowest start address must appear first in the array.
+ */
+void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
+
+/*
+ * Returns a HeapStats_t structure filled with information about the current
+ * heap state.
+ */
+void vPortGetHeapStats( HeapStats_t * pxHeapStats );
+
+/*
+ * Map to the memory management routines required for the port.
+ */
+void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
+void * pvPortCalloc( size_t xNum,
+ size_t xSize ) PRIVILEGED_FUNCTION;
+void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
+void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
+size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
+size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
+
+#if ( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 )
+ void * pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION;
+ void vPortFreeStack( void * pv ) PRIVILEGED_FUNCTION;
+#else
+ #define pvPortMallocStack pvPortMalloc
+ #define vPortFreeStack vPortFree
+#endif
+
+#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationMallocFailedHook( void )
+ * @endcode
+ *
+ * This hook function is called when allocation failed.
+ */
+ void vApplicationMallocFailedHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
+#endif
+
+/*
+ * Setup the hardware ready for the scheduler to take control. This generally
+ * sets up a tick interrupt and sets timers for the correct tick frequency.
+ */
+BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
+ * the hardware is left in its original condition after the scheduler stops
+ * executing.
+ */
+void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * The structures and methods of manipulating the MPU are contained within the
+ * port layer.
+ *
+ * Fills the xMPUSettings structure with the memory region information
+ * contained in xRegions.
+ */
+#if ( portUSING_MPU_WRAPPERS == 1 )
+ struct xMEMORY_REGION;
+ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
+ const struct xMEMORY_REGION * const xRegions,
+ StackType_t * pxBottomOfStack,
+ uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
+#endif
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* PORTABLE_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/projdefs.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/projdefs.h
new file mode 100644
index 0000000..595cbed
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/projdefs.h
@@ -0,0 +1,122 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PROJDEFS_H
+#define PROJDEFS_H
+
+/*
+ * Defines the prototype to which task functions must conform. Defined in this
+ * file to ensure the type is known before portable.h is included.
+ */
+typedef void (* TaskFunction_t)( void * );
+
+/* Converts a time in milliseconds to a time in ticks. This macro can be
+ * overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
+ * definition here is not suitable for your application. */
+#ifndef pdMS_TO_TICKS
+ #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
+#endif
+
+#define pdFALSE ( ( BaseType_t ) 0 )
+#define pdTRUE ( ( BaseType_t ) 1 )
+
+#define pdPASS ( pdTRUE )
+#define pdFAIL ( pdFALSE )
+#define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
+#define errQUEUE_FULL ( ( BaseType_t ) 0 )
+
+/* FreeRTOS error definitions. */
+#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
+#define errQUEUE_BLOCKED ( -4 )
+#define errQUEUE_YIELD ( -5 )
+
+/* Macros used for basic data corruption checks. */
+#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
+ #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
+#endif
+
+#if ( configUSE_16_BIT_TICKS == 1 )
+ #define pdINTEGRITY_CHECK_VALUE 0x5a5a
+#else
+ #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
+#endif
+
+/* The following errno values are used by FreeRTOS+ components, not FreeRTOS
+ * itself. */
+#define pdFREERTOS_ERRNO_NONE 0 /* No errors */
+#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
+#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
+#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
+#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
+#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
+#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
+#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
+#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
+#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
+#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
+#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
+#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
+#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
+#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
+#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
+#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
+#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
+#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
+#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
+#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
+#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
+#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
+#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
+#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
+#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
+#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
+#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
+#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
+#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
+#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
+#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
+#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
+#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
+#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
+#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
+#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
+#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
+#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
+
+/* The following endian values are used by FreeRTOS+ components, not FreeRTOS
+ * itself. */
+#define pdFREERTOS_LITTLE_ENDIAN 0
+#define pdFREERTOS_BIG_ENDIAN 1
+
+/* Re-defining endian values for generic naming. */
+#define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
+#define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
+
+
+#endif /* PROJDEFS_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/queue.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/queue.h
new file mode 100644
index 0000000..df572e1
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/queue.h
@@ -0,0 +1,1722 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#ifndef QUEUE_H
+#define QUEUE_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h" must appear in source files before "include queue.h"
+#endif
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+#include "task.h"
+
+/**
+ * Type by which queues are referenced. For example, a call to xQueueCreate()
+ * returns an QueueHandle_t variable that can then be used as a parameter to
+ * xQueueSend(), xQueueReceive(), etc.
+ */
+struct QueueDefinition; /* Using old naming convention so as not to break kernel aware debuggers. */
+typedef struct QueueDefinition * QueueHandle_t;
+
+/**
+ * Type by which queue sets are referenced. For example, a call to
+ * xQueueCreateSet() returns an xQueueSet variable that can then be used as a
+ * parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
+ */
+typedef struct QueueDefinition * QueueSetHandle_t;
+
+/**
+ * Queue sets can contain both queues and semaphores, so the
+ * QueueSetMemberHandle_t is defined as a type to be used where a parameter or
+ * return value can be either an QueueHandle_t or an SemaphoreHandle_t.
+ */
+typedef struct QueueDefinition * QueueSetMemberHandle_t;
+
+/* For internal use only. */
+#define queueSEND_TO_BACK ( ( BaseType_t ) 0 )
+#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 )
+#define queueOVERWRITE ( ( BaseType_t ) 2 )
+
+/* For internal use only. These definitions *must* match those in queue.c. */
+#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U )
+#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U )
+#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U )
+#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U )
+#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U )
+#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U )
+
+/**
+ * queue. h
+ * @code{c}
+ * QueueHandle_t xQueueCreate(
+ * UBaseType_t uxQueueLength,
+ * UBaseType_t uxItemSize
+ * );
+ * @endcode
+ *
+ * Creates a new queue instance, and returns a handle by which the new queue
+ * can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, queues use two blocks of
+ * memory. The first block is used to hold the queue's data structures. The
+ * second block is used to hold items placed into the queue. If a queue is
+ * created using xQueueCreate() then both blocks of memory are automatically
+ * dynamically allocated inside the xQueueCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a queue is created using
+ * xQueueCreateStatic() then the application writer must provide the memory that
+ * will get used by the queue. xQueueCreateStatic() therefore allows a queue to
+ * be created without using any dynamic memory allocation.
+ *
+ * https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
+ *
+ * @param uxQueueLength The maximum number of items that the queue can contain.
+ *
+ * @param uxItemSize The number of bytes each item in the queue will require.
+ * Items are queued by copy, not by reference, so this is the number of bytes
+ * that will be copied for each posted item. Each item on the queue must be
+ * the same size.
+ *
+ * @return If the queue is successfully create then a handle to the newly
+ * created queue is returned. If the queue cannot be created then 0 is
+ * returned.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * };
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1, xQueue2;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
+ * if( xQueue1 == 0 )
+ * {
+ * // Queue was not created and must not be used.
+ * }
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ * if( xQueue2 == 0 )
+ * {
+ * // Queue was not created and must not be used.
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueCreate xQueueCreate
+ * \ingroup QueueManagement
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )
+#endif
+
+/**
+ * queue. h
+ * @code{c}
+ * QueueHandle_t xQueueCreateStatic(
+ * UBaseType_t uxQueueLength,
+ * UBaseType_t uxItemSize,
+ * uint8_t *pucQueueStorage,
+ * StaticQueue_t *pxQueueBuffer
+ * );
+ * @endcode
+ *
+ * Creates a new queue instance, and returns a handle by which the new queue
+ * can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, queues use two blocks of
+ * memory. The first block is used to hold the queue's data structures. The
+ * second block is used to hold items placed into the queue. If a queue is
+ * created using xQueueCreate() then both blocks of memory are automatically
+ * dynamically allocated inside the xQueueCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a queue is created using
+ * xQueueCreateStatic() then the application writer must provide the memory that
+ * will get used by the queue. xQueueCreateStatic() therefore allows a queue to
+ * be created without using any dynamic memory allocation.
+ *
+ * https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
+ *
+ * @param uxQueueLength The maximum number of items that the queue can contain.
+ *
+ * @param uxItemSize The number of bytes each item in the queue will require.
+ * Items are queued by copy, not by reference, so this is the number of bytes
+ * that will be copied for each posted item. Each item on the queue must be
+ * the same size.
+ *
+ * @param pucQueueStorage If uxItemSize is not zero then
+ * pucQueueStorage must point to a uint8_t array that is at least large
+ * enough to hold the maximum number of items that can be in the queue at any
+ * one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is
+ * zero then pucQueueStorage can be NULL.
+ *
+ * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
+ * will be used to hold the queue's data structure.
+ *
+ * @return If the queue is created then a handle to the created queue is
+ * returned. If pxQueueBuffer is NULL then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * };
+ *
+ #define QUEUE_LENGTH 10
+ #define ITEM_SIZE sizeof( uint32_t )
+ *
+ * // xQueueBuffer will hold the queue structure.
+ * StaticQueue_t xQueueBuffer;
+ *
+ * // ucQueueStorage will hold the items posted to the queue. Must be at least
+ * // [(queue length) * ( queue item size)] bytes long.
+ * uint8_t ucQueueStorage[ QUEUE_LENGTH * ITEM_SIZE ];
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold.
+ * ITEM_SIZE // The size of each item in the queue
+ * &( ucQueueStorage[ 0 ] ), // The buffer that will hold the items in the queue.
+ * &xQueueBuffer ); // The buffer that will hold the queue structure.
+ *
+ * // The queue is guaranteed to be created successfully as no dynamic memory
+ * // allocation is used. Therefore xQueue1 is now a handle to a valid queue.
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueCreateStatic xQueueCreateStatic
+ * \ingroup QueueManagement
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xQueueCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer ) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendToToFront(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * TickType_t xTicksToWait
+ * );
+ * @endcode
+ *
+ * Post an item to the front of a queue. The item is queued by copy, not by
+ * reference. This function must not be called from an interrupt service
+ * routine. See xQueueSendFromISR () for an alternative which may be used
+ * in an ISR.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for space to become available on the queue, should it already
+ * be full. The call will return immediately if this is set to 0 and the
+ * queue is full. The time is defined in tick periods so the constant
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.
+ *
+ * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * uint32_t ulVar = 10UL;
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1, xQueue2;
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ *
+ * // ...
+ *
+ * if( xQueue1 != 0 )
+ * {
+ * // Send an uint32_t. Wait for 10 ticks for space to become
+ * // available if necessary.
+ * if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
+ * {
+ * // Failed to post the message, even after 10 ticks.
+ * }
+ * }
+ *
+ * if( xQueue2 != 0 )
+ * {
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueSend xQueueSend
+ * \ingroup QueueManagement
+ */
+#define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) \
+ xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendToBack(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * TickType_t xTicksToWait
+ * );
+ * @endcode
+ *
+ * This is a macro that calls xQueueGenericSend().
+ *
+ * Post an item to the back of a queue. The item is queued by copy, not by
+ * reference. This function must not be called from an interrupt service
+ * routine. See xQueueSendFromISR () for an alternative which may be used
+ * in an ISR.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for space to become available on the queue, should it already
+ * be full. The call will return immediately if this is set to 0 and the queue
+ * is full. The time is defined in tick periods so the constant
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.
+ *
+ * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * uint32_t ulVar = 10UL;
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1, xQueue2;
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ *
+ * // ...
+ *
+ * if( xQueue1 != 0 )
+ * {
+ * // Send an uint32_t. Wait for 10 ticks for space to become
+ * // available if necessary.
+ * if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
+ * {
+ * // Failed to post the message, even after 10 ticks.
+ * }
+ * }
+ *
+ * if( xQueue2 != 0 )
+ * {
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueSend xQueueSend
+ * \ingroup QueueManagement
+ */
+#define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) \
+ xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSend(
+ * QueueHandle_t xQueue,
+ * const void * pvItemToQueue,
+ * TickType_t xTicksToWait
+ * );
+ * @endcode
+ *
+ * This is a macro that calls xQueueGenericSend(). It is included for
+ * backward compatibility with versions of FreeRTOS.org that did not
+ * include the xQueueSendToFront() and xQueueSendToBack() macros. It is
+ * equivalent to xQueueSendToBack().
+ *
+ * Post an item on a queue. The item is queued by copy, not by reference.
+ * This function must not be called from an interrupt service routine.
+ * See xQueueSendFromISR () for an alternative which may be used in an ISR.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for space to become available on the queue, should it already
+ * be full. The call will return immediately if this is set to 0 and the
+ * queue is full. The time is defined in tick periods so the constant
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.
+ *
+ * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * uint32_t ulVar = 10UL;
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1, xQueue2;
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ *
+ * // ...
+ *
+ * if( xQueue1 != 0 )
+ * {
+ * // Send an uint32_t. Wait for 10 ticks for space to become
+ * // available if necessary.
+ * if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
+ * {
+ * // Failed to post the message, even after 10 ticks.
+ * }
+ * }
+ *
+ * if( xQueue2 != 0 )
+ * {
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueSend xQueueSend
+ * \ingroup QueueManagement
+ */
+#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) \
+ xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueOverwrite(
+ * QueueHandle_t xQueue,
+ * const void * pvItemToQueue
+ * );
+ * @endcode
+ *
+ * Only for use with queues that have a length of one - so the queue is either
+ * empty or full.
+ *
+ * Post an item on a queue. If the queue is already full then overwrite the
+ * value held in the queue. The item is queued by copy, not by reference.
+ *
+ * This function must not be called from an interrupt service routine.
+ * See xQueueOverwriteFromISR () for an alternative which may be used in an ISR.
+ *
+ * @param xQueue The handle of the queue to which the data is being sent.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @return xQueueOverwrite() is a macro that calls xQueueGenericSend(), and
+ * therefore has the same return values as xQueueSendToFront(). However, pdPASS
+ * is the only value that can be returned because xQueueOverwrite() will write
+ * to the queue even when the queue is already full.
+ *
+ * Example usage:
+ * @code{c}
+ *
+ * void vFunction( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue;
+ * uint32_t ulVarToSend, ulValReceived;
+ *
+ * // Create a queue to hold one uint32_t value. It is strongly
+ * // recommended *not* to use xQueueOverwrite() on queues that can
+ * // contain more than one value, and doing so will trigger an assertion
+ * // if configASSERT() is defined.
+ * xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
+ *
+ * // Write the value 10 to the queue using xQueueOverwrite().
+ * ulVarToSend = 10;
+ * xQueueOverwrite( xQueue, &ulVarToSend );
+ *
+ * // Peeking the queue should now return 10, but leave the value 10 in
+ * // the queue. A block time of zero is used as it is known that the
+ * // queue holds a value.
+ * ulValReceived = 0;
+ * xQueuePeek( xQueue, &ulValReceived, 0 );
+ *
+ * if( ulValReceived != 10 )
+ * {
+ * // Error unless the item was removed by a different task.
+ * }
+ *
+ * // The queue is still full. Use xQueueOverwrite() to overwrite the
+ * // value held in the queue with 100.
+ * ulVarToSend = 100;
+ * xQueueOverwrite( xQueue, &ulVarToSend );
+ *
+ * // This time read from the queue, leaving the queue empty once more.
+ * // A block time of 0 is used again.
+ * xQueueReceive( xQueue, &ulValReceived, 0 );
+ *
+ * // The value read should be the last value written, even though the
+ * // queue was already full when the value was written.
+ * if( ulValReceived != 100 )
+ * {
+ * // Error!
+ * }
+ *
+ * // ...
+ * }
+ * @endcode
+ * \defgroup xQueueOverwrite xQueueOverwrite
+ * \ingroup QueueManagement
+ */
+#define xQueueOverwrite( xQueue, pvItemToQueue ) \
+ xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE )
+
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueGenericSend(
+ * QueueHandle_t xQueue,
+ * const void * pvItemToQueue,
+ * TickType_t xTicksToWait
+ * BaseType_t xCopyPosition
+ * );
+ * @endcode
+ *
+ * It is preferred that the macros xQueueSend(), xQueueSendToFront() and
+ * xQueueSendToBack() are used in place of calling this function directly.
+ *
+ * Post an item on a queue. The item is queued by copy, not by reference.
+ * This function must not be called from an interrupt service routine.
+ * See xQueueSendFromISR () for an alternative which may be used in an ISR.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for space to become available on the queue, should it already
+ * be full. The call will return immediately if this is set to 0 and the
+ * queue is full. The time is defined in tick periods so the constant
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.
+ *
+ * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
+ * item at the back of the queue, or queueSEND_TO_FRONT to place the item
+ * at the front of the queue (for high priority messages).
+ *
+ * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * uint32_t ulVar = 10UL;
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * QueueHandle_t xQueue1, xQueue2;
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 uint32_t values.
+ * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ *
+ * // ...
+ *
+ * if( xQueue1 != 0 )
+ * {
+ * // Send an uint32_t. Wait for 10 ticks for space to become
+ * // available if necessary.
+ * if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10, queueSEND_TO_BACK ) != pdPASS )
+ * {
+ * // Failed to post the message, even after 10 ticks.
+ * }
+ * }
+ *
+ * if( xQueue2 != 0 )
+ * {
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0, queueSEND_TO_BACK );
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueSend xQueueSend
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
+ const void * const pvItemToQueue,
+ TickType_t xTicksToWait,
+ const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueuePeek(
+ * QueueHandle_t xQueue,
+ * void * const pvBuffer,
+ * TickType_t xTicksToWait
+ * );
+ * @endcode
+ *
+ * Receive an item from a queue without removing the item from the queue.
+ * The item is received by copy so a buffer of adequate size must be
+ * provided. The number of bytes copied into the buffer was defined when
+ * the queue was created.
+ *
+ * Successfully received items remain on the queue so will be returned again
+ * by the next call, or a call to xQueueReceive().
+ *
+ * This macro must not be used in an interrupt service routine. See
+ * xQueuePeekFromISR() for an alternative that can be called from an interrupt
+ * service routine.
+ *
+ * @param xQueue The handle to the queue from which the item is to be
+ * received.
+ *
+ * @param pvBuffer Pointer to the buffer into which the received item will
+ * be copied.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for an item to receive should the queue be empty at the time
+ * of the call. The time is defined in tick periods so the constant
+ * portTICK_PERIOD_MS should be used to convert to real time if this is required.
+ * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
+ * is empty.
+ *
+ * @return pdTRUE if an item was successfully received from the queue,
+ * otherwise pdFALSE.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * QueueHandle_t xQueue;
+ *
+ * // Task to create a queue and post a value.
+ * void vATask( void *pvParameters )
+ * {
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ * if( xQueue == 0 )
+ * {
+ * // Failed to create the queue.
+ * }
+ *
+ * // ...
+ *
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
+ *
+ * // ... Rest of task code.
+ * }
+ *
+ * // Task to peek the data from the queue.
+ * void vADifferentTask( void *pvParameters )
+ * {
+ * struct AMessage *pxRxedMessage;
+ *
+ * if( xQueue != 0 )
+ * {
+ * // Peek a message on the created queue. Block for 10 ticks if a
+ * // message is not immediately available.
+ * if( xQueuePeek( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
+ * {
+ * // pcRxedMessage now points to the struct AMessage variable posted
+ * // by vATask, but the item still remains on the queue.
+ * }
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueuePeek xQueuePeek
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueuePeek( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueuePeekFromISR(
+ * QueueHandle_t xQueue,
+ * void *pvBuffer,
+ * );
+ * @endcode
+ *
+ * A version of xQueuePeek() that can be called from an interrupt service
+ * routine (ISR).
+ *
+ * Receive an item from a queue without removing the item from the queue.
+ * The item is received by copy so a buffer of adequate size must be
+ * provided. The number of bytes copied into the buffer was defined when
+ * the queue was created.
+ *
+ * Successfully received items remain on the queue so will be returned again
+ * by the next call, or a call to xQueueReceive().
+ *
+ * @param xQueue The handle to the queue from which the item is to be
+ * received.
+ *
+ * @param pvBuffer Pointer to the buffer into which the received item will
+ * be copied.
+ *
+ * @return pdTRUE if an item was successfully received from the queue,
+ * otherwise pdFALSE.
+ *
+ * \defgroup xQueuePeekFromISR xQueuePeekFromISR
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
+ void * const pvBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueReceive(
+ * QueueHandle_t xQueue,
+ * void *pvBuffer,
+ * TickType_t xTicksToWait
+ * );
+ * @endcode
+ *
+ * Receive an item from a queue. The item is received by copy so a buffer of
+ * adequate size must be provided. The number of bytes copied into the buffer
+ * was defined when the queue was created.
+ *
+ * Successfully received items are removed from the queue.
+ *
+ * This function must not be used in an interrupt service routine. See
+ * xQueueReceiveFromISR for an alternative that can.
+ *
+ * @param xQueue The handle to the queue from which the item is to be
+ * received.
+ *
+ * @param pvBuffer Pointer to the buffer into which the received item will
+ * be copied.
+ *
+ * @param xTicksToWait The maximum amount of time the task should block
+ * waiting for an item to receive should the queue be empty at the time
+ * of the call. xQueueReceive() will return immediately if xTicksToWait
+ * is zero and the queue is empty. The time is defined in tick periods so the
+ * constant portTICK_PERIOD_MS should be used to convert to real time if this is
+ * required.
+ *
+ * @return pdTRUE if an item was successfully received from the queue,
+ * otherwise pdFALSE.
+ *
+ * Example usage:
+ * @code{c}
+ * struct AMessage
+ * {
+ * char ucMessageID;
+ * char ucData[ 20 ];
+ * } xMessage;
+ *
+ * QueueHandle_t xQueue;
+ *
+ * // Task to create a queue and post a value.
+ * void vATask( void *pvParameters )
+ * {
+ * struct AMessage *pxMessage;
+ *
+ * // Create a queue capable of containing 10 pointers to AMessage structures.
+ * // These should be passed by pointer as they contain a lot of data.
+ * xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
+ * if( xQueue == 0 )
+ * {
+ * // Failed to create the queue.
+ * }
+ *
+ * // ...
+ *
+ * // Send a pointer to a struct AMessage object. Don't block if the
+ * // queue is already full.
+ * pxMessage = & xMessage;
+ * xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
+ *
+ * // ... Rest of task code.
+ * }
+ *
+ * // Task to receive from the queue.
+ * void vADifferentTask( void *pvParameters )
+ * {
+ * struct AMessage *pxRxedMessage;
+ *
+ * if( xQueue != 0 )
+ * {
+ * // Receive a message on the created queue. Block for 10 ticks if a
+ * // message is not immediately available.
+ * if( xQueueReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
+ * {
+ * // pcRxedMessage now points to the struct AMessage variable posted
+ * // by vATask.
+ * }
+ * }
+ *
+ * // ... Rest of task code.
+ * }
+ * @endcode
+ * \defgroup xQueueReceive xQueueReceive
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueueReceive( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
+ * @endcode
+ *
+ * Return the number of messages stored in a queue.
+ *
+ * @param xQueue A handle to the queue being queried.
+ *
+ * @return The number of messages available in the queue.
+ *
+ * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
+ * \ingroup QueueManagement
+ */
+UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
+ * @endcode
+ *
+ * Return the number of free spaces available in a queue. This is equal to the
+ * number of items that can be sent to the queue before the queue becomes full
+ * if no items are removed.
+ *
+ * @param xQueue A handle to the queue being queried.
+ *
+ * @return The number of spaces available in the queue.
+ *
+ * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
+ * \ingroup QueueManagement
+ */
+UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * void vQueueDelete( QueueHandle_t xQueue );
+ * @endcode
+ *
+ * Delete a queue - freeing all the memory allocated for storing of items
+ * placed on the queue.
+ *
+ * @param xQueue A handle to the queue to be deleted.
+ *
+ * \defgroup vQueueDelete vQueueDelete
+ * \ingroup QueueManagement
+ */
+void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendToFrontFromISR(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * This is a macro that calls xQueueGenericSendFromISR().
+ *
+ * Post an item to the front of a queue. It is safe to use this macro from
+ * within an interrupt service routine.
+ *
+ * Items are queued by copy not reference so it is preferable to only
+ * queue small items, especially when called from an ISR. In most cases
+ * it would be preferable to store a pointer to the item being queued.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return pdTRUE if the data was successfully sent to the queue, otherwise
+ * errQUEUE_FULL.
+ *
+ * Example usage for buffered IO (where the ISR can obtain more than one value
+ * per call):
+ * @code{c}
+ * void vBufferISR( void )
+ * {
+ * char cIn;
+ * BaseType_t xHigherPriorityTaskWoken;
+ *
+ * // We have not woken a task at the start of the ISR.
+ * xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Loop until the buffer is empty.
+ * do
+ * {
+ * // Obtain a byte from the buffer.
+ * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
+ *
+ * // Post the byte.
+ * xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
+ *
+ * } while( portINPUT_BYTE( BUFFER_COUNT ) );
+ *
+ * // Now the buffer is empty we can switch context if necessary.
+ * if( xHigherPriorityTaskWoken )
+ * {
+ * taskYIELD ();
+ * }
+ * }
+ * @endcode
+ *
+ * \defgroup xQueueSendFromISR xQueueSendFromISR
+ * \ingroup QueueManagement
+ */
+#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
+ xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
+
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendToBackFromISR(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * This is a macro that calls xQueueGenericSendFromISR().
+ *
+ * Post an item to the back of a queue. It is safe to use this macro from
+ * within an interrupt service routine.
+ *
+ * Items are queued by copy not reference so it is preferable to only
+ * queue small items, especially when called from an ISR. In most cases
+ * it would be preferable to store a pointer to the item being queued.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return pdTRUE if the data was successfully sent to the queue, otherwise
+ * errQUEUE_FULL.
+ *
+ * Example usage for buffered IO (where the ISR can obtain more than one value
+ * per call):
+ * @code{c}
+ * void vBufferISR( void )
+ * {
+ * char cIn;
+ * BaseType_t xHigherPriorityTaskWoken;
+ *
+ * // We have not woken a task at the start of the ISR.
+ * xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Loop until the buffer is empty.
+ * do
+ * {
+ * // Obtain a byte from the buffer.
+ * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
+ *
+ * // Post the byte.
+ * xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
+ *
+ * } while( portINPUT_BYTE( BUFFER_COUNT ) );
+ *
+ * // Now the buffer is empty we can switch context if necessary.
+ * if( xHigherPriorityTaskWoken )
+ * {
+ * taskYIELD ();
+ * }
+ * }
+ * @endcode
+ *
+ * \defgroup xQueueSendFromISR xQueueSendFromISR
+ * \ingroup QueueManagement
+ */
+#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
+ xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueOverwriteFromISR(
+ * QueueHandle_t xQueue,
+ * const void * pvItemToQueue,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * A version of xQueueOverwrite() that can be used in an interrupt service
+ * routine (ISR).
+ *
+ * Only for use with queues that can hold a single item - so the queue is either
+ * empty or full.
+ *
+ * Post an item on a queue. If the queue is already full then overwrite the
+ * value held in the queue. The item is queued by copy, not by reference.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param pxHigherPriorityTaskWoken xQueueOverwriteFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xQueueOverwriteFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return xQueueOverwriteFromISR() is a macro that calls
+ * xQueueGenericSendFromISR(), and therefore has the same return values as
+ * xQueueSendToFrontFromISR(). However, pdPASS is the only value that can be
+ * returned because xQueueOverwriteFromISR() will write to the queue even when
+ * the queue is already full.
+ *
+ * Example usage:
+ * @code{c}
+ *
+ * QueueHandle_t xQueue;
+ *
+ * void vFunction( void *pvParameters )
+ * {
+ * // Create a queue to hold one uint32_t value. It is strongly
+ * // recommended *not* to use xQueueOverwriteFromISR() on queues that can
+ * // contain more than one value, and doing so will trigger an assertion
+ * // if configASSERT() is defined.
+ * xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
+ * }
+ *
+ * void vAnInterruptHandler( void )
+ * {
+ * // xHigherPriorityTaskWoken must be set to pdFALSE before it is used.
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ * uint32_t ulVarToSend, ulValReceived;
+ *
+ * // Write the value 10 to the queue using xQueueOverwriteFromISR().
+ * ulVarToSend = 10;
+ * xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
+ *
+ * // The queue is full, but calling xQueueOverwriteFromISR() again will still
+ * // pass because the value held in the queue will be overwritten with the
+ * // new value.
+ * ulVarToSend = 100;
+ * xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
+ *
+ * // Reading from the queue will now return 100.
+ *
+ * // ...
+ *
+ * if( xHigherPrioritytaskWoken == pdTRUE )
+ * {
+ * // Writing to the queue caused a task to unblock and the unblocked task
+ * // has a priority higher than or equal to the priority of the currently
+ * // executing task (the task this interrupt interrupted). Perform a context
+ * // switch so this interrupt returns directly to the unblocked task.
+ * portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
+ * }
+ * }
+ * @endcode
+ * \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
+ * \ingroup QueueManagement
+ */
+#define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
+ xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendFromISR(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * This is a macro that calls xQueueGenericSendFromISR(). It is included
+ * for backward compatibility with versions of FreeRTOS.org that did not
+ * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR()
+ * macros.
+ *
+ * Post an item to the back of a queue. It is safe to use this function from
+ * within an interrupt service routine.
+ *
+ * Items are queued by copy not reference so it is preferable to only
+ * queue small items, especially when called from an ISR. In most cases
+ * it would be preferable to store a pointer to the item being queued.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param pxHigherPriorityTaskWoken xQueueSendFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xQueueSendFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return pdTRUE if the data was successfully sent to the queue, otherwise
+ * errQUEUE_FULL.
+ *
+ * Example usage for buffered IO (where the ISR can obtain more than one value
+ * per call):
+ * @code{c}
+ * void vBufferISR( void )
+ * {
+ * char cIn;
+ * BaseType_t xHigherPriorityTaskWoken;
+ *
+ * // We have not woken a task at the start of the ISR.
+ * xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Loop until the buffer is empty.
+ * do
+ * {
+ * // Obtain a byte from the buffer.
+ * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
+ *
+ * // Post the byte.
+ * xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
+ *
+ * } while( portINPUT_BYTE( BUFFER_COUNT ) );
+ *
+ * // Now the buffer is empty we can switch context if necessary.
+ * if( xHigherPriorityTaskWoken )
+ * {
+ * // Actual macro used here is port specific.
+ * portYIELD_FROM_ISR ();
+ * }
+ * }
+ * @endcode
+ *
+ * \defgroup xQueueSendFromISR xQueueSendFromISR
+ * \ingroup QueueManagement
+ */
+#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
+ xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueGenericSendFromISR(
+ * QueueHandle_t xQueue,
+ * const void *pvItemToQueue,
+ * BaseType_t *pxHigherPriorityTaskWoken,
+ * BaseType_t xCopyPosition
+ * );
+ * @endcode
+ *
+ * It is preferred that the macros xQueueSendFromISR(),
+ * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
+ * of calling this function directly. xQueueGiveFromISR() is an
+ * equivalent for use by semaphores that don't actually copy any data.
+ *
+ * Post an item on a queue. It is safe to use this function from within an
+ * interrupt service routine.
+ *
+ * Items are queued by copy not reference so it is preferable to only
+ * queue small items, especially when called from an ISR. In most cases
+ * it would be preferable to store a pointer to the item being queued.
+ *
+ * @param xQueue The handle to the queue on which the item is to be posted.
+ *
+ * @param pvItemToQueue A pointer to the item that is to be placed on the
+ * queue. The size of the items the queue will hold was defined when the
+ * queue was created, so this many bytes will be copied from pvItemToQueue
+ * into the queue storage area.
+ *
+ * @param pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
+ * item at the back of the queue, or queueSEND_TO_FRONT to place the item
+ * at the front of the queue (for high priority messages).
+ *
+ * @return pdTRUE if the data was successfully sent to the queue, otherwise
+ * errQUEUE_FULL.
+ *
+ * Example usage for buffered IO (where the ISR can obtain more than one value
+ * per call):
+ * @code{c}
+ * void vBufferISR( void )
+ * {
+ * char cIn;
+ * BaseType_t xHigherPriorityTaskWokenByPost;
+ *
+ * // We have not woken a task at the start of the ISR.
+ * xHigherPriorityTaskWokenByPost = pdFALSE;
+ *
+ * // Loop until the buffer is empty.
+ * do
+ * {
+ * // Obtain a byte from the buffer.
+ * cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
+ *
+ * // Post each byte.
+ * xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK );
+ *
+ * } while( portINPUT_BYTE( BUFFER_COUNT ) );
+ *
+ * // Now the buffer is empty we can switch context if necessary. Note that the
+ * // name of the yield function required is port specific.
+ * if( xHigherPriorityTaskWokenByPost )
+ * {
+ * portYIELD_FROM_ISR();
+ * }
+ * }
+ * @endcode
+ *
+ * \defgroup xQueueSendFromISR xQueueSendFromISR
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
+ const void * const pvItemToQueue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueReceiveFromISR(
+ * QueueHandle_t xQueue,
+ * void *pvBuffer,
+ * BaseType_t *pxTaskWoken
+ * );
+ * @endcode
+ *
+ * Receive an item from a queue. It is safe to use this function from within an
+ * interrupt service routine.
+ *
+ * @param xQueue The handle to the queue from which the item is to be
+ * received.
+ *
+ * @param pvBuffer Pointer to the buffer into which the received item will
+ * be copied.
+ *
+ * @param pxTaskWoken A task may be blocked waiting for space to become
+ * available on the queue. If xQueueReceiveFromISR causes such a task to
+ * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
+ * remain unchanged.
+ *
+ * @return pdTRUE if an item was successfully received from the queue,
+ * otherwise pdFALSE.
+ *
+ * Example usage:
+ * @code{c}
+ *
+ * QueueHandle_t xQueue;
+ *
+ * // Function to create a queue and post some values.
+ * void vAFunction( void *pvParameters )
+ * {
+ * char cValueToPost;
+ * const TickType_t xTicksToWait = ( TickType_t )0xff;
+ *
+ * // Create a queue capable of containing 10 characters.
+ * xQueue = xQueueCreate( 10, sizeof( char ) );
+ * if( xQueue == 0 )
+ * {
+ * // Failed to create the queue.
+ * }
+ *
+ * // ...
+ *
+ * // Post some characters that will be used within an ISR. If the queue
+ * // is full then this task will block for xTicksToWait ticks.
+ * cValueToPost = 'a';
+ * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
+ * cValueToPost = 'b';
+ * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
+ *
+ * // ... keep posting characters ... this task may block when the queue
+ * // becomes full.
+ *
+ * cValueToPost = 'c';
+ * xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
+ * }
+ *
+ * // ISR that outputs all the characters received on the queue.
+ * void vISR_Routine( void )
+ * {
+ * BaseType_t xTaskWokenByReceive = pdFALSE;
+ * char cRxedChar;
+ *
+ * while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
+ * {
+ * // A character was received. Output the character now.
+ * vOutputCharacter( cRxedChar );
+ *
+ * // If removing the character from the queue woke the task that was
+ * // posting onto the queue xTaskWokenByReceive will have been set to
+ * // pdTRUE. No matter how many times this loop iterates only one
+ * // task will be woken.
+ * }
+ *
+ * if( xTaskWokenByReceive != ( char ) pdFALSE;
+ * {
+ * taskYIELD ();
+ * }
+ * }
+ * @endcode
+ * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
+ * \ingroup QueueManagement
+ */
+BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/*
+ * Utilities to query queues that are safe to use from an ISR. These utilities
+ * should be used only from within an ISR, or within a critical section.
+ */
+BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+
+/*
+ * The functions defined above are for passing data to and from tasks. The
+ * functions below are the equivalents for passing data to and from
+ * co-routines.
+ *
+ * These functions are called from the co-routine macro implementation and
+ * should not be called directly from application code. Instead use the macro
+ * wrappers defined within croutine.h.
+ */
+BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
+ const void * pvItemToQueue,
+ BaseType_t xCoRoutinePreviouslyWoken );
+BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
+ void * pvBuffer,
+ BaseType_t * pxTaskWoken );
+BaseType_t xQueueCRSend( QueueHandle_t xQueue,
+ const void * pvItemToQueue,
+ TickType_t xTicksToWait );
+BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
+ void * pvBuffer,
+ TickType_t xTicksToWait );
+
+/*
+ * For internal use only. Use xSemaphoreCreateMutex(),
+ * xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
+ * these functions directly.
+ */
+QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
+QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+
+/*
+ * For internal use only. Use xSemaphoreTakeMutexRecursive() or
+ * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
+ */
+BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
+
+/*
+ * Reset a queue back to its original empty state. The return value is now
+ * obsolete and is always set to pdPASS.
+ */
+#define xQueueReset( xQueue ) xQueueGenericReset( ( xQueue ), pdFALSE )
+
+/*
+ * The registry is provided as a means for kernel aware debuggers to
+ * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
+ * a queue, semaphore or mutex handle to the registry if you want the handle
+ * to be available to a kernel aware debugger. If you are not using a kernel
+ * aware debugger then this function can be ignored.
+ *
+ * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
+ * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
+ * within FreeRTOSConfig.h for the registry to be available. Its value
+ * does not affect the number of queues, semaphores and mutexes that can be
+ * created - just the number that the registry can hold.
+ *
+ * If vQueueAddToRegistry is called more than once with the same xQueue
+ * parameter, the registry will store the pcQueueName parameter from the
+ * most recent call to vQueueAddToRegistry.
+ *
+ * @param xQueue The handle of the queue being added to the registry. This
+ * is the handle returned by a call to xQueueCreate(). Semaphore and mutex
+ * handles can also be passed in here.
+ *
+ * @param pcQueueName The name to be associated with the handle. This is the
+ * name that the kernel aware debugger will display. The queue registry only
+ * stores a pointer to the string - so the string must be persistent (global or
+ * preferably in ROM/Flash), not on the stack.
+ */
+#if ( configQUEUE_REGISTRY_SIZE > 0 )
+ void vQueueAddToRegistry( QueueHandle_t xQueue,
+ const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+#endif
+
+/*
+ * The registry is provided as a means for kernel aware debuggers to
+ * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
+ * a queue, semaphore or mutex handle to the registry if you want the handle
+ * to be available to a kernel aware debugger, and vQueueUnregisterQueue() to
+ * remove the queue, semaphore or mutex from the register. If you are not using
+ * a kernel aware debugger then this function can be ignored.
+ *
+ * @param xQueue The handle of the queue being removed from the registry.
+ */
+#if ( configQUEUE_REGISTRY_SIZE > 0 )
+ void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+#endif
+
+/*
+ * The queue registry is provided as a means for kernel aware debuggers to
+ * locate queues, semaphores and mutexes. Call pcQueueGetName() to look
+ * up and return the name of a queue in the queue registry from the queue's
+ * handle.
+ *
+ * @param xQueue The handle of the queue the name of which will be returned.
+ * @return If the queue is in the registry then a pointer to the name of the
+ * queue is returned. If the queue is not in the registry then NULL is
+ * returned.
+ */
+#if ( configQUEUE_REGISTRY_SIZE > 0 )
+ const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+#endif
+
+/*
+ * Generic version of the function used to create a queue using dynamic memory
+ * allocation. This is called by other functions and macros that create other
+ * RTOS objects that use the queue structure as their base.
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+#endif
+
+/*
+ * Generic version of the function used to create a queue using dynamic memory
+ * allocation. This is called by other functions and macros that create other
+ * RTOS objects that use the queue structure as their base.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ uint8_t * pucQueueStorage,
+ StaticQueue_t * pxStaticQueue,
+ const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+#endif
+
+/*
+ * Queue sets provide a mechanism to allow a task to block (pend) on a read
+ * operation from multiple queues or semaphores simultaneously.
+ *
+ * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
+ * function.
+ *
+ * A queue set must be explicitly created using a call to xQueueCreateSet()
+ * before it can be used. Once created, standard FreeRTOS queues and semaphores
+ * can be added to the set using calls to xQueueAddToSet().
+ * xQueueSelectFromSet() is then used to determine which, if any, of the queues
+ * or semaphores contained in the set is in a state where a queue read or
+ * semaphore take operation would be successful.
+ *
+ * Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
+ * for reasons why queue sets are very rarely needed in practice as there are
+ * simpler methods of blocking on multiple objects.
+ *
+ * Note 2: Blocking on a queue set that contains a mutex will not cause the
+ * mutex holder to inherit the priority of the blocked task.
+ *
+ * Note 3: An additional 4 bytes of RAM is required for each space in a every
+ * queue added to a queue set. Therefore counting semaphores that have a high
+ * maximum count value should not be added to a queue set.
+ *
+ * Note 4: A receive (in the case of a queue) or take (in the case of a
+ * semaphore) operation must not be performed on a member of a queue set unless
+ * a call to xQueueSelectFromSet() has first returned a handle to that set member.
+ *
+ * @param uxEventQueueLength Queue sets store events that occur on
+ * the queues and semaphores contained in the set. uxEventQueueLength specifies
+ * the maximum number of events that can be queued at once. To be absolutely
+ * certain that events are not lost uxEventQueueLength should be set to the
+ * total sum of the length of the queues added to the set, where binary
+ * semaphores and mutexes have a length of 1, and counting semaphores have a
+ * length set by their maximum count value. Examples:
+ * + If a queue set is to hold a queue of length 5, another queue of length 12,
+ * and a binary semaphore, then uxEventQueueLength should be set to
+ * (5 + 12 + 1), or 18.
+ * + If a queue set is to hold three binary semaphores then uxEventQueueLength
+ * should be set to (1 + 1 + 1 ), or 3.
+ * + If a queue set is to hold a counting semaphore that has a maximum count of
+ * 5, and a counting semaphore that has a maximum count of 3, then
+ * uxEventQueueLength should be set to (5 + 3), or 8.
+ *
+ * @return If the queue set is created successfully then a handle to the created
+ * queue set is returned. Otherwise NULL is returned.
+ */
+QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
+
+/*
+ * Adds a queue or semaphore to a queue set that was previously created by a
+ * call to xQueueCreateSet().
+ *
+ * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
+ * function.
+ *
+ * Note 1: A receive (in the case of a queue) or take (in the case of a
+ * semaphore) operation must not be performed on a member of a queue set unless
+ * a call to xQueueSelectFromSet() has first returned a handle to that set member.
+ *
+ * @param xQueueOrSemaphore The handle of the queue or semaphore being added to
+ * the queue set (cast to an QueueSetMemberHandle_t type).
+ *
+ * @param xQueueSet The handle of the queue set to which the queue or semaphore
+ * is being added.
+ *
+ * @return If the queue or semaphore was successfully added to the queue set
+ * then pdPASS is returned. If the queue could not be successfully added to the
+ * queue set because it is already a member of a different queue set then pdFAIL
+ * is returned.
+ */
+BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+
+/*
+ * Removes a queue or semaphore from a queue set. A queue or semaphore can only
+ * be removed from a set if the queue or semaphore is empty.
+ *
+ * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
+ * function.
+ *
+ * @param xQueueOrSemaphore The handle of the queue or semaphore being removed
+ * from the queue set (cast to an QueueSetMemberHandle_t type).
+ *
+ * @param xQueueSet The handle of the queue set in which the queue or semaphore
+ * is included.
+ *
+ * @return If the queue or semaphore was successfully removed from the queue set
+ * then pdPASS is returned. If the queue was not in the queue set, or the
+ * queue (or semaphore) was not empty, then pdFAIL is returned.
+ */
+BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+
+/*
+ * xQueueSelectFromSet() selects from the members of a queue set a queue or
+ * semaphore that either contains data (in the case of a queue) or is available
+ * to take (in the case of a semaphore). xQueueSelectFromSet() effectively
+ * allows a task to block (pend) on a read operation on all the queues and
+ * semaphores in a queue set simultaneously.
+ *
+ * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
+ * function.
+ *
+ * Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
+ * for reasons why queue sets are very rarely needed in practice as there are
+ * simpler methods of blocking on multiple objects.
+ *
+ * Note 2: Blocking on a queue set that contains a mutex will not cause the
+ * mutex holder to inherit the priority of the blocked task.
+ *
+ * Note 3: A receive (in the case of a queue) or take (in the case of a
+ * semaphore) operation must not be performed on a member of a queue set unless
+ * a call to xQueueSelectFromSet() has first returned a handle to that set member.
+ *
+ * @param xQueueSet The queue set on which the task will (potentially) block.
+ *
+ * @param xTicksToWait The maximum time, in ticks, that the calling task will
+ * remain in the Blocked state (with other tasks executing) to wait for a member
+ * of the queue set to be ready for a successful queue read or semaphore take
+ * operation.
+ *
+ * @return xQueueSelectFromSet() will return the handle of a queue (cast to
+ * a QueueSetMemberHandle_t type) contained in the queue set that contains data,
+ * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained
+ * in the queue set that is available, or NULL if no such queue or semaphore
+ * exists before before the specified block time expires.
+ */
+QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/*
+ * A version of xQueueSelectFromSet() that can be used from an ISR.
+ */
+QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+
+/* Not public API functions. */
+void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
+ TickType_t xTicksToWait,
+ const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
+ BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
+void vQueueSetQueueNumber( QueueHandle_t xQueue,
+ UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
+UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* QUEUE_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/semphr.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/semphr.h
new file mode 100644
index 0000000..e0193bd
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/semphr.h
@@ -0,0 +1,1193 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef SEMAPHORE_H
+#define SEMAPHORE_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h" must appear in source files before "include semphr.h"
+#endif
+
+#include "queue.h"
+
+typedef QueueHandle_t SemaphoreHandle_t;
+
+#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( uint8_t ) 1U )
+#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( uint8_t ) 0U )
+#define semGIVE_BLOCK_TIME ( ( TickType_t ) 0U )
+
+
+/**
+ * semphr. h
+ * @code{c}
+ * vSemaphoreCreateBinary( SemaphoreHandle_t xSemaphore );
+ * @endcode
+ *
+ * In many usage scenarios it is faster and more memory efficient to use a
+ * direct to task notification in place of a binary semaphore!
+ * https://www.FreeRTOS.org/RTOS-task-notifications.html
+ *
+ * This old vSemaphoreCreateBinary() macro is now deprecated in favour of the
+ * xSemaphoreCreateBinary() function. Note that binary semaphores created using
+ * the vSemaphoreCreateBinary() macro are created in a state such that the
+ * first call to 'take' the semaphore would pass, whereas binary semaphores
+ * created using xSemaphoreCreateBinary() are created in a state such that the
+ * the semaphore must first be 'given' before it can be 'taken'.
+ *
+ * Macro that implements a semaphore by using the existing queue mechanism.
+ * The queue length is 1 as this is a binary semaphore. The data size is 0
+ * as we don't want to actually store any data - we just want to know if the
+ * queue is empty or full.
+ *
+ * This type of semaphore can be used for pure synchronisation between tasks or
+ * between an interrupt and a task. The semaphore need not be given back once
+ * obtained, so one task/interrupt can continuously 'give' the semaphore while
+ * another continuously 'takes' the semaphore. For this reason this type of
+ * semaphore does not use a priority inheritance mechanism. For an alternative
+ * that does use priority inheritance see xSemaphoreCreateMutex().
+ *
+ * @param xSemaphore Handle to the created semaphore. Should be of type SemaphoreHandle_t.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Semaphore cannot be used before a call to vSemaphoreCreateBinary ().
+ * // This is a macro so pass the variable in directly.
+ * vSemaphoreCreateBinary( xSemaphore );
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // The semaphore was created successfully.
+ * // The semaphore can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary
+ * \ingroup Semaphores
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #define vSemaphoreCreateBinary( xSemaphore ) \
+ { \
+ ( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ); \
+ if( ( xSemaphore ) != NULL ) \
+ { \
+ ( void ) xSemaphoreGive( ( xSemaphore ) ); \
+ } \
+ }
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateBinary( void );
+ * @endcode
+ *
+ * Creates a new binary semaphore instance, and returns a handle by which the
+ * new semaphore can be referenced.
+ *
+ * In many usage scenarios it is faster and more memory efficient to use a
+ * direct to task notification in place of a binary semaphore!
+ * https://www.FreeRTOS.org/RTOS-task-notifications.html
+ *
+ * Internally, within the FreeRTOS implementation, binary semaphores use a block
+ * of memory, in which the semaphore structure is stored. If a binary semaphore
+ * is created using xSemaphoreCreateBinary() then the required memory is
+ * automatically dynamically allocated inside the xSemaphoreCreateBinary()
+ * function. (see https://www.FreeRTOS.org/a00111.html). If a binary semaphore
+ * is created using xSemaphoreCreateBinaryStatic() then the application writer
+ * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a
+ * binary semaphore to be created without using any dynamic memory allocation.
+ *
+ * The old vSemaphoreCreateBinary() macro is now deprecated in favour of this
+ * xSemaphoreCreateBinary() function. Note that binary semaphores created using
+ * the vSemaphoreCreateBinary() macro are created in a state such that the
+ * first call to 'take' the semaphore would pass, whereas binary semaphores
+ * created using xSemaphoreCreateBinary() are created in a state such that the
+ * the semaphore must first be 'given' before it can be 'taken'.
+ *
+ * This type of semaphore can be used for pure synchronisation between tasks or
+ * between an interrupt and a task. The semaphore need not be given back once
+ * obtained, so one task/interrupt can continuously 'give' the semaphore while
+ * another continuously 'takes' the semaphore. For this reason this type of
+ * semaphore does not use a priority inheritance mechanism. For an alternative
+ * that does use priority inheritance see xSemaphoreCreateMutex().
+ *
+ * @return Handle to the created semaphore, or NULL if the memory required to
+ * hold the semaphore's data structures could not be allocated.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Semaphore cannot be used before a call to xSemaphoreCreateBinary().
+ * // This is a macro so pass the variable in directly.
+ * xSemaphore = xSemaphoreCreateBinary();
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // The semaphore was created successfully.
+ * // The semaphore can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateBinary xSemaphoreCreateBinary
+ * \ingroup Semaphores
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #define xSemaphoreCreateBinary() xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t *pxSemaphoreBuffer );
+ * @endcode
+ *
+ * Creates a new binary semaphore instance, and returns a handle by which the
+ * new semaphore can be referenced.
+ *
+ * NOTE: In many usage scenarios it is faster and more memory efficient to use a
+ * direct to task notification in place of a binary semaphore!
+ * https://www.FreeRTOS.org/RTOS-task-notifications.html
+ *
+ * Internally, within the FreeRTOS implementation, binary semaphores use a block
+ * of memory, in which the semaphore structure is stored. If a binary semaphore
+ * is created using xSemaphoreCreateBinary() then the required memory is
+ * automatically dynamically allocated inside the xSemaphoreCreateBinary()
+ * function. (see https://www.FreeRTOS.org/a00111.html). If a binary semaphore
+ * is created using xSemaphoreCreateBinaryStatic() then the application writer
+ * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a
+ * binary semaphore to be created without using any dynamic memory allocation.
+ *
+ * This type of semaphore can be used for pure synchronisation between tasks or
+ * between an interrupt and a task. The semaphore need not be given back once
+ * obtained, so one task/interrupt can continuously 'give' the semaphore while
+ * another continuously 'takes' the semaphore. For this reason this type of
+ * semaphore does not use a priority inheritance mechanism. For an alternative
+ * that does use priority inheritance see xSemaphoreCreateMutex().
+ *
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,
+ * which will then be used to hold the semaphore's data structure, removing the
+ * need for the memory to be allocated dynamically.
+ *
+ * @return If the semaphore is created then a handle to the created semaphore is
+ * returned. If pxSemaphoreBuffer is NULL then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore = NULL;
+ * StaticSemaphore_t xSemaphoreBuffer;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Semaphore cannot be used before a call to xSemaphoreCreateBinary().
+ * // The semaphore's data structures will be placed in the xSemaphoreBuffer
+ * // variable, the address of which is passed into the function. The
+ * // function's parameter is not NULL, so the function will not attempt any
+ * // dynamic memory allocation, and therefore the function will not return
+ * // return NULL.
+ * xSemaphore = xSemaphoreCreateBinary( &xSemaphoreBuffer );
+ *
+ * // Rest of task code goes here.
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateBinaryStatic xSemaphoreCreateBinaryStatic
+ * \ingroup Semaphores
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, ( pxStaticSemaphore ), queueQUEUE_TYPE_BINARY_SEMAPHORE )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreTake(
+ * SemaphoreHandle_t xSemaphore,
+ * TickType_t xBlockTime
+ * );
+ * @endcode
+ *
+ * Macro to obtain a semaphore. The semaphore must have previously been
+ * created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
+ * xSemaphoreCreateCounting().
+ *
+ * @param xSemaphore A handle to the semaphore being taken - obtained when
+ * the semaphore was created.
+ *
+ * @param xBlockTime The time in ticks to wait for the semaphore to become
+ * available. The macro portTICK_PERIOD_MS can be used to convert this to a
+ * real time. A block time of zero can be used to poll the semaphore. A block
+ * time of portMAX_DELAY can be used to block indefinitely (provided
+ * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
+ *
+ * @return pdTRUE if the semaphore was obtained. pdFALSE
+ * if xBlockTime expired without the semaphore becoming available.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * // A task that creates a semaphore.
+ * void vATask( void * pvParameters )
+ * {
+ * // Create the semaphore to guard a shared resource.
+ * xSemaphore = xSemaphoreCreateBinary();
+ * }
+ *
+ * // A task that uses the semaphore.
+ * void vAnotherTask( void * pvParameters )
+ * {
+ * // ... Do other things.
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // See if we can obtain the semaphore. If the semaphore is not available
+ * // wait 10 ticks to see if it becomes free.
+ * if( xSemaphoreTake( xSemaphore, ( TickType_t ) 10 ) == pdTRUE )
+ * {
+ * // We were able to obtain the semaphore and can now access the
+ * // shared resource.
+ *
+ * // ...
+ *
+ * // We have finished accessing the shared resource. Release the
+ * // semaphore.
+ * xSemaphoreGive( xSemaphore );
+ * }
+ * else
+ * {
+ * // We could not obtain the semaphore and can therefore not access
+ * // the shared resource safely.
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreTake xSemaphoreTake
+ * \ingroup Semaphores
+ */
+#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueSemaphoreTake( ( xSemaphore ), ( xBlockTime ) )
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreTakeRecursive(
+ * SemaphoreHandle_t xMutex,
+ * TickType_t xBlockTime
+ * );
+ * @endcode
+ *
+ * Macro to recursively obtain, or 'take', a mutex type semaphore.
+ * The mutex must have previously been created using a call to
+ * xSemaphoreCreateRecursiveMutex();
+ *
+ * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this
+ * macro to be available.
+ *
+ * This macro must not be used on mutexes created using xSemaphoreCreateMutex().
+ *
+ * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
+ * doesn't become available again until the owner has called
+ * xSemaphoreGiveRecursive() for each successful 'take' request. For example,
+ * if a task successfully 'takes' the same mutex 5 times then the mutex will
+ * not be available to any other task until it has also 'given' the mutex back
+ * exactly five times.
+ *
+ * @param xMutex A handle to the mutex being obtained. This is the
+ * handle returned by xSemaphoreCreateRecursiveMutex();
+ *
+ * @param xBlockTime The time in ticks to wait for the semaphore to become
+ * available. The macro portTICK_PERIOD_MS can be used to convert this to a
+ * real time. A block time of zero can be used to poll the semaphore. If
+ * the task already owns the semaphore then xSemaphoreTakeRecursive() will
+ * return immediately no matter what the value of xBlockTime.
+ *
+ * @return pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime
+ * expired without the semaphore becoming available.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xMutex = NULL;
+ *
+ * // A task that creates a mutex.
+ * void vATask( void * pvParameters )
+ * {
+ * // Create the mutex to guard a shared resource.
+ * xMutex = xSemaphoreCreateRecursiveMutex();
+ * }
+ *
+ * // A task that uses the mutex.
+ * void vAnotherTask( void * pvParameters )
+ * {
+ * // ... Do other things.
+ *
+ * if( xMutex != NULL )
+ * {
+ * // See if we can obtain the mutex. If the mutex is not available
+ * // wait 10 ticks to see if it becomes free.
+ * if( xSemaphoreTakeRecursive( xSemaphore, ( TickType_t ) 10 ) == pdTRUE )
+ * {
+ * // We were able to obtain the mutex and can now access the
+ * // shared resource.
+ *
+ * // ...
+ * // For some reason due to the nature of the code further calls to
+ * // xSemaphoreTakeRecursive() are made on the same mutex. In real
+ * // code these would not be just sequential calls as this would make
+ * // no sense. Instead the calls are likely to be buried inside
+ * // a more complex call structure.
+ * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
+ * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
+ *
+ * // The mutex has now been 'taken' three times, so will not be
+ * // available to another task until it has also been given back
+ * // three times. Again it is unlikely that real code would have
+ * // these calls sequentially, but instead buried in a more complex
+ * // call structure. This is just for illustrative purposes.
+ * xSemaphoreGiveRecursive( xMutex );
+ * xSemaphoreGiveRecursive( xMutex );
+ * xSemaphoreGiveRecursive( xMutex );
+ *
+ * // Now the mutex can be taken by other tasks.
+ * }
+ * else
+ * {
+ * // We could not obtain the mutex and can therefore not access
+ * // the shared resource safely.
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive
+ * \ingroup Semaphores
+ */
+#if ( configUSE_RECURSIVE_MUTEXES == 1 )
+ #define xSemaphoreTakeRecursive( xMutex, xBlockTime ) xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreGive( SemaphoreHandle_t xSemaphore );
+ * @endcode
+ *
+ * Macro to release a semaphore. The semaphore must have previously been
+ * created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
+ * xSemaphoreCreateCounting(). and obtained using sSemaphoreTake().
+ *
+ * This macro must not be used from an ISR. See xSemaphoreGiveFromISR () for
+ * an alternative which can be used from an ISR.
+ *
+ * This macro must also not be used on semaphores created using
+ * xSemaphoreCreateRecursiveMutex().
+ *
+ * @param xSemaphore A handle to the semaphore being released. This is the
+ * handle returned when the semaphore was created.
+ *
+ * @return pdTRUE if the semaphore was released. pdFALSE if an error occurred.
+ * Semaphores are implemented using queues. An error can occur if there is
+ * no space on the queue to post a message - indicating that the
+ * semaphore was not first obtained correctly.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Create the semaphore to guard a shared resource.
+ * xSemaphore = vSemaphoreCreateBinary();
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * if( xSemaphoreGive( xSemaphore ) != pdTRUE )
+ * {
+ * // We would expect this call to fail because we cannot give
+ * // a semaphore without first "taking" it!
+ * }
+ *
+ * // Obtain the semaphore - don't block if the semaphore is not
+ * // immediately available.
+ * if( xSemaphoreTake( xSemaphore, ( TickType_t ) 0 ) )
+ * {
+ * // We now have the semaphore and can access the shared resource.
+ *
+ * // ...
+ *
+ * // We have finished accessing the shared resource so can free the
+ * // semaphore.
+ * if( xSemaphoreGive( xSemaphore ) != pdTRUE )
+ * {
+ * // We would not expect this call to fail because we must have
+ * // obtained the semaphore to get here.
+ * }
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreGive xSemaphoreGive
+ * \ingroup Semaphores
+ */
+#define xSemaphoreGive( xSemaphore ) xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex );
+ * @endcode
+ *
+ * Macro to recursively release, or 'give', a mutex type semaphore.
+ * The mutex must have previously been created using a call to
+ * xSemaphoreCreateRecursiveMutex();
+ *
+ * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this
+ * macro to be available.
+ *
+ * This macro must not be used on mutexes created using xSemaphoreCreateMutex().
+ *
+ * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
+ * doesn't become available again until the owner has called
+ * xSemaphoreGiveRecursive() for each successful 'take' request. For example,
+ * if a task successfully 'takes' the same mutex 5 times then the mutex will
+ * not be available to any other task until it has also 'given' the mutex back
+ * exactly five times.
+ *
+ * @param xMutex A handle to the mutex being released, or 'given'. This is the
+ * handle returned by xSemaphoreCreateMutex();
+ *
+ * @return pdTRUE if the semaphore was given.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xMutex = NULL;
+ *
+ * // A task that creates a mutex.
+ * void vATask( void * pvParameters )
+ * {
+ * // Create the mutex to guard a shared resource.
+ * xMutex = xSemaphoreCreateRecursiveMutex();
+ * }
+ *
+ * // A task that uses the mutex.
+ * void vAnotherTask( void * pvParameters )
+ * {
+ * // ... Do other things.
+ *
+ * if( xMutex != NULL )
+ * {
+ * // See if we can obtain the mutex. If the mutex is not available
+ * // wait 10 ticks to see if it becomes free.
+ * if( xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ) == pdTRUE )
+ * {
+ * // We were able to obtain the mutex and can now access the
+ * // shared resource.
+ *
+ * // ...
+ * // For some reason due to the nature of the code further calls to
+ * // xSemaphoreTakeRecursive() are made on the same mutex. In real
+ * // code these would not be just sequential calls as this would make
+ * // no sense. Instead the calls are likely to be buried inside
+ * // a more complex call structure.
+ * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
+ * xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
+ *
+ * // The mutex has now been 'taken' three times, so will not be
+ * // available to another task until it has also been given back
+ * // three times. Again it is unlikely that real code would have
+ * // these calls sequentially, it would be more likely that the calls
+ * // to xSemaphoreGiveRecursive() would be called as a call stack
+ * // unwound. This is just for demonstrative purposes.
+ * xSemaphoreGiveRecursive( xMutex );
+ * xSemaphoreGiveRecursive( xMutex );
+ * xSemaphoreGiveRecursive( xMutex );
+ *
+ * // Now the mutex can be taken by other tasks.
+ * }
+ * else
+ * {
+ * // We could not obtain the mutex and can therefore not access
+ * // the shared resource safely.
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreGiveRecursive xSemaphoreGiveRecursive
+ * \ingroup Semaphores
+ */
+#if ( configUSE_RECURSIVE_MUTEXES == 1 )
+ #define xSemaphoreGiveRecursive( xMutex ) xQueueGiveMutexRecursive( ( xMutex ) )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreGiveFromISR(
+ * SemaphoreHandle_t xSemaphore,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * Macro to release a semaphore. The semaphore must have previously been
+ * created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting().
+ *
+ * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex())
+ * must not be used with this macro.
+ *
+ * This macro can be used from an ISR.
+ *
+ * @param xSemaphore A handle to the semaphore being released. This is the
+ * handle returned when the semaphore was created.
+ *
+ * @param pxHigherPriorityTaskWoken xSemaphoreGiveFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if giving the semaphore caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xSemaphoreGiveFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return pdTRUE if the semaphore was successfully given, otherwise errQUEUE_FULL.
+ *
+ * Example usage:
+ * @code{c}
+ \#define LONG_TIME 0xffff
+ \#define TICKS_TO_WAIT 10
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * // Repetitive task.
+ * void vATask( void * pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // We want this task to run every 10 ticks of a timer. The semaphore
+ * // was created before this task was started.
+ *
+ * // Block waiting for the semaphore to become available.
+ * if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE )
+ * {
+ * // It is time to execute.
+ *
+ * // ...
+ *
+ * // We have finished our task. Return to the top of the loop where
+ * // we will block on the semaphore until it is time to execute
+ * // again. Note when using the semaphore for synchronisation with an
+ * // ISR in this manner there is no need to 'give' the semaphore back.
+ * }
+ * }
+ * }
+ *
+ * // Timer ISR
+ * void vTimerISR( void * pvParameters )
+ * {
+ * static uint8_t ucLocalTickCount = 0;
+ * static BaseType_t xHigherPriorityTaskWoken;
+ *
+ * // A timer tick has occurred.
+ *
+ * // ... Do other time functions.
+ *
+ * // Is it time for vATask () to run?
+ * xHigherPriorityTaskWoken = pdFALSE;
+ * ucLocalTickCount++;
+ * if( ucLocalTickCount >= TICKS_TO_WAIT )
+ * {
+ * // Unblock the task by releasing the semaphore.
+ * xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );
+ *
+ * // Reset the count so we release the semaphore again in 10 ticks time.
+ * ucLocalTickCount = 0;
+ * }
+ *
+ * if( xHigherPriorityTaskWoken != pdFALSE )
+ * {
+ * // We can force a context switch here. Context switching from an
+ * // ISR uses port specific syntax. Check the demo task for your port
+ * // to find the syntax required.
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreGiveFromISR xSemaphoreGiveFromISR
+ * \ingroup Semaphores
+ */
+#define xSemaphoreGiveFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueGiveFromISR( ( QueueHandle_t ) ( xSemaphore ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * semphr. h
+ * @code{c}
+ * xSemaphoreTakeFromISR(
+ * SemaphoreHandle_t xSemaphore,
+ * BaseType_t *pxHigherPriorityTaskWoken
+ * );
+ * @endcode
+ *
+ * Macro to take a semaphore from an ISR. The semaphore must have
+ * previously been created with a call to xSemaphoreCreateBinary() or
+ * xSemaphoreCreateCounting().
+ *
+ * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex())
+ * must not be used with this macro.
+ *
+ * This macro can be used from an ISR, however taking a semaphore from an ISR
+ * is not a common operation. It is likely to only be useful when taking a
+ * counting semaphore when an interrupt is obtaining an object from a resource
+ * pool (when the semaphore count indicates the number of resources available).
+ *
+ * @param xSemaphore A handle to the semaphore being taken. This is the
+ * handle returned when the semaphore was created.
+ *
+ * @param pxHigherPriorityTaskWoken xSemaphoreTakeFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if taking the semaphore caused a task
+ * to unblock, and the unblocked task has a priority higher than the currently
+ * running task. If xSemaphoreTakeFromISR() sets this value to pdTRUE then
+ * a context switch should be requested before the interrupt is exited.
+ *
+ * @return pdTRUE if the semaphore was successfully taken, otherwise
+ * pdFALSE
+ */
+#define xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateMutex( void );
+ * @endcode
+ *
+ * Creates a new mutex type semaphore instance, and returns a handle by which
+ * the new mutex can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, mutex semaphores use a block
+ * of memory, in which the mutex structure is stored. If a mutex is created
+ * using xSemaphoreCreateMutex() then the required memory is automatically
+ * dynamically allocated inside the xSemaphoreCreateMutex() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a mutex is created using
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the
+ * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created
+ * without using any dynamic memory allocation.
+ *
+ * Mutexes created using this function can be accessed using the xSemaphoreTake()
+ * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
+ * xSemaphoreGiveRecursive() macros must not be used.
+ *
+ * This type of semaphore uses a priority inheritance mechanism so a task
+ * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
+ * semaphore it is no longer required.
+ *
+ * Mutex type semaphores cannot be used from within interrupt service routines.
+ *
+ * See xSemaphoreCreateBinary() for an alternative implementation that can be
+ * used for pure synchronisation (where one task or interrupt always 'gives' the
+ * semaphore and another always 'takes' the semaphore) and from within interrupt
+ * service routines.
+ *
+ * @return If the mutex was successfully created then a handle to the created
+ * semaphore is returned. If there was not enough heap to allocate the mutex
+ * data structures then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Semaphore cannot be used before a call to xSemaphoreCreateMutex().
+ * // This is a macro so pass the variable in directly.
+ * xSemaphore = xSemaphoreCreateMutex();
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // The semaphore was created successfully.
+ * // The semaphore can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateMutex xSemaphoreCreateMutex
+ * \ingroup Semaphores
+ */
+#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_MUTEXES == 1 ) )
+ #define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateMutexStatic( StaticSemaphore_t *pxMutexBuffer );
+ * @endcode
+ *
+ * Creates a new mutex type semaphore instance, and returns a handle by which
+ * the new mutex can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, mutex semaphores use a block
+ * of memory, in which the mutex structure is stored. If a mutex is created
+ * using xSemaphoreCreateMutex() then the required memory is automatically
+ * dynamically allocated inside the xSemaphoreCreateMutex() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a mutex is created using
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the
+ * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created
+ * without using any dynamic memory allocation.
+ *
+ * Mutexes created using this function can be accessed using the xSemaphoreTake()
+ * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
+ * xSemaphoreGiveRecursive() macros must not be used.
+ *
+ * This type of semaphore uses a priority inheritance mechanism so a task
+ * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
+ * semaphore it is no longer required.
+ *
+ * Mutex type semaphores cannot be used from within interrupt service routines.
+ *
+ * See xSemaphoreCreateBinary() for an alternative implementation that can be
+ * used for pure synchronisation (where one task or interrupt always 'gives' the
+ * semaphore and another always 'takes' the semaphore) and from within interrupt
+ * service routines.
+ *
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,
+ * which will be used to hold the mutex's data structure, removing the need for
+ * the memory to be allocated dynamically.
+ *
+ * @return If the mutex was successfully created then a handle to the created
+ * mutex is returned. If pxMutexBuffer was NULL then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ * StaticSemaphore_t xMutexBuffer;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // A mutex cannot be used before it has been created. xMutexBuffer is
+ * // into xSemaphoreCreateMutexStatic() so no dynamic memory allocation is
+ * // attempted.
+ * xSemaphore = xSemaphoreCreateMutexStatic( &xMutexBuffer );
+ *
+ * // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
+ * // so there is no need to check it.
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateMutexStatic xSemaphoreCreateMutexStatic
+ * \ingroup Semaphores
+ */
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_MUTEXES == 1 ) )
+ #define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutexStatic( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) )
+#endif
+
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void );
+ * @endcode
+ *
+ * Creates a new recursive mutex type semaphore instance, and returns a handle
+ * by which the new recursive mutex can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, recursive mutexes use a block
+ * of memory, in which the mutex structure is stored. If a recursive mutex is
+ * created using xSemaphoreCreateRecursiveMutex() then the required memory is
+ * automatically dynamically allocated inside the
+ * xSemaphoreCreateRecursiveMutex() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a recursive mutex is created using
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must
+ * provide the memory that will get used by the mutex.
+ * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
+ * be created without using any dynamic memory allocation.
+ *
+ * Mutexes created using this macro can be accessed using the
+ * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The
+ * xSemaphoreTake() and xSemaphoreGive() macros must not be used.
+ *
+ * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
+ * doesn't become available again until the owner has called
+ * xSemaphoreGiveRecursive() for each successful 'take' request. For example,
+ * if a task successfully 'takes' the same mutex 5 times then the mutex will
+ * not be available to any other task until it has also 'given' the mutex back
+ * exactly five times.
+ *
+ * This type of semaphore uses a priority inheritance mechanism so a task
+ * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
+ * semaphore it is no longer required.
+ *
+ * Mutex type semaphores cannot be used from within interrupt service routines.
+ *
+ * See xSemaphoreCreateBinary() for an alternative implementation that can be
+ * used for pure synchronisation (where one task or interrupt always 'gives' the
+ * semaphore and another always 'takes' the semaphore) and from within interrupt
+ * service routines.
+ *
+ * @return xSemaphore Handle to the created mutex semaphore. Should be of type
+ * SemaphoreHandle_t.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // Semaphore cannot be used before a call to xSemaphoreCreateMutex().
+ * // This is a macro so pass the variable in directly.
+ * xSemaphore = xSemaphoreCreateRecursiveMutex();
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // The semaphore was created successfully.
+ * // The semaphore can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateRecursiveMutex xSemaphoreCreateRecursiveMutex
+ * \ingroup Semaphores
+ */
+#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) )
+ #define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic( StaticSemaphore_t *pxMutexBuffer );
+ * @endcode
+ *
+ * Creates a new recursive mutex type semaphore instance, and returns a handle
+ * by which the new recursive mutex can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, recursive mutexes use a block
+ * of memory, in which the mutex structure is stored. If a recursive mutex is
+ * created using xSemaphoreCreateRecursiveMutex() then the required memory is
+ * automatically dynamically allocated inside the
+ * xSemaphoreCreateRecursiveMutex() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a recursive mutex is created using
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must
+ * provide the memory that will get used by the mutex.
+ * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
+ * be created without using any dynamic memory allocation.
+ *
+ * Mutexes created using this macro can be accessed using the
+ * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The
+ * xSemaphoreTake() and xSemaphoreGive() macros must not be used.
+ *
+ * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
+ * doesn't become available again until the owner has called
+ * xSemaphoreGiveRecursive() for each successful 'take' request. For example,
+ * if a task successfully 'takes' the same mutex 5 times then the mutex will
+ * not be available to any other task until it has also 'given' the mutex back
+ * exactly five times.
+ *
+ * This type of semaphore uses a priority inheritance mechanism so a task
+ * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
+ * semaphore it is no longer required.
+ *
+ * Mutex type semaphores cannot be used from within interrupt service routines.
+ *
+ * See xSemaphoreCreateBinary() for an alternative implementation that can be
+ * used for pure synchronisation (where one task or interrupt always 'gives' the
+ * semaphore and another always 'takes' the semaphore) and from within interrupt
+ * service routines.
+ *
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,
+ * which will then be used to hold the recursive mutex's data structure,
+ * removing the need for the memory to be allocated dynamically.
+ *
+ * @return If the recursive mutex was successfully created then a handle to the
+ * created recursive mutex is returned. If pxMutexBuffer was NULL then NULL is
+ * returned.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ * StaticSemaphore_t xMutexBuffer;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * // A recursive semaphore cannot be used before it is created. Here a
+ * // recursive mutex is created using xSemaphoreCreateRecursiveMutexStatic().
+ * // The address of xMutexBuffer is passed into the function, and will hold
+ * // the mutexes data structures - so no dynamic memory allocation will be
+ * // attempted.
+ * xSemaphore = xSemaphoreCreateRecursiveMutexStatic( &xMutexBuffer );
+ *
+ * // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
+ * // so there is no need to check it.
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateRecursiveMutexStatic xSemaphoreCreateRecursiveMutexStatic
+ * \ingroup Semaphores
+ */
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) )
+ #define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutexStatic( queueQUEUE_TYPE_RECURSIVE_MUTEX, ( pxStaticSemaphore ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount );
+ * @endcode
+ *
+ * Creates a new counting semaphore instance, and returns a handle by which the
+ * new counting semaphore can be referenced.
+ *
+ * In many usage scenarios it is faster and more memory efficient to use a
+ * direct to task notification in place of a counting semaphore!
+ * https://www.FreeRTOS.org/RTOS-task-notifications.html
+ *
+ * Internally, within the FreeRTOS implementation, counting semaphores use a
+ * block of memory, in which the counting semaphore structure is stored. If a
+ * counting semaphore is created using xSemaphoreCreateCounting() then the
+ * required memory is automatically dynamically allocated inside the
+ * xSemaphoreCreateCounting() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a counting semaphore is created
+ * using xSemaphoreCreateCountingStatic() then the application writer can
+ * instead optionally provide the memory that will get used by the counting
+ * semaphore. xSemaphoreCreateCountingStatic() therefore allows a counting
+ * semaphore to be created without using any dynamic memory allocation.
+ *
+ * Counting semaphores are typically used for two things:
+ *
+ * 1) Counting events.
+ *
+ * In this usage scenario an event handler will 'give' a semaphore each time
+ * an event occurs (incrementing the semaphore count value), and a handler
+ * task will 'take' a semaphore each time it processes an event
+ * (decrementing the semaphore count value). The count value is therefore
+ * the difference between the number of events that have occurred and the
+ * number that have been processed. In this case it is desirable for the
+ * initial count value to be zero.
+ *
+ * 2) Resource management.
+ *
+ * In this usage scenario the count value indicates the number of resources
+ * available. To obtain control of a resource a task must first obtain a
+ * semaphore - decrementing the semaphore count value. When the count value
+ * reaches zero there are no free resources. When a task finishes with the
+ * resource it 'gives' the semaphore back - incrementing the semaphore count
+ * value. In this case it is desirable for the initial count value to be
+ * equal to the maximum count value, indicating that all resources are free.
+ *
+ * @param uxMaxCount The maximum count value that can be reached. When the
+ * semaphore reaches this value it can no longer be 'given'.
+ *
+ * @param uxInitialCount The count value assigned to the semaphore when it is
+ * created.
+ *
+ * @return Handle to the created semaphore. Null if the semaphore could not be
+ * created.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * // Semaphore cannot be used before a call to xSemaphoreCreateCounting().
+ * // The max value to which the semaphore can count should be 10, and the
+ * // initial value assigned to the count should be 0.
+ * xSemaphore = xSemaphoreCreateCounting( 10, 0 );
+ *
+ * if( xSemaphore != NULL )
+ * {
+ * // The semaphore was created successfully.
+ * // The semaphore can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateCounting xSemaphoreCreateCounting
+ * \ingroup Semaphores
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ) )
+#endif
+
+/**
+ * semphr. h
+ * @code{c}
+ * SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer );
+ * @endcode
+ *
+ * Creates a new counting semaphore instance, and returns a handle by which the
+ * new counting semaphore can be referenced.
+ *
+ * In many usage scenarios it is faster and more memory efficient to use a
+ * direct to task notification in place of a counting semaphore!
+ * https://www.FreeRTOS.org/RTOS-task-notifications.html
+ *
+ * Internally, within the FreeRTOS implementation, counting semaphores use a
+ * block of memory, in which the counting semaphore structure is stored. If a
+ * counting semaphore is created using xSemaphoreCreateCounting() then the
+ * required memory is automatically dynamically allocated inside the
+ * xSemaphoreCreateCounting() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a counting semaphore is created
+ * using xSemaphoreCreateCountingStatic() then the application writer must
+ * provide the memory. xSemaphoreCreateCountingStatic() therefore allows a
+ * counting semaphore to be created without using any dynamic memory allocation.
+ *
+ * Counting semaphores are typically used for two things:
+ *
+ * 1) Counting events.
+ *
+ * In this usage scenario an event handler will 'give' a semaphore each time
+ * an event occurs (incrementing the semaphore count value), and a handler
+ * task will 'take' a semaphore each time it processes an event
+ * (decrementing the semaphore count value). The count value is therefore
+ * the difference between the number of events that have occurred and the
+ * number that have been processed. In this case it is desirable for the
+ * initial count value to be zero.
+ *
+ * 2) Resource management.
+ *
+ * In this usage scenario the count value indicates the number of resources
+ * available. To obtain control of a resource a task must first obtain a
+ * semaphore - decrementing the semaphore count value. When the count value
+ * reaches zero there are no free resources. When a task finishes with the
+ * resource it 'gives' the semaphore back - incrementing the semaphore count
+ * value. In this case it is desirable for the initial count value to be
+ * equal to the maximum count value, indicating that all resources are free.
+ *
+ * @param uxMaxCount The maximum count value that can be reached. When the
+ * semaphore reaches this value it can no longer be 'given'.
+ *
+ * @param uxInitialCount The count value assigned to the semaphore when it is
+ * created.
+ *
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,
+ * which will then be used to hold the semaphore's data structure, removing the
+ * need for the memory to be allocated dynamically.
+ *
+ * @return If the counting semaphore was successfully created then a handle to
+ * the created counting semaphore is returned. If pxSemaphoreBuffer was NULL
+ * then NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * SemaphoreHandle_t xSemaphore;
+ * StaticSemaphore_t xSemaphoreBuffer;
+ *
+ * void vATask( void * pvParameters )
+ * {
+ * SemaphoreHandle_t xSemaphore = NULL;
+ *
+ * // Counting semaphore cannot be used before they have been created. Create
+ * // a counting semaphore using xSemaphoreCreateCountingStatic(). The max
+ * // value to which the semaphore can count is 10, and the initial value
+ * // assigned to the count will be 0. The address of xSemaphoreBuffer is
+ * // passed in and will be used to hold the semaphore structure, so no dynamic
+ * // memory allocation will be used.
+ * xSemaphore = xSemaphoreCreateCounting( 10, 0, &xSemaphoreBuffer );
+ *
+ * // No memory allocation was attempted so xSemaphore cannot be NULL, so there
+ * // is no need to check its value.
+ * }
+ * @endcode
+ * \defgroup xSemaphoreCreateCountingStatic xSemaphoreCreateCountingStatic
+ * \ingroup Semaphores
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xSemaphoreCreateCountingStatic( uxMaxCount, uxInitialCount, pxSemaphoreBuffer ) xQueueCreateCountingSemaphoreStatic( ( uxMaxCount ), ( uxInitialCount ), ( pxSemaphoreBuffer ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * semphr. h
+ * @code{c}
+ * void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );
+ * @endcode
+ *
+ * Delete a semaphore. This function must be used with care. For example,
+ * do not delete a mutex type semaphore if the mutex is held by a task.
+ *
+ * @param xSemaphore A handle to the semaphore to be deleted.
+ *
+ * \defgroup vSemaphoreDelete vSemaphoreDelete
+ * \ingroup Semaphores
+ */
+#define vSemaphoreDelete( xSemaphore ) vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )
+
+/**
+ * semphr.h
+ * @code{c}
+ * TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );
+ * @endcode
+ *
+ * If xMutex is indeed a mutex type semaphore, return the current mutex holder.
+ * If xMutex is not a mutex type semaphore, or the mutex is available (not held
+ * by a task), return NULL.
+ *
+ * Note: This is a good way of determining if the calling task is the mutex
+ * holder, but not a good way of determining the identity of the mutex holder as
+ * the holder may change between the function exiting and the returned value
+ * being tested.
+ */
+#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
+ #define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
+#endif
+
+/**
+ * semphr.h
+ * @code{c}
+ * TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );
+ * @endcode
+ *
+ * If xMutex is indeed a mutex type semaphore, return the current mutex holder.
+ * If xMutex is not a mutex type semaphore, or the mutex is available (not held
+ * by a task), return NULL.
+ *
+ */
+#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
+ #define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )
+#endif
+
+/**
+ * semphr.h
+ * @code{c}
+ * UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );
+ * @endcode
+ *
+ * If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns
+ * its current count value. If the semaphore is a binary semaphore then
+ * uxSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the
+ * semaphore is not available.
+ *
+ */
+#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
+
+/**
+ * semphr.h
+ * @code{c}
+ * UBaseType_t uxSemaphoreGetCountFromISR( SemaphoreHandle_t xSemaphore );
+ * @endcode
+ *
+ * If the semaphore is a counting semaphore then uxSemaphoreGetCountFromISR() returns
+ * its current count value. If the semaphore is a binary semaphore then
+ * uxSemaphoreGetCountFromISR() returns 1 if the semaphore is available, and 0 if the
+ * semaphore is not available.
+ *
+ */
+#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
+
+#endif /* SEMAPHORE_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stack_macros.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stack_macros.h
new file mode 100644
index 0000000..a289bd0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stack_macros.h
@@ -0,0 +1,137 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef STACK_MACROS_H
+#define STACK_MACROS_H
+
+/*
+ * Call the stack overflow hook function if the stack of the task being swapped
+ * out is currently overflowed, or looks like it might have overflowed in the
+ * past.
+ *
+ * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
+ * the current stack state only - comparing the current top of stack value to
+ * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
+ * will also cause the last few stack bytes to be checked to ensure the value
+ * to which the bytes were set when the task was created have not been
+ * overwritten. Note this second test does not guarantee that an overflowed
+ * stack will always be recognised.
+ */
+
+/*-----------------------------------------------------------*/
+
+/*
+ * portSTACK_LIMIT_PADDING is a number of extra words to consider to be in
+ * use on the stack.
+ */
+#ifndef portSTACK_LIMIT_PADDING
+ #define portSTACK_LIMIT_PADDING 0
+#endif
+
+#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
+
+/* Only the current stack state is to be checked. */
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ { \
+ /* Is the currently saved stack pointer within the stack limit? */ \
+ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
+ { \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, (signed char *)pxCurrentTCB->pcTaskName ); \
+ } \
+ }
+
+#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
+/*-----------------------------------------------------------*/
+
+#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
+
+/* Only the current stack state is to be checked. */
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ { \
+ \
+ /* Is the currently saved stack pointer within the stack limit? */ \
+ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
+ { \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
+ } \
+ }
+
+#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
+/*-----------------------------------------------------------*/
+
+#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
+
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ { \
+ const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
+ const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
+ \
+ if( ( pulStack[ 0 ] != ulCheckValue ) || \
+ ( pulStack[ 1 ] != ulCheckValue ) || \
+ ( pulStack[ 2 ] != ulCheckValue ) || \
+ ( pulStack[ 3 ] != ulCheckValue ) ) \
+ { \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
+ } \
+ }
+
+#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
+
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ { \
+ int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
+ static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
+ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
+ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
+ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
+ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
+ \
+ \
+ pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
+ \
+ /* Has the extremity of the task stack ever been written over? */ \
+ if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
+ { \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
+ } \
+ }
+
+#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
+/*-----------------------------------------------------------*/
+
+/* Remove stack overflow macro if not being used. */
+#ifndef taskCHECK_FOR_STACK_OVERFLOW
+ #define taskCHECK_FOR_STACK_OVERFLOW()
+#endif
+
+
+
+#endif /* STACK_MACROS_H */
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/stdint.readme b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stdint.readme
similarity index 88%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/stdint.readme
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stdint.readme
index 629ae4b..03208f8 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/include/stdint.readme
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stdint.readme
@@ -1,52 +1,58 @@
-/*
- * FreeRTOS Kernel V10.4.3 LTS Patch 2
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
-
-#ifndef FREERTOS_STDINT
-#define FREERTOS_STDINT
-
-/*******************************************************************************
- * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions
- * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be
- * built using compilers that do not provide their own stdint.h definition.
- *
- * To use this file:
- *
- * 1) Copy this file into the directory that contains your FreeRTOSConfig.h
- * header file, as that directory will already be in the compiler's include
- * path.
- *
- * 2) Rename the copied file stdint.h.
- *
- */
-
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef long int32_t;
-typedef unsigned long uint32_t;
-
-#endif /* FREERTOS_STDINT */
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef FREERTOS_STDINT
+#define FREERTOS_STDINT
+
+/*******************************************************************************
+ * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions
+ * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be
+ * built using compilers that do not provide their own stdint.h definition.
+ *
+ * To use this file:
+ *
+ * 1) Copy this file into the directory that contains your FreeRTOSConfig.h
+ * header file, as that directory will already be in the compiler's include
+ * path.
+ *
+ * 2) Rename the copied file stdint.h.
+ *
+ */
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef long int32_t;
+typedef unsigned long uint32_t;
+
+#ifndef SIZE_MAX
+ #define SIZE_MAX ( ( size_t ) -1 )
+#endif
+
+#endif /* FREERTOS_STDINT */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stream_buffer.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stream_buffer.h
new file mode 100644
index 0000000..955c094
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/stream_buffer.h
@@ -0,0 +1,913 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+ * Stream buffers are used to send a continuous stream of data from one task or
+ * interrupt to another. Their implementation is light weight, making them
+ * particularly suited for interrupt to task and core to core communication
+ * scenarios.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xStreamBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xStreamBufferReceive()) inside a critical section section and set the
+ * receive block time to 0.
+ *
+ */
+
+#ifndef STREAM_BUFFER_H
+#define STREAM_BUFFER_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include stream_buffer.h"
+#endif
+
+/* *INDENT-OFF* */
+#if defined( __cplusplus )
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/**
+ * Type by which stream buffers are referenced. For example, a call to
+ * xStreamBufferCreate() returns an StreamBufferHandle_t variable that can
+ * then be used as a parameter to xStreamBufferSend(), xStreamBufferReceive(),
+ * etc.
+ */
+struct StreamBufferDef_t;
+typedef struct StreamBufferDef_t * StreamBufferHandle_t;
+
+/**
+ * Type used as a stream buffer's optional callback.
+ */
+typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuffer,
+ BaseType_t xIsInsideISR,
+ BaseType_t * const pxHigherPriorityTaskWoken );
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * StreamBufferHandle_t xStreamBufferCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes );
+ * @endcode
+ *
+ * Creates a new stream buffer using dynamically allocated memory. See
+ * xStreamBufferCreateStatic() for a version that uses statically allocated
+ * memory (memory that is allocated at compile time).
+ *
+ * configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
+ * FreeRTOSConfig.h for xStreamBufferCreate() to be available.
+ *
+ * @param xBufferSizeBytes The total number of bytes the stream buffer will be
+ * able to hold at any one time.
+ *
+ * @param xTriggerLevelBytes The number of bytes that must be in the stream
+ * buffer before a task that is blocked on the stream buffer to wait for data is
+ * moved out of the blocked state. For example, if a task is blocked on a read
+ * of an empty stream buffer that has a trigger level of 1 then the task will be
+ * unblocked when a single byte is written to the buffer or the task's block
+ * time expires. As another example, if a task is blocked on a read of an empty
+ * stream buffer that has a trigger level of 10 then the task will not be
+ * unblocked until the stream buffer contains at least 10 bytes or the task's
+ * block time expires. If a reading task's block time expires before the
+ * trigger level is reached then the task will still receive however many bytes
+ * are actually available. Setting a trigger level of 0 will result in a
+ * trigger level of 1 being used. It is not valid to specify a trigger level
+ * that is greater than the buffer size.
+ *
+ * @param pxSendCompletedCallback Callback invoked when number of bytes at least equal to
+ * trigger level is sent to the stream buffer. If the parameter is NULL, it will use the default
+ * implementation provided by sbSEND_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when more than zero bytes are read from a
+ * stream buffer. If the parameter is NULL, it will use the default
+ * implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @return If NULL is returned, then the stream buffer cannot be created
+ * because there is insufficient heap memory available for FreeRTOS to allocate
+ * the stream buffer data structures and storage area. A non-NULL value being
+ * returned indicates that the stream buffer has been created successfully -
+ * the returned value should be stored as the handle to the created stream
+ * buffer.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * void vAFunction( void )
+ * {
+ * StreamBufferHandle_t xStreamBuffer;
+ * const size_t xStreamBufferSizeBytes = 100, xTriggerLevel = 10;
+ *
+ * // Create a stream buffer that can hold 100 bytes. The memory used to hold
+ * // both the stream buffer structure and the data in the stream buffer is
+ * // allocated dynamically.
+ * xStreamBuffer = xStreamBufferCreate( xStreamBufferSizeBytes, xTriggerLevel );
+ *
+ * if( xStreamBuffer == NULL )
+ * {
+ * // There was not enough heap memory space available to create the
+ * // stream buffer.
+ * }
+ * else
+ * {
+ * // The stream buffer was created successfully and can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xStreamBufferCreate xStreamBufferCreate
+ * \ingroup StreamBufferManagement
+ */
+
+#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xStreamBufferCreateWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * StreamBufferHandle_t xStreamBufferCreateStatic( size_t xBufferSizeBytes,
+ * size_t xTriggerLevelBytes,
+ * uint8_t *pucStreamBufferStorageArea,
+ * StaticStreamBuffer_t *pxStaticStreamBuffer );
+ * @endcode
+ * Creates a new stream buffer using statically allocated memory. See
+ * xStreamBufferCreate() for a version that uses dynamically allocated memory.
+ *
+ * configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h for
+ * xStreamBufferCreateStatic() to be available.
+ *
+ * @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
+ * pucStreamBufferStorageArea parameter.
+ *
+ * @param xTriggerLevelBytes The number of bytes that must be in the stream
+ * buffer before a task that is blocked on the stream buffer to wait for data is
+ * moved out of the blocked state. For example, if a task is blocked on a read
+ * of an empty stream buffer that has a trigger level of 1 then the task will be
+ * unblocked when a single byte is written to the buffer or the task's block
+ * time expires. As another example, if a task is blocked on a read of an empty
+ * stream buffer that has a trigger level of 10 then the task will not be
+ * unblocked until the stream buffer contains at least 10 bytes or the task's
+ * block time expires. If a reading task's block time expires before the
+ * trigger level is reached then the task will still receive however many bytes
+ * are actually available. Setting a trigger level of 0 will result in a
+ * trigger level of 1 being used. It is not valid to specify a trigger level
+ * that is greater than the buffer size.
+ *
+ * @param pucStreamBufferStorageArea Must point to a uint8_t array that is at
+ * least xBufferSizeBytes big. This is the array to which streams are
+ * copied when they are written to the stream buffer.
+ *
+ * @param pxStaticStreamBuffer Must point to a variable of type
+ * StaticStreamBuffer_t, which will be used to hold the stream buffer's data
+ * structure.
+ *
+ * @param pxSendCompletedCallback Callback invoked when number of bytes at least equal to
+ * trigger level is sent to the stream buffer. If the parameter is NULL, it will use the default
+ * implementation provided by sbSEND_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when more than zero bytes are read from a
+ * stream buffer. If the parameter is NULL, it will use the default
+ * implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
+ * configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @return If the stream buffer is created successfully then a handle to the
+ * created stream buffer is returned. If either pucStreamBufferStorageArea or
+ * pxStaticstreamBuffer are NULL then NULL is returned.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * // Used to dimension the array used to hold the streams. The available space
+ * // will actually be one less than this, so 999.
+ #define STORAGE_SIZE_BYTES 1000
+ *
+ * // Defines the memory that will actually hold the streams within the stream
+ * // buffer.
+ * static uint8_t ucStorageBuffer[ STORAGE_SIZE_BYTES ];
+ *
+ * // The variable used to hold the stream buffer structure.
+ * StaticStreamBuffer_t xStreamBufferStruct;
+ *
+ * void MyFunction( void )
+ * {
+ * StreamBufferHandle_t xStreamBuffer;
+ * const size_t xTriggerLevel = 1;
+ *
+ * xStreamBuffer = xStreamBufferCreateStatic( sizeof( ucStorageBuffer ),
+ * xTriggerLevel,
+ * ucStorageBuffer,
+ * &xStreamBufferStruct );
+ *
+ * // As neither the pucStreamBufferStorageArea or pxStaticStreamBuffer
+ * // parameters were NULL, xStreamBuffer will not be NULL, and can be used to
+ * // reference the created stream buffer in other stream buffer API calls.
+ *
+ * // Other code that uses the stream buffer can go here.
+ * }
+ *
+ * @endcode
+ * \defgroup xStreamBufferCreateStatic xStreamBufferCreateStatic
+ * \ingroup StreamBufferManagement
+ */
+
+#define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xStreamBufferCreateStaticWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Sends bytes to a stream buffer. The bytes are copied into the stream buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xStreamBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xStreamBufferReceive()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xStreamBufferSend() to write to a stream buffer from a task. Use
+ * xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
+ * service routine (ISR).
+ *
+ * @param xStreamBuffer The handle of the stream buffer to which a stream is
+ * being sent.
+ *
+ * @param pvTxData A pointer to the buffer that holds the bytes to be copied
+ * into the stream buffer.
+ *
+ * @param xDataLengthBytes The maximum number of bytes to copy from pvTxData
+ * into the stream buffer.
+ *
+ * @param xTicksToWait The maximum amount of time the task should remain in the
+ * Blocked state to wait for enough space to become available in the stream
+ * buffer, should the stream buffer contain too little space to hold the
+ * another xDataLengthBytes bytes. The block time is specified in tick periods,
+ * so the absolute time it represents is dependent on the tick frequency. The
+ * macro pdMS_TO_TICKS() can be used to convert a time specified in milliseconds
+ * into a time specified in ticks. Setting xTicksToWait to portMAX_DELAY will
+ * cause the task to wait indefinitely (without timing out), provided
+ * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h. If a task times out
+ * before it can write all xDataLengthBytes into the buffer it will still write
+ * as many bytes as possible. A task does not use any CPU time when it is in
+ * the blocked state.
+ *
+ * @return The number of bytes written to the stream buffer. If a task times
+ * out before it can write all xDataLengthBytes into the buffer it will still
+ * write as many bytes as possible.
+ *
+ * Example use:
+ * @code{c}
+ * void vAFunction( StreamBufferHandle_t xStreamBuffer )
+ * {
+ * size_t xBytesSent;
+ * uint8_t ucArrayToSend[] = { 0, 1, 2, 3 };
+ * char *pcStringToSend = "String to send";
+ * const TickType_t x100ms = pdMS_TO_TICKS( 100 );
+ *
+ * // Send an array to the stream buffer, blocking for a maximum of 100ms to
+ * // wait for enough space to be available in the stream buffer.
+ * xBytesSent = xStreamBufferSend( xStreamBuffer, ( void * ) ucArrayToSend, sizeof( ucArrayToSend ), x100ms );
+ *
+ * if( xBytesSent != sizeof( ucArrayToSend ) )
+ * {
+ * // The call to xStreamBufferSend() times out before there was enough
+ * // space in the buffer for the data to be written, but it did
+ * // successfully write xBytesSent bytes.
+ * }
+ *
+ * // Send the string to the stream buffer. Return immediately if there is not
+ * // enough space in the buffer.
+ * xBytesSent = xStreamBufferSend( xStreamBuffer, ( void * ) pcStringToSend, strlen( pcStringToSend ), 0 );
+ *
+ * if( xBytesSent != strlen( pcStringToSend ) )
+ * {
+ * // The entire string could not be added to the stream buffer because
+ * // there was not enough free space in the buffer, but xBytesSent bytes
+ * // were sent. Could try again to send the remaining bytes.
+ * }
+ * }
+ * @endcode
+ * \defgroup xStreamBufferSend xStreamBufferSend
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
+ const void * pvTxData,
+ size_t xDataLengthBytes,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * Interrupt safe version of the API function that sends a stream of bytes to
+ * the stream buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xStreamBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xStreamBufferReceive()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xStreamBufferSend() to write to a stream buffer from a task. Use
+ * xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
+ * service routine (ISR).
+ *
+ * @param xStreamBuffer The handle of the stream buffer to which a stream is
+ * being sent.
+ *
+ * @param pvTxData A pointer to the data that is to be copied into the stream
+ * buffer.
+ *
+ * @param xDataLengthBytes The maximum number of bytes to copy from pvTxData
+ * into the stream buffer.
+ *
+ * @param pxHigherPriorityTaskWoken It is possible that a stream buffer will
+ * have a task blocked on it waiting for data. Calling
+ * xStreamBufferSendFromISR() can make data available, and so cause a task that
+ * was waiting for data to leave the Blocked state. If calling
+ * xStreamBufferSendFromISR() causes a task to leave the Blocked state, and the
+ * unblocked task has a priority higher than the currently executing task (the
+ * task that was interrupted), then, internally, xStreamBufferSendFromISR()
+ * will set *pxHigherPriorityTaskWoken to pdTRUE. If
+ * xStreamBufferSendFromISR() sets this value to pdTRUE, then normally a
+ * context switch should be performed before the interrupt is exited. This will
+ * ensure that the interrupt returns directly to the highest priority Ready
+ * state task. *pxHigherPriorityTaskWoken should be set to pdFALSE before it
+ * is passed into the function. See the example code below for an example.
+ *
+ * @return The number of bytes actually written to the stream buffer, which will
+ * be less than xDataLengthBytes if the stream buffer didn't have enough free
+ * space for all the bytes to be written.
+ *
+ * Example use:
+ * @code{c}
+ * // A stream buffer that has already been created.
+ * StreamBufferHandle_t xStreamBuffer;
+ *
+ * void vAnInterruptServiceRoutine( void )
+ * {
+ * size_t xBytesSent;
+ * char *pcStringToSend = "String to send";
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Initialised to pdFALSE.
+ *
+ * // Attempt to send the string to the stream buffer.
+ * xBytesSent = xStreamBufferSendFromISR( xStreamBuffer,
+ * ( void * ) pcStringToSend,
+ * strlen( pcStringToSend ),
+ * &xHigherPriorityTaskWoken );
+ *
+ * if( xBytesSent != strlen( pcStringToSend ) )
+ * {
+ * // There was not enough free space in the stream buffer for the entire
+ * // string to be written, ut xBytesSent bytes were written.
+ * }
+ *
+ * // If xHigherPriorityTaskWoken was set to pdTRUE inside
+ * // xStreamBufferSendFromISR() then a task that has a priority above the
+ * // priority of the currently executing task was unblocked and a context
+ * // switch should be performed to ensure the ISR returns to the unblocked
+ * // task. In most FreeRTOS ports this is done by simply passing
+ * // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
+ * // variables value, and perform the context switch if necessary. Check the
+ * // documentation for the port in use for port specific instructions.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ * }
+ * @endcode
+ * \defgroup xStreamBufferSendFromISR xStreamBufferSendFromISR
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
+ const void * pvTxData,
+ size_t xDataLengthBytes,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Receives bytes from a stream buffer.
+ *
+ * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
+ * implementation (so also the message buffer implementation, as message buffers
+ * are built on top of stream buffers) assumes there is only one task or
+ * interrupt that will write to the buffer (the writer), and only one task or
+ * interrupt that will read from the buffer (the reader). It is safe for the
+ * writer and reader to be different tasks or interrupts, but, unlike other
+ * FreeRTOS objects, it is not safe to have multiple different writers or
+ * multiple different readers. If there are to be multiple different writers
+ * then the application writer must place each call to a writing API function
+ * (such as xStreamBufferSend()) inside a critical section and set the send
+ * block time to 0. Likewise, if there are to be multiple different readers
+ * then the application writer must place each call to a reading API function
+ * (such as xStreamBufferReceive()) inside a critical section and set the receive
+ * block time to 0.
+ *
+ * Use xStreamBufferReceive() to read from a stream buffer from a task. Use
+ * xStreamBufferReceiveFromISR() to read from a stream buffer from an
+ * interrupt service routine (ISR).
+ *
+ * @param xStreamBuffer The handle of the stream buffer from which bytes are to
+ * be received.
+ *
+ * @param pvRxData A pointer to the buffer into which the received bytes will be
+ * copied.
+ *
+ * @param xBufferLengthBytes The length of the buffer pointed to by the
+ * pvRxData parameter. This sets the maximum number of bytes to receive in one
+ * call. xStreamBufferReceive will return as many bytes as possible up to a
+ * maximum set by xBufferLengthBytes.
+ *
+ * @param xTicksToWait The maximum amount of time the task should remain in the
+ * Blocked state to wait for data to become available if the stream buffer is
+ * empty. xStreamBufferReceive() will return immediately if xTicksToWait is
+ * zero. The block time is specified in tick periods, so the absolute time it
+ * represents is dependent on the tick frequency. The macro pdMS_TO_TICKS() can
+ * be used to convert a time specified in milliseconds into a time specified in
+ * ticks. Setting xTicksToWait to portMAX_DELAY will cause the task to wait
+ * indefinitely (without timing out), provided INCLUDE_vTaskSuspend is set to 1
+ * in FreeRTOSConfig.h. A task does not use any CPU time when it is in the
+ * Blocked state.
+ *
+ * @return The number of bytes actually read from the stream buffer, which will
+ * be less than xBufferLengthBytes if the call to xStreamBufferReceive() timed
+ * out before xBufferLengthBytes were available.
+ *
+ * Example use:
+ * @code{c}
+ * void vAFunction( StreamBuffer_t xStreamBuffer )
+ * {
+ * uint8_t ucRxData[ 20 ];
+ * size_t xReceivedBytes;
+ * const TickType_t xBlockTime = pdMS_TO_TICKS( 20 );
+ *
+ * // Receive up to another sizeof( ucRxData ) bytes from the stream buffer.
+ * // Wait in the Blocked state (so not using any CPU processing time) for a
+ * // maximum of 100ms for the full sizeof( ucRxData ) number of bytes to be
+ * // available.
+ * xReceivedBytes = xStreamBufferReceive( xStreamBuffer,
+ * ( void * ) ucRxData,
+ * sizeof( ucRxData ),
+ * xBlockTime );
+ *
+ * if( xReceivedBytes > 0 )
+ * {
+ * // A ucRxData contains another xReceivedBytes bytes of data, which can
+ * // be processed here....
+ * }
+ * }
+ * @endcode
+ * \defgroup xStreamBufferReceive xStreamBufferReceive
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
+ void * pvRxData,
+ size_t xBufferLengthBytes,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * An interrupt safe version of the API function that receives bytes from a
+ * stream buffer.
+ *
+ * Use xStreamBufferReceive() to read bytes from a stream buffer from a task.
+ * Use xStreamBufferReceiveFromISR() to read bytes from a stream buffer from an
+ * interrupt service routine (ISR).
+ *
+ * @param xStreamBuffer The handle of the stream buffer from which a stream
+ * is being received.
+ *
+ * @param pvRxData A pointer to the buffer into which the received bytes are
+ * copied.
+ *
+ * @param xBufferLengthBytes The length of the buffer pointed to by the
+ * pvRxData parameter. This sets the maximum number of bytes to receive in one
+ * call. xStreamBufferReceive will return as many bytes as possible up to a
+ * maximum set by xBufferLengthBytes.
+ *
+ * @param pxHigherPriorityTaskWoken It is possible that a stream buffer will
+ * have a task blocked on it waiting for space to become available. Calling
+ * xStreamBufferReceiveFromISR() can make space available, and so cause a task
+ * that is waiting for space to leave the Blocked state. If calling
+ * xStreamBufferReceiveFromISR() causes a task to leave the Blocked state, and
+ * the unblocked task has a priority higher than the currently executing task
+ * (the task that was interrupted), then, internally,
+ * xStreamBufferReceiveFromISR() will set *pxHigherPriorityTaskWoken to pdTRUE.
+ * If xStreamBufferReceiveFromISR() sets this value to pdTRUE, then normally a
+ * context switch should be performed before the interrupt is exited. That will
+ * ensure the interrupt returns directly to the highest priority Ready state
+ * task. *pxHigherPriorityTaskWoken should be set to pdFALSE before it is
+ * passed into the function. See the code example below for an example.
+ *
+ * @return The number of bytes read from the stream buffer, if any.
+ *
+ * Example use:
+ * @code{c}
+ * // A stream buffer that has already been created.
+ * StreamBuffer_t xStreamBuffer;
+ *
+ * void vAnInterruptServiceRoutine( void )
+ * {
+ * uint8_t ucRxData[ 20 ];
+ * size_t xReceivedBytes;
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Initialised to pdFALSE.
+ *
+ * // Receive the next stream from the stream buffer.
+ * xReceivedBytes = xStreamBufferReceiveFromISR( xStreamBuffer,
+ * ( void * ) ucRxData,
+ * sizeof( ucRxData ),
+ * &xHigherPriorityTaskWoken );
+ *
+ * if( xReceivedBytes > 0 )
+ * {
+ * // ucRxData contains xReceivedBytes read from the stream buffer.
+ * // Process the stream here....
+ * }
+ *
+ * // If xHigherPriorityTaskWoken was set to pdTRUE inside
+ * // xStreamBufferReceiveFromISR() then a task that has a priority above the
+ * // priority of the currently executing task was unblocked and a context
+ * // switch should be performed to ensure the ISR returns to the unblocked
+ * // task. In most FreeRTOS ports this is done by simply passing
+ * // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
+ * // variables value, and perform the context switch if necessary. Check the
+ * // documentation for the port in use for port specific instructions.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ * }
+ * @endcode
+ * \defgroup xStreamBufferReceiveFromISR xStreamBufferReceiveFromISR
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
+ void * pvRxData,
+ size_t xBufferLengthBytes,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Deletes a stream buffer that was previously created using a call to
+ * xStreamBufferCreate() or xStreamBufferCreateStatic(). If the stream
+ * buffer was created using dynamic memory (that is, by xStreamBufferCreate()),
+ * then the allocated memory is freed.
+ *
+ * A stream buffer handle must not be used after the stream buffer has been
+ * deleted.
+ *
+ * @param xStreamBuffer The handle of the stream buffer to be deleted.
+ *
+ * \defgroup vStreamBufferDelete vStreamBufferDelete
+ * \ingroup StreamBufferManagement
+ */
+void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Queries a stream buffer to see if it is full. A stream buffer is full if it
+ * does not have any free space, and therefore cannot accept any more data.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being queried.
+ *
+ * @return If the stream buffer is full then pdTRUE is returned. Otherwise
+ * pdFALSE is returned.
+ *
+ * \defgroup xStreamBufferIsFull xStreamBufferIsFull
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Queries a stream buffer to see if it is empty. A stream buffer is empty if
+ * it does not contain any data.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being queried.
+ *
+ * @return If the stream buffer is empty then pdTRUE is returned. Otherwise
+ * pdFALSE is returned.
+ *
+ * \defgroup xStreamBufferIsEmpty xStreamBufferIsEmpty
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Resets a stream buffer to its initial, empty, state. Any data that was in
+ * the stream buffer is discarded. A stream buffer can only be reset if there
+ * are no tasks blocked waiting to either send to or receive from the stream
+ * buffer.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being reset.
+ *
+ * @return If the stream buffer is reset then pdPASS is returned. If there was
+ * a task blocked waiting to send to or read from the stream buffer then the
+ * stream buffer is not reset and pdFAIL is returned.
+ *
+ * \defgroup xStreamBufferReset xStreamBufferReset
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Queries a stream buffer to see how much free space it contains, which is
+ * equal to the amount of data that can be sent to the stream buffer before it
+ * is full.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being queried.
+ *
+ * @return The number of bytes that can be written to the stream buffer before
+ * the stream buffer would be full.
+ *
+ * \defgroup xStreamBufferSpacesAvailable xStreamBufferSpacesAvailable
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Queries a stream buffer to see how much data it contains, which is equal to
+ * the number of bytes that can be read from the stream buffer before the stream
+ * buffer would be empty.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being queried.
+ *
+ * @return The number of bytes that can be read from the stream buffer before
+ * the stream buffer would be empty.
+ *
+ * \defgroup xStreamBufferBytesAvailable xStreamBufferBytesAvailable
+ * \ingroup StreamBufferManagement
+ */
+size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel );
+ * @endcode
+ *
+ * A stream buffer's trigger level is the number of bytes that must be in the
+ * stream buffer before a task that is blocked on the stream buffer to
+ * wait for data is moved out of the blocked state. For example, if a task is
+ * blocked on a read of an empty stream buffer that has a trigger level of 1
+ * then the task will be unblocked when a single byte is written to the buffer
+ * or the task's block time expires. As another example, if a task is blocked
+ * on a read of an empty stream buffer that has a trigger level of 10 then the
+ * task will not be unblocked until the stream buffer contains at least 10 bytes
+ * or the task's block time expires. If a reading task's block time expires
+ * before the trigger level is reached then the task will still receive however
+ * many bytes are actually available. Setting a trigger level of 0 will result
+ * in a trigger level of 1 being used. It is not valid to specify a trigger
+ * level that is greater than the buffer size.
+ *
+ * A trigger level is set when the stream buffer is created, and can be modified
+ * using xStreamBufferSetTriggerLevel().
+ *
+ * @param xStreamBuffer The handle of the stream buffer being updated.
+ *
+ * @param xTriggerLevel The new trigger level for the stream buffer.
+ *
+ * @return If xTriggerLevel was less than or equal to the stream buffer's length
+ * then the trigger level will be updated and pdTRUE is returned. Otherwise
+ * pdFALSE is returned.
+ *
+ * \defgroup xStreamBufferSetTriggerLevel xStreamBufferSetTriggerLevel
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
+ size_t xTriggerLevel ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * For advanced users only.
+ *
+ * The sbSEND_COMPLETED() macro is called from within the FreeRTOS APIs when
+ * data is sent to a message buffer or stream buffer. If there was a task that
+ * was blocked on the message or stream buffer waiting for data to arrive then
+ * the sbSEND_COMPLETED() macro sends a notification to the task to remove it
+ * from the Blocked state. xStreamBufferSendCompletedFromISR() does the same
+ * thing. It is provided to enable application writers to implement their own
+ * version of sbSEND_COMPLETED(), and MUST NOT BE USED AT ANY OTHER TIME.
+ *
+ * See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
+ * additional information.
+ *
+ * @param xStreamBuffer The handle of the stream buffer to which data was
+ * written.
+ *
+ * @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
+ * initialised to pdFALSE before it is passed into
+ * xStreamBufferSendCompletedFromISR(). If calling
+ * xStreamBufferSendCompletedFromISR() removes a task from the Blocked state,
+ * and the task has a priority above the priority of the currently running task,
+ * then *pxHigherPriorityTaskWoken will get set to pdTRUE indicating that a
+ * context switch should be performed before exiting the ISR.
+ *
+ * @return If a task was removed from the Blocked state then pdTRUE is returned.
+ * Otherwise pdFALSE is returned.
+ *
+ * \defgroup xStreamBufferSendCompletedFromISR xStreamBufferSendCompletedFromISR
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * For advanced users only.
+ *
+ * The sbRECEIVE_COMPLETED() macro is called from within the FreeRTOS APIs when
+ * data is read out of a message buffer or stream buffer. If there was a task
+ * that was blocked on the message or stream buffer waiting for data to arrive
+ * then the sbRECEIVE_COMPLETED() macro sends a notification to the task to
+ * remove it from the Blocked state. xStreamBufferReceiveCompletedFromISR()
+ * does the same thing. It is provided to enable application writers to
+ * implement their own version of sbRECEIVE_COMPLETED(), and MUST NOT BE USED AT
+ * ANY OTHER TIME.
+ *
+ * See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
+ * additional information.
+ *
+ * @param xStreamBuffer The handle of the stream buffer from which data was
+ * read.
+ *
+ * @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
+ * initialised to pdFALSE before it is passed into
+ * xStreamBufferReceiveCompletedFromISR(). If calling
+ * xStreamBufferReceiveCompletedFromISR() removes a task from the Blocked state,
+ * and the task has a priority above the priority of the currently running task,
+ * then *pxHigherPriorityTaskWoken will get set to pdTRUE indicating that a
+ * context switch should be performed before exiting the ISR.
+ *
+ * @return If a task was removed from the Blocked state then pdTRUE is returned.
+ * Otherwise pdFALSE is returned.
+ *
+ * \defgroup xStreamBufferReceiveCompletedFromISR xStreamBufferReceiveCompletedFromISR
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/* Functions below here are not part of the public API. */
+StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
+ size_t xTriggerLevelBytes,
+ BaseType_t xIsMessageBuffer,
+ StreamBufferCallbackFunction_t pxSendCompletedCallback,
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
+
+
+StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
+ size_t xTriggerLevelBytes,
+ BaseType_t xIsMessageBuffer,
+ uint8_t * const pucStreamBufferStorageArea,
+ StaticStreamBuffer_t * const pxStaticStreamBuffer,
+ StreamBufferCallbackFunction_t pxSendCompletedCallback,
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
+
+size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+ void vStreamBufferSetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer,
+ UBaseType_t uxStreamBufferNumber ) PRIVILEGED_FUNCTION;
+ UBaseType_t uxStreamBufferGetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+ uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+#endif
+
+/* *INDENT-OFF* */
+#if defined( __cplusplus )
+ }
+#endif
+/* *INDENT-ON* */
+
+#endif /* !defined( STREAM_BUFFER_H ) */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/task.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/task.h
new file mode 100644
index 0000000..bae94c6
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/task.h
@@ -0,0 +1,3141 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ * 1 tab == 4 spaces!
+ *
+ * Copyright 2019 MicroEJ Corp. This file has been modified by MicroEJ Corp.
+ * 1. Patch for SystemView support
+ */
+
+
+#ifndef INC_TASK_H
+#define INC_TASK_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include task.h"
+#endif
+
+#include "list.h"
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/*-----------------------------------------------------------
+* MACROS AND DEFINITIONS
+*----------------------------------------------------------*/
+
+/*
+ * If tskKERNEL_VERSION_NUMBER ends with + it represents the version in development
+ * after the numbered release.
+ *
+ * The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD
+ * values will reflect the last released version number.
+ */
+#define tskKERNEL_VERSION_NUMBER "V10.5.1"
+#define tskKERNEL_VERSION_MAJOR 10
+#define tskKERNEL_VERSION_MINOR 5
+#define tskKERNEL_VERSION_BUILD 1
+
+/* MPU region parameters passed in ulParameters
+ * of MemoryRegion_t struct. */
+#define tskMPU_REGION_READ_ONLY ( 1UL << 0UL )
+#define tskMPU_REGION_READ_WRITE ( 1UL << 1UL )
+#define tskMPU_REGION_EXECUTE_NEVER ( 1UL << 2UL )
+#define tskMPU_REGION_NORMAL_MEMORY ( 1UL << 3UL )
+#define tskMPU_REGION_DEVICE_MEMORY ( 1UL << 4UL )
+
+/* The direct to task notification feature used to have only a single notification
+ * per task. Now there is an array of notifications per task that is dimensioned by
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES. For backward compatibility, any use of the
+ * original direct to task notification defaults to using the first index in the
+ * array. */
+#define tskDEFAULT_INDEX_TO_NOTIFY ( 0 )
+
+/**
+ * task. h
+ *
+ * Type by which tasks are referenced. For example, a call to xTaskCreate
+ * returns (via a pointer parameter) an TaskHandle_t variable that can then
+ * be used as a parameter to vTaskDelete to delete the task.
+ *
+ * \defgroup TaskHandle_t TaskHandle_t
+ * \ingroup Tasks
+ */
+struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
+typedef struct tskTaskControlBlock * TaskHandle_t;
+
+/*
+ * Defines the prototype to which the application task hook function must
+ * conform.
+ */
+typedef BaseType_t (* TaskHookFunction_t)( void * );
+
+/* Task states returned by eTaskGetState. */
+typedef enum
+{
+ eRunning = 0, /* A task is querying the state of itself, so must be running. */
+ eReady, /* The task being queried is in a ready or pending ready list. */
+ eBlocked, /* The task being queried is in the Blocked state. */
+ eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
+ eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */
+ eInvalid /* Used as an 'invalid state' value. */
+} eTaskState;
+
+/* Actions that can be performed when vTaskNotify() is called. */
+typedef enum
+{
+ eNoAction = 0, /* Notify the task without updating its notify value. */
+ eSetBits, /* Set bits in the task's notification value. */
+ eIncrement, /* Increment the task's notification value. */
+ eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
+ eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
+} eNotifyAction;
+
+/*
+ * Used internally only.
+ */
+typedef struct xTIME_OUT
+{
+ BaseType_t xOverflowCount;
+ TickType_t xTimeOnEntering;
+} TimeOut_t;
+
+/*
+ * Defines the memory ranges allocated to the task when an MPU is used.
+ */
+typedef struct xMEMORY_REGION
+{
+ void * pvBaseAddress;
+ uint32_t ulLengthInBytes;
+ uint32_t ulParameters;
+} MemoryRegion_t;
+
+/*
+ * Parameters required to create an MPU protected task.
+ */
+typedef struct xTASK_PARAMETERS
+{
+ TaskFunction_t pvTaskCode;
+ const char * pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ configSTACK_DEPTH_TYPE usStackDepth;
+ void * pvParameters;
+ UBaseType_t uxPriority;
+ StackType_t * puxStackBuffer;
+ MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ];
+ #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ StaticTask_t * const pxTaskBuffer;
+ #endif
+} TaskParameters_t;
+
+/* Used with the uxTaskGetSystemState() function to return the state of each task
+ * in the system. */
+typedef struct xTASK_STATUS
+{
+ TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
+ const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ UBaseType_t xTaskNumber; /* A number unique to the task. */
+ eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
+ UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
+ UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
+ configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
+ StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
+ #if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
+ StackType_t * pxTopOfStack; /* Points to the top address of the task's stack area. */
+ StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
+ #endif
+ configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
+} TaskStatus_t;
+
+/* Possible return values for eTaskConfirmSleepModeStatus(). */
+typedef enum
+{
+ eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
+ eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
+ #if ( INCLUDE_vTaskSuspend == 1 )
+ eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
+ #endif /* INCLUDE_vTaskSuspend */
+} eSleepModeStatus;
+
+/**
+ * Defines the priority used by the idle task. This must not be modified.
+ *
+ * \ingroup TaskUtils
+ */
+#define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
+
+/**
+ * task. h
+ *
+ * Macro for forcing a context switch.
+ *
+ * \defgroup taskYIELD taskYIELD
+ * \ingroup SchedulerControl
+ */
+#define taskYIELD() portYIELD()
+
+/**
+ * task. h
+ *
+ * Macro to mark the start of a critical code region. Preemptive context
+ * switches cannot occur when in a critical region.
+ *
+ * NOTE: This may alter the stack (depending on the portable implementation)
+ * so must be used with care!
+ *
+ * \defgroup taskENTER_CRITICAL taskENTER_CRITICAL
+ * \ingroup SchedulerControl
+ */
+#define taskENTER_CRITICAL() portENTER_CRITICAL()
+#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+
+/**
+ * task. h
+ *
+ * Macro to mark the end of a critical code region. Preemptive context
+ * switches cannot occur when in a critical region.
+ *
+ * NOTE: This may alter the stack (depending on the portable implementation)
+ * so must be used with care!
+ *
+ * \defgroup taskEXIT_CRITICAL taskEXIT_CRITICAL
+ * \ingroup SchedulerControl
+ */
+#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
+#define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
+
+/**
+ * task. h
+ *
+ * Macro to disable all maskable interrupts.
+ *
+ * \defgroup taskDISABLE_INTERRUPTS taskDISABLE_INTERRUPTS
+ * \ingroup SchedulerControl
+ */
+#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
+
+/**
+ * task. h
+ *
+ * Macro to enable microcontroller interrupts.
+ *
+ * \defgroup taskENABLE_INTERRUPTS taskENABLE_INTERRUPTS
+ * \ingroup SchedulerControl
+ */
+#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
+
+/* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
+ * 0 to generate more optimal code when configASSERT() is defined as the constant
+ * is used in assert() statements. */
+#define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
+#define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
+#define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
+
+
+/*-----------------------------------------------------------
+* TASK CREATION API
+*----------------------------------------------------------*/
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskCreate(
+ * TaskFunction_t pxTaskCode,
+ * const char *pcName,
+ * configSTACK_DEPTH_TYPE usStackDepth,
+ * void *pvParameters,
+ * UBaseType_t uxPriority,
+ * TaskHandle_t *pxCreatedTask
+ * );
+ * @endcode
+ *
+ * Create a new task and add it to the list of tasks that are ready to run.
+ *
+ * Internally, within the FreeRTOS implementation, tasks use two blocks of
+ * memory. The first block is used to hold the task's data structures. The
+ * second block is used by the task as its stack. If a task is created using
+ * xTaskCreate() then both blocks of memory are automatically dynamically
+ * allocated inside the xTaskCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a task is created using
+ * xTaskCreateStatic() then the application writer must provide the required
+ * memory. xTaskCreateStatic() therefore allows a task to be created without
+ * using any dynamic memory allocation.
+ *
+ * See xTaskCreateStatic() for a version that does not use any dynamic memory
+ * allocation.
+ *
+ * xTaskCreate() can only be used to create a task that has unrestricted
+ * access to the entire microcontroller memory map. Systems that include MPU
+ * support can alternatively create an MPU constrained task using
+ * xTaskCreateRestricted().
+ *
+ * @param pxTaskCode Pointer to the task entry function. Tasks
+ * must be implemented to never return (i.e. continuous loop).
+ *
+ * @param pcName A descriptive name for the task. This is mainly used to
+ * facilitate debugging. Max length defined by configMAX_TASK_NAME_LEN - default
+ * is 16.
+ *
+ * @param usStackDepth The size of the task stack specified as the number of
+ * variables the stack can hold - not the number of bytes. For example, if
+ * the stack is 16 bits wide and usStackDepth is defined as 100, 200 bytes
+ * will be allocated for stack storage.
+ *
+ * @param pvParameters Pointer that will be used as the parameter for the task
+ * being created.
+ *
+ * @param uxPriority The priority at which the task should run. Systems that
+ * include MPU support can optionally create tasks in a privileged (system)
+ * mode by setting bit portPRIVILEGE_BIT of the priority parameter. For
+ * example, to create a privileged task at priority 2 the uxPriority parameter
+ * should be set to ( 2 | portPRIVILEGE_BIT ).
+ *
+ * @param pxCreatedTask Used to pass back a handle by which the created task
+ * can be referenced.
+ *
+ * @return pdPASS if the task was successfully created and added to a ready
+ * list, otherwise an error code defined in the file projdefs.h
+ *
+ * Example usage:
+ * @code{c}
+ * // Task to be created.
+ * void vTaskCode( void * pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Task code goes here.
+ * }
+ * }
+ *
+ * // Function that creates a task.
+ * void vOtherFunction( void )
+ * {
+ * static uint8_t ucParameterToPass;
+ * TaskHandle_t xHandle = NULL;
+ *
+ * // Create the task, storing the handle. Note that the passed parameter ucParameterToPass
+ * // must exist for the lifetime of the task, so in this case is declared static. If it was just an
+ * // an automatic stack variable it might no longer exist, or at least have been corrupted, by the time
+ * // the new task attempts to access it.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, &ucParameterToPass, tskIDLE_PRIORITY, &xHandle );
+ * configASSERT( xHandle );
+ *
+ * // Use the handle to delete the task.
+ * if( xHandle != NULL )
+ * {
+ * vTaskDelete( xHandle );
+ * }
+ * }
+ * @endcode
+ * \defgroup xTaskCreate xTaskCreate
+ * \ingroup Tasks
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
+ const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const configSTACK_DEPTH_TYPE usStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * task. h
+ * @code{c}
+ * TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ * const char *pcName,
+ * uint32_t ulStackDepth,
+ * void *pvParameters,
+ * UBaseType_t uxPriority,
+ * StackType_t *puxStackBuffer,
+ * StaticTask_t *pxTaskBuffer );
+ * @endcode
+ *
+ * Create a new task and add it to the list of tasks that are ready to run.
+ *
+ * Internally, within the FreeRTOS implementation, tasks use two blocks of
+ * memory. The first block is used to hold the task's data structures. The
+ * second block is used by the task as its stack. If a task is created using
+ * xTaskCreate() then both blocks of memory are automatically dynamically
+ * allocated inside the xTaskCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a task is created using
+ * xTaskCreateStatic() then the application writer must provide the required
+ * memory. xTaskCreateStatic() therefore allows a task to be created without
+ * using any dynamic memory allocation.
+ *
+ * @param pxTaskCode Pointer to the task entry function. Tasks
+ * must be implemented to never return (i.e. continuous loop).
+ *
+ * @param pcName A descriptive name for the task. This is mainly used to
+ * facilitate debugging. The maximum length of the string is defined by
+ * configMAX_TASK_NAME_LEN in FreeRTOSConfig.h.
+ *
+ * @param ulStackDepth The size of the task stack specified as the number of
+ * variables the stack can hold - not the number of bytes. For example, if
+ * the stack is 32-bits wide and ulStackDepth is defined as 100 then 400 bytes
+ * will be allocated for stack storage.
+ *
+ * @param pvParameters Pointer that will be used as the parameter for the task
+ * being created.
+ *
+ * @param uxPriority The priority at which the task will run.
+ *
+ * @param puxStackBuffer Must point to a StackType_t array that has at least
+ * ulStackDepth indexes - the array will then be used as the task's stack,
+ * removing the need for the stack to be allocated dynamically.
+ *
+ * @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will
+ * then be used to hold the task's data structures, removing the need for the
+ * memory to be allocated dynamically.
+ *
+ * @return If neither puxStackBuffer nor pxTaskBuffer are NULL, then the task
+ * will be created and a handle to the created task is returned. If either
+ * puxStackBuffer or pxTaskBuffer are NULL then the task will not be created and
+ * NULL is returned.
+ *
+ * Example usage:
+ * @code{c}
+ *
+ * // Dimensions of the buffer that the task being created will use as its stack.
+ * // NOTE: This is the number of words the stack will hold, not the number of
+ * // bytes. For example, if each stack item is 32-bits, and this is set to 100,
+ * // then 400 bytes (100 * 32-bits) will be allocated.
+ #define STACK_SIZE 200
+ *
+ * // Structure that will hold the TCB of the task being created.
+ * StaticTask_t xTaskBuffer;
+ *
+ * // Buffer that the task being created will use as its stack. Note this is
+ * // an array of StackType_t variables. The size of StackType_t is dependent on
+ * // the RTOS port.
+ * StackType_t xStack[ STACK_SIZE ];
+ *
+ * // Function that implements the task being created.
+ * void vTaskCode( void * pvParameters )
+ * {
+ * // The parameter value is expected to be 1 as 1 is passed in the
+ * // pvParameters value in the call to xTaskCreateStatic().
+ * configASSERT( ( uint32_t ) pvParameters == 1UL );
+ *
+ * for( ;; )
+ * {
+ * // Task code goes here.
+ * }
+ * }
+ *
+ * // Function that creates a task.
+ * void vOtherFunction( void )
+ * {
+ * TaskHandle_t xHandle = NULL;
+ *
+ * // Create the task without using any dynamic memory allocation.
+ * xHandle = xTaskCreateStatic(
+ * vTaskCode, // Function that implements the task.
+ * "NAME", // Text name for the task.
+ * STACK_SIZE, // Stack size in words, not bytes.
+ * ( void * ) 1, // Parameter passed into the task.
+ * tskIDLE_PRIORITY,// Priority at which the task is created.
+ * xStack, // Array to use as the task's stack.
+ * &xTaskBuffer ); // Variable to hold the task's data structure.
+ *
+ * // puxStackBuffer and pxTaskBuffer were not NULL, so the task will have
+ * // been created, and xHandle will be the task's handle. Use the handle
+ * // to suspend the task.
+ * vTaskSuspend( xHandle );
+ * }
+ * @endcode
+ * \defgroup xTaskCreateStatic xTaskCreateStatic
+ * \ingroup Tasks
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const uint32_t ulStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskCreateRestricted( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );
+ * @endcode
+ *
+ * Only available when configSUPPORT_DYNAMIC_ALLOCATION is set to 1.
+ *
+ * xTaskCreateRestricted() should only be used in systems that include an MPU
+ * implementation.
+ *
+ * Create a new task and add it to the list of tasks that are ready to run.
+ * The function parameters define the memory regions and associated access
+ * permissions allocated to the task.
+ *
+ * See xTaskCreateRestrictedStatic() for a version that does not use any
+ * dynamic memory allocation.
+ *
+ * @param pxTaskDefinition Pointer to a structure that contains a member
+ * for each of the normal xTaskCreate() parameters (see the xTaskCreate() API
+ * documentation) plus an optional stack buffer and the memory region
+ * definitions.
+ *
+ * @param pxCreatedTask Used to pass back a handle by which the created task
+ * can be referenced.
+ *
+ * @return pdPASS if the task was successfully created and added to a ready
+ * list, otherwise an error code defined in the file projdefs.h
+ *
+ * Example usage:
+ * @code{c}
+ * // Create an TaskParameters_t structure that defines the task to be created.
+ * static const TaskParameters_t xCheckTaskParameters =
+ * {
+ * vATask, // pvTaskCode - the function that implements the task.
+ * "ATask", // pcName - just a text name for the task to assist debugging.
+ * 100, // usStackDepth - the stack size DEFINED IN WORDS.
+ * NULL, // pvParameters - passed into the task function as the function parameters.
+ * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
+ * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack.
+ *
+ * // xRegions - Allocate up to three separate memory regions for access by
+ * // the task, with appropriate access permissions. Different processors have
+ * // different memory alignment requirements - refer to the FreeRTOS documentation
+ * // for full information.
+ * {
+ * // Base address Length Parameters
+ * { cReadWriteArray, 32, portMPU_REGION_READ_WRITE },
+ * { cReadOnlyArray, 32, portMPU_REGION_READ_ONLY },
+ * { cPrivilegedOnlyAccessArray, 128, portMPU_REGION_PRIVILEGED_READ_WRITE }
+ * }
+ * };
+ *
+ * int main( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task from the const structure defined above. The task handle
+ * // is requested (the second parameter is not NULL) but in this case just for
+ * // demonstration purposes as its not actually used.
+ * xTaskCreateRestricted( &xRegTest1Parameters, &xHandle );
+ *
+ * // Start the scheduler.
+ * vTaskStartScheduler();
+ *
+ * // Will only get here if there was insufficient memory to create the idle
+ * // and/or timer task.
+ * for( ;; );
+ * }
+ * @endcode
+ * \defgroup xTaskCreateRestricted xTaskCreateRestricted
+ * \ingroup Tasks
+ */
+#if ( portUSING_MPU_WRAPPERS == 1 )
+ BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskCreateRestrictedStatic( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );
+ * @endcode
+ *
+ * Only available when configSUPPORT_STATIC_ALLOCATION is set to 1.
+ *
+ * xTaskCreateRestrictedStatic() should only be used in systems that include an
+ * MPU implementation.
+ *
+ * Internally, within the FreeRTOS implementation, tasks use two blocks of
+ * memory. The first block is used to hold the task's data structures. The
+ * second block is used by the task as its stack. If a task is created using
+ * xTaskCreateRestricted() then the stack is provided by the application writer,
+ * and the memory used to hold the task's data structure is automatically
+ * dynamically allocated inside the xTaskCreateRestricted() function. If a task
+ * is created using xTaskCreateRestrictedStatic() then the application writer
+ * must provide the memory used to hold the task's data structures too.
+ * xTaskCreateRestrictedStatic() therefore allows a memory protected task to be
+ * created without using any dynamic memory allocation.
+ *
+ * @param pxTaskDefinition Pointer to a structure that contains a member
+ * for each of the normal xTaskCreate() parameters (see the xTaskCreate() API
+ * documentation) plus an optional stack buffer and the memory region
+ * definitions. If configSUPPORT_STATIC_ALLOCATION is set to 1 the structure
+ * contains an additional member, which is used to point to a variable of type
+ * StaticTask_t - which is then used to hold the task's data structure.
+ *
+ * @param pxCreatedTask Used to pass back a handle by which the created task
+ * can be referenced.
+ *
+ * @return pdPASS if the task was successfully created and added to a ready
+ * list, otherwise an error code defined in the file projdefs.h
+ *
+ * Example usage:
+ * @code{c}
+ * // Create an TaskParameters_t structure that defines the task to be created.
+ * // The StaticTask_t variable is only included in the structure when
+ * // configSUPPORT_STATIC_ALLOCATION is set to 1. The PRIVILEGED_DATA macro can
+ * // be used to force the variable into the RTOS kernel's privileged data area.
+ * static PRIVILEGED_DATA StaticTask_t xTaskBuffer;
+ * static const TaskParameters_t xCheckTaskParameters =
+ * {
+ * vATask, // pvTaskCode - the function that implements the task.
+ * "ATask", // pcName - just a text name for the task to assist debugging.
+ * 100, // usStackDepth - the stack size DEFINED IN WORDS.
+ * NULL, // pvParameters - passed into the task function as the function parameters.
+ * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
+ * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack.
+ *
+ * // xRegions - Allocate up to three separate memory regions for access by
+ * // the task, with appropriate access permissions. Different processors have
+ * // different memory alignment requirements - refer to the FreeRTOS documentation
+ * // for full information.
+ * {
+ * // Base address Length Parameters
+ * { cReadWriteArray, 32, portMPU_REGION_READ_WRITE },
+ * { cReadOnlyArray, 32, portMPU_REGION_READ_ONLY },
+ * { cPrivilegedOnlyAccessArray, 128, portMPU_REGION_PRIVILEGED_READ_WRITE }
+ * }
+ *
+ * &xTaskBuffer; // Holds the task's data structure.
+ * };
+ *
+ * int main( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task from the const structure defined above. The task handle
+ * // is requested (the second parameter is not NULL) but in this case just for
+ * // demonstration purposes as its not actually used.
+ * xTaskCreateRestrictedStatic( &xRegTest1Parameters, &xHandle );
+ *
+ * // Start the scheduler.
+ * vTaskStartScheduler();
+ *
+ * // Will only get here if there was insufficient memory to create the idle
+ * // and/or timer task.
+ * for( ;; );
+ * }
+ * @endcode
+ * \defgroup xTaskCreateRestrictedStatic xTaskCreateRestrictedStatic
+ * \ingroup Tasks
+ */
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ BaseType_t xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );
+ * @endcode
+ *
+ * Memory regions are assigned to a restricted task when the task is created by
+ * a call to xTaskCreateRestricted(). These regions can be redefined using
+ * vTaskAllocateMPURegions().
+ *
+ * @param xTask The handle of the task being updated.
+ *
+ * @param xRegions A pointer to a MemoryRegion_t structure that contains the
+ * new memory region definitions.
+ *
+ * Example usage:
+ * @code{c}
+ * // Define an array of MemoryRegion_t structures that configures an MPU region
+ * // allowing read/write access for 1024 bytes starting at the beginning of the
+ * // ucOneKByte array. The other two of the maximum 3 definable regions are
+ * // unused so set to zero.
+ * static const MemoryRegion_t xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] =
+ * {
+ * // Base address Length Parameters
+ * { ucOneKByte, 1024, portMPU_REGION_READ_WRITE },
+ * { 0, 0, 0 },
+ * { 0, 0, 0 }
+ * };
+ *
+ * void vATask( void *pvParameters )
+ * {
+ * // This task was created such that it has access to certain regions of
+ * // memory as defined by the MPU configuration. At some point it is
+ * // desired that these MPU regions are replaced with that defined in the
+ * // xAltRegions const struct above. Use a call to vTaskAllocateMPURegions()
+ * // for this purpose. NULL is used as the task handle to indicate that this
+ * // function should modify the MPU regions of the calling task.
+ * vTaskAllocateMPURegions( NULL, xAltRegions );
+ *
+ * // Now the task can continue its function, but from this point on can only
+ * // access its stack and the ucOneKByte array (unless any other statically
+ * // defined or shared regions have been declared elsewhere).
+ * }
+ * @endcode
+ * \defgroup vTaskAllocateMPURegions vTaskAllocateMPURegions
+ * \ingroup Tasks
+ */
+void vTaskAllocateMPURegions( TaskHandle_t xTask,
+ const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskDelete( TaskHandle_t xTaskToDelete );
+ * @endcode
+ *
+ * INCLUDE_vTaskDelete must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Remove a task from the RTOS real time kernel's management. The task being
+ * deleted will be removed from all ready, blocked, suspended and event lists.
+ *
+ * NOTE: The idle task is responsible for freeing the kernel allocated
+ * memory from tasks that have been deleted. It is therefore important that
+ * the idle task is not starved of microcontroller processing time if your
+ * application makes any calls to vTaskDelete (). Memory allocated by the
+ * task code is not automatically freed, and should be freed before the task
+ * is deleted.
+ *
+ * See the demo application file death.c for sample code that utilises
+ * vTaskDelete ().
+ *
+ * @param xTaskToDelete The handle of the task to be deleted. Passing NULL will
+ * cause the calling task to be deleted.
+ *
+ * Example usage:
+ * @code{c}
+ * void vOtherFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create the task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
+ *
+ * // Use the handle to delete the task.
+ * vTaskDelete( xHandle );
+ * }
+ * @endcode
+ * \defgroup vTaskDelete vTaskDelete
+ * \ingroup Tasks
+ */
+void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
+
+/*-----------------------------------------------------------
+* TASK CONTROL API
+*----------------------------------------------------------*/
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskDelay( const TickType_t xTicksToDelay );
+ * @endcode
+ *
+ * Delay a task for a given number of ticks. The actual time that the
+ * task remains blocked depends on the tick rate. The constant
+ * portTICK_PERIOD_MS can be used to calculate real time from the tick
+ * rate - with the resolution of one tick period.
+ *
+ * INCLUDE_vTaskDelay must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ *
+ * vTaskDelay() specifies a time at which the task wishes to unblock relative to
+ * the time at which vTaskDelay() is called. For example, specifying a block
+ * period of 100 ticks will cause the task to unblock 100 ticks after
+ * vTaskDelay() is called. vTaskDelay() does not therefore provide a good method
+ * of controlling the frequency of a periodic task as the path taken through the
+ * code, as well as other task and interrupt activity, will affect the frequency
+ * at which vTaskDelay() gets called and therefore the time at which the task
+ * next executes. See xTaskDelayUntil() for an alternative API function designed
+ * to facilitate fixed frequency execution. It does this by specifying an
+ * absolute time (rather than a relative time) at which the calling task should
+ * unblock.
+ *
+ * @param xTicksToDelay The amount of time, in tick periods, that
+ * the calling task should block.
+ *
+ * Example usage:
+ *
+ * void vTaskFunction( void * pvParameters )
+ * {
+ * // Block for 500ms.
+ * const TickType_t xDelay = 500 / portTICK_PERIOD_MS;
+ *
+ * for( ;; )
+ * {
+ * // Simply toggle the LED every 500ms, blocking between each toggle.
+ * vToggleLED();
+ * vTaskDelay( xDelay );
+ * }
+ * }
+ *
+ * \defgroup vTaskDelay vTaskDelay
+ * \ingroup TaskCtrl
+ */
+void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
+ * @endcode
+ *
+ * INCLUDE_xTaskDelayUntil must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Delay a task until a specified time. This function can be used by periodic
+ * tasks to ensure a constant execution frequency.
+ *
+ * This function differs from vTaskDelay () in one important aspect: vTaskDelay () will
+ * cause a task to block for the specified number of ticks from the time vTaskDelay () is
+ * called. It is therefore difficult to use vTaskDelay () by itself to generate a fixed
+ * execution frequency as the time between a task starting to execute and that task
+ * calling vTaskDelay () may not be fixed [the task may take a different path though the
+ * code between calls, or may get interrupted or preempted a different number of times
+ * each time it executes].
+ *
+ * Whereas vTaskDelay () specifies a wake time relative to the time at which the function
+ * is called, xTaskDelayUntil () specifies the absolute (exact) time at which it wishes to
+ * unblock.
+ *
+ * The macro pdMS_TO_TICKS() can be used to calculate the number of ticks from a
+ * time specified in milliseconds with a resolution of one tick period.
+ *
+ * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the
+ * task was last unblocked. The variable must be initialised with the current time
+ * prior to its first use (see the example below). Following this the variable is
+ * automatically updated within xTaskDelayUntil ().
+ *
+ * @param xTimeIncrement The cycle time period. The task will be unblocked at
+ * time *pxPreviousWakeTime + xTimeIncrement. Calling xTaskDelayUntil with the
+ * same xTimeIncrement parameter value will cause the task to execute with
+ * a fixed interface period.
+ *
+ * @return Value which can be used to check whether the task was actually delayed.
+ * Will be pdTRUE if the task way delayed and pdFALSE otherwise. A task will not
+ * be delayed if the next expected wake time is in the past.
+ *
+ * Example usage:
+ * @code{c}
+ * // Perform an action every 10 ticks.
+ * void vTaskFunction( void * pvParameters )
+ * {
+ * TickType_t xLastWakeTime;
+ * const TickType_t xFrequency = 10;
+ * BaseType_t xWasDelayed;
+ *
+ * // Initialise the xLastWakeTime variable with the current time.
+ * xLastWakeTime = xTaskGetTickCount ();
+ * for( ;; )
+ * {
+ * // Wait for the next cycle.
+ * xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
+ *
+ * // Perform action here. xWasDelayed value can be used to determine
+ * // whether a deadline was missed if the code here took too long.
+ * }
+ * }
+ * @endcode
+ * \defgroup xTaskDelayUntil xTaskDelayUntil
+ * \ingroup TaskCtrl
+ */
+BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
+ const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
+
+/*
+ * vTaskDelayUntil() is the older version of xTaskDelayUntil() and does not
+ * return a value.
+ */
+#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
+ do { \
+ ( void ) xTaskDelayUntil( ( pxPreviousWakeTime ), ( xTimeIncrement ) ); \
+ } while( 0 )
+
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskAbortDelay( TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_xTaskAbortDelay must be defined as 1 in FreeRTOSConfig.h for this
+ * function to be available.
+ *
+ * A task will enter the Blocked state when it is waiting for an event. The
+ * event it is waiting for can be a temporal event (waiting for a time), such
+ * as when vTaskDelay() is called, or an event on an object, such as when
+ * xQueueReceive() or ulTaskNotifyTake() is called. If the handle of a task
+ * that is in the Blocked state is used in a call to xTaskAbortDelay() then the
+ * task will leave the Blocked state, and return from whichever function call
+ * placed the task into the Blocked state.
+ *
+ * There is no 'FromISR' version of this function as an interrupt would need to
+ * know which object a task was blocked on in order to know which actions to
+ * take. For example, if the task was blocked on a queue the interrupt handler
+ * would then need to know if the queue was locked.
+ *
+ * @param xTask The handle of the task to remove from the Blocked state.
+ *
+ * @return If the task referenced by xTask was not in the Blocked state then
+ * pdFAIL is returned. Otherwise pdPASS is returned.
+ *
+ * \defgroup xTaskAbortDelay xTaskAbortDelay
+ * \ingroup TaskCtrl
+ */
+BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Obtain the priority of any task.
+ *
+ * @param xTask Handle of the task to be queried. Passing a NULL
+ * handle results in the priority of the calling task being returned.
+ *
+ * @return The priority of xTask.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
+ *
+ * // ...
+ *
+ * // Use the handle to obtain the priority of the created task.
+ * // It was created with tskIDLE_PRIORITY, but may have changed
+ * // it itself.
+ * if( uxTaskPriorityGet( xHandle ) != tskIDLE_PRIORITY )
+ * {
+ * // The task has changed it's priority.
+ * }
+ *
+ * // ...
+ *
+ * // Is our priority higher than the created task?
+ * if( uxTaskPriorityGet( xHandle ) < uxTaskPriorityGet( NULL ) )
+ * {
+ * // Our priority (obtained using NULL handle) is higher.
+ * }
+ * }
+ * @endcode
+ * \defgroup uxTaskPriorityGet uxTaskPriorityGet
+ * \ingroup TaskCtrl
+ */
+UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask );
+ * @endcode
+ *
+ * A version of uxTaskPriorityGet() that can be used from an ISR.
+ */
+UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * eTaskState eTaskGetState( TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_eTaskGetState must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Obtain the state of any task. States are encoded by the eTaskState
+ * enumerated type.
+ *
+ * @param xTask Handle of the task to be queried.
+ *
+ * @return The state of xTask at the time the function was called. Note the
+ * state of the task might change between the function being called, and the
+ * functions return value being tested by the calling task.
+ */
+eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );
+ * @endcode
+ *
+ * configUSE_TRACE_FACILITY must be defined as 1 for this function to be
+ * available. See the configuration section for more information.
+ *
+ * Populates a TaskStatus_t structure with information about a task.
+ *
+ * @param xTask Handle of the task being queried. If xTask is NULL then
+ * information will be returned about the calling task.
+ *
+ * @param pxTaskStatus A pointer to the TaskStatus_t structure that will be
+ * filled with information about the task referenced by the handle passed using
+ * the xTask parameter.
+ *
+ * @param xGetFreeStackSpace The TaskStatus_t structure contains a member to report
+ * the stack high water mark of the task being queried. Calculating the stack
+ * high water mark takes a relatively long time, and can make the system
+ * temporarily unresponsive - so the xGetFreeStackSpace parameter is provided to
+ * allow the high water mark checking to be skipped. The high watermark value
+ * will only be written to the TaskStatus_t structure if xGetFreeStackSpace is
+ * not set to pdFALSE;
+ *
+ * @param eState The TaskStatus_t structure contains a member to report the
+ * state of the task being queried. Obtaining the task state is not as fast as
+ * a simple assignment - so the eState parameter is provided to allow the state
+ * information to be omitted from the TaskStatus_t structure. To obtain state
+ * information then set eState to eInvalid - otherwise the value passed in
+ * eState will be reported as the task state in the TaskStatus_t structure.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ * TaskStatus_t xTaskDetails;
+ *
+ * // Obtain the handle of a task from its name.
+ * xHandle = xTaskGetHandle( "Task_Name" );
+ *
+ * // Check the handle is not NULL.
+ * configASSERT( xHandle );
+ *
+ * // Use the handle to obtain further information about the task.
+ * vTaskGetInfo( xHandle,
+ * &xTaskDetails,
+ * pdTRUE, // Include the high water mark in xTaskDetails.
+ * eInvalid ); // Include the task state in xTaskDetails.
+ * }
+ * @endcode
+ * \defgroup vTaskGetInfo vTaskGetInfo
+ * \ingroup TaskCtrl
+ */
+void vTaskGetInfo( TaskHandle_t xTask,
+ TaskStatus_t * pxTaskStatus,
+ BaseType_t xGetFreeStackSpace,
+ eTaskState eState ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );
+ * @endcode
+ *
+ * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Set the priority of any task.
+ *
+ * A context switch will occur before the function returns if the priority
+ * being set is higher than the currently executing task.
+ *
+ * @param xTask Handle to the task for which the priority is being set.
+ * Passing a NULL handle results in the priority of the calling task being set.
+ *
+ * @param uxNewPriority The priority to which the task will be set.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
+ *
+ * // ...
+ *
+ * // Use the handle to raise the priority of the created task.
+ * vTaskPrioritySet( xHandle, tskIDLE_PRIORITY + 1 );
+ *
+ * // ...
+ *
+ * // Use a NULL handle to raise our priority to the same value.
+ * vTaskPrioritySet( NULL, tskIDLE_PRIORITY + 1 );
+ * }
+ * @endcode
+ * \defgroup vTaskPrioritySet vTaskPrioritySet
+ * \ingroup TaskCtrl
+ */
+void vTaskPrioritySet( TaskHandle_t xTask,
+ UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskSuspend( TaskHandle_t xTaskToSuspend );
+ * @endcode
+ *
+ * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Suspend any task. When suspended a task will never get any microcontroller
+ * processing time, no matter what its priority.
+ *
+ * Calls to vTaskSuspend are not accumulative -
+ * i.e. calling vTaskSuspend () twice on the same task still only requires one
+ * call to vTaskResume () to ready the suspended task.
+ *
+ * @param xTaskToSuspend Handle to the task being suspended. Passing a NULL
+ * handle will cause the calling task to be suspended.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
+ *
+ * // ...
+ *
+ * // Use the handle to suspend the created task.
+ * vTaskSuspend( xHandle );
+ *
+ * // ...
+ *
+ * // The created task will not run during this period, unless
+ * // another task calls vTaskResume( xHandle ).
+ *
+ * //...
+ *
+ *
+ * // Suspend ourselves.
+ * vTaskSuspend( NULL );
+ *
+ * // We cannot get here unless another task calls vTaskResume
+ * // with our handle as the parameter.
+ * }
+ * @endcode
+ * \defgroup vTaskSuspend vTaskSuspend
+ * \ingroup TaskCtrl
+ */
+void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskResume( TaskHandle_t xTaskToResume );
+ * @endcode
+ *
+ * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
+ * See the configuration section for more information.
+ *
+ * Resumes a suspended task.
+ *
+ * A task that has been suspended by one or more calls to vTaskSuspend ()
+ * will be made available for running again by a single call to
+ * vTaskResume ().
+ *
+ * @param xTaskToResume Handle to the task being readied.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
+ *
+ * // ...
+ *
+ * // Use the handle to suspend the created task.
+ * vTaskSuspend( xHandle );
+ *
+ * // ...
+ *
+ * // The created task will not run during this period, unless
+ * // another task calls vTaskResume( xHandle ).
+ *
+ * //...
+ *
+ *
+ * // Resume the suspended task ourselves.
+ * vTaskResume( xHandle );
+ *
+ * // The created task will once again get microcontroller processing
+ * // time in accordance with its priority within the system.
+ * }
+ * @endcode
+ * \defgroup vTaskResume vTaskResume
+ * \ingroup TaskCtrl
+ */
+void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void xTaskResumeFromISR( TaskHandle_t xTaskToResume );
+ * @endcode
+ *
+ * INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be
+ * available. See the configuration section for more information.
+ *
+ * An implementation of vTaskResume() that can be called from within an ISR.
+ *
+ * A task that has been suspended by one or more calls to vTaskSuspend ()
+ * will be made available for running again by a single call to
+ * xTaskResumeFromISR ().
+ *
+ * xTaskResumeFromISR() should not be used to synchronise a task with an
+ * interrupt if there is a chance that the interrupt could arrive prior to the
+ * task being suspended - as this can lead to interrupts being missed. Use of a
+ * semaphore as a synchronisation mechanism would avoid this eventuality.
+ *
+ * @param xTaskToResume Handle to the task being readied.
+ *
+ * @return pdTRUE if resuming the task should result in a context switch,
+ * otherwise pdFALSE. This is used by the ISR to determine if a context switch
+ * may be required following the ISR.
+ *
+ * \defgroup vTaskResumeFromISR vTaskResumeFromISR
+ * \ingroup TaskCtrl
+ */
+BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
+
+/*-----------------------------------------------------------
+* SCHEDULER CONTROL
+*----------------------------------------------------------*/
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskStartScheduler( void );
+ * @endcode
+ *
+ * Starts the real time kernel tick processing. After calling the kernel
+ * has control over which tasks are executed and when.
+ *
+ * See the demo application file main.c for an example of creating
+ * tasks and starting the kernel.
+ *
+ * Example usage:
+ * @code{c}
+ * void vAFunction( void )
+ * {
+ * // Create at least one task before starting the kernel.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
+ *
+ * // Start the real time kernel with preemption.
+ * vTaskStartScheduler ();
+ *
+ * // Will not get here unless a task calls vTaskEndScheduler ()
+ * }
+ * @endcode
+ *
+ * \defgroup vTaskStartScheduler vTaskStartScheduler
+ * \ingroup SchedulerControl
+ */
+void vTaskStartScheduler( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskEndScheduler( void );
+ * @endcode
+ *
+ * NOTE: At the time of writing only the x86 real mode port, which runs on a PC
+ * in place of DOS, implements this function.
+ *
+ * Stops the real time kernel tick. All created tasks will be automatically
+ * deleted and multitasking (either preemptive or cooperative) will
+ * stop. Execution then resumes from the point where vTaskStartScheduler ()
+ * was called, as if vTaskStartScheduler () had just returned.
+ *
+ * See the demo application file main. c in the demo/PC directory for an
+ * example that uses vTaskEndScheduler ().
+ *
+ * vTaskEndScheduler () requires an exit function to be defined within the
+ * portable layer (see vPortEndScheduler () in port. c for the PC port). This
+ * performs hardware specific operations such as stopping the kernel tick.
+ *
+ * vTaskEndScheduler () will cause all of the resources allocated by the
+ * kernel to be freed - but will not free resources allocated by application
+ * tasks.
+ *
+ * Example usage:
+ * @code{c}
+ * void vTaskCode( void * pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Task code goes here.
+ *
+ * // At some point we want to end the real time kernel processing
+ * // so call ...
+ * vTaskEndScheduler ();
+ * }
+ * }
+ *
+ * void vAFunction( void )
+ * {
+ * // Create at least one task before starting the kernel.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
+ *
+ * // Start the real time kernel with preemption.
+ * vTaskStartScheduler ();
+ *
+ * // Will only get here when the vTaskCode () task has called
+ * // vTaskEndScheduler (). When we get here we are back to single task
+ * // execution.
+ * }
+ * @endcode
+ *
+ * \defgroup vTaskEndScheduler vTaskEndScheduler
+ * \ingroup SchedulerControl
+ */
+void vTaskEndScheduler( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskSuspendAll( void );
+ * @endcode
+ *
+ * Suspends the scheduler without disabling interrupts. Context switches will
+ * not occur while the scheduler is suspended.
+ *
+ * After calling vTaskSuspendAll () the calling task will continue to execute
+ * without risk of being swapped out until a call to xTaskResumeAll () has been
+ * made.
+ *
+ * API functions that have the potential to cause a context switch (for example,
+ * xTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler
+ * is suspended.
+ *
+ * Example usage:
+ * @code{c}
+ * void vTask1( void * pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Task code goes here.
+ *
+ * // ...
+ *
+ * // At some point the task wants to perform a long operation during
+ * // which it does not want to get swapped out. It cannot use
+ * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
+ * // operation may cause interrupts to be missed - including the
+ * // ticks.
+ *
+ * // Prevent the real time kernel swapping out the task.
+ * vTaskSuspendAll ();
+ *
+ * // Perform the operation here. There is no need to use critical
+ * // sections as we have all the microcontroller processing time.
+ * // During this time interrupts will still operate and the kernel
+ * // tick count will be maintained.
+ *
+ * // ...
+ *
+ * // The operation is complete. Restart the kernel.
+ * xTaskResumeAll ();
+ * }
+ * }
+ * @endcode
+ * \defgroup vTaskSuspendAll vTaskSuspendAll
+ * \ingroup SchedulerControl
+ */
+void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskResumeAll( void );
+ * @endcode
+ *
+ * Resumes scheduler activity after it was suspended by a call to
+ * vTaskSuspendAll().
+ *
+ * xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks
+ * that were previously suspended by a call to vTaskSuspend().
+ *
+ * @return If resuming the scheduler caused a context switch then pdTRUE is
+ * returned, otherwise pdFALSE is returned.
+ *
+ * Example usage:
+ * @code{c}
+ * void vTask1( void * pvParameters )
+ * {
+ * for( ;; )
+ * {
+ * // Task code goes here.
+ *
+ * // ...
+ *
+ * // At some point the task wants to perform a long operation during
+ * // which it does not want to get swapped out. It cannot use
+ * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
+ * // operation may cause interrupts to be missed - including the
+ * // ticks.
+ *
+ * // Prevent the real time kernel swapping out the task.
+ * vTaskSuspendAll ();
+ *
+ * // Perform the operation here. There is no need to use critical
+ * // sections as we have all the microcontroller processing time.
+ * // During this time interrupts will still operate and the real
+ * // time kernel tick count will be maintained.
+ *
+ * // ...
+ *
+ * // The operation is complete. Restart the kernel. We want to force
+ * // a context switch - but there is no point if resuming the scheduler
+ * // caused a context switch already.
+ * if( !xTaskResumeAll () )
+ * {
+ * taskYIELD ();
+ * }
+ * }
+ * }
+ * @endcode
+ * \defgroup xTaskResumeAll xTaskResumeAll
+ * \ingroup SchedulerControl
+ */
+BaseType_t xTaskResumeAll( void ) PRIVILEGED_FUNCTION;
+
+/*-----------------------------------------------------------
+* TASK UTILITIES
+*----------------------------------------------------------*/
+
+/**
+ * task. h
+ * @code{c}
+ * TickType_t xTaskGetTickCount( void );
+ * @endcode
+ *
+ * @return The count of ticks since vTaskStartScheduler was called.
+ *
+ * \defgroup xTaskGetTickCount xTaskGetTickCount
+ * \ingroup TaskUtils
+ */
+TickType_t xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * TickType_t xTaskGetTickCountFromISR( void );
+ * @endcode
+ *
+ * @return The count of ticks since vTaskStartScheduler was called.
+ *
+ * This is a version of xTaskGetTickCount() that is safe to be called from an
+ * ISR - provided that TickType_t is the natural word size of the
+ * microcontroller being used or interrupt nesting is either not supported or
+ * not being used.
+ *
+ * \defgroup xTaskGetTickCountFromISR xTaskGetTickCountFromISR
+ * \ingroup TaskUtils
+ */
+TickType_t xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * uint16_t uxTaskGetNumberOfTasks( void );
+ * @endcode
+ *
+ * @return The number of tasks that the real time kernel is currently managing.
+ * This includes all ready, blocked and suspended tasks. A task that
+ * has been deleted but not yet freed by the idle task will also be
+ * included in the count.
+ *
+ * \defgroup uxTaskGetNumberOfTasks uxTaskGetNumberOfTasks
+ * \ingroup TaskUtils
+ */
+UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * char *pcTaskGetName( TaskHandle_t xTaskToQuery );
+ * @endcode
+ *
+ * @return The text (human readable) name of the task referenced by the handle
+ * xTaskToQuery. A task can query its own name by either passing in its own
+ * handle, or by setting xTaskToQuery to NULL.
+ *
+ * \defgroup pcTaskGetName pcTaskGetName
+ * \ingroup TaskUtils
+ */
+char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+
+/**
+ * task. h
+ * @code{c}
+ * TaskHandle_t xTaskGetHandle( const char *pcNameToQuery );
+ * @endcode
+ *
+ * NOTE: This function takes a relatively long time to complete and should be
+ * used sparingly.
+ *
+ * @return The handle of the task that has the human readable name pcNameToQuery.
+ * NULL is returned if no matching name is found. INCLUDE_xTaskGetHandle
+ * must be set to 1 in FreeRTOSConfig.h for pcTaskGetHandle() to be available.
+ *
+ * \defgroup pcTaskGetHandle pcTaskGetHandle
+ * \ingroup TaskUtils
+ */
+TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+
+/**
+ * task.h
+ * @code{c}
+ * UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_uxTaskGetStackHighWaterMark must be set to 1 in FreeRTOSConfig.h for
+ * this function to be available.
+ *
+ * Returns the high water mark of the stack associated with xTask. That is,
+ * the minimum free stack space there has been (in words, so on a 32 bit machine
+ * a value of 1 means 4 bytes) since the task started. The smaller the returned
+ * number the closer the task has come to overflowing its stack.
+ *
+ * uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are the
+ * same except for their return type. Using configSTACK_DEPTH_TYPE allows the
+ * user to determine the return type. It gets around the problem of the value
+ * overflowing on 8-bit types without breaking backward compatibility for
+ * applications that expect an 8-bit return type.
+ *
+ * @param xTask Handle of the task associated with the stack to be checked.
+ * Set xTask to NULL to check the stack of the calling task.
+ *
+ * @return The smallest amount of free stack space there has been (in words, so
+ * actual spaces on the stack rather than bytes) since the task referenced by
+ * xTask was created.
+ */
+UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ * @code{c}
+ * configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_uxTaskGetStackHighWaterMark2 must be set to 1 in FreeRTOSConfig.h for
+ * this function to be available.
+ *
+ * Returns the high water mark of the stack associated with xTask. That is,
+ * the minimum free stack space there has been (in words, so on a 32 bit machine
+ * a value of 1 means 4 bytes) since the task started. The smaller the returned
+ * number the closer the task has come to overflowing its stack.
+ *
+ * uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are the
+ * same except for their return type. Using configSTACK_DEPTH_TYPE allows the
+ * user to determine the return type. It gets around the problem of the value
+ * overflowing on 8-bit types without breaking backward compatibility for
+ * applications that expect an 8-bit return type.
+ *
+ * @param xTask Handle of the task associated with the stack to be checked.
+ * Set xTask to NULL to check the stack of the calling task.
+ *
+ * @return The smallest amount of free stack space there has been (in words, so
+ * actual spaces on the stack rather than bytes) since the task referenced by
+ * xTask was created.
+ */
+configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ *
+ *
+ * INCLUDE_pxTaskGetStackStart must be set to 1 in FreeRTOSConfig.h for
+ * this function to be available.
+ *
+ * Returns the start of the stack associated with xTask. That is,
+ * the highest stack memory address on architectures where the stack grows down
+ * from high memory, and the lowest memory address on architectures where the
+ * stack grows up from low memory.
+ *
+ * @param xTask Handle of the task associated with the stack returned.
+ * Set xTask to NULL to return the stack of the calling task.
+ *
+ * @return A pointer to the start of the stack.
+ */
+uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) PRIVILEGED_FUNCTION;
+
+/* When using trace macros it is sometimes necessary to include task.h before
+ * FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
+ * so the following two prototypes will cause a compilation error. This can be
+ * fixed by simply guarding against the inclusion of these two prototypes unless
+ * they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
+ * constant. */
+#ifdef configUSE_APPLICATION_TASK_TAG
+ #if configUSE_APPLICATION_TASK_TAG == 1
+
+/**
+ * task.h
+ * @code{c}
+ * void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );
+ * @endcode
+ *
+ * Sets pxHookFunction to be the task hook function used by the task xTask.
+ * Passing xTask as NULL has the effect of setting the calling tasks hook
+ * function.
+ */
+ void vTaskSetApplicationTaskTag( TaskHandle_t xTask,
+ TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ * @code{c}
+ * void xTaskGetApplicationTaskTag( TaskHandle_t xTask );
+ * @endcode
+ *
+ * Returns the pxHookFunction value assigned to the task xTask. Do not
+ * call from an interrupt service routine - call
+ * xTaskGetApplicationTaskTagFromISR() instead.
+ */
+ TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ * @code{c}
+ * void xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask );
+ * @endcode
+ *
+ * Returns the pxHookFunction value assigned to the task xTask. Can
+ * be called from an interrupt service routine.
+ */
+ TaskHookFunction_t xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+ #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
+#endif /* ifdef configUSE_APPLICATION_TASK_TAG */
+
+#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
+
+/* Each task contains an array of pointers that is dimensioned by the
+ * configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
+ * kernel does not use the pointers itself, so the application writer can use
+ * the pointers for any purpose they wish. The following two functions are
+ * used to set and query a pointer respectively. */
+ void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
+ BaseType_t xIndex,
+ void * pvValue ) PRIVILEGED_FUNCTION;
+ void * pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
+ BaseType_t xIndex ) PRIVILEGED_FUNCTION;
+
+#endif
+
+#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName);
+ * @endcode
+ *
+ * The application stack overflow hook is called when a stack overflow is detected for a task.
+ *
+ * Details on stack overflow detection can be found here: https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
+ *
+ * @param xTask the task that just exceeded its stack boundaries.
+ * @param pcTaskName A character string containing the name of the offending task.
+ */
+ void vApplicationStackOverflowHook( TaskHandle_t xTask,
+ signed char * pcTaskName );
+
+#endif
+
+#if ( configUSE_TICK_HOOK > 0 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationTickHook( void );
+ * @endcode
+ *
+ * This hook function is called in the system tick handler after any OS work is completed.
+ */
+ void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
+
+#endif
+
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
+ * @endcode
+ *
+ * This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when
+ * configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
+ *
+ * @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
+ * @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
+ * @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
+ */
+ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
+ StackType_t ** ppxIdleTaskStackBuffer,
+ uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
+#endif
+
+/**
+ * task.h
+ * @code{c}
+ * BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
+ * @endcode
+ *
+ * Calls the hook function associated with xTask. Passing xTask as NULL has
+ * the effect of calling the Running tasks (the calling task) hook function.
+ *
+ * pvParameter is passed to the hook function for the task to interpret as it
+ * wants. The return value is the value returned by the task hook function
+ * registered by the user.
+ */
+BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
+ void * pvParameter ) PRIVILEGED_FUNCTION;
+
+/**
+ * xTaskGetIdleTaskHandle() is only available if
+ * INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h.
+ *
+ * Simply returns the handle of the idle task. It is not valid to call
+ * xTaskGetIdleTaskHandle() before the scheduler has been started.
+ */
+TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for
+ * uxTaskGetSystemState() to be available.
+ *
+ * uxTaskGetSystemState() populates an TaskStatus_t structure for each task in
+ * the system. TaskStatus_t structures contain, among other things, members
+ * for the task handle, task name, task priority, task state, and total amount
+ * of run time consumed by the task. See the TaskStatus_t structure
+ * definition in this file for the full member list.
+ *
+ * NOTE: This function is intended for debugging use only as its use results in
+ * the scheduler remaining suspended for an extended period.
+ *
+ * @param pxTaskStatusArray A pointer to an array of TaskStatus_t structures.
+ * The array must contain at least one TaskStatus_t structure for each task
+ * that is under the control of the RTOS. The number of tasks under the control
+ * of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function.
+ *
+ * @param uxArraySize The size of the array pointed to by the pxTaskStatusArray
+ * parameter. The size is specified as the number of indexes in the array, or
+ * the number of TaskStatus_t structures contained in the array, not by the
+ * number of bytes in the array.
+ *
+ * @param pulTotalRunTime If configGENERATE_RUN_TIME_STATS is set to 1 in
+ * FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the
+ * total run time (as defined by the run time stats clock, see
+ * https://www.FreeRTOS.org/rtos-run-time-stats.html) since the target booted.
+ * pulTotalRunTime can be set to NULL to omit the total run time information.
+ *
+ * @return The number of TaskStatus_t structures that were populated by
+ * uxTaskGetSystemState(). This should equal the number returned by the
+ * uxTaskGetNumberOfTasks() API function, but will be zero if the value passed
+ * in the uxArraySize parameter was too small.
+ *
+ * Example usage:
+ * @code{c}
+ * // This example demonstrates how a human readable table of run time stats
+ * // information is generated from raw data provided by uxTaskGetSystemState().
+ * // The human readable table is written to pcWriteBuffer
+ * void vTaskGetRunTimeStats( char *pcWriteBuffer )
+ * {
+ * TaskStatus_t *pxTaskStatusArray;
+ * volatile UBaseType_t uxArraySize, x;
+ * configRUN_TIME_COUNTER_TYPE ulTotalRunTime, ulStatsAsPercentage;
+ *
+ * // Make sure the write buffer does not contain a string.
+ * pcWriteBuffer = 0x00;
+ *
+ * // Take a snapshot of the number of tasks in case it changes while this
+ * // function is executing.
+ * uxArraySize = uxTaskGetNumberOfTasks();
+ *
+ * // Allocate a TaskStatus_t structure for each task. An array could be
+ * // allocated statically at compile time.
+ * pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
+ *
+ * if( pxTaskStatusArray != NULL )
+ * {
+ * // Generate raw status information about each task.
+ * uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );
+ *
+ * // For percentage calculations.
+ * ulTotalRunTime /= 100UL;
+ *
+ * // Avoid divide by zero errors.
+ * if( ulTotalRunTime > 0 )
+ * {
+ * // For each populated position in the pxTaskStatusArray array,
+ * // format the raw data as human readable ASCII data
+ * for( x = 0; x < uxArraySize; x++ )
+ * {
+ * // What percentage of the total run time has the task used?
+ * // This will always be rounded down to the nearest integer.
+ * // ulTotalRunTimeDiv100 has already been divided by 100.
+ * ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
+ *
+ * if( ulStatsAsPercentage > 0UL )
+ * {
+ * sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
+ * }
+ * else
+ * {
+ * // If the percentage is zero here then the task has
+ * // consumed less than 1% of the total run time.
+ * sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
+ * }
+ *
+ * pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );
+ * }
+ * }
+ *
+ * // The array is no longer needed, free the memory it consumes.
+ * vPortFree( pxTaskStatusArray );
+ * }
+ * }
+ * @endcode
+ */
+UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
+ const UBaseType_t uxArraySize,
+ configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskList( char *pcWriteBuffer );
+ * @endcode
+ *
+ * configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must
+ * both be defined as 1 for this function to be available. See the
+ * configuration section of the FreeRTOS.org website for more information.
+ *
+ * NOTE 1: This function will disable interrupts for its duration. It is
+ * not intended for normal application runtime use but as a debug aid.
+ *
+ * Lists all the current tasks, along with their current state and stack
+ * usage high water mark.
+ *
+ * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or
+ * suspended ('S').
+ *
+ * PLEASE NOTE:
+ *
+ * This function is provided for convenience only, and is used by many of the
+ * demo applications. Do not consider it to be part of the scheduler.
+ *
+ * vTaskList() calls uxTaskGetSystemState(), then formats part of the
+ * uxTaskGetSystemState() output into a human readable table that displays task:
+ * names, states, priority, stack usage and task number.
+ * Stack usage specified as the number of unused StackType_t words stack can hold
+ * on top of stack - not the number of bytes.
+ *
+ * vTaskList() has a dependency on the sprintf() C library function that might
+ * bloat the code size, use a lot of stack, and provide different results on
+ * different platforms. An alternative, tiny, third party, and limited
+ * functionality implementation of sprintf() is provided in many of the
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
+ * printf-stdarg.c does not provide a full snprintf() implementation!).
+ *
+ * It is recommended that production systems call uxTaskGetSystemState()
+ * directly to get access to raw stats data, rather than indirectly through a
+ * call to vTaskList().
+ *
+ * @param pcWriteBuffer A buffer into which the above mentioned details
+ * will be written, in ASCII form. This buffer is assumed to be large
+ * enough to contain the generated report. Approximately 40 bytes per
+ * task should be sufficient.
+ *
+ * \defgroup vTaskList vTaskList
+ * \ingroup TaskUtils
+ */
+void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskGetRunTimeStats( char *pcWriteBuffer );
+ * @endcode
+ *
+ * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS
+ * must both be defined as 1 for this function to be available. The application
+ * must also then provide definitions for
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()
+ * to configure a peripheral timer/counter and return the timers current count
+ * value respectively. The counter should be at least 10 times the frequency of
+ * the tick count.
+ *
+ * NOTE 1: This function will disable interrupts for its duration. It is
+ * not intended for normal application runtime use but as a debug aid.
+ *
+ * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total
+ * accumulated execution time being stored for each task. The resolution
+ * of the accumulated time value depends on the frequency of the timer
+ * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro.
+ * Calling vTaskGetRunTimeStats() writes the total execution time of each
+ * task into a buffer, both as an absolute count value and as a percentage
+ * of the total system execution time.
+ *
+ * NOTE 2:
+ *
+ * This function is provided for convenience only, and is used by many of the
+ * demo applications. Do not consider it to be part of the scheduler.
+ *
+ * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part of the
+ * uxTaskGetSystemState() output into a human readable table that displays the
+ * amount of time each task has spent in the Running state in both absolute and
+ * percentage terms.
+ *
+ * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function
+ * that might bloat the code size, use a lot of stack, and provide different
+ * results on different platforms. An alternative, tiny, third party, and
+ * limited functionality implementation of sprintf() is provided in many of the
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
+ * printf-stdarg.c does not provide a full snprintf() implementation!).
+ *
+ * It is recommended that production systems call uxTaskGetSystemState() directly
+ * to get access to raw stats data, rather than indirectly through a call to
+ * vTaskGetRunTimeStats().
+ *
+ * @param pcWriteBuffer A buffer into which the execution times will be
+ * written, in ASCII form. This buffer is assumed to be large enough to
+ * contain the generated report. Approximately 40 bytes per task should
+ * be sufficient.
+ *
+ * \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats
+ * \ingroup TaskUtils
+ */
+void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+
+/**
+ * task. h
+ * @code{c}
+ * configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void );
+ * configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void );
+ * @endcode
+ *
+ * configGENERATE_RUN_TIME_STATS, configUSE_STATS_FORMATTING_FUNCTIONS and
+ * INCLUDE_xTaskGetIdleTaskHandle must all be defined as 1 for these functions
+ * to be available. The application must also then provide definitions for
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()
+ * to configure a peripheral timer/counter and return the timers current count
+ * value respectively. The counter should be at least 10 times the frequency of
+ * the tick count.
+ *
+ * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total
+ * accumulated execution time being stored for each task. The resolution
+ * of the accumulated time value depends on the frequency of the timer
+ * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro.
+ * While uxTaskGetSystemState() and vTaskGetRunTimeStats() writes the total
+ * execution time of each task into a buffer, ulTaskGetIdleRunTimeCounter()
+ * returns the total execution time of just the idle task and
+ * ulTaskGetIdleRunTimePercent() returns the percentage of the CPU time used by
+ * just the idle task.
+ *
+ * Note the amount of idle time is only a good measure of the slack time in a
+ * system if there are no other tasks executing at the idle priority, tickless
+ * idle is not used, and configIDLE_SHOULD_YIELD is set to 0.
+ *
+ * @return The total run time of the idle task or the percentage of the total
+ * run time consumed by the idle task. This is the amount of time the
+ * idle task has actually been executing. The unit of time is dependent on the
+ * frequency configured using the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and
+ * portGET_RUN_TIME_COUNTER_VALUE() macros.
+ *
+ * \defgroup ulTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
+ * \ingroup TaskUtils
+ */
+configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION;
+configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction );
+ * BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
+ * functions to be available.
+ *
+ * Sends a direct to task notification to a task, with an optional value and
+ * action.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * A task can use xTaskNotifyWaitIndexed() or ulTaskNotifyTakeIndexed() to
+ * [optionally] block to wait for a notification to be pending. The task does
+ * not consume any CPU time while it is in the Blocked state.
+ *
+ * A notification sent to a task will remain pending until it is cleared by the
+ * task calling xTaskNotifyWaitIndexed() or ulTaskNotifyTakeIndexed() (or their
+ * un-indexed equivalents). If the task was already in the Blocked state to
+ * wait for a notification when the notification arrives then the task will
+ * automatically be removed from the Blocked state (unblocked) and the
+ * notification cleared.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotify() is the original API function, and remains backward
+ * compatible by always operating on the notification value at index 0 in the
+ * array. Calling xTaskNotify() is equivalent to calling xTaskNotifyIndexed()
+ * with the uxIndexToNotify parameter set to 0.
+ *
+ * @param xTaskToNotify The handle of the task being notified. The handle to a
+ * task can be returned from the xTaskCreate() API function used to create the
+ * task, and the handle of the currently running task can be obtained by calling
+ * xTaskGetCurrentTaskHandle().
+ *
+ * @param uxIndexToNotify The index within the target task's array of
+ * notification values to which the notification is to be sent. uxIndexToNotify
+ * must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES. xTaskNotify() does
+ * not have this parameter and always sends notifications to index 0.
+ *
+ * @param ulValue Data that can be sent with the notification. How the data is
+ * used depends on the value of the eAction parameter.
+ *
+ * @param eAction Specifies how the notification updates the task's notification
+ * value, if at all. Valid values for eAction are as follows:
+ *
+ * eSetBits -
+ * The target notification value is bitwise ORed with ulValue.
+ * xTaskNotifyIndexed() always returns pdPASS in this case.
+ *
+ * eIncrement -
+ * The target notification value is incremented. ulValue is not used and
+ * xTaskNotifyIndexed() always returns pdPASS in this case.
+ *
+ * eSetValueWithOverwrite -
+ * The target notification value is set to the value of ulValue, even if the
+ * task being notified had not yet processed the previous notification at the
+ * same array index (the task already had a notification pending at that index).
+ * xTaskNotifyIndexed() always returns pdPASS in this case.
+ *
+ * eSetValueWithoutOverwrite -
+ * If the task being notified did not already have a notification pending at the
+ * same array index then the target notification value is set to ulValue and
+ * xTaskNotifyIndexed() will return pdPASS. If the task being notified already
+ * had a notification pending at the same array index then no action is
+ * performed and pdFAIL is returned.
+ *
+ * eNoAction -
+ * The task receives a notification at the specified array index without the
+ * notification value at that index being updated. ulValue is not used and
+ * xTaskNotifyIndexed() always returns pdPASS in this case.
+ *
+ * pulPreviousNotificationValue -
+ * Can be used to pass out the subject task's notification value before any
+ * bits are modified by the notify function.
+ *
+ * @return Dependent on the value of eAction. See the description of the
+ * eAction parameter.
+ *
+ * \defgroup xTaskNotifyIndexed xTaskNotifyIndexed
+ * \ingroup TaskNotifications
+ */
+BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ uint32_t ulValue,
+ eNotifyAction eAction,
+ uint32_t * pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
+#define xTaskNotify( xTaskToNotify, ulValue, eAction ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL )
+#define xTaskNotifyIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyAndQueryIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );
+ * BaseType_t xTaskNotifyAndQuery( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * xTaskNotifyAndQueryIndexed() performs the same operation as
+ * xTaskNotifyIndexed() with the addition that it also returns the subject
+ * task's prior notification value (the notification value at the time the
+ * function is called rather than when the function returns) in the additional
+ * pulPreviousNotifyValue parameter.
+ *
+ * xTaskNotifyAndQuery() performs the same operation as xTaskNotify() with the
+ * addition that it also returns the subject task's prior notification value
+ * (the notification value as it was at the time the function is called, rather
+ * than when the function returns) in the additional pulPreviousNotifyValue
+ * parameter.
+ *
+ * \defgroup xTaskNotifyAndQueryIndexed xTaskNotifyAndQueryIndexed
+ * \ingroup TaskNotifications
+ */
+#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
+#define xTaskNotifyAndQueryIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );
+ * BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
+ * functions to be available.
+ *
+ * A version of xTaskNotifyIndexed() that can be used from an interrupt service
+ * routine (ISR).
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * A task can use xTaskNotifyWaitIndexed() to [optionally] block to wait for a
+ * notification to be pending, or ulTaskNotifyTakeIndexed() to [optionally] block
+ * to wait for a notification value to have a non-zero value. The task does
+ * not consume any CPU time while it is in the Blocked state.
+ *
+ * A notification sent to a task will remain pending until it is cleared by the
+ * task calling xTaskNotifyWaitIndexed() or ulTaskNotifyTakeIndexed() (or their
+ * un-indexed equivalents). If the task was already in the Blocked state to
+ * wait for a notification when the notification arrives then the task will
+ * automatically be removed from the Blocked state (unblocked) and the
+ * notification cleared.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotifyFromISR() is the original API function, and remains
+ * backward compatible by always operating on the notification value at index 0
+ * within the array. Calling xTaskNotifyFromISR() is equivalent to calling
+ * xTaskNotifyIndexedFromISR() with the uxIndexToNotify parameter set to 0.
+ *
+ * @param uxIndexToNotify The index within the target task's array of
+ * notification values to which the notification is to be sent. uxIndexToNotify
+ * must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES. xTaskNotifyFromISR()
+ * does not have this parameter and always sends notifications to index 0.
+ *
+ * @param xTaskToNotify The handle of the task being notified. The handle to a
+ * task can be returned from the xTaskCreate() API function used to create the
+ * task, and the handle of the currently running task can be obtained by calling
+ * xTaskGetCurrentTaskHandle().
+ *
+ * @param ulValue Data that can be sent with the notification. How the data is
+ * used depends on the value of the eAction parameter.
+ *
+ * @param eAction Specifies how the notification updates the task's notification
+ * value, if at all. Valid values for eAction are as follows:
+ *
+ * eSetBits -
+ * The task's notification value is bitwise ORed with ulValue. xTaskNotify()
+ * always returns pdPASS in this case.
+ *
+ * eIncrement -
+ * The task's notification value is incremented. ulValue is not used and
+ * xTaskNotify() always returns pdPASS in this case.
+ *
+ * eSetValueWithOverwrite -
+ * The task's notification value is set to the value of ulValue, even if the
+ * task being notified had not yet processed the previous notification (the
+ * task already had a notification pending). xTaskNotify() always returns
+ * pdPASS in this case.
+ *
+ * eSetValueWithoutOverwrite -
+ * If the task being notified did not already have a notification pending then
+ * the task's notification value is set to ulValue and xTaskNotify() will
+ * return pdPASS. If the task being notified already had a notification
+ * pending then no action is performed and pdFAIL is returned.
+ *
+ * eNoAction -
+ * The task receives a notification without its notification value being
+ * updated. ulValue is not used and xTaskNotify() always returns pdPASS in
+ * this case.
+ *
+ * @param pxHigherPriorityTaskWoken xTaskNotifyFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the
+ * task to which the notification was sent to leave the Blocked state, and the
+ * unblocked task has a priority higher than the currently running task. If
+ * xTaskNotifyFromISR() sets this value to pdTRUE then a context switch should
+ * be requested before the interrupt is exited. How a context switch is
+ * requested from an ISR is dependent on the port - see the documentation page
+ * for the port in use.
+ *
+ * @return Dependent on the value of eAction. See the description of the
+ * eAction parameter.
+ *
+ * \defgroup xTaskNotifyIndexedFromISR xTaskNotifyIndexedFromISR
+ * \ingroup TaskNotifications
+ */
+BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ uint32_t ulValue,
+ eNotifyAction eAction,
+ uint32_t * pulPreviousNotificationValue,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+#define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
+ xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
+#define xTaskNotifyIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
+ xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyAndQueryIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );
+ * BaseType_t xTaskNotifyAndQueryFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * xTaskNotifyAndQueryIndexedFromISR() performs the same operation as
+ * xTaskNotifyIndexedFromISR() with the addition that it also returns the
+ * subject task's prior notification value (the notification value at the time
+ * the function is called rather than at the time the function returns) in the
+ * additional pulPreviousNotifyValue parameter.
+ *
+ * xTaskNotifyAndQueryFromISR() performs the same operation as
+ * xTaskNotifyFromISR() with the addition that it also returns the subject
+ * task's prior notification value (the notification value at the time the
+ * function is called rather than at the time the function returns) in the
+ * additional pulPreviousNotifyValue parameter.
+ *
+ * \defgroup xTaskNotifyAndQueryIndexedFromISR xTaskNotifyAndQueryIndexedFromISR
+ * \ingroup TaskNotifications
+ */
+#define xTaskNotifyAndQueryIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
+ xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
+#define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
+ xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyWaitIndexed( UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
+ *
+ * BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Waits for a direct to task notification to be pending at a given index within
+ * an array of direct to task notifications.
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
+ * function to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * A notification sent to a task will remain pending until it is cleared by the
+ * task calling xTaskNotifyWaitIndexed() or ulTaskNotifyTakeIndexed() (or their
+ * un-indexed equivalents). If the task was already in the Blocked state to
+ * wait for a notification when the notification arrives then the task will
+ * automatically be removed from the Blocked state (unblocked) and the
+ * notification cleared.
+ *
+ * A task can use xTaskNotifyWaitIndexed() to [optionally] block to wait for a
+ * notification to be pending, or ulTaskNotifyTakeIndexed() to [optionally] block
+ * to wait for a notification value to have a non-zero value. The task does
+ * not consume any CPU time while it is in the Blocked state.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotifyWait() is the original API function, and remains backward
+ * compatible by always operating on the notification value at index 0 in the
+ * array. Calling xTaskNotifyWait() is equivalent to calling
+ * xTaskNotifyWaitIndexed() with the uxIndexToWaitOn parameter set to 0.
+ *
+ * @param uxIndexToWaitOn The index within the calling task's array of
+ * notification values on which the calling task will wait for a notification to
+ * be received. uxIndexToWaitOn must be less than
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES. xTaskNotifyWait() does
+ * not have this parameter and always waits for notifications on index 0.
+ *
+ * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value
+ * will be cleared in the calling task's notification value before the task
+ * checks to see if any notifications are pending, and optionally blocks if no
+ * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if
+ * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have
+ * the effect of resetting the task's notification value to 0. Setting
+ * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged.
+ *
+ * @param ulBitsToClearOnExit If a notification is pending or received before
+ * the calling task exits the xTaskNotifyWait() function then the task's
+ * notification value (see the xTaskNotify() API function) is passed out using
+ * the pulNotificationValue parameter. Then any bits that are set in
+ * ulBitsToClearOnExit will be cleared in the task's notification value (note
+ * *pulNotificationValue is set before any bits are cleared). Setting
+ * ulBitsToClearOnExit to ULONG_MAX (if limits.h is included) or 0xffffffffUL
+ * (if limits.h is not included) will have the effect of resetting the task's
+ * notification value to 0 before the function exits. Setting
+ * ulBitsToClearOnExit to 0 will leave the task's notification value unchanged
+ * when the function exits (in which case the value passed out in
+ * pulNotificationValue will match the task's notification value).
+ *
+ * @param pulNotificationValue Used to pass the task's notification value out
+ * of the function. Note the value passed out will not be effected by the
+ * clearing of any bits caused by ulBitsToClearOnExit being non-zero.
+ *
+ * @param xTicksToWait The maximum amount of time that the task should wait in
+ * the Blocked state for a notification to be received, should a notification
+ * not already be pending when xTaskNotifyWait() was called. The task
+ * will not consume any processing time while it is in the Blocked state. This
+ * is specified in kernel ticks, the macro pdMS_TO_TICKS( value_in_ms ) can be
+ * used to convert a time specified in milliseconds to a time specified in
+ * ticks.
+ *
+ * @return If a notification was received (including notifications that were
+ * already pending when xTaskNotifyWait was called) then pdPASS is
+ * returned. Otherwise pdFAIL is returned.
+ *
+ * \defgroup xTaskNotifyWaitIndexed xTaskNotifyWaitIndexed
+ * \ingroup TaskNotifications
+ */
+BaseType_t xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
+ uint32_t ulBitsToClearOnEntry,
+ uint32_t ulBitsToClearOnExit,
+ uint32_t * pulNotificationValue,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#define xTaskNotifyWait( ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
+ xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
+#define xTaskNotifyWaitIndexed( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
+ xTaskGenericNotifyWait( ( uxIndexToWaitOn ), ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyGiveIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify );
+ * BaseType_t xTaskNotifyGive( TaskHandle_t xTaskToNotify );
+ * @endcode
+ *
+ * Sends a direct to task notification to a particular index in the target
+ * task's notification array in a manner similar to giving a counting semaphore.
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
+ * macros to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * xTaskNotifyGiveIndexed() is a helper macro intended for use when task
+ * notifications are used as light weight and faster binary or counting
+ * semaphore equivalents. Actual FreeRTOS semaphores are given using the
+ * xSemaphoreGive() API function, the equivalent action that instead uses a task
+ * notification is xTaskNotifyGiveIndexed().
+ *
+ * When task notifications are being used as a binary or counting semaphore
+ * equivalent then the task being notified should wait for the notification
+ * using the ulTaskNotifyTakeIndexed() API function rather than the
+ * xTaskNotifyWaitIndexed() API function.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotifyGive() is the original API function, and remains backward
+ * compatible by always operating on the notification value at index 0 in the
+ * array. Calling xTaskNotifyGive() is equivalent to calling
+ * xTaskNotifyGiveIndexed() with the uxIndexToNotify parameter set to 0.
+ *
+ * @param xTaskToNotify The handle of the task being notified. The handle to a
+ * task can be returned from the xTaskCreate() API function used to create the
+ * task, and the handle of the currently running task can be obtained by calling
+ * xTaskGetCurrentTaskHandle().
+ *
+ * @param uxIndexToNotify The index within the target task's array of
+ * notification values to which the notification is to be sent. uxIndexToNotify
+ * must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES. xTaskNotifyGive()
+ * does not have this parameter and always sends notifications to index 0.
+ *
+ * @return xTaskNotifyGive() is a macro that calls xTaskNotify() with the
+ * eAction parameter set to eIncrement - so pdPASS is always returned.
+ *
+ * \defgroup xTaskNotifyGiveIndexed xTaskNotifyGiveIndexed
+ * \ingroup TaskNotifications
+ */
+#define xTaskNotifyGive( xTaskToNotify ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( 0 ), eIncrement, NULL )
+#define xTaskNotifyGiveIndexed( xTaskToNotify, uxIndexToNotify ) \
+ xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( 0 ), eIncrement, NULL )
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskNotifyGiveIndexedFromISR( TaskHandle_t xTaskHandle, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken );
+ * void vTaskNotifyGiveFromISR( TaskHandle_t xTaskHandle, BaseType_t *pxHigherPriorityTaskWoken );
+ * @endcode
+ *
+ * A version of xTaskNotifyGiveIndexed() that can be called from an interrupt
+ * service routine (ISR).
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro
+ * to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * vTaskNotifyGiveIndexedFromISR() is intended for use when task notifications
+ * are used as light weight and faster binary or counting semaphore equivalents.
+ * Actual FreeRTOS semaphores are given from an ISR using the
+ * xSemaphoreGiveFromISR() API function, the equivalent action that instead uses
+ * a task notification is vTaskNotifyGiveIndexedFromISR().
+ *
+ * When task notifications are being used as a binary or counting semaphore
+ * equivalent then the task being notified should wait for the notification
+ * using the ulTaskNotifyTakeIndexed() API function rather than the
+ * xTaskNotifyWaitIndexed() API function.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotifyFromISR() is the original API function, and remains
+ * backward compatible by always operating on the notification value at index 0
+ * within the array. Calling xTaskNotifyGiveFromISR() is equivalent to calling
+ * xTaskNotifyGiveIndexedFromISR() with the uxIndexToNotify parameter set to 0.
+ *
+ * @param xTaskToNotify The handle of the task being notified. The handle to a
+ * task can be returned from the xTaskCreate() API function used to create the
+ * task, and the handle of the currently running task can be obtained by calling
+ * xTaskGetCurrentTaskHandle().
+ *
+ * @param uxIndexToNotify The index within the target task's array of
+ * notification values to which the notification is to be sent. uxIndexToNotify
+ * must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES.
+ * xTaskNotifyGiveFromISR() does not have this parameter and always sends
+ * notifications to index 0.
+ *
+ * @param pxHigherPriorityTaskWoken vTaskNotifyGiveFromISR() will set
+ * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the
+ * task to which the notification was sent to leave the Blocked state, and the
+ * unblocked task has a priority higher than the currently running task. If
+ * vTaskNotifyGiveFromISR() sets this value to pdTRUE then a context switch
+ * should be requested before the interrupt is exited. How a context switch is
+ * requested from an ISR is dependent on the port - see the documentation page
+ * for the port in use.
+ *
+ * \defgroup vTaskNotifyGiveIndexedFromISR vTaskNotifyGiveIndexedFromISR
+ * \ingroup TaskNotifications
+ */
+void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+#define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) \
+ vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) )
+#define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) \
+ vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) )
+
+/**
+ * task. h
+ * @code{c}
+ * uint32_t ulTaskNotifyTakeIndexed( UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
+ *
+ * uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
+ * @endcode
+ *
+ * Waits for a direct to task notification on a particular index in the calling
+ * task's notification array in a manner similar to taking a counting semaphore.
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
+ * function to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * Events can be sent to a task using an intermediary object. Examples of such
+ * objects are queues, semaphores, mutexes and event groups. Task notifications
+ * are a method of sending an event directly to a task without the need for such
+ * an intermediary object.
+ *
+ * A notification sent to a task can optionally perform an action, such as
+ * update, overwrite or increment one of the task's notification values. In
+ * that way task notifications can be used to send data to a task, or be used as
+ * light weight and fast binary or counting semaphores.
+ *
+ * ulTaskNotifyTakeIndexed() is intended for use when a task notification is
+ * used as a faster and lighter weight binary or counting semaphore alternative.
+ * Actual FreeRTOS semaphores are taken using the xSemaphoreTake() API function,
+ * the equivalent action that instead uses a task notification is
+ * ulTaskNotifyTakeIndexed().
+ *
+ * When a task is using its notification value as a binary or counting semaphore
+ * other tasks should send notifications to it using the xTaskNotifyGiveIndexed()
+ * macro, or xTaskNotifyIndex() function with the eAction parameter set to
+ * eIncrement.
+ *
+ * ulTaskNotifyTakeIndexed() can either clear the task's notification value at
+ * the array index specified by the uxIndexToWaitOn parameter to zero on exit,
+ * in which case the notification value acts like a binary semaphore, or
+ * decrement the notification value on exit, in which case the notification
+ * value acts like a counting semaphore.
+ *
+ * A task can use ulTaskNotifyTakeIndexed() to [optionally] block to wait for
+ * a notification. The task does not consume any CPU time while it is in the
+ * Blocked state.
+ *
+ * Where as xTaskNotifyWaitIndexed() will return when a notification is pending,
+ * ulTaskNotifyTakeIndexed() will return when the task's notification value is
+ * not zero.
+ *
+ * **NOTE** Each notification within the array operates independently - a task
+ * can only block on one notification within the array at a time and will not be
+ * unblocked by a notification sent to any other array index.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. ulTaskNotifyTake() is the original API function, and remains backward
+ * compatible by always operating on the notification value at index 0 in the
+ * array. Calling ulTaskNotifyTake() is equivalent to calling
+ * ulTaskNotifyTakeIndexed() with the uxIndexToWaitOn parameter set to 0.
+ *
+ * @param uxIndexToWaitOn The index within the calling task's array of
+ * notification values on which the calling task will wait for a notification to
+ * be non-zero. uxIndexToWaitOn must be less than
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES. xTaskNotifyTake() does
+ * not have this parameter and always waits for notifications on index 0.
+ *
+ * @param xClearCountOnExit if xClearCountOnExit is pdFALSE then the task's
+ * notification value is decremented when the function exits. In this way the
+ * notification value acts like a counting semaphore. If xClearCountOnExit is
+ * not pdFALSE then the task's notification value is cleared to zero when the
+ * function exits. In this way the notification value acts like a binary
+ * semaphore.
+ *
+ * @param xTicksToWait The maximum amount of time that the task should wait in
+ * the Blocked state for the task's notification value to be greater than zero,
+ * should the count not already be greater than zero when
+ * ulTaskNotifyTake() was called. The task will not consume any processing
+ * time while it is in the Blocked state. This is specified in kernel ticks,
+ * the macro pdMS_TO_TICKS( value_in_ms ) can be used to convert a time
+ * specified in milliseconds to a time specified in ticks.
+ *
+ * @return The task's notification count before it is either cleared to zero or
+ * decremented (see the xClearCountOnExit parameter).
+ *
+ * \defgroup ulTaskNotifyTakeIndexed ulTaskNotifyTakeIndexed
+ * \ingroup TaskNotifications
+ */
+uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
+ BaseType_t xClearCountOnExit,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#define ulTaskNotifyTake( xClearCountOnExit, xTicksToWait ) \
+ ulTaskGenericNotifyTake( ( tskDEFAULT_INDEX_TO_NOTIFY ), ( xClearCountOnExit ), ( xTicksToWait ) )
+#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait ) \
+ ulTaskGenericNotifyTake( ( uxIndexToWaitOn ), ( xClearCountOnExit ), ( xTicksToWait ) )
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskNotifyStateClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToCLear );
+ *
+ * BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
+ * functions to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * If a notification is sent to an index within the array of notifications then
+ * the notification at that index is said to be 'pending' until it is read or
+ * explicitly cleared by the receiving task. xTaskNotifyStateClearIndexed()
+ * is the function that clears a pending notification without reading the
+ * notification value. The notification value at the same array index is not
+ * altered. Set xTask to NULL to clear the notification state of the calling
+ * task.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. xTaskNotifyStateClear() is the original API function, and remains
+ * backward compatible by always operating on the notification value at index 0
+ * within the array. Calling xTaskNotifyStateClear() is equivalent to calling
+ * xTaskNotifyStateClearIndexed() with the uxIndexToNotify parameter set to 0.
+ *
+ * @param xTask The handle of the RTOS task that will have a notification state
+ * cleared. Set xTask to NULL to clear a notification state in the calling
+ * task. To obtain a task's handle create the task using xTaskCreate() and
+ * make use of the pxCreatedTask parameter, or create the task using
+ * xTaskCreateStatic() and store the returned value, or use the task's name in
+ * a call to xTaskGetHandle().
+ *
+ * @param uxIndexToClear The index within the target task's array of
+ * notification values to act upon. For example, setting uxIndexToClear to 1
+ * will clear the state of the notification at index 1 within the array.
+ * uxIndexToClear must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES.
+ * ulTaskNotifyStateClear() does not have this parameter and always acts on the
+ * notification at index 0.
+ *
+ * @return pdTRUE if the task's notification state was set to
+ * eNotWaitingNotification, otherwise pdFALSE.
+ *
+ * \defgroup xTaskNotifyStateClearIndexed xTaskNotifyStateClearIndexed
+ * \ingroup TaskNotifications
+ */
+BaseType_t xTaskGenericNotifyStateClear( TaskHandle_t xTask,
+ UBaseType_t uxIndexToClear ) PRIVILEGED_FUNCTION;
+#define xTaskNotifyStateClear( xTask ) \
+ xTaskGenericNotifyStateClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ) )
+#define xTaskNotifyStateClearIndexed( xTask, uxIndexToClear ) \
+ xTaskGenericNotifyStateClear( ( xTask ), ( uxIndexToClear ) )
+
+/**
+ * task. h
+ * @code{c}
+ * uint32_t ulTaskNotifyValueClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear );
+ *
+ * uint32_t ulTaskNotifyValueClear( TaskHandle_t xTask, uint32_t ulBitsToClear );
+ * @endcode
+ *
+ * See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
+ *
+ * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
+ * functions to be available.
+ *
+ * Each task has a private array of "notification values" (or 'notifications'),
+ * each of which is a 32-bit unsigned integer (uint32_t). The constant
+ * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
+ * array, and (for backward compatibility) defaults to 1 if left undefined.
+ * Prior to FreeRTOS V10.4.0 there was only one notification value per task.
+ *
+ * ulTaskNotifyValueClearIndexed() clears the bits specified by the
+ * ulBitsToClear bit mask in the notification value at array index uxIndexToClear
+ * of the task referenced by xTask.
+ *
+ * Backward compatibility information:
+ * Prior to FreeRTOS V10.4.0 each task had a single "notification value", and
+ * all task notification API functions operated on that value. Replacing the
+ * single notification value with an array of notification values necessitated a
+ * new set of API functions that could address specific notifications within the
+ * array. ulTaskNotifyValueClear() is the original API function, and remains
+ * backward compatible by always operating on the notification value at index 0
+ * within the array. Calling ulTaskNotifyValueClear() is equivalent to calling
+ * ulTaskNotifyValueClearIndexed() with the uxIndexToClear parameter set to 0.
+ *
+ * @param xTask The handle of the RTOS task that will have bits in one of its
+ * notification values cleared. Set xTask to NULL to clear bits in a
+ * notification value of the calling task. To obtain a task's handle create the
+ * task using xTaskCreate() and make use of the pxCreatedTask parameter, or
+ * create the task using xTaskCreateStatic() and store the returned value, or
+ * use the task's name in a call to xTaskGetHandle().
+ *
+ * @param uxIndexToClear The index within the target task's array of
+ * notification values in which to clear the bits. uxIndexToClear
+ * must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES.
+ * ulTaskNotifyValueClear() does not have this parameter and always clears bits
+ * in the notification value at index 0.
+ *
+ * @param ulBitsToClear Bit mask of the bits to clear in the notification value of
+ * xTask. Set a bit to 1 to clear the corresponding bits in the task's notification
+ * value. Set ulBitsToClear to 0xffffffff (UINT_MAX on 32-bit architectures) to clear
+ * the notification value to 0. Set ulBitsToClear to 0 to query the task's
+ * notification value without clearing any bits.
+ *
+ *
+ * @return The value of the target task's notification value before the bits
+ * specified by ulBitsToClear were cleared.
+ * \defgroup ulTaskNotifyValueClear ulTaskNotifyValueClear
+ * \ingroup TaskNotifications
+ */
+uint32_t ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
+ UBaseType_t uxIndexToClear,
+ uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
+#define ulTaskNotifyValueClear( xTask, ulBitsToClear ) \
+ ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )
+#define ulTaskNotifyValueClearIndexed( xTask, uxIndexToClear, ulBitsToClear ) \
+ ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )
+
+/**
+ * task.h
+ * @code{c}
+ * void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut );
+ * @endcode
+ *
+ * Capture the current time for future use with xTaskCheckForTimeOut().
+ *
+ * @param pxTimeOut Pointer to a timeout object into which the current time
+ * is to be captured. The captured time includes the tick count and the number
+ * of times the tick count has overflowed since the system first booted.
+ * \defgroup vTaskSetTimeOutState vTaskSetTimeOutState
+ * \ingroup TaskCtrl
+ */
+void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ * @code{c}
+ * BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );
+ * @endcode
+ *
+ * Determines if pxTicksToWait ticks has passed since a time was captured
+ * using a call to vTaskSetTimeOutState(). The captured time includes the tick
+ * count and the number of times the tick count has overflowed.
+ *
+ * @param pxTimeOut The time status as captured previously using
+ * vTaskSetTimeOutState. If the timeout has not yet occurred, it is updated
+ * to reflect the current time status.
+ * @param pxTicksToWait The number of ticks to check for timeout i.e. if
+ * pxTicksToWait ticks have passed since pxTimeOut was last updated (either by
+ * vTaskSetTimeOutState() or xTaskCheckForTimeOut()), the timeout has occurred.
+ * If the timeout has not occurred, pxTicksToWait is updated to reflect the
+ * number of remaining ticks.
+ *
+ * @return If timeout has occurred, pdTRUE is returned. Otherwise pdFALSE is
+ * returned and pxTicksToWait is updated to reflect the number of remaining
+ * ticks.
+ *
+ * @see https://www.FreeRTOS.org/xTaskCheckForTimeOut.html
+ *
+ * Example Usage:
+ * @code{c}
+ * // Driver library function used to receive uxWantedBytes from an Rx buffer
+ * // that is filled by a UART interrupt. If there are not enough bytes in the
+ * // Rx buffer then the task enters the Blocked state until it is notified that
+ * // more data has been placed into the buffer. If there is still not enough
+ * // data then the task re-enters the Blocked state, and xTaskCheckForTimeOut()
+ * // is used to re-calculate the Block time to ensure the total amount of time
+ * // spent in the Blocked state does not exceed MAX_TIME_TO_WAIT. This
+ * // continues until either the buffer contains at least uxWantedBytes bytes,
+ * // or the total amount of time spent in the Blocked state reaches
+ * // MAX_TIME_TO_WAIT - at which point the task reads however many bytes are
+ * // available up to a maximum of uxWantedBytes.
+ *
+ * size_t xUART_Receive( uint8_t *pucBuffer, size_t uxWantedBytes )
+ * {
+ * size_t uxReceived = 0;
+ * TickType_t xTicksToWait = MAX_TIME_TO_WAIT;
+ * TimeOut_t xTimeOut;
+ *
+ * // Initialize xTimeOut. This records the time at which this function
+ * // was entered.
+ * vTaskSetTimeOutState( &xTimeOut );
+ *
+ * // Loop until the buffer contains the wanted number of bytes, or a
+ * // timeout occurs.
+ * while( UART_bytes_in_rx_buffer( pxUARTInstance ) < uxWantedBytes )
+ * {
+ * // The buffer didn't contain enough data so this task is going to
+ * // enter the Blocked state. Adjusting xTicksToWait to account for
+ * // any time that has been spent in the Blocked state within this
+ * // function so far to ensure the total amount of time spent in the
+ * // Blocked state does not exceed MAX_TIME_TO_WAIT.
+ * if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) != pdFALSE )
+ * {
+ * //Timed out before the wanted number of bytes were available,
+ * // exit the loop.
+ * break;
+ * }
+ *
+ * // Wait for a maximum of xTicksToWait ticks to be notified that the
+ * // receive interrupt has placed more data into the buffer.
+ * ulTaskNotifyTake( pdTRUE, xTicksToWait );
+ * }
+ *
+ * // Attempt to read uxWantedBytes from the receive buffer into pucBuffer.
+ * // The actual number of bytes read (which might be less than
+ * // uxWantedBytes) is returned.
+ * uxReceived = UART_read_from_receive_buffer( pxUARTInstance,
+ * pucBuffer,
+ * uxWantedBytes );
+ *
+ * return uxReceived;
+ * }
+ * @endcode
+ * \defgroup xTaskCheckForTimeOut xTaskCheckForTimeOut
+ * \ingroup TaskCtrl
+ */
+BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
+ TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * task.h
+ * @code{c}
+ * BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp );
+ * @endcode
+ *
+ * This function corrects the tick count value after the application code has held
+ * interrupts disabled for an extended period resulting in tick interrupts having
+ * been missed.
+ *
+ * This function is similar to vTaskStepTick(), however, unlike
+ * vTaskStepTick(), xTaskCatchUpTicks() may move the tick count forward past a
+ * time at which a task should be removed from the blocked state. That means
+ * tasks may have to be removed from the blocked state as the tick count is
+ * moved.
+ *
+ * @param xTicksToCatchUp The number of tick interrupts that have been missed due to
+ * interrupts being disabled. Its value is not computed automatically, so must be
+ * computed by the application writer.
+ *
+ * @return pdTRUE if moving the tick count forward resulted in a task leaving the
+ * blocked state and a context switch being performed. Otherwise pdFALSE.
+ *
+ * \defgroup xTaskCatchUpTicks xTaskCatchUpTicks
+ * \ingroup TaskCtrl
+ */
+BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) PRIVILEGED_FUNCTION;
+
+
+/*-----------------------------------------------------------
+* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
+*----------------------------------------------------------*/
+
+/*
+ * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
+ * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
+ * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
+ *
+ * Called from the real time kernel tick (either preemptive or cooperative),
+ * this increments the tick count and checks if any tasks that are blocked
+ * for a finite period required removing from a blocked list and placing on
+ * a ready list. If a non-zero value is returned then a context switch is
+ * required because either:
+ * + A task was removed from a blocked list because its timeout had expired,
+ * or
+ * + Time slicing is in use and there is a task of equal priority to the
+ * currently running task.
+ */
+BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
+ * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
+ *
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
+ *
+ * Removes the calling task from the ready list and places it both
+ * on the list of tasks waiting for a particular event, and the
+ * list of delayed tasks. The task will be removed from both lists
+ * and replaced on the ready list should either the event occur (and
+ * there be no higher priority tasks waiting on the same event) or
+ * the delay period expires.
+ *
+ * The 'unordered' version replaces the event list item value with the
+ * xItemValue value, and inserts the list item at the end of the list.
+ *
+ * The 'ordered' version uses the existing event list item value (which is the
+ * owning task's priority) to insert the list item into the event list in task
+ * priority order.
+ *
+ * @param pxEventList The list containing tasks that are blocked waiting
+ * for the event to occur.
+ *
+ * @param xItemValue The item value to use for the event list item when the
+ * event list is not ordered by task priority.
+ *
+ * @param xTicksToWait The maximum amount of time that the task should wait
+ * for the event to occur. This is specified in kernel ticks, the constant
+ * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time
+ * period.
+ */
+void vTaskPlaceOnEventList( List_t * const pxEventList,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
+ const TickType_t xItemValue,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/*
+ * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
+ * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
+ *
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
+ *
+ * This function performs nearly the same function as vTaskPlaceOnEventList().
+ * The difference being that this function does not permit tasks to block
+ * indefinitely, whereas vTaskPlaceOnEventList() does.
+ *
+ */
+void vTaskPlaceOnEventListRestricted( List_t * const pxEventList,
+ TickType_t xTicksToWait,
+ const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
+
+/*
+ * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
+ * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
+ *
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
+ *
+ * Removes a task from both the specified event list and the list of blocked
+ * tasks, and places it on a ready queue.
+ *
+ * xTaskRemoveFromEventList()/vTaskRemoveFromUnorderedEventList() will be called
+ * if either an event occurs to unblock a task, or the block timeout period
+ * expires.
+ *
+ * xTaskRemoveFromEventList() is used when the event list is in task priority
+ * order. It removes the list item from the head of the event list as that will
+ * have the highest priority owning task of all the tasks on the event list.
+ * vTaskRemoveFromUnorderedEventList() is used when the event list is not
+ * ordered and the event list items hold something other than the owning tasks
+ * priority. In this case the event list item value is updated to the value
+ * passed in the xItemValue parameter.
+ *
+ * @return pdTRUE if the task being removed has a higher priority than the task
+ * making the call, otherwise pdFALSE.
+ */
+BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;
+void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
+ const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
+
+/*
+ * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
+ * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
+ * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
+ *
+ * Sets the pointer to the current TCB to the TCB of the highest priority task
+ * that is ready to run.
+ */
+portDONT_DISCARD void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
+ * THE EVENT BITS MODULE.
+ */
+TickType_t uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * Return the handle of the calling task.
+ */
+TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * Shortcut used by the queue implementation to prevent unnecessary call to
+ * taskYIELD();
+ */
+void vTaskMissedYield( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * Returns the scheduler state as taskSCHEDULER_RUNNING,
+ * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
+ */
+BaseType_t xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * Raises the priority of the mutex holder to that of the calling task should
+ * the mutex holder have a priority less than the calling task.
+ */
+BaseType_t xTaskPriorityInherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;
+
+/*
+ * Set the priority of a task back to its proper priority in the case that it
+ * inherited a higher priority while it was holding a semaphore.
+ */
+BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;
+
+/*
+ * If a higher priority task attempting to obtain a mutex caused a lower
+ * priority task to inherit the higher priority task's priority - but the higher
+ * priority task then timed out without obtaining the mutex, then the lower
+ * priority task will disinherit the priority again - but only down as far as
+ * the highest priority task that is still waiting for the mutex (if there were
+ * more than one task waiting for the mutex).
+ */
+void vTaskPriorityDisinheritAfterTimeout( TaskHandle_t const pxMutexHolder,
+ UBaseType_t uxHighestPriorityWaitingTask ) PRIVILEGED_FUNCTION;
+
+/*
+ * Get the uxTaskNumber assigned to the task referenced by the xTask parameter.
+ */
+UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/*
+ * Set the uxTaskNumber of the task referenced by the xTask parameter to
+ * uxHandle.
+ */
+void vTaskSetTaskNumber( TaskHandle_t xTask,
+ const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
+
+/*
+ * Only available when configUSE_TICKLESS_IDLE is set to 1.
+ * If tickless mode is being used, or a low power mode is implemented, then
+ * the tick interrupt will not execute during idle periods. When this is the
+ * case, the tick count value maintained by the scheduler needs to be kept up
+ * to date with the actual execution time by being skipped forward by a time
+ * equal to the idle period.
+ */
+void vTaskStepTick( TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
+
+/*
+ * Only available when configUSE_TICKLESS_IDLE is set to 1.
+ * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port
+ * specific sleep function to determine if it is ok to proceed with the sleep,
+ * and if it is ok to proceed, if it is ok to sleep indefinitely.
+ *
+ * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only
+ * called with the scheduler suspended, not from within a critical section. It
+ * is therefore possible for an interrupt to request a context switch between
+ * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being
+ * entered. eTaskConfirmSleepModeStatus() should be called from a short
+ * critical section between the timer being stopped and the sleep mode being
+ * entered to ensure it is ok to proceed into the sleep mode.
+ */
+eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * For internal use only. Increment the mutex held count when a mutex is
+ * taken and return the handle of the task that has taken the mutex.
+ */
+TaskHandle_t pvTaskIncrementMutexHeldCount( void ) PRIVILEGED_FUNCTION;
+
+/*
+ * For internal use only. Same as vTaskSetTimeOutState(), but without a critical
+ * section.
+ */
+void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
+
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+#endif /* INC_TASK_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/timers.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/timers.h
new file mode 100644
index 0000000..4b73908
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/include/timers.h
@@ -0,0 +1,1369 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#ifndef TIMERS_H
+#define TIMERS_H
+
+#ifndef INC_FREERTOS_H
+ #error "include FreeRTOS.h must appear in source files before include timers.h"
+#endif
+
+/*lint -save -e537 This headers are only multiply included if the application code
+ * happens to also be including task.h. */
+#include "task.h"
+/*lint -restore */
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+/* *INDENT-ON* */
+
+/*-----------------------------------------------------------
+* MACROS AND DEFINITIONS
+*----------------------------------------------------------*/
+
+/* IDs for commands that can be sent/received on the timer queue. These are to
+ * be used solely through the macros that make up the public software timer API,
+ * as defined below. The commands that are sent from interrupts must use the
+ * highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task
+ * or interrupt version of the queue send function should be used. */
+#define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR ( ( BaseType_t ) -2 )
+#define tmrCOMMAND_EXECUTE_CALLBACK ( ( BaseType_t ) -1 )
+#define tmrCOMMAND_START_DONT_TRACE ( ( BaseType_t ) 0 )
+#define tmrCOMMAND_START ( ( BaseType_t ) 1 )
+#define tmrCOMMAND_RESET ( ( BaseType_t ) 2 )
+#define tmrCOMMAND_STOP ( ( BaseType_t ) 3 )
+#define tmrCOMMAND_CHANGE_PERIOD ( ( BaseType_t ) 4 )
+#define tmrCOMMAND_DELETE ( ( BaseType_t ) 5 )
+
+#define tmrFIRST_FROM_ISR_COMMAND ( ( BaseType_t ) 6 )
+#define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 )
+#define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 )
+#define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 )
+#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 )
+
+
+/**
+ * Type by which software timers are referenced. For example, a call to
+ * xTimerCreate() returns an TimerHandle_t variable that can then be used to
+ * reference the subject timer in calls to other software timer API functions
+ * (for example, xTimerStart(), xTimerReset(), etc.).
+ */
+struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
+typedef struct tmrTimerControl * TimerHandle_t;
+
+/*
+ * Defines the prototype to which timer callback functions must conform.
+ */
+typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
+
+/*
+ * Defines the prototype to which functions used with the
+ * xTimerPendFunctionCallFromISR() function must conform.
+ */
+typedef void (* PendedFunction_t)( void *,
+ uint32_t );
+
+/**
+ * TimerHandle_t xTimerCreate( const char * const pcTimerName,
+ * TickType_t xTimerPeriodInTicks,
+ * BaseType_t xAutoReload,
+ * void * pvTimerID,
+ * TimerCallbackFunction_t pxCallbackFunction );
+ *
+ * Creates a new software timer instance, and returns a handle by which the
+ * created software timer can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, software timers use a block
+ * of memory, in which the timer data structure is stored. If a software timer
+ * is created using xTimerCreate() then the required memory is automatically
+ * dynamically allocated inside the xTimerCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a software timer is created using
+ * xTimerCreateStatic() then the application writer must provide the memory that
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a
+ * software timer to be created without using any dynamic memory allocation.
+ *
+ * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
+ * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
+ * xTimerChangePeriodFromISR() API functions can all be used to transition a
+ * timer into the active state.
+ *
+ * @param pcTimerName A text name that is assigned to the timer. This is done
+ * purely to assist debugging. The kernel itself only ever references a timer
+ * by its handle, and never by its name.
+ *
+ * @param xTimerPeriodInTicks The timer period. The time is defined in tick
+ * periods so the constant portTICK_PERIOD_MS can be used to convert a time that
+ * has been specified in milliseconds. For example, if the timer must expire
+ * after 100 ticks, then xTimerPeriodInTicks should be set to 100.
+ * Alternatively, if the timer must expire after 500ms, then xPeriod can be set
+ * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
+ * equal to 1000. Time timer period must be greater than 0.
+ *
+ * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
+ * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
+ * If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
+ * enter the dormant state after it expires.
+ *
+ * @param pvTimerID An identifier that is assigned to the timer being created.
+ * Typically this would be used in the timer callback function to identify which
+ * timer expired when the same callback function is assigned to more than one
+ * timer.
+ *
+ * @param pxCallbackFunction The function to call when the timer expires.
+ * Callback functions must have the prototype defined by TimerCallbackFunction_t,
+ * which is "void vCallbackFunction( TimerHandle_t xTimer );".
+ *
+ * @return If the timer is successfully created then a handle to the newly
+ * created timer is returned. If the timer cannot be created because there is
+ * insufficient FreeRTOS heap remaining to allocate the timer
+ * structures then NULL is returned.
+ *
+ * Example usage:
+ * @verbatim
+ * #define NUM_TIMERS 5
+ *
+ * // An array to hold handles to the created timers.
+ * TimerHandle_t xTimers[ NUM_TIMERS ];
+ *
+ * // An array to hold a count of the number of times each timer expires.
+ * int32_t lExpireCounters[ NUM_TIMERS ] = { 0 };
+ *
+ * // Define a callback function that will be used by multiple timer instances.
+ * // The callback function does nothing but count the number of times the
+ * // associated timer expires, and stop the timer once the timer has expired
+ * // 10 times.
+ * void vTimerCallback( TimerHandle_t pxTimer )
+ * {
+ * int32_t lArrayIndex;
+ * const int32_t xMaxExpiryCountBeforeStopping = 10;
+ *
+ * // Optionally do something if the pxTimer parameter is NULL.
+ * configASSERT( pxTimer );
+ *
+ * // Which timer expired?
+ * lArrayIndex = ( int32_t ) pvTimerGetTimerID( pxTimer );
+ *
+ * // Increment the number of times that pxTimer has expired.
+ * lExpireCounters[ lArrayIndex ] += 1;
+ *
+ * // If the timer has expired 10 times then stop it from running.
+ * if( lExpireCounters[ lArrayIndex ] == xMaxExpiryCountBeforeStopping )
+ * {
+ * // Do not use a block time if calling a timer API function from a
+ * // timer callback function, as doing so could cause a deadlock!
+ * xTimerStop( pxTimer, 0 );
+ * }
+ * }
+ *
+ * void main( void )
+ * {
+ * int32_t x;
+ *
+ * // Create then start some timers. Starting the timers before the scheduler
+ * // has been started means the timers will start running immediately that
+ * // the scheduler starts.
+ * for( x = 0; x < NUM_TIMERS; x++ )
+ * {
+ * xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
+ * ( 100 * ( x + 1 ) ), // The timer period in ticks.
+ * pdTRUE, // The timers will auto-reload themselves when they expire.
+ * ( void * ) x, // Assign each timer a unique id equal to its array index.
+ * vTimerCallback // Each timer calls the same callback when it expires.
+ * );
+ *
+ * if( xTimers[ x ] == NULL )
+ * {
+ * // The timer was not created.
+ * }
+ * else
+ * {
+ * // Start the timer. No block time is specified, and even if one was
+ * // it would be ignored because the scheduler has not yet been
+ * // started.
+ * if( xTimerStart( xTimers[ x ], 0 ) != pdPASS )
+ * {
+ * // The timer could not be set into the Active state.
+ * }
+ * }
+ * }
+ *
+ * // ...
+ * // Create tasks here.
+ * // ...
+ *
+ * // Starting the scheduler will start the timers running as they have already
+ * // been set into the active state.
+ * vTaskStartScheduler();
+ *
+ * // Should not reach here.
+ * for( ;; );
+ * }
+ * @endverbatim
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const TickType_t xTimerPeriodInTicks,
+ const BaseType_t xAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,
+ * TickType_t xTimerPeriodInTicks,
+ * BaseType_t xAutoReload,
+ * void * pvTimerID,
+ * TimerCallbackFunction_t pxCallbackFunction,
+ * StaticTimer_t *pxTimerBuffer );
+ *
+ * Creates a new software timer instance, and returns a handle by which the
+ * created software timer can be referenced.
+ *
+ * Internally, within the FreeRTOS implementation, software timers use a block
+ * of memory, in which the timer data structure is stored. If a software timer
+ * is created using xTimerCreate() then the required memory is automatically
+ * dynamically allocated inside the xTimerCreate() function. (see
+ * https://www.FreeRTOS.org/a00111.html). If a software timer is created using
+ * xTimerCreateStatic() then the application writer must provide the memory that
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a
+ * software timer to be created without using any dynamic memory allocation.
+ *
+ * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
+ * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
+ * xTimerChangePeriodFromISR() API functions can all be used to transition a
+ * timer into the active state.
+ *
+ * @param pcTimerName A text name that is assigned to the timer. This is done
+ * purely to assist debugging. The kernel itself only ever references a timer
+ * by its handle, and never by its name.
+ *
+ * @param xTimerPeriodInTicks The timer period. The time is defined in tick
+ * periods so the constant portTICK_PERIOD_MS can be used to convert a time that
+ * has been specified in milliseconds. For example, if the timer must expire
+ * after 100 ticks, then xTimerPeriodInTicks should be set to 100.
+ * Alternatively, if the timer must expire after 500ms, then xPeriod can be set
+ * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
+ * equal to 1000. The timer period must be greater than 0.
+ *
+ * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
+ * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
+ * If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
+ * enter the dormant state after it expires.
+ *
+ * @param pvTimerID An identifier that is assigned to the timer being created.
+ * Typically this would be used in the timer callback function to identify which
+ * timer expired when the same callback function is assigned to more than one
+ * timer.
+ *
+ * @param pxCallbackFunction The function to call when the timer expires.
+ * Callback functions must have the prototype defined by TimerCallbackFunction_t,
+ * which is "void vCallbackFunction( TimerHandle_t xTimer );".
+ *
+ * @param pxTimerBuffer Must point to a variable of type StaticTimer_t, which
+ * will be then be used to hold the software timer's data structures, removing
+ * the need for the memory to be allocated dynamically.
+ *
+ * @return If the timer is created then a handle to the created timer is
+ * returned. If pxTimerBuffer was NULL then NULL is returned.
+ *
+ * Example usage:
+ * @verbatim
+ *
+ * // The buffer used to hold the software timer's data structure.
+ * static StaticTimer_t xTimerBuffer;
+ *
+ * // A variable that will be incremented by the software timer's callback
+ * // function.
+ * UBaseType_t uxVariableToIncrement = 0;
+ *
+ * // A software timer callback function that increments a variable passed to
+ * // it when the software timer was created. After the 5th increment the
+ * // callback function stops the software timer.
+ * static void prvTimerCallback( TimerHandle_t xExpiredTimer )
+ * {
+ * UBaseType_t *puxVariableToIncrement;
+ * BaseType_t xReturned;
+ *
+ * // Obtain the address of the variable to increment from the timer ID.
+ * puxVariableToIncrement = ( UBaseType_t * ) pvTimerGetTimerID( xExpiredTimer );
+ *
+ * // Increment the variable to show the timer callback has executed.
+ * ( *puxVariableToIncrement )++;
+ *
+ * // If this callback has executed the required number of times, stop the
+ * // timer.
+ * if( *puxVariableToIncrement == 5 )
+ * {
+ * // This is called from a timer callback so must not block.
+ * xTimerStop( xExpiredTimer, staticDONT_BLOCK );
+ * }
+ * }
+ *
+ *
+ * void main( void )
+ * {
+ * // Create the software time. xTimerCreateStatic() has an extra parameter
+ * // than the normal xTimerCreate() API function. The parameter is a pointer
+ * // to the StaticTimer_t structure that will hold the software timer
+ * // structure. If the parameter is passed as NULL then the structure will be
+ * // allocated dynamically, just as if xTimerCreate() had been called.
+ * xTimer = xTimerCreateStatic( "T1", // Text name for the task. Helps debugging only. Not used by FreeRTOS.
+ * xTimerPeriod, // The period of the timer in ticks.
+ * pdTRUE, // This is an auto-reload timer.
+ * ( void * ) &uxVariableToIncrement, // A variable incremented by the software timer's callback function
+ * prvTimerCallback, // The function to execute when the timer expires.
+ * &xTimerBuffer ); // The buffer that will hold the software timer structure.
+ *
+ * // The scheduler has not started yet so a block time is not used.
+ * xReturned = xTimerStart( xTimer, 0 );
+ *
+ * // ...
+ * // Create tasks here.
+ * // ...
+ *
+ * // Starting the scheduler will start the timers running as they have already
+ * // been set into the active state.
+ * vTaskStartScheduler();
+ *
+ * // Should not reach here.
+ * for( ;; );
+ * }
+ * @endverbatim
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const TickType_t xTimerPeriodInTicks,
+ const BaseType_t xAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction,
+ StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * void *pvTimerGetTimerID( TimerHandle_t xTimer );
+ *
+ * Returns the ID assigned to the timer.
+ *
+ * IDs are assigned to timers using the pvTimerID parameter of the call to
+ * xTimerCreated() that was used to create the timer, and by calling the
+ * vTimerSetTimerID() API function.
+ *
+ * If the same callback function is assigned to multiple timers then the timer
+ * ID can be used as time specific (timer local) storage.
+ *
+ * @param xTimer The timer being queried.
+ *
+ * @return The ID assigned to the timer being queried.
+ *
+ * Example usage:
+ *
+ * See the xTimerCreate() API function example usage scenario.
+ */
+void * pvTimerGetTimerID( const TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/**
+ * void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
+ *
+ * Sets the ID assigned to the timer.
+ *
+ * IDs are assigned to timers using the pvTimerID parameter of the call to
+ * xTimerCreated() that was used to create the timer.
+ *
+ * If the same callback function is assigned to multiple timers then the timer
+ * ID can be used as time specific (timer local) storage.
+ *
+ * @param xTimer The timer being updated.
+ *
+ * @param pvNewID The ID to assign to the timer.
+ *
+ * Example usage:
+ *
+ * See the xTimerCreate() API function example usage scenario.
+ */
+void vTimerSetTimerID( TimerHandle_t xTimer,
+ void * pvNewID ) PRIVILEGED_FUNCTION;
+
+/**
+ * BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );
+ *
+ * Queries a timer to see if it is active or dormant.
+ *
+ * A timer will be dormant if:
+ * 1) It has been created but not started, or
+ * 2) It is an expired one-shot timer that has not been restarted.
+ *
+ * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
+ * xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
+ * xTimerChangePeriodFromISR() API functions can all be used to transition a timer into the
+ * active state.
+ *
+ * @param xTimer The timer being queried.
+ *
+ * @return pdFALSE will be returned if the timer is dormant. A value other than
+ * pdFALSE will be returned if the timer is active.
+ *
+ * Example usage:
+ * @verbatim
+ * // This function assumes xTimer has already been created.
+ * void vAFunction( TimerHandle_t xTimer )
+ * {
+ * if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"
+ * {
+ * // xTimer is active, do something.
+ * }
+ * else
+ * {
+ * // xTimer is not active, do something else.
+ * }
+ * }
+ * @endverbatim
+ */
+BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/**
+ * TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
+ *
+ * Simply returns the handle of the timer service/daemon task. It it not valid
+ * to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started.
+ */
+TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * BaseType_t xTimerStart( TimerHandle_t xTimer, TickType_t xTicksToWait );
+ *
+ * Timer functionality is provided by a timer service/daemon task. Many of the
+ * public FreeRTOS timer API functions send commands to the timer service task
+ * through a queue called the timer command queue. The timer command queue is
+ * private to the kernel itself and is not directly accessible to application
+ * code. The length of the timer command queue is set by the
+ * configTIMER_QUEUE_LENGTH configuration constant.
+ *
+ * xTimerStart() starts a timer that was previously created using the
+ * xTimerCreate() API function. If the timer had already been started and was
+ * already in the active state, then xTimerStart() has equivalent functionality
+ * to the xTimerReset() API function.
+ *
+ * Starting a timer ensures the timer is in the active state. If the timer
+ * is not stopped, deleted, or reset in the mean time, the callback function
+ * associated with the timer will get called 'n' ticks after xTimerStart() was
+ * called, where 'n' is the timers defined period.
+ *
+ * It is valid to call xTimerStart() before the scheduler has been started, but
+ * when this is done the timer will not actually start until the scheduler is
+ * started, and the timers expiry time will be relative to when the scheduler is
+ * started, not relative to when xTimerStart() was called.
+ *
+ * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStart()
+ * to be available.
+ *
+ * @param xTimer The handle of the timer being started/restarted.
+ *
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should
+ * be held in the Blocked state to wait for the start command to be successfully
+ * sent to the timer command queue, should the queue already be full when
+ * xTimerStart() was called. xTicksToWait is ignored if xTimerStart() is called
+ * before the scheduler is started.
+ *
+ * @return pdFAIL will be returned if the start command could not be sent to
+ * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
+ * be returned if the command was successfully sent to the timer command queue.
+ * When the command is actually processed will depend on the priority of the
+ * timer service/daemon task relative to other tasks in the system, although the
+ * timers expiry time is relative to when xTimerStart() is actually called. The
+ * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY
+ * configuration constant.
+ *
+ * Example usage:
+ *
+ * See the xTimerCreate() API function example usage scenario.
+ *
+ */
+#define xTimerStart( xTimer, xTicksToWait ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
+
+/**
+ * BaseType_t xTimerStop( TimerHandle_t xTimer, TickType_t xTicksToWait );
+ *
+ * Timer functionality is provided by a timer service/daemon task. Many of the
+ * public FreeRTOS timer API functions send commands to the timer service task
+ * through a queue called the timer command queue. The timer command queue is
+ * private to the kernel itself and is not directly accessible to application
+ * code. The length of the timer command queue is set by the
+ * configTIMER_QUEUE_LENGTH configuration constant.
+ *
+ * xTimerStop() stops a timer that was previously started using either of the
+ * The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(),
+ * xTimerChangePeriod() or xTimerChangePeriodFromISR() API functions.
+ *
+ * Stopping a timer ensures the timer is not in the active state.
+ *
+ * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStop()
+ * to be available.
+ *
+ * @param xTimer The handle of the timer being stopped.
+ *
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should
+ * be held in the Blocked state to wait for the stop command to be successfully
+ * sent to the timer command queue, should the queue already be full when
+ * xTimerStop() was called. xTicksToWait is ignored if xTimerStop() is called
+ * before the scheduler is started.
+ *
+ * @return pdFAIL will be returned if the stop command could not be sent to
+ * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
+ * be returned if the command was successfully sent to the timer command queue.
+ * When the command is actually processed will depend on the priority of the
+ * timer service/daemon task relative to other tasks in the system. The timer
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
+ * configuration constant.
+ *
+ * Example usage:
+ *
+ * See the xTimerCreate() API function example usage scenario.
+ *
+ */
+#define xTimerStop( xTimer, xTicksToWait ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) )
+
+/**
+ * BaseType_t xTimerChangePeriod( TimerHandle_t xTimer,
+ * TickType_t xNewPeriod,
+ * TickType_t xTicksToWait );
+ *
+ * Timer functionality is provided by a timer service/daemon task. Many of the
+ * public FreeRTOS timer API functions send commands to the timer service task
+ * through a queue called the timer command queue. The timer command queue is
+ * private to the kernel itself and is not directly accessible to application
+ * code. The length of the timer command queue is set by the
+ * configTIMER_QUEUE_LENGTH configuration constant.
+ *
+ * xTimerChangePeriod() changes the period of a timer that was previously
+ * created using the xTimerCreate() API function.
+ *
+ * xTimerChangePeriod() can be called to change the period of an active or
+ * dormant state timer.
+ *
+ * The configUSE_TIMERS configuration constant must be set to 1 for
+ * xTimerChangePeriod() to be available.
+ *
+ * @param xTimer The handle of the timer that is having its period changed.
+ *
+ * @param xNewPeriod The new period for xTimer. Timer periods are specified in
+ * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time
+ * that has been specified in milliseconds. For example, if the timer must
+ * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively,
+ * if the timer must expire after 500ms, then xNewPeriod can be set to
+ * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than
+ * or equal to 1000.
+ *
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should
+ * be held in the Blocked state to wait for the change period command to be
+ * successfully sent to the timer command queue, should the queue already be
+ * full when xTimerChangePeriod() was called. xTicksToWait is ignored if
+ * xTimerChangePeriod() is called before the scheduler is started.
+ *
+ * @return pdFAIL will be returned if the change period command could not be
+ * sent to the timer command queue even after xTicksToWait ticks had passed.
+ * pdPASS will be returned if the command was successfully sent to the timer
+ * command queue. When the command is actually processed will depend on the
+ * priority of the timer service/daemon task relative to other tasks in the
+ * system. The timer service/daemon task priority is set by the
+ * configTIMER_TASK_PRIORITY configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // This function assumes xTimer has already been created. If the timer
+ * // referenced by xTimer is already active when it is called, then the timer
+ * // is deleted. If the timer referenced by xTimer is not active when it is
+ * // called, then the period of the timer is set to 500ms and the timer is
+ * // started.
+ * void vAFunction( TimerHandle_t xTimer )
+ * {
+ * if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )"
+ * {
+ * // xTimer is already active - delete it.
+ * xTimerDelete( xTimer );
+ * }
+ * else
+ * {
+ * // xTimer is not active, change its period to 500ms. This will also
+ * // cause the timer to start. Block for a maximum of 100 ticks if the
+ * // change period command cannot immediately be sent to the timer
+ * // command queue.
+ * if( xTimerChangePeriod( xTimer, 500 / portTICK_PERIOD_MS, 100 ) == pdPASS )
+ * {
+ * // The command was successfully sent.
+ * }
+ * else
+ * {
+ * // The command could not be sent, even after waiting for 100 ticks
+ * // to pass. Take appropriate action here.
+ * }
+ * }
+ * }
+ * @endverbatim
+ */
+#define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) )
+
+/**
+ * BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );
+ *
+ * Timer functionality is provided by a timer service/daemon task. Many of the
+ * public FreeRTOS timer API functions send commands to the timer service task
+ * through a queue called the timer command queue. The timer command queue is
+ * private to the kernel itself and is not directly accessible to application
+ * code. The length of the timer command queue is set by the
+ * configTIMER_QUEUE_LENGTH configuration constant.
+ *
+ * xTimerDelete() deletes a timer that was previously created using the
+ * xTimerCreate() API function.
+ *
+ * The configUSE_TIMERS configuration constant must be set to 1 for
+ * xTimerDelete() to be available.
+ *
+ * @param xTimer The handle of the timer being deleted.
+ *
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should
+ * be held in the Blocked state to wait for the delete command to be
+ * successfully sent to the timer command queue, should the queue already be
+ * full when xTimerDelete() was called. xTicksToWait is ignored if xTimerDelete()
+ * is called before the scheduler is started.
+ *
+ * @return pdFAIL will be returned if the delete command could not be sent to
+ * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
+ * be returned if the command was successfully sent to the timer command queue.
+ * When the command is actually processed will depend on the priority of the
+ * timer service/daemon task relative to other tasks in the system. The timer
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
+ * configuration constant.
+ *
+ * Example usage:
+ *
+ * See the xTimerChangePeriod() API function example usage scenario.
+ */
+#define xTimerDelete( xTimer, xTicksToWait ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )
+
+/**
+ * BaseType_t xTimerReset( TimerHandle_t xTimer, TickType_t xTicksToWait );
+ *
+ * Timer functionality is provided by a timer service/daemon task. Many of the
+ * public FreeRTOS timer API functions send commands to the timer service task
+ * through a queue called the timer command queue. The timer command queue is
+ * private to the kernel itself and is not directly accessible to application
+ * code. The length of the timer command queue is set by the
+ * configTIMER_QUEUE_LENGTH configuration constant.
+ *
+ * xTimerReset() re-starts a timer that was previously created using the
+ * xTimerCreate() API function. If the timer had already been started and was
+ * already in the active state, then xTimerReset() will cause the timer to
+ * re-evaluate its expiry time so that it is relative to when xTimerReset() was
+ * called. If the timer was in the dormant state then xTimerReset() has
+ * equivalent functionality to the xTimerStart() API function.
+ *
+ * Resetting a timer ensures the timer is in the active state. If the timer
+ * is not stopped, deleted, or reset in the mean time, the callback function
+ * associated with the timer will get called 'n' ticks after xTimerReset() was
+ * called, where 'n' is the timers defined period.
+ *
+ * It is valid to call xTimerReset() before the scheduler has been started, but
+ * when this is done the timer will not actually start until the scheduler is
+ * started, and the timers expiry time will be relative to when the scheduler is
+ * started, not relative to when xTimerReset() was called.
+ *
+ * The configUSE_TIMERS configuration constant must be set to 1 for xTimerReset()
+ * to be available.
+ *
+ * @param xTimer The handle of the timer being reset/started/restarted.
+ *
+ * @param xTicksToWait Specifies the time, in ticks, that the calling task should
+ * be held in the Blocked state to wait for the reset command to be successfully
+ * sent to the timer command queue, should the queue already be full when
+ * xTimerReset() was called. xTicksToWait is ignored if xTimerReset() is called
+ * before the scheduler is started.
+ *
+ * @return pdFAIL will be returned if the reset command could not be sent to
+ * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
+ * be returned if the command was successfully sent to the timer command queue.
+ * When the command is actually processed will depend on the priority of the
+ * timer service/daemon task relative to other tasks in the system, although the
+ * timers expiry time is relative to when xTimerStart() is actually called. The
+ * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY
+ * configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // When a key is pressed, an LCD back-light is switched on. If 5 seconds pass
+ * // without a key being pressed, then the LCD back-light is switched off. In
+ * // this case, the timer is a one-shot timer.
+ *
+ * TimerHandle_t xBacklightTimer = NULL;
+ *
+ * // The callback function assigned to the one-shot timer. In this case the
+ * // parameter is not used.
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )
+ * {
+ * // The timer expired, therefore 5 seconds must have passed since a key
+ * // was pressed. Switch off the LCD back-light.
+ * vSetBacklightState( BACKLIGHT_OFF );
+ * }
+ *
+ * // The key press event handler.
+ * void vKeyPressEventHandler( char cKey )
+ * {
+ * // Ensure the LCD back-light is on, then reset the timer that is
+ * // responsible for turning the back-light off after 5 seconds of
+ * // key inactivity. Wait 10 ticks for the command to be successfully sent
+ * // if it cannot be sent immediately.
+ * vSetBacklightState( BACKLIGHT_ON );
+ * if( xTimerReset( xBacklightTimer, 100 ) != pdPASS )
+ * {
+ * // The reset command was not executed successfully. Take appropriate
+ * // action here.
+ * }
+ *
+ * // Perform the rest of the key processing here.
+ * }
+ *
+ * void main( void )
+ * {
+ * int32_t x;
+ *
+ * // Create then start the one-shot timer that is responsible for turning
+ * // the back-light off if no keys are pressed within a 5 second period.
+ * xBacklightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel.
+ * ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks.
+ * pdFALSE, // The timer is a one-shot timer.
+ * 0, // The id is not used by the callback so can take any value.
+ * vBacklightTimerCallback // The callback function that switches the LCD back-light off.
+ * );
+ *
+ * if( xBacklightTimer == NULL )
+ * {
+ * // The timer was not created.
+ * }
+ * else
+ * {
+ * // Start the timer. No block time is specified, and even if one was
+ * // it would be ignored because the scheduler has not yet been
+ * // started.
+ * if( xTimerStart( xBacklightTimer, 0 ) != pdPASS )
+ * {
+ * // The timer could not be set into the Active state.
+ * }
+ * }
+ *
+ * // ...
+ * // Create tasks here.
+ * // ...
+ *
+ * // Starting the scheduler will start the timer running as it has already
+ * // been set into the active state.
+ * vTaskStartScheduler();
+ *
+ * // Should not reach here.
+ * for( ;; );
+ * }
+ * @endverbatim
+ */
+#define xTimerReset( xTimer, xTicksToWait ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
+
+/**
+ * BaseType_t xTimerStartFromISR( TimerHandle_t xTimer,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ *
+ * A version of xTimerStart() that can be called from an interrupt service
+ * routine.
+ *
+ * @param xTimer The handle of the timer being started/restarted.
+ *
+ * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
+ * of its time in the Blocked state, waiting for messages to arrive on the timer
+ * command queue. Calling xTimerStartFromISR() writes a message to the timer
+ * command queue, so has the potential to transition the timer service/daemon
+ * task out of the Blocked state. If calling xTimerStartFromISR() causes the
+ * timer service/daemon task to leave the Blocked state, and the timer service/
+ * daemon task has a priority equal to or greater than the currently executing
+ * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
+ * get set to pdTRUE internally within the xTimerStartFromISR() function. If
+ * xTimerStartFromISR() sets this value to pdTRUE then a context switch should
+ * be performed before the interrupt exits.
+ *
+ * @return pdFAIL will be returned if the start command could not be sent to
+ * the timer command queue. pdPASS will be returned if the command was
+ * successfully sent to the timer command queue. When the command is actually
+ * processed will depend on the priority of the timer service/daemon task
+ * relative to other tasks in the system, although the timers expiry time is
+ * relative to when xTimerStartFromISR() is actually called. The timer
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
+ * configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // This scenario assumes xBacklightTimer has already been created. When a
+ * // key is pressed, an LCD back-light is switched on. If 5 seconds pass
+ * // without a key being pressed, then the LCD back-light is switched off. In
+ * // this case, the timer is a one-shot timer, and unlike the example given for
+ * // the xTimerReset() function, the key press event handler is an interrupt
+ * // service routine.
+ *
+ * // The callback function assigned to the one-shot timer. In this case the
+ * // parameter is not used.
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )
+ * {
+ * // The timer expired, therefore 5 seconds must have passed since a key
+ * // was pressed. Switch off the LCD back-light.
+ * vSetBacklightState( BACKLIGHT_OFF );
+ * }
+ *
+ * // The key press interrupt service routine.
+ * void vKeyPressEventInterruptHandler( void )
+ * {
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Ensure the LCD back-light is on, then restart the timer that is
+ * // responsible for turning the back-light off after 5 seconds of
+ * // key inactivity. This is an interrupt service routine so can only
+ * // call FreeRTOS API functions that end in "FromISR".
+ * vSetBacklightState( BACKLIGHT_ON );
+ *
+ * // xTimerStartFromISR() or xTimerResetFromISR() could be called here
+ * // as both cause the timer to re-calculate its expiry time.
+ * // xHigherPriorityTaskWoken was initialised to pdFALSE when it was
+ * // declared (in this function).
+ * if( xTimerStartFromISR( xBacklightTimer, &xHigherPriorityTaskWoken ) != pdPASS )
+ * {
+ * // The start command was not executed successfully. Take appropriate
+ * // action here.
+ * }
+ *
+ * // Perform the rest of the key processing here.
+ *
+ * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch
+ * // should be performed. The syntax required to perform a context switch
+ * // from inside an ISR varies from port to port, and from compiler to
+ * // compiler. Inspect the demos for the port you are using to find the
+ * // actual syntax required.
+ * if( xHigherPriorityTaskWoken != pdFALSE )
+ * {
+ * // Call the interrupt safe yield function here (actual function
+ * // depends on the FreeRTOS port being used).
+ * }
+ * }
+ * @endverbatim
+ */
+#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
+
+/**
+ * BaseType_t xTimerStopFromISR( TimerHandle_t xTimer,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ *
+ * A version of xTimerStop() that can be called from an interrupt service
+ * routine.
+ *
+ * @param xTimer The handle of the timer being stopped.
+ *
+ * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
+ * of its time in the Blocked state, waiting for messages to arrive on the timer
+ * command queue. Calling xTimerStopFromISR() writes a message to the timer
+ * command queue, so has the potential to transition the timer service/daemon
+ * task out of the Blocked state. If calling xTimerStopFromISR() causes the
+ * timer service/daemon task to leave the Blocked state, and the timer service/
+ * daemon task has a priority equal to or greater than the currently executing
+ * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
+ * get set to pdTRUE internally within the xTimerStopFromISR() function. If
+ * xTimerStopFromISR() sets this value to pdTRUE then a context switch should
+ * be performed before the interrupt exits.
+ *
+ * @return pdFAIL will be returned if the stop command could not be sent to
+ * the timer command queue. pdPASS will be returned if the command was
+ * successfully sent to the timer command queue. When the command is actually
+ * processed will depend on the priority of the timer service/daemon task
+ * relative to other tasks in the system. The timer service/daemon task
+ * priority is set by the configTIMER_TASK_PRIORITY configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // This scenario assumes xTimer has already been created and started. When
+ * // an interrupt occurs, the timer should be simply stopped.
+ *
+ * // The interrupt service routine that stops the timer.
+ * void vAnExampleInterruptServiceRoutine( void )
+ * {
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // The interrupt has occurred - simply stop the timer.
+ * // xHigherPriorityTaskWoken was set to pdFALSE where it was defined
+ * // (within this function). As this is an interrupt service routine, only
+ * // FreeRTOS API functions that end in "FromISR" can be used.
+ * if( xTimerStopFromISR( xTimer, &xHigherPriorityTaskWoken ) != pdPASS )
+ * {
+ * // The stop command was not executed successfully. Take appropriate
+ * // action here.
+ * }
+ *
+ * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch
+ * // should be performed. The syntax required to perform a context switch
+ * // from inside an ISR varies from port to port, and from compiler to
+ * // compiler. Inspect the demos for the port you are using to find the
+ * // actual syntax required.
+ * if( xHigherPriorityTaskWoken != pdFALSE )
+ * {
+ * // Call the interrupt safe yield function here (actual function
+ * // depends on the FreeRTOS port being used).
+ * }
+ * }
+ * @endverbatim
+ */
+#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )
+
+/**
+ * BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,
+ * TickType_t xNewPeriod,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ *
+ * A version of xTimerChangePeriod() that can be called from an interrupt
+ * service routine.
+ *
+ * @param xTimer The handle of the timer that is having its period changed.
+ *
+ * @param xNewPeriod The new period for xTimer. Timer periods are specified in
+ * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time
+ * that has been specified in milliseconds. For example, if the timer must
+ * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively,
+ * if the timer must expire after 500ms, then xNewPeriod can be set to
+ * ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than
+ * or equal to 1000.
+ *
+ * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
+ * of its time in the Blocked state, waiting for messages to arrive on the timer
+ * command queue. Calling xTimerChangePeriodFromISR() writes a message to the
+ * timer command queue, so has the potential to transition the timer service/
+ * daemon task out of the Blocked state. If calling xTimerChangePeriodFromISR()
+ * causes the timer service/daemon task to leave the Blocked state, and the
+ * timer service/daemon task has a priority equal to or greater than the
+ * currently executing task (the task that was interrupted), then
+ * *pxHigherPriorityTaskWoken will get set to pdTRUE internally within the
+ * xTimerChangePeriodFromISR() function. If xTimerChangePeriodFromISR() sets
+ * this value to pdTRUE then a context switch should be performed before the
+ * interrupt exits.
+ *
+ * @return pdFAIL will be returned if the command to change the timers period
+ * could not be sent to the timer command queue. pdPASS will be returned if the
+ * command was successfully sent to the timer command queue. When the command
+ * is actually processed will depend on the priority of the timer service/daemon
+ * task relative to other tasks in the system. The timer service/daemon task
+ * priority is set by the configTIMER_TASK_PRIORITY configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // This scenario assumes xTimer has already been created and started. When
+ * // an interrupt occurs, the period of xTimer should be changed to 500ms.
+ *
+ * // The interrupt service routine that changes the period of xTimer.
+ * void vAnExampleInterruptServiceRoutine( void )
+ * {
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // The interrupt has occurred - change the period of xTimer to 500ms.
+ * // xHigherPriorityTaskWoken was set to pdFALSE where it was defined
+ * // (within this function). As this is an interrupt service routine, only
+ * // FreeRTOS API functions that end in "FromISR" can be used.
+ * if( xTimerChangePeriodFromISR( xTimer, &xHigherPriorityTaskWoken ) != pdPASS )
+ * {
+ * // The command to change the timers period was not executed
+ * // successfully. Take appropriate action here.
+ * }
+ *
+ * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch
+ * // should be performed. The syntax required to perform a context switch
+ * // from inside an ISR varies from port to port, and from compiler to
+ * // compiler. Inspect the demos for the port you are using to find the
+ * // actual syntax required.
+ * if( xHigherPriorityTaskWoken != pdFALSE )
+ * {
+ * // Call the interrupt safe yield function here (actual function
+ * // depends on the FreeRTOS port being used).
+ * }
+ * }
+ * @endverbatim
+ */
+#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )
+
+/**
+ * BaseType_t xTimerResetFromISR( TimerHandle_t xTimer,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ *
+ * A version of xTimerReset() that can be called from an interrupt service
+ * routine.
+ *
+ * @param xTimer The handle of the timer that is to be started, reset, or
+ * restarted.
+ *
+ * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
+ * of its time in the Blocked state, waiting for messages to arrive on the timer
+ * command queue. Calling xTimerResetFromISR() writes a message to the timer
+ * command queue, so has the potential to transition the timer service/daemon
+ * task out of the Blocked state. If calling xTimerResetFromISR() causes the
+ * timer service/daemon task to leave the Blocked state, and the timer service/
+ * daemon task has a priority equal to or greater than the currently executing
+ * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
+ * get set to pdTRUE internally within the xTimerResetFromISR() function. If
+ * xTimerResetFromISR() sets this value to pdTRUE then a context switch should
+ * be performed before the interrupt exits.
+ *
+ * @return pdFAIL will be returned if the reset command could not be sent to
+ * the timer command queue. pdPASS will be returned if the command was
+ * successfully sent to the timer command queue. When the command is actually
+ * processed will depend on the priority of the timer service/daemon task
+ * relative to other tasks in the system, although the timers expiry time is
+ * relative to when xTimerResetFromISR() is actually called. The timer service/daemon
+ * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.
+ *
+ * Example usage:
+ * @verbatim
+ * // This scenario assumes xBacklightTimer has already been created. When a
+ * // key is pressed, an LCD back-light is switched on. If 5 seconds pass
+ * // without a key being pressed, then the LCD back-light is switched off. In
+ * // this case, the timer is a one-shot timer, and unlike the example given for
+ * // the xTimerReset() function, the key press event handler is an interrupt
+ * // service routine.
+ *
+ * // The callback function assigned to the one-shot timer. In this case the
+ * // parameter is not used.
+ * void vBacklightTimerCallback( TimerHandle_t pxTimer )
+ * {
+ * // The timer expired, therefore 5 seconds must have passed since a key
+ * // was pressed. Switch off the LCD back-light.
+ * vSetBacklightState( BACKLIGHT_OFF );
+ * }
+ *
+ * // The key press interrupt service routine.
+ * void vKeyPressEventInterruptHandler( void )
+ * {
+ * BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ *
+ * // Ensure the LCD back-light is on, then reset the timer that is
+ * // responsible for turning the back-light off after 5 seconds of
+ * // key inactivity. This is an interrupt service routine so can only
+ * // call FreeRTOS API functions that end in "FromISR".
+ * vSetBacklightState( BACKLIGHT_ON );
+ *
+ * // xTimerStartFromISR() or xTimerResetFromISR() could be called here
+ * // as both cause the timer to re-calculate its expiry time.
+ * // xHigherPriorityTaskWoken was initialised to pdFALSE when it was
+ * // declared (in this function).
+ * if( xTimerResetFromISR( xBacklightTimer, &xHigherPriorityTaskWoken ) != pdPASS )
+ * {
+ * // The reset command was not executed successfully. Take appropriate
+ * // action here.
+ * }
+ *
+ * // Perform the rest of the key processing here.
+ *
+ * // If xHigherPriorityTaskWoken equals pdTRUE, then a context switch
+ * // should be performed. The syntax required to perform a context switch
+ * // from inside an ISR varies from port to port, and from compiler to
+ * // compiler. Inspect the demos for the port you are using to find the
+ * // actual syntax required.
+ * if( xHigherPriorityTaskWoken != pdFALSE )
+ * {
+ * // Call the interrupt safe yield function here (actual function
+ * // depends on the FreeRTOS port being used).
+ * }
+ * }
+ * @endverbatim
+ */
+#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) \
+ xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
+
+
+/**
+ * BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
+ * void *pvParameter1,
+ * uint32_t ulParameter2,
+ * BaseType_t *pxHigherPriorityTaskWoken );
+ *
+ *
+ * Used from application interrupt service routines to defer the execution of a
+ * function to the RTOS daemon task (the timer service task, hence this function
+ * is implemented in timers.c and is prefixed with 'Timer').
+ *
+ * Ideally an interrupt service routine (ISR) is kept as short as possible, but
+ * sometimes an ISR either has a lot of processing to do, or needs to perform
+ * processing that is not deterministic. In these cases
+ * xTimerPendFunctionCallFromISR() can be used to defer processing of a function
+ * to the RTOS daemon task.
+ *
+ * A mechanism is provided that allows the interrupt to return directly to the
+ * task that will subsequently execute the pended callback function. This
+ * allows the callback function to execute contiguously in time with the
+ * interrupt - just as if the callback had executed in the interrupt itself.
+ *
+ * @param xFunctionToPend The function to execute from the timer service/
+ * daemon task. The function must conform to the PendedFunction_t
+ * prototype.
+ *
+ * @param pvParameter1 The value of the callback function's first parameter.
+ * The parameter has a void * type to allow it to be used to pass any type.
+ * For example, unsigned longs can be cast to a void *, or the void * can be
+ * used to point to a structure.
+ *
+ * @param ulParameter2 The value of the callback function's second parameter.
+ *
+ * @param pxHigherPriorityTaskWoken As mentioned above, calling this function
+ * will result in a message being sent to the timer daemon task. If the
+ * priority of the timer daemon task (which is set using
+ * configTIMER_TASK_PRIORITY in FreeRTOSConfig.h) is higher than the priority of
+ * the currently running task (the task the interrupt interrupted) then
+ * *pxHigherPriorityTaskWoken will be set to pdTRUE within
+ * xTimerPendFunctionCallFromISR(), indicating that a context switch should be
+ * requested before the interrupt exits. For that reason
+ * *pxHigherPriorityTaskWoken must be initialised to pdFALSE. See the
+ * example code below.
+ *
+ * @return pdPASS is returned if the message was successfully sent to the
+ * timer daemon task, otherwise pdFALSE is returned.
+ *
+ * Example usage:
+ * @verbatim
+ *
+ * // The callback function that will execute in the context of the daemon task.
+ * // Note callback functions must all use this same prototype.
+ * void vProcessInterface( void *pvParameter1, uint32_t ulParameter2 )
+ * {
+ * BaseType_t xInterfaceToService;
+ *
+ * // The interface that requires servicing is passed in the second
+ * // parameter. The first parameter is not used in this case.
+ * xInterfaceToService = ( BaseType_t ) ulParameter2;
+ *
+ * // ...Perform the processing here...
+ * }
+ *
+ * // An ISR that receives data packets from multiple interfaces
+ * void vAnISR( void )
+ * {
+ * BaseType_t xInterfaceToService, xHigherPriorityTaskWoken;
+ *
+ * // Query the hardware to determine which interface needs processing.
+ * xInterfaceToService = prvCheckInterfaces();
+ *
+ * // The actual processing is to be deferred to a task. Request the
+ * // vProcessInterface() callback function is executed, passing in the
+ * // number of the interface that needs processing. The interface to
+ * // service is passed in the second parameter. The first parameter is
+ * // not used in this case.
+ * xHigherPriorityTaskWoken = pdFALSE;
+ * xTimerPendFunctionCallFromISR( vProcessInterface, NULL, ( uint32_t ) xInterfaceToService, &xHigherPriorityTaskWoken );
+ *
+ * // If xHigherPriorityTaskWoken is now set to pdTRUE then a context
+ * // switch should be requested. The macro used is port specific and will
+ * // be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to
+ * // the documentation page for the port being used.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+ *
+ * }
+ * @endverbatim
+ */
+BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
+ void * pvParameter1,
+ uint32_t ulParameter2,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+
+/**
+ * BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
+ * void *pvParameter1,
+ * uint32_t ulParameter2,
+ * TickType_t xTicksToWait );
+ *
+ *
+ * Used to defer the execution of a function to the RTOS daemon task (the timer
+ * service task, hence this function is implemented in timers.c and is prefixed
+ * with 'Timer').
+ *
+ * @param xFunctionToPend The function to execute from the timer service/
+ * daemon task. The function must conform to the PendedFunction_t
+ * prototype.
+ *
+ * @param pvParameter1 The value of the callback function's first parameter.
+ * The parameter has a void * type to allow it to be used to pass any type.
+ * For example, unsigned longs can be cast to a void *, or the void * can be
+ * used to point to a structure.
+ *
+ * @param ulParameter2 The value of the callback function's second parameter.
+ *
+ * @param xTicksToWait Calling this function will result in a message being
+ * sent to the timer daemon task on a queue. xTicksToWait is the amount of
+ * time the calling task should remain in the Blocked state (so not using any
+ * processing time) for space to become available on the timer queue if the
+ * queue is found to be full.
+ *
+ * @return pdPASS is returned if the message was successfully sent to the
+ * timer daemon task, otherwise pdFALSE is returned.
+ *
+ */
+BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
+ void * pvParameter1,
+ uint32_t ulParameter2,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * const char * const pcTimerGetName( TimerHandle_t xTimer );
+ *
+ * Returns the name that was assigned to a timer when the timer was created.
+ *
+ * @param xTimer The handle of the timer being queried.
+ *
+ * @return The name assigned to the timer specified by the xTimer parameter.
+ */
+const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+
+/**
+ * void vTimerSetReloadMode( TimerHandle_t xTimer, const BaseType_t xAutoReload );
+ *
+ * Updates a timer to be either an auto-reload timer, in which case the timer
+ * automatically resets itself each time it expires, or a one-shot timer, in
+ * which case the timer will only expire once unless it is manually restarted.
+ *
+ * @param xTimer The handle of the timer being updated.
+ *
+ * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
+ * expire repeatedly with a frequency set by the timer's period (see the
+ * xTimerPeriodInTicks parameter of the xTimerCreate() API function). If
+ * xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
+ * enter the dormant state after it expires.
+ */
+void vTimerSetReloadMode( TimerHandle_t xTimer,
+ const BaseType_t xAutoReload ) PRIVILEGED_FUNCTION;
+
+/**
+ * BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer );
+ *
+ * Queries a timer to determine if it is an auto-reload timer, in which case the timer
+ * automatically resets itself each time it expires, or a one-shot timer, in
+ * which case the timer will only expire once unless it is manually restarted.
+ *
+ * @param xTimer The handle of the timer being queried.
+ *
+ * @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
+ * pdFALSE is returned.
+ */
+BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/**
+ * UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );
+ *
+ * Queries a timer to determine if it is an auto-reload timer, in which case the timer
+ * automatically resets itself each time it expires, or a one-shot timer, in
+ * which case the timer will only expire once unless it is manually restarted.
+ *
+ * @param xTimer The handle of the timer being queried.
+ *
+ * @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
+ * pdFALSE is returned.
+ */
+UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/**
+ * TickType_t xTimerGetPeriod( TimerHandle_t xTimer );
+ *
+ * Returns the period of a timer.
+ *
+ * @param xTimer The handle of the timer being queried.
+ *
+ * @return The period of the timer in ticks.
+ */
+TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/**
+ * TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer );
+ *
+ * Returns the time in ticks at which the timer will expire. If this is less
+ * than the current tick count then the expiry time has overflowed from the
+ * current time.
+ *
+ * @param xTimer The handle of the timer being queried.
+ *
+ * @return If the timer is running then the time in ticks at which the timer
+ * will next expire is returned. If the timer is not running then the return
+ * value is undefined.
+ */
+TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+
+/*
+ * Functions beyond this part are not part of the public API and are intended
+ * for use by the kernel only.
+ */
+BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
+BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+ void vTimerSetTimerNumber( TimerHandle_t xTimer,
+ UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
+ UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+#endif
+
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )
+ * @endcode
+ *
+ * This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
+ * configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
+ *
+ * @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
+ * @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
+ * @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
+ */
+ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
+ StackType_t ** ppxTimerTaskStackBuffer,
+ uint32_t * pulTimerTaskStackSize );
+
+#endif
+
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+#endif /* TIMERS_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/list.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/list.c
new file mode 100644
index 0000000..afcae87
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/list.c
@@ -0,0 +1,226 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
+ * all the API functions to use the MPU wrappers. That should only be done when
+ * task.h is included from an application file. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+#include "FreeRTOS.h"
+#include "list.h"
+
+/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
+ * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
+ * defined for the header files above, but not in this file, in order to
+ * generate the correct privileged Vs unprivileged linkage and placement. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
+
+/*-----------------------------------------------------------
+* PUBLIC LIST API documented in list.h
+*----------------------------------------------------------*/
+
+void vListInitialise( List_t * const pxList )
+{
+ /* The list structure contains a list item which is used to mark the
+ * end of the list. To initialise the list the list end is inserted
+ * as the only list entry. */
+ pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+
+ listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
+
+ /* The list end value is the highest possible value in the list to
+ * ensure it remains at the end of the list. */
+ pxList->xListEnd.xItemValue = portMAX_DELAY;
+
+ /* The list end next and previous pointers point to itself so we know
+ * when the list is empty. */
+ pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+ pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+
+ /* Initialize the remaining fields of xListEnd when it is a proper ListItem_t */
+ #if ( configUSE_MINI_LIST_ITEM == 0 )
+ {
+ pxList->xListEnd.pvOwner = NULL;
+ pxList->xListEnd.pxContainer = NULL;
+ listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
+ }
+ #endif
+
+ pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
+
+ /* Write known values into the list if
+ * configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
+ listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
+}
+/*-----------------------------------------------------------*/
+
+void vListInitialiseItem( ListItem_t * const pxItem )
+{
+ /* Make sure the list item is not recorded as being on a list. */
+ pxItem->pxContainer = NULL;
+
+ /* Write known values into the list item if
+ * configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
+ listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
+}
+/*-----------------------------------------------------------*/
+
+void vListInsertEnd( List_t * const pxList,
+ ListItem_t * const pxNewListItem )
+{
+ ListItem_t * const pxIndex = pxList->pxIndex;
+
+ /* Only effective when configASSERT() is also defined, these tests may catch
+ * the list data structures being overwritten in memory. They will not catch
+ * data errors caused by incorrect configuration or use of FreeRTOS. */
+ listTEST_LIST_INTEGRITY( pxList );
+ listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
+
+ /* Insert a new list item into pxList, but rather than sort the list,
+ * makes the new list item the last item to be removed by a call to
+ * listGET_OWNER_OF_NEXT_ENTRY(). */
+ pxNewListItem->pxNext = pxIndex;
+ pxNewListItem->pxPrevious = pxIndex->pxPrevious;
+
+ /* Only used during decision coverage testing. */
+ mtCOVERAGE_TEST_DELAY();
+
+ pxIndex->pxPrevious->pxNext = pxNewListItem;
+ pxIndex->pxPrevious = pxNewListItem;
+
+ /* Remember which list the item is in. */
+ pxNewListItem->pxContainer = pxList;
+
+ ( pxList->uxNumberOfItems )++;
+}
+/*-----------------------------------------------------------*/
+
+void vListInsert( List_t * const pxList,
+ ListItem_t * const pxNewListItem )
+{
+ ListItem_t * pxIterator;
+ const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
+
+ /* Only effective when configASSERT() is also defined, these tests may catch
+ * the list data structures being overwritten in memory. They will not catch
+ * data errors caused by incorrect configuration or use of FreeRTOS. */
+ listTEST_LIST_INTEGRITY( pxList );
+ listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
+
+ /* Insert the new list item into the list, sorted in xItemValue order.
+ *
+ * If the list already contains a list item with the same item value then the
+ * new list item should be placed after it. This ensures that TCBs which are
+ * stored in ready lists (all of which have the same xItemValue value) get a
+ * share of the CPU. However, if the xItemValue is the same as the back marker
+ * the iteration loop below will not end. Therefore the value is checked
+ * first, and the algorithm slightly modified if necessary. */
+ if( xValueOfInsertion == portMAX_DELAY )
+ {
+ pxIterator = pxList->xListEnd.pxPrevious;
+ }
+ else
+ {
+ /* *** NOTE ***********************************************************
+ * If you find your application is crashing here then likely causes are
+ * listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for
+ * more tips, and ensure configASSERT() is defined!
+ * https://www.FreeRTOS.org/a00110.html#configASSERT
+ *
+ * 1) Stack overflow -
+ * see https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
+ * 2) Incorrect interrupt priority assignment, especially on Cortex-M
+ * parts where numerically high priority values denote low actual
+ * interrupt priorities, which can seem counter intuitive. See
+ * https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html and the definition
+ * of configMAX_SYSCALL_INTERRUPT_PRIORITY on
+ * https://www.FreeRTOS.org/a00110.html
+ * 3) Calling an API function from within a critical section or when
+ * the scheduler is suspended, or calling an API function that does
+ * not end in "FromISR" from an interrupt.
+ * 4) Using a queue or semaphore before it has been initialised or
+ * before the scheduler has been started (are interrupts firing
+ * before vTaskStartScheduler() has been called?).
+ * 5) If the FreeRTOS port supports interrupt nesting then ensure that
+ * the priority of the tick interrupt is at or below
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ **********************************************************************/
+
+ for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
+ {
+ /* There is nothing to do here, just iterating to the wanted
+ * insertion position. */
+ }
+ }
+
+ pxNewListItem->pxNext = pxIterator->pxNext;
+ pxNewListItem->pxNext->pxPrevious = pxNewListItem;
+ pxNewListItem->pxPrevious = pxIterator;
+ pxIterator->pxNext = pxNewListItem;
+
+ /* Remember which list the item is in. This allows fast removal of the
+ * item later. */
+ pxNewListItem->pxContainer = pxList;
+
+ ( pxList->uxNumberOfItems )++;
+}
+/*-----------------------------------------------------------*/
+
+UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
+{
+/* The list item knows which list it is in. Obtain the list from the list
+ * item. */
+ List_t * const pxList = pxItemToRemove->pxContainer;
+
+ pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
+ pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
+
+ /* Only used during decision coverage testing. */
+ mtCOVERAGE_TEST_DELAY();
+
+ /* Make sure the index is left pointing to a valid item. */
+ if( pxList->pxIndex == pxItemToRemove )
+ {
+ pxList->pxIndex = pxItemToRemove->pxPrevious;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ pxItemToRemove->pxContainer = NULL;
+ ( pxList->uxNumberOfItems )--;
+
+ return pxList->uxNumberOfItems;
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifest.yml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifest.yml
new file mode 100644
index 0000000..211e3c2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifest.yml
@@ -0,0 +1,4 @@
+name : "FreeRTOS-Kernel"
+version: "v10.5.1"
+description: "FreeRTOS Kernel."
+license: "MIT"
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_10.xml
new file mode 100644
index 0000000..ea0cd8d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_13.xml
new file mode 100644
index 0000000..d5fa39c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_14.xml
new file mode 100644
index 0000000..08ea480
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2A41A_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_10.xml
new file mode 100644
index 0000000..f9cb434
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_13.xml
new file mode 100644
index 0000000..1804d91
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_14.xml
new file mode 100644
index 0000000..d7b5c02
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L2B31A_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_10.xml
new file mode 100644
index 0000000..c656fc3
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_10.xml
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_13.xml
new file mode 100644
index 0000000..3a67b7e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_13.xml
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_14.xml
new file mode 100644
index 0000000..c860050
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_K32L3A60_manifest_v3_14.xml
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_10.xml
new file mode 100644
index 0000000..2a4f392
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_13.xml
new file mode 100644
index 0000000..2106dac
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_14.xml
new file mode 100644
index 0000000..8d92321
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC51U68_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_10.xml
new file mode 100644
index 0000000..847dd7a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_13.xml
new file mode 100644
index 0000000..243a2a5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_14.xml
new file mode 100644
index 0000000..c3946fb
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54628_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_10.xml
new file mode 100644
index 0000000..70b371b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_10.xml
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_13.xml
new file mode 100644
index 0000000..0fe1804
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_14.xml
new file mode 100644
index 0000000..c8279d3
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018M_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_10.xml
new file mode 100644
index 0000000..609588b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_13.xml
new file mode 100644
index 0000000..0c42df1
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_14.xml
new file mode 100644
index 0000000..7009c74
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC54S018_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC5506CPXXXX_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC5506CPXXXX_manifest_v3_10.xml
new file mode 100644
index 0000000..60a5443
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC5506CPXXXX_manifest_v3_10.xml
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_10.xml
new file mode 100644
index 0000000..e33f802
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_10.xml
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_13.xml
new file mode 100644
index 0000000..d9ca25e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_13.xml
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_14.xml
new file mode 100644
index 0000000..e3cd0d3
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S06_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_10.xml
new file mode 100644
index 0000000..b7ed0b6
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_10.xml
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_13.xml
new file mode 100644
index 0000000..fb33022
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_13.xml
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_14.xml
new file mode 100644
index 0000000..4766aa5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S16_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_10.xml
new file mode 100644
index 0000000..0675049
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_10.xml
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_13.xml
new file mode 100644
index 0000000..036c7ba
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_13.xml
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_14.xml
new file mode 100644
index 0000000..ea0a157
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S28_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S36_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S36_manifest_v3_14.xml
new file mode 100644
index 0000000..e1ff1a3
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S36_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_10.xml
new file mode 100644
index 0000000..db7b594
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_10.xml
@@ -0,0 +1,349 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_13.xml
new file mode 100644
index 0000000..4e8a4ae
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_13.xml
@@ -0,0 +1,330 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_14.xml
new file mode 100644
index 0000000..99d2dbf
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC55S69_manifest_v3_14.xml
@@ -0,0 +1,368 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC865_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC865_manifest_v3_14.xml
new file mode 100644
index 0000000..27f070f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_LPC865_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_10.xml
new file mode 100644
index 0000000..76b93da
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_13.xml
new file mode 100644
index 0000000..38aa0ad
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_14.xml
new file mode 100644
index 0000000..c3fa5c9
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MCIMX7U5_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_10.xml
new file mode 100644
index 0000000..f9d79cb
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_13.xml
new file mode 100644
index 0000000..f9075e9
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_14.xml
new file mode 100644
index 0000000..2f48982
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8ML8_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_10.xml
new file mode 100644
index 0000000..e5bed2c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_13.xml
new file mode 100644
index 0000000..63f63a1
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_14.xml
new file mode 100644
index 0000000..8116421
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MM6_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_10.xml
new file mode 100644
index 0000000..64bf54e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_13.xml
new file mode 100644
index 0000000..baf7f41
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_14.xml
new file mode 100644
index 0000000..6a72904
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MN6_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_10.xml
new file mode 100644
index 0000000..aad2604
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_13.xml
new file mode 100644
index 0000000..d2df358
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_14.xml
new file mode 100644
index 0000000..f816b02
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8MQ6_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD5_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD5_manifest_v3_14.xml
new file mode 100644
index 0000000..494957b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD5_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD7_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD7_manifest_v3_14.xml
new file mode 100644
index 0000000..b14e84e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMX8UD7_manifest_v3_14.xml
@@ -0,0 +1,349 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_10.xml
new file mode 100644
index 0000000..9172754
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_13.xml
new file mode 100644
index 0000000..ad86507
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_14.xml
new file mode 100644
index 0000000..d4ac99e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1011_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_10.xml
new file mode 100644
index 0000000..8e544e0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_13.xml
new file mode 100644
index 0000000..4a518d9
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_14.xml
new file mode 100644
index 0000000..e590e43
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1015_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_10.xml
new file mode 100644
index 0000000..ddc88d2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_13.xml
new file mode 100644
index 0000000..3119de5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_14.xml
new file mode 100644
index 0000000..2c43bca
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1021_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_10.xml
new file mode 100644
index 0000000..475e697
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_13.xml
new file mode 100644
index 0000000..ff3f368
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_14.xml
new file mode 100644
index 0000000..1f89732
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1024_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_10.xml
new file mode 100644
index 0000000..e1317f5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_13.xml
new file mode 100644
index 0000000..c556d66
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_14.xml
new file mode 100644
index 0000000..5b11cc7
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1042_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_10.xml
new file mode 100644
index 0000000..c503c03
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_13.xml
new file mode 100644
index 0000000..d714106
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_14.xml
new file mode 100644
index 0000000..0e117cc
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1052_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_10.xml
new file mode 100644
index 0000000..f9b5b9c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_13.xml
new file mode 100644
index 0000000..b3f2748
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_14.xml
new file mode 100644
index 0000000..25ff2ef
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1062_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_10.xml
new file mode 100644
index 0000000..97f608a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_13.xml
new file mode 100644
index 0000000..b1cb4ca
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_14.xml
new file mode 100644
index 0000000..bac77fb
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1064_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_10.xml
new file mode 100644
index 0000000..5e39443
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_10.xml
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_13.xml
new file mode 100644
index 0000000..f6d5b75
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_13.xml
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_14.xml
new file mode 100644
index 0000000..37978bd
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1166_manifest_v3_14.xml
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_10.xml
new file mode 100644
index 0000000..3d6309c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_10.xml
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_13.xml
new file mode 100644
index 0000000..5883d89
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_13.xml
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_14.xml
new file mode 100644
index 0000000..b9952ce
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT1176_manifest_v3_14.xml
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_10.xml
new file mode 100644
index 0000000..98a7591
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_10.xml
@@ -0,0 +1,339 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_13.xml
new file mode 100644
index 0000000..a1a396d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_13.xml
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_14.xml
new file mode 100644
index 0000000..b0c800c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT595S_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_10.xml
new file mode 100644
index 0000000..941a2cc
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_10.xml
@@ -0,0 +1,339 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_13.xml
new file mode 100644
index 0000000..a6c5036
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_13.xml
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_14.xml
new file mode 100644
index 0000000..810379a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MIMXRT685S_manifest_v3_14.xml
@@ -0,0 +1,355 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_10.xml
new file mode 100644
index 0000000..151f50f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_10.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_13.xml
new file mode 100644
index 0000000..8b21b67
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_14.xml
new file mode 100644
index 0000000..83a532f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MK22F51212_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_10.xml
new file mode 100644
index 0000000..14ab1a9
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_13.xml
new file mode 100644
index 0000000..979dcec
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_14.xml
new file mode 100644
index 0000000..0a929fb
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE15Z7_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_10.xml
new file mode 100644
index 0000000..fc69e0a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_10.xml
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_13.xml
new file mode 100644
index 0000000..0a63de1
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_14.xml
new file mode 100644
index 0000000..b7d1d7f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE16Z4_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_10.xml
new file mode 100644
index 0000000..0354606
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_13.xml
new file mode 100644
index 0000000..f2a4998
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_14.xml
new file mode 100644
index 0000000..30a319d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKE17Z7_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_10.xml
new file mode 100644
index 0000000..607f404
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_13.xml
new file mode 100644
index 0000000..6d4206e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_14.xml
new file mode 100644
index 0000000..ea8e99e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34Z7_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_10.xml
new file mode 100644
index 0000000..6f386a4
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_13.xml
new file mode 100644
index 0000000..dac58b5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_13.xml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_14.xml
new file mode 100644
index 0000000..cc7076b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM34ZA5_manifest_v3_14.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_10.xml
new file mode 100644
index 0000000..3b0dfea
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_13.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_13.xml
new file mode 100644
index 0000000..911344d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_13.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_14.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_14.xml
new file mode 100644
index 0000000..a0b5d78
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKM35Z7_manifest_v3_14.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV11Z7_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV11Z7_manifest_v3_10.xml
new file mode 100644
index 0000000..ed8fe8d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV11Z7_manifest_v3_10.xml
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV31F51212_manifest_v3_10.xml b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV31F51212_manifest_v3_10.xml
new file mode 100644
index 0000000..5088d40
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/manifests/middleware_amazon_freertos_kernel_MKV31F51212_manifest_v3_10.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2A41A.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2A41A.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2A41A.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2B31A.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2B31A.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L2B31A.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm0plus.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm0plus.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm0plus.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm4.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_K32L3A60_cm4.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC51U68.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC51U68.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC51U68.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm0plus.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm0plus.cmake
new file mode 100644
index 0000000..f1e0912
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm0plus.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm4.cmake
new file mode 100644
index 0000000..f425363
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54114_cm4.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54628.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54628.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54628.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018M.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018M.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC54S018M.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT595S_cm33.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC5506CPXXXX.cmake
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT595S_cm33.cmake
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC5506CPXXXX.cmake
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S06.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S06.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S06.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S16.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S16.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S16.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S28.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S28.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S28.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S36.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S36.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S36.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core0.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core0.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core0.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core1.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core1.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_LPC55S69_cm33_core1.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MCIMX7U5.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MCIMX7U5.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MCIMX7U5.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8ML8.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8ML8.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8ML8.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MM6.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MM6.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MM6.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MN6.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MN6.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MN6.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MQ6.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MQ6.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8MQ6.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core0.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core0.cmake
new file mode 100644
index 0000000..f425363
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core0.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core1.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core1.cmake
new file mode 100644
index 0000000..f425363
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QM6_cm4_core1.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QX6.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QX6.cmake
new file mode 100644
index 0000000..f425363
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMX8QX6.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1011.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1011.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1011.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1015.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1015.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1015.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1021.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1021.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1021.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1024.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1024.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1024.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1042.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1042.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1042.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1052.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1052.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1052.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1062.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1062.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1062.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1064.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1064.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1064.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm4.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm4.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm7.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1166_cm7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake
similarity index 75%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake
index 2c75bed..0815f49 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm4.cmake
@@ -1,4 +1,5 @@
-include_guard()
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
message("middleware_freertos-kernel component is included.")
target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
@@ -12,12 +13,10 @@ target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/timers.c
)
-
-target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
)
-include(middleware_freertos-kernel_extension_MIMXRT1176_cm4)
-
+include(middleware_freertos-kernel_extension)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake
similarity index 75%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake
index 6f4e42f..0815f49 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT1176_cm7.cmake
@@ -1,4 +1,5 @@
-include_guard()
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
message("middleware_freertos-kernel component is included.")
target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
@@ -12,12 +13,10 @@ target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/timers.c
)
-
-target_include_directories(${MCUX_SDK_PROJECT_NAME} PRIVATE
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
)
-include(middleware_freertos-kernel_extension_MIMXRT1176_cm7)
-
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT595S_cm33.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT595S_cm33.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT595S_cm33.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT685S_cm33.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT685S_cm33.cmake
new file mode 100644
index 0000000..862b36f
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MIMXRT685S_cm33.cmake
@@ -0,0 +1,20 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK22F51212.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK22F51212.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK22F51212.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK28FA15.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK28FA15.cmake
new file mode 100644
index 0000000..f425363
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK28FA15.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK64F12.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK64F12.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK64F12.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK66F18.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK66F18.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MK66F18.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE15Z7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE15Z7.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE15Z7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE16Z4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE16Z4.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE16Z4.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE17Z7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE17Z7.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKE17Z7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKL27Z644.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKL27Z644.cmake
new file mode 100644
index 0000000..f1e0912
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKL27Z644.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34Z7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34Z7.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34Z7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34ZA5.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34ZA5.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM34ZA5.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM35Z7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM35Z7.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKM35Z7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV11Z7.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV11Z7.cmake
new file mode 100644
index 0000000..e09376a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV11Z7.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM0
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV31F51212.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV31F51212.cmake
new file mode 100644
index 0000000..0815f49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_MKV31F51212.cmake
@@ -0,0 +1,22 @@
+#Description: FreeRTOS kernel; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/croutine.c
+ ${CMAKE_CURRENT_LIST_DIR}/event_groups.c
+ ${CMAKE_CURRENT_LIST_DIR}/list.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/queue.c
+ ${CMAKE_CURRENT_LIST_DIR}/stream_buffer.c
+ ${CMAKE_CURRENT_LIST_DIR}/tasks.c
+ ${CMAKE_CURRENT_LIST_DIR}/timers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/include
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM4F
+)
+
+
+include(middleware_freertos-kernel_extension)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake
similarity index 93%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake
index 0ab475f..3d2f659 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_nonsecure_port.cmake
@@ -12,9 +12,6 @@ target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
)
#OR Logic component
-if(${MCUX_DEVICE} STREQUAL "LPC55S36")
- include(middleware_freertos-kernel_LPC55S36)
-endif()
if(${MCUX_DEVICE} STREQUAL "LPC5506CPXXXX")
include(middleware_freertos-kernel_LPC5506CPXXXX)
endif()
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_secure_port.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_secure_port.cmake
new file mode 100644
index 0000000..89bd736
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_cm33_secure_port.cmake
@@ -0,0 +1,16 @@
+#Description: FreeRTOS cm33 secure port; user_visible: False
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_cm33_secure_port component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/non_secure/port.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/non_secure/portasm.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/non_secure
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure
+)
+
+
+include(middleware_freertos-kernel_mpu_wrappers)
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_extension.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_extension.cmake
similarity index 100%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/amazon-freertos/freertos_kernel/middleware_freertos-kernel_extension.cmake
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_extension.cmake
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_1.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_1.cmake
new file mode 100644
index 0000000..9d00d65
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_1.cmake
@@ -0,0 +1,28 @@
+#Description: FreeRTOS heap 1; user_visible: False
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_heap_1 component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/MemMang/heap_1.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+)
+
+#OR Logic component
+if(${MCUX_DEVICE} STREQUAL "MK22F12810")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK22F51212")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK02F12810")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK22F25612")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK64F12")
+ include(middleware_freertos-kernel_MK64F12)
+endif()
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_3.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_3.cmake
new file mode 100644
index 0000000..184c547
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_3.cmake
@@ -0,0 +1,166 @@
+#Description: FreeRTOS heap_3; user_visible: False
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_heap_3 component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/MemMang/heap_3.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+)
+
+#OR Logic component
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm4")
+ include(middleware_freertos-kernel_MIMXRT1166_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm7")
+ include(middleware_freertos-kernel_MIMXRT1166_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1052")
+ include(middleware_freertos-kernel_MIMXRT1052)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT633S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1064")
+ include(middleware_freertos-kernel_MIMXRT1064)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54607")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S016")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54606")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54616")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE16Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54016")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54018")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54628")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1173_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1173_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54605")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1051")
+ include(middleware_freertos-kernel_MIMXRT1052)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54618")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1021")
+ include(middleware_freertos-kernel_MIMXRT1021)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT555S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54018M")
+ include(middleware_freertos-kernel_LPC54S018M)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1062")
+ include(middleware_freertos-kernel_MIMXRT1062)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S018")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE15Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1042")
+ include(middleware_freertos-kernel_MIMXRT1042)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1175_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1175_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S018M")
+ include(middleware_freertos-kernel_LPC54S018M)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1061")
+ include(middleware_freertos-kernel_MIMXRT1062)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1165_cm4")
+ include(middleware_freertos-kernel_MIMXRT1166_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1165_cm7")
+ include(middleware_freertos-kernel_MIMXRT1166_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S005")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1171_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1024")
+ include(middleware_freertos-kernel_MIMXRT1024)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54005")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE14Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT533S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54608")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT685S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT595S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1172_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK64F12")
+ include(middleware_freertos-kernel_MK64F12)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK66F18")
+ include(middleware_freertos-kernel_MK66F18)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm0plus")
+ include(middleware_freertos-kernel_K32L3A60_cm0plus)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm4")
+ include(middleware_freertos-kernel_K32L3A60_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54114_cm0plus")
+ include(middleware_freertos-kernel_LPC54114_cm0plus)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54114_cm4")
+ include(middleware_freertos-kernel_LPC54114_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core0")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core1")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core1)
+endif()
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_4.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_4.cmake
new file mode 100644
index 0000000..c82cdd4
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_heap_4.cmake
@@ -0,0 +1,391 @@
+#Description: FreeRTOS heap 4; user_visible: False
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_heap_4 component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/MemMang/heap_4.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+)
+
+#OR Logic component
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm4")
+ include(middleware_freertos-kernel_MIMXRT1166_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1166_cm7")
+ include(middleware_freertos-kernel_MIMXRT1166_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5506CPXXXX")
+ include(middleware_freertos-kernel_LPC5506CPXXXX)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1052")
+ include(middleware_freertos-kernel_MIMXRT1052)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK22F12810")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV10Z1287")
+ include(middleware_freertos-kernel_MKV11Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT633S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1064")
+ include(middleware_freertos-kernel_MIMXRT1064)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5526")
+ include(middleware_freertos-kernel_LPC55S28)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5504CPXXXX")
+ include(middleware_freertos-kernel_LPC5506CPXXXX)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54607")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S016")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54606")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54616")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN5")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN4")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MQ6")
+ include(middleware_freertos-kernel_MIMX8MQ6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM6")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE15Z7")
+ include(middleware_freertos-kernel_MKE15Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S04")
+ include(middleware_freertos-kernel_LPC55S06)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM1")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L2B31A")
+ include(middleware_freertos-kernel_K32L2B31A)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE16Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S06")
+ include(middleware_freertos-kernel_LPC55S06)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKM14ZA5")
+ include(middleware_freertos-kernel_MKM34ZA5)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54016")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV11Z7")
+ include(middleware_freertos-kernel_MKV11Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54018")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV31F51212")
+ include(middleware_freertos-kernel_MKV31F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE12Z7")
+ include(middleware_freertos-kernel_MKE17Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54628")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5502CPXXXX")
+ include(middleware_freertos-kernel_LPC5506CPXXXX)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM5")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5512")
+ include(middleware_freertos-kernel_LPC55S16)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK22F51212")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM2")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8ML3")
+ include(middleware_freertos-kernel_MIMX8ML8)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1173_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1173_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5516")
+ include(middleware_freertos-kernel_LPC55S16)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKM34ZA5")
+ include(middleware_freertos-kernel_MKM34ZA5)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54605")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1051")
+ include(middleware_freertos-kernel_MIMXRT1052)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54618")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE13Z7")
+ include(middleware_freertos-kernel_MKE17Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE14Z7")
+ include(middleware_freertos-kernel_MKE15Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1021")
+ include(middleware_freertos-kernel_MIMXRT1021)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV10Z7")
+ include(middleware_freertos-kernel_MKV11Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM3")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT555S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54018M")
+ include(middleware_freertos-kernel_LPC54S018M)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5506")
+ include(middleware_freertos-kernel_LPC55S06)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5514")
+ include(middleware_freertos-kernel_LPC55S16)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S16")
+ include(middleware_freertos-kernel_LPC55S16)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L2B11A")
+ include(middleware_freertos-kernel_K32L2B31A)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK02F12810")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MQ7")
+ include(middleware_freertos-kernel_MIMX8MQ6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1062")
+ include(middleware_freertos-kernel_MIMXRT1062)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN6")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8ML6")
+ include(middleware_freertos-kernel_MIMX8ML8)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S018")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE15Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm0plus")
+ include(middleware_freertos-kernel_K32L3A60_cm0plus)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L3A60_cm4")
+ include(middleware_freertos-kernel_K32L3A60_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1042")
+ include(middleware_freertos-kernel_MIMXRT1042)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1176_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1175_cm4")
+ include(middleware_freertos-kernel_MIMXRT1176_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1175_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S018M")
+ include(middleware_freertos-kernel_LPC54S018M)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK22F25612")
+ include(middleware_freertos-kernel_MK22F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKM35Z7")
+ include(middleware_freertos-kernel_MKM35Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L2B21A")
+ include(middleware_freertos-kernel_K32L2B31A)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC51U68")
+ include(middleware_freertos-kernel_LPC51U68)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1061")
+ include(middleware_freertos-kernel_MIMXRT1062)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN2")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5528")
+ include(middleware_freertos-kernel_LPC55S28)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1165_cm4")
+ include(middleware_freertos-kernel_MIMXRT1166_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1165_cm7")
+ include(middleware_freertos-kernel_MIMXRT1166_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S66_cm33_core0")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S66_cm33_core1")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core1)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8ML4")
+ include(middleware_freertos-kernel_MIMX8ML8)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKM34Z7")
+ include(middleware_freertos-kernel_MKM34Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV31F12810")
+ include(middleware_freertos-kernel_MKV31F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MD6")
+ include(middleware_freertos-kernel_MIMX8MQ6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54S005")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE17Z7")
+ include(middleware_freertos-kernel_MKE17Z7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1171_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core0")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core1")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core1)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L2A31A")
+ include(middleware_freertos-kernel_K32L2A41A)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MCIMX7U5")
+ include(middleware_freertos-kernel_MCIMX7U5)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1024")
+ include(middleware_freertos-kernel_MIMXRT1024)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKM33ZA5")
+ include(middleware_freertos-kernel_MKM34ZA5)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1011")
+ include(middleware_freertos-kernel_MIMXRT1011)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54005")
+ include(middleware_freertos-kernel_LPC54S018)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MM4")
+ include(middleware_freertos-kernel_MIMX8MM6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S28")
+ include(middleware_freertos-kernel_LPC55S28)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKE14Z4")
+ include(middleware_freertos-kernel_MKE16Z4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN1")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT533S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8ML8")
+ include(middleware_freertos-kernel_MIMX8ML8)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S14")
+ include(middleware_freertos-kernel_LPC55S16)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV31F25612")
+ include(middleware_freertos-kernel_MKV31F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKV30F12810")
+ include(middleware_freertos-kernel_MKV31F51212)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S26")
+ include(middleware_freertos-kernel_LPC55S28)
+endif()
+if(${MCUX_DEVICE} STREQUAL "K32L2A41A")
+ include(middleware_freertos-kernel_K32L2A41A)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5504")
+ include(middleware_freertos-kernel_LPC55S06)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MN3")
+ include(middleware_freertos-kernel_MIMX8MN6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54608")
+ include(middleware_freertos-kernel_LPC54628)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MD7")
+ include(middleware_freertos-kernel_MIMX8MQ6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT685S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT595S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8MQ5")
+ include(middleware_freertos-kernel_MIMX8MQ6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC5502")
+ include(middleware_freertos-kernel_LPC55S06)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1172_cm7")
+ include(middleware_freertos-kernel_MIMXRT1176_cm7)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MCIMX7U3")
+ include(middleware_freertos-kernel_MCIMX7U5)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT1015")
+ include(middleware_freertos-kernel_MIMXRT1015)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK64F12")
+ include(middleware_freertos-kernel_MK64F12)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK66F18")
+ include(middleware_freertos-kernel_MK66F18)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC54114_cm4")
+ include(middleware_freertos-kernel_LPC54114_cm4)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8QM6_cm4_core0")
+ include(middleware_freertos-kernel_MIMX8QM6_cm4_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8QM6_cm4_core1")
+ include(middleware_freertos-kernel_MIMX8QM6_cm4_core1)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMX8QX6")
+ include(middleware_freertos-kernel_MIMX8QX6)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MK28FA15")
+ include(middleware_freertos-kernel_MK28FA15)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MKL27Z644")
+ include(middleware_freertos-kernel_MKL27Z644)
+endif()
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_mpu_wrappers.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_mpu_wrappers.cmake
new file mode 100644
index 0000000..fb061c2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_mpu_wrappers.cmake
@@ -0,0 +1,34 @@
+#Description: FreeRTOS MPU wrappers; user_visible: False
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_mpu_wrappers component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/Common/mpu_wrappers.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+)
+
+#OR Logic component
+if(${MCUX_DEVICE} STREQUAL "MIMXRT633S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT555S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S66_cm33_core0")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "LPC55S69_cm33_core0")
+ include(middleware_freertos-kernel_LPC55S69_cm33_core0)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT533S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT685S_cm33")
+ include(middleware_freertos-kernel_MIMXRT685S_cm33)
+endif()
+if(${MCUX_DEVICE} STREQUAL "MIMXRT595S_cm33")
+ include(middleware_freertos-kernel_MIMXRT595S_cm33)
+endif()
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_secure_context.cmake b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_secure_context.cmake
new file mode 100644
index 0000000..dd77e6c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/middleware_freertos-kernel_secure_context.cmake
@@ -0,0 +1,17 @@
+#Description: FreeRTOS Secure Context; user_visible: True
+include_guard(GLOBAL)
+message("middleware_freertos-kernel_secure_context component is included.")
+
+target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure/secure_context.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure/secure_context_port.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure/secure_heap.c
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure/secure_init.c
+)
+
+target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/non_secure
+ ${CMAKE_CURRENT_LIST_DIR}/portable/GCC/ARM_CM33/secure
+)
+
+
diff --git a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/portable/ARMClang/Use-the-GCC-ports.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMClang/Use-the-GCC-ports.txt
similarity index 99%
rename from nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/portable/ARMClang/Use-the-GCC-ports.txt
rename to bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMClang/Use-the-GCC-ports.txt
index d2c3a86..4a23ecd 100644
--- a/nxpvee-mimxrt595-evk-round-bsp/sdk_overlay/rtos/freertos/freertos_kernel/portable/ARMClang/Use-the-GCC-ports.txt
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMClang/Use-the-GCC-ports.txt
@@ -1,2 +1,2 @@
-The FreeRTOS GCC port layer also builds and works with the ARMClang compiler.
+The FreeRTOS GCC port layer also builds and works with the ARMClang compiler.
To use the ARMClang compiler build the port files from FreeRTOS/Source/portable/GCC.
\ No newline at end of file
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/ReadMe.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/ReadMe.txt
new file mode 100644
index 0000000..c0db145
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/ReadMe.txt
@@ -0,0 +1,11 @@
+This directory tree contains the master copy of the FreeeRTOS Armv8-M and
+Armv8.1-M ports.
+Do not use the files located here! These file are copied into separate
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to each
+FreeRTOS release.
+
+If your Armv8-M and Armv8.1-M application uses TrustZone then use the files from the
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
+
+If your Armv8-M and Armv8.1-M application does not use TrustZone then use the files from
+the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/copy_files.py b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/copy_files.py
new file mode 100644
index 0000000..5cf9e62
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/copy_files.py
@@ -0,0 +1,152 @@
+#/*
+# * FreeRTOS Kernel V10.5.1
+# * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+# *
+# * SPDX-License-Identifier: MIT
+# *
+# * Permission is hereby granted, free of charge, to any person obtaining a copy of
+# * this software and associated documentation files (the "Software"), to deal in
+# * the Software without restriction, including without limitation the rights to
+# * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+# * the Software, and to permit persons to whom the Software is furnished to do so,
+# * subject to the following conditions:
+# *
+# * The above copyright notice and this permission notice shall be included in all
+# * copies or substantial portions of the Software.
+# *
+# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+# * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+# * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+# *
+# * https://www.FreeRTOS.org
+# * https://github.com/FreeRTOS
+# *
+# */
+
+import os
+import shutil
+
+_THIS_FILE_DIRECTORY_ = os.path.dirname(os.path.realpath(__file__))
+_FREERTOS_PORTABLE_DIRECTORY_ = os.path.dirname(_THIS_FILE_DIRECTORY_)
+
+_COMPILERS_ = ['GCC', 'IAR']
+_ARCH_NS_ = ['ARM_CM85', 'ARM_CM85_NTZ', 'ARM_CM55', 'ARM_CM55_NTZ', 'ARM_CM33', 'ARM_CM33_NTZ', 'ARM_CM23', 'ARM_CM23_NTZ']
+_ARCH_S_ = ['ARM_CM85', 'ARM_CM55', 'ARM_CM33', 'ARM_CM23']
+
+# Files to be compiled in the Secure Project
+_SECURE_COMMON_FILE_PATHS_ = [
+ os.path.join('secure', 'context'),
+ os.path.join('secure', 'heap'),
+ os.path.join('secure', 'init'),
+ os.path.join('secure', 'macros')
+]
+
+_SECURE_PORTABLE_FILE_PATHS_ = {
+ 'GCC':{
+ 'ARM_CM23':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM23')],
+ 'ARM_CM33':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
+ 'ARM_CM55':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
+ 'ARM_CM85':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')]
+ },
+ 'IAR':{
+ 'ARM_CM23':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM23')],
+ 'ARM_CM33':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
+ 'ARM_CM55':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
+ 'ARM_CM85':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')]
+ }
+}
+
+# Files to be compiled in the Non-Secure Project
+_NONSECURE_COMMON_FILE_PATHS_ = [
+ 'non_secure'
+]
+
+_NONSECURE_PORTABLE_FILE_PATHS_ = {
+ 'GCC':{
+ 'ARM_CM23' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM23')],
+ 'ARM_CM23_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM23_NTZ')],
+ 'ARM_CM33' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33')],
+ 'ARM_CM33_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ')],
+ 'ARM_CM55' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'portasm.c'),
+ os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM55', 'portmacro.h')],
+ 'ARM_CM55_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
+ os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM55', 'portmacro.h')],
+ 'ARM_CM85' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'portasm.c'),
+ os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM85', 'portmacro.h')],
+ 'ARM_CM85_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
+ os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM85', 'portmacro.h')]
+ },
+ 'IAR':{
+ 'ARM_CM23' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM23')],
+ 'ARM_CM23_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM23_NTZ')],
+ 'ARM_CM33' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33')],
+ 'ARM_CM33_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ')],
+ 'ARM_CM55' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'portasm.s'),
+ os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM55', 'portmacro.h')],
+ 'ARM_CM55_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
+ os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM55', 'portmacro.h')],
+ 'ARM_CM85' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'portasm.s'),
+ os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM85', 'portmacro.h')],
+ 'ARM_CM85_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
+ os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM85', 'portmacro.h')]
+ },
+}
+
+
+def copy_files_in_dir(src_abs_path, dst_abs_path):
+ if os.path.isfile(src_abs_path):
+ print('Src: {}'.format(src_abs_path))
+ print('Dst: {}\n'.format(dst_abs_path))
+ shutil.copy2(src_abs_path, dst_abs_path)
+ else:
+ for src_file in os.listdir(src_abs_path):
+ src_file_abs_path = os.path.join(src_abs_path, src_file)
+ if os.path.isfile(src_file_abs_path) and src_file != 'ReadMe.txt':
+ if not os.path.exists(dst_abs_path):
+ os.makedirs(dst_abs_path)
+ print('Src: {}'.format(src_file_abs_path))
+ print('Dst: {}\n'.format(dst_abs_path))
+ shutil.copy2(src_file_abs_path, dst_abs_path)
+
+
+def copy_common_files_for_compiler_and_arch(compiler, arch, src_paths, dst_path):
+ for src_path in src_paths:
+
+ src_abs_path = os.path.join(_THIS_FILE_DIRECTORY_, src_path)
+ dst_abs_path = os.path.join(_FREERTOS_PORTABLE_DIRECTORY_, compiler, arch, dst_path)
+
+ copy_files_in_dir(src_abs_path, dst_abs_path)
+
+
+def copy_portable_files_for_compiler_and_arch(compiler, arch, src_paths, dst_path):
+ for src_path in src_paths[compiler][arch]:
+
+ src_abs_path = os.path.join(_THIS_FILE_DIRECTORY_, src_path)
+ dst_abs_path = os.path.join(_FREERTOS_PORTABLE_DIRECTORY_, compiler, arch, dst_path)
+
+ copy_files_in_dir(src_abs_path, dst_abs_path)
+
+
+def copy_files():
+ # Copy Secure Files
+ for compiler in _COMPILERS_:
+ for arch in _ARCH_S_:
+ copy_common_files_for_compiler_and_arch(compiler, arch, _SECURE_COMMON_FILE_PATHS_, 'secure')
+ copy_portable_files_for_compiler_and_arch(compiler, arch, _SECURE_PORTABLE_FILE_PATHS_, 'secure')
+
+ # Copy Non-Secure Files
+ for compiler in _COMPILERS_:
+ for arch in _ARCH_NS_:
+ copy_common_files_for_compiler_and_arch(compiler, arch, _NONSECURE_COMMON_FILE_PATHS_, 'non_secure')
+ copy_portable_files_for_compiler_and_arch(compiler, arch, _NONSECURE_PORTABLE_FILE_PATHS_, 'non_secure')
+
+
+def main():
+ copy_files()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/ReadMe.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/ReadMe.txt
new file mode 100644
index 0000000..68ff904
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/ReadMe.txt
@@ -0,0 +1,11 @@
+This directory tree contains the master copy of the FreeRTOS Armv8-M and
+Armv8.1-M ports.
+Do not use the files located here! These file are copied into separate
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to
+each FreeRTOS release.
+
+If your Armv8-M/Armv8.1-M application uses TrustZone then use the files from the
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
+
+If your Armv8-M/Armv8.1-M application does not use TrustZone then use the files from
+the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/port.c
new file mode 100644
index 0000000..349aeff
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/port.c
@@ -0,0 +1,1261 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
+ * all the API functions to use the MPU wrappers. That should only be done when
+ * task.h is included from an application file. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+/* MPU wrappers includes. */
+#include "mpu_wrappers.h"
+
+/* Portasm includes. */
+#include "portasm.h"
+
+#if ( configENABLE_TRUSTZONE == 1 )
+ /* Secure components includes. */
+ #include "secure_context.h"
+ #include "secure_init.h"
+#endif /* configENABLE_TRUSTZONE */
+
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/**
+ * The FreeRTOS Cortex M33 port can be configured to run on the Secure Side only
+ * i.e. the processor boots as secure and never jumps to the non-secure side.
+ * The Trust Zone support in the port must be disabled in order to run FreeRTOS
+ * on the secure side. The following are the valid configuration seetings:
+ *
+ * 1. Run FreeRTOS on the Secure Side:
+ * configRUN_FREERTOS_SECURE_ONLY = 1 and configENABLE_TRUSTZONE = 0
+ *
+ * 2. Run FreeRTOS on the Non-Secure Side with Secure Side function call support:
+ * configRUN_FREERTOS_SECURE_ONLY = 0 and configENABLE_TRUSTZONE = 1
+ *
+ * 3. Run FreeRTOS on the Non-Secure Side only i.e. no Secure Side function call support:
+ * configRUN_FREERTOS_SECURE_ONLY = 0 and configENABLE_TRUSTZONE = 0
+ */
+#if ( ( configRUN_FREERTOS_SECURE_ONLY == 1 ) && ( configENABLE_TRUSTZONE == 1 ) )
+ #error TrustZone needs to be disabled in order to run FreeRTOS on the Secure Side.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Constants required to manipulate the NVIC.
+ */
+#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
+#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
+#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
+#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
+#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
+#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
+#define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL )
+#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
+#define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL )
+#define portNVIC_PEND_SYSTICK_SET_BIT ( 1UL << 26UL )
+#define portMIN_INTERRUPT_PRIORITY ( 255UL )
+#define portNVIC_PENDSV_PRI ( portMIN_INTERRUPT_PRIORITY << 16UL )
+#define portNVIC_SYSTICK_PRI ( portMIN_INTERRUPT_PRIORITY << 24UL )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Constants required to manipulate the SCB.
+ */
+#define portSCB_SYS_HANDLER_CTRL_STATE_REG ( *( volatile uint32_t * ) 0xe000ed24 )
+#define portSCB_MEM_FAULT_ENABLE_BIT ( 1UL << 16UL )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Constants required to manipulate the FPU.
+ */
+#define portCPACR ( ( volatile uint32_t * ) 0xe000ed88 ) /* Coprocessor Access Control Register. */
+#define portCPACR_CP10_VALUE ( 3UL )
+#define portCPACR_CP11_VALUE portCPACR_CP10_VALUE
+#define portCPACR_CP10_POS ( 20UL )
+#define portCPACR_CP11_POS ( 22UL )
+
+#define portFPCCR ( ( volatile uint32_t * ) 0xe000ef34 ) /* Floating Point Context Control Register. */
+#define portFPCCR_ASPEN_POS ( 31UL )
+#define portFPCCR_ASPEN_MASK ( 1UL << portFPCCR_ASPEN_POS )
+#define portFPCCR_LSPEN_POS ( 30UL )
+#define portFPCCR_LSPEN_MASK ( 1UL << portFPCCR_LSPEN_POS )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Constants required to manipulate the MPU.
+ */
+#define portMPU_TYPE_REG ( *( ( volatile uint32_t * ) 0xe000ed90 ) )
+#define portMPU_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed94 ) )
+#define portMPU_RNR_REG ( *( ( volatile uint32_t * ) 0xe000ed98 ) )
+
+#define portMPU_RBAR_REG ( *( ( volatile uint32_t * ) 0xe000ed9c ) )
+#define portMPU_RLAR_REG ( *( ( volatile uint32_t * ) 0xe000eda0 ) )
+
+#define portMPU_RBAR_A1_REG ( *( ( volatile uint32_t * ) 0xe000eda4 ) )
+#define portMPU_RLAR_A1_REG ( *( ( volatile uint32_t * ) 0xe000eda8 ) )
+
+#define portMPU_RBAR_A2_REG ( *( ( volatile uint32_t * ) 0xe000edac ) )
+#define portMPU_RLAR_A2_REG ( *( ( volatile uint32_t * ) 0xe000edb0 ) )
+
+#define portMPU_RBAR_A3_REG ( *( ( volatile uint32_t * ) 0xe000edb4 ) )
+#define portMPU_RLAR_A3_REG ( *( ( volatile uint32_t * ) 0xe000edb8 ) )
+
+#define portMPU_MAIR0_REG ( *( ( volatile uint32_t * ) 0xe000edc0 ) )
+#define portMPU_MAIR1_REG ( *( ( volatile uint32_t * ) 0xe000edc4 ) )
+
+#define portMPU_RBAR_ADDRESS_MASK ( 0xffffffe0 ) /* Must be 32-byte aligned. */
+#define portMPU_RLAR_ADDRESS_MASK ( 0xffffffe0 ) /* Must be 32-byte aligned. */
+
+#define portMPU_MAIR_ATTR0_POS ( 0UL )
+#define portMPU_MAIR_ATTR0_MASK ( 0x000000ff )
+
+#define portMPU_MAIR_ATTR1_POS ( 8UL )
+#define portMPU_MAIR_ATTR1_MASK ( 0x0000ff00 )
+
+#define portMPU_MAIR_ATTR2_POS ( 16UL )
+#define portMPU_MAIR_ATTR2_MASK ( 0x00ff0000 )
+
+#define portMPU_MAIR_ATTR3_POS ( 24UL )
+#define portMPU_MAIR_ATTR3_MASK ( 0xff000000 )
+
+#define portMPU_MAIR_ATTR4_POS ( 0UL )
+#define portMPU_MAIR_ATTR4_MASK ( 0x000000ff )
+
+#define portMPU_MAIR_ATTR5_POS ( 8UL )
+#define portMPU_MAIR_ATTR5_MASK ( 0x0000ff00 )
+
+#define portMPU_MAIR_ATTR6_POS ( 16UL )
+#define portMPU_MAIR_ATTR6_MASK ( 0x00ff0000 )
+
+#define portMPU_MAIR_ATTR7_POS ( 24UL )
+#define portMPU_MAIR_ATTR7_MASK ( 0xff000000 )
+
+#define portMPU_RLAR_ATTR_INDEX0 ( 0UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX1 ( 1UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX2 ( 2UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX3 ( 3UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX4 ( 4UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX5 ( 5UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX6 ( 6UL << 1UL )
+#define portMPU_RLAR_ATTR_INDEX7 ( 7UL << 1UL )
+
+#define portMPU_RLAR_REGION_ENABLE ( 1UL )
+
+/* Enable privileged access to unmapped region. */
+#define portMPU_PRIV_BACKGROUND_ENABLE_BIT ( 1UL << 2UL )
+
+/* Enable MPU. */
+#define portMPU_ENABLE_BIT ( 1UL << 0UL )
+
+/* Expected value of the portMPU_TYPE register. */
+#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief The maximum 24-bit number.
+ *
+ * It is needed because the systick is a 24-bit counter.
+ */
+#define portMAX_24_BIT_NUMBER ( 0xffffffUL )
+
+/**
+ * @brief A fiddle factor to estimate the number of SysTick counts that would
+ * have occurred while the SysTick counter is stopped during tickless idle
+ * calculations.
+ */
+#define portMISSED_COUNTS_FACTOR ( 94UL )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Constants required to set up the initial stack.
+ */
+#define portINITIAL_XPSR ( 0x01000000 )
+
+#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
+
+/**
+ * @brief Initial EXC_RETURN value.
+ *
+ * FF FF FF FD
+ * 1111 1111 1111 1111 1111 1111 1111 1101
+ *
+ * Bit[6] - 1 --> The exception was taken from the Secure state.
+ * Bit[5] - 1 --> Do not skip stacking of additional state context.
+ * Bit[4] - 1 --> The PE did not allocate space on the stack for FP context.
+ * Bit[3] - 1 --> Return to the Thread mode.
+ * Bit[2] - 1 --> Restore registers from the process stack.
+ * Bit[1] - 0 --> Reserved, 0.
+ * Bit[0] - 1 --> The exception was taken to the Secure state.
+ */
+ #define portINITIAL_EXC_RETURN ( 0xfffffffd )
+#else
+
+/**
+ * @brief Initial EXC_RETURN value.
+ *
+ * FF FF FF BC
+ * 1111 1111 1111 1111 1111 1111 1011 1100
+ *
+ * Bit[6] - 0 --> The exception was taken from the Non-Secure state.
+ * Bit[5] - 1 --> Do not skip stacking of additional state context.
+ * Bit[4] - 1 --> The PE did not allocate space on the stack for FP context.
+ * Bit[3] - 1 --> Return to the Thread mode.
+ * Bit[2] - 1 --> Restore registers from the process stack.
+ * Bit[1] - 0 --> Reserved, 0.
+ * Bit[0] - 0 --> The exception was taken to the Non-Secure state.
+ */
+ #define portINITIAL_EXC_RETURN ( 0xffffffbc )
+#endif /* configRUN_FREERTOS_SECURE_ONLY */
+
+/**
+ * @brief CONTROL register privileged bit mask.
+ *
+ * Bit[0] in CONTROL register tells the privilege:
+ * Bit[0] = 0 ==> The task is privileged.
+ * Bit[0] = 1 ==> The task is not privileged.
+ */
+#define portCONTROL_PRIVILEGED_MASK ( 1UL << 0UL )
+
+/**
+ * @brief Initial CONTROL register values.
+ */
+#define portINITIAL_CONTROL_UNPRIVILEGED ( 0x3 )
+#define portINITIAL_CONTROL_PRIVILEGED ( 0x2 )
+
+/**
+ * @brief Let the user override the default SysTick clock rate. If defined by the
+ * user, this symbol must equal the SysTick clock rate when the CLK bit is 0 in the
+ * configuration register.
+ */
+#ifndef configSYSTICK_CLOCK_HZ
+ #define configSYSTICK_CLOCK_HZ ( configCPU_CLOCK_HZ )
+ /* Ensure the SysTick is clocked at the same frequency as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT_CONFIG ( portNVIC_SYSTICK_CLK_BIT )
+#else
+ /* Select the option to clock SysTick not at the same frequency as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT_CONFIG ( 0 )
+#endif
+
+/**
+ * @brief Let the user override the pre-loading of the initial LR with the
+ * address of prvTaskExitError() in case it messes up unwinding of the stack
+ * in the debugger.
+ */
+#ifdef configTASK_RETURN_ADDRESS
+ #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
+#else
+ #define portTASK_RETURN_ADDRESS prvTaskExitError
+#endif
+
+/**
+ * @brief If portPRELOAD_REGISTERS then registers will be given an initial value
+ * when a task is created. This helps in debugging at the cost of code size.
+ */
+#define portPRELOAD_REGISTERS 1
+
+/**
+ * @brief A task is created without a secure context, and must call
+ * portALLOCATE_SECURE_CONTEXT() to give itself a secure context before it makes
+ * any secure calls.
+ */
+#define portNO_SECURE_CONTEXT 0
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Used to catch tasks that attempt to return from their implementing
+ * function.
+ */
+static void prvTaskExitError( void );
+
+#if ( configENABLE_MPU == 1 )
+
+/**
+ * @brief Setup the Memory Protection Unit (MPU).
+ */
+ static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_FPU == 1 )
+
+/**
+ * @brief Setup the Floating Point Unit (FPU).
+ */
+ static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
+#endif /* configENABLE_FPU */
+
+/**
+ * @brief Setup the timer to generate the tick interrupts.
+ *
+ * The implementation in this file is weak to allow application writers to
+ * change the timer used to generate the tick interrupt.
+ */
+void vPortSetupTimerInterrupt( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Checks whether the current execution context is interrupt.
+ *
+ * @return pdTRUE if the current execution context is interrupt, pdFALSE
+ * otherwise.
+ */
+BaseType_t xPortIsInsideInterrupt( void );
+
+/**
+ * @brief Yield the processor.
+ */
+void vPortYield( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Enter critical section.
+ */
+void vPortEnterCritical( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Exit from critical section.
+ */
+void vPortExitCritical( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief SysTick handler.
+ */
+void SysTick_Handler( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief C part of SVC handler.
+ */
+portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIVILEGED_FUNCTION;
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Each task maintains its own interrupt status in the critical nesting
+ * variable.
+ */
+PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
+
+#if ( configENABLE_TRUSTZONE == 1 )
+
+/**
+ * @brief Saved as part of the task context to indicate which context the
+ * task is using on the secure side.
+ */
+ PRIVILEGED_DATA portDONT_DISCARD volatile SecureContextHandle_t xSecureContext = portNO_SECURE_CONTEXT;
+#endif /* configENABLE_TRUSTZONE */
+
+#if ( configUSE_TICKLESS_IDLE == 1 )
+
+/**
+ * @brief The number of SysTick increments that make up one tick period.
+ */
+ PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
+
+/**
+ * @brief The maximum number of tick periods that can be suppressed is
+ * limited by the 24 bit resolution of the SysTick timer.
+ */
+ PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
+
+/**
+ * @brief Compensate for the CPU cycles that pass while the SysTick is
+ * stopped (low power functionality only).
+ */
+ PRIVILEGED_DATA static uint32_t ulStoppedTimerCompensation = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ __attribute__( ( weak ) ) void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
+ {
+ uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements, ulSysTickDecrementsLeft;
+ TickType_t xModifiableIdleTime;
+
+ /* Make sure the SysTick reload value does not overflow the counter. */
+ if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
+ {
+ xExpectedIdleTime = xMaximumPossibleSuppressedTicks;
+ }
+
+ /* Enter a critical section but don't use the taskENTER_CRITICAL()
+ * method as that will mask interrupts that should exit sleep mode. */
+ __asm volatile ( "cpsid i" ::: "memory" );
+ __asm volatile ( "dsb" );
+ __asm volatile ( "isb" );
+
+ /* If a context switch is pending or a task is waiting for the scheduler
+ * to be unsuspended then abandon the low power entry. */
+ if( eTaskConfirmSleepModeStatus() == eAbortSleep )
+ {
+ /* Re-enable interrupts - see comments above the cpsid instruction
+ * above. */
+ __asm volatile ( "cpsie i" ::: "memory" );
+ }
+ else
+ {
+ /* Stop the SysTick momentarily. The time the SysTick is stopped for
+ * is accounted for as best it can be, but using the tickless mode will
+ * inevitably result in some tiny drift of the time maintained by the
+ * kernel with respect to calendar time. */
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT_CONFIG | portNVIC_SYSTICK_INT_BIT );
+
+ /* Use the SysTick current-value register to determine the number of
+ * SysTick decrements remaining until the next tick interrupt. If the
+ * current-value register is zero, then there are actually
+ * ulTimerCountsForOneTick decrements remaining, not zero, because the
+ * SysTick requests the interrupt when decrementing from 1 to 0. */
+ ulSysTickDecrementsLeft = portNVIC_SYSTICK_CURRENT_VALUE_REG;
+
+ if( ulSysTickDecrementsLeft == 0 )
+ {
+ ulSysTickDecrementsLeft = ulTimerCountsForOneTick;
+ }
+
+ /* Calculate the reload value required to wait xExpectedIdleTime
+ * tick periods. -1 is used because this code normally executes part
+ * way through the first tick period. But if the SysTick IRQ is now
+ * pending, then clear the IRQ, suppressing the first tick, and correct
+ * the reload value to reflect that the second tick period is already
+ * underway. The expected idle time is always at least two ticks. */
+ ulReloadValue = ulSysTickDecrementsLeft + ( ulTimerCountsForOneTick * ( xExpectedIdleTime - 1UL ) );
+
+ if( ( portNVIC_INT_CTRL_REG & portNVIC_PEND_SYSTICK_SET_BIT ) != 0 )
+ {
+ portNVIC_INT_CTRL_REG = portNVIC_PEND_SYSTICK_CLEAR_BIT;
+ ulReloadValue -= ulTimerCountsForOneTick;
+ }
+
+ if( ulReloadValue > ulStoppedTimerCompensation )
+ {
+ ulReloadValue -= ulStoppedTimerCompensation;
+ }
+
+ /* Set the new reload value. */
+ portNVIC_SYSTICK_LOAD_REG = ulReloadValue;
+
+ /* Clear the SysTick count flag and set the count value back to
+ * zero. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Restart SysTick. */
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Sleep until something happens. configPRE_SLEEP_PROCESSING() can
+ * set its parameter to 0 to indicate that its implementation contains
+ * its own wait for interrupt or wait for event instruction, and so wfi
+ * should not be executed again. However, the original expected idle
+ * time variable must remain unmodified, so a copy is taken. */
+ xModifiableIdleTime = xExpectedIdleTime;
+ configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
+
+ if( xModifiableIdleTime > 0 )
+ {
+ __asm volatile ( "dsb" ::: "memory" );
+ __asm volatile ( "wfi" );
+ __asm volatile ( "isb" );
+ }
+
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );
+
+ /* Re-enable interrupts to allow the interrupt that brought the MCU
+ * out of sleep mode to execute immediately. See comments above
+ * the cpsid instruction above. */
+ __asm volatile ( "cpsie i" ::: "memory" );
+ __asm volatile ( "dsb" );
+ __asm volatile ( "isb" );
+
+ /* Disable interrupts again because the clock is about to be stopped
+ * and interrupts that execute while the clock is stopped will increase
+ * any slippage between the time maintained by the RTOS and calendar
+ * time. */
+ __asm volatile ( "cpsid i" ::: "memory" );
+ __asm volatile ( "dsb" );
+ __asm volatile ( "isb" );
+
+ /* Disable the SysTick clock without reading the
+ * portNVIC_SYSTICK_CTRL_REG register to ensure the
+ * portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,
+ * the time the SysTick is stopped for is accounted for as best it can
+ * be, but using the tickless mode will inevitably result in some tiny
+ * drift of the time maintained by the kernel with respect to calendar
+ * time*/
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT_CONFIG | portNVIC_SYSTICK_INT_BIT );
+
+ /* Determine whether the SysTick has already counted to zero. */
+ if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )
+ {
+ uint32_t ulCalculatedLoadValue;
+
+ /* The tick interrupt ended the sleep (or is now pending), and
+ * a new tick period has started. Reset portNVIC_SYSTICK_LOAD_REG
+ * with whatever remains of the new tick period. */
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );
+
+ /* Don't allow a tiny value, or values that have somehow
+ * underflowed because the post sleep hook did something
+ * that took too long or because the SysTick current-value register
+ * is zero. */
+ if( ( ulCalculatedLoadValue <= ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )
+ {
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );
+ }
+
+ portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;
+
+ /* As the pending tick will be processed as soon as this
+ * function exits, the tick value maintained by the tick is stepped
+ * forward by one less than the time spent waiting. */
+ ulCompleteTickPeriods = xExpectedIdleTime - 1UL;
+ }
+ else
+ {
+ /* Something other than the tick interrupt ended the sleep. */
+
+ /* Use the SysTick current-value register to determine the
+ * number of SysTick decrements remaining until the expected idle
+ * time would have ended. */
+ ulSysTickDecrementsLeft = portNVIC_SYSTICK_CURRENT_VALUE_REG;
+ #if ( portNVIC_SYSTICK_CLK_BIT_CONFIG != portNVIC_SYSTICK_CLK_BIT )
+ {
+ /* If the SysTick is not using the core clock, the current-
+ * value register might still be zero here. In that case, the
+ * SysTick didn't load from the reload register, and there are
+ * ulReloadValue decrements remaining in the expected idle
+ * time, not zero. */
+ if( ulSysTickDecrementsLeft == 0 )
+ {
+ ulSysTickDecrementsLeft = ulReloadValue;
+ }
+ }
+ #endif /* portNVIC_SYSTICK_CLK_BIT_CONFIG */
+
+ /* Work out how long the sleep lasted rounded to complete tick
+ * periods (not the ulReload value which accounted for part
+ * ticks). */
+ ulCompletedSysTickDecrements = ( xExpectedIdleTime * ulTimerCountsForOneTick ) - ulSysTickDecrementsLeft;
+
+ /* How many complete tick periods passed while the processor
+ * was waiting? */
+ ulCompleteTickPeriods = ulCompletedSysTickDecrements / ulTimerCountsForOneTick;
+
+ /* The reload value is set to whatever fraction of a single tick
+ * period remains. */
+ portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;
+ }
+
+ /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG again,
+ * then set portNVIC_SYSTICK_LOAD_REG back to its standard value. If
+ * the SysTick is not using the core clock, temporarily configure it to
+ * use the core clock. This configuration forces the SysTick to load
+ * from portNVIC_SYSTICK_LOAD_REG immediately instead of at the next
+ * cycle of the other clock. Then portNVIC_SYSTICK_LOAD_REG is ready
+ * to receive the standard value immediately. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
+ #if ( portNVIC_SYSTICK_CLK_BIT_CONFIG == portNVIC_SYSTICK_CLK_BIT )
+ {
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+ }
+ #else
+ {
+ /* The temporary usage of the core clock has served its purpose,
+ * as described above. Resume usage of the other clock. */
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT;
+
+ if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )
+ {
+ /* The partial tick period already ended. Be sure the SysTick
+ * counts it only once. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0;
+ }
+
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
+ }
+ #endif /* portNVIC_SYSTICK_CLK_BIT_CONFIG */
+
+ /* Step the tick to account for any tick periods that elapsed. */
+ vTaskStepTick( ulCompleteTickPeriods );
+
+ /* Exit with interrupts enabled. */
+ __asm volatile ( "cpsie i" ::: "memory" );
+ }
+ }
+#endif /* configUSE_TICKLESS_IDLE */
+/*-----------------------------------------------------------*/
+
+__attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FUNCTION */
+{
+ /* Calculate the constants required to configure the tick interrupt. */
+ #if ( configUSE_TICKLESS_IDLE == 1 )
+ {
+ ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );
+ xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;
+ ulStoppedTimerCompensation = portMISSED_COUNTS_FACTOR / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );
+ }
+ #endif /* configUSE_TICKLESS_IDLE */
+
+ /* Stop and reset the SysTick. */
+ portNVIC_SYSTICK_CTRL_REG = 0UL;
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Configure SysTick to interrupt at the requested rate. */
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
+}
+/*-----------------------------------------------------------*/
+
+static void prvTaskExitError( void )
+{
+ volatile uint32_t ulDummy = 0UL;
+
+ /* A function that implements a task must not exit or attempt to return to
+ * its caller as there is nothing to return to. If a task wants to exit it
+ * should instead call vTaskDelete( NULL ). Artificially force an assert()
+ * to be triggered if configASSERT() is defined, then stop here so
+ * application writers can catch the error. */
+ configASSERT( ulCriticalNesting == ~0UL );
+ portDISABLE_INTERRUPTS();
+
+ while( ulDummy == 0 )
+ {
+ /* This file calls prvTaskExitError() after the scheduler has been
+ * started to remove a compiler warning about the function being
+ * defined but never called. ulDummy is used purely to quieten other
+ * warnings about code appearing after this function is called - making
+ * ulDummy volatile makes the compiler think the function could return
+ * and therefore not output an 'unreachable code' warning for code that
+ * appears after it. */
+ }
+}
+/*-----------------------------------------------------------*/
+
+#if ( configENABLE_MPU == 1 )
+ static void prvSetupMPU( void ) /* PRIVILEGED_FUNCTION */
+ {
+ #if defined( __ARMCC_VERSION )
+
+ /* Declaration when these variable are defined in code instead of being
+ * exported from linker scripts. */
+ extern uint32_t * __privileged_functions_start__;
+ extern uint32_t * __privileged_functions_end__;
+ extern uint32_t * __syscalls_flash_start__;
+ extern uint32_t * __syscalls_flash_end__;
+ extern uint32_t * __unprivileged_flash_start__;
+ extern uint32_t * __unprivileged_flash_end__;
+ extern uint32_t * __privileged_sram_start__;
+ extern uint32_t * __privileged_sram_end__;
+ #else /* if defined( __ARMCC_VERSION ) */
+ /* Declaration when these variable are exported from linker scripts. */
+ extern uint32_t __privileged_functions_start__[];
+ extern uint32_t __privileged_functions_end__[];
+ extern uint32_t __syscalls_flash_start__[];
+ extern uint32_t __syscalls_flash_end__[];
+ extern uint32_t __unprivileged_flash_start__[];
+ extern uint32_t __unprivileged_flash_end__[];
+ extern uint32_t __privileged_sram_start__[];
+ extern uint32_t __privileged_sram_end__[];
+ #endif /* defined( __ARMCC_VERSION ) */
+
+ /* The only permitted number of regions are 8 or 16. */
+ configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
+
+ /* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
+ configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
+
+ /* Check that the MPU is present. */
+ if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
+ {
+ /* MAIR0 - Index 0. */
+ portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
+ /* MAIR0 - Index 1. */
+ portMPU_MAIR0_REG |= ( ( portMPU_DEVICE_MEMORY_nGnRE << portMPU_MAIR_ATTR1_POS ) & portMPU_MAIR_ATTR1_MASK );
+
+ /* Setup privileged flash as Read Only so that privileged tasks can
+ * read it but not modify. */
+ portMPU_RNR_REG = portPRIVILEGED_FLASH_REGION;
+ portMPU_RBAR_REG = ( ( ( uint32_t ) __privileged_functions_start__ ) & portMPU_RBAR_ADDRESS_MASK ) |
+ ( portMPU_REGION_NON_SHAREABLE ) |
+ ( portMPU_REGION_PRIVILEGED_READ_ONLY );
+ portMPU_RLAR_REG = ( ( ( uint32_t ) __privileged_functions_end__ ) & portMPU_RLAR_ADDRESS_MASK ) |
+ ( portMPU_RLAR_ATTR_INDEX0 ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+
+ /* Setup unprivileged flash as Read Only by both privileged and
+ * unprivileged tasks. All tasks can read it but no-one can modify. */
+ portMPU_RNR_REG = portUNPRIVILEGED_FLASH_REGION;
+ portMPU_RBAR_REG = ( ( ( uint32_t ) __unprivileged_flash_start__ ) & portMPU_RBAR_ADDRESS_MASK ) |
+ ( portMPU_REGION_NON_SHAREABLE ) |
+ ( portMPU_REGION_READ_ONLY );
+ portMPU_RLAR_REG = ( ( ( uint32_t ) __unprivileged_flash_end__ ) & portMPU_RLAR_ADDRESS_MASK ) |
+ ( portMPU_RLAR_ATTR_INDEX0 ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+
+ /* Setup unprivileged syscalls flash as Read Only by both privileged
+ * and unprivileged tasks. All tasks can read it but no-one can modify. */
+ portMPU_RNR_REG = portUNPRIVILEGED_SYSCALLS_REGION;
+ portMPU_RBAR_REG = ( ( ( uint32_t ) __syscalls_flash_start__ ) & portMPU_RBAR_ADDRESS_MASK ) |
+ ( portMPU_REGION_NON_SHAREABLE ) |
+ ( portMPU_REGION_READ_ONLY );
+ portMPU_RLAR_REG = ( ( ( uint32_t ) __syscalls_flash_end__ ) & portMPU_RLAR_ADDRESS_MASK ) |
+ ( portMPU_RLAR_ATTR_INDEX0 ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+
+ /* Setup RAM containing kernel data for privileged access only. */
+ portMPU_RNR_REG = portPRIVILEGED_RAM_REGION;
+ portMPU_RBAR_REG = ( ( ( uint32_t ) __privileged_sram_start__ ) & portMPU_RBAR_ADDRESS_MASK ) |
+ ( portMPU_REGION_NON_SHAREABLE ) |
+ ( portMPU_REGION_PRIVILEGED_READ_WRITE ) |
+ ( portMPU_REGION_EXECUTE_NEVER );
+ portMPU_RLAR_REG = ( ( ( uint32_t ) __privileged_sram_end__ ) & portMPU_RLAR_ADDRESS_MASK ) |
+ ( portMPU_RLAR_ATTR_INDEX0 ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+
+ /* Enable mem fault. */
+ portSCB_SYS_HANDLER_CTRL_STATE_REG |= portSCB_MEM_FAULT_ENABLE_BIT;
+
+ /* Enable MPU with privileged background access i.e. unmapped
+ * regions have privileged access. */
+ portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
+ }
+ }
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+#if ( configENABLE_FPU == 1 )
+ static void prvSetupFPU( void ) /* PRIVILEGED_FUNCTION */
+ {
+ #if ( configENABLE_TRUSTZONE == 1 )
+ {
+ /* Enable non-secure access to the FPU. */
+ SecureInit_EnableNSFPUAccess();
+ }
+ #endif /* configENABLE_TRUSTZONE */
+
+ /* CP10 = 11 ==> Full access to FPU i.e. both privileged and
+ * unprivileged code should be able to access FPU. CP11 should be
+ * programmed to the same value as CP10. */
+ *( portCPACR ) |= ( ( portCPACR_CP10_VALUE << portCPACR_CP10_POS ) |
+ ( portCPACR_CP11_VALUE << portCPACR_CP11_POS )
+ );
+
+ /* ASPEN = 1 ==> Hardware should automatically preserve floating point
+ * context on exception entry and restore on exception return.
+ * LSPEN = 1 ==> Enable lazy context save of FP state. */
+ *( portFPCCR ) |= ( portFPCCR_ASPEN_MASK | portFPCCR_LSPEN_MASK );
+ }
+#endif /* configENABLE_FPU */
+/*-----------------------------------------------------------*/
+
+void vPortYield( void ) /* PRIVILEGED_FUNCTION */
+{
+ /* Set a PendSV to request a context switch. */
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
+
+ /* Barriers are normally not required but do ensure the code is
+ * completely within the specified behaviour for the architecture. */
+ __asm volatile ( "dsb" ::: "memory" );
+ __asm volatile ( "isb" );
+}
+/*-----------------------------------------------------------*/
+
+void vPortEnterCritical( void ) /* PRIVILEGED_FUNCTION */
+{
+ portDISABLE_INTERRUPTS();
+ ulCriticalNesting++;
+
+ /* Barriers are normally not required but do ensure the code is
+ * completely within the specified behaviour for the architecture. */
+ __asm volatile ( "dsb" ::: "memory" );
+ __asm volatile ( "isb" );
+}
+/*-----------------------------------------------------------*/
+
+void vPortExitCritical( void ) /* PRIVILEGED_FUNCTION */
+{
+ configASSERT( ulCriticalNesting );
+ ulCriticalNesting--;
+
+ if( ulCriticalNesting == 0 )
+ {
+ portENABLE_INTERRUPTS();
+ }
+}
+/*-----------------------------------------------------------*/
+
+void SysTick_Handler( void ) /* PRIVILEGED_FUNCTION */
+{
+ uint32_t ulPreviousMask;
+
+ ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR();
+ {
+ /* Increment the RTOS tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* Pend a context switch. */
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
+ }
+ }
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask );
+}
+/*-----------------------------------------------------------*/
+
+void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTION portDONT_DISCARD */
+{
+ #if ( configENABLE_MPU == 1 )
+ #if defined( __ARMCC_VERSION )
+
+ /* Declaration when these variable are defined in code instead of being
+ * exported from linker scripts. */
+ extern uint32_t * __syscalls_flash_start__;
+ extern uint32_t * __syscalls_flash_end__;
+ #else
+ /* Declaration when these variable are exported from linker scripts. */
+ extern uint32_t __syscalls_flash_start__[];
+ extern uint32_t __syscalls_flash_end__[];
+ #endif /* defined( __ARMCC_VERSION ) */
+ #endif /* configENABLE_MPU */
+
+ uint32_t ulPC;
+
+ #if ( configENABLE_TRUSTZONE == 1 )
+ uint32_t ulR0, ulR1;
+ extern TaskHandle_t pxCurrentTCB;
+ #if ( configENABLE_MPU == 1 )
+ uint32_t ulControl, ulIsTaskPrivileged;
+ #endif /* configENABLE_MPU */
+ #endif /* configENABLE_TRUSTZONE */
+ uint8_t ucSVCNumber;
+
+ /* Register are stored on the stack in the following order - R0, R1, R2, R3,
+ * R12, LR, PC, xPSR. */
+ ulPC = pulCallerStackAddress[ 6 ];
+ ucSVCNumber = ( ( uint8_t * ) ulPC )[ -2 ];
+
+ switch( ucSVCNumber )
+ {
+ #if ( configENABLE_TRUSTZONE == 1 )
+ case portSVC_ALLOCATE_SECURE_CONTEXT:
+
+ /* R0 contains the stack size passed as parameter to the
+ * vPortAllocateSecureContext function. */
+ ulR0 = pulCallerStackAddress[ 0 ];
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ /* Read the CONTROL register value. */
+ __asm volatile ( "mrs %0, control" : "=r" ( ulControl ) );
+
+ /* The task that raised the SVC is privileged if Bit[0]
+ * in the CONTROL register is 0. */
+ ulIsTaskPrivileged = ( ( ulControl & portCONTROL_PRIVILEGED_MASK ) == 0 );
+
+ /* Allocate and load a context for the secure task. */
+ xSecureContext = SecureContext_AllocateContext( ulR0, ulIsTaskPrivileged, pxCurrentTCB );
+ }
+ #else /* if ( configENABLE_MPU == 1 ) */
+ {
+ /* Allocate and load a context for the secure task. */
+ xSecureContext = SecureContext_AllocateContext( ulR0, pxCurrentTCB );
+ }
+ #endif /* configENABLE_MPU */
+
+ configASSERT( xSecureContext != securecontextINVALID_CONTEXT_ID );
+ SecureContext_LoadContext( xSecureContext, pxCurrentTCB );
+ break;
+
+ case portSVC_FREE_SECURE_CONTEXT:
+
+ /* R0 contains TCB being freed and R1 contains the secure
+ * context handle to be freed. */
+ ulR0 = pulCallerStackAddress[ 0 ];
+ ulR1 = pulCallerStackAddress[ 1 ];
+
+ /* Free the secure context. */
+ SecureContext_FreeContext( ( SecureContextHandle_t ) ulR1, ( void * ) ulR0 );
+ break;
+ #endif /* configENABLE_TRUSTZONE */
+
+ case portSVC_START_SCHEDULER:
+ #if ( configENABLE_TRUSTZONE == 1 )
+ {
+ /* De-prioritize the non-secure exceptions so that the
+ * non-secure pendSV runs at the lowest priority. */
+ SecureInit_DePrioritizeNSExceptions();
+
+ /* Initialize the secure context management system. */
+ SecureContext_Init();
+ }
+ #endif /* configENABLE_TRUSTZONE */
+
+ #if ( configENABLE_FPU == 1 )
+ {
+ /* Setup the Floating Point Unit (FPU). */
+ prvSetupFPU();
+ }
+ #endif /* configENABLE_FPU */
+
+ /* Setup the context of the first task so that the first task starts
+ * executing. */
+ vRestoreContextOfFirstTask();
+ break;
+
+ #if ( configENABLE_MPU == 1 )
+ case portSVC_RAISE_PRIVILEGE:
+
+ /* Only raise the privilege, if the svc was raised from any of
+ * the system calls. */
+ if( ( ulPC >= ( uint32_t ) __syscalls_flash_start__ ) &&
+ ( ulPC <= ( uint32_t ) __syscalls_flash_end__ ) )
+ {
+ vRaisePrivilege();
+ }
+ break;
+ #endif /* configENABLE_MPU */
+
+ default:
+ /* Incorrect SVC call. */
+ configASSERT( pdFALSE );
+ }
+}
+/*-----------------------------------------------------------*/
+/* *INDENT-OFF* */
+#if ( configENABLE_MPU == 1 )
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ StackType_t * pxEndOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters,
+ BaseType_t xRunPrivileged ) /* PRIVILEGED_FUNCTION */
+#else
+ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ StackType_t * pxEndOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters ) /* PRIVILEGED_FUNCTION */
+#endif /* configENABLE_MPU */
+/* *INDENT-ON* */
+{
+ /* Simulate the stack frame as it would be created by a context switch
+ * interrupt. */
+ #if ( portPRELOAD_REGISTERS == 0 )
+ {
+ pxTopOfStack--; /* Offset added to account for the way the MCU uses the stack on entry/exit of interrupts. */
+ *pxTopOfStack = portINITIAL_XPSR; /* xPSR */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pxCode; /* PC */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS; /* LR */
+ pxTopOfStack -= 5; /* R12, R3, R2 and R1. */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
+ pxTopOfStack -= 9; /* R11..R4, EXC_RETURN. */
+ *pxTopOfStack = portINITIAL_EXC_RETURN;
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ pxTopOfStack--;
+
+ if( xRunPrivileged == pdTRUE )
+ {
+ *pxTopOfStack = portINITIAL_CONTROL_PRIVILEGED; /* Slot used to hold this task's CONTROL value. */
+ }
+ else
+ {
+ *pxTopOfStack = portINITIAL_CONTROL_UNPRIVILEGED; /* Slot used to hold this task's CONTROL value. */
+ }
+ }
+ #endif /* configENABLE_MPU */
+
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pxEndOfStack; /* Slot used to hold this task's PSPLIM value. */
+
+ #if ( configENABLE_TRUSTZONE == 1 )
+ {
+ pxTopOfStack--;
+ *pxTopOfStack = portNO_SECURE_CONTEXT; /* Slot used to hold this task's xSecureContext value. */
+ }
+ #endif /* configENABLE_TRUSTZONE */
+ }
+ #else /* portPRELOAD_REGISTERS */
+ {
+ pxTopOfStack--; /* Offset added to account for the way the MCU uses the stack on entry/exit of interrupts. */
+ *pxTopOfStack = portINITIAL_XPSR; /* xPSR */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pxCode; /* PC */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS; /* LR */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x12121212UL; /* R12 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x03030303UL; /* R3 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x02020202UL; /* R2 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x01010101UL; /* R1 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x11111111UL; /* R11 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x10101010UL; /* R10 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x09090909UL; /* R09 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x08080808UL; /* R08 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x07070707UL; /* R07 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x06060606UL; /* R06 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x05050505UL; /* R05 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x04040404UL; /* R04 */
+ pxTopOfStack--;
+ *pxTopOfStack = portINITIAL_EXC_RETURN; /* EXC_RETURN */
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ pxTopOfStack--;
+
+ if( xRunPrivileged == pdTRUE )
+ {
+ *pxTopOfStack = portINITIAL_CONTROL_PRIVILEGED; /* Slot used to hold this task's CONTROL value. */
+ }
+ else
+ {
+ *pxTopOfStack = portINITIAL_CONTROL_UNPRIVILEGED; /* Slot used to hold this task's CONTROL value. */
+ }
+ }
+ #endif /* configENABLE_MPU */
+
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pxEndOfStack; /* Slot used to hold this task's PSPLIM value. */
+
+ #if ( configENABLE_TRUSTZONE == 1 )
+ {
+ pxTopOfStack--;
+ *pxTopOfStack = portNO_SECURE_CONTEXT; /* Slot used to hold this task's xSecureContext value. */
+ }
+ #endif /* configENABLE_TRUSTZONE */
+ }
+ #endif /* portPRELOAD_REGISTERS */
+
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
+{
+ /* Make PendSV, CallSV and SysTick the same priority as the kernel. */
+ portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
+ portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ /* Setup the Memory Protection Unit (MPU). */
+ prvSetupMPU();
+ }
+ #endif /* configENABLE_MPU */
+
+ /* Start the timer that generates the tick ISR. Interrupts are disabled
+ * here already. */
+ vPortSetupTimerInterrupt();
+
+ /* Initialize the critical nesting count ready for the first task. */
+ ulCriticalNesting = 0;
+
+ /* Start the first task. */
+ vStartFirstTask();
+
+ /* Should never get here as the tasks will now be executing. Call the task
+ * exit error function to prevent compiler warnings about a static function
+ * not being called in the case that the application writer overrides this
+ * functionality by defining configTASK_RETURN_ADDRESS. Call
+ * vTaskSwitchContext() so link time optimization does not remove the
+ * symbol. */
+ vTaskSwitchContext();
+ prvTaskExitError();
+
+ /* Should not get here. */
+ return 0;
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void ) /* PRIVILEGED_FUNCTION */
+{
+ /* Not implemented in ports where there is nothing to return to.
+ * Artificially force an assert. */
+ configASSERT( ulCriticalNesting == 1000UL );
+}
+/*-----------------------------------------------------------*/
+
+#if ( configENABLE_MPU == 1 )
+ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
+ const struct xMEMORY_REGION * const xRegions,
+ StackType_t * pxBottomOfStack,
+ uint32_t ulStackDepth )
+ {
+ uint32_t ulRegionStartAddress, ulRegionEndAddress, ulRegionNumber;
+ int32_t lIndex = 0;
+
+ #if defined( __ARMCC_VERSION )
+
+ /* Declaration when these variable are defined in code instead of being
+ * exported from linker scripts. */
+ extern uint32_t * __privileged_sram_start__;
+ extern uint32_t * __privileged_sram_end__;
+ #else
+ /* Declaration when these variable are exported from linker scripts. */
+ extern uint32_t __privileged_sram_start__[];
+ extern uint32_t __privileged_sram_end__[];
+ #endif /* defined( __ARMCC_VERSION ) */
+
+ /* Setup MAIR0. */
+ xMPUSettings->ulMAIR0 = ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
+ xMPUSettings->ulMAIR0 |= ( ( portMPU_DEVICE_MEMORY_nGnRE << portMPU_MAIR_ATTR1_POS ) & portMPU_MAIR_ATTR1_MASK );
+
+ /* This function is called automatically when the task is created - in
+ * which case the stack region parameters will be valid. At all other
+ * times the stack parameters will not be valid and it is assumed that
+ * the stack region has already been configured. */
+ if( ulStackDepth > 0 )
+ {
+ ulRegionStartAddress = ( uint32_t ) pxBottomOfStack;
+ ulRegionEndAddress = ( uint32_t ) pxBottomOfStack + ( ulStackDepth * ( uint32_t ) sizeof( StackType_t ) ) - 1;
+
+ /* If the stack is within the privileged SRAM, do not protect it
+ * using a separate MPU region. This is needed because privileged
+ * SRAM is already protected using an MPU region and ARMv8-M does
+ * not allow overlapping MPU regions. */
+ if( ( ulRegionStartAddress >= ( uint32_t ) __privileged_sram_start__ ) &&
+ ( ulRegionEndAddress <= ( uint32_t ) __privileged_sram_end__ ) )
+ {
+ xMPUSettings->xRegionsSettings[ 0 ].ulRBAR = 0;
+ xMPUSettings->xRegionsSettings[ 0 ].ulRLAR = 0;
+ }
+ else
+ {
+ /* Define the region that allows access to the stack. */
+ ulRegionStartAddress &= portMPU_RBAR_ADDRESS_MASK;
+ ulRegionEndAddress &= portMPU_RLAR_ADDRESS_MASK;
+
+ xMPUSettings->xRegionsSettings[ 0 ].ulRBAR = ( ulRegionStartAddress ) |
+ ( portMPU_REGION_NON_SHAREABLE ) |
+ ( portMPU_REGION_READ_WRITE ) |
+ ( portMPU_REGION_EXECUTE_NEVER );
+
+ xMPUSettings->xRegionsSettings[ 0 ].ulRLAR = ( ulRegionEndAddress ) |
+ ( portMPU_RLAR_ATTR_INDEX0 ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+ }
+ }
+
+ /* User supplied configurable regions. */
+ for( ulRegionNumber = 1; ulRegionNumber <= portNUM_CONFIGURABLE_REGIONS; ulRegionNumber++ )
+ {
+ /* If xRegions is NULL i.e. the task has not specified any MPU
+ * region, the else part ensures that all the configurable MPU
+ * regions are invalidated. */
+ if( ( xRegions != NULL ) && ( xRegions[ lIndex ].ulLengthInBytes > 0UL ) )
+ {
+ /* Translate the generic region definition contained in xRegions
+ * into the ARMv8 specific MPU settings that are then stored in
+ * xMPUSettings. */
+ ulRegionStartAddress = ( ( uint32_t ) xRegions[ lIndex ].pvBaseAddress ) & portMPU_RBAR_ADDRESS_MASK;
+ ulRegionEndAddress = ( uint32_t ) xRegions[ lIndex ].pvBaseAddress + xRegions[ lIndex ].ulLengthInBytes - 1;
+ ulRegionEndAddress &= portMPU_RLAR_ADDRESS_MASK;
+
+ /* Start address. */
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRBAR = ( ulRegionStartAddress ) |
+ ( portMPU_REGION_NON_SHAREABLE );
+
+ /* RO/RW. */
+ if( ( xRegions[ lIndex ].ulParameters & tskMPU_REGION_READ_ONLY ) != 0 )
+ {
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRBAR |= ( portMPU_REGION_READ_ONLY );
+ }
+ else
+ {
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRBAR |= ( portMPU_REGION_READ_WRITE );
+ }
+
+ /* XN. */
+ if( ( xRegions[ lIndex ].ulParameters & tskMPU_REGION_EXECUTE_NEVER ) != 0 )
+ {
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRBAR |= ( portMPU_REGION_EXECUTE_NEVER );
+ }
+
+ /* End Address. */
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRLAR = ( ulRegionEndAddress ) |
+ ( portMPU_RLAR_REGION_ENABLE );
+
+ /* Normal memory/ Device memory. */
+ if( ( xRegions[ lIndex ].ulParameters & tskMPU_REGION_DEVICE_MEMORY ) != 0 )
+ {
+ /* Attr1 in MAIR0 is configured as device memory. */
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRLAR |= portMPU_RLAR_ATTR_INDEX1;
+ }
+ else
+ {
+ /* Attr0 in MAIR0 is configured as normal memory. */
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRLAR |= portMPU_RLAR_ATTR_INDEX0;
+ }
+ }
+ else
+ {
+ /* Invalidate the region. */
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRBAR = 0UL;
+ xMPUSettings->xRegionsSettings[ ulRegionNumber ].ulRLAR = 0UL;
+ }
+
+ lIndex++;
+ }
+ }
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+BaseType_t xPortIsInsideInterrupt( void )
+{
+ uint32_t ulCurrentInterrupt;
+ BaseType_t xReturn;
+
+ /* Obtain the number of the currently executing interrupt. Interrupt Program
+ * Status Register (IPSR) holds the exception number of the currently-executing
+ * exception or zero for Thread mode.*/
+ __asm volatile ( "mrs %0, ipsr" : "=r" ( ulCurrentInterrupt )::"memory" );
+
+ if( ulCurrentInterrupt == 0 )
+ {
+ xReturn = pdFALSE;
+ }
+ else
+ {
+ xReturn = pdTRUE;
+ }
+
+ return xReturn;
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portasm.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portasm.c
new file mode 100644
index 0000000..74e7b9e
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portasm.c
@@ -0,0 +1,478 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE ensures that PRIVILEGED_FUNCTION
+ * is defined correctly and privileged functions are placed in correct sections. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* Portasm includes. */
+#include "portasm.h"
+
+/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
+ * header files. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+
+void vRestoreContextOfFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, pxCurrentTCBConst2 \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r3, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r3] \n"/* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r5, #1 \n"/* r5 = 1. */
+ " bics r4, r5 \n"/* r4 = r4 & ~r5 i.e. Clear the bit 0 in r4. */
+ " str r4, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r3, #4 \n"/* r3 = r3 + 4. r3 now points to MAIR0 in TCB. */
+ " ldr r4, [r3] \n"/* r4 = *r3 i.e. r4 = MAIR0. */
+ " ldr r2, xMAIR0Const2 \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " adds r3, #4 \n"/* r3 = r3 + 4. r3 now points to first RBAR in TCB. */
+ " movs r5, #4 \n"/* r5 = 4. */
+ " str r5, [r2] \n"/* Program RNR = 4. */
+ " ldmia r3!, {r6,r7} \n"/* Read first set of RBAR/RLAR from TCB. */
+ " ldr r4, xRBARConst2 \n"/* r4 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r4!, {r6,r7} \n"/* Write first set of RBAR/RLAR registers. */
+ " movs r5, #5 \n"/* r5 = 5. */
+ " str r5, [r2] \n"/* Program RNR = 5. */
+ " ldmia r3!, {r6,r7} \n"/* Read second set of RBAR/RLAR from TCB. */
+ " ldr r4, xRBARConst2 \n"/* r4 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r4!, {r6,r7} \n"/* Write second set of RBAR/RLAR registers. */
+ " movs r5, #6 \n"/* r5 = 6. */
+ " str r5, [r2] \n"/* Program RNR = 6. */
+ " ldmia r3!, {r6,r7} \n"/* Read third set of RBAR/RLAR from TCB. */
+ " ldr r4, xRBARConst2 \n"/* r4 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r4!, {r6,r7} \n"/* Write third set of RBAR/RLAR registers. */
+ " movs r5, #7 \n"/* r5 = 7. */
+ " str r5, [r2] \n"/* Program RNR = 7. */
+ " ldmia r3!, {r6,r7} \n"/* Read fourth set of RBAR/RLAR from TCB. */
+ " ldr r4, xRBARConst2 \n"/* r4 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r4!, {r6,r7} \n"/* Write fourth set of RBAR/RLAR registers. */
+ " \n"
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r5, #1 \n"/* r5 = 1. */
+ " orrs r4, r5 \n"/* r4 = r4 | r5 i.e. Set the bit 0 in r4. */
+ " str r4, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldm r0!, {r1-r4} \n"/* Read from stack - r1 = xSecureContext, r2 = PSPLIM, r3 = CONTROL and r4 = EXC_RETURN. */
+ " ldr r5, xSecureContextConst2 \n"
+ " str r1, [r5] \n"/* Set xSecureContext to this task's value for the same. */
+ " msr psplim, r2 \n"/* Set this task's PSPLIM value. */
+ " msr control, r3 \n"/* Set this task's CONTROL value. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " bx r4 \n"/* Finally, branch to EXC_RETURN. */
+ #else /* configENABLE_MPU */
+ " ldm r0!, {r1-r3} \n"/* Read from stack - r1 = xSecureContext, r2 = PSPLIM and r3 = EXC_RETURN. */
+ " ldr r4, xSecureContextConst2 \n"
+ " str r1, [r4] \n"/* Set xSecureContext to this task's value for the same. */
+ " msr psplim, r2 \n"/* Set this task's PSPLIM value. */
+ " movs r1, #2 \n"/* r1 = 2. */
+ " msr CONTROL, r1 \n"/* Switch to use PSP in the thread mode. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " bx r3 \n"/* Finally, branch to EXC_RETURN. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst2: .word pxCurrentTCB \n"
+ "xSecureContextConst2: .word xSecureContext \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst2: .word 0xe000ed94 \n"
+ "xMAIR0Const2: .word 0xe000edc0 \n"
+ "xRNRConst2: .word 0xe000ed98 \n"
+ "xRBARConst2: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " tst r0, r1 \n"/* Perform r0 & r1 (bitwise AND) and update the conditions flag. */
+ " beq running_privileged \n"/* If the result of previous AND operation was 0, branch. */
+ " movs r0, #0 \n"/* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ " bx lr \n"/* Return. */
+ " running_privileged: \n"
+ " movs r0, #1 \n"/* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ " bx lr \n"/* Return. */
+ " \n"
+ " .align 4 \n"
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vRaisePrivilege( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* Read the CONTROL register. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " bics r0, r1 \n"/* Clear the bit 0. */
+ " msr control, r0 \n"/* Write back the new CONTROL value. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vResetPrivilege( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " orrs r0, r1 \n"/* r0 = r0 | r1. */
+ " msr control, r0 \n"/* CONTROL = r0. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vStartFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r0, xVTORConst \n"/* Use the NVIC offset register to locate the stack. */
+ " ldr r0, [r0] \n"/* Read the VTOR register which gives the address of vector table. */
+ " ldr r0, [r0] \n"/* The first entry in vector table is stack pointer. */
+ " msr msp, r0 \n"/* Set the MSP back to the start of the stack. */
+ " cpsie i \n"/* Globally enable interrupts. */
+ " dsb \n"
+ " isb \n"
+ " svc %0 \n"/* System call to start the first task. */
+ " nop \n"
+ " \n"
+ " .align 4 \n"
+ "xVTORConst: .word 0xe000ed08 \n"
+ ::"i" ( portSVC_START_SCHEDULER ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, PRIMASK \n"
+ " cpsid i \n"
+ " bx lr \n"
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " msr PRIMASK, r0 \n"
+ " bx lr \n"
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void PendSV_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " .extern SecureContext_SaveContext \n"
+ " .extern SecureContext_LoadContext \n"
+ " \n"
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " ldr r0, [r3] \n"/* Read xSecureContext - Value of xSecureContext must be in r0 as it is used as a parameter later. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB - Value of pxCurrentTCB must be in r1 as it is used as a parameter later.*/
+ " mrs r2, psp \n"/* Read PSP in r2. */
+ " \n"
+ " cbz r0, save_ns_context \n"/* No secure context to save. */
+ " push {r0-r2, r14} \n"
+ " bl SecureContext_SaveContext \n"/* Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r0-r3} \n"/* LR is now in r3. */
+ " mov lr, r3 \n"/* LR = r3. */
+ " lsls r1, r3, #25 \n"/* r1 = r3 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl save_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ #if ( configENABLE_MPU == 1 )
+ " subs r2, r2, #16 \n"/* Make space for xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r3, control \n"/* r3 = CONTROL. */
+ " mov r4, lr \n"/* r4 = LR/EXC_RETURN. */
+ " stmia r2!, {r0, r1, r3, r4} \n"/* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ " subs r2, r2, #12 \n"/* Make space for xSecureContext, PSPLIM and LR on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmia r2!, {r0, r1, r3} \n"/* Store xSecureContext, PSPLIM and LR on the stack. */
+ #endif /* configENABLE_MPU */
+ " b select_next_task \n"
+ " \n"
+ " save_ns_context: \n"
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ #if ( configENABLE_MPU == 1 )
+ " subs r2, r2, #48 \n"/* Make space for xSecureContext, PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " adds r2, r2, #16 \n"/* r2 = r2 + 16. */
+ " stmia r2!, {r4-r7} \n"/* Store the low registers that are not saved automatically. */
+ " mov r4, r8 \n"/* r4 = r8. */
+ " mov r5, r9 \n"/* r5 = r9. */
+ " mov r6, r10 \n"/* r6 = r10. */
+ " mov r7, r11 \n"/* r7 = r11. */
+ " stmia r2!, {r4-r7} \n"/* Store the high registers that are not saved automatically. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r3, control \n"/* r3 = CONTROL. */
+ " mov r4, lr \n"/* r4 = LR/EXC_RETURN. */
+ " subs r2, r2, #48 \n"/* r2 = r2 - 48. */
+ " stmia r2!, {r0, r1, r3, r4} \n"/* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ " subs r2, r2, #44 \n"/* Make space for xSecureContext, PSPLIM, LR and the remaining registers on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmia r2!, {r0, r1, r3-r7} \n"/* Store xSecureContext, PSPLIM, LR and the low registers that are not saved automatically. */
+ " mov r4, r8 \n"/* r4 = r8. */
+ " mov r5, r9 \n"/* r5 = r9. */
+ " mov r6, r10 \n"/* r6 = r10. */
+ " mov r7, r11 \n"/* r7 = r11. */
+ " stmia r2!, {r4-r7} \n"/* Store the high registers that are not saved automatically. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " select_next_task: \n"
+ " cpsid i \n"
+ " bl vTaskSwitchContext \n"
+ " cpsie i \n"
+ " \n"
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " ldr r2, [r1] \n"/* The first item in pxCurrentTCB is the task top of stack. r2 now points to the top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r3, xMPUCTRLConst \n"/* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r3] \n"/* Read the value of MPU_CTRL. */
+ " movs r5, #1 \n"/* r5 = 1. */
+ " bics r4, r5 \n"/* r4 = r4 & ~r5 i.e. Clear the bit 0 in r4. */
+ " str r4, [r3] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r4, [r1] \n"/* r4 = *r1 i.e. r4 = MAIR0. */
+ " ldr r3, xMAIR0Const \n"/* r3 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r3] \n"/* Program MAIR0. */
+ " ldr r4, xRNRConst \n"/* r4 = 0xe000ed98 [Location of RNR]. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " movs r5, #4 \n"/* r5 = 4. */
+ " str r5, [r4] \n"/* Program RNR = 4. */
+ " ldmia r1!, {r6,r7} \n"/* Read first set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r6,r7} \n"/* Write first set of RBAR/RLAR registers. */
+ " movs r5, #5 \n"/* r5 = 5. */
+ " str r5, [r4] \n"/* Program RNR = 5. */
+ " ldmia r1!, {r6,r7} \n"/* Read second set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r6,r7} \n"/* Write second set of RBAR/RLAR registers. */
+ " movs r5, #6 \n"/* r5 = 6. */
+ " str r5, [r4] \n"/* Program RNR = 6. */
+ " ldmia r1!, {r6,r7} \n"/* Read third set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r6,r7} \n"/* Write third set of RBAR/RLAR registers. */
+ " movs r5, #7 \n"/* r5 = 7. */
+ " str r5, [r4] \n"/* Program RNR = 7. */
+ " ldmia r1!, {r6,r7} \n"/* Read fourth set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r6,r7} \n"/* Write fourth set of RBAR/RLAR registers. */
+ " \n"
+ " ldr r3, xMPUCTRLConst \n"/* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r3] \n"/* Read the value of MPU_CTRL. */
+ " movs r5, #1 \n"/* r5 = 1. */
+ " orrs r4, r5 \n"/* r4 = r4 | r5 i.e. Set the bit 0 in r4. */
+ " str r4, [r3] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldmia r2!, {r0, r1, r3, r4} \n"/* Read from stack - r0 = xSecureContext, r1 = PSPLIM, r3 = CONTROL and r4 = LR. */
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " msr control, r3 \n"/* Restore the CONTROL register value for the task. */
+ " mov lr, r4 \n"/* LR = r4. */
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " str r0, [r3] \n"/* Restore the task's xSecureContext. */
+ " cbz r0, restore_ns_context \n"/* If there is no secure context for the task, restore the non-secure context. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " push {r2, r4} \n"
+ " bl SecureContext_LoadContext \n"/* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r2, r4} \n"
+ " mov lr, r4 \n"/* LR = r4. */
+ " lsls r1, r4, #25 \n"/* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl restore_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " bx lr \n"
+ #else /* configENABLE_MPU */
+ " ldmia r2!, {r0, r1, r4} \n"/* Read from stack - r0 = xSecureContext, r1 = PSPLIM and r4 = LR. */
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " mov lr, r4 \n"/* LR = r4. */
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " str r0, [r3] \n"/* Restore the task's xSecureContext. */
+ " cbz r0, restore_ns_context \n"/* If there is no secure context for the task, restore the non-secure context. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " push {r2, r4} \n"
+ " bl SecureContext_LoadContext \n"/* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r2, r4} \n"
+ " mov lr, r4 \n"/* LR = r4. */
+ " lsls r1, r4, #25 \n"/* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl restore_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " bx lr \n"
+ #endif /* configENABLE_MPU */
+ " \n"
+ " restore_ns_context: \n"
+ " adds r2, r2, #16 \n"/* Move to the high registers. */
+ " ldmia r2!, {r4-r7} \n"/* Restore the high registers that are not automatically restored. */
+ " mov r8, r4 \n"/* r8 = r4. */
+ " mov r9, r5 \n"/* r9 = r5. */
+ " mov r10, r6 \n"/* r10 = r6. */
+ " mov r11, r7 \n"/* r11 = r7. */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " subs r2, r2, #32 \n"/* Go back to the low registers. */
+ " ldmia r2!, {r4-r7} \n"/* Restore the low registers that are not automatically restored. */
+ " bx lr \n"
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst: .word pxCurrentTCB \n"
+ "xSecureContextConst: .word xSecureContext \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst: .word 0xe000ed94 \n"
+ "xMAIR0Const: .word 0xe000edc0 \n"
+ "xRNRConst: .word 0xe000ed98 \n"
+ "xRBARConst: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SVC_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " movs r0, #4 \n"
+ " mov r1, lr \n"
+ " tst r0, r1 \n"
+ " beq stacking_used_msp \n"
+ " mrs r0, psp \n"
+ " ldr r2, svchandler_address_const \n"
+ " bx r2 \n"
+ " stacking_used_msp: \n"
+ " mrs r0, msp \n"
+ " ldr r2, svchandler_address_const \n"
+ " bx r2 \n"
+ " \n"
+ " .align 4 \n"
+ "svchandler_address_const: .word vPortSVCHandler_C \n"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " svc %0 \n"/* Secure context is allocated in the supervisor call. */
+ " bx lr \n"/* Return. */
+ ::"i" ( portSVC_ALLOCATE_SECURE_CONTEXT ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, [r0] \n"/* The first item in the TCB is the top of the stack. */
+ " ldr r1, [r2] \n"/* The first item on the stack is the task's xSecureContext. */
+ " cmp r1, #0 \n"/* Raise svc if task's xSecureContext is not NULL. */
+ " bne free_secure_context \n"/* Branch if r1 != 0. */
+ " bx lr \n"/* There is no secure context (xSecureContext is NULL). */
+ " free_secure_context: \n"
+ " svc %0 \n"/* Secure context is freed in the supervisor call. */
+ " bx lr \n"/* Return. */
+ ::"i" ( portSVC_FREE_SECURE_CONTEXT ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h
new file mode 100644
index 0000000..7cca20a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h
@@ -0,0 +1,71 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M23"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" )
+#define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portasm.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portasm.c
new file mode 100644
index 0000000..2a81873
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portasm.c
@@ -0,0 +1,381 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE ensures that PRIVILEGED_FUNCTION
+ * is defined correctly and privileged functions are placed in correct sections. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* Portasm includes. */
+#include "portasm.h"
+
+/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
+ * header files. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+
+void vRestoreContextOfFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, pxCurrentTCBConst2 \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r1] \n"/* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r3, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r4, #1 \n"/* r4 = 1. */
+ " bics r3, r4 \n"/* r3 = r3 & ~r4 i.e. Clear the bit 0 in r3. */
+ " str r3, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r4, [r1] \n"/* r4 = *r1 i.e. r4 = MAIR0. */
+ " ldr r2, xMAIR0Const2 \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " movs r4, #4 \n"/* r4 = 4. */
+ " str r4, [r2] \n"/* Program RNR = 4. */
+ " ldmia r1!, {r5,r6} \n"/* Read first set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst2 \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write first set of RBAR/RLAR registers. */
+ " movs r4, #5 \n"/* r4 = 5. */
+ " str r4, [r2] \n"/* Program RNR = 5. */
+ " ldmia r1!, {r5,r6} \n"/* Read second set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst2 \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write second set of RBAR/RLAR registers. */
+ " movs r4, #6 \n"/* r4 = 6. */
+ " str r4, [r2] \n"/* Program RNR = 6. */
+ " ldmia r1!, {r5,r6} \n"/* Read third set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst2 \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write third set of RBAR/RLAR registers. */
+ " movs r4, #7 \n"/* r4 = 7. */
+ " str r4, [r2] \n"/* Program RNR = 7. */
+ " ldmia r1!, {r5,r6} \n"/* Read fourth set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst2 \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write fourth set of RBAR/RLAR registers. */
+ " \n"
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r3, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r4, #1 \n"/* r4 = 1. */
+ " orrs r3, r4 \n"/* r3 = r3 | r4 i.e. Set the bit 0 in r3. */
+ " str r3, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldm r0!, {r1-r3} \n"/* Read from stack - r1 = PSPLIM, r2 = CONTROL and r3 = EXC_RETURN. */
+ " msr psplim, r1 \n"/* Set this task's PSPLIM value. */
+ " msr control, r2 \n"/* Set this task's CONTROL value. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " bx r3 \n"/* Finally, branch to EXC_RETURN. */
+ #else /* configENABLE_MPU */
+ " ldm r0!, {r1-r2} \n"/* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
+ " msr psplim, r1 \n"/* Set this task's PSPLIM value. */
+ " movs r1, #2 \n"/* r1 = 2. */
+ " msr CONTROL, r1 \n"/* Switch to use PSP in the thread mode. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " bx r2 \n"/* Finally, branch to EXC_RETURN. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst2: .word pxCurrentTCB \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst2: .word 0xe000ed94 \n"
+ "xMAIR0Const2: .word 0xe000edc0 \n"
+ "xRNRConst2: .word 0xe000ed98 \n"
+ "xRBARConst2: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " tst r0, r1 \n"/* Perform r0 & r1 (bitwise AND) and update the conditions flag. */
+ " beq running_privileged \n"/* If the result of previous AND operation was 0, branch. */
+ " movs r0, #0 \n"/* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ " bx lr \n"/* Return. */
+ " running_privileged: \n"
+ " movs r0, #1 \n"/* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ " bx lr \n"/* Return. */
+ " \n"
+ " .align 4 \n"
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vRaisePrivilege( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* Read the CONTROL register. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " bics r0, r1 \n"/* Clear the bit 0. */
+ " msr control, r0 \n"/* Write back the new CONTROL value. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vResetPrivilege( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " movs r1, #1 \n"/* r1 = 1. */
+ " orrs r0, r1 \n"/* r0 = r0 | r1. */
+ " msr control, r0 \n"/* CONTROL = r0. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vStartFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r0, xVTORConst \n"/* Use the NVIC offset register to locate the stack. */
+ " ldr r0, [r0] \n"/* Read the VTOR register which gives the address of vector table. */
+ " ldr r0, [r0] \n"/* The first entry in vector table is stack pointer. */
+ " msr msp, r0 \n"/* Set the MSP back to the start of the stack. */
+ " cpsie i \n"/* Globally enable interrupts. */
+ " dsb \n"
+ " isb \n"
+ " svc %0 \n"/* System call to start the first task. */
+ " nop \n"
+ " \n"
+ " .align 4 \n"
+ "xVTORConst: .word 0xe000ed08 \n"
+ ::"i" ( portSVC_START_SCHEDULER ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, PRIMASK \n"
+ " cpsid i \n"
+ " bx lr \n"
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " msr PRIMASK, r0 \n"
+ " bx lr \n"
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void PendSV_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, psp \n"/* Read PSP in r0. */
+ " ldr r2, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ #if ( configENABLE_MPU == 1 )
+ " subs r0, r0, #44 \n"/* Make space for PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ " str r0, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r2, control \n"/* r2 = CONTROL. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmia r0!, {r1-r7} \n"/* Store on the stack - PSPLIM, CONTROL, LR and low registers that are not automatically saved. */
+ " mov r4, r8 \n"/* r4 = r8. */
+ " mov r5, r9 \n"/* r5 = r9. */
+ " mov r6, r10 \n"/* r6 = r10. */
+ " mov r7, r11 \n"/* r7 = r11. */
+ " stmia r0!, {r4-r7} \n"/* Store the high registers that are not saved automatically. */
+ #else /* configENABLE_MPU */
+ " subs r0, r0, #40 \n"/* Make space for PSPLIM, LR and the remaining registers on the stack. */
+ " str r0, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r2, psplim \n"/* r2 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmia r0!, {r2-r7} \n"/* Store on the stack - PSPLIM, LR and low registers that are not automatically saved. */
+ " mov r4, r8 \n"/* r4 = r8. */
+ " mov r5, r9 \n"/* r5 = r9. */
+ " mov r6, r10 \n"/* r6 = r10. */
+ " mov r7, r11 \n"/* r7 = r11. */
+ " stmia r0!, {r4-r7} \n"/* Store the high registers that are not saved automatically. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " cpsid i \n"
+ " bl vTaskSwitchContext \n"
+ " cpsie i \n"
+ " \n"
+ " ldr r2, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r1] \n"/* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r3, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r4, #1 \n"/* r4 = 1. */
+ " bics r3, r4 \n"/* r3 = r3 & ~r4 i.e. Clear the bit 0 in r3. */
+ " str r3, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r4, [r1] \n"/* r4 = *r1 i.e. r4 = MAIR0. */
+ " ldr r2, xMAIR0Const \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " movs r4, #4 \n"/* r4 = 4. */
+ " str r4, [r2] \n"/* Program RNR = 4. */
+ " ldmia r1!, {r5,r6} \n"/* Read first set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write first set of RBAR/RLAR registers. */
+ " movs r4, #5 \n"/* r4 = 5. */
+ " str r4, [r2] \n"/* Program RNR = 5. */
+ " ldmia r1!, {r5,r6} \n"/* Read second set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write second set of RBAR/RLAR registers. */
+ " movs r4, #6 \n"/* r4 = 6. */
+ " str r4, [r2] \n"/* Program RNR = 6. */
+ " ldmia r1!, {r5,r6} \n"/* Read third set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write third set of RBAR/RLAR registers. */
+ " movs r4, #7 \n"/* r4 = 7. */
+ " str r4, [r2] \n"/* Program RNR = 7. */
+ " ldmia r1!, {r5,r6} \n"/* Read fourth set of RBAR/RLAR from TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " stmia r3!, {r5,r6} \n"/* Write fourth set of RBAR/RLAR registers. */
+ " \n"
+ " ldr r2, xMPUCTRLConst \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r3, [r2] \n"/* Read the value of MPU_CTRL. */
+ " movs r4, #1 \n"/* r4 = 1. */
+ " orrs r3, r4 \n"/* r3 = r3 | r4 i.e. Set the bit 0 in r3. */
+ " str r3, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " adds r0, r0, #28 \n"/* Move to the high registers. */
+ " ldmia r0!, {r4-r7} \n"/* Restore the high registers that are not automatically restored. */
+ " mov r8, r4 \n"/* r8 = r4. */
+ " mov r9, r5 \n"/* r9 = r5. */
+ " mov r10, r6 \n"/* r10 = r6. */
+ " mov r11, r7 \n"/* r11 = r7. */
+ " msr psp, r0 \n"/* Remember the new top of stack for the task. */
+ " subs r0, r0, #44 \n"/* Move to the starting of the saved context. */
+ " ldmia r0!, {r1-r7} \n"/* Read from stack - r1 = PSPLIM, r2 = CONTROL, r3 = LR and r4-r7 restored. */
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " msr control, r2 \n"/* Restore the CONTROL register value for the task. */
+ " bx r3 \n"
+ #else /* configENABLE_MPU */
+ " adds r0, r0, #24 \n"/* Move to the high registers. */
+ " ldmia r0!, {r4-r7} \n"/* Restore the high registers that are not automatically restored. */
+ " mov r8, r4 \n"/* r8 = r4. */
+ " mov r9, r5 \n"/* r9 = r5. */
+ " mov r10, r6 \n"/* r10 = r6. */
+ " mov r11, r7 \n"/* r11 = r7. */
+ " msr psp, r0 \n"/* Remember the new top of stack for the task. */
+ " subs r0, r0, #40 \n"/* Move to the starting of the saved context. */
+ " ldmia r0!, {r2-r7} \n"/* Read from stack - r2 = PSPLIM, r3 = LR and r4-r7 restored. */
+ " msr psplim, r2 \n"/* Restore the PSPLIM register value for the task. */
+ " bx r3 \n"
+ #endif /* configENABLE_MPU */
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst: .word pxCurrentTCB \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst: .word 0xe000ed94 \n"
+ "xMAIR0Const: .word 0xe000edc0 \n"
+ "xRNRConst: .word 0xe000ed98 \n"
+ "xRBARConst: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SVC_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " movs r0, #4 \n"
+ " mov r1, lr \n"
+ " tst r0, r1 \n"
+ " beq stacking_used_msp \n"
+ " mrs r0, psp \n"
+ " ldr r2, svchandler_address_const \n"
+ " bx r2 \n"
+ " stacking_used_msp: \n"
+ " mrs r0, msp \n"
+ " ldr r2, svchandler_address_const \n"
+ " bx r2 \n"
+ " \n"
+ " .align 4 \n"
+ "svchandler_address_const: .word vPortSVCHandler_C \n"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h
new file mode 100644
index 0000000..7cca20a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h
@@ -0,0 +1,71 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M23"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" )
+#define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portasm.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portasm.c
new file mode 100644
index 0000000..df117af
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portasm.c
@@ -0,0 +1,470 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE ensures that PRIVILEGED_FUNCTION
+ * is defined correctly and privileged functions are placed in correct sections. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* Portasm includes. */
+#include "portasm.h"
+
+/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
+ * header files. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+void vRestoreContextOfFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, pxCurrentTCBConst2 \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r3, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r3] \n"/* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " bic r4, #1 \n"/* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ " str r4, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r3, #4 \n"/* r3 = r3 + 4. r3 now points to MAIR0 in TCB. */
+ " ldr r4, [r3] \n"/* r4 = *r3 i.e. r4 = MAIR0. */
+ " ldr r2, xMAIR0Const2 \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #4 \n"/* r4 = 4. */
+ " str r4, [r2] \n"/* Program RNR = 4. */
+ " adds r3, #4 \n"/* r3 = r3 + 4. r3 now points to first RBAR in TCB. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r3!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " \n"
+ #if ( configTOTAL_MPU_REGIONS == 16 )
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #8 \n"/* r4 = 8. */
+ " str r4, [r2] \n"/* Program RNR = 8. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r3!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #12 \n"/* r4 = 12. */
+ " str r4, [r2] \n"/* Program RNR = 12. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r3!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ #endif /* configTOTAL_MPU_REGIONS == 16 */
+ " \n"
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " orr r4, #1 \n"/* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ " str r4, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldm r0!, {r1-r4} \n"/* Read from stack - r1 = xSecureContext, r2 = PSPLIM, r3 = CONTROL and r4 = EXC_RETURN. */
+ " ldr r5, xSecureContextConst2 \n"
+ " str r1, [r5] \n"/* Set xSecureContext to this task's value for the same. */
+ " msr psplim, r2 \n"/* Set this task's PSPLIM value. */
+ " msr control, r3 \n"/* Set this task's CONTROL value. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " mov r0, #0 \n"
+ " msr basepri, r0 \n"/* Ensure that interrupts are enabled when the first task starts. */
+ " bx r4 \n"/* Finally, branch to EXC_RETURN. */
+ #else /* configENABLE_MPU */
+ " ldm r0!, {r1-r3} \n"/* Read from stack - r1 = xSecureContext, r2 = PSPLIM and r3 = EXC_RETURN. */
+ " ldr r4, xSecureContextConst2 \n"
+ " str r1, [r4] \n"/* Set xSecureContext to this task's value for the same. */
+ " msr psplim, r2 \n"/* Set this task's PSPLIM value. */
+ " movs r1, #2 \n"/* r1 = 2. */
+ " msr CONTROL, r1 \n"/* Switch to use PSP in the thread mode. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " mov r0, #0 \n"
+ " msr basepri, r0 \n"/* Ensure that interrupts are enabled when the first task starts. */
+ " bx r3 \n"/* Finally, branch to EXC_RETURN. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst2: .word pxCurrentTCB \n"
+ "xSecureContextConst2: .word xSecureContext \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst2: .word 0xe000ed94 \n"
+ "xMAIR0Const2: .word 0xe000edc0 \n"
+ "xRNRConst2: .word 0xe000ed98 \n"
+ "xRBARConst2: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " tst r0, #1 \n"/* Perform r0 & 1 (bitwise AND) and update the conditions flag. */
+ " ite ne \n"
+ " movne r0, #0 \n"/* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ " moveq r0, #1 \n"/* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ " bx lr \n"/* Return. */
+ " \n"
+ " .align 4 \n"
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vRaisePrivilege( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* Read the CONTROL register. */
+ " bic r0, #1 \n"/* Clear the bit 0. */
+ " msr control, r0 \n"/* Write back the new CONTROL value. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vResetPrivilege( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " orr r0, #1 \n"/* r0 = r0 | 1. */
+ " msr control, r0 \n"/* CONTROL = r0. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vStartFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r0, xVTORConst \n"/* Use the NVIC offset register to locate the stack. */
+ " ldr r0, [r0] \n"/* Read the VTOR register which gives the address of vector table. */
+ " ldr r0, [r0] \n"/* The first entry in vector table is stack pointer. */
+ " msr msp, r0 \n"/* Set the MSP back to the start of the stack. */
+ " cpsie i \n"/* Globally enable interrupts. */
+ " cpsie f \n"
+ " dsb \n"
+ " isb \n"
+ " svc %0 \n"/* System call to start the first task. */
+ " nop \n"
+ " \n"
+ " .align 4 \n"
+ "xVTORConst: .word 0xe000ed08 \n"
+ ::"i" ( portSVC_START_SCHEDULER ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, basepri \n"/* r0 = basepri. Return original basepri value. */
+ " mov r1, %0 \n"/* r1 = configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " msr basepri, r1 \n"/* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " dsb \n"
+ " isb \n"
+ " bx lr \n"/* Return. */
+ ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " msr basepri, r0 \n"/* basepri = ulMask. */
+ " dsb \n"
+ " isb \n"
+ " bx lr \n"/* Return. */
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void PendSV_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " .extern SecureContext_SaveContext \n"
+ " .extern SecureContext_LoadContext \n"
+ " \n"
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " ldr r0, [r3] \n"/* Read xSecureContext - Value of xSecureContext must be in r0 as it is used as a parameter later. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB - Value of pxCurrentTCB must be in r1 as it is used as a parameter later. */
+ " mrs r2, psp \n"/* Read PSP in r2. */
+ " \n"
+ " cbz r0, save_ns_context \n"/* No secure context to save. */
+ " push {r0-r2, r14} \n"
+ " bl SecureContext_SaveContext \n"/* Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r0-r3} \n"/* LR is now in r3. */
+ " mov lr, r3 \n"/* LR = r3. */
+ " lsls r1, r3, #25 \n"/* r1 = r3 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl save_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " \n"
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB.*/
+ #if ( configENABLE_MPU == 1 )
+ " subs r2, r2, #16 \n"/* Make space for xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r3, control \n"/* r3 = CONTROL. */
+ " mov r4, lr \n"/* r4 = LR/EXC_RETURN. */
+ " stmia r2!, {r0, r1, r3, r4} \n"/* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ " subs r2, r2, #12 \n"/* Make space for xSecureContext, PSPLIM and LR on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmia r2!, {r0, r1, r3} \n"/* Store xSecureContext, PSPLIM and LR on the stack. */
+ #endif /* configENABLE_MPU */
+ " b select_next_task \n"
+ " \n"
+ " save_ns_context: \n"
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ " tst lr, #0x10 \n"/* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ " it eq \n"
+ " vstmdbeq r2!, {s16-s31} \n"/* Store the additional FP context registers which are not saved automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ #if ( configENABLE_MPU == 1 )
+ " subs r2, r2, #48 \n"/* Make space for xSecureContext, PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " adds r2, r2, #16 \n"/* r2 = r2 + 16. */
+ " stm r2, {r4-r11} \n"/* Store the registers that are not saved automatically. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r3, control \n"/* r3 = CONTROL. */
+ " mov r4, lr \n"/* r4 = LR/EXC_RETURN. */
+ " subs r2, r2, #16 \n"/* r2 = r2 - 16. */
+ " stmia r2!, {r0, r1, r3, r4} \n"/* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ " subs r2, r2, #44 \n"/* Make space for xSecureContext, PSPLIM, LR and the remaining registers on the stack. */
+ " str r2, [r1] \n"/* Save the new top of stack in TCB. */
+ " adds r2, r2, #12 \n"/* r2 = r2 + 12. */
+ " stm r2, {r4-r11} \n"/* Store the registers that are not saved automatically. */
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " subs r2, r2, #12 \n"/* r2 = r2 - 12. */
+ " stmia r2!, {r0, r1, r3} \n"/* Store xSecureContext, PSPLIM and LR on the stack. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " select_next_task: \n"
+ " mov r0, %0 \n"/* r0 = configMAX_SYSCALL_INTERRUPT_PRIORITY */
+ " msr basepri, r0 \n"/* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " dsb \n"
+ " isb \n"
+ " bl vTaskSwitchContext \n"
+ " mov r0, #0 \n"/* r0 = 0. */
+ " msr basepri, r0 \n"/* Enable interrupts. */
+ " \n"
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " ldr r2, [r1] \n"/* The first item in pxCurrentTCB is the task top of stack. r2 now points to the top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r3, xMPUCTRLConst \n"/* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r3] \n"/* Read the value of MPU_CTRL. */
+ " bic r4, #1 \n"/* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ " str r4, [r3] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r4, [r1] \n"/* r4 = *r1 i.e. r4 = MAIR0. */
+ " ldr r3, xMAIR0Const \n"/* r3 = 0xe000edc0 [Location of MAIR0]. */
+ " str r4, [r3] \n"/* Program MAIR0. */
+ " ldr r3, xRNRConst \n"/* r3 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #4 \n"/* r4 = 4. */
+ " str r4, [r3] \n"/* Program RNR = 4. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r3!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " \n"
+ #if ( configTOTAL_MPU_REGIONS == 16 )
+ " ldr r3, xRNRConst \n"/* r3 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #8 \n"/* r4 = 8. */
+ " str r4, [r3] \n"/* Program RNR = 8. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r3!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " ldr r3, xRNRConst \n"/* r3 = 0xe000ed98 [Location of RNR]. */
+ " movs r4, #12 \n"/* r4 = 12. */
+ " str r4, [r3] \n"/* Program RNR = 12. */
+ " ldr r3, xRBARConst \n"/* r3 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r3!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ #endif /* configTOTAL_MPU_REGIONS == 16 */
+ " \n"
+ " ldr r3, xMPUCTRLConst \n"/* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r3] \n"/* Read the value of MPU_CTRL. */
+ " orr r4, #1 \n"/* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ " str r4, [r3] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldmia r2!, {r0, r1, r3, r4} \n"/* Read from stack - r0 = xSecureContext, r1 = PSPLIM, r3 = CONTROL and r4 = LR. */
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " msr control, r3 \n"/* Restore the CONTROL register value for the task. */
+ " mov lr, r4 \n"/* LR = r4. */
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " str r0, [r3] \n"/* Restore the task's xSecureContext. */
+ " cbz r0, restore_ns_context \n"/* If there is no secure context for the task, restore the non-secure context. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " push {r2, r4} \n"
+ " bl SecureContext_LoadContext \n"/* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r2, r4} \n"
+ " mov lr, r4 \n"/* LR = r4. */
+ " lsls r1, r4, #25 \n"/* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl restore_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " bx lr \n"
+ #else /* configENABLE_MPU */
+ " ldmia r2!, {r0, r1, r4} \n"/* Read from stack - r0 = xSecureContext, r1 = PSPLIM and r4 = LR. */
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " mov lr, r4 \n"/* LR = r4. */
+ " ldr r3, xSecureContextConst \n"/* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ " str r0, [r3] \n"/* Restore the task's xSecureContext. */
+ " cbz r0, restore_ns_context \n"/* If there is no secure context for the task, restore the non-secure context. */
+ " ldr r3, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r3] \n"/* Read pxCurrentTCB. */
+ " push {r2, r4} \n"
+ " bl SecureContext_LoadContext \n"/* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ " pop {r2, r4} \n"
+ " mov lr, r4 \n"/* LR = r4. */
+ " lsls r1, r4, #25 \n"/* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ " bpl restore_ns_context \n"/* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " bx lr \n"
+ #endif /* configENABLE_MPU */
+ " \n"
+ " restore_ns_context: \n"
+ " ldmia r2!, {r4-r11} \n"/* Restore the registers that are not automatically restored. */
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ " tst lr, #0x10 \n"/* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ " it eq \n"
+ " vldmiaeq r2!, {s16-s31} \n"/* Restore the additional FP context registers which are not restored automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ " msr psp, r2 \n"/* Remember the new top of stack for the task. */
+ " bx lr \n"
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst: .word pxCurrentTCB \n"
+ "xSecureContextConst: .word xSecureContext \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst: .word 0xe000ed94 \n"
+ "xMAIR0Const: .word 0xe000edc0 \n"
+ "xRNRConst: .word 0xe000ed98 \n"
+ "xRBARConst: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SVC_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " tst lr, #4 \n"
+ " ite eq \n"
+ " mrseq r0, msp \n"
+ " mrsne r0, psp \n"
+ " ldr r1, svchandler_address_const \n"
+ " bx r1 \n"
+ " \n"
+ " .align 4 \n"
+ "svchandler_address_const: .word vPortSVCHandler_C \n"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " svc %0 \n"/* Secure context is allocated in the supervisor call. */
+ " bx lr \n"/* Return. */
+ ::"i" ( portSVC_ALLOCATE_SECURE_CONTEXT ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, [r0] \n"/* The first item in the TCB is the top of the stack. */
+ " ldr r1, [r2] \n"/* The first item on the stack is the task's xSecureContext. */
+ " cmp r1, #0 \n"/* Raise svc if task's xSecureContext is not NULL. */
+ " it ne \n"
+ " svcne %0 \n"/* Secure context is freed in the supervisor call. */
+ " bx lr \n"/* Return. */
+ ::"i" ( portSVC_FREE_SECURE_CONTEXT ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h
new file mode 100644
index 0000000..1f3d964
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h
@@ -0,0 +1,66 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M33"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portasm.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portasm.c
new file mode 100644
index 0000000..660e942
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portasm.c
@@ -0,0 +1,365 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE ensures that PRIVILEGED_FUNCTION
+ * is defined correctly and privileged functions are placed in correct sections. */
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* Portasm includes. */
+#include "portasm.h"
+
+/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
+ * header files. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+void vRestoreContextOfFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r2, pxCurrentTCBConst2 \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r1] \n"/* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " bic r4, #1 \n"/* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ " str r4, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r3, [r1] \n"/* r3 = *r1 i.e. r3 = MAIR0. */
+ " ldr r2, xMAIR0Const2 \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r3, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #4 \n"/* r3 = 4. */
+ " str r3, [r2] \n"/* Program RNR = 4. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " \n"
+ #if ( configTOTAL_MPU_REGIONS == 16 )
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #8 \n"/* r3 = 8. */
+ " str r3, [r2] \n"/* Program RNR = 8. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " ldr r2, xRNRConst2 \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #12 \n"/* r3 = 12. */
+ " str r3, [r2] \n"/* Program RNR = 12. */
+ " ldr r2, xRBARConst2 \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 set of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ #endif /* configTOTAL_MPU_REGIONS == 16 */
+ " \n"
+ " ldr r2, xMPUCTRLConst2 \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " orr r4, #1 \n"/* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ " str r4, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldm r0!, {r1-r3} \n"/* Read from stack - r1 = PSPLIM, r2 = CONTROL and r3 = EXC_RETURN. */
+ " msr psplim, r1 \n"/* Set this task's PSPLIM value. */
+ " msr control, r2 \n"/* Set this task's CONTROL value. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " mov r0, #0 \n"
+ " msr basepri, r0 \n"/* Ensure that interrupts are enabled when the first task starts. */
+ " bx r3 \n"/* Finally, branch to EXC_RETURN. */
+ #else /* configENABLE_MPU */
+ " ldm r0!, {r1-r2} \n"/* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
+ " msr psplim, r1 \n"/* Set this task's PSPLIM value. */
+ " movs r1, #2 \n"/* r1 = 2. */
+ " msr CONTROL, r1 \n"/* Switch to use PSP in the thread mode. */
+ " adds r0, #32 \n"/* Discard everything up to r0. */
+ " msr psp, r0 \n"/* This is now the new top of stack to use in the task. */
+ " isb \n"
+ " mov r0, #0 \n"
+ " msr basepri, r0 \n"/* Ensure that interrupts are enabled when the first task starts. */
+ " bx r2 \n"/* Finally, branch to EXC_RETURN. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst2: .word pxCurrentTCB \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst2: .word 0xe000ed94 \n"
+ "xMAIR0Const2: .word 0xe000edc0 \n"
+ "xRNRConst2: .word 0xe000ed98 \n"
+ "xRBARConst2: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ );
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " tst r0, #1 \n"/* Perform r0 & 1 (bitwise AND) and update the conditions flag. */
+ " ite ne \n"
+ " movne r0, #0 \n"/* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ " moveq r0, #1 \n"/* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ " bx lr \n"/* Return. */
+ " \n"
+ " .align 4 \n"
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vRaisePrivilege( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* Read the CONTROL register. */
+ " bic r0, #1 \n"/* Clear the bit 0. */
+ " msr control, r0 \n"/* Write back the new CONTROL value. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vResetPrivilege( void ) /* __attribute__ (( naked )) */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, control \n"/* r0 = CONTROL. */
+ " orr r0, #1 \n"/* r0 = r0 | 1. */
+ " msr control, r0 \n"/* CONTROL = r0. */
+ " bx lr \n"/* Return to the caller. */
+ ::: "r0", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vStartFirstTask( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " ldr r0, xVTORConst \n"/* Use the NVIC offset register to locate the stack. */
+ " ldr r0, [r0] \n"/* Read the VTOR register which gives the address of vector table. */
+ " ldr r0, [r0] \n"/* The first entry in vector table is stack pointer. */
+ " msr msp, r0 \n"/* Set the MSP back to the start of the stack. */
+ " cpsie i \n"/* Globally enable interrupts. */
+ " cpsie f \n"
+ " dsb \n"
+ " isb \n"
+ " svc %0 \n"/* System call to start the first task. */
+ " nop \n"
+ " \n"
+ " .align 4 \n"
+ "xVTORConst: .word 0xe000ed08 \n"
+ ::"i" ( portSVC_START_SCHEDULER ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, basepri \n"/* r0 = basepri. Return original basepri value. */
+ " mov r1, %0 \n"/* r1 = configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " msr basepri, r1 \n"/* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " dsb \n"
+ " isb \n"
+ " bx lr \n"/* Return. */
+ ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " msr basepri, r0 \n"/* basepri = ulMask. */
+ " dsb \n"
+ " isb \n"
+ " bx lr \n"/* Return. */
+ ::: "memory"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void PendSV_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r0, psp \n"/* Read PSP in r0. */
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ " tst lr, #0x10 \n"/* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ " it eq \n"
+ " vstmdbeq r0!, {s16-s31} \n"/* Store the additional FP context registers which are not saved automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ #if ( configENABLE_MPU == 1 )
+ " mrs r1, psplim \n"/* r1 = PSPLIM. */
+ " mrs r2, control \n"/* r2 = CONTROL. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmdb r0!, {r1-r11} \n"/* Store on the stack - PSPLIM, CONTROL, LR and registers that are not automatically saved. */
+ #else /* configENABLE_MPU */
+ " mrs r2, psplim \n"/* r2 = PSPLIM. */
+ " mov r3, lr \n"/* r3 = LR/EXC_RETURN. */
+ " stmdb r0!, {r2-r11} \n"/* Store on the stack - PSPLIM, LR and registers that are not automatically saved. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " ldr r2, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ " str r0, [r1] \n"/* Save the new top of stack in TCB. */
+ " \n"
+ " mov r0, %0 \n"/* r0 = configMAX_SYSCALL_INTERRUPT_PRIORITY */
+ " msr basepri, r0 \n"/* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ " dsb \n"
+ " isb \n"
+ " bl vTaskSwitchContext \n"
+ " mov r0, #0 \n"/* r0 = 0. */
+ " msr basepri, r0 \n"/* Enable interrupts. */
+ " \n"
+ " ldr r2, pxCurrentTCBConst \n"/* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ " ldr r1, [r2] \n"/* Read pxCurrentTCB. */
+ " ldr r0, [r1] \n"/* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " dmb \n"/* Complete outstanding transfers before disabling MPU. */
+ " ldr r2, xMPUCTRLConst \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " bic r4, #1 \n"/* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ " str r4, [r2] \n"/* Disable MPU. */
+ " \n"
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ " ldr r3, [r1] \n"/* r3 = *r1 i.e. r3 = MAIR0. */
+ " ldr r2, xMAIR0Const \n"/* r2 = 0xe000edc0 [Location of MAIR0]. */
+ " str r3, [r2] \n"/* Program MAIR0. */
+ " ldr r2, xRNRConst \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #4 \n"/* r3 = 4. */
+ " str r3, [r2] \n"/* Program RNR = 4. */
+ " adds r1, #4 \n"/* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ " ldr r2, xRBARConst \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " \n"
+ #if ( configTOTAL_MPU_REGIONS == 16 )
+ " ldr r2, xRNRConst \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #8 \n"/* r3 = 8. */
+ " str r3, [r2] \n"/* Program RNR = 8. */
+ " ldr r2, xRBARConst \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ " ldr r2, xRNRConst \n"/* r2 = 0xe000ed98 [Location of RNR]. */
+ " movs r3, #12 \n"/* r3 = 12. */
+ " str r3, [r2] \n"/* Program RNR = 12. */
+ " ldr r2, xRBARConst \n"/* r2 = 0xe000ed9c [Location of RBAR]. */
+ " ldmia r1!, {r4-r11} \n"/* Read 4 sets of RBAR/RLAR registers from TCB. */
+ " stmia r2!, {r4-r11} \n"/* Write 4 set of RBAR/RLAR registers using alias registers. */
+ #endif /* configTOTAL_MPU_REGIONS == 16 */
+ " \n"
+ " ldr r2, xMPUCTRLConst \n"/* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ " ldr r4, [r2] \n"/* Read the value of MPU_CTRL. */
+ " orr r4, #1 \n"/* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ " str r4, [r2] \n"/* Enable MPU. */
+ " dsb \n"/* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldmia r0!, {r1-r11} \n"/* Read from stack - r1 = PSPLIM, r2 = CONTROL, r3 = LR and r4-r11 restored. */
+ #else /* configENABLE_MPU */
+ " ldmia r0!, {r2-r11} \n"/* Read from stack - r2 = PSPLIM, r3 = LR and r4-r11 restored. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ " tst r3, #0x10 \n"/* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ " it eq \n"
+ " vldmiaeq r0!, {s16-s31} \n"/* Restore the additional FP context registers which are not restored automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " msr psplim, r1 \n"/* Restore the PSPLIM register value for the task. */
+ " msr control, r2 \n"/* Restore the CONTROL register value for the task. */
+ #else /* configENABLE_MPU */
+ " msr psplim, r2 \n"/* Restore the PSPLIM register value for the task. */
+ #endif /* configENABLE_MPU */
+ " msr psp, r0 \n"/* Remember the new top of stack for the task. */
+ " bx r3 \n"
+ " \n"
+ " .align 4 \n"
+ "pxCurrentTCBConst: .word pxCurrentTCB \n"
+ #if ( configENABLE_MPU == 1 )
+ "xMPUCTRLConst: .word 0xe000ed94 \n"
+ "xMAIR0Const: .word 0xe000edc0 \n"
+ "xRNRConst: .word 0xe000ed98 \n"
+ "xRBARConst: .word 0xe000ed9c \n"
+ #endif /* configENABLE_MPU */
+ ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SVC_Handler( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
+{
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " tst lr, #4 \n"
+ " ite eq \n"
+ " mrseq r0, msp \n"
+ " mrsne r0, psp \n"
+ " ldr r1, svchandler_address_const \n"
+ " bx r1 \n"
+ " \n"
+ " .align 4 \n"
+ "svchandler_address_const: .word vPortSVCHandler_C \n"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h
new file mode 100644
index 0000000..1f3d964
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h
@@ -0,0 +1,66 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M33"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM55/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM55/portmacro.h
new file mode 100644
index 0000000..26577dd
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM55/portmacro.h
@@ -0,0 +1,71 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+#ifndef configENABLE_MVE
+ #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
+#endif /* configENABLE_MVE */
+/*-----------------------------------------------------------*/
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M55"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM85/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM85/portmacro.h
new file mode 100644
index 0000000..3795d32
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/GCC/ARM_CM85/portmacro.h
@@ -0,0 +1,71 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+#ifndef configENABLE_MVE
+ #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
+#endif /* configENABLE_MVE */
+/*-----------------------------------------------------------*/
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M85"
+#define portDONT_DISCARD __attribute__( ( used ) )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portasm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portasm.s
new file mode 100644
index 0000000..35d4795
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portasm.s
@@ -0,0 +1,391 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ EXTERN pxCurrentTCB
+ EXTERN xSecureContext
+ EXTERN vTaskSwitchContext
+ EXTERN vPortSVCHandler_C
+ EXTERN SecureContext_SaveContext
+ EXTERN SecureContext_LoadContext
+
+ PUBLIC xIsPrivileged
+ PUBLIC vResetPrivilege
+ PUBLIC vPortAllocateSecureContext
+ PUBLIC vRestoreContextOfFirstTask
+ PUBLIC vRaisePrivilege
+ PUBLIC vStartFirstTask
+ PUBLIC ulSetInterruptMask
+ PUBLIC vClearInterruptMask
+ PUBLIC PendSV_Handler
+ PUBLIC SVC_Handler
+ PUBLIC vPortFreeSecureContext
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+/*-----------------------------------------------------------*/
+
+/*---------------- Unprivileged Functions -------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+xIsPrivileged:
+ mrs r0, control /* r0 = CONTROL. */
+ movs r1, #1 /* r1 = 1. */
+ tst r0, r1 /* Perform r0 & r1 (bitwise AND) and update the conditions flag. */
+ beq running_privileged /* If the result of previous AND operation was 0, branch. */
+ movs r0, #0 /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ bx lr /* Return. */
+ running_privileged:
+ movs r0, #1 /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+vResetPrivilege:
+ mrs r0, control /* r0 = CONTROL. */
+ movs r1, #1 /* r1 = 1. */
+ orrs r0, r1 /* r0 = r0 | r1. */
+ msr control, r0 /* CONTROL = r0. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vPortAllocateSecureContext:
+ svc 0 /* Secure context is allocated in the supervisor call. portSVC_ALLOCATE_SECURE_CONTEXT = 0. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+/*----------------- Privileged Functions --------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION privileged_functions:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+vRestoreContextOfFirstTask:
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r3, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r3] /* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ movs r5, #1 /* r5 = 1. */
+ bics r4, r5 /* r4 = r4 & ~r5 i.e. Clear the bit 0 in r4. */
+ str r4, [r2] /* Disable MPU. */
+
+ adds r3, #4 /* r3 = r3 + 4. r3 now points to MAIR0 in TCB. */
+ ldr r4, [r3] /* r4 = *r3 i.e. r4 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ adds r3, #4 /* r3 = r3 + 4. r3 now points to first RBAR in TCB. */
+ movs r5, #4 /* r5 = 4. */
+ str r5, [r2] /* Program RNR = 4. */
+ ldmia r3!, {r6,r7} /* Read first set of RBAR/RLAR from TCB. */
+ ldr r4, =0xe000ed9c /* r4 = 0xe000ed9c [Location of RBAR]. */
+ stmia r4!, {r6,r7} /* Write first set of RBAR/RLAR registers. */
+ movs r5, #5 /* r5 = 5. */
+ str r5, [r2] /* Program RNR = 5. */
+ ldmia r3!, {r6,r7} /* Read second set of RBAR/RLAR from TCB. */
+ ldr r4, =0xe000ed9c /* r4 = 0xe000ed9c [Location of RBAR]. */
+ stmia r4!, {r6,r7} /* Write second set of RBAR/RLAR registers. */
+ movs r5, #6 /* r5 = 6. */
+ str r5, [r2] /* Program RNR = 6. */
+ ldmia r3!, {r6,r7} /* Read third set of RBAR/RLAR from TCB. */
+ ldr r4, =0xe000ed9c /* r4 = 0xe000ed9c [Location of RBAR]. */
+ stmia r4!, {r6,r7} /* Write third set of RBAR/RLAR registers. */
+ movs r5, #7 /* r5 = 7. */
+ str r5, [r2] /* Program RNR = 7. */
+ ldmia r3!, {r6,r7} /* Read fourth set of RBAR/RLAR from TCB. */
+ ldr r4, =0xe000ed9c /* r4 = 0xe000ed9c [Location of RBAR]. */
+ stmia r4!, {r6,r7} /* Write fourth set of RBAR/RLAR registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ movs r5, #1 /* r5 = 1. */
+ orrs r4, r5 /* r4 = r4 | r5 i.e. Set the bit 0 in r4. */
+ str r4, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ ldm r0!, {r1-r4} /* Read from stack - r1 = xSecureContext, r2 = PSPLIM, r3 = CONTROL and r4 = EXC_RETURN. */
+ ldr r5, =xSecureContext
+ str r1, [r5] /* Set xSecureContext to this task's value for the same. */
+ msr psplim, r2 /* Set this task's PSPLIM value. */
+ msr control, r3 /* Set this task's CONTROL value. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ bx r4 /* Finally, branch to EXC_RETURN. */
+#else /* configENABLE_MPU */
+ ldm r0!, {r1-r3} /* Read from stack - r1 = xSecureContext, r2 = PSPLIM and r3 = EXC_RETURN. */
+ ldr r4, =xSecureContext
+ str r1, [r4] /* Set xSecureContext to this task's value for the same. */
+ msr psplim, r2 /* Set this task's PSPLIM value. */
+ movs r1, #2 /* r1 = 2. */
+ msr CONTROL, r1 /* Switch to use PSP in the thread mode. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ bx r3 /* Finally, branch to EXC_RETURN. */
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+vRaisePrivilege:
+ mrs r0, control /* Read the CONTROL register. */
+ movs r1, #1 /* r1 = 1. */
+ bics r0, r1 /* Clear the bit 0. */
+ msr control, r0 /* Write back the new CONTROL value. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vStartFirstTask:
+ ldr r0, =0xe000ed08 /* Use the NVIC offset register to locate the stack. */
+ ldr r0, [r0] /* Read the VTOR register which gives the address of vector table. */
+ ldr r0, [r0] /* The first entry in vector table is stack pointer. */
+ msr msp, r0 /* Set the MSP back to the start of the stack. */
+ cpsie i /* Globally enable interrupts. */
+ dsb
+ isb
+ svc 2 /* System call to start the first task. portSVC_START_SCHEDULER = 2. */
+/*-----------------------------------------------------------*/
+
+ulSetInterruptMask:
+ mrs r0, PRIMASK
+ cpsid i
+ bx lr
+/*-----------------------------------------------------------*/
+
+vClearInterruptMask:
+ msr PRIMASK, r0
+ bx lr
+/*-----------------------------------------------------------*/
+
+PendSV_Handler:
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ ldr r0, [r3] /* Read xSecureContext - Value of xSecureContext must be in r0 as it is used as a parameter later. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB - Value of pxCurrentTCB must be in r1 as it is used as a parameter later. */
+ mrs r2, psp /* Read PSP in r2. */
+
+ cbz r0, save_ns_context /* No secure context to save. */
+ push {r0-r2, r14}
+ bl SecureContext_SaveContext /* Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r0-r3} /* LR is now in r3. */
+ mov lr, r3 /* LR = r3. */
+ lsls r1, r3, #25 /* r1 = r3 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl save_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+#if ( configENABLE_MPU == 1 )
+ subs r2, r2, #16 /* Make space for xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r3, control /* r3 = CONTROL. */
+ mov r4, lr /* r4 = LR/EXC_RETURN. */
+ stmia r2!, {r0, r1, r3, r4} /* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+#else /* configENABLE_MPU */
+ subs r2, r2, #12 /* Make space for xSecureContext, PSPLIM and LR on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmia r2!, {r0, r1, r3} /* Store xSecureContext, PSPLIM and LR on the stack. */
+#endif /* configENABLE_MPU */
+ b select_next_task
+
+ save_ns_context:
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ #if ( configENABLE_MPU == 1 )
+ subs r2, r2, #48 /* Make space for xSecureContext, PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ adds r2, r2, #16 /* r2 = r2 + 16. */
+ stmia r2!, {r4-r7} /* Store the low registers that are not saved automatically. */
+ mov r4, r8 /* r4 = r8. */
+ mov r5, r9 /* r5 = r9. */
+ mov r6, r10 /* r6 = r10. */
+ mov r7, r11 /* r7 = r11. */
+ stmia r2!, {r4-r7} /* Store the high registers that are not saved automatically. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r3, control /* r3 = CONTROL. */
+ mov r4, lr /* r4 = LR/EXC_RETURN. */
+ subs r2, r2, #48 /* r2 = r2 - 48. */
+ stmia r2!, {r0, r1, r3, r4} /* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ subs r2, r2, #44 /* Make space for xSecureContext, PSPLIM, LR and the remaining registers on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmia r2!, {r0, r1, r3-r7} /* Store xSecureContext, PSPLIM, LR and the low registers that are not saved automatically. */
+ mov r4, r8 /* r4 = r8. */
+ mov r5, r9 /* r5 = r9. */
+ mov r6, r10 /* r6 = r10. */
+ mov r7, r11 /* r7 = r11. */
+ stmia r2!, {r4-r7} /* Store the high registers that are not saved automatically. */
+ #endif /* configENABLE_MPU */
+
+ select_next_task:
+ cpsid i
+ bl vTaskSwitchContext
+ cpsie i
+
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ ldr r2, [r1] /* The first item in pxCurrentTCB is the task top of stack. r2 now points to the top of stack. */
+
+ #if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r3, =0xe000ed94 /* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r3] /* Read the value of MPU_CTRL. */
+ movs r5, #1 /* r5 = 1. */
+ bics r4, r5 /* r4 = r4 & ~r5 i.e. Clear the bit 0 in r4. */
+ str r4, [r3] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r4, [r1] /* r4 = *r1 i.e. r4 = MAIR0. */
+ ldr r3, =0xe000edc0 /* r3 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r3] /* Program MAIR0. */
+ ldr r4, =0xe000ed98 /* r4 = 0xe000ed98 [Location of RNR]. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ movs r5, #4 /* r5 = 4. */
+ str r5, [r4] /* Program RNR = 4. */
+ ldmia r1!, {r6,r7} /* Read first set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r6,r7} /* Write first set of RBAR/RLAR registers. */
+ movs r5, #5 /* r5 = 5. */
+ str r5, [r4] /* Program RNR = 5. */
+ ldmia r1!, {r6,r7} /* Read second set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r6,r7} /* Write second set of RBAR/RLAR registers. */
+ movs r5, #6 /* r5 = 6. */
+ str r5, [r4] /* Program RNR = 6. */
+ ldmia r1!, {r6,r7} /* Read third set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r6,r7} /* Write third set of RBAR/RLAR registers. */
+ movs r5, #7 /* r5 = 7. */
+ str r5, [r4] /* Program RNR = 7. */
+ ldmia r1!, {r6,r7} /* Read fourth set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r6,r7} /* Write fourth set of RBAR/RLAR registers. */
+
+ ldr r3, =0xe000ed94 /* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r3] /* Read the value of MPU_CTRL. */
+ movs r5, #1 /* r5 = 1. */
+ orrs r4, r5 /* r4 = r4 | r5 i.e. Set the bit 0 in r4. */
+ str r4, [r3] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+
+ #if ( configENABLE_MPU == 1 )
+ ldmia r2!, {r0, r1, r3, r4} /* Read from stack - r0 = xSecureContext, r1 = PSPLIM, r3 = CONTROL and r4 = LR. */
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ msr control, r3 /* Restore the CONTROL register value for the task. */
+ mov lr, r4 /* LR = r4. */
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ str r0, [r3] /* Restore the task's xSecureContext. */
+ cbz r0, restore_ns_context /* If there is no secure context for the task, restore the non-secure context. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ push {r2, r4}
+ bl SecureContext_LoadContext /* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r2, r4}
+ mov lr, r4 /* LR = r4. */
+ lsls r1, r4, #25 /* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl restore_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ bx lr
+ #else /* configENABLE_MPU */
+ ldmia r2!, {r0, r1, r4} /* Read from stack - r0 = xSecureContext, r1 = PSPLIM and r4 = LR. */
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ mov lr, r4 /* LR = r4. */
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ str r0, [r3] /* Restore the task's xSecureContext. */
+ cbz r0, restore_ns_context /* If there is no secure context for the task, restore the non-secure context. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ push {r2, r4}
+ bl SecureContext_LoadContext /* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r2, r4}
+ mov lr, r4 /* LR = r4. */
+ lsls r1, r4, #25 /* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl restore_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ bx lr
+ #endif /* configENABLE_MPU */
+
+ restore_ns_context:
+ adds r2, r2, #16 /* Move to the high registers. */
+ ldmia r2!, {r4-r7} /* Restore the high registers that are not automatically restored. */
+ mov r8, r4 /* r8 = r4. */
+ mov r9, r5 /* r9 = r5. */
+ mov r10, r6 /* r10 = r6. */
+ mov r11, r7 /* r11 = r7. */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ subs r2, r2, #32 /* Go back to the low registers. */
+ ldmia r2!, {r4-r7} /* Restore the low registers that are not automatically restored. */
+ bx lr
+/*-----------------------------------------------------------*/
+
+SVC_Handler:
+ movs r0, #4
+ mov r1, lr
+ tst r0, r1
+ beq stacking_used_msp
+ mrs r0, psp
+ b vPortSVCHandler_C
+ stacking_used_msp:
+ mrs r0, msp
+ b vPortSVCHandler_C
+/*-----------------------------------------------------------*/
+
+vPortFreeSecureContext:
+ ldr r2, [r0] /* The first item in the TCB is the top of the stack. */
+ ldr r1, [r2] /* The first item on the stack is the task's xSecureContext. */
+ cmp r1, #0 /* Raise svc if task's xSecureContext is not NULL. */
+ bne free_secure_context /* Branch if r1 != 0. */
+ bx lr /* There is no secure context (xSecureContext is NULL). */
+ free_secure_context:
+ svc 1 /* Secure context is freed in the supervisor call. portSVC_FREE_SECURE_CONTEXT = 1. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h
new file mode 100644
index 0000000..a8e2c6a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h
@@ -0,0 +1,78 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M23"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" )
+#define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portasm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portasm.s
new file mode 100644
index 0000000..e6e1251
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portasm.s
@@ -0,0 +1,310 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ EXTERN pxCurrentTCB
+ EXTERN vTaskSwitchContext
+ EXTERN vPortSVCHandler_C
+
+ PUBLIC xIsPrivileged
+ PUBLIC vResetPrivilege
+ PUBLIC vRestoreContextOfFirstTask
+ PUBLIC vRaisePrivilege
+ PUBLIC vStartFirstTask
+ PUBLIC ulSetInterruptMask
+ PUBLIC vClearInterruptMask
+ PUBLIC PendSV_Handler
+ PUBLIC SVC_Handler
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+/*-----------------------------------------------------------*/
+
+/*---------------- Unprivileged Functions -------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+xIsPrivileged:
+ mrs r0, control /* r0 = CONTROL. */
+ movs r1, #1 /* r1 = 1. */
+ tst r0, r1 /* Perform r0 & r1 (bitwise AND) and update the conditions flag. */
+ beq running_privileged /* If the result of previous AND operation was 0, branch. */
+ movs r0, #0 /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ bx lr /* Return. */
+ running_privileged:
+ movs r0, #1 /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
+ bx lr /* Return. */
+
+/*-----------------------------------------------------------*/
+
+vResetPrivilege:
+ mrs r0, control /* r0 = CONTROL. */
+ movs r1, #1 /* r1 = 1. */
+ orrs r0, r1 /* r0 = r0 | r1. */
+ msr control, r0 /* CONTROL = r0. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+/*----------------- Privileged Functions --------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION privileged_functions:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+vRestoreContextOfFirstTask:
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r1] /* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r3, [r2] /* Read the value of MPU_CTRL. */
+ movs r4, #1 /* r4 = 1. */
+ bics r3, r4 /* r3 = r3 & ~r4 i.e. Clear the bit 0 in r3. */
+ str r3, [r2] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r4, [r1] /* r4 = *r1 i.e. r4 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ movs r4, #4 /* r4 = 4. */
+ str r4, [r2] /* Program RNR = 4. */
+ ldmia r1!, {r5,r6} /* Read first set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write first set of RBAR/RLAR registers. */
+ movs r4, #5 /* r4 = 5. */
+ str r4, [r2] /* Program RNR = 5. */
+ ldmia r1!, {r5,r6} /* Read second set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write second set of RBAR/RLAR registers. */
+ movs r4, #6 /* r4 = 6. */
+ str r4, [r2] /* Program RNR = 6. */
+ ldmia r1!, {r5,r6} /* Read third set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write third set of RBAR/RLAR registers. */
+ movs r4, #7 /* r4 = 7. */
+ str r4, [r2] /* Program RNR = 7. */
+ ldmia r1!, {r5,r6} /* Read fourth set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write fourth set of RBAR/RLAR registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r3, [r2] /* Read the value of MPU_CTRL. */
+ movs r4, #1 /* r4 = 1. */
+ orrs r3, r4 /* r3 = r3 | r4 i.e. Set the bit 0 in r3. */
+ str r3, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ ldm r0!, {r1-r3} /* Read from stack - r1 = PSPLIM, r2 = CONTROL and r3 = EXC_RETURN. */
+ msr psplim, r1 /* Set this task's PSPLIM value. */
+ msr control, r2 /* Set this task's CONTROL value. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ bx r3 /* Finally, branch to EXC_RETURN. */
+#else /* configENABLE_MPU */
+ ldm r0!, {r1-r2} /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
+ msr psplim, r1 /* Set this task's PSPLIM value. */
+ movs r1, #2 /* r1 = 2. */
+ msr CONTROL, r1 /* Switch to use PSP in the thread mode. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ bx r2 /* Finally, branch to EXC_RETURN. */
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+vRaisePrivilege:
+ mrs r0, control /* Read the CONTROL register. */
+ movs r1, #1 /* r1 = 1. */
+ bics r0, r1 /* Clear the bit 0. */
+ msr control, r0 /* Write back the new CONTROL value. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vStartFirstTask:
+ ldr r0, =0xe000ed08 /* Use the NVIC offset register to locate the stack. */
+ ldr r0, [r0] /* Read the VTOR register which gives the address of vector table. */
+ ldr r0, [r0] /* The first entry in vector table is stack pointer. */
+ msr msp, r0 /* Set the MSP back to the start of the stack. */
+ cpsie i /* Globally enable interrupts. */
+ dsb
+ isb
+ svc 2 /* System call to start the first task. portSVC_START_SCHEDULER = 2. */
+ nop
+/*-----------------------------------------------------------*/
+
+ulSetInterruptMask:
+ mrs r0, PRIMASK
+ cpsid i
+ bx lr
+/*-----------------------------------------------------------*/
+
+vClearInterruptMask:
+ msr PRIMASK, r0
+ bx lr
+/*-----------------------------------------------------------*/
+
+PendSV_Handler:
+ mrs r0, psp /* Read PSP in r0. */
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+#if ( configENABLE_MPU == 1 )
+ subs r0, r0, #44 /* Make space for PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ str r0, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r2, control /* r2 = CONTROL. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmia r0!, {r1-r7} /* Store on the stack - PSPLIM, CONTROL, LR and low registers that are not automatically saved. */
+ mov r4, r8 /* r4 = r8. */
+ mov r5, r9 /* r5 = r9. */
+ mov r6, r10 /* r6 = r10. */
+ mov r7, r11 /* r7 = r11. */
+ stmia r0!, {r4-r7} /* Store the high registers that are not saved automatically. */
+#else /* configENABLE_MPU */
+ subs r0, r0, #40 /* Make space for PSPLIM, LR and the remaining registers on the stack. */
+ str r0, [r1] /* Save the new top of stack in TCB. */
+ mrs r2, psplim /* r2 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmia r0!, {r2-r7} /* Store on the stack - PSPLIM, LR and low registers that are not automatically saved. */
+ mov r4, r8 /* r4 = r8. */
+ mov r5, r9 /* r5 = r9. */
+ mov r6, r10 /* r6 = r10. */
+ mov r7, r11 /* r7 = r11. */
+ stmia r0!, {r4-r7} /* Store the high registers that are not saved automatically. */
+#endif /* configENABLE_MPU */
+
+ cpsid i
+ bl vTaskSwitchContext
+ cpsie i
+
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r1] /* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r3, [r2] /* Read the value of MPU_CTRL. */
+ movs r4, #1 /* r4 = 1. */
+ bics r3, r4 /* r3 = r3 & ~r4 i.e. Clear the bit 0 in r3. */
+ str r3, [r2] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r4, [r1] /* r4 = *r1 i.e. r4 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ movs r4, #4 /* r4 = 4. */
+ str r4, [r2] /* Program RNR = 4. */
+ ldmia r1!, {r5,r6} /* Read first set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write first set of RBAR/RLAR registers. */
+ movs r4, #5 /* r4 = 5. */
+ str r4, [r2] /* Program RNR = 5. */
+ ldmia r1!, {r5,r6} /* Read second set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write second set of RBAR/RLAR registers. */
+ movs r4, #6 /* r4 = 6. */
+ str r4, [r2] /* Program RNR = 6. */
+ ldmia r1!, {r5,r6} /* Read third set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write third set of RBAR/RLAR registers. */
+ movs r4, #7 /* r4 = 7. */
+ str r4, [r2] /* Program RNR = 7. */
+ ldmia r1!, {r5,r6} /* Read fourth set of RBAR/RLAR from TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ stmia r3!, {r5,r6} /* Write fourth set of RBAR/RLAR registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r3, [r2] /* Read the value of MPU_CTRL. */
+ movs r4, #1 /* r4 = 1. */
+ orrs r3, r4 /* r3 = r3 | r4 i.e. Set the bit 0 in r3. */
+ str r3, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ adds r0, r0, #28 /* Move to the high registers. */
+ ldmia r0!, {r4-r7} /* Restore the high registers that are not automatically restored. */
+ mov r8, r4 /* r8 = r4. */
+ mov r9, r5 /* r9 = r5. */
+ mov r10, r6 /* r10 = r6. */
+ mov r11, r7 /* r11 = r7. */
+ msr psp, r0 /* Remember the new top of stack for the task. */
+ subs r0, r0, #44 /* Move to the starting of the saved context. */
+ ldmia r0!, {r1-r7} /* Read from stack - r1 = PSPLIM, r2 = CONTROL, r3 = LR and r4-r7 restored. */
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ msr control, r2 /* Restore the CONTROL register value for the task. */
+ bx r3
+#else /* configENABLE_MPU */
+ adds r0, r0, #24 /* Move to the high registers. */
+ ldmia r0!, {r4-r7} /* Restore the high registers that are not automatically restored. */
+ mov r8, r4 /* r8 = r4. */
+ mov r9, r5 /* r9 = r5. */
+ mov r10, r6 /* r10 = r6. */
+ mov r11, r7 /* r11 = r7. */
+ msr psp, r0 /* Remember the new top of stack for the task. */
+ subs r0, r0, #40 /* Move to the starting of the saved context. */
+ ldmia r0!, {r2-r7} /* Read from stack - r2 = PSPLIM, r3 = LR and r4-r7 restored. */
+ msr psplim, r2 /* Restore the PSPLIM register value for the task. */
+ bx r3
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+SVC_Handler:
+ movs r0, #4
+ mov r1, lr
+ tst r0, r1
+ beq stacking_used_msp
+ mrs r0, psp
+ b vPortSVCHandler_C
+ stacking_used_msp:
+ mrs r0, msp
+ b vPortSVCHandler_C
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h
new file mode 100644
index 0000000..a8e2c6a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h
@@ -0,0 +1,78 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M23"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" )
+#define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s
new file mode 100644
index 0000000..2267aa7
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s
@@ -0,0 +1,353 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ EXTERN pxCurrentTCB
+ EXTERN xSecureContext
+ EXTERN vTaskSwitchContext
+ EXTERN vPortSVCHandler_C
+ EXTERN SecureContext_SaveContext
+ EXTERN SecureContext_LoadContext
+
+ PUBLIC xIsPrivileged
+ PUBLIC vResetPrivilege
+ PUBLIC vPortAllocateSecureContext
+ PUBLIC vRestoreContextOfFirstTask
+ PUBLIC vRaisePrivilege
+ PUBLIC vStartFirstTask
+ PUBLIC ulSetInterruptMask
+ PUBLIC vClearInterruptMask
+ PUBLIC PendSV_Handler
+ PUBLIC SVC_Handler
+ PUBLIC vPortFreeSecureContext
+/*-----------------------------------------------------------*/
+
+/*---------------- Unprivileged Functions -------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+xIsPrivileged:
+ mrs r0, control /* r0 = CONTROL. */
+ tst r0, #1 /* Perform r0 & 1 (bitwise AND) and update the conditions flag. */
+ ite ne
+ movne r0, #0 /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ moveq r0, #1 /* CONTROL[0]==0. Return true to indicate that the processor is not privileged. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+vResetPrivilege:
+ mrs r0, control /* r0 = CONTROL. */
+ orr r0, r0, #1 /* r0 = r0 | 1. */
+ msr control, r0 /* CONTROL = r0. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vPortAllocateSecureContext:
+ svc 0 /* Secure context is allocated in the supervisor call. portSVC_ALLOCATE_SECURE_CONTEXT = 0. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+/*----------------- Privileged Functions --------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION privileged_functions:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+vRestoreContextOfFirstTask:
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r3, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r3] /* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ str r4, [r2] /* Disable MPU. */
+
+ adds r3, #4 /* r3 = r3 + 4. r3 now points to MAIR0 in TCB. */
+ ldr r4, [r3] /* r4 = *r3 i.e. r4 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ movs r4, #4 /* r4 = 4. */
+ str r4, [r2] /* Program RNR = 4. */
+ adds r3, #4 /* r3 = r3 + 4. r3 now points to first RBAR in TCB. */
+ ldr r2, =0xe000ed9c /* r2 = 0xe000ed9c [Location of RBAR]. */
+ ldmia r3!, {r4-r11} /* Read 4 set of RBAR/RLAR registers from TCB. */
+ stmia r2!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ str r4, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ ldm r0!, {r1-r4} /* Read from stack - r1 = xSecureContext, r2 = PSPLIM, r3 = CONTROL and r4 = EXC_RETURN. */
+ ldr r5, =xSecureContext
+ str r1, [r5] /* Set xSecureContext to this task's value for the same. */
+ msr psplim, r2 /* Set this task's PSPLIM value. */
+ msr control, r3 /* Set this task's CONTROL value. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ mov r0, #0
+ msr basepri, r0 /* Ensure that interrupts are enabled when the first task starts. */
+ bx r4 /* Finally, branch to EXC_RETURN. */
+#else /* configENABLE_MPU */
+ ldm r0!, {r1-r3} /* Read from stack - r1 = xSecureContext, r2 = PSPLIM and r3 = EXC_RETURN. */
+ ldr r4, =xSecureContext
+ str r1, [r4] /* Set xSecureContext to this task's value for the same. */
+ msr psplim, r2 /* Set this task's PSPLIM value. */
+ movs r1, #2 /* r1 = 2. */
+ msr CONTROL, r1 /* Switch to use PSP in the thread mode. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ mov r0, #0
+ msr basepri, r0 /* Ensure that interrupts are enabled when the first task starts. */
+ bx r3 /* Finally, branch to EXC_RETURN. */
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+vRaisePrivilege:
+ mrs r0, control /* Read the CONTROL register. */
+ bic r0, r0, #1 /* Clear the bit 0. */
+ msr control, r0 /* Write back the new CONTROL value. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vStartFirstTask:
+ ldr r0, =0xe000ed08 /* Use the NVIC offset register to locate the stack. */
+ ldr r0, [r0] /* Read the VTOR register which gives the address of vector table. */
+ ldr r0, [r0] /* The first entry in vector table is stack pointer. */
+ msr msp, r0 /* Set the MSP back to the start of the stack. */
+ cpsie i /* Globally enable interrupts. */
+ cpsie f
+ dsb
+ isb
+ svc 2 /* System call to start the first task. portSVC_START_SCHEDULER = 2. */
+/*-----------------------------------------------------------*/
+
+ulSetInterruptMask:
+ mrs r0, basepri /* r0 = basepri. Return original basepri value. */
+ mov r1, #configMAX_SYSCALL_INTERRUPT_PRIORITY
+ msr basepri, r1 /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ dsb
+ isb
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+vClearInterruptMask:
+ msr basepri, r0 /* basepri = ulMask. */
+ dsb
+ isb
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+PendSV_Handler:
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ ldr r0, [r3] /* Read xSecureContext - Value of xSecureContext must be in r0 as it is used as a parameter later. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB - Value of pxCurrentTCB must be in r1 as it is used as a parameter later. */
+ mrs r2, psp /* Read PSP in r2. */
+
+ cbz r0, save_ns_context /* No secure context to save. */
+ push {r0-r2, r14}
+ bl SecureContext_SaveContext /* Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r0-r3} /* LR is now in r3. */
+ mov lr, r3 /* LR = r3. */
+ lsls r1, r3, #25 /* r1 = r3 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl save_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+#if ( configENABLE_MPU == 1 )
+ subs r2, r2, #16 /* Make space for xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r3, control /* r3 = CONTROL. */
+ mov r4, lr /* r4 = LR/EXC_RETURN. */
+ stmia r2!, {r0, r1, r3, r4} /* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+#else /* configENABLE_MPU */
+ subs r2, r2, #12 /* Make space for xSecureContext, PSPLIM and LR on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmia r2!, {r0, r1, r3} /* Store xSecureContext, PSPLIM and LR on the stack. */
+#endif /* configENABLE_MPU */
+ b select_next_task
+
+ save_ns_context:
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ tst lr, #0x10 /* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ it eq
+ vstmdbeq r2!, {s16-s31} /* Store the additional FP context registers which are not saved automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ #if ( configENABLE_MPU == 1 )
+ subs r2, r2, #48 /* Make space for xSecureContext, PSPLIM, CONTROL, LR and the remaining registers on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ adds r2, r2, #16 /* r2 = r2 + 16. */
+ stm r2, {r4-r11} /* Store the registers that are not saved automatically. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r3, control /* r3 = CONTROL. */
+ mov r4, lr /* r4 = LR/EXC_RETURN. */
+ subs r2, r2, #16 /* r2 = r2 - 16. */
+ stmia r2!, {r0, r1, r3, r4} /* Store xSecureContext, PSPLIM, CONTROL and LR on the stack. */
+ #else /* configENABLE_MPU */
+ subs r2, r2, #44 /* Make space for xSecureContext, PSPLIM, LR and the remaining registers on the stack. */
+ str r2, [r1] /* Save the new top of stack in TCB. */
+ adds r2, r2, #12 /* r2 = r2 + 12. */
+ stm r2, {r4-r11} /* Store the registers that are not saved automatically. */
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ subs r2, r2, #12 /* r2 = r2 - 12. */
+ stmia r2!, {r0, r1, r3} /* Store xSecureContext, PSPLIM and LR on the stack. */
+ #endif /* configENABLE_MPU */
+
+ select_next_task:
+ mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY
+ msr basepri, r0 /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ dsb
+ isb
+ bl vTaskSwitchContext
+ mov r0, #0 /* r0 = 0. */
+ msr basepri, r0 /* Enable interrupts. */
+
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ ldr r2, [r1] /* The first item in pxCurrentTCB is the task top of stack. r2 now points to the top of stack. */
+
+ #if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r3, =0xe000ed94 /* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r3] /* Read the value of MPU_CTRL. */
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ str r4, [r3] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r4, [r1] /* r4 = *r1 i.e. r4 = MAIR0. */
+ ldr r3, =0xe000edc0 /* r3 = 0xe000edc0 [Location of MAIR0]. */
+ str r4, [r3] /* Program MAIR0. */
+ ldr r3, =0xe000ed98 /* r3 = 0xe000ed98 [Location of RNR]. */
+ movs r4, #4 /* r4 = 4. */
+ str r4, [r3] /* Program RNR = 4. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ ldr r3, =0xe000ed9c /* r3 = 0xe000ed9c [Location of RBAR]. */
+ ldmia r1!, {r4-r11} /* Read 4 sets of RBAR/RLAR registers from TCB. */
+ stmia r3!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */
+
+ ldr r3, =0xe000ed94 /* r3 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r3] /* Read the value of MPU_CTRL. */
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ str r4, [r3] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+ #endif /* configENABLE_MPU */
+
+ #if ( configENABLE_MPU == 1 )
+ ldmia r2!, {r0, r1, r3, r4} /* Read from stack - r0 = xSecureContext, r1 = PSPLIM, r3 = CONTROL and r4 = LR. */
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ msr control, r3 /* Restore the CONTROL register value for the task. */
+ mov lr, r4 /* LR = r4. */
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ str r0, [r3] /* Restore the task's xSecureContext. */
+ cbz r0, restore_ns_context /* If there is no secure context for the task, restore the non-secure context. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ push {r2, r4}
+ bl SecureContext_LoadContext /* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r2, r4}
+ mov lr, r4 /* LR = r4. */
+ lsls r1, r4, #25 /* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl restore_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ bx lr
+ #else /* configENABLE_MPU */
+ ldmia r2!, {r0, r1, r4} /* Read from stack - r0 = xSecureContext, r1 = PSPLIM and r4 = LR. */
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ mov lr, r4 /* LR = r4. */
+ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */
+ str r0, [r3] /* Restore the task's xSecureContext. */
+ cbz r0, restore_ns_context /* If there is no secure context for the task, restore the non-secure context. */
+ ldr r3, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r3] /* Read pxCurrentTCB. */
+ push {r2, r4}
+ bl SecureContext_LoadContext /* Restore the secure context. Params are in r0 and r1. r0 = xSecureContext and r1 = pxCurrentTCB. */
+ pop {r2, r4}
+ mov lr, r4 /* LR = r4. */
+ lsls r1, r4, #25 /* r1 = r4 << 25. Bit[6] of EXC_RETURN is 1 if secure stack was used, 0 if non-secure stack was used to store stack frame. */
+ bpl restore_ns_context /* bpl - branch if positive or zero. If r1 >= 0 ==> Bit[6] in EXC_RETURN is 0 i.e. non-secure stack was used. */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ bx lr
+ #endif /* configENABLE_MPU */
+
+ restore_ns_context:
+ ldmia r2!, {r4-r11} /* Restore the registers that are not automatically restored. */
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ tst lr, #0x10 /* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ it eq
+ vldmiaeq r2!, {s16-s31} /* Restore the additional FP context registers which are not restored automatically. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ msr psp, r2 /* Remember the new top of stack for the task. */
+ bx lr
+/*-----------------------------------------------------------*/
+
+SVC_Handler:
+ tst lr, #4
+ ite eq
+ mrseq r0, msp
+ mrsne r0, psp
+ b vPortSVCHandler_C
+/*-----------------------------------------------------------*/
+
+vPortFreeSecureContext:
+ /* r0 = uint32_t *pulTCB. */
+ ldr r2, [r0] /* The first item in the TCB is the top of the stack. */
+ ldr r1, [r2] /* The first item on the stack is the task's xSecureContext. */
+ cmp r1, #0 /* Raise svc if task's xSecureContext is not NULL. */
+ it ne
+ svcne 1 /* Secure context is freed in the supervisor call. portSVC_FREE_SECURE_CONTEXT = 1. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h
new file mode 100644
index 0000000..aaefff6
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h
@@ -0,0 +1,78 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M33"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portasm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portasm.s
new file mode 100644
index 0000000..c4efd3c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portasm.s
@@ -0,0 +1,262 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ EXTERN pxCurrentTCB
+ EXTERN vTaskSwitchContext
+ EXTERN vPortSVCHandler_C
+
+ PUBLIC xIsPrivileged
+ PUBLIC vResetPrivilege
+ PUBLIC vRestoreContextOfFirstTask
+ PUBLIC vRaisePrivilege
+ PUBLIC vStartFirstTask
+ PUBLIC ulSetInterruptMask
+ PUBLIC vClearInterruptMask
+ PUBLIC PendSV_Handler
+ PUBLIC SVC_Handler
+/*-----------------------------------------------------------*/
+
+/*---------------- Unprivileged Functions -------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+xIsPrivileged:
+ mrs r0, control /* r0 = CONTROL. */
+ tst r0, #1 /* Perform r0 & 1 (bitwise AND) and update the conditions flag. */
+ ite ne
+ movne r0, #0 /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
+ moveq r0, #1 /* CONTROL[0]==0. Return true to indicate that the processor is not privileged. */
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+vResetPrivilege:
+ mrs r0, control /* r0 = CONTROL. */
+ orr r0, r0, #1 /* r0 = r0 | 1. */
+ msr control, r0 /* CONTROL = r0. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+/*----------------- Privileged Functions --------------------*/
+
+/*-----------------------------------------------------------*/
+
+ SECTION privileged_functions:CODE:NOROOT(2)
+ THUMB
+/*-----------------------------------------------------------*/
+
+vRestoreContextOfFirstTask:
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r1] /* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ str r4, [r2] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r3, [r1] /* r3 = *r1 i.e. r3 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r3, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ movs r3, #4 /* r3 = 4. */
+ str r3, [r2] /* Program RNR = 4. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ ldr r2, =0xe000ed9c /* r2 = 0xe000ed9c [Location of RBAR]. */
+ ldmia r1!, {r4-r11} /* Read 4 sets of RBAR/RLAR registers from TCB. */
+ stmia r2!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ str r4, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ ldm r0!, {r1-r3} /* Read from stack - r1 = PSPLIM, r2 = CONTROL and r3 = EXC_RETURN. */
+ msr psplim, r1 /* Set this task's PSPLIM value. */
+ msr control, r2 /* Set this task's CONTROL value. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ mov r0, #0
+ msr basepri, r0 /* Ensure that interrupts are enabled when the first task starts. */
+ bx r3 /* Finally, branch to EXC_RETURN. */
+#else /* configENABLE_MPU */
+ ldm r0!, {r1-r2} /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
+ msr psplim, r1 /* Set this task's PSPLIM value. */
+ movs r1, #2 /* r1 = 2. */
+ msr CONTROL, r1 /* Switch to use PSP in the thread mode. */
+ adds r0, #32 /* Discard everything up to r0. */
+ msr psp, r0 /* This is now the new top of stack to use in the task. */
+ isb
+ mov r0, #0
+ msr basepri, r0 /* Ensure that interrupts are enabled when the first task starts. */
+ bx r2 /* Finally, branch to EXC_RETURN. */
+#endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+vRaisePrivilege:
+ mrs r0, control /* Read the CONTROL register. */
+ bic r0, r0, #1 /* Clear the bit 0. */
+ msr control, r0 /* Write back the new CONTROL value. */
+ bx lr /* Return to the caller. */
+/*-----------------------------------------------------------*/
+
+vStartFirstTask:
+ ldr r0, =0xe000ed08 /* Use the NVIC offset register to locate the stack. */
+ ldr r0, [r0] /* Read the VTOR register which gives the address of vector table. */
+ ldr r0, [r0] /* The first entry in vector table is stack pointer. */
+ msr msp, r0 /* Set the MSP back to the start of the stack. */
+ cpsie i /* Globally enable interrupts. */
+ cpsie f
+ dsb
+ isb
+ svc 2 /* System call to start the first task. portSVC_START_SCHEDULER = 2. */
+/*-----------------------------------------------------------*/
+
+ulSetInterruptMask:
+ mrs r0, basepri /* r0 = basepri. Return original basepri value. */
+ mov r1, #configMAX_SYSCALL_INTERRUPT_PRIORITY
+ msr basepri, r1 /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ dsb
+ isb
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+vClearInterruptMask:
+ msr basepri, r0 /* basepri = ulMask. */
+ dsb
+ isb
+ bx lr /* Return. */
+/*-----------------------------------------------------------*/
+
+PendSV_Handler:
+ mrs r0, psp /* Read PSP in r0. */
+#if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ tst lr, #0x10 /* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ it eq
+ vstmdbeq r0!, {s16-s31} /* Store the additional FP context registers which are not saved automatically. */
+#endif /* configENABLE_FPU || configENABLE_MVE */
+#if ( configENABLE_MPU == 1 )
+ mrs r1, psplim /* r1 = PSPLIM. */
+ mrs r2, control /* r2 = CONTROL. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmdb r0!, {r1-r11} /* Store on the stack - PSPLIM, CONTROL, LR and registers that are not automatically saved. */
+#else /* configENABLE_MPU */
+ mrs r2, psplim /* r2 = PSPLIM. */
+ mov r3, lr /* r3 = LR/EXC_RETURN. */
+ stmdb r0!, {r2-r11} /* Store on the stack - PSPLIM, LR and registers that are not automatically. */
+#endif /* configENABLE_MPU */
+
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+ str r0, [r1] /* Save the new top of stack in TCB. */
+
+ mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY
+ msr basepri, r0 /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */
+ dsb
+ isb
+ bl vTaskSwitchContext
+ mov r0, #0 /* r0 = 0. */
+ msr basepri, r0 /* Enable interrupts. */
+
+ ldr r2, =pxCurrentTCB /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
+ ldr r1, [r2] /* Read pxCurrentTCB. */
+ ldr r0, [r1] /* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */
+
+#if ( configENABLE_MPU == 1 )
+ dmb /* Complete outstanding transfers before disabling MPU. */
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */
+ str r4, [r2] /* Disable MPU. */
+
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */
+ ldr r3, [r1] /* r3 = *r1 i.e. r3 = MAIR0. */
+ ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */
+ str r3, [r2] /* Program MAIR0. */
+ ldr r2, =0xe000ed98 /* r2 = 0xe000ed98 [Location of RNR]. */
+ movs r3, #4 /* r3 = 4. */
+ str r3, [r2] /* Program RNR = 4. */
+ adds r1, #4 /* r1 = r1 + 4. r1 now points to first RBAR in TCB. */
+ ldr r2, =0xe000ed9c /* r2 = 0xe000ed9c [Location of RBAR]. */
+ ldmia r1!, {r4-r11} /* Read 4 sets of RBAR/RLAR registers from TCB. */
+ stmia r2!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */
+
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */
+ str r4, [r2] /* Enable MPU. */
+ dsb /* Force memory writes before continuing. */
+#endif /* configENABLE_MPU */
+
+#if ( configENABLE_MPU == 1 )
+ ldmia r0!, {r1-r11} /* Read from stack - r1 = PSPLIM, r2 = CONTROL, r3 = LR and r4-r11 restored. */
+#else /* configENABLE_MPU */
+ ldmia r0!, {r2-r11} /* Read from stack - r2 = PSPLIM, r3 = LR and r4-r11 restored. */
+#endif /* configENABLE_MPU */
+
+#if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ tst r3, #0x10 /* Test Bit[4] in LR. Bit[4] of EXC_RETURN is 0 if the Extended Stack Frame is in use. */
+ it eq
+ vldmiaeq r0!, {s16-s31} /* Restore the additional FP context registers which are not restored automatically. */
+#endif /* configENABLE_FPU || configENABLE_MVE */
+
+ #if ( configENABLE_MPU == 1 )
+ msr psplim, r1 /* Restore the PSPLIM register value for the task. */
+ msr control, r2 /* Restore the CONTROL register value for the task. */
+#else /* configENABLE_MPU */
+ msr psplim, r2 /* Restore the PSPLIM register value for the task. */
+#endif /* configENABLE_MPU */
+ msr psp, r0 /* Remember the new top of stack for the task. */
+ bx r3
+/*-----------------------------------------------------------*/
+
+SVC_Handler:
+ tst lr, #4
+ ite eq
+ mrseq r0, msp
+ mrsne r0, psp
+ b vPortSVCHandler_C
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h
new file mode 100644
index 0000000..aaefff6
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h
@@ -0,0 +1,78 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M33"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM55/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM55/portmacro.h
new file mode 100644
index 0000000..a2ec280
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM55/portmacro.h
@@ -0,0 +1,83 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+#ifndef configENABLE_MVE
+ #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
+#endif /* configENABLE_MVE */
+/*-----------------------------------------------------------*/
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M55"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM85/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM85/portmacro.h
new file mode 100644
index 0000000..59fc09b
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portable/IAR/ARM_CM85/portmacro.h
@@ -0,0 +1,83 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include "portmacrocommon.h"
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+#ifndef configENABLE_MVE
+ #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
+#endif /* configENABLE_MVE */
+/*-----------------------------------------------------------*/
+
+/**
+ * Architecture specifics.
+ */
+#define portARCH_NAME "Cortex-M85"
+#define portDONT_DISCARD __root
+/*-----------------------------------------------------------*/
+
+#if( configTOTAL_MPU_REGIONS == 16 )
+ #error 16 MPU regions are not yet supported for this port.
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
+#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
+/*-----------------------------------------------------------*/
+
+/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
+ * the source code because to do so would cause other compilers to generate
+ * warnings. */
+#pragma diag_suppress=Be006
+#pragma diag_suppress=Pa082
+/*-----------------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portasm.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portasm.h
new file mode 100644
index 0000000..c3b2f2c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portasm.h
@@ -0,0 +1,114 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __PORT_ASM_H__
+#define __PORT_ASM_H__
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+
+/* MPU wrappers includes. */
+#include "mpu_wrappers.h"
+
+/**
+ * @brief Restore the context of the first task so that the first task starts
+ * executing.
+ */
+void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Checks whether or not the processor is privileged.
+ *
+ * @return 1 if the processor is already privileged, 0 otherwise.
+ */
+BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) );
+
+/**
+ * @brief Raises the privilege level by clearing the bit 0 of the CONTROL
+ * register.
+ *
+ * @note This is a privileged function and should only be called from the kenrel
+ * code.
+ *
+ * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.
+ * Bit[0] = 0 --> The processor is running privileged
+ * Bit[0] = 1 --> The processor is running unprivileged.
+ */
+void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Lowers the privilege level by setting the bit 0 of the CONTROL
+ * register.
+ *
+ * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.
+ * Bit[0] = 0 --> The processor is running privileged
+ * Bit[0] = 1 --> The processor is running unprivileged.
+ */
+void vResetPrivilege( void ) __attribute__( ( naked ) );
+
+/**
+ * @brief Starts the first task.
+ */
+void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Disables interrupts.
+ */
+uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Enables interrupts.
+ */
+void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief PendSV Exception handler.
+ */
+void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief SVC Handler.
+ */
+void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+/**
+ * @brief Allocate a Secure context for the calling task.
+ *
+ * @param[in] ulSecureStackSize The size of the stack to be allocated on the
+ * secure side for the calling task.
+ */
+void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) );
+
+/**
+ * @brief Free the task's secure context.
+ *
+ * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task.
+ */
+void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
+
+#endif /* __PORT_ASM_H__ */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portmacrocommon.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portmacrocommon.h
new file mode 100644
index 0000000..e68692a
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/non_secure/portmacrocommon.h
@@ -0,0 +1,311 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACROCOMMON_H
+ #define PORTMACROCOMMON_H
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+/*------------------------------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the given hardware
+ * and compiler.
+ *
+ * These settings should not be altered.
+ *------------------------------------------------------------------------------
+ */
+
+ #ifndef configENABLE_FPU
+ #error configENABLE_FPU must be defined in FreeRTOSConfig.h. Set configENABLE_FPU to 1 to enable the FPU or 0 to disable the FPU.
+ #endif /* configENABLE_FPU */
+
+ #ifndef configENABLE_MPU
+ #error configENABLE_MPU must be defined in FreeRTOSConfig.h. Set configENABLE_MPU to 1 to enable the MPU or 0 to disable the MPU.
+ #endif /* configENABLE_MPU */
+
+ #ifndef configENABLE_TRUSTZONE
+ #error configENABLE_TRUSTZONE must be defined in FreeRTOSConfig.h. Set configENABLE_TRUSTZONE to 1 to enable TrustZone or 0 to disable TrustZone.
+ #endif /* configENABLE_TRUSTZONE */
+
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Type definitions.
+ */
+ #define portCHAR char
+ #define portFLOAT float
+ #define portDOUBLE double
+ #define portLONG long
+ #define portSHORT short
+ #define portSTACK_TYPE uint32_t
+ #define portBASE_TYPE long
+
+ typedef portSTACK_TYPE StackType_t;
+ typedef long BaseType_t;
+ typedef unsigned long UBaseType_t;
+
+ #if ( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+ #else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+
+/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
+ * not need to be guarded with a critical section. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+ #endif
+/*-----------------------------------------------------------*/
+
+/**
+ * Architecture specifics.
+ */
+ #define portSTACK_GROWTH ( -1 )
+ #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+ #define portBYTE_ALIGNMENT 8
+ #define portNOP()
+ #define portINLINE __inline
+ #ifndef portFORCE_INLINE
+ #define portFORCE_INLINE inline __attribute__( ( always_inline ) )
+ #endif
+ #define portHAS_STACK_OVERFLOW_CHECKING 1
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Extern declarations.
+ */
+ extern BaseType_t xPortIsInsideInterrupt( void );
+
+ extern void vPortYield( void ) /* PRIVILEGED_FUNCTION */;
+
+ extern void vPortEnterCritical( void ) /* PRIVILEGED_FUNCTION */;
+ extern void vPortExitCritical( void ) /* PRIVILEGED_FUNCTION */;
+
+ extern uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */;
+ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */;
+
+ #if ( configENABLE_TRUSTZONE == 1 )
+ extern void vPortAllocateSecureContext( uint32_t ulSecureStackSize ); /* __attribute__ (( naked )) */
+ extern void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */;
+ #endif /* configENABLE_TRUSTZONE */
+
+ #if ( configENABLE_MPU == 1 )
+ extern BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */;
+ extern void vResetPrivilege( void ) /* __attribute__ (( naked )) */;
+ #endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief MPU specific constants.
+ */
+ #if ( configENABLE_MPU == 1 )
+ #define portUSING_MPU_WRAPPERS 1
+ #define portPRIVILEGE_BIT ( 0x80000000UL )
+ #else
+ #define portPRIVILEGE_BIT ( 0x0UL )
+ #endif /* configENABLE_MPU */
+
+/* MPU settings that can be overriden in FreeRTOSConfig.h. */
+#ifndef configTOTAL_MPU_REGIONS
+ /* Define to 8 for backward compatibility. */
+ #define configTOTAL_MPU_REGIONS ( 8UL )
+#endif
+
+/* MPU regions. */
+ #define portPRIVILEGED_FLASH_REGION ( 0UL )
+ #define portUNPRIVILEGED_FLASH_REGION ( 1UL )
+ #define portUNPRIVILEGED_SYSCALLS_REGION ( 2UL )
+ #define portPRIVILEGED_RAM_REGION ( 3UL )
+ #define portSTACK_REGION ( 4UL )
+ #define portFIRST_CONFIGURABLE_REGION ( 5UL )
+ #define portLAST_CONFIGURABLE_REGION ( configTOTAL_MPU_REGIONS - 1UL )
+ #define portNUM_CONFIGURABLE_REGIONS ( ( portLAST_CONFIGURABLE_REGION - portFIRST_CONFIGURABLE_REGION ) + 1 )
+ #define portTOTAL_NUM_REGIONS ( portNUM_CONFIGURABLE_REGIONS + 1 ) /* Plus one to make space for the stack region. */
+
+/* Device memory attributes used in MPU_MAIR registers.
+ *
+ * 8-bit values encoded as follows:
+ * Bit[7:4] - 0000 - Device Memory
+ * Bit[3:2] - 00 --> Device-nGnRnE
+ * 01 --> Device-nGnRE
+ * 10 --> Device-nGRE
+ * 11 --> Device-GRE
+ * Bit[1:0] - 00, Reserved.
+ */
+ #define portMPU_DEVICE_MEMORY_nGnRnE ( 0x00 ) /* 0000 0000 */
+ #define portMPU_DEVICE_MEMORY_nGnRE ( 0x04 ) /* 0000 0100 */
+ #define portMPU_DEVICE_MEMORY_nGRE ( 0x08 ) /* 0000 1000 */
+ #define portMPU_DEVICE_MEMORY_GRE ( 0x0C ) /* 0000 1100 */
+
+/* Normal memory attributes used in MPU_MAIR registers. */
+ #define portMPU_NORMAL_MEMORY_NON_CACHEABLE ( 0x44 ) /* Non-cacheable. */
+ #define portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE ( 0xFF ) /* Non-Transient, Write-back, Read-Allocate and Write-Allocate. */
+
+/* Attributes used in MPU_RBAR registers. */
+ #define portMPU_REGION_NON_SHAREABLE ( 0UL << 3UL )
+ #define portMPU_REGION_INNER_SHAREABLE ( 1UL << 3UL )
+ #define portMPU_REGION_OUTER_SHAREABLE ( 2UL << 3UL )
+
+ #define portMPU_REGION_PRIVILEGED_READ_WRITE ( 0UL << 1UL )
+ #define portMPU_REGION_READ_WRITE ( 1UL << 1UL )
+ #define portMPU_REGION_PRIVILEGED_READ_ONLY ( 2UL << 1UL )
+ #define portMPU_REGION_READ_ONLY ( 3UL << 1UL )
+
+ #define portMPU_REGION_EXECUTE_NEVER ( 1UL )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Settings to define an MPU region.
+ */
+ typedef struct MPURegionSettings
+ {
+ uint32_t ulRBAR; /**< RBAR for the region. */
+ uint32_t ulRLAR; /**< RLAR for the region. */
+ } MPURegionSettings_t;
+
+/**
+ * @brief MPU settings as stored in the TCB.
+ */
+ typedef struct MPU_SETTINGS
+ {
+ uint32_t ulMAIR0; /**< MAIR0 for the task containing attributes for all the 4 per task regions. */
+ MPURegionSettings_t xRegionsSettings[ portTOTAL_NUM_REGIONS ]; /**< Settings for 4 per task regions. */
+ } xMPU_SETTINGS;
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief SVC numbers.
+ */
+ #define portSVC_ALLOCATE_SECURE_CONTEXT 0
+ #define portSVC_FREE_SECURE_CONTEXT 1
+ #define portSVC_START_SCHEDULER 2
+ #define portSVC_RAISE_PRIVILEGE 3
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Scheduler utilities.
+ */
+ #define portYIELD() vPortYield()
+ #define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
+ #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
+ #define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; } while( 0 )
+ #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Critical section management.
+ */
+ #define portSET_INTERRUPT_MASK_FROM_ISR() ulSetInterruptMask()
+ #define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) vClearInterruptMask( x )
+ #define portENTER_CRITICAL() vPortEnterCritical()
+ #define portEXIT_CRITICAL() vPortExitCritical()
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Tickless idle/low power functionality.
+ */
+ #ifndef portSUPPRESS_TICKS_AND_SLEEP
+ extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
+ #endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Task function macros as described on the FreeRTOS.org WEB site.
+ */
+ #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
+ #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
+/*-----------------------------------------------------------*/
+
+ #if ( configENABLE_TRUSTZONE == 1 )
+
+/**
+ * @brief Allocate a secure context for the task.
+ *
+ * Tasks are not created with a secure context. Any task that is going to call
+ * secure functions must call portALLOCATE_SECURE_CONTEXT() to allocate itself a
+ * secure context before it calls any secure function.
+ *
+ * @param[in] ulSecureStackSize The size of the secure stack to be allocated.
+ */
+ #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) vPortAllocateSecureContext( ulSecureStackSize )
+
+/**
+ * @brief Called when a task is deleted to delete the task's secure context,
+ * if it has one.
+ *
+ * @param[in] pxTCB The TCB of the task being deleted.
+ */
+ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB )
+ #endif /* configENABLE_TRUSTZONE */
+/*-----------------------------------------------------------*/
+
+ #if ( configENABLE_MPU == 1 )
+
+/**
+ * @brief Checks whether or not the processor is privileged.
+ *
+ * @return 1 if the processor is already privileged, 0 otherwise.
+ */
+ #define portIS_PRIVILEGED() xIsPrivileged()
+
+/**
+ * @brief Raise an SVC request to raise privilege.
+ *
+ * The SVC handler checks that the SVC was raised from a system call and only
+ * then it raises the privilege. If this is called from any other place,
+ * the privilege is not raised.
+ */
+ #define portRAISE_PRIVILEGE() __asm volatile ( "svc %0 \n" ::"i" ( portSVC_RAISE_PRIVILEGE ) : "memory" );
+
+/**
+ * @brief Lowers the privilege level by setting the bit 0 of the CONTROL
+ * register.
+ */
+ #define portRESET_PRIVILEGE() vResetPrivilege()
+ #else
+ #define portIS_PRIVILEGED()
+ #define portRAISE_PRIVILEGE()
+ #define portRESET_PRIVILEGE()
+ #endif /* configENABLE_MPU */
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Barriers.
+ */
+ #define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" )
+/*-----------------------------------------------------------*/
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+#endif /* PORTMACROCOMMON_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/ReadMe.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/ReadMe.txt
new file mode 100644
index 0000000..68ff904
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/ReadMe.txt
@@ -0,0 +1,11 @@
+This directory tree contains the master copy of the FreeRTOS Armv8-M and
+Armv8.1-M ports.
+Do not use the files located here! These file are copied into separate
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to
+each FreeRTOS release.
+
+If your Armv8-M/Armv8.1-M application uses TrustZone then use the files from the
+FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
+
+If your Armv8-M/Armv8.1-M application does not use TrustZone then use the files from
+the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM23/secure_context_port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM23/secure_context_port.c
new file mode 100644
index 0000000..2d8b2af
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM23/secure_context_port.c
@@ -0,0 +1,99 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Secure context includes. */
+#include "secure_context.h"
+
+/* Secure port macros. */
+#include "secure_port_macros.h"
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+
+void SecureContext_LoadContextAsm( SecureContext_t * pxSecureContext ) __attribute__( ( naked ) );
+void SecureContext_SaveContextAsm( SecureContext_t * pxSecureContext ) __attribute__( ( naked ) );
+
+void SecureContext_LoadContextAsm( SecureContext_t * pxSecureContext )
+{
+ /* pxSecureContext value is in r0. */
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r1, ipsr \n" /* r1 = IPSR. */
+ " cbz r1, load_ctx_therad_mode \n" /* Do nothing if the processor is running in the Thread Mode. */
+ " ldmia r0!, {r1, r2} \n" /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldmia r1!, {r3} \n" /* Read CONTROL register value from task's stack. r3 = CONTROL. */
+ " msr control, r3 \n" /* CONTROL = r3. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " msr psplim, r2 \n" /* PSPLIM = r2. */
+ " msr psp, r1 \n" /* PSP = r1. */
+ " \n"
+ " load_ctx_therad_mode: \n"
+ " bx lr \n"
+ " \n"
+ ::: "r0", "r1", "r2"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SecureContext_SaveContextAsm( SecureContext_t * pxSecureContext )
+{
+ /* pxSecureContext value is in r0. */
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r1, ipsr \n" /* r1 = IPSR. */
+ " cbz r1, save_ctx_therad_mode \n" /* Do nothing if the processor is running in the Thread Mode. */
+ " mrs r1, psp \n" /* r1 = PSP. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " mrs r2, control \n" /* r2 = CONTROL. */
+ " subs r1, r1, #4 \n" /* Make space for the CONTROL value on the stack. */
+ " str r1, [r0] \n" /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+ " stmia r1!, {r2} \n" /* Store CONTROL value on the stack. */
+ #else /* configENABLE_MPU */
+ " str r1, [r0] \n" /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " movs r1, %0 \n" /* r1 = securecontextNO_STACK. */
+ " msr psplim, r1 \n" /* PSPLIM = securecontextNO_STACK. */
+ " msr psp, r1 \n" /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */
+ " \n"
+ " save_ctx_therad_mode: \n"
+ " bx lr \n"
+ " \n"
+ ::"i" ( securecontextNO_STACK ) : "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM33/secure_context_port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM33/secure_context_port.c
new file mode 100644
index 0000000..f35fae0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/GCC/ARM_CM33/secure_context_port.c
@@ -0,0 +1,97 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Secure context includes. */
+#include "secure_context.h"
+
+/* Secure port macros. */
+#include "secure_port_macros.h"
+
+void SecureContext_LoadContextAsm( SecureContext_t * pxSecureContext ) __attribute__( ( naked ) );
+void SecureContext_SaveContextAsm( SecureContext_t * pxSecureContext ) __attribute__( ( naked ) );
+
+void SecureContext_LoadContextAsm( SecureContext_t * pxSecureContext )
+{
+ /* pxSecureContext value is in r0. */
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r1, ipsr \n" /* r1 = IPSR. */
+ " cbz r1, load_ctx_therad_mode \n" /* Do nothing if the processor is running in the Thread Mode. */
+ " ldmia r0!, {r1, r2} \n" /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " ldmia r1!, {r3} \n" /* Read CONTROL register value from task's stack. r3 = CONTROL. */
+ " msr control, r3 \n" /* CONTROL = r3. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " msr psplim, r2 \n" /* PSPLIM = r2. */
+ " msr psp, r1 \n" /* PSP = r1. */
+ " \n"
+ " load_ctx_therad_mode: \n"
+ " bx lr \n"
+ " \n"
+ ::: "r0", "r1", "r2"
+ );
+}
+/*-----------------------------------------------------------*/
+
+void SecureContext_SaveContextAsm( SecureContext_t * pxSecureContext )
+{
+ /* pxSecureContext value is in r0. */
+ __asm volatile
+ (
+ " .syntax unified \n"
+ " \n"
+ " mrs r1, ipsr \n" /* r1 = IPSR. */
+ " cbz r1, save_ctx_therad_mode \n" /* Do nothing if the processor is running in the Thread Mode. */
+ " mrs r1, psp \n" /* r1 = PSP. */
+ " \n"
+ #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ " vstmdb r1!, {s0} \n" /* Trigger the deferred stacking of FPU registers. */
+ " vldmia r1!, {s0} \n" /* Nullify the effect of the previous statement. */
+ #endif /* configENABLE_FPU || configENABLE_MVE */
+ " \n"
+ #if ( configENABLE_MPU == 1 )
+ " mrs r2, control \n" /* r2 = CONTROL. */
+ " stmdb r1!, {r2} \n" /* Store CONTROL value on the stack. */
+ #endif /* configENABLE_MPU */
+ " \n"
+ " str r1, [r0] \n" /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+ " movs r1, %0 \n" /* r1 = securecontextNO_STACK. */
+ " msr psplim, r1 \n" /* PSPLIM = securecontextNO_STACK. */
+ " msr psp, r1 \n" /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */
+ " \n"
+ " save_ctx_therad_mode: \n"
+ " bx lr \n"
+ " \n"
+ ::"i" ( securecontextNO_STACK ) : "r1", "memory"
+ );
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM23/secure_context_port_asm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM23/secure_context_port_asm.s
new file mode 100644
index 0000000..b89a865
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM23/secure_context_port_asm.s
@@ -0,0 +1,88 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ PUBLIC SecureContext_LoadContextAsm
+ PUBLIC SecureContext_SaveContextAsm
+
+#if ( configENABLE_FPU == 1 )
+ #error Cortex-M23 does not have a Floating Point Unit (FPU) and therefore configENABLE_FPU must be set to 0.
+#endif
+/*-----------------------------------------------------------*/
+
+SecureContext_LoadContextAsm:
+ /* pxSecureContext value is in r0. */
+ mrs r1, ipsr /* r1 = IPSR. */
+ cbz r1, load_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */
+ ldmia r0!, {r1, r2} /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */
+
+#if ( configENABLE_MPU == 1 )
+ ldmia r1!, {r3} /* Read CONTROL register value from task's stack. r3 = CONTROL. */
+ msr control, r3 /* CONTROL = r3. */
+#endif /* configENABLE_MPU */
+
+ msr psplim, r2 /* PSPLIM = r2. */
+ msr psp, r1 /* PSP = r1. */
+
+ load_ctx_therad_mode:
+ bx lr
+/*-----------------------------------------------------------*/
+
+SecureContext_SaveContextAsm:
+ /* pxSecureContext value is in r0. */
+ mrs r1, ipsr /* r1 = IPSR. */
+ cbz r1, save_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */
+ mrs r1, psp /* r1 = PSP. */
+
+#if ( configENABLE_MPU == 1 )
+ mrs r2, control /* r2 = CONTROL. */
+ subs r1, r1, #4 /* Make space for the CONTROL value on the stack. */
+ str r1, [r0] /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+ stmia r1!, {r2} /* Store CONTROL value on the stack. */
+#else /* configENABLE_MPU */
+ str r1, [r0] /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+#endif /* configENABLE_MPU */
+
+ movs r1, #0 /* r1 = securecontextNO_STACK. */
+ msr psplim, r1 /* PSPLIM = securecontextNO_STACK. */
+ msr psp, r1 /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */
+
+ save_ctx_therad_mode:
+ bx lr
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM33/secure_context_port_asm.s b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM33/secure_context_port_asm.s
new file mode 100644
index 0000000..a02ab36
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/portable/IAR/ARM_CM33/secure_context_port_asm.s
@@ -0,0 +1,86 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+ SECTION .text:CODE:NOROOT(2)
+ THUMB
+
+/* Including FreeRTOSConfig.h here will cause build errors if the header file
+contains code not understood by the assembler - for example the 'extern' keyword.
+To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
+the code is included in C files but excluded by the preprocessor in assembly
+files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
+#include "FreeRTOSConfig.h"
+
+ PUBLIC SecureContext_LoadContextAsm
+ PUBLIC SecureContext_SaveContextAsm
+/*-----------------------------------------------------------*/
+
+SecureContext_LoadContextAsm:
+ /* pxSecureContext value is in r0. */
+ mrs r1, ipsr /* r1 = IPSR. */
+ cbz r1, load_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */
+ ldmia r0!, {r1, r2} /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */
+
+#if ( configENABLE_MPU == 1 )
+ ldmia r1!, {r3} /* Read CONTROL register value from task's stack. r3 = CONTROL. */
+ msr control, r3 /* CONTROL = r3. */
+#endif /* configENABLE_MPU */
+
+ msr psplim, r2 /* PSPLIM = r2. */
+ msr psp, r1 /* PSP = r1. */
+
+ load_ctx_therad_mode:
+ bx lr
+/*-----------------------------------------------------------*/
+
+SecureContext_SaveContextAsm:
+ /* pxSecureContext value is in r0. */
+ mrs r1, ipsr /* r1 = IPSR. */
+ cbz r1, save_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */
+ mrs r1, psp /* r1 = PSP. */
+
+#if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) )
+ vstmdb r1!, {s0} /* Trigger the deferred stacking of FPU registers. */
+ vldmia r1!, {s0} /* Nullify the effect of the previous statement. */
+#endif /* configENABLE_FPU || configENABLE_MVE */
+
+#if ( configENABLE_MPU == 1 )
+ mrs r2, control /* r2 = CONTROL. */
+ stmdb r1!, {r2} /* Store CONTROL value on the stack. */
+#endif /* configENABLE_MPU */
+
+ str r1, [r0] /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */
+ movs r1, #0 /* r1 = securecontextNO_STACK. */
+ msr psplim, r1 /* PSPLIM = securecontextNO_STACK. */
+ msr psp, r1 /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */
+
+ save_ctx_therad_mode:
+ bx lr
+/*-----------------------------------------------------------*/
+
+ END
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.c
new file mode 100644
index 0000000..ffb4f87
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.c
@@ -0,0 +1,351 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Secure context includes. */
+#include "secure_context.h"
+
+/* Secure heap includes. */
+#include "secure_heap.h"
+
+/* Secure port macros. */
+#include "secure_port_macros.h"
+
+/**
+ * @brief CONTROL value for privileged tasks.
+ *
+ * Bit[0] - 0 --> Thread mode is privileged.
+ * Bit[1] - 1 --> Thread mode uses PSP.
+ */
+#define securecontextCONTROL_VALUE_PRIVILEGED 0x02
+
+/**
+ * @brief CONTROL value for un-privileged tasks.
+ *
+ * Bit[0] - 1 --> Thread mode is un-privileged.
+ * Bit[1] - 1 --> Thread mode uses PSP.
+ */
+#define securecontextCONTROL_VALUE_UNPRIVILEGED 0x03
+
+/**
+ * @brief Size of stack seal values in bytes.
+ */
+#define securecontextSTACK_SEAL_SIZE 8
+
+/**
+ * @brief Stack seal value as recommended by ARM.
+ */
+#define securecontextSTACK_SEAL_VALUE 0xFEF5EDA5
+
+/**
+ * @brief Maximum number of secure contexts.
+ */
+#ifndef secureconfigMAX_SECURE_CONTEXTS
+ #define secureconfigMAX_SECURE_CONTEXTS 8UL
+#endif
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Pre-allocated array of secure contexts.
+ */
+SecureContext_t xSecureContexts[ secureconfigMAX_SECURE_CONTEXTS ];
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Get a free secure context for a task from the secure context pool (xSecureContexts).
+ *
+ * This function ensures that only one secure context is allocated for a task.
+ *
+ * @param[in] pvTaskHandle The task handle for which the secure context is allocated.
+ *
+ * @return Index of a free secure context in the xSecureContexts array.
+ */
+static uint32_t ulGetSecureContext( void * pvTaskHandle );
+
+/**
+ * @brief Return the secure context to the secure context pool (xSecureContexts).
+ *
+ * @param[in] ulSecureContextIndex Index of the context in the xSecureContexts array.
+ */
+static void vReturnSecureContext( uint32_t ulSecureContextIndex );
+
+/* These are implemented in assembly. */
+extern void SecureContext_LoadContextAsm( SecureContext_t * pxSecureContext );
+extern void SecureContext_SaveContextAsm( SecureContext_t * pxSecureContext );
+/*-----------------------------------------------------------*/
+
+static uint32_t ulGetSecureContext( void * pvTaskHandle )
+{
+ /* Start with invalid index. */
+ uint32_t i, ulSecureContextIndex = secureconfigMAX_SECURE_CONTEXTS;
+
+ for( i = 0; i < secureconfigMAX_SECURE_CONTEXTS; i++ )
+ {
+ if( ( xSecureContexts[ i ].pucCurrentStackPointer == NULL ) &&
+ ( xSecureContexts[ i ].pucStackLimit == NULL ) &&
+ ( xSecureContexts[ i ].pucStackStart == NULL ) &&
+ ( xSecureContexts[ i ].pvTaskHandle == NULL ) &&
+ ( ulSecureContextIndex == secureconfigMAX_SECURE_CONTEXTS ) )
+ {
+ ulSecureContextIndex = i;
+ }
+ else if( xSecureContexts[ i ].pvTaskHandle == pvTaskHandle )
+ {
+ /* A task can only have one secure context. Do not allocate a second
+ * context for the same task. */
+ ulSecureContextIndex = secureconfigMAX_SECURE_CONTEXTS;
+ break;
+ }
+ }
+
+ return ulSecureContextIndex;
+}
+/*-----------------------------------------------------------*/
+
+static void vReturnSecureContext( uint32_t ulSecureContextIndex )
+{
+ xSecureContexts[ ulSecureContextIndex ].pucCurrentStackPointer = NULL;
+ xSecureContexts[ ulSecureContextIndex ].pucStackLimit = NULL;
+ xSecureContexts[ ulSecureContextIndex ].pucStackStart = NULL;
+ xSecureContexts[ ulSecureContextIndex ].pvTaskHandle = NULL;
+}
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureContext_Init( void )
+{
+ uint32_t ulIPSR, i;
+ static uint32_t ulSecureContextsInitialized = 0;
+
+ /* Read the Interrupt Program Status Register (IPSR) value. */
+ secureportREAD_IPSR( ulIPSR );
+
+ /* Do nothing if the processor is running in the Thread Mode. IPSR is zero
+ * when the processor is running in the Thread Mode. */
+ if( ( ulIPSR != 0 ) && ( ulSecureContextsInitialized == 0 ) )
+ {
+ /* Ensure to initialize secure contexts only once. */
+ ulSecureContextsInitialized = 1;
+
+ /* No stack for thread mode until a task's context is loaded. */
+ secureportSET_PSPLIM( securecontextNO_STACK );
+ secureportSET_PSP( securecontextNO_STACK );
+
+ /* Initialize all secure contexts. */
+ for( i = 0; i < secureconfigMAX_SECURE_CONTEXTS; i++ )
+ {
+ xSecureContexts[ i ].pucCurrentStackPointer = NULL;
+ xSecureContexts[ i ].pucStackLimit = NULL;
+ xSecureContexts[ i ].pucStackStart = NULL;
+ xSecureContexts[ i ].pvTaskHandle = NULL;
+ }
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ /* Configure thread mode to use PSP and to be unprivileged. */
+ secureportSET_CONTROL( securecontextCONTROL_VALUE_UNPRIVILEGED );
+ }
+ #else /* configENABLE_MPU */
+ {
+ /* Configure thread mode to use PSP and to be privileged. */
+ secureportSET_CONTROL( securecontextCONTROL_VALUE_PRIVILEGED );
+ }
+ #endif /* configENABLE_MPU */
+ }
+}
+/*-----------------------------------------------------------*/
+
+#if ( configENABLE_MPU == 1 )
+ secureportNON_SECURE_CALLABLE SecureContextHandle_t SecureContext_AllocateContext( uint32_t ulSecureStackSize,
+ uint32_t ulIsTaskPrivileged,
+ void * pvTaskHandle )
+#else /* configENABLE_MPU */
+ secureportNON_SECURE_CALLABLE SecureContextHandle_t SecureContext_AllocateContext( uint32_t ulSecureStackSize,
+ void * pvTaskHandle )
+#endif /* configENABLE_MPU */
+{
+ uint8_t * pucStackMemory = NULL;
+ uint8_t * pucStackLimit;
+ uint32_t ulIPSR, ulSecureContextIndex;
+ SecureContextHandle_t xSecureContextHandle = securecontextINVALID_CONTEXT_ID;
+
+ #if ( configENABLE_MPU == 1 )
+ uint32_t * pulCurrentStackPointer = NULL;
+ #endif /* configENABLE_MPU */
+
+ /* Read the Interrupt Program Status Register (IPSR) and Process Stack Limit
+ * Register (PSPLIM) value. */
+ secureportREAD_IPSR( ulIPSR );
+ secureportREAD_PSPLIM( pucStackLimit );
+
+ /* Do nothing if the processor is running in the Thread Mode. IPSR is zero
+ * when the processor is running in the Thread Mode.
+ * Also do nothing, if a secure context us already loaded. PSPLIM is set to
+ * securecontextNO_STACK when no secure context is loaded. */
+ if( ( ulIPSR != 0 ) && ( pucStackLimit == securecontextNO_STACK ) )
+ {
+ /* Ontain a free secure context. */
+ ulSecureContextIndex = ulGetSecureContext( pvTaskHandle );
+
+ /* Were we able to get a free context? */
+ if( ulSecureContextIndex < secureconfigMAX_SECURE_CONTEXTS )
+ {
+ /* Allocate the stack space. */
+ pucStackMemory = pvPortMalloc( ulSecureStackSize + securecontextSTACK_SEAL_SIZE );
+
+ if( pucStackMemory != NULL )
+ {
+ /* Since stack grows down, the starting point will be the last
+ * location. Note that this location is next to the last
+ * allocated byte for stack (excluding the space for seal values)
+ * because the hardware decrements the stack pointer before
+ * writing i.e. if stack pointer is 0x2, a push operation will
+ * decrement the stack pointer to 0x1 and then write at 0x1. */
+ xSecureContexts[ ulSecureContextIndex ].pucStackStart = pucStackMemory + ulSecureStackSize;
+
+ /* Seal the created secure process stack. */
+ *( uint32_t * )( pucStackMemory + ulSecureStackSize ) = securecontextSTACK_SEAL_VALUE;
+ *( uint32_t * )( pucStackMemory + ulSecureStackSize + 4 ) = securecontextSTACK_SEAL_VALUE;
+
+ /* The stack cannot go beyond this location. This value is
+ * programmed in the PSPLIM register on context switch.*/
+ xSecureContexts[ ulSecureContextIndex ].pucStackLimit = pucStackMemory;
+
+ xSecureContexts[ ulSecureContextIndex ].pvTaskHandle = pvTaskHandle;
+
+ #if ( configENABLE_MPU == 1 )
+ {
+ /* Store the correct CONTROL value for the task on the stack.
+ * This value is programmed in the CONTROL register on
+ * context switch. */
+ pulCurrentStackPointer = ( uint32_t * ) xSecureContexts[ ulSecureContextIndex ].pucStackStart;
+ pulCurrentStackPointer--;
+
+ if( ulIsTaskPrivileged )
+ {
+ *( pulCurrentStackPointer ) = securecontextCONTROL_VALUE_PRIVILEGED;
+ }
+ else
+ {
+ *( pulCurrentStackPointer ) = securecontextCONTROL_VALUE_UNPRIVILEGED;
+ }
+
+ /* Store the current stack pointer. This value is programmed in
+ * the PSP register on context switch. */
+ xSecureContexts[ ulSecureContextIndex ].pucCurrentStackPointer = ( uint8_t * ) pulCurrentStackPointer;
+ }
+ #else /* configENABLE_MPU */
+ {
+ /* Current SP is set to the starting of the stack. This
+ * value programmed in the PSP register on context switch. */
+ xSecureContexts[ ulSecureContextIndex ].pucCurrentStackPointer = xSecureContexts[ ulSecureContextIndex ].pucStackStart;
+ }
+ #endif /* configENABLE_MPU */
+
+ /* Ensure to never return 0 as a valid context handle. */
+ xSecureContextHandle = ulSecureContextIndex + 1UL;
+ }
+ }
+ }
+
+ return xSecureContextHandle;
+}
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureContext_FreeContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle )
+{
+ uint32_t ulIPSR, ulSecureContextIndex;
+
+ /* Read the Interrupt Program Status Register (IPSR) value. */
+ secureportREAD_IPSR( ulIPSR );
+
+ /* Do nothing if the processor is running in the Thread Mode. IPSR is zero
+ * when the processor is running in the Thread Mode. */
+ if( ulIPSR != 0 )
+ {
+ /* Only free if a valid context handle is passed. */
+ if( ( xSecureContextHandle > 0UL ) && ( xSecureContextHandle <= secureconfigMAX_SECURE_CONTEXTS ) )
+ {
+ ulSecureContextIndex = xSecureContextHandle - 1UL;
+
+ /* Ensure that the secure context being deleted is associated with
+ * the task. */
+ if( xSecureContexts[ ulSecureContextIndex ].pvTaskHandle == pvTaskHandle )
+ {
+ /* Free the stack space. */
+ vPortFree( xSecureContexts[ ulSecureContextIndex ].pucStackLimit );
+
+ /* Return the secure context back to the free secure contexts pool. */
+ vReturnSecureContext( ulSecureContextIndex );
+ }
+ }
+ }
+}
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureContext_LoadContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle )
+{
+ uint8_t * pucStackLimit;
+ uint32_t ulSecureContextIndex;
+
+ if( ( xSecureContextHandle > 0UL ) && ( xSecureContextHandle <= secureconfigMAX_SECURE_CONTEXTS ) )
+ {
+ ulSecureContextIndex = xSecureContextHandle - 1UL;
+
+ secureportREAD_PSPLIM( pucStackLimit );
+
+ /* Ensure that no secure context is loaded and the task is loading it's
+ * own context. */
+ if( ( pucStackLimit == securecontextNO_STACK ) &&
+ ( xSecureContexts[ ulSecureContextIndex ].pvTaskHandle == pvTaskHandle ) )
+ {
+ SecureContext_LoadContextAsm( &( xSecureContexts[ ulSecureContextIndex ] ) );
+ }
+ }
+}
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureContext_SaveContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle )
+{
+ uint8_t * pucStackLimit;
+ uint32_t ulSecureContextIndex;
+
+ if( ( xSecureContextHandle > 0UL ) && ( xSecureContextHandle <= secureconfigMAX_SECURE_CONTEXTS ) )
+ {
+ ulSecureContextIndex = xSecureContextHandle - 1UL;
+
+ secureportREAD_PSPLIM( pucStackLimit );
+
+ /* Ensure that task's context is loaded and the task is saving it's own
+ * context. */
+ if( ( xSecureContexts[ ulSecureContextIndex ].pucStackLimit == pucStackLimit ) &&
+ ( xSecureContexts[ ulSecureContextIndex ].pvTaskHandle == pvTaskHandle ) )
+ {
+ SecureContext_SaveContextAsm( &( xSecureContexts[ ulSecureContextIndex ] ) );
+ }
+ }
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.h
new file mode 100644
index 0000000..68efd7c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/context/secure_context.h
@@ -0,0 +1,135 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __SECURE_CONTEXT_H__
+#define __SECURE_CONTEXT_H__
+
+/* Standard includes. */
+#include
+
+/* FreeRTOS includes. */
+#include "FreeRTOSConfig.h"
+
+/**
+ * @brief PSP value when no secure context is loaded.
+ */
+#define securecontextNO_STACK 0x0
+
+/**
+ * @brief Invalid context ID.
+ */
+#define securecontextINVALID_CONTEXT_ID 0UL
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Structure to represent a secure context.
+ *
+ * @note Since stack grows down, pucStackStart is the highest address while
+ * pucStackLimit is the first address of the allocated memory.
+ */
+typedef struct SecureContext
+{
+ uint8_t * pucCurrentStackPointer; /**< Current value of stack pointer (PSP). */
+ uint8_t * pucStackLimit; /**< Last location of the stack memory (PSPLIM). */
+ uint8_t * pucStackStart; /**< First location of the stack memory. */
+ void * pvTaskHandle; /**< Task handle of the task this context is associated with. */
+} SecureContext_t;
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Opaque handle for a secure context.
+ */
+typedef uint32_t SecureContextHandle_t;
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Initializes the secure context management system.
+ *
+ * PSP is set to NULL and therefore a task must allocate and load a context
+ * before calling any secure side function in the thread mode.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ */
+void SecureContext_Init( void );
+
+/**
+ * @brief Allocates a context on the secure side.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ *
+ * @param[in] ulSecureStackSize Size of the stack to allocate on secure side.
+ * @param[in] ulIsTaskPrivileged 1 if the calling task is privileged, 0 otherwise.
+ *
+ * @return Opaque context handle if context is successfully allocated, NULL
+ * otherwise.
+ */
+#if ( configENABLE_MPU == 1 )
+ SecureContextHandle_t SecureContext_AllocateContext( uint32_t ulSecureStackSize,
+ uint32_t ulIsTaskPrivileged,
+ void * pvTaskHandle );
+#else /* configENABLE_MPU */
+ SecureContextHandle_t SecureContext_AllocateContext( uint32_t ulSecureStackSize,
+ void * pvTaskHandle );
+#endif /* configENABLE_MPU */
+
+/**
+ * @brief Frees the given context.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ *
+ * @param[in] xSecureContextHandle Context handle corresponding to the
+ * context to be freed.
+ */
+void SecureContext_FreeContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle );
+
+/**
+ * @brief Loads the given context.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ *
+ * @param[in] xSecureContextHandle Context handle corresponding to the context
+ * to be loaded.
+ */
+void SecureContext_LoadContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle );
+
+/**
+ * @brief Saves the given context.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ *
+ * @param[in] xSecureContextHandle Context handle corresponding to the context
+ * to be saved.
+ */
+void SecureContext_SaveContext( SecureContextHandle_t xSecureContextHandle, void * pvTaskHandle );
+
+#endif /* __SECURE_CONTEXT_H__ */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.c
new file mode 100644
index 0000000..fa42ee3
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.c
@@ -0,0 +1,454 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Secure context heap includes. */
+#include "secure_heap.h"
+
+/* Secure port macros. */
+#include "secure_port_macros.h"
+
+/**
+ * @brief Total heap size.
+ */
+#ifndef secureconfigTOTAL_HEAP_SIZE
+ #define secureconfigTOTAL_HEAP_SIZE ( ( ( size_t ) ( 10 * 1024 ) ) )
+#endif
+
+/* No test marker by default. */
+#ifndef mtCOVERAGE_TEST_MARKER
+ #define mtCOVERAGE_TEST_MARKER()
+#endif
+
+/* No tracing by default. */
+#ifndef traceMALLOC
+ #define traceMALLOC( pvReturn, xWantedSize )
+#endif
+
+/* No tracing by default. */
+#ifndef traceFREE
+ #define traceFREE( pv, xBlockSize )
+#endif
+
+/* Block sizes must not get too small. */
+#define secureheapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )
+
+/* Assumes 8bit bytes! */
+#define secureheapBITS_PER_BYTE ( ( size_t ) 8 )
+/*-----------------------------------------------------------*/
+
+/* Allocate the memory for the heap. */
+#if ( configAPPLICATION_ALLOCATED_HEAP == 1 )
+
+/* The application writer has already defined the array used for the RTOS
+* heap - probably so it can be placed in a special segment or address. */
+ extern uint8_t ucHeap[ secureconfigTOTAL_HEAP_SIZE ];
+#else /* configAPPLICATION_ALLOCATED_HEAP */
+ static uint8_t ucHeap[ secureconfigTOTAL_HEAP_SIZE ];
+#endif /* configAPPLICATION_ALLOCATED_HEAP */
+
+/**
+ * @brief The linked list structure.
+ *
+ * This is used to link free blocks in order of their memory address.
+ */
+typedef struct A_BLOCK_LINK
+{
+ struct A_BLOCK_LINK * pxNextFreeBlock; /**< The next free block in the list. */
+ size_t xBlockSize; /**< The size of the free block. */
+} BlockLink_t;
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief Called automatically to setup the required heap structures the first
+ * time pvPortMalloc() is called.
+ */
+static void prvHeapInit( void );
+
+/**
+ * @brief Inserts a block of memory that is being freed into the correct
+ * position in the list of free memory blocks.
+ *
+ * The block being freed will be merged with the block in front it and/or the
+ * block behind it if the memory blocks are adjacent to each other.
+ *
+ * @param[in] pxBlockToInsert The block being freed.
+ */
+static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert );
+/*-----------------------------------------------------------*/
+
+/**
+ * @brief The size of the structure placed at the beginning of each allocated
+ * memory block must by correctly byte aligned.
+ */
+static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( secureportBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) secureportBYTE_ALIGNMENT_MASK );
+
+/**
+ * @brief Create a couple of list links to mark the start and end of the list.
+ */
+static BlockLink_t xStart;
+static BlockLink_t * pxEnd = NULL;
+
+/**
+ * @brief Keeps track of the number of free bytes remaining, but says nothing
+ * about fragmentation.
+ */
+static size_t xFreeBytesRemaining = 0U;
+static size_t xMinimumEverFreeBytesRemaining = 0U;
+
+/**
+ * @brief Gets set to the top bit of an size_t type.
+ *
+ * When this bit in the xBlockSize member of an BlockLink_t structure is set
+ * then the block belongs to the application. When the bit is free the block is
+ * still part of the free heap space.
+ */
+static size_t xBlockAllocatedBit = 0;
+/*-----------------------------------------------------------*/
+
+static void prvHeapInit( void )
+{
+ BlockLink_t * pxFirstFreeBlock;
+ uint8_t * pucAlignedHeap;
+ size_t uxAddress;
+ size_t xTotalHeapSize = secureconfigTOTAL_HEAP_SIZE;
+
+ /* Ensure the heap starts on a correctly aligned boundary. */
+ uxAddress = ( size_t ) ucHeap;
+
+ if( ( uxAddress & secureportBYTE_ALIGNMENT_MASK ) != 0 )
+ {
+ uxAddress += ( secureportBYTE_ALIGNMENT - 1 );
+ uxAddress &= ~( ( size_t ) secureportBYTE_ALIGNMENT_MASK );
+ xTotalHeapSize -= uxAddress - ( size_t ) ucHeap;
+ }
+
+ pucAlignedHeap = ( uint8_t * ) uxAddress;
+
+ /* xStart is used to hold a pointer to the first item in the list of free
+ * blocks. The void cast is used to prevent compiler warnings. */
+ xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;
+ xStart.xBlockSize = ( size_t ) 0;
+
+ /* pxEnd is used to mark the end of the list of free blocks and is inserted
+ * at the end of the heap space. */
+ uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize;
+ uxAddress -= xHeapStructSize;
+ uxAddress &= ~( ( size_t ) secureportBYTE_ALIGNMENT_MASK );
+ pxEnd = ( void * ) uxAddress;
+ pxEnd->xBlockSize = 0;
+ pxEnd->pxNextFreeBlock = NULL;
+
+ /* To start with there is a single free block that is sized to take up the
+ * entire heap space, minus the space taken by pxEnd. */
+ pxFirstFreeBlock = ( void * ) pucAlignedHeap;
+ pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock;
+ pxFirstFreeBlock->pxNextFreeBlock = pxEnd;
+
+ /* Only one block exists - and it covers the entire usable heap space. */
+ xMinimumEverFreeBytesRemaining = pxFirstFreeBlock->xBlockSize;
+ xFreeBytesRemaining = pxFirstFreeBlock->xBlockSize;
+
+ /* Work out the position of the top bit in a size_t variable. */
+ xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * secureheapBITS_PER_BYTE ) - 1 );
+}
+/*-----------------------------------------------------------*/
+
+static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
+{
+ BlockLink_t * pxIterator;
+ uint8_t * puc;
+
+ /* Iterate through the list until a block is found that has a higher address
+ * than the block being inserted. */
+ for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )
+ {
+ /* Nothing to do here, just iterate to the right position. */
+ }
+
+ /* Do the block being inserted, and the block it is being inserted after
+ * make a contiguous block of memory? */
+ puc = ( uint8_t * ) pxIterator;
+
+ if( ( puc + pxIterator->xBlockSize ) == ( uint8_t * ) pxBlockToInsert )
+ {
+ pxIterator->xBlockSize += pxBlockToInsert->xBlockSize;
+ pxBlockToInsert = pxIterator;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Do the block being inserted, and the block it is being inserted before
+ * make a contiguous block of memory? */
+ puc = ( uint8_t * ) pxBlockToInsert;
+
+ if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )
+ {
+ if( pxIterator->pxNextFreeBlock != pxEnd )
+ {
+ /* Form one big block from the two blocks. */
+ pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;
+ pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;
+ }
+ else
+ {
+ pxBlockToInsert->pxNextFreeBlock = pxEnd;
+ }
+ }
+ else
+ {
+ pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock;
+ }
+
+ /* If the block being inserted plugged a gab, so was merged with the block
+ * before and the block after, then it's pxNextFreeBlock pointer will have
+ * already been set, and should not be set here as that would make it point
+ * to itself. */
+ if( pxIterator != pxBlockToInsert )
+ {
+ pxIterator->pxNextFreeBlock = pxBlockToInsert;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+}
+/*-----------------------------------------------------------*/
+
+void * pvPortMalloc( size_t xWantedSize )
+{
+ BlockLink_t * pxBlock;
+ BlockLink_t * pxPreviousBlock;
+ BlockLink_t * pxNewBlockLink;
+ void * pvReturn = NULL;
+
+ /* If this is the first call to malloc then the heap will require
+ * initialisation to setup the list of free blocks. */
+ if( pxEnd == NULL )
+ {
+ prvHeapInit();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Check the requested block size is not so large that the top bit is set.
+ * The top bit of the block size member of the BlockLink_t structure is used
+ * to determine who owns the block - the application or the kernel, so it
+ * must be free. */
+ if( ( xWantedSize & xBlockAllocatedBit ) == 0 )
+ {
+ /* The wanted size is increased so it can contain a BlockLink_t
+ * structure in addition to the requested amount of bytes. */
+ if( xWantedSize > 0 )
+ {
+ xWantedSize += xHeapStructSize;
+
+ /* Ensure that blocks are always aligned to the required number of
+ * bytes. */
+ if( ( xWantedSize & secureportBYTE_ALIGNMENT_MASK ) != 0x00 )
+ {
+ /* Byte alignment required. */
+ xWantedSize += ( secureportBYTE_ALIGNMENT - ( xWantedSize & secureportBYTE_ALIGNMENT_MASK ) );
+ secureportASSERT( ( xWantedSize & secureportBYTE_ALIGNMENT_MASK ) == 0 );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
+ {
+ /* Traverse the list from the start (lowest address) block until
+ * one of adequate size is found. */
+ pxPreviousBlock = &xStart;
+ pxBlock = xStart.pxNextFreeBlock;
+
+ while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
+ {
+ pxPreviousBlock = pxBlock;
+ pxBlock = pxBlock->pxNextFreeBlock;
+ }
+
+ /* If the end marker was reached then a block of adequate size was
+ * not found. */
+ if( pxBlock != pxEnd )
+ {
+ /* Return the memory space pointed to - jumping over the
+ * BlockLink_t structure at its start. */
+ pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
+
+ /* This block is being returned for use so must be taken out
+ * of the list of free blocks. */
+ pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
+
+ /* If the block is larger than required it can be split into
+ * two. */
+ if( ( pxBlock->xBlockSize - xWantedSize ) > secureheapMINIMUM_BLOCK_SIZE )
+ {
+ /* This block is to be split into two. Create a new
+ * block following the number of bytes requested. The void
+ * cast is used to prevent byte alignment warnings from the
+ * compiler. */
+ pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
+ secureportASSERT( ( ( ( size_t ) pxNewBlockLink ) & secureportBYTE_ALIGNMENT_MASK ) == 0 );
+
+ /* Calculate the sizes of two blocks split from the single
+ * block. */
+ pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
+ pxBlock->xBlockSize = xWantedSize;
+
+ /* Insert the new block into the list of free blocks. */
+ prvInsertBlockIntoFreeList( pxNewBlockLink );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ xFreeBytesRemaining -= pxBlock->xBlockSize;
+
+ if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )
+ {
+ xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* The block is being returned - it is allocated and owned by
+ * the application and has no "next" block. */
+ pxBlock->xBlockSize |= xBlockAllocatedBit;
+ pxBlock->pxNextFreeBlock = NULL;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceMALLOC( pvReturn, xWantedSize );
+
+ #if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
+ {
+ if( pvReturn == NULL )
+ {
+ extern void vApplicationMallocFailedHook( void );
+ vApplicationMallocFailedHook();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 ) */
+
+ secureportASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) secureportBYTE_ALIGNMENT_MASK ) == 0 );
+ return pvReturn;
+}
+/*-----------------------------------------------------------*/
+
+void vPortFree( void * pv )
+{
+ uint8_t * puc = ( uint8_t * ) pv;
+ BlockLink_t * pxLink;
+
+ if( pv != NULL )
+ {
+ /* The memory being freed will have an BlockLink_t structure immediately
+ * before it. */
+ puc -= xHeapStructSize;
+
+ /* This casting is to keep the compiler from issuing warnings. */
+ pxLink = ( void * ) puc;
+
+ /* Check the block is actually allocated. */
+ secureportASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
+ secureportASSERT( pxLink->pxNextFreeBlock == NULL );
+
+ if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 )
+ {
+ if( pxLink->pxNextFreeBlock == NULL )
+ {
+ /* The block is being returned to the heap - it is no longer
+ * allocated. */
+ pxLink->xBlockSize &= ~xBlockAllocatedBit;
+
+ secureportDISABLE_NON_SECURE_INTERRUPTS();
+ {
+ /* Add this block to the list of free blocks. */
+ xFreeBytesRemaining += pxLink->xBlockSize;
+ traceFREE( pv, pxLink->xBlockSize );
+ prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
+ }
+ secureportENABLE_NON_SECURE_INTERRUPTS();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+}
+/*-----------------------------------------------------------*/
+
+size_t xPortGetFreeHeapSize( void )
+{
+ return xFreeBytesRemaining;
+}
+/*-----------------------------------------------------------*/
+
+size_t xPortGetMinimumEverFreeHeapSize( void )
+{
+ return xMinimumEverFreeBytesRemaining;
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.h
new file mode 100644
index 0000000..2689c49
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/heap/secure_heap.h
@@ -0,0 +1,66 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __SECURE_HEAP_H__
+#define __SECURE_HEAP_H__
+
+/* Standard includes. */
+#include
+
+/**
+ * @brief Allocates memory from heap.
+ *
+ * @param[in] xWantedSize The size of the memory to be allocated.
+ *
+ * @return Pointer to the memory region if the allocation is successful, NULL
+ * otherwise.
+ */
+void * pvPortMalloc( size_t xWantedSize );
+
+/**
+ * @brief Frees the previously allocated memory.
+ *
+ * @param[in] pv Pointer to the memory to be freed.
+ */
+void vPortFree( void * pv );
+
+/**
+ * @brief Get the free heap size.
+ *
+ * @return Free heap size.
+ */
+size_t xPortGetFreeHeapSize( void );
+
+/**
+ * @brief Get the minimum ever free heap size.
+ *
+ * @return Minimum ever free heap size.
+ */
+size_t xPortGetMinimumEverFreeHeapSize( void );
+
+#endif /* __SECURE_HEAP_H__ */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.c
new file mode 100644
index 0000000..585adfe
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.c
@@ -0,0 +1,106 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Standard includes. */
+#include
+
+/* Secure init includes. */
+#include "secure_init.h"
+
+/* Secure port macros. */
+#include "secure_port_macros.h"
+
+/**
+ * @brief Constants required to manipulate the SCB.
+ */
+#define secureinitSCB_AIRCR ( ( volatile uint32_t * ) 0xe000ed0c ) /* Application Interrupt and Reset Control Register. */
+#define secureinitSCB_AIRCR_VECTKEY_POS ( 16UL )
+#define secureinitSCB_AIRCR_VECTKEY_MASK ( 0xFFFFUL << secureinitSCB_AIRCR_VECTKEY_POS )
+#define secureinitSCB_AIRCR_PRIS_POS ( 14UL )
+#define secureinitSCB_AIRCR_PRIS_MASK ( 1UL << secureinitSCB_AIRCR_PRIS_POS )
+
+/**
+ * @brief Constants required to manipulate the FPU.
+ */
+#define secureinitFPCCR ( ( volatile uint32_t * ) 0xe000ef34 ) /* Floating Point Context Control Register. */
+#define secureinitFPCCR_LSPENS_POS ( 29UL )
+#define secureinitFPCCR_LSPENS_MASK ( 1UL << secureinitFPCCR_LSPENS_POS )
+#define secureinitFPCCR_TS_POS ( 26UL )
+#define secureinitFPCCR_TS_MASK ( 1UL << secureinitFPCCR_TS_POS )
+
+#define secureinitNSACR ( ( volatile uint32_t * ) 0xe000ed8c ) /* Non-secure Access Control Register. */
+#define secureinitNSACR_CP10_POS ( 10UL )
+#define secureinitNSACR_CP10_MASK ( 1UL << secureinitNSACR_CP10_POS )
+#define secureinitNSACR_CP11_POS ( 11UL )
+#define secureinitNSACR_CP11_MASK ( 1UL << secureinitNSACR_CP11_POS )
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureInit_DePrioritizeNSExceptions( void )
+{
+ uint32_t ulIPSR;
+
+ /* Read the Interrupt Program Status Register (IPSR) value. */
+ secureportREAD_IPSR( ulIPSR );
+
+ /* Do nothing if the processor is running in the Thread Mode. IPSR is zero
+ * when the processor is running in the Thread Mode. */
+ if( ulIPSR != 0 )
+ {
+ *( secureinitSCB_AIRCR ) = ( *( secureinitSCB_AIRCR ) & ~( secureinitSCB_AIRCR_VECTKEY_MASK | secureinitSCB_AIRCR_PRIS_MASK ) ) |
+ ( ( 0x05FAUL << secureinitSCB_AIRCR_VECTKEY_POS ) & secureinitSCB_AIRCR_VECTKEY_MASK ) |
+ ( ( 0x1UL << secureinitSCB_AIRCR_PRIS_POS ) & secureinitSCB_AIRCR_PRIS_MASK );
+ }
+}
+/*-----------------------------------------------------------*/
+
+secureportNON_SECURE_CALLABLE void SecureInit_EnableNSFPUAccess( void )
+{
+ uint32_t ulIPSR;
+
+ /* Read the Interrupt Program Status Register (IPSR) value. */
+ secureportREAD_IPSR( ulIPSR );
+
+ /* Do nothing if the processor is running in the Thread Mode. IPSR is zero
+ * when the processor is running in the Thread Mode. */
+ if( ulIPSR != 0 )
+ {
+ /* CP10 = 1 ==> Non-secure access to the Floating Point Unit is
+ * permitted. CP11 should be programmed to the same value as CP10. */
+ *( secureinitNSACR ) |= ( secureinitNSACR_CP10_MASK | secureinitNSACR_CP11_MASK );
+
+ /* LSPENS = 0 ==> LSPEN is writable fron non-secure state. This ensures
+ * that we can enable/disable lazy stacking in port.c file. */
+ *( secureinitFPCCR ) &= ~( secureinitFPCCR_LSPENS_MASK );
+
+ /* TS = 1 ==> Treat FP registers as secure i.e. callee saved FP
+ * registers (S16-S31) are also pushed to stack on exception entry and
+ * restored on exception return. */
+ *( secureinitFPCCR ) |= ( secureinitFPCCR_TS_MASK );
+ }
+}
+/*-----------------------------------------------------------*/
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.h
new file mode 100644
index 0000000..fc000cf
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/init/secure_init.h
@@ -0,0 +1,54 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __SECURE_INIT_H__
+#define __SECURE_INIT_H__
+
+/**
+ * @brief De-prioritizes the non-secure exceptions.
+ *
+ * This is needed to ensure that the non-secure PendSV runs at the lowest
+ * priority. Context switch is done in the non-secure PendSV handler.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ */
+void SecureInit_DePrioritizeNSExceptions( void );
+
+/**
+ * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access.
+ *
+ * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point
+ * Registers are not leaked to the non-secure side.
+ *
+ * @note This function must be called in the handler mode. It is no-op if called
+ * in the thread mode.
+ */
+void SecureInit_EnableNSFPUAccess( void );
+
+#endif /* __SECURE_INIT_H__ */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/macros/secure_port_macros.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/macros/secure_port_macros.h
new file mode 100644
index 0000000..1ca265d
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/ARMv8M/secure/macros/secure_port_macros.h
@@ -0,0 +1,140 @@
+/*
+ * FreeRTOS Kernel V10.5.1
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __SECURE_PORT_MACROS_H__
+#define __SECURE_PORT_MACROS_H__
+
+/**
+ * @brief Byte alignment requirements.
+ */
+#define secureportBYTE_ALIGNMENT 8
+#define secureportBYTE_ALIGNMENT_MASK ( 0x0007 )
+
+/**
+ * @brief Macro to declare a function as non-secure callable.
+ */
+#if defined( __IAR_SYSTEMS_ICC__ )
+ #define secureportNON_SECURE_CALLABLE __cmse_nonsecure_entry __root
+#else
+ #define secureportNON_SECURE_CALLABLE __attribute__( ( cmse_nonsecure_entry ) ) __attribute__( ( used ) )
+#endif
+
+/**
+ * @brief Set the secure PRIMASK value.
+ */
+#define secureportSET_SECURE_PRIMASK( ulPrimaskValue ) \
+ __asm volatile ( "msr primask, %0" : : "r" ( ulPrimaskValue ) : "memory" )
+
+/**
+ * @brief Set the non-secure PRIMASK value.
+ */
+#define secureportSET_NON_SECURE_PRIMASK( ulPrimaskValue ) \
+ __asm volatile ( "msr primask_ns, %0" : : "r" ( ulPrimaskValue ) : "memory" )
+
+/**
+ * @brief Read the PSP value in the given variable.
+ */
+#define secureportREAD_PSP( pucOutCurrentStackPointer ) \
+ __asm volatile ( "mrs %0, psp" : "=r" ( pucOutCurrentStackPointer ) )
+
+/**
+ * @brief Set the PSP to the given value.
+ */
+#define secureportSET_PSP( pucCurrentStackPointer ) \
+ __asm volatile ( "msr psp, %0" : : "r" ( pucCurrentStackPointer ) )
+
+/**
+ * @brief Read the PSPLIM value in the given variable.
+ */
+#define secureportREAD_PSPLIM( pucOutStackLimit ) \
+ __asm volatile ( "mrs %0, psplim" : "=r" ( pucOutStackLimit ) )
+
+/**
+ * @brief Set the PSPLIM to the given value.
+ */
+#define secureportSET_PSPLIM( pucStackLimit ) \
+ __asm volatile ( "msr psplim, %0" : : "r" ( pucStackLimit ) )
+
+/**
+ * @brief Set the NonSecure MSP to the given value.
+ */
+#define secureportSET_MSP_NS( pucMainStackPointer ) \
+ __asm volatile ( "msr msp_ns, %0" : : "r" ( pucMainStackPointer ) )
+
+/**
+ * @brief Set the CONTROL register to the given value.
+ */
+#define secureportSET_CONTROL( ulControl ) \
+ __asm volatile ( "msr control, %0" : : "r" ( ulControl ) : "memory" )
+
+/**
+ * @brief Read the Interrupt Program Status Register (IPSR) value in the given
+ * variable.
+ */
+#define secureportREAD_IPSR( ulIPSR ) \
+ __asm volatile ( "mrs %0, ipsr" : "=r" ( ulIPSR ) )
+
+/**
+ * @brief PRIMASK value to enable interrupts.
+ */
+#define secureportPRIMASK_ENABLE_INTERRUPTS_VAL 0
+
+/**
+ * @brief PRIMASK value to disable interrupts.
+ */
+#define secureportPRIMASK_DISABLE_INTERRUPTS_VAL 1
+
+/**
+ * @brief Disable secure interrupts.
+ */
+#define secureportDISABLE_SECURE_INTERRUPTS() secureportSET_SECURE_PRIMASK( secureportPRIMASK_DISABLE_INTERRUPTS_VAL )
+
+/**
+ * @brief Disable non-secure interrupts.
+ *
+ * This effectively disables context switches.
+ */
+#define secureportDISABLE_NON_SECURE_INTERRUPTS() secureportSET_NON_SECURE_PRIMASK( secureportPRIMASK_DISABLE_INTERRUPTS_VAL )
+
+/**
+ * @brief Enable non-secure interrupts.
+ */
+#define secureportENABLE_NON_SECURE_INTERRUPTS() secureportSET_NON_SECURE_PRIMASK( secureportPRIMASK_ENABLE_INTERRUPTS_VAL )
+
+/**
+ * @brief Assert definition.
+ */
+#define secureportASSERT( x ) \
+ if( ( x ) == 0 ) \
+ { \
+ secureportDISABLE_SECURE_INTERRUPTS(); \
+ secureportDISABLE_NON_SECURE_INTERRUPTS(); \
+ for( ; ; ) {; } \
+ }
+
+#endif /* __SECURE_PORT_MACROS_H__ */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/port.c
new file mode 100644
index 0000000..0210716
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/port.c
@@ -0,0 +1,245 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+Changes from V1.00:
+
+ + Call to taskYIELD() from within tick ISR has been replaced by the more
+ efficient portSWITCH_CONTEXT().
+ + ISR function definitions renamed to include the prv prefix.
+
+Changes from V2.6.1
+
+ + Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
+ macro to be consistent with the later ports.
+*/
+
+/*-----------------------------------------------------------
+ * Implementation of functions defined in portable.h for the Flashlite 186
+ * port.
+ *----------------------------------------------------------*/
+
+#include
+#include
+#include
+
+#include "FreeRTOS.h"
+#include "task.h"
+#include "portasm.h"
+
+/*lint -e950 Non ANSI reserved words okay in this file only. */
+
+#define portTIMER_EOI_TYPE ( 8 )
+#define portRESET_PIC() portOUTPUT_WORD( ( uint16_t ) 0xff22, portTIMER_EOI_TYPE )
+#define portTIMER_INT_NUMBER 0x12
+
+#define portTIMER_1_CONTROL_REGISTER ( ( uint16_t ) 0xff5e )
+#define portTIMER_0_CONTROL_REGISTER ( ( uint16_t ) 0xff56 )
+#define portTIMER_INTERRUPT_ENABLE ( ( uint16_t ) 0x2000 )
+
+/* Setup the hardware to generate the required tick frequency. */
+static void prvSetTickFrequency( uint32_t ulTickRateHz );
+
+/* Set the hardware back to the state as per before the scheduler started. */
+static void prvExitFunction( void );
+
+/* The ISR used depends on whether the preemptive or cooperative scheduler
+is being used. */
+#if( configUSE_PREEMPTION == 1 )
+ /* Tick service routine used by the scheduler when preemptive scheduling is
+ being used. */
+ static void __interrupt __far prvPreemptiveTick( void );
+#else
+ /* Tick service routine used by the scheduler when cooperative scheduling is
+ being used. */
+ static void __interrupt __far prvNonPreemptiveTick( void );
+#endif
+
+/* Trap routine used by taskYIELD() to manually cause a context switch. */
+static void __interrupt __far prvYieldProcessor( void );
+
+/*lint -e956 File scopes necessary here. */
+
+/* Set true when the vectors are set so the scheduler will service the tick. */
+static BaseType_t xSchedulerRunning = pdFALSE;
+
+/* Points to the original routine installed on the vector we use for manual
+context switches. This is then used to restore the original routine during
+prvExitFunction(). */
+static void ( __interrupt __far *pxOldSwitchISR )();
+
+/* Used to restore the original DOS context when the scheduler is ended. */
+static jmp_buf xJumpBuf;
+
+/*lint +e956 */
+
+/*-----------------------------------------------------------*/
+BaseType_t xPortStartScheduler( void )
+{
+ /* This is called with interrupts already disabled. */
+
+ /* Remember what was on the interrupts we are going to use
+ so we can put them back later if required. */
+ pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
+
+ /* Put our manual switch (yield) function on a known
+ vector. */
+ _dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
+
+ #if( configUSE_PREEMPTION == 1 )
+ {
+ /* Put our tick switch function on the timer interrupt. */
+ _dos_setvect( portTIMER_INT_NUMBER, prvPreemptiveTick );
+ }
+ #else
+ {
+ /* We want the timer interrupt to just increment the tick count. */
+ _dos_setvect( portTIMER_INT_NUMBER, prvNonPreemptiveTick );
+ }
+ #endif
+
+ prvSetTickFrequency( configTICK_RATE_HZ );
+
+ /* Clean up function if we want to return to DOS. */
+ if( setjmp( xJumpBuf ) != 0 )
+ {
+ prvExitFunction();
+ xSchedulerRunning = pdFALSE;
+ }
+ else
+ {
+ xSchedulerRunning = pdTRUE;
+
+ /* Kick off the scheduler by setting up the context of the first task. */
+ portFIRST_CONTEXT();
+ }
+
+ return xSchedulerRunning;
+}
+/*-----------------------------------------------------------*/
+
+/* The ISR used depends on whether the preemptive or cooperative scheduler
+is being used. */
+#if( configUSE_PREEMPTION == 1 )
+ static void __interrupt __far prvPreemptiveTick( void )
+ {
+ /* Get the scheduler to update the task states following the tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* Switch in the context of the next task to be run. */
+ portSWITCH_CONTEXT();
+ }
+
+ /* Reset the PIC ready for the next time. */
+ portRESET_PIC();
+ }
+#else
+ static void __interrupt __far prvNonPreemptiveTick( void )
+ {
+ /* Same as preemptive tick, but the cooperative scheduler is being used
+ so we don't have to switch in the context of the next task. */
+ xTaskIncrementTick();
+ portRESET_PIC();
+ }
+#endif
+/*-----------------------------------------------------------*/
+
+static void __interrupt __far prvYieldProcessor( void )
+{
+ /* Switch in the context of the next task to be run. */
+ portSWITCH_CONTEXT();
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* Jump back to the processor state prior to starting the
+ scheduler. This means we are not going to be using a
+ task stack frame so the task can be deleted. */
+ longjmp( xJumpBuf, 1 );
+}
+/*-----------------------------------------------------------*/
+
+static void prvExitFunction( void )
+{
+const uint16_t usTimerDisable = 0x0000;
+uint16_t usTimer0Control;
+
+ /* Interrupts should be disabled here anyway - but no
+ harm in making sure. */
+ portDISABLE_INTERRUPTS();
+ if( xSchedulerRunning == pdTRUE )
+ {
+ /* Put back the switch interrupt routines that was in place
+ before the scheduler started. */
+ _dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
+ }
+
+ /* Disable the timer used for the tick to ensure the scheduler is
+ not called before restoring interrupts. There was previously nothing
+ on this timer so there is no old ISR to restore. */
+ portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerDisable );
+
+ /* Restart the DOS tick. */
+ usTimer0Control = portINPUT_WORD( portTIMER_0_CONTROL_REGISTER );
+ usTimer0Control |= portTIMER_INTERRUPT_ENABLE;
+ portOUTPUT_WORD( portTIMER_0_CONTROL_REGISTER, usTimer0Control );
+
+
+ portENABLE_INTERRUPTS();
+}
+/*-----------------------------------------------------------*/
+
+static void prvSetTickFrequency( uint32_t ulTickRateHz )
+{
+const uint16_t usMaxCountRegister = 0xff5a;
+const uint16_t usTimerPriorityRegister = 0xff32;
+const uint16_t usTimerEnable = 0xC000;
+const uint16_t usRetrigger = 0x0001;
+const uint16_t usTimerHighPriority = 0x0000;
+uint16_t usTimer0Control;
+
+/* ( CPU frequency / 4 ) / clock 2 max count [inpw( 0xff62 ) = 7] */
+
+const uint32_t ulClockFrequency = ( uint32_t ) 0x7f31a0UL;
+
+uint32_t ulTimerCount = ulClockFrequency / ulTickRateHz;
+
+ portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerEnable | portTIMER_INTERRUPT_ENABLE | usRetrigger );
+ portOUTPUT_WORD( usMaxCountRegister, ( uint16_t ) ulTimerCount );
+ portOUTPUT_WORD( usTimerPriorityRegister, usTimerHighPriority );
+
+ /* Stop the DOS tick - don't do this if you want to maintain a TOD clock. */
+ usTimer0Control = portINPUT_WORD( portTIMER_0_CONTROL_REGISTER );
+ usTimer0Control &= ~portTIMER_INTERRUPT_ENABLE;
+ portOUTPUT_WORD( portTIMER_0_CONTROL_REGISTER, usTimer0Control );
+}
+
+
+/*lint +e950 */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/prtmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/prtmacro.h
new file mode 100644
index 0000000..80d9637
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/Flsh186/prtmacro.h
@@ -0,0 +1,98 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Type definitions. */
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE long
+#define portLONG long
+#define portSHORT int
+#define portSTACK_TYPE uint16_t
+#define portBASE_TYPE portSHORT
+
+typedef portSTACK_TYPE StackType_t;
+typedef short BaseType_t;
+typedef unsigned short UBaseType_t;
+
+#if( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+#else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+#endif
+/*-----------------------------------------------------------*/
+
+/* Critical section handling. */
+#define portENTER_CRITICAL() __asm{ pushf } \
+ __asm{ cli } \
+
+#define portEXIT_CRITICAL() __asm{ popf }
+
+#define portDISABLE_INTERRUPTS() __asm{ cli }
+
+#define portENABLE_INTERRUPTS() __asm{ sti }
+/*-----------------------------------------------------------*/
+
+/* Hardware specifics. */
+#define portNOP() __asm{ nop }
+#define portSTACK_GROWTH ( -1 )
+#define portSWITCH_INT_NUMBER 0x80
+#define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+#define portBYTE_ALIGNMENT 2
+#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
+/*-----------------------------------------------------------*/
+
+/* Compiler specifics. */
+#define portINPUT_BYTE( xAddr ) inp( xAddr )
+#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
+#define portINPUT_WORD( xAddr ) inpw( xAddr )
+#define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
+
+/*-----------------------------------------------------------*/
+
+/* Task function macros as described on the FreeRTOS.org WEB site. */
+#define portTASK_FUNCTION_PROTO( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
+#define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
+
+#endif /* PORTMACRO_H */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/port.c
new file mode 100644
index 0000000..c3b0564
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/port.c
@@ -0,0 +1,289 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+Changes from V2.6.1
+
+ + Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
+ macro to be consistent with the later ports.
+
+Changes from V4.0.1
+
+ + Add function prvSetTickFrequencyDefault() to set the DOS tick back to
+ its proper value when the scheduler exits.
+*/
+
+#include
+#include
+#include
+
+#include "FreeRTOS.h"
+#include "task.h"
+#include "portasm.h"
+
+/*-----------------------------------------------------------
+ * Implementation of functions defined in portable.h for the industrial
+ * PC port.
+ *----------------------------------------------------------*/
+
+/*lint -e950 Non ANSI reserved words okay in this file only. */
+
+#define portTIMER_INT_NUMBER 0x08
+
+/* Setup hardware for required tick interrupt rate. */
+static void prvSetTickFrequency( uint32_t ulTickRateHz );
+
+/* Restore hardware to as it was prior to starting the scheduler. */
+static void prvExitFunction( void );
+
+/* Either chain to the DOS tick (which itself clears the PIC) or clear the PIC
+directly. We chain to the DOS tick as close as possible to the standard DOS
+tick rate. */
+static void prvPortResetPIC( void );
+
+/* The ISR used depends on whether the preemptive or cooperative
+scheduler is being used. */
+#if( configUSE_PREEMPTION == 1 )
+ /* Tick service routine used by the scheduler when preemptive scheduling is
+ being used. */
+ static void __interrupt __far prvPreemptiveTick( void );
+#else
+ /* Tick service routine used by the scheduler when cooperative scheduling is
+ being used. */
+ static void __interrupt __far prvNonPreemptiveTick( void );
+#endif
+
+/* Trap routine used by taskYIELD() to manually cause a context switch. */
+static void __interrupt __far prvYieldProcessor( void );
+
+/* Set the tick frequency back so the floppy drive works correctly when the
+scheduler exits. */
+static void prvSetTickFrequencyDefault( void );
+
+/*lint -e956 File scopes necessary here. */
+
+/* Used to signal when to chain to the DOS tick, and when to just clear the PIC ourselves. */
+static int16_t sDOSTickCounter;
+
+/* Set true when the vectors are set so the scheduler will service the tick. */
+static BaseType_t xSchedulerRunning = pdFALSE;
+
+/* Points to the original routine installed on the vector we use for manual context switches. This is then used to restore the original routine during prvExitFunction(). */
+static void ( __interrupt __far *pxOldSwitchISR )();
+
+/* Points to the original routine installed on the vector we use to chain to the DOS tick. This is then used to restore the original routine during prvExitFunction(). */
+static void ( __interrupt __far *pxOldSwitchISRPlus1 )();
+
+/* Used to restore the original DOS context when the scheduler is ended. */
+static jmp_buf xJumpBuf;
+
+/*lint +e956 */
+
+/*-----------------------------------------------------------*/
+BaseType_t xPortStartScheduler( void )
+{
+pxISR pxOriginalTickISR;
+
+ /* This is called with interrupts already disabled. */
+
+ /* Remember what was on the interrupts we are going to use
+ so we can put them back later if required. */
+ pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
+ pxOriginalTickISR = _dos_getvect( portTIMER_INT_NUMBER );
+ pxOldSwitchISRPlus1 = _dos_getvect( portSWITCH_INT_NUMBER + 1 );
+
+ prvSetTickFrequency( configTICK_RATE_HZ );
+
+ /* Put our manual switch (yield) function on a known
+ vector. */
+ _dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
+
+ /* Put the old tick on a different interrupt number so we can
+ call it when we want. */
+ _dos_setvect( portSWITCH_INT_NUMBER + 1, pxOriginalTickISR );
+
+ /* The ISR used depends on whether the preemptive or cooperative
+ scheduler is being used. */
+ #if( configUSE_PREEMPTION == 1 )
+ {
+ /* Put our tick switch function on the timer interrupt. */
+ _dos_setvect( portTIMER_INT_NUMBER, prvPreemptiveTick );
+ }
+ #else
+ {
+ /* We want the timer interrupt to just increment the tick count. */
+ _dos_setvect( portTIMER_INT_NUMBER, prvNonPreemptiveTick );
+ }
+ #endif
+
+ /* Setup a counter that is used to call the DOS interrupt as close
+ to it's original frequency as can be achieved given our chosen tick
+ frequency. */
+ sDOSTickCounter = portTICKS_PER_DOS_TICK;
+
+ /* Clean up function if we want to return to DOS. */
+ if( setjmp( xJumpBuf ) != 0 )
+ {
+ prvExitFunction();
+ xSchedulerRunning = pdFALSE;
+ }
+ else
+ {
+ xSchedulerRunning = pdTRUE;
+
+ /* Kick off the scheduler by setting up the context of the first task. */
+ portFIRST_CONTEXT();
+ }
+
+ return xSchedulerRunning;
+}
+/*-----------------------------------------------------------*/
+
+/* The ISR used depends on whether the preemptive or cooperative
+scheduler is being used. */
+#if( configUSE_PREEMPTION == 1 )
+ static void __interrupt __far prvPreemptiveTick( void )
+ {
+ /* Get the scheduler to update the task states following the tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* Switch in the context of the next task to be run. */
+ portSWITCH_CONTEXT();
+ }
+
+ /* Reset the PIC ready for the next time. */
+ prvPortResetPIC();
+ }
+#else
+ static void __interrupt __far prvNonPreemptiveTick( void )
+ {
+ /* Same as preemptive tick, but the cooperative scheduler is being used
+ so we don't have to switch in the context of the next task. */
+ xTaskIncrementTick();
+ prvPortResetPIC();
+ }
+#endif
+/*-----------------------------------------------------------*/
+
+static void __interrupt __far prvYieldProcessor( void )
+{
+ /* Switch in the context of the next task to be run. */
+ portSWITCH_CONTEXT();
+}
+/*-----------------------------------------------------------*/
+
+static void prvPortResetPIC( void )
+{
+ /* We are going to call the DOS tick interrupt at as close a
+ frequency to the normal DOS tick as possible. */
+
+ /* WE SHOULD NOT DO THIS IF YIELD WAS CALLED. */
+ --sDOSTickCounter;
+ if( sDOSTickCounter <= 0 )
+ {
+ sDOSTickCounter = ( int16_t ) portTICKS_PER_DOS_TICK;
+ __asm{ int portSWITCH_INT_NUMBER + 1 };
+ }
+ else
+ {
+ /* Reset the PIC as the DOS tick is not being called to
+ do it. */
+ __asm
+ {
+ mov al, 20H
+ out 20H, al
+ };
+ }
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* Jump back to the processor state prior to starting the
+ scheduler. This means we are not going to be using a
+ task stack frame so the task can be deleted. */
+ longjmp( xJumpBuf, 1 );
+}
+/*-----------------------------------------------------------*/
+
+static void prvExitFunction( void )
+{
+void ( __interrupt __far *pxOriginalTickISR )();
+
+ /* Interrupts should be disabled here anyway - but no
+ harm in making sure. */
+ portDISABLE_INTERRUPTS();
+ if( xSchedulerRunning == pdTRUE )
+ {
+ /* Set the DOS tick back onto the timer ticker. */
+ pxOriginalTickISR = _dos_getvect( portSWITCH_INT_NUMBER + 1 );
+ _dos_setvect( portTIMER_INT_NUMBER, pxOriginalTickISR );
+ prvSetTickFrequencyDefault();
+
+ /* Put back the switch interrupt routines that was in place
+ before the scheduler started. */
+ _dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
+ _dos_setvect( portSWITCH_INT_NUMBER + 1, pxOldSwitchISRPlus1 );
+ }
+ /* The tick timer is back how DOS wants it. We can re-enable
+ interrupts without the scheduler being called. */
+ portENABLE_INTERRUPTS();
+}
+/*-----------------------------------------------------------*/
+
+static void prvSetTickFrequency( uint32_t ulTickRateHz )
+{
+const uint16_t usPIT_MODE = ( uint16_t ) 0x43;
+const uint16_t usPIT0 = ( uint16_t ) 0x40;
+const uint32_t ulPIT_CONST = ( uint32_t ) 1193180UL;
+const uint16_t us8254_CTR0_MODE3 = ( uint16_t ) 0x36;
+uint32_t ulOutput;
+
+ /* Setup the 8245 to tick at the wanted frequency. */
+ portOUTPUT_BYTE( usPIT_MODE, us8254_CTR0_MODE3 );
+ ulOutput = ulPIT_CONST / ulTickRateHz;
+ portOUTPUT_BYTE( usPIT0, ( uint16_t )( ulOutput & ( uint32_t ) 0xff ) );
+ ulOutput >>= 8;
+ portOUTPUT_BYTE( usPIT0, ( uint16_t ) ( ulOutput & ( uint32_t ) 0xff ) );
+}
+/*-----------------------------------------------------------*/
+
+static void prvSetTickFrequencyDefault( void )
+{
+const uint16_t usPIT_MODE = ( uint16_t ) 0x43;
+const uint16_t usPIT0 = ( uint16_t ) 0x40;
+const uint16_t us8254_CTR0_MODE3 = ( uint16_t ) 0x36;
+
+ portOUTPUT_BYTE( usPIT_MODE, us8254_CTR0_MODE3 );
+ portOUTPUT_BYTE( usPIT0,0 );
+ portOUTPUT_BYTE( usPIT0,0 );
+}
+
+
+/*lint +e950 */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/prtmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/prtmacro.h
new file mode 100644
index 0000000..f4a1716
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/PC/prtmacro.h
@@ -0,0 +1,98 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Type definitions. */
+#define portCHAR char
+#define portFLOAT long
+#define portDOUBLE long
+#define portLONG long
+#define portSHORT int
+#define portSTACK_TYPE uint16_t
+#define portBASE_TYPE portSHORT
+
+typedef portSTACK_TYPE StackType_t;
+typedef short BaseType_t;
+typedef unsigned short UBaseType_t;
+
+#if( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+#else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+#endif
+/*-----------------------------------------------------------*/
+
+/* Critical section management. */
+#define portENTER_CRITICAL() __asm{ pushf } \
+ __asm{ cli } \
+
+#define portEXIT_CRITICAL() __asm{ popf }
+
+#define portDISABLE_INTERRUPTS() __asm{ cli }
+
+#define portENABLE_INTERRUPTS() __asm{ sti }
+/*-----------------------------------------------------------*/
+
+/* Hardware specifics. */
+#define portNOP() __asm{ nop }
+#define portSTACK_GROWTH ( -1 )
+#define portSWITCH_INT_NUMBER 0x80
+#define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
+#define portDOS_TICK_RATE ( 18.20648 )
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+#define portTICKS_PER_DOS_TICK ( ( uint16_t ) ( ( ( portDOUBLE ) configTICK_RATE_HZ / portDOS_TICK_RATE ) + 0.5 ) )
+#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
+#define portBYTE_ALIGNMENT ( 2 )
+/*-----------------------------------------------------------*/
+
+/* Compiler specifics. */
+#define portINPUT_BYTE( xAddr ) inp( xAddr )
+#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
+
+/*-----------------------------------------------------------*/
+
+/* Task function macros as described on the FreeRTOS.org WEB site. */
+#define portTASK_FUNCTION_PROTO( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
+#define portTASK_FUNCTION( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
+
+#endif /* PORTMACRO_H */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portasm.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portasm.h
new file mode 100644
index 0000000..1767b9c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portasm.h
@@ -0,0 +1,88 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORT_ASM_H
+#define PORT_ASM_H
+
+typedef void TCB_t;
+extern volatile TCB_t * volatile pxCurrentTCB;
+extern void vTaskSwitchContext( void );
+
+/*
+ * Saves the stack pointer for one task into its TCB, calls
+ * vTaskSwitchContext() to update the TCB being used, then restores the stack
+ * from the new TCB read to run the task.
+ */
+void portSWITCH_CONTEXT( void );
+
+/*
+ * Load the stack pointer from the TCB of the task which is going to be first
+ * to execute. Then force an IRET so the registers and IP are popped off the
+ * stack.
+ */
+void portFIRST_CONTEXT( void );
+
+/* There are slightly different versions depending on whether you are building
+to include debugger information. If debugger information is used then there
+are a couple of extra bytes left of the ISR stack (presumably for use by the
+debugger). The true stack pointer is then stored in the bp register. We add
+2 to the stack pointer to remove the extra bytes before we restore our context. */
+
+#define portSWITCH_CONTEXT() \
+ asm { mov ax, seg pxCurrentTCB } \
+ asm { mov ds, ax } \
+ asm { les bx, pxCurrentTCB } /* Save the stack pointer into the TCB. */ \
+ asm { mov es:0x2[ bx ], ss } \
+ asm { mov es:[ bx ], sp } \
+ asm { call far ptr vTaskSwitchContext } /* Perform the switch. */ \
+ asm { mov ax, seg pxCurrentTCB } /* Restore the stack pointer from the TCB. */ \
+ asm { mov ds, ax } \
+ asm { les bx, dword ptr pxCurrentTCB } \
+ asm { mov ss, es:[ bx + 2 ] } \
+ asm { mov sp, es:[ bx ] }
+
+#define portFIRST_CONTEXT() \
+ __asm { mov ax, seg pxCurrentTCB } \
+ __asm { mov ds, ax } \
+ __asm { les bx, dword ptr pxCurrentTCB } \
+ __asm { mov ss, es:[ bx + 2 ] } \
+ __asm { mov sp, es:[ bx ] } \
+ __asm { pop bp } \
+ __asm { pop di } \
+ __asm { pop si } \
+ __asm { pop ds } \
+ __asm { pop es } \
+ __asm { pop dx } \
+ __asm { pop cx } \
+ __asm { pop bx } \
+ __asm { pop ax } \
+ __asm { iret }
+
+
+#endif
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portcomn.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portcomn.c
new file mode 100644
index 0000000..c01a24c
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/BCC/16BitDOS/common/portcomn.c
@@ -0,0 +1,121 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*
+Changes from V1.00:
+
+ + pxPortInitialiseStack() now initialises the stack of new tasks to the
+ same format used by the compiler. This allows the compiler generated
+ interrupt mechanism to be used for context switches.
+
+Changes from V2.6.1
+
+ + Move usPortCheckFreeStackSpace() to tasks.c.
+*/
+
+
+#include
+#include
+#include "FreeRTOS.h"
+
+/*-----------------------------------------------------------*/
+
+/* See header file for description. */
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
+{
+StackType_t DS_Reg = 0;
+
+ /* Place a few bytes of known values on the bottom of the stack.
+ This is just useful for debugging. */
+
+ *pxTopOfStack = 0x1111;
+ pxTopOfStack--;
+ *pxTopOfStack = 0x2222;
+ pxTopOfStack--;
+ *pxTopOfStack = 0x3333;
+ pxTopOfStack--;
+ *pxTopOfStack = 0x4444;
+ pxTopOfStack--;
+ *pxTopOfStack = 0x5555;
+ pxTopOfStack--;
+
+
+ /*lint -e950 -e611 -e923 Lint doesn't like this much - but nothing I can do about it. */
+
+ /* We are going to start the scheduler using a return from interrupt
+ instruction to load the program counter, so first there would be the
+ function call with parameters preamble. */
+
+ *pxTopOfStack = FP_SEG( pvParameters );
+ pxTopOfStack--;
+ *pxTopOfStack = FP_OFF( pvParameters );
+ pxTopOfStack--;
+ *pxTopOfStack = FP_SEG( pxCode );
+ pxTopOfStack--;
+ *pxTopOfStack = FP_OFF( pxCode );
+ pxTopOfStack--;
+
+ /* Next the status register and interrupt return address. */
+ *pxTopOfStack = portINITIAL_SW;
+ pxTopOfStack--;
+ *pxTopOfStack = FP_SEG( pxCode );
+ pxTopOfStack--;
+ *pxTopOfStack = FP_OFF( pxCode );
+ pxTopOfStack--;
+
+ /* The remaining registers would be pushed on the stack by our context
+ switch function. These are loaded with values simply to make debugging
+ easier. */
+ *pxTopOfStack = ( StackType_t ) 0xAAAA; /* AX */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xBBBB; /* BX */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xCCCC; /* CX */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xDDDD; /* DX */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xEEEE; /* ES */
+ pxTopOfStack--;
+
+ /* We need the true data segment. */
+ __asm{ MOV DS_Reg, DS };
+
+ *pxTopOfStack = DS_Reg; /* DS */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x0123; /* SI */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xDDDD; /* DI */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xBBBB; /* BP */
+
+ /*lint +e950 +e611 +e923 */
+
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/port.c
new file mode 100644
index 0000000..b5df2a4
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/port.c
@@ -0,0 +1,609 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*-----------------------------------------------------------
+* Implementation of functions defined in portable.h for the ARM CM3 port.
+*----------------------------------------------------------*/
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+#if ( configMAX_SYSCALL_INTERRUPT_PRIORITY == 0 )
+ #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http: /*www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
+#endif
+
+#ifndef configSYSTICK_CLOCK_HZ
+ #define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ
+ /* Ensure the SysTick is clocked at the same frequency as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL )
+#else
+
+/* The way the SysTick is clocked is not modified in case it is not the same
+ * as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT ( 0 )
+#endif
+
+/* Constants required to manipulate the core. Registers first... */
+#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
+#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
+#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
+#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
+/* ...then bits in the registers. */
+#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
+#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
+#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
+#define portNVIC_PENDSVCLEAR_BIT ( 1UL << 27UL )
+#define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL )
+
+#define portNVIC_PENDSV_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )
+#define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
+
+/* Constants required to check the validity of an interrupt priority. */
+#define portFIRST_USER_INTERRUPT_NUMBER ( 16 )
+#define portNVIC_IP_REGISTERS_OFFSET_16 ( 0xE000E3F0 )
+#define portAIRCR_REG ( *( ( volatile uint32_t * ) 0xE000ED0C ) )
+#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
+#define portTOP_BIT_OF_BYTE ( ( uint8_t ) 0x80 )
+#define portMAX_PRIGROUP_BITS ( ( uint8_t ) 7 )
+#define portPRIORITY_GROUP_MASK ( 0x07UL << 8UL )
+#define portPRIGROUP_SHIFT ( 8UL )
+
+/* Masks off all bits but the VECTACTIVE bits in the ICSR register. */
+#define portVECTACTIVE_MASK ( 0xFFUL )
+
+/* Constants required to set up the initial stack. */
+#define portINITIAL_XPSR ( 0x01000000 )
+
+/* The systick is a 24-bit counter. */
+#define portMAX_24_BIT_NUMBER ( 0xffffffUL )
+
+/* A fiddle factor to estimate the number of SysTick counts that would have
+ * occurred while the SysTick counter is stopped during tickless idle
+ * calculations. */
+#define portMISSED_COUNTS_FACTOR ( 45UL )
+
+/* For strict compliance with the Cortex-M spec the task start address should
+ * have bit-0 clear, as it is loaded into the PC on exit from an ISR. */
+#define portSTART_ADDRESS_MASK ( ( StackType_t ) 0xfffffffeUL )
+
+/*
+ * Setup the timer to generate the tick interrupts. The implementation in this
+ * file is weak to allow application writers to change the timer used to
+ * generate the tick interrupt.
+ */
+void vPortSetupTimerInterrupt( void );
+
+/*
+ * Exception handlers.
+ */
+void xPortSysTickHandler( void );
+
+/*
+ * Start first task is a separate function so it can be tested in isolation.
+ */
+extern void vPortStartFirstTask( void );
+
+/*
+ * Used to catch tasks that attempt to return from their implementing function.
+ */
+static void prvTaskExitError( void );
+
+/*-----------------------------------------------------------*/
+
+/* Required to allow portasm.asm access the configMAX_SYSCALL_INTERRUPT_PRIORITY
+ * setting. */
+const uint32_t ulMaxSyscallInterruptPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY;
+
+/* Each task maintains its own interrupt status in the critical nesting
+ * variable. */
+static UBaseType_t uxCriticalNesting = 0xaaaaaaaa;
+
+/*
+ * The number of SysTick increments that make up one tick period.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t ulTimerCountsForOneTick = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * The maximum number of tick periods that can be suppressed is limited by the
+ * 24 bit resolution of the SysTick timer.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t xMaximumPossibleSuppressedTicks = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low
+ * power functionality only.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t ulStoppedTimerCompensation = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * Used by the portASSERT_IF_INTERRUPT_PRIORITY_INVALID() macro to ensure
+ * FreeRTOS API functions are not called from interrupts that have been assigned
+ * a priority above configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ */
+#if ( configASSERT_DEFINED == 1 )
+ static uint8_t ucMaxSysCallPriority = 0;
+ static uint32_t ulMaxPRIGROUPValue = 0;
+ static const volatile uint8_t * const pcInterruptPriorityRegisters = ( uint8_t * ) portNVIC_IP_REGISTERS_OFFSET_16;
+#endif /* configASSERT_DEFINED */
+
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters )
+{
+ /* Simulate the stack frame as it would be created by a context switch
+ * interrupt. */
+
+ /* Offset added to account for the way the MCU uses the stack on entry/exit
+ * of interrupts, and to ensure alignment. */
+ pxTopOfStack--;
+
+ *pxTopOfStack = portINITIAL_XPSR; /* xPSR */
+ pxTopOfStack--;
+ *pxTopOfStack = ( ( StackType_t ) pxCode ) & portSTART_ADDRESS_MASK; /* PC */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) prvTaskExitError; /* LR */
+
+ /* Save code space by skipping register initialisation. */
+ pxTopOfStack -= 5; /* R12, R3, R2 and R1. */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
+
+ pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */
+
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+static void prvTaskExitError( void )
+{
+ /* A function that implements a task must not exit or attempt to return to
+ * its caller as there is nothing to return to. If a task wants to exit it
+ * should instead call vTaskDelete( NULL ).
+ *
+ * Artificially force an assert() to be triggered if configASSERT() is
+ * defined, then stop here so application writers can catch the error. */
+ configASSERT( uxCriticalNesting == ~0UL );
+ portDISABLE_INTERRUPTS();
+
+ for( ; ; )
+ {
+ }
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+BaseType_t xPortStartScheduler( void )
+{
+ #if ( configASSERT_DEFINED == 1 )
+ {
+ volatile uint32_t ulOriginalPriority;
+ volatile uint8_t * const pucFirstUserPriorityRegister = ( uint8_t * ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );
+ volatile uint8_t ucMaxPriorityValue;
+
+ /* Determine the maximum priority from which ISR safe FreeRTOS API
+ * functions can be called. ISR safe functions are those that end in
+ * "FromISR". FreeRTOS maintains separate thread and ISR API functions to
+ * ensure interrupt entry is as fast and simple as possible.
+ *
+ * Save the interrupt priority value that is about to be clobbered. */
+ ulOriginalPriority = *pucFirstUserPriorityRegister;
+
+ /* Determine the number of priority bits available. First write to all
+ * possible bits. */
+ *pucFirstUserPriorityRegister = portMAX_8_BIT_VALUE;
+
+ /* Read the value back to see how many bits stuck. */
+ ucMaxPriorityValue = *pucFirstUserPriorityRegister;
+
+ /* Use the same mask on the maximum system call priority. */
+ ucMaxSysCallPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY & ucMaxPriorityValue;
+
+ /* Calculate the maximum acceptable priority group value for the number
+ * of bits read back. */
+ ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS;
+
+ while( ( ucMaxPriorityValue & portTOP_BIT_OF_BYTE ) == portTOP_BIT_OF_BYTE )
+ {
+ ulMaxPRIGROUPValue--;
+ ucMaxPriorityValue <<= ( uint8_t ) 0x01;
+ }
+
+ #ifdef __NVIC_PRIO_BITS
+ {
+ /* Check the CMSIS configuration that defines the number of
+ * priority bits matches the number of priority bits actually queried
+ * from the hardware. */
+ configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
+ }
+ #endif
+
+ #ifdef configPRIO_BITS
+ {
+ /* Check the FreeRTOS configuration that defines the number of
+ * priority bits matches the number of priority bits actually queried
+ * from the hardware. */
+ configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
+ }
+ #endif
+
+ /* Shift the priority group value back to its position within the AIRCR
+ * register. */
+ ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
+ ulMaxPRIGROUPValue &= portPRIORITY_GROUP_MASK;
+
+ /* Restore the clobbered interrupt priority register to its original
+ * value. */
+ *pucFirstUserPriorityRegister = ulOriginalPriority;
+ }
+ #endif /* configASSERT_DEFINED */
+
+ /* Make PendSV and SysTick the lowest priority interrupts. */
+ portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
+ portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
+
+ /* Start the timer that generates the tick ISR. Interrupts are disabled
+ * here already. */
+ vPortSetupTimerInterrupt();
+
+ /* Initialise the critical nesting count ready for the first task. */
+ uxCriticalNesting = 0;
+
+ /* Start the first task. */
+ vPortStartFirstTask();
+
+ /* Should not get here! */
+ return 0;
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* Not implemented in ports where there is nothing to return to.
+ * Artificially force an assert. */
+ configASSERT( uxCriticalNesting == 1000UL );
+}
+/*-----------------------------------------------------------*/
+
+void vPortEnterCritical( void )
+{
+ portDISABLE_INTERRUPTS();
+ uxCriticalNesting++;
+
+ /* This is not the interrupt safe version of the enter critical function so
+ * assert() if it is being called from an interrupt context. Only API
+ * functions that end in "FromISR" can be used in an interrupt. Only assert if
+ * the critical nesting count is 1 to protect against recursive calls if the
+ * assert function also uses a critical section. */
+ if( uxCriticalNesting == 1 )
+ {
+ configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );
+ }
+}
+/*-----------------------------------------------------------*/
+
+void vPortExitCritical( void )
+{
+ configASSERT( uxCriticalNesting );
+ uxCriticalNesting--;
+
+ if( uxCriticalNesting == 0 )
+ {
+ portENABLE_INTERRUPTS();
+ }
+}
+/*-----------------------------------------------------------*/
+
+void xPortSysTickHandler( void )
+{
+ /* The SysTick runs at the lowest interrupt priority, so when this interrupt
+ * executes all interrupts must be unmasked. There is therefore no need to
+ * save and then restore the interrupt mask value as its value is already
+ * known. */
+ ( void ) portSET_INTERRUPT_MASK_FROM_ISR();
+ {
+ /* Increment the RTOS tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* A context switch is required. Context switching is performed in
+ * the PendSV interrupt. Pend the PendSV interrupt. */
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
+ }
+ }
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
+}
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TICKLESS_IDLE == 1 )
+
+ #pragma WEAK( vPortSuppressTicksAndSleep )
+ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
+ {
+ uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements;
+ TickType_t xModifiableIdleTime;
+
+ /* Make sure the SysTick reload value does not overflow the counter. */
+ if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
+ {
+ xExpectedIdleTime = xMaximumPossibleSuppressedTicks;
+ }
+
+ /* Stop the SysTick momentarily. The time the SysTick is stopped for
+ * is accounted for as best it can be, but using the tickless mode will
+ * inevitably result in some tiny drift of the time maintained by the
+ * kernel with respect to calendar time. */
+ portNVIC_SYSTICK_CTRL_REG &= ~portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Calculate the reload value required to wait xExpectedIdleTime
+ * tick periods. -1 is used because this code will execute part way
+ * through one of the tick periods. */
+ ulReloadValue = portNVIC_SYSTICK_CURRENT_VALUE_REG + ( ulTimerCountsForOneTick * ( xExpectedIdleTime - 1UL ) );
+
+ if( ulReloadValue > ulStoppedTimerCompensation )
+ {
+ ulReloadValue -= ulStoppedTimerCompensation;
+ }
+
+ /* Enter a critical section but don't use the taskENTER_CRITICAL()
+ * method as that will mask interrupts that should exit sleep mode. */
+ __asm( " cpsid i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* If a context switch is pending or a task is waiting for the scheduler
+ * to be unsuspended then abandon the low power entry. */
+ if( eTaskConfirmSleepModeStatus() == eAbortSleep )
+ {
+ /* Restart from whatever is left in the count register to complete
+ * this tick period. */
+ portNVIC_SYSTICK_LOAD_REG = portNVIC_SYSTICK_CURRENT_VALUE_REG;
+
+ /* Restart SysTick. */
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Reset the reload register to the value required for normal tick
+ * periods. */
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+
+ /* Re-enable interrupts - see comments above __disable_interrupt()
+ * call above. */
+ __asm( " cpsie i");
+ }
+ else
+ {
+ /* Set the new reload value. */
+ portNVIC_SYSTICK_LOAD_REG = ulReloadValue;
+
+ /* Clear the SysTick count flag and set the count value back to
+ * zero. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Restart SysTick. */
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Sleep until something happens. configPRE_SLEEP_PROCESSING() can
+ * set its parameter to 0 to indicate that its implementation contains
+ * its own wait for interrupt or wait for event instruction, and so wfi
+ * should not be executed again. However, the original expected idle
+ * time variable must remain unmodified, so a copy is taken. */
+ xModifiableIdleTime = xExpectedIdleTime;
+ configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
+
+ if( xModifiableIdleTime > 0 )
+ {
+ __asm( " dsb");
+ __asm( " wfi");
+ __asm( " isb");
+ }
+
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );
+
+ /* Re-enable interrupts to allow the interrupt that brought the MCU
+ * out of sleep mode to execute immediately. see comments above
+ * __disable_interrupt() call above. */
+ __asm( " cpsie i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* Disable interrupts again because the clock is about to be stopped
+ * and interrupts that execute while the clock is stopped will increase
+ * any slippage between the time maintained by the RTOS and calendar
+ * time. */
+ __asm( " cpsid i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* Disable the SysTick clock without reading the
+ * portNVIC_SYSTICK_CTRL_REG register to ensure the
+ * portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,
+ * the time the SysTick is stopped for is accounted for as best it can
+ * be, but using the tickless mode will inevitably result in some tiny
+ * drift of the time maintained by the kernel with respect to calendar
+ * time*/
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );
+
+ /* Determine if the SysTick clock has already counted to zero and
+ * been set back to the current reload value (the reload back being
+ * correct for the entire expected idle time) or if the SysTick is yet
+ * to count to zero (in which case an interrupt other than the SysTick
+ * must have brought the system out of sleep mode). */
+ if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )
+ {
+ uint32_t ulCalculatedLoadValue;
+
+ /* The tick interrupt is already pending, and the SysTick count
+ * reloaded with ulReloadValue. Reset the
+ * portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick
+ * period. */
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );
+
+ /* Don't allow a tiny value, or values that have somehow
+ * underflowed because the post sleep hook did something
+ * that took too long. */
+ if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )
+ {
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );
+ }
+
+ portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;
+
+ /* As the pending tick will be processed as soon as this
+ * function exits, the tick value maintained by the tick is stepped
+ * forward by one less than the time spent waiting. */
+ ulCompleteTickPeriods = xExpectedIdleTime - 1UL;
+ }
+ else
+ {
+ /* Something other than the tick interrupt ended the sleep.
+ * Work out how long the sleep lasted rounded to complete tick
+ * periods (not the ulReload value which accounted for part
+ * ticks). */
+ ulCompletedSysTickDecrements = ( xExpectedIdleTime * ulTimerCountsForOneTick ) - portNVIC_SYSTICK_CURRENT_VALUE_REG;
+
+ /* How many complete tick periods passed while the processor
+ * was waiting? */
+ ulCompleteTickPeriods = ulCompletedSysTickDecrements / ulTimerCountsForOneTick;
+
+ /* The reload value is set to whatever fraction of a single tick
+ * period remains. */
+ portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;
+ }
+
+ /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG
+ * again, then set portNVIC_SYSTICK_LOAD_REG back to its standard
+ * value. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+ vTaskStepTick( ulCompleteTickPeriods );
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+
+ /* Exit with interrupts enabled. */
+ __asm( " cpsie i");
+ }
+ }
+
+#endif /* configUSE_TICKLESS_IDLE */
+/*-----------------------------------------------------------*/
+
+/*
+ * Setup the systick timer to generate the tick interrupts at the required
+ * frequency.
+ */
+#pragma WEAK( vPortSetupTimerInterrupt )
+void vPortSetupTimerInterrupt( void )
+{
+ /* Calculate the constants required to configure the tick interrupt. */
+ #if ( configUSE_TICKLESS_IDLE == 1 )
+ {
+ ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );
+ xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;
+ ulStoppedTimerCompensation = portMISSED_COUNTS_FACTOR / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );
+ }
+ #endif /* configUSE_TICKLESS_IDLE */
+
+ /* Stop and clear the SysTick. */
+ portNVIC_SYSTICK_CTRL_REG = 0UL;
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Configure SysTick to interrupt at the requested rate. */
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT );
+}
+/*-----------------------------------------------------------*/
+
+#if ( configASSERT_DEFINED == 1 )
+
+ void vPortValidateInterruptPriority( void )
+ {
+ extern uint32_t ulPortGetIPSR( void );
+ uint32_t ulCurrentInterrupt;
+ uint8_t ucCurrentPriority;
+
+ ulCurrentInterrupt = ulPortGetIPSR();
+
+ /* Is the interrupt number a user defined interrupt? */
+ if( ulCurrentInterrupt >= portFIRST_USER_INTERRUPT_NUMBER )
+ {
+ /* Look up the interrupt's priority. */
+ ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ];
+
+ /* The following assertion will fail if a service routine (ISR) for
+ * an interrupt that has been assigned a priority above
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
+ * function. ISR safe FreeRTOS API functions must *only* be called
+ * from interrupts that have been assigned a priority at or below
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Numerically low interrupt priority numbers represent logically high
+ * interrupt priorities, therefore the priority of the interrupt must
+ * be set to a value equal to or numerically *higher* than
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Interrupts that use the FreeRTOS API must not be left at their
+ * default priority of zero as that is the highest possible priority,
+ * which is guaranteed to be above configMAX_SYSCALL_INTERRUPT_PRIORITY,
+ * and therefore also guaranteed to be invalid.
+ *
+ * FreeRTOS maintains separate thread and ISR API functions to ensure
+ * interrupt entry is as fast and simple as possible.
+ *
+ * The following links provide detailed information:
+ * https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html
+ * https://www.FreeRTOS.org/FAQHelp.html */
+ configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
+ }
+
+ /* Priority grouping: The interrupt controller (NVIC) allows the bits
+ * that define each interrupt's priority to be split between bits that
+ * define the interrupt's pre-emption priority bits and bits that define
+ * the interrupt's sub-priority. For simplicity all bits must be defined
+ * to be pre-emption priority bits. The following assertion will fail if
+ * this is not the case (if some bits represent a sub-priority).
+ *
+ * If the application only uses CMSIS libraries for interrupt
+ * configuration then the correct setting can be achieved on all Cortex-M
+ * devices by calling NVIC_SetPriorityGrouping( 0 ); before starting the
+ * scheduler. Note however that some vendor specific peripheral libraries
+ * assume a non-zero priority group setting, in which cases using a value
+ * of zero will result in unpredictable behaviour. */
+ configASSERT( ( portAIRCR_REG & portPRIORITY_GROUP_MASK ) <= ulMaxPRIGROUPValue );
+ }
+
+#endif /* configASSERT_DEFINED */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portasm.asm b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portasm.asm
new file mode 100644
index 0000000..8b4b4fe
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portasm.asm
@@ -0,0 +1,145 @@
+;/*
+; * FreeRTOS Kernel V10.5.0
+; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+; *
+; * SPDX-License-Identifier: MIT
+; *
+; * Permission is hereby granted, free of charge, to any person obtaining a copy of
+; * this software and associated documentation files (the "Software"), to deal in
+; * the Software without restriction, including without limitation the rights to
+; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+; * the Software, and to permit persons to whom the Software is furnished to do so,
+; * subject to the following conditions:
+; *
+; * The above copyright notice and this permission notice shall be included in all
+; * copies or substantial portions of the Software.
+; *
+; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+; *
+; * https://www.FreeRTOS.org
+; * https://github.com/FreeRTOS
+; *
+; */
+
+ .thumb
+
+ .ref pxCurrentTCB
+ .ref vTaskSwitchContext
+ .ref ulMaxSyscallInterruptPriority
+
+ .def xPortPendSVHandler
+ .def ulPortGetIPSR
+ .def vPortSVCHandler
+ .def vPortStartFirstTask
+
+NVICOffsetConst: .word 0xE000ED08
+CPACRConst: .word 0xE000ED88
+pxCurrentTCBConst: .word pxCurrentTCB
+ulMaxSyscallInterruptPriorityConst: .word ulMaxSyscallInterruptPriority
+
+; -----------------------------------------------------------
+
+ .align 4
+ulPortGetIPSR: .asmfunc
+ mrs r0, ipsr
+ bx r14
+ .endasmfunc
+ ; -----------------------------------------------------------
+
+ .align 4
+vPortSetInterruptMask: .asmfunc
+ push {r0}
+ ldr r0, ulMaxSyscallInterruptPriorityConst
+ msr basepri, r0
+ pop {r0}
+ bx r14
+ .endasmfunc
+; -----------------------------------------------------------
+
+ .align 4
+xPortPendSVHandler: .asmfunc
+ mrs r0, psp
+ isb
+
+ ;/* Get the location of the current TCB. */
+ ldr r3, pxCurrentTCBConst
+ ldr r2, [r3]
+
+ ;/* Save the core registers. */
+ stmdb r0!, {r4-r11}
+
+ ;/* Save the new top of stack into the first member of the TCB. */
+ str r0, [r2]
+
+ stmdb sp!, {r3, r14}
+ ldr r0, ulMaxSyscallInterruptPriorityConst
+ ldr r1, [r0]
+ msr basepri, r1
+ dsb
+ isb
+ bl vTaskSwitchContext
+ mov r0, #0
+ msr basepri, r0
+ ldmia sp!, {r3, r14}
+
+ ;/* The first item in pxCurrentTCB is the task top of stack. */
+ ldr r1, [r3]
+ ldr r0, [r1]
+
+ ;/* Pop the core registers. */
+ ldmia r0!, {r4-r11}
+
+ msr psp, r0
+ isb
+ bx r14
+ .endasmfunc
+
+; -----------------------------------------------------------
+
+ .align 4
+vPortSVCHandler: .asmfunc
+ ;/* Get the location of the current TCB. */
+ ldr r3, pxCurrentTCBConst
+ ldr r1, [r3]
+ ldr r0, [r1]
+ ;/* Pop the core registers. */
+ ldmia r0!, {r4-r11}
+ msr psp, r0
+ isb
+ mov r0, #0
+ msr basepri, r0
+ orr r14, #0xd
+ bx r14
+ .endasmfunc
+
+; -----------------------------------------------------------
+
+ .align 4
+vPortStartFirstTask: .asmfunc
+ ;/* Use the NVIC offset register to locate the stack. */
+ ldr r0, NVICOffsetConst
+ ldr r0, [r0]
+ ldr r0, [r0]
+ ;/* Set the msp back to the start of the stack. */
+ msr msp, r0
+ ;/* Clear the bit that indicates the FPU is in use in case the FPU was used
+ ;before the scheduler was started - which would otherwise result in the
+ ;unnecessary leaving of space in the SVC stack for lazy saving of FPU
+ ;registers. */
+ mov r0, #0
+ msr control, r0
+ ;/* Call SVC to start the first task. */
+ cpsie i
+ cpsie f
+ dsb
+ isb
+ svc #0
+ .endasmfunc
+
+; -----------------------------------------------------------
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portmacro.h
new file mode 100644
index 0000000..a7bd8ce
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM3/portmacro.h
@@ -0,0 +1,171 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#ifndef PORTMACRO_H
+ #define PORTMACRO_H
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Type definitions. */
+ #define portCHAR char
+ #define portFLOAT float
+ #define portDOUBLE double
+ #define portLONG long
+ #define portSHORT short
+ #define portSTACK_TYPE uint32_t
+ #define portBASE_TYPE long
+
+ typedef portSTACK_TYPE StackType_t;
+ typedef long BaseType_t;
+ typedef unsigned long UBaseType_t;
+
+ #if ( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+ #else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+
+/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
+ * not need to be guarded with a critical section. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+ #endif
+/*-----------------------------------------------------------*/
+
+/* Architecture specifics. */
+ #define portSTACK_GROWTH ( -1 )
+ #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+ #define portBYTE_ALIGNMENT 8
+
+/*-----------------------------------------------------------*/
+
+/* Compiler directives. */
+ #define portWEAK_SYMBOL __attribute__( ( weak ) )
+
+/*-----------------------------------------------------------*/
+
+/* Scheduler utilities. */
+ #define portYIELD() \
+ { \
+ /* Set a PendSV to request a context switch. */ \
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
+ __asm( " dsb"); \
+ __asm( " isb"); \
+ }
+
+ #define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
+ #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
+ #define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) portYIELD(); } while( 0 )
+ #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+
+/*-----------------------------------------------------------*/
+
+/* Architecture specific optimisations. */
+ #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+ #endif
+
+ #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
+
+/* Check the configuration. */
+ #if ( configMAX_PRIORITIES > 32 )
+ #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
+ #endif
+
+/* Store/clear the ready priorities in a bit map. */
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
+
+/*-----------------------------------------------------------*/
+
+ #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __clz( ( uxReadyPriorities ) ) )
+
+ #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
+/*-----------------------------------------------------------*/
+
+/* Critical section management. */
+ extern void vPortEnterCritical( void );
+ extern void vPortExitCritical( void );
+
+ #define portDISABLE_INTERRUPTS() \
+ { \
+ _set_interrupt_priority( configMAX_SYSCALL_INTERRUPT_PRIORITY ); \
+ __asm( " dsb"); \
+ __asm( " isb"); \
+ }
+
+ #define portENABLE_INTERRUPTS() _set_interrupt_priority( 0 )
+ #define portENTER_CRITICAL() vPortEnterCritical()
+ #define portEXIT_CRITICAL() vPortExitCritical()
+ #define portSET_INTERRUPT_MASK_FROM_ISR() _set_interrupt_priority( configMAX_SYSCALL_INTERRUPT_PRIORITY ); __asm( " dsb" ); __asm( " isb")
+ #define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) _set_interrupt_priority( x )
+/*-----------------------------------------------------------*/
+
+/* Tickless idle/low power functionality. */
+ #ifndef portSUPPRESS_TICKS_AND_SLEEP
+ extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
+ #endif
+
+/*-----------------------------------------------------------*/
+
+/* Task function macros as described on the FreeRTOS.org WEB site. These are
+ * not necessary for to use this port. They are defined so the common demo files
+ * (which build with all the ports) will build. */
+ #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
+ #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
+/*-----------------------------------------------------------*/
+
+ #ifdef configASSERT
+ void vPortValidateInterruptPriority( void );
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
+ #endif
+
+/* portNOP() is not required by this port. */
+ #define portNOP()
+
+/*-----------------------------------------------------------*/
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/port.c
new file mode 100644
index 0000000..1b705c2
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/port.c
@@ -0,0 +1,634 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/*-----------------------------------------------------------
+* Implementation of functions defined in portable.h for the ARM CM4F port.
+*----------------------------------------------------------*/
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+#ifndef __TI_VFP_SUPPORT__
+ #error This port can only be used when the project options are configured to enable hardware floating point support.
+#endif
+
+#if ( configMAX_SYSCALL_INTERRUPT_PRIORITY == 0 )
+ #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http: /*www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
+#endif
+
+#ifndef configSYSTICK_CLOCK_HZ
+ #define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ
+ /* Ensure the SysTick is clocked at the same frequency as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL )
+#else
+
+/* The way the SysTick is clocked is not modified in case it is not the same
+ * as the core. */
+ #define portNVIC_SYSTICK_CLK_BIT ( 0 )
+#endif
+
+/* Constants required to manipulate the core. Registers first... */
+#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
+#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
+#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
+#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
+/* ...then bits in the registers. */
+#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
+#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
+#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
+#define portNVIC_PENDSVCLEAR_BIT ( 1UL << 27UL )
+#define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL )
+
+#define portNVIC_PENDSV_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )
+#define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
+
+/* Constants required to check the validity of an interrupt priority. */
+#define portFIRST_USER_INTERRUPT_NUMBER ( 16 )
+#define portNVIC_IP_REGISTERS_OFFSET_16 ( 0xE000E3F0 )
+#define portAIRCR_REG ( *( ( volatile uint32_t * ) 0xE000ED0C ) )
+#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
+#define portTOP_BIT_OF_BYTE ( ( uint8_t ) 0x80 )
+#define portMAX_PRIGROUP_BITS ( ( uint8_t ) 7 )
+#define portPRIORITY_GROUP_MASK ( 0x07UL << 8UL )
+#define portPRIGROUP_SHIFT ( 8UL )
+
+/* Masks off all bits but the VECTACTIVE bits in the ICSR register. */
+#define portVECTACTIVE_MASK ( 0xFFUL )
+
+/* Constants required to manipulate the VFP. */
+#define portFPCCR ( ( volatile uint32_t * ) 0xe000ef34 ) /* Floating point context control register. */
+#define portASPEN_AND_LSPEN_BITS ( 0x3UL << 30UL )
+
+/* Constants required to set up the initial stack. */
+#define portINITIAL_XPSR ( 0x01000000 )
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )
+
+/* The systick is a 24-bit counter. */
+#define portMAX_24_BIT_NUMBER ( 0xffffffUL )
+
+/* A fiddle factor to estimate the number of SysTick counts that would have
+ * occurred while the SysTick counter is stopped during tickless idle
+ * calculations. */
+#define portMISSED_COUNTS_FACTOR ( 45UL )
+
+/* For strict compliance with the Cortex-M spec the task start address should
+ * have bit-0 clear, as it is loaded into the PC on exit from an ISR. */
+#define portSTART_ADDRESS_MASK ( ( StackType_t ) 0xfffffffeUL )
+
+/*
+ * Setup the timer to generate the tick interrupts. The implementation in this
+ * file is weak to allow application writers to change the timer used to
+ * generate the tick interrupt.
+ */
+void vPortSetupTimerInterrupt( void );
+
+/*
+ * Exception handlers.
+ */
+void xPortSysTickHandler( void );
+
+/*
+ * Start first task is a separate function so it can be tested in isolation.
+ */
+extern void vPortStartFirstTask( void );
+
+/*
+ * Turn the VFP on.
+ */
+extern void vPortEnableVFP( void );
+
+/*
+ * Used to catch tasks that attempt to return from their implementing function.
+ */
+static void prvTaskExitError( void );
+
+/*-----------------------------------------------------------*/
+
+/* Required to allow portasm.asm access the configMAX_SYSCALL_INTERRUPT_PRIORITY
+ * setting. */
+const uint32_t ulMaxSyscallInterruptPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY;
+
+/* Each task maintains its own interrupt status in the critical nesting
+ * variable. */
+static UBaseType_t uxCriticalNesting = 0xaaaaaaaa;
+
+/*
+ * The number of SysTick increments that make up one tick period.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t ulTimerCountsForOneTick = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * The maximum number of tick periods that can be suppressed is limited by the
+ * 24 bit resolution of the SysTick timer.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t xMaximumPossibleSuppressedTicks = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low
+ * power functionality only.
+ */
+#if ( configUSE_TICKLESS_IDLE == 1 )
+ static uint32_t ulStoppedTimerCompensation = 0;
+#endif /* configUSE_TICKLESS_IDLE */
+
+/*
+ * Used by the portASSERT_IF_INTERRUPT_PRIORITY_INVALID() macro to ensure
+ * FreeRTOS API functions are not called from interrupts that have been assigned
+ * a priority above configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ */
+#if ( configASSERT_DEFINED == 1 )
+ static uint8_t ucMaxSysCallPriority = 0;
+ static uint32_t ulMaxPRIGROUPValue = 0;
+ static const volatile uint8_t * const pcInterruptPriorityRegisters = ( uint8_t * ) portNVIC_IP_REGISTERS_OFFSET_16;
+#endif /* configASSERT_DEFINED */
+
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters )
+{
+ /* Simulate the stack frame as it would be created by a context switch
+ * interrupt. */
+
+ /* Offset added to account for the way the MCU uses the stack on entry/exit
+ * of interrupts, and to ensure alignment. */
+ pxTopOfStack--;
+
+ *pxTopOfStack = portINITIAL_XPSR; /* xPSR */
+ pxTopOfStack--;
+ *pxTopOfStack = ( ( StackType_t ) pxCode ) & portSTART_ADDRESS_MASK; /* PC */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) prvTaskExitError; /* LR */
+
+ /* Save code space by skipping register initialisation. */
+ pxTopOfStack -= 5; /* R12, R3, R2 and R1. */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
+
+ /* A save method is being used that requires each task to maintain its
+ * own exec return value. */
+ pxTopOfStack--;
+ *pxTopOfStack = portINITIAL_EXC_RETURN;
+
+ pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */
+
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+static void prvTaskExitError( void )
+{
+ /* A function that implements a task must not exit or attempt to return to
+ * its caller as there is nothing to return to. If a task wants to exit it
+ * should instead call vTaskDelete( NULL ).
+ *
+ * Artificially force an assert() to be triggered if configASSERT() is
+ * defined, then stop here so application writers can catch the error. */
+ configASSERT( uxCriticalNesting == ~0UL );
+ portDISABLE_INTERRUPTS();
+
+ for( ; ; )
+ {
+ }
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+BaseType_t xPortStartScheduler( void )
+{
+ #if ( configASSERT_DEFINED == 1 )
+ {
+ volatile uint32_t ulOriginalPriority;
+ volatile uint8_t * const pucFirstUserPriorityRegister = ( uint8_t * ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );
+ volatile uint8_t ucMaxPriorityValue;
+
+ /* Determine the maximum priority from which ISR safe FreeRTOS API
+ * functions can be called. ISR safe functions are those that end in
+ * "FromISR". FreeRTOS maintains separate thread and ISR API functions to
+ * ensure interrupt entry is as fast and simple as possible.
+ *
+ * Save the interrupt priority value that is about to be clobbered. */
+ ulOriginalPriority = *pucFirstUserPriorityRegister;
+
+ /* Determine the number of priority bits available. First write to all
+ * possible bits. */
+ *pucFirstUserPriorityRegister = portMAX_8_BIT_VALUE;
+
+ /* Read the value back to see how many bits stuck. */
+ ucMaxPriorityValue = *pucFirstUserPriorityRegister;
+
+ /* Use the same mask on the maximum system call priority. */
+ ucMaxSysCallPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY & ucMaxPriorityValue;
+
+ /* Calculate the maximum acceptable priority group value for the number
+ * of bits read back. */
+ ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS;
+
+ while( ( ucMaxPriorityValue & portTOP_BIT_OF_BYTE ) == portTOP_BIT_OF_BYTE )
+ {
+ ulMaxPRIGROUPValue--;
+ ucMaxPriorityValue <<= ( uint8_t ) 0x01;
+ }
+
+ #ifdef __NVIC_PRIO_BITS
+ {
+ /* Check the CMSIS configuration that defines the number of
+ * priority bits matches the number of priority bits actually queried
+ * from the hardware. */
+ configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
+ }
+ #endif
+
+ #ifdef configPRIO_BITS
+ {
+ /* Check the FreeRTOS configuration that defines the number of
+ * priority bits matches the number of priority bits actually queried
+ * from the hardware. */
+ configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
+ }
+ #endif
+
+ /* Shift the priority group value back to its position within the AIRCR
+ * register. */
+ ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
+ ulMaxPRIGROUPValue &= portPRIORITY_GROUP_MASK;
+
+ /* Restore the clobbered interrupt priority register to its original
+ * value. */
+ *pucFirstUserPriorityRegister = ulOriginalPriority;
+ }
+ #endif /* configASSERT_DEFINED */
+
+ /* Make PendSV and SysTick the lowest priority interrupts. */
+ portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
+ portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
+
+ /* Start the timer that generates the tick ISR. Interrupts are disabled
+ * here already. */
+ vPortSetupTimerInterrupt();
+
+ /* Initialise the critical nesting count ready for the first task. */
+ uxCriticalNesting = 0;
+
+ /* Ensure the VFP is enabled - it should be anyway. */
+ vPortEnableVFP();
+
+ /* Lazy save always. */
+ *( portFPCCR ) |= portASPEN_AND_LSPEN_BITS;
+
+ /* Start the first task. */
+ vPortStartFirstTask();
+
+ /* Should not get here! */
+ return 0;
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* Not implemented in ports where there is nothing to return to.
+ * Artificially force an assert. */
+ configASSERT( uxCriticalNesting == 1000UL );
+}
+/*-----------------------------------------------------------*/
+
+void vPortEnterCritical( void )
+{
+ portDISABLE_INTERRUPTS();
+ uxCriticalNesting++;
+
+ /* This is not the interrupt safe version of the enter critical function so
+ * assert() if it is being called from an interrupt context. Only API
+ * functions that end in "FromISR" can be used in an interrupt. Only assert if
+ * the critical nesting count is 1 to protect against recursive calls if the
+ * assert function also uses a critical section. */
+ if( uxCriticalNesting == 1 )
+ {
+ configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );
+ }
+}
+/*-----------------------------------------------------------*/
+
+void vPortExitCritical( void )
+{
+ configASSERT( uxCriticalNesting );
+ uxCriticalNesting--;
+
+ if( uxCriticalNesting == 0 )
+ {
+ portENABLE_INTERRUPTS();
+ }
+}
+/*-----------------------------------------------------------*/
+
+void xPortSysTickHandler( void )
+{
+ /* The SysTick runs at the lowest interrupt priority, so when this interrupt
+ * executes all interrupts must be unmasked. There is therefore no need to
+ * save and then restore the interrupt mask value as its value is already
+ * known. */
+ ( void ) portSET_INTERRUPT_MASK_FROM_ISR();
+ {
+ /* Increment the RTOS tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* A context switch is required. Context switching is performed in
+ * the PendSV interrupt. Pend the PendSV interrupt. */
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
+ }
+ }
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
+}
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TICKLESS_IDLE == 1 )
+
+ #pragma WEAK( vPortSuppressTicksAndSleep )
+ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
+ {
+ uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements;
+ TickType_t xModifiableIdleTime;
+
+ /* Make sure the SysTick reload value does not overflow the counter. */
+ if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
+ {
+ xExpectedIdleTime = xMaximumPossibleSuppressedTicks;
+ }
+
+ /* Stop the SysTick momentarily. The time the SysTick is stopped for
+ * is accounted for as best it can be, but using the tickless mode will
+ * inevitably result in some tiny drift of the time maintained by the
+ * kernel with respect to calendar time. */
+ portNVIC_SYSTICK_CTRL_REG &= ~portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Calculate the reload value required to wait xExpectedIdleTime
+ * tick periods. -1 is used because this code will execute part way
+ * through one of the tick periods. */
+ ulReloadValue = portNVIC_SYSTICK_CURRENT_VALUE_REG + ( ulTimerCountsForOneTick * ( xExpectedIdleTime - 1UL ) );
+
+ if( ulReloadValue > ulStoppedTimerCompensation )
+ {
+ ulReloadValue -= ulStoppedTimerCompensation;
+ }
+
+ /* Enter a critical section but don't use the taskENTER_CRITICAL()
+ * method as that will mask interrupts that should exit sleep mode. */
+ __asm( " cpsid i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* If a context switch is pending or a task is waiting for the scheduler
+ * to be unsuspended then abandon the low power entry. */
+ if( eTaskConfirmSleepModeStatus() == eAbortSleep )
+ {
+ /* Restart from whatever is left in the count register to complete
+ * this tick period. */
+ portNVIC_SYSTICK_LOAD_REG = portNVIC_SYSTICK_CURRENT_VALUE_REG;
+
+ /* Restart SysTick. */
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Reset the reload register to the value required for normal tick
+ * periods. */
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+
+ /* Re-enable interrupts - see comments above __disable_interrupt()
+ * call above. */
+ __asm( " cpsie i");
+ }
+ else
+ {
+ /* Set the new reload value. */
+ portNVIC_SYSTICK_LOAD_REG = ulReloadValue;
+
+ /* Clear the SysTick count flag and set the count value back to
+ * zero. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Restart SysTick. */
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+
+ /* Sleep until something happens. configPRE_SLEEP_PROCESSING() can
+ * set its parameter to 0 to indicate that its implementation contains
+ * its own wait for interrupt or wait for event instruction, and so wfi
+ * should not be executed again. However, the original expected idle
+ * time variable must remain unmodified, so a copy is taken. */
+ xModifiableIdleTime = xExpectedIdleTime;
+ configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
+
+ if( xModifiableIdleTime > 0 )
+ {
+ __asm( " dsb");
+ __asm( " wfi");
+ __asm( " isb");
+ }
+
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );
+
+ /* Re-enable interrupts to allow the interrupt that brought the MCU
+ * out of sleep mode to execute immediately. see comments above
+ * __disable_interrupt() call above. */
+ __asm( " cpsie i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* Disable interrupts again because the clock is about to be stopped
+ * and interrupts that execute while the clock is stopped will increase
+ * any slippage between the time maintained by the RTOS and calendar
+ * time. */
+ __asm( " cpsid i");
+ __asm( " dsb");
+ __asm( " isb");
+
+ /* Disable the SysTick clock without reading the
+ * portNVIC_SYSTICK_CTRL_REG register to ensure the
+ * portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,
+ * the time the SysTick is stopped for is accounted for as best it can
+ * be, but using the tickless mode will inevitably result in some tiny
+ * drift of the time maintained by the kernel with respect to calendar
+ * time*/
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );
+
+ /* Determine if the SysTick clock has already counted to zero and
+ * been set back to the current reload value (the reload back being
+ * correct for the entire expected idle time) or if the SysTick is yet
+ * to count to zero (in which case an interrupt other than the SysTick
+ * must have brought the system out of sleep mode). */
+ if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )
+ {
+ uint32_t ulCalculatedLoadValue;
+
+ /* The tick interrupt is already pending, and the SysTick count
+ * reloaded with ulReloadValue. Reset the
+ * portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick
+ * period. */
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );
+
+ /* Don't allow a tiny value, or values that have somehow
+ * underflowed because the post sleep hook did something
+ * that took too long. */
+ if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )
+ {
+ ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );
+ }
+
+ portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;
+
+ /* As the pending tick will be processed as soon as this
+ * function exits, the tick value maintained by the tick is stepped
+ * forward by one less than the time spent waiting. */
+ ulCompleteTickPeriods = xExpectedIdleTime - 1UL;
+ }
+ else
+ {
+ /* Something other than the tick interrupt ended the sleep.
+ * Work out how long the sleep lasted rounded to complete tick
+ * periods (not the ulReload value which accounted for part
+ * ticks). */
+ ulCompletedSysTickDecrements = ( xExpectedIdleTime * ulTimerCountsForOneTick ) - portNVIC_SYSTICK_CURRENT_VALUE_REG;
+
+ /* How many complete tick periods passed while the processor
+ * was waiting? */
+ ulCompleteTickPeriods = ulCompletedSysTickDecrements / ulTimerCountsForOneTick;
+
+ /* The reload value is set to whatever fraction of a single tick
+ * period remains. */
+ portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;
+ }
+
+ /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG
+ * again, then set portNVIC_SYSTICK_LOAD_REG back to its standard
+ * value. */
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+ portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT;
+ vTaskStepTick( ulCompleteTickPeriods );
+ portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;
+
+ /* Exit with interrupts enabled. */
+ __asm( " cpsie i");
+ }
+ }
+
+#endif /* configUSE_TICKLESS_IDLE */
+/*-----------------------------------------------------------*/
+
+/*
+ * Setup the systick timer to generate the tick interrupts at the required
+ * frequency.
+ */
+#pragma WEAK( vPortSetupTimerInterrupt )
+void vPortSetupTimerInterrupt( void )
+{
+ /* Calculate the constants required to configure the tick interrupt. */
+ #if ( configUSE_TICKLESS_IDLE == 1 )
+ {
+ ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );
+ xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;
+ ulStoppedTimerCompensation = portMISSED_COUNTS_FACTOR / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );
+ }
+ #endif /* configUSE_TICKLESS_IDLE */
+
+ /* Stop and clear the SysTick. */
+ portNVIC_SYSTICK_CTRL_REG = 0UL;
+ portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
+
+ /* Configure SysTick to interrupt at the requested rate. */
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
+ portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT );
+}
+/*-----------------------------------------------------------*/
+
+#if ( configASSERT_DEFINED == 1 )
+
+ void vPortValidateInterruptPriority( void )
+ {
+ extern uint32_t ulPortGetIPSR( void );
+ uint32_t ulCurrentInterrupt;
+ uint8_t ucCurrentPriority;
+
+ ulCurrentInterrupt = ulPortGetIPSR();
+
+ /* Is the interrupt number a user defined interrupt? */
+ if( ulCurrentInterrupt >= portFIRST_USER_INTERRUPT_NUMBER )
+ {
+ /* Look up the interrupt's priority. */
+ ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ];
+
+ /* The following assertion will fail if a service routine (ISR) for
+ * an interrupt that has been assigned a priority above
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
+ * function. ISR safe FreeRTOS API functions must *only* be called
+ * from interrupts that have been assigned a priority at or below
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Numerically low interrupt priority numbers represent logically high
+ * interrupt priorities, therefore the priority of the interrupt must
+ * be set to a value equal to or numerically *higher* than
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Interrupts that use the FreeRTOS API must not be left at their
+ * default priority of zero as that is the highest possible priority,
+ * which is guaranteed to be above configMAX_SYSCALL_INTERRUPT_PRIORITY,
+ * and therefore also guaranteed to be invalid.
+ *
+ * FreeRTOS maintains separate thread and ISR API functions to ensure
+ * interrupt entry is as fast and simple as possible.
+ *
+ * The following links provide detailed information:
+ * https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html
+ * https://www.FreeRTOS.org/FAQHelp.html */
+ configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
+ }
+
+ /* Priority grouping: The interrupt controller (NVIC) allows the bits
+ * that define each interrupt's priority to be split between bits that
+ * define the interrupt's pre-emption priority bits and bits that define
+ * the interrupt's sub-priority. For simplicity all bits must be defined
+ * to be pre-emption priority bits. The following assertion will fail if
+ * this is not the case (if some bits represent a sub-priority).
+ *
+ * If the application only uses CMSIS libraries for interrupt
+ * configuration then the correct setting can be achieved on all Cortex-M
+ * devices by calling NVIC_SetPriorityGrouping( 0 ); before starting the
+ * scheduler. Note however that some vendor specific peripheral libraries
+ * assume a non-zero priority group setting, in which cases using a value
+ * of zero will result in unpredictable behaviour. */
+ configASSERT( ( portAIRCR_REG & portPRIORITY_GROUP_MASK ) <= ulMaxPRIGROUPValue );
+ }
+
+#endif /* configASSERT_DEFINED */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portasm.asm b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portasm.asm
new file mode 100644
index 0000000..8309db0
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portasm.asm
@@ -0,0 +1,172 @@
+;/*
+; * FreeRTOS Kernel V10.5.0
+; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+; *
+; * SPDX-License-Identifier: MIT
+; *
+; * Permission is hereby granted, free of charge, to any person obtaining a copy of
+; * this software and associated documentation files (the "Software"), to deal in
+; * the Software without restriction, including without limitation the rights to
+; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+; * the Software, and to permit persons to whom the Software is furnished to do so,
+; * subject to the following conditions:
+; *
+; * The above copyright notice and this permission notice shall be included in all
+; * copies or substantial portions of the Software.
+; *
+; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+; *
+; * https://www.FreeRTOS.org
+; * https://github.com/FreeRTOS
+; *
+; */
+
+ .thumb
+
+ .ref pxCurrentTCB
+ .ref vTaskSwitchContext
+ .ref ulMaxSyscallInterruptPriority
+
+ .def xPortPendSVHandler
+ .def ulPortGetIPSR
+ .def vPortSVCHandler
+ .def vPortStartFirstTask
+ .def vPortEnableVFP
+
+NVICOffsetConst: .word 0xE000ED08
+CPACRConst: .word 0xE000ED88
+pxCurrentTCBConst: .word pxCurrentTCB
+ulMaxSyscallInterruptPriorityConst: .word ulMaxSyscallInterruptPriority
+
+; -----------------------------------------------------------
+
+ .align 4
+ulPortGetIPSR: .asmfunc
+ mrs r0, ipsr
+ bx r14
+ .endasmfunc
+ ; -----------------------------------------------------------
+
+ .align 4
+vPortSetInterruptMask: .asmfunc
+ push {r0}
+ ldr r0, ulMaxSyscallInterruptPriorityConst
+ msr basepri, r0
+ pop {r0}
+ bx r14
+ .endasmfunc
+; -----------------------------------------------------------
+
+ .align 4
+xPortPendSVHandler: .asmfunc
+ mrs r0, psp
+ isb
+
+ ;/* Get the location of the current TCB. */
+ ldr r3, pxCurrentTCBConst
+ ldr r2, [r3]
+
+ ;/* Is the task using the FPU context? If so, push high vfp registers. */
+ tst r14, #0x10
+ it eq
+ vstmdbeq r0!, {s16-s31}
+
+ ;/* Save the core registers. */
+ stmdb r0!, {r4-r11, r14}
+
+ ;/* Save the new top of stack into the first member of the TCB. */
+ str r0, [r2]
+
+ stmdb sp!, {r0, r3}
+ ldr r0, ulMaxSyscallInterruptPriorityConst
+ ldr r1, [r0]
+ msr basepri, r1
+ dsb
+ isb
+ bl vTaskSwitchContext
+ mov r0, #0
+ msr basepri, r0
+ ldmia sp!, {r0, r3}
+
+ ;/* The first item in pxCurrentTCB is the task top of stack. */
+ ldr r1, [r3]
+ ldr r0, [r1]
+
+ ;/* Pop the core registers. */
+ ldmia r0!, {r4-r11, r14}
+
+ ;/* Is the task using the FPU context? If so, pop the high vfp registers
+ ;too. */
+ tst r14, #0x10
+ it eq
+ vldmiaeq r0!, {s16-s31}
+
+ msr psp, r0
+ isb
+ bx r14
+ .endasmfunc
+
+; -----------------------------------------------------------
+
+ .align 4
+vPortSVCHandler: .asmfunc
+ ;/* Get the location of the current TCB. */
+ ldr r3, pxCurrentTCBConst
+ ldr r1, [r3]
+ ldr r0, [r1]
+ ;/* Pop the core registers. */
+ ldmia r0!, {r4-r11, r14}
+ msr psp, r0
+ isb
+ mov r0, #0
+ msr basepri, r0
+ bx r14
+ .endasmfunc
+
+; -----------------------------------------------------------
+
+ .align 4
+vPortStartFirstTask: .asmfunc
+ ;/* Use the NVIC offset register to locate the stack. */
+ ldr r0, NVICOffsetConst
+ ldr r0, [r0]
+ ldr r0, [r0]
+ ;/* Set the msp back to the start of the stack. */
+ msr msp, r0
+ ;/* Clear the bit that indicates the FPU is in use in case the FPU was used
+ ;before the scheduler was started - which would otherwise result in the
+ ;unnecessary leaving of space in the SVC stack for lazy saving of FPU
+ ;registers. */
+ mov r0, #0
+ msr control, r0
+ ;/* Call SVC to start the first task. */
+ cpsie i
+ cpsie f
+ dsb
+ isb
+ svc #0
+ .endasmfunc
+
+; -----------------------------------------------------------
+
+ .align 4
+vPortEnableVFP: .asmfunc
+ ;/* The FPU enable bits are in the CPACR. */
+ ldr.w r0, CPACRConst
+ ldr r1, [r0]
+
+ ;/* Enable CP10 and CP11 coprocessors, then save back. */
+ orr r1, r1, #( 0xf << 20 )
+ str r1, [r0]
+ bx r14
+ .endasmfunc
+
+ .end
+
+; -----------------------------------------------------------
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portmacro.h
new file mode 100644
index 0000000..6663419
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_CM4F/portmacro.h
@@ -0,0 +1,165 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+
+#ifndef PORTMACRO_H
+ #define PORTMACRO_H
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Type definitions. */
+ #define portCHAR char
+ #define portFLOAT float
+ #define portDOUBLE double
+ #define portLONG long
+ #define portSHORT short
+ #define portSTACK_TYPE uint32_t
+ #define portBASE_TYPE long
+
+ typedef portSTACK_TYPE StackType_t;
+ typedef long BaseType_t;
+ typedef unsigned long UBaseType_t;
+
+ #if ( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+ #else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+
+/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
+ * not need to be guarded with a critical section. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+ #endif
+/*-----------------------------------------------------------*/
+
+/* Architecture specifics. */
+ #define portSTACK_GROWTH ( -1 )
+ #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+ #define portBYTE_ALIGNMENT 8
+/*-----------------------------------------------------------*/
+
+/* Scheduler utilities. */
+ #define portYIELD() \
+ { \
+ /* Set a PendSV to request a context switch. */ \
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
+ __asm( " dsb"); \
+ __asm( " isb"); \
+ }
+
+ #define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
+ #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
+ #define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) portYIELD(); } while( 0 )
+ #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+
+/*-----------------------------------------------------------*/
+
+/* Architecture specific optimisations. */
+ #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+ #endif
+
+ #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
+
+/* Check the configuration. */
+ #if ( configMAX_PRIORITIES > 32 )
+ #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
+ #endif
+
+/* Store/clear the ready priorities in a bit map. */
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
+
+/*-----------------------------------------------------------*/
+
+ #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __clz( ( uxReadyPriorities ) ) )
+
+ #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
+/*-----------------------------------------------------------*/
+
+/* Critical section management. */
+ extern void vPortEnterCritical( void );
+ extern void vPortExitCritical( void );
+
+ #define portDISABLE_INTERRUPTS() \
+ { \
+ _set_interrupt_priority( configMAX_SYSCALL_INTERRUPT_PRIORITY ); \
+ __asm( " dsb"); \
+ __asm( " isb"); \
+ }
+
+ #define portENABLE_INTERRUPTS() _set_interrupt_priority( 0 )
+ #define portENTER_CRITICAL() vPortEnterCritical()
+ #define portEXIT_CRITICAL() vPortExitCritical()
+ #define portSET_INTERRUPT_MASK_FROM_ISR() _set_interrupt_priority( configMAX_SYSCALL_INTERRUPT_PRIORITY ); __asm( " dsb" ); __asm( " isb")
+ #define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) _set_interrupt_priority( x )
+/*-----------------------------------------------------------*/
+
+/* Tickless idle/low power functionality. */
+ #ifndef portSUPPRESS_TICKS_AND_SLEEP
+ extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
+ #endif
+
+/*-----------------------------------------------------------*/
+
+/* Task function macros as described on the FreeRTOS.org WEB site. These are
+ * not necessary for to use this port. They are defined so the common demo files
+ * (which build with all the ports) will build. */
+ #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
+ #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
+/*-----------------------------------------------------------*/
+
+ #ifdef configASSERT
+ void vPortValidateInterruptPriority( void );
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
+ #endif
+
+/* portNOP() is not required by this port. */
+ #define portNOP()
+
+/*-----------------------------------------------------------*/
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+#endif /* PORTMACRO_H */
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/port.c
new file mode 100644
index 0000000..e5f6ca9
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/port.c
@@ -0,0 +1,313 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* FreeRTOS includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+/*-----------------------------------------------------------*/
+
+/* Count of the critical section nesting depth. */
+uint32_t ulCriticalNesting = 9999;
+
+/*-----------------------------------------------------------*/
+
+/* Registers required to configure the RTI. */
+#define portRTI_GCTRL_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC00 ) )
+#define portRTI_TBCTRL_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC04 ) )
+#define portRTI_COMPCTRL_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC0C ) )
+#define portRTI_CNT0_FRC0_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC10 ) )
+#define portRTI_CNT0_UC0_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC14 ) )
+#define portRTI_CNT0_CPUC0_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC18 ) )
+#define portRTI_CNT0_COMP0_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC50 ) )
+#define portRTI_CNT0_UDCP0_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC54 ) )
+#define portRTI_SETINTENA_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC80 ) )
+#define portRTI_CLEARINTENA_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC84 ) )
+#define portRTI_INTFLAG_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC88 ) )
+
+
+/* Constants required to set up the initial stack of each task. */
+#define portINITIAL_SPSR ( ( StackType_t ) 0x1F )
+#define portINITIAL_FPSCR ( ( StackType_t ) 0x00 )
+#define portINSTRUCTION_SIZE ( ( StackType_t ) 0x04 )
+#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
+
+/* The number of words on the stack frame between the saved Top Of Stack and
+R0 (in which the parameters are passed. */
+#define portSPACE_BETWEEN_TOS_AND_PARAMETERS ( 12 )
+
+/*-----------------------------------------------------------*/
+
+/* vPortStartFirstSTask() is defined in portASM.asm */
+extern void vPortStartFirstTask( void );
+
+/*-----------------------------------------------------------*/
+
+/* Saved as part of the task context. Set to pdFALSE if the task does not
+require an FPU context. */
+uint32_t ulTaskHasFPUContext = 0;
+
+/*-----------------------------------------------------------*/
+
+
+/*
+ * See header file for description.
+ */
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
+{
+StackType_t *pxOriginalTOS;
+
+ pxOriginalTOS = pxTopOfStack;
+
+ #if __TI_VFP_SUPPORT__
+ {
+ /* Ensure the stack is correctly aligned on exit. */
+ pxTopOfStack--;
+ }
+ #endif
+
+ /* Setup the initial stack of the task. The stack is set exactly as
+ expected by the portRESTORE_CONTEXT() macro. */
+
+ /* First on the stack is the return address - which is the start of the as
+ the task has not executed yet. The offset is added to make the return
+ address appear as it would within an IRQ ISR. */
+ *pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
+ pxTopOfStack--;
+
+ *pxTopOfStack = ( StackType_t ) 0x00000000; /* R14 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pxOriginalTOS; /* Stack used when task starts goes in R13. */
+ pxTopOfStack--;
+
+ #ifdef portPRELOAD_TASK_REGISTERS
+ {
+ *pxTopOfStack = ( StackType_t ) 0x12121212; /* R12 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x11111111; /* R11 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x10101010; /* R10 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x09090909; /* R9 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x08080808; /* R8 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x07070707; /* R7 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x06060606; /* R6 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x05050505; /* R5 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x04040404; /* R4 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x03030303; /* R3 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x02020202; /* R2 */
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
+ pxTopOfStack--;
+ }
+ #else
+ {
+ pxTopOfStack -= portSPACE_BETWEEN_TOS_AND_PARAMETERS;
+ }
+ #endif
+
+ /* Function parameters are passed in R0. */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
+ pxTopOfStack--;
+
+ /* Set the status register for system mode, with interrupts enabled. */
+ *pxTopOfStack = ( StackType_t ) ( ( _get_CPSR() & ~0xFF ) | portINITIAL_SPSR );
+
+ if( ( ( uint32_t ) pxCode & 0x01UL ) != 0x00 )
+ {
+ /* The task will start in thumb mode. */
+ *pxTopOfStack |= portTHUMB_MODE_BIT;
+ }
+
+ #ifdef __TI_VFP_SUPPORT__
+ {
+ pxTopOfStack--;
+
+ /* The last thing on the stack is the tasks ulUsingFPU value, which by
+ default is set to indicate that the stack frame does not include FPU
+ registers. */
+ *pxTopOfStack = pdFALSE;
+ }
+ #endif
+
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+static void prvSetupTimerInterrupt(void)
+{
+ /* Disable timer 0. */
+ portRTI_GCTRL_REG &= 0xFFFFFFFEUL;
+
+ /* Use the internal counter. */
+ portRTI_TBCTRL_REG = 0x00000000U;
+
+ /* COMPSEL0 will use the RTIFRC0 counter. */
+ portRTI_COMPCTRL_REG = 0x00000000U;
+
+ /* Initialise the counter and the prescale counter registers. */
+ portRTI_CNT0_UC0_REG = 0x00000000U;
+ portRTI_CNT0_FRC0_REG = 0x00000000U;
+
+ /* Set Prescalar for RTI clock. */
+ portRTI_CNT0_CPUC0_REG = 0x00000001U;
+ portRTI_CNT0_COMP0_REG = ( configCPU_CLOCK_HZ / 2 ) / configTICK_RATE_HZ;
+ portRTI_CNT0_UDCP0_REG = ( configCPU_CLOCK_HZ / 2 ) / configTICK_RATE_HZ;
+
+ /* Clear interrupts. */
+ portRTI_INTFLAG_REG = 0x0007000FU;
+ portRTI_CLEARINTENA_REG = 0x00070F0FU;
+
+ /* Enable the compare 0 interrupt. */
+ portRTI_SETINTENA_REG = 0x00000001U;
+ portRTI_GCTRL_REG |= 0x00000001U;
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+BaseType_t xPortStartScheduler(void)
+{
+ /* Start the timer that generates the tick ISR. */
+ prvSetupTimerInterrupt();
+
+ /* Reset the critical section nesting count read to execute the first task. */
+ ulCriticalNesting = 0;
+
+ /* Start the first task. This is done from portASM.asm as ARM mode must be
+ used. */
+ vPortStartFirstTask();
+
+ /* Should not get here! */
+ return pdFAIL;
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * See header file for description.
+ */
+void vPortEndScheduler(void)
+{
+ /* Not implemented in ports where there is nothing to return to.
+ Artificially force an assert. */
+ configASSERT( ulCriticalNesting == 1000UL );
+}
+/*-----------------------------------------------------------*/
+
+#if configUSE_PREEMPTION == 0
+
+ /* The cooperative scheduler requires a normal IRQ service routine to
+ * simply increment the system tick. */
+ __interrupt void vPortNonPreemptiveTick( void )
+ {
+ /* clear clock interrupt flag */
+ portRTI_INTFLAG_REG = 0x00000001;
+
+ /* Increment the tick count - this may make a delaying task ready
+ to run - but a context switch is not performed. */
+ xTaskIncrementTick();
+ }
+
+ #else
+
+ /*
+ **************************************************************************
+ * The preemptive scheduler ISR is written in assembler and can be found
+ * in the portASM.asm file. This will only get used if portUSE_PREEMPTION
+ * is set to 1 in portmacro.h
+ **************************************************************************
+ */
+ void vPortPreemptiveTick( void );
+
+#endif
+/*-----------------------------------------------------------*/
+
+
+/*
+ * Disable interrupts, and keep a count of the nesting depth.
+ */
+void vPortEnterCritical( void )
+{
+ /* Disable interrupts as per portDISABLE_INTERRUPTS(); */
+ portDISABLE_INTERRUPTS();
+
+ /* Now interrupts are disabled ulCriticalNesting can be accessed
+ directly. Increment ulCriticalNesting to keep a count of how many times
+ portENTER_CRITICAL() has been called. */
+ ulCriticalNesting++;
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * Decrement the critical nesting count, and if it has reached zero, re-enable
+ * interrupts.
+ */
+void vPortExitCritical( void )
+{
+ if( ulCriticalNesting > 0 )
+ {
+ /* Decrement the nesting count as we are leaving a critical section. */
+ ulCriticalNesting--;
+
+ /* If the nesting level has reached zero then interrupts should be
+ re-enabled. */
+ if( ulCriticalNesting == 0 )
+ {
+ /* Enable interrupts as per portENABLE_INTERRUPTS(). */
+ portENABLE_INTERRUPTS();
+ }
+ }
+}
+/*-----------------------------------------------------------*/
+
+#if __TI_VFP_SUPPORT__
+
+ void vPortTaskUsesFPU( void )
+ {
+ extern void vPortInitialiseFPSCR( void );
+
+ /* A task is registering the fact that it needs an FPU context. Set the
+ FPU flag (saved as part of the task context. */
+ ulTaskHasFPUContext = pdTRUE;
+
+ /* Initialise the floating point status register. */
+ vPortInitialiseFPSCR();
+ }
+
+#endif /* __TI_VFP_SUPPORT__ */
+
+/*-----------------------------------------------------------*/
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portASM.asm b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portASM.asm
new file mode 100644
index 0000000..c993540
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portASM.asm
@@ -0,0 +1,230 @@
+;/*
+; * FreeRTOS Kernel V10.5.0
+; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+; *
+; * SPDX-License-Identifier: MIT
+; *
+; * Permission is hereby granted, free of charge, to any person obtaining a copy of
+; * this software and associated documentation files (the "Software"), to deal in
+; * the Software without restriction, including without limitation the rights to
+; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+; * the Software, and to permit persons to whom the Software is furnished to do so,
+; * subject to the following conditions:
+; *
+; * The above copyright notice and this permission notice shall be included in all
+; * copies or substantial portions of the Software.
+; *
+; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+; *
+; * https://www.FreeRTOS.org
+; * https://github.com/FreeRTOS
+; *
+; */
+
+ .text
+ .arm
+ .ref vTaskSwitchContext
+ .ref xTaskIncrementTick
+ .ref ulTaskHasFPUContext
+ .ref pxCurrentTCB
+
+;/*-----------------------------------------------------------*/
+;
+; Save Task Context
+;
+portSAVE_CONTEXT .macro
+ DSB
+
+ ; Push R0 as we are going to use it
+ STMDB SP!, {R0}
+
+ ; Set R0 to point to the task stack pointer.
+ STMDB SP,{SP}^
+ SUB SP, SP, #4
+ LDMIA SP!,{R0}
+
+ ; Push the return address onto the stack.
+ STMDB R0!, {LR}
+
+ ; Now LR has been saved, it can be used instead of R0.
+ MOV LR, R0
+
+ ; Pop R0 so it can be saved onto the task stack.
+ LDMIA SP!, {R0}
+
+ ; Push all the system mode registers onto the task stack.
+ STMDB LR,{R0-LR}^
+ SUB LR, LR, #60
+
+ ; Push the SPSR onto the task stack.
+ MRS R0, SPSR
+ STMDB LR!, {R0}
+
+ .if (__TI_VFP_SUPPORT__)
+ ;Determine if the task maintains an FPU context.
+ LDR R0, ulFPUContextConst
+ LDR R0, [R0]
+
+ ; Test the flag
+ CMP R0, #0
+
+ ; If the task is not using a floating point context then skip the
+ ; saving of the FPU registers.
+ BEQ $+16
+ FSTMDBD LR!, {D0-D15}
+ FMRX R1, FPSCR
+ STMFD LR!, {R1}
+
+ ; Save the flag
+ STMDB LR!, {R0}
+ .endif
+
+ ; Store the new top of stack for the task.
+ LDR R0, pxCurrentTCBConst
+ LDR R0, [R0]
+ STR LR, [R0]
+
+ .endm
+
+;/*-----------------------------------------------------------*/
+;
+; Restore Task Context
+;
+portRESTORE_CONTEXT .macro
+ LDR R0, pxCurrentTCBConst
+ LDR R0, [R0]
+ LDR LR, [R0]
+
+ .if (__TI_VFP_SUPPORT__)
+ ; The floating point context flag is the first thing on the stack.
+ LDR R0, ulFPUContextConst
+ LDMFD LR!, {R1}
+ STR R1, [R0]
+
+ ; Test the flag
+ CMP R1, #0
+
+ ; If the task is not using a floating point context then skip the
+ ; VFP register loads.
+ BEQ $+16
+
+ ; Restore the floating point context.
+ LDMFD LR!, {R0}
+ FLDMIAD LR!, {D0-D15}
+ FMXR FPSCR, R0
+ .endif
+
+ ; Get the SPSR from the stack.
+ LDMFD LR!, {R0}
+ MSR SPSR_CSXF, R0
+
+ ; Restore all system mode registers for the task.
+ LDMFD LR, {R0-R14}^
+
+ ; Restore the return address.
+ LDR LR, [LR, #+60]
+
+ ; And return - correcting the offset in the LR to obtain the
+ ; correct address.
+ SUBS PC, LR, #4
+ .endm
+
+;/*-----------------------------------------------------------*/
+; Start the first task by restoring its context.
+
+ .def vPortStartFirstTask
+
+vPortStartFirstTask:
+ portRESTORE_CONTEXT
+
+;/*-----------------------------------------------------------*/
+; Yield to another task.
+
+ .def vPortYieldProcessor
+
+vPortYieldProcessor:
+ ; Within an IRQ ISR the link register has an offset from the true return
+ ; address. SWI doesn't do this. Add the offset manually so the ISR
+ ; return code can be used.
+ ADD LR, LR, #4
+
+ ; First save the context of the current task.
+ portSAVE_CONTEXT
+
+ ; Select the next task to execute. */
+ BL vTaskSwitchContext
+
+ ; Restore the context of the task selected to execute.
+ portRESTORE_CONTEXT
+
+;/*-----------------------------------------------------------*/
+; Yield to another task from within the FreeRTOS API
+
+ .def vPortYeildWithinAPI
+
+vPortYeildWithinAPI:
+ ; Save the context of the current task.
+
+ portSAVE_CONTEXT
+ ; Clear SSI flag.
+ MOVW R0, #0xFFF4
+ MOVT R0, #0xFFFF
+ LDR R0, [R0]
+
+ ; Select the next task to execute. */
+ BL vTaskSwitchContext
+
+ ; Restore the context of the task selected to execute.
+ portRESTORE_CONTEXT
+
+;/*-----------------------------------------------------------*/
+; Preemptive Tick
+
+ .def vPortPreemptiveTick
+
+vPortPreemptiveTick:
+
+ ; Save the context of the current task.
+ portSAVE_CONTEXT
+
+ ; Clear interrupt flag
+ MOVW R0, #0xFC88
+ MOVT R0, #0xFFFF
+ MOV R1, #1
+ STR R1, [R0]
+
+ ; Increment the tick count, making any adjustments to the blocked lists
+ ; that may be necessary.
+ BL xTaskIncrementTick
+
+ ; Select the next task to execute.
+ CMP R0, #0
+ BLNE vTaskSwitchContext
+
+ ; Restore the context of the task selected to execute.
+ portRESTORE_CONTEXT
+
+;-------------------------------------------------------------------------------
+
+ .if (__TI_VFP_SUPPORT__)
+
+ .def vPortInitialiseFPSCR
+
+vPortInitialiseFPSCR:
+
+ MOV R0, #0
+ FMXR FPSCR, R0
+ BX LR
+
+ .endif ;__TI_VFP_SUPPORT__
+
+
+pxCurrentTCBConst .word pxCurrentTCB
+ulFPUContextConst .word ulTaskHasFPUContext
+;-------------------------------------------------------------------------------
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portmacro.h
new file mode 100644
index 0000000..d1240ae
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/ARM_Cortex-R4/portmacro.h
@@ -0,0 +1,118 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef __PORTMACRO_H__
+#define __PORTMACRO_H__
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Type definitions. */
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE double
+#define portLONG long
+#define portSHORT short
+#define portSTACK_TYPE uint32_t
+#define portBASE_TYPE long
+
+typedef portSTACK_TYPE StackType_t;
+typedef long BaseType_t;
+typedef unsigned long UBaseType_t;
+
+#if (configUSE_16_BIT_TICKS == 1)
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY (TickType_t) 0xFFFF
+#else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY (TickType_t) 0xFFFFFFFFF
+
+ /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
+ not need to be guarded with a critical section. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+#endif
+
+
+/* Architecture specifics. */
+#define portSTACK_GROWTH (-1)
+#define portTICK_PERIOD_MS ((TickType_t) 1000 / configTICK_RATE_HZ)
+#define portBYTE_ALIGNMENT 8
+
+/* Critical section handling. */
+extern void vPortEnterCritical(void);
+extern void vPortExitCritical(void);
+#define portENTER_CRITICAL() vPortEnterCritical()
+#define portEXIT_CRITICAL() vPortExitCritical()
+#define portDISABLE_INTERRUPTS() asm( " CPSID I" )
+#define portENABLE_INTERRUPTS() asm( " CPSIE I" )
+
+/* Scheduler utilities. */
+#pragma SWI_ALIAS( vPortYield, 0 )
+extern void vPortYield( void );
+#define portYIELD() vPortYield()
+#define portSYS_SSIR1_REG ( * ( ( volatile uint32_t * ) 0xFFFFFFB0 ) )
+#define portSYS_SSIR1_SSKEY ( 0x7500UL )
+#define portYIELD_WITHIN_API() { portSYS_SSIR1_REG = portSYS_SSIR1_SSKEY; asm( " DSB " ); asm( " ISB " ); }
+#define portYIELD_FROM_ISR( x ) do { if( x != pdFALSE ) { portSYS_SSIR1_REG = portSYS_SSIR1_SSKEY; ( void ) portSYS_SSIR1_REG; } } while( 0 )
+
+#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+#endif
+
+/* Architecture specific optimisations. */
+#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
+
+ /* Check the configuration. */
+ #if( configMAX_PRIORITIES > 32 )
+ #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
+ #endif
+
+ /* Store/clear the ready priorities in a bit map. */
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
+
+ /*-----------------------------------------------------------*/
+
+ #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __clz( ( uxReadyPriorities ) ) )
+
+#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
+
+
+/* Task function macros as described on the FreeRTOS.org WEB site. */
+#define portTASK_FUNCTION(vFunction, pvParameters) void vFunction(void *pvParameters)
+#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
+
+#endif /* __PORTMACRO_H__ */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/data_model.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/data_model.h
new file mode 100644
index 0000000..aa514e5
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/data_model.h
@@ -0,0 +1,54 @@
+;/*
+; * FreeRTOS Kernel V10.5.0
+; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+; *
+; * SPDX-License-Identifier: MIT
+; *
+; * Permission is hereby granted, free of charge, to any person obtaining a copy of
+; * this software and associated documentation files (the "Software"), to deal in
+; * the Software without restriction, including without limitation the rights to
+; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+; * the Software, and to permit persons to whom the Software is furnished to do so,
+; * subject to the following conditions:
+; *
+; * The above copyright notice and this permission notice shall be included in all
+; * copies or substantial portions of the Software.
+; *
+; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+; *
+; * https://www.FreeRTOS.org
+; * https://github.com/FreeRTOS
+; *
+; */
+
+ .if $DEFINED( __LARGE_DATA_MODEL__ )
+ .define "pushm.a", pushm_x
+ .define "popm.a", popm_x
+ .define "push.a", push_x
+ .define "pop.a", pop_x
+ .define "mov.a", mov_x
+ .else
+ .define "pushm.w", pushm_x
+ .define "popm.w", popm_x
+ .define "push.w", push_x
+ .define "pop.w", pop_x
+ .define "mov.w", mov_x
+ .endif
+
+ .if $DEFINED( __LARGE_CODE_MODEL__ )
+ .define "calla", call_x
+ .define "reta", ret_x
+ .else
+ .define "call", call_x
+ .define "ret", ret_x
+ .endif
+
+
+
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/port.c b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/port.c
new file mode 100644
index 0000000..4bf1a00
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/port.c
@@ -0,0 +1,188 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+/*-----------------------------------------------------------
+ * Implementation of functions defined in portable.h for the MSP430X port.
+ *----------------------------------------------------------*/
+
+/* Constants required for hardware setup. The tick ISR runs off the ACLK,
+not the MCLK. */
+#define portACLK_FREQUENCY_HZ ( ( TickType_t ) 32768 )
+#define portINITIAL_CRITICAL_NESTING ( ( uint16_t ) 10 )
+#define portFLAGS_INT_ENABLED ( ( StackType_t ) 0x08 )
+
+/* We require the address of the pxCurrentTCB variable, but don't want to know
+any details of its type. */
+typedef void TCB_t;
+extern volatile TCB_t * volatile pxCurrentTCB;
+
+/* Each task maintains a count of the critical section nesting depth. Each
+time a critical section is entered the count is incremented. Each time a
+critical section is exited the count is decremented - with interrupts only
+being re-enabled if the count is zero.
+
+usCriticalNesting will get set to zero when the scheduler starts, but must
+not be initialised to zero as this will cause problems during the startup
+sequence. */
+volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
+/*-----------------------------------------------------------*/
+
+
+/*
+ * Sets up the periodic ISR used for the RTOS tick. This uses timer 0, but
+ * could have alternatively used the watchdog timer or timer 1.
+ */
+void vPortSetupTimerInterrupt( void );
+/*-----------------------------------------------------------*/
+
+/*
+ * Initialise the stack of a task to look exactly as if a call to
+ * portSAVE_CONTEXT had been called.
+ *
+ * See the header file portable.h.
+ */
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
+{
+uint16_t *pusTopOfStack;
+uint32_t *pulTopOfStack, ulTemp;
+
+ /*
+ Place a few bytes of known values on the bottom of the stack.
+ This is just useful for debugging and can be included if required.
+
+ *pxTopOfStack = ( StackType_t ) 0x1111;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x2222;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x3333;
+ pxTopOfStack--;
+ */
+
+ /* Data types are need either 16 bits or 32 bits depending on the data
+ and code model used. */
+ if( sizeof( pxCode ) == sizeof( uint16_t ) )
+ {
+ pusTopOfStack = ( uint16_t * ) pxTopOfStack;
+ ulTemp = ( uint32_t ) pxCode;
+ *pusTopOfStack = ( uint16_t ) ulTemp;
+ }
+ else
+ {
+ /* Make room for a 20 bit value stored as a 32 bit value. */
+ pusTopOfStack = ( uint16_t * ) pxTopOfStack;
+ pusTopOfStack--;
+ pulTopOfStack = ( uint32_t * ) pusTopOfStack;
+ *pulTopOfStack = ( uint32_t ) pxCode;
+ }
+
+ pusTopOfStack--;
+ *pusTopOfStack = portFLAGS_INT_ENABLED;
+ pusTopOfStack -= ( sizeof( StackType_t ) / 2 );
+
+ /* From here on the size of stacked items depends on the memory model. */
+ pxTopOfStack = ( StackType_t * ) pusTopOfStack;
+
+ /* Next the general purpose registers. */
+ #ifdef PRELOAD_REGISTER_VALUES
+ *pxTopOfStack = ( StackType_t ) 0xffff;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xeeee;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xdddd;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pvParameters;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xbbbb;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xaaaa;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x9999;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x8888;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x5555;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x6666;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x5555;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x4444;
+ pxTopOfStack--;
+ #else
+ pxTopOfStack -= 3;
+ *pxTopOfStack = ( StackType_t ) pvParameters;
+ pxTopOfStack -= 9;
+ #endif
+
+ /* A variable is used to keep track of the critical section nesting.
+ This variable has to be stored as part of the task context and is
+ initially set to zero. */
+ *pxTopOfStack = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
+
+ /* Return a pointer to the top of the stack we have generated so this can
+ be stored in the task control block for the task. */
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* It is unlikely that the MSP430 port will get stopped. If required simply
+ disable the tick interrupt here. */
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * Hardware initialisation to generate the RTOS tick.
+ */
+void vPortSetupTimerInterrupt( void )
+{
+ vApplicationSetupTimerInterrupt();
+}
+/*-----------------------------------------------------------*/
+
+#pragma vector=configTICK_VECTOR
+interrupt void vTickISREntry( void )
+{
+extern void vPortTickISR( void );
+
+ __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
+ #if configUSE_PREEMPTION == 1
+ extern void vPortPreemptiveTickISR( void );
+ vPortPreemptiveTickISR();
+ #else
+ extern void vPortCooperativeTickISR( void );
+ vPortCooperativeTickISR();
+ #endif
+}
+
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portext.asm b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portext.asm
new file mode 100644
index 0000000..5e3b635
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portext.asm
@@ -0,0 +1,160 @@
+;/*
+; * FreeRTOS Kernel V10.5.0
+; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+; *
+; * SPDX-License-Identifier: MIT
+; *
+; * Permission is hereby granted, free of charge, to any person obtaining a copy of
+; * this software and associated documentation files (the "Software"), to deal in
+; * the Software without restriction, including without limitation the rights to
+; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+; * the Software, and to permit persons to whom the Software is furnished to do so,
+; * subject to the following conditions:
+; *
+; * The above copyright notice and this permission notice shall be included in all
+; * copies or substantial portions of the Software.
+; *
+; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+; *
+; * https://www.FreeRTOS.org
+; * https://github.com/FreeRTOS
+; *
+; */
+
+; * The definition of the "register test" tasks, as described at the top of
+; * main.c
+
+ .include data_model.h
+
+ .global xTaskIncrementTick
+ .global vTaskSwitchContext
+ .global vPortSetupTimerInterrupt
+ .global pxCurrentTCB
+ .global usCriticalNesting
+
+ .def vPortPreemptiveTickISR
+ .def vPortCooperativeTickISR
+ .def vPortYield
+ .def xPortStartScheduler
+
+;-----------------------------------------------------------
+
+portSAVE_CONTEXT .macro
+
+ ;Save the remaining registers.
+ pushm_x #12, r15
+ mov.w &usCriticalNesting, r14
+ push_x r14
+ mov_x &pxCurrentTCB, r12
+ mov_x sp, 0( r12 )
+ .endm
+;-----------------------------------------------------------
+
+portRESTORE_CONTEXT .macro
+
+ mov_x &pxCurrentTCB, r12
+ mov_x @r12, sp
+ pop_x r15
+ mov.w r15, &usCriticalNesting
+ popm_x #12, r15
+ nop
+ pop.w sr
+ nop
+ ret_x
+ .endm
+;-----------------------------------------------------------
+
+;*
+;* The RTOS tick ISR.
+;*
+;* If the cooperative scheduler is in use this simply increments the tick
+;* count.
+;*
+;* If the preemptive scheduler is in use a context switch can also occur.
+;*/
+
+ .text
+ .align 2
+
+vPortPreemptiveTickISR: .asmfunc
+
+ ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs
+ ;to save it manually before it gets modified (interrupts get disabled).
+ push.w sr
+ portSAVE_CONTEXT
+
+ call_x #xTaskIncrementTick
+ call_x #vTaskSwitchContext
+
+ portRESTORE_CONTEXT
+ .endasmfunc
+;-----------------------------------------------------------
+
+ .align 2
+
+vPortCooperativeTickISR: .asmfunc
+
+ ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs
+ ;to save it manually before it gets modified (interrupts get disabled).
+ push.w sr
+ portSAVE_CONTEXT
+
+ call_x #xTaskIncrementTick
+
+ portRESTORE_CONTEXT
+
+ .endasmfunc
+;-----------------------------------------------------------
+
+;
+; Manual context switch called by the portYIELD() macro.
+;
+
+ .align 2
+
+vPortYield: .asmfunc
+
+ ; The sr needs saving before it is modified.
+ push.w sr
+
+ ; Now the SR is stacked we can disable interrupts.
+ dint
+ nop
+
+ ; Save the context of the current task.
+ portSAVE_CONTEXT
+
+ ; Select the next task to run.
+ call_x #vTaskSwitchContext
+
+ ; Restore the context of the new task.
+ portRESTORE_CONTEXT
+ .endasmfunc
+;-----------------------------------------------------------
+
+
+;
+; Start off the scheduler by initialising the RTOS tick timer, then restoring
+; the context of the first task.
+;
+
+ .align 2
+
+xPortStartScheduler: .asmfunc
+
+ ; Setup the hardware to generate the tick. Interrupts are disabled
+ ; when this function is called.
+ call_x #vPortSetupTimerInterrupt
+
+ ; Restore the context of the first task that is going to run.
+ portRESTORE_CONTEXT
+ .endasmfunc
+;-----------------------------------------------------------
+
+ .end
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portmacro.h b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portmacro.h
new file mode 100644
index 0000000..75b0eb4
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CCS/MSP430X/portmacro.h
@@ -0,0 +1,144 @@
+/*
+ * FreeRTOS Kernel V10.5.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Hardware includes. */
+#include "msp430.h"
+
+/* Type definitions. */
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE double
+#define portLONG long
+#define portSHORT int
+#define portBASE_TYPE portSHORT
+
+/* The stack type changes depending on the data model. */
+#ifdef __LARGE_DATA_MODEL__
+ #define portSTACK_TYPE uint32_t
+#else
+ #define portSTACK_TYPE uint16_t
+ #define portPOINTER_SIZE_TYPE uint16_t
+#endif
+
+typedef portSTACK_TYPE StackType_t;
+typedef short BaseType_t;
+typedef unsigned short UBaseType_t;
+
+#if( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+#else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+#endif
+
+/*-----------------------------------------------------------*/
+
+/* Interrupt control macros. */
+#define portDISABLE_INTERRUPTS() _disable_interrupt(); _nop()
+#define portENABLE_INTERRUPTS() _enable_interrupt(); _nop()
+/*-----------------------------------------------------------*/
+
+/* Critical section control macros. */
+#define portNO_CRITICAL_SECTION_NESTING ( ( uint16_t ) 0 )
+
+#define portENTER_CRITICAL() \
+{ \
+extern volatile uint16_t usCriticalNesting; \
+ \
+ portDISABLE_INTERRUPTS(); \
+ \
+ /* Now interrupts are disabled usCriticalNesting can be accessed */ \
+ /* directly. Increment ulCriticalNesting to keep a count of how many */ \
+ /* times portENTER_CRITICAL() has been called. */ \
+ usCriticalNesting++; \
+}
+
+#define portEXIT_CRITICAL() \
+{ \
+extern volatile uint16_t usCriticalNesting; \
+ \
+ if( usCriticalNesting > portNO_CRITICAL_SECTION_NESTING ) \
+ { \
+ /* Decrement the nesting count as we are leaving a critical section. */ \
+ usCriticalNesting--; \
+ \
+ /* If the nesting level has reached zero then interrupts should be */ \
+ /* re-enabled. */ \
+ if( usCriticalNesting == portNO_CRITICAL_SECTION_NESTING ) \
+ { \
+ portENABLE_INTERRUPTS(); \
+ } \
+ } \
+}
+/*-----------------------------------------------------------*/
+
+/* Task utilities. */
+
+/*
+ * Manual context switch called by portYIELD or taskYIELD.
+ */
+extern void vPortYield( void );
+#define portYIELD() vPortYield()
+/*-----------------------------------------------------------*/
+
+/* Hardware specifics. */
+#define portBYTE_ALIGNMENT 2
+#define portSTACK_GROWTH ( -1 )
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+#define portNOP() __no_operation()
+/*-----------------------------------------------------------*/
+
+/* Task function macros as described on the FreeRTOS.org WEB site. */
+#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
+#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
+
+extern void vTaskSwitchContext( void );
+#define portYIELD_FROM_ISR( x ) do { if( x ) vPortYield(); } while( 0 )
+
+void vApplicationSetupTimerInterrupt( void );
+
+/* sizeof( int ) != sizeof( long ) so a full printf() library is required if
+run time stats information is to be displayed. */
+#define portLU_PRINTF_SPECIFIER_REQUIRED
+
+#endif /* PORTMACRO_H */
+
diff --git a/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CMakeLists.txt b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CMakeLists.txt
new file mode 100644
index 0000000..ea54ec4
--- /dev/null
+++ b/bsp/sdk_overlay/rtos/freertos/freertos-kernel/portable/CMakeLists.txt
@@ -0,0 +1,994 @@
+# FreeRTOS internal cmake file. Do not use it in user top-level project
+
+add_library(freertos_kernel_port STATIC
+ # 16-Bit DOS ports for BCC
+ $<$:
+ BCC/16BitDOS/common/portcomn.c
+ BCC/16BitDOS/Flsh186/port.c>
+
+ $<$:
+ BCC/16BitDOS/common/portcomn.c
+ BCC/16BitDOS/PC/port.c>
+
+ # ARMv7-M port for Texas Instruments Code Composer Studio
+ $<$:
+ CCS/ARM_CM3/port.c
+ CCS/ARM_CM3/portasm.asm>
+
+ # ARMv7E-M port for Texas Instruments Code Composer Studio
+ $<$:
+ CCS/ARM_CM4F/port.c
+ CCS/ARM_CM4F/portasm.asm>
+
+ # ARMv7-R port for Texas Instruments Code Composer Studio
+ $<$:
+ CCS/ARM_Cortex-R4/port.c
+ CCS/ARM_Cortex-R4/portASM.asm>
+
+ # Texas Instruments MSP430 port for Texas Instruments Code Composer Studio
+ $<$:
+ CCS/MSP430X/port.c
+ CCS/MSP430X/portext.asm>
+
+ # NXP (formerly Motorola, Freescale) Cold Fire and 68HCS12 ports for Code Warrior
+ $<$:
+ CodeWarrior/ColdFire_V1/port.c
+ CodeWarrior/ColdFire_V1/portasm.S>
+
+ $<$:
+ CodeWarrior/ColdFire_V2/port.c
+ CodeWarrior/ColdFire_V2/portasm.S>
+
+ $<$