init Files
This commit is contained in:
BIN
libraries/lvgl/env_support/cmsis-pack/LVGL.lvgl.9.2.2.pack
Normal file
BIN
libraries/lvgl/env_support/cmsis-pack/LVGL.lvgl.9.2.2.pack
Normal file
Binary file not shown.
1900
libraries/lvgl/env_support/cmsis-pack/LVGL.lvgl.pdsc
Normal file
1900
libraries/lvgl/env_support/cmsis-pack/LVGL.lvgl.pdsc
Normal file
File diff suppressed because it is too large
Load Diff
9
libraries/lvgl/env_support/cmsis-pack/LVGL.pidx
Normal file
9
libraries/lvgl/env_support/cmsis-pack/LVGL.pidx
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<vendor>LVGL</vendor>
|
||||
<url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url>
|
||||
<timestamp>2024-10-29</timestamp>
|
||||
<pindex>
|
||||
<pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="9.2.2"/>
|
||||
</pindex>
|
||||
</index>
|
||||
247
libraries/lvgl/env_support/cmsis-pack/README.md
Normal file
247
libraries/lvgl/env_support/cmsis-pack/README.md
Normal file
@@ -0,0 +1,247 @@
|
||||
# How to Create CMSIS-Pack
|
||||
|
||||
|
||||
|
||||
## STEP 1 Update 'lv_conf_cmsis.h'
|
||||
|
||||
1. Copy the **lv_conf_template.h** to '**cmsis-pack**' directory
|
||||
|
||||
2. Set the macro protector to '1'
|
||||
|
||||
```c
|
||||
...
|
||||
/* clang-format off */
|
||||
#if 1 /*Set it to "1" to enable content*/
|
||||
...
|
||||
```
|
||||
|
||||
remove the misleading guide above this code segment.
|
||||
|
||||
```c
|
||||
/*
|
||||
* Copy this file as `lv_conf.h`
|
||||
* 1. simply next to the `lvgl` folder
|
||||
* 2. or any other places and
|
||||
* - define `LV_CONF_INCLUDE_SIMPLE`
|
||||
* - add the path as include path
|
||||
*/
|
||||
```
|
||||
|
||||
|
||||
3. Add including for '**RTE_Components.h**'
|
||||
|
||||
```c
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
#include "RTE_Components.h"
|
||||
...
|
||||
```
|
||||
4. Remove macro definitions for
|
||||
|
||||
- LV_USE_DEMO_WIDGETS
|
||||
- LV_USE_DEMO_BENCHMARK
|
||||
- LV_USE_IME_PINYIN
|
||||
- LV_USE_OS
|
||||
- LV_USE_FILE_EXPLORER
|
||||
- LV_USE_DEMO_WIDGETS
|
||||
- LV_USE_DEMO_KEYPAD_AND_ENCODER
|
||||
- LV_USE_DEMO_BENCHMARK
|
||||
- LV_USE_DEMO_RENDER
|
||||
- LV_USE_DEMO_STRESS
|
||||
- LV_USE_DEMO_MUSIC
|
||||
- LV_USE_DEMO_FLEX_LAYOUT
|
||||
- LV_USE_DEMO_MULTILANG
|
||||
- LV_USE_DEMO_TRANSFORM
|
||||
- LV_USE_DEMO_SCROLL
|
||||
- LV_USE_DEMO_VECTOR_GRAPHIC
|
||||
- LV_USE_DRAW_VGLITE
|
||||
- LV_USE_DRAW_VG_LITE
|
||||
- LV_USE_PXP
|
||||
- LV_USE_DRAW_SDL
|
||||
- LV_USE_DRAW_ARM2D_SYNC
|
||||
- LV_USE_SNAPSHOT
|
||||
- LV_USE_MONKEY
|
||||
- LV_USE_GRIDNAV
|
||||
- LV_USE_FRAGMENT
|
||||
- LV_USE_IMGFONT
|
||||
- LV_USE_LINUX_DRM
|
||||
- LV_USE_TFT_ESPI
|
||||
- LV_USE_ST7735
|
||||
- LV_USE_ST7789
|
||||
- LV_USE_ST7796
|
||||
- LV_USE_ILI9341
|
||||
- LV_USE_RENESAS_GLCDC
|
||||
|
||||
5. Update `LV_LOG_PRINTF` to `1` and `LV_LOG_LEVEL` to `LV_LOG_LEVEL_USER`
|
||||
|
||||
|
||||
6. Set `LV_FONT_MONTSERRAT_12`, `LV_FONT_MONTSERRAT_24` and `LV_FONT_MONTSERRAT_16` to `1` (So Widgets and Benchmark can be compiled correctly, this is for improving the out of box experience.)
|
||||
|
||||
|
||||
7. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment.
|
||||
```c
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
|
||||
#define LV_DRAW_BUF_STRIDE_ALIGN 4
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
|
||||
```
|
||||
Make sure `LV_MEM_SIZE` is no less than `(128*1024U)`.
|
||||
|
||||
8. Remove following macro definitions in the `3rd party libraries` section:
|
||||
|
||||
- \#define LV_USE_FS_STDIO 0
|
||||
- \#define LV_USE_FS_POSIX 0
|
||||
- \#define LV_USE_FS_WIN32 0
|
||||
- \#define LV_USE_FS_FATFS 0
|
||||
- #define LV_USE_FS_LITTLEFS 0
|
||||
- #define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0
|
||||
- #define LV_USE_FS_ARDUINO_SD 0
|
||||
- #define LV_USE_FS_MEMFS 0
|
||||
- \#define LV_USE_LODEPNG 0
|
||||
- #define LV_USE_LIBPNG 0
|
||||
- \#define LV_USE_BMP 0
|
||||
- \#define LV_USE_RLE 0
|
||||
- #define LV_USE_TJPGD 0
|
||||
- #define LV_USE_LIBJPEG_TURBO 0
|
||||
- \#define LV_USE_GIF 0
|
||||
- \#define LV_USE_BARCODE 0
|
||||
- \#define LV_USE_QRCODE 0
|
||||
- \#define LV_USE_FREETYPE 0
|
||||
- \#define LV_USE_TINY_TTF 0
|
||||
- \#define LV_USE_RLOTTIE 0
|
||||
- \#define LV_USE_FFMPEG 0
|
||||
|
||||
9. update the definition of following macros: `LV_USE_VECTOR_GRAPHIC`, `LV_USE_THORVE_INTERNAL` and `LV_USE_THORVE_EXTERNAL` as
|
||||
|
||||
```c
|
||||
/*Enable Vector Graphic APIs*/
|
||||
#ifndef LV_USE_VECTOR_GRAPHIC
|
||||
# define LV_USE_VECTOR_GRAPHIC 0
|
||||
|
||||
/* Enable ThorVG (vector graphics library) from the src/libs folder */
|
||||
# define LV_USE_THORVG_INTERNAL 0
|
||||
|
||||
/* Enable ThorVG by assuming that its installed and linked to the project */
|
||||
# define LV_USE_THORVG_EXTERNAL 0
|
||||
#endif
|
||||
```
|
||||
|
||||
10. update the definition of following macros: `LV_USE_LZ4`, `LV_USE_LZ4_INTERNAL` and `LV_USE_LZ4_EXTERNAL` as
|
||||
|
||||
```c
|
||||
/*Enable LZ4 compress/decompress lib*/
|
||||
#ifndef LV_USE_LZ4
|
||||
# define LV_USE_LZ4 0
|
||||
|
||||
/*Use lvgl built-in LZ4 lib*/
|
||||
# define LV_USE_LZ4_INTERNAL 0
|
||||
|
||||
/*Use external LZ4 library*/
|
||||
# define LV_USE_LZ4_EXTERNAL 0
|
||||
#endif
|
||||
```
|
||||
|
||||
|
||||
11. Add the following code to `HAL SETTINGS`:
|
||||
|
||||
```c
|
||||
/*customize tick-get */
|
||||
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
|
||||
#define LV_GLOBAL_INIT(__GLOBAL_PTR) \
|
||||
do { \
|
||||
lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
|
||||
extern uint32_t perfc_tick_get(void); \
|
||||
(__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
|
||||
} while(0)
|
||||
#endif
|
||||
```
|
||||
|
||||
|
||||
|
||||
12. Replace the macro definition:
|
||||
|
||||
```c
|
||||
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
|
||||
```
|
||||
|
||||
with:
|
||||
|
||||
```c
|
||||
#if !defined(LV_USE_DRAW_SW_ASM) && defined(RTE_Acceleration_Arm_2D)
|
||||
/*turn-on helium acceleration when Arm-2D and the Helium-powered device are detected */
|
||||
#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE
|
||||
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_HELIUM
|
||||
#define LV_USE_DRAW_ARM2D_SYNC 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_DRAW_SW_ASM
|
||||
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
|
||||
#endif
|
||||
```
|
||||
|
||||
13. Update macro `LV_PROFILER_INCLUDE`:
|
||||
|
||||
```c
|
||||
#define LV_PROFILER_INCLUDE "src/misc/lv_profiler_builtin.h"
|
||||
```
|
||||
|
||||
|
||||
|
||||
14. Add the following macro definition to **COLOR SETTINGS** section:
|
||||
|
||||
```c
|
||||
#define LV_COLOR_16_SWAP 0
|
||||
```
|
||||
|
||||
|
||||
|
||||
14. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.
|
||||
|
||||
|
||||
|
||||
## STEP 2 Check, Update and Run the 'gen_pack.sh'
|
||||
|
||||
```sh
|
||||
if [ `uname -s` = "Linux" ]
|
||||
then
|
||||
CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
|
||||
PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
|
||||
else
|
||||
CMSIS_PACK_PATH="/C/Users/$USER/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
|
||||
PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
|
||||
fi
|
||||
[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
|
||||
echo $PATH_TO_ADD appended to PATH
|
||||
echo " "
|
||||
```
|
||||
|
||||
|
||||
|
||||
### A. For Windows users
|
||||
|
||||
Update the '**CMSIS_PACK_PATH**' accordingly (Usually just replace the name gabriel with your own windows account name is sufficient.).
|
||||
|
||||
Update the '**PATH_TO_ADD**' to point to the installation folders of **7Zip** and **xmllint**.
|
||||
|
||||
Launch the git-bash and go to the cmsis-pack folder.
|
||||
|
||||
enter the following command:
|
||||
|
||||
```sh
|
||||
./gen_pack.sh
|
||||
```
|
||||
|
||||
|
||||
|
||||
### B. For Linux Users
|
||||
|
||||
Update '**PATH_TO_ADD**' if necessary.
|
||||
|
||||
go to the **cmsis-pack** folder.
|
||||
|
||||
enter the following command:
|
||||
|
||||
```sh
|
||||
./gen_pack.sh
|
||||
```
|
||||
237
libraries/lvgl/env_support/cmsis-pack/gen_pack.sh
Executable file
237
libraries/lvgl/env_support/cmsis-pack/gen_pack.sh
Executable file
@@ -0,0 +1,237 @@
|
||||
#!/bin/bash
|
||||
# Version: 1.1
|
||||
# Date: 2022-01-11
|
||||
# This bash script generates a CMSIS Software Pack:
|
||||
#
|
||||
# Pre-requisites:
|
||||
# - bash shell (for Windows: install git for Windows)
|
||||
# - 7z in path (zip archiving utility)
|
||||
# e.g. Ubuntu: sudo apt-get install p7zip-full p7zip-rar)
|
||||
# - PackChk in path with execute permission
|
||||
# (see CMSIS-Pack: CMSIS/Utilities/<os>/PackChk)
|
||||
# - xmllint in path (XML schema validation)
|
||||
# e.g. Ubuntu: sudo apt-get install libxml2-utils
|
||||
# Windows: download from https://www.zlatkovic.com/pub/libxml/
|
||||
|
||||
############### EDIT BELOW ###############
|
||||
# Extend Path environment variable locally
|
||||
#
|
||||
if [ `uname -s` = "Linux" ]
|
||||
then
|
||||
CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
|
||||
PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
|
||||
else
|
||||
CMSIS_PACK_PATH="/C/Users/$USER/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
|
||||
PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:/C/Program Files/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
|
||||
fi
|
||||
[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
|
||||
echo $PATH_TO_ADD appended to PATH
|
||||
echo " "
|
||||
|
||||
# Pack warehouse directory - destination
|
||||
PACK_WAREHOUSE=./
|
||||
|
||||
# Temporary pack build directory
|
||||
PACK_BUILD=build/
|
||||
|
||||
# Specify directories included in pack relative to base directory
|
||||
# All directories:
|
||||
# PACK_DIRS=`ls -d */`
|
||||
# Do not include the build directory if it is local
|
||||
# PACK_DIRS=${PACK_DIRS//$PACK_BUILD/}
|
||||
# PACK_DIRS=${PACK_DIRS//$PACK_WAREHOUSE/}
|
||||
|
||||
# alternative: specify directory names to be added to pack base directory
|
||||
PACK_DIRS="
|
||||
../../src
|
||||
../../demos
|
||||
../../env_support/pikascript
|
||||
"
|
||||
|
||||
|
||||
# Specify file names to be added to pack base directory
|
||||
PACK_BASE_FILES="
|
||||
../../LICENCE.txt
|
||||
../../README.md
|
||||
../../lvgl.h
|
||||
../../lv_version.h
|
||||
lv_conf_cmsis.h
|
||||
lv_cmsis_pack.txt
|
||||
"
|
||||
|
||||
############ DO NOT EDIT BELOW ###########
|
||||
echo Starting CMSIS-Pack Generation: `date`
|
||||
# Zip utility check
|
||||
ZIP=7z
|
||||
type -a $ZIP
|
||||
errorlevel=$?
|
||||
if [ $errorlevel -gt 0 ]
|
||||
then
|
||||
echo "Error: No 7zip Utility found"
|
||||
echo "Action: Add 7zip to your path"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
|
||||
# Pack checking utility check
|
||||
PACKCHK=PackChk
|
||||
type -a $PACKCHK
|
||||
errorlevel=$?
|
||||
if [ $errorlevel != 0 ]
|
||||
then
|
||||
echo "Error: No PackChk Utility found"
|
||||
echo "Action: Add PackChk to your path"
|
||||
echo "Hint: Included in CMSIS Pack:"
|
||||
echo "<pack_root_dir>/ARM/CMSIS/<version>/CMSIS/Utilities/<os>/"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
echo " "
|
||||
|
||||
# XML syntax checking utility check
|
||||
XMLLINT=xmllint
|
||||
type -a $XMLLINT
|
||||
errorlevel=$?
|
||||
if [ $errorlevel != 0 ]
|
||||
then
|
||||
echo "Error: No xmllint found"
|
||||
echo "Action: Add xmllint to your path"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
echo " "
|
||||
|
||||
# Locate Package Description file
|
||||
# check whether there is more than one pdsc file
|
||||
NUM_PDSCS=`ls -1 *.pdsc | wc -l`
|
||||
PACK_DESCRIPTION_FILE=`ls *.pdsc`
|
||||
if [ $NUM_PDSCS -lt 1 ]
|
||||
then
|
||||
echo "Error: No *.pdsc file found in current directory"
|
||||
echo " "
|
||||
elif [ $NUM_PDSCS -gt 1 ]
|
||||
then
|
||||
echo "Error: Only one PDSC file allowed in directory structure:"
|
||||
echo "Found:"
|
||||
echo "$PACK_DESCRIPTION_FILE"
|
||||
echo "Action: Delete unused pdsc files"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
|
||||
SAVEIFS=$IFS
|
||||
IFS=.
|
||||
set $PACK_DESCRIPTION_FILE
|
||||
# Pack Vendor
|
||||
PACK_VENDOR=$1
|
||||
# Pack Name
|
||||
PACK_NAME=$2
|
||||
echo Generating Pack Version: for $PACK_VENDOR.$PACK_NAME
|
||||
echo " "
|
||||
IFS=$SAVEIFS
|
||||
|
||||
#if $PACK_BUILD directory does not exist, create it.
|
||||
if [ ! -d $PACK_BUILD ]; then
|
||||
mkdir -p $PACK_BUILD
|
||||
fi
|
||||
|
||||
mkdir -p ${PACK_BUILD}/examples
|
||||
mkdir -p ${PACK_BUILD}/examples/porting
|
||||
|
||||
|
||||
|
||||
# directories
|
||||
echo Adding directories to pack:
|
||||
echo $PACK_DIRS
|
||||
echo " "
|
||||
for d in ${PACK_DIRS}
|
||||
do
|
||||
cp -r "$d" ${PACK_BUILD}
|
||||
done
|
||||
|
||||
# files for base directory
|
||||
echo Adding files to pack:
|
||||
echo $PACK_BASE_FILES
|
||||
echo " "
|
||||
for f in $PACK_BASE_FILES
|
||||
do
|
||||
cp -f "$f" $PACK_BUILD/
|
||||
done
|
||||
|
||||
# Copy files into build base directory: $PACK_BUILD
|
||||
# pdsc file is mandatory in base directory:
|
||||
cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_BUILD}
|
||||
cp -f ../../examples/porting/* ${PACK_BUILD}/examples/porting
|
||||
cp -f ./lv_os_custom_c.txt ${PACK_BUILD}/src/osal/lv_os_custom.c
|
||||
cp -f ./lv_os_custom_h.txt ${PACK_BUILD}/src/osal/lv_os_custom.h
|
||||
|
||||
mv "${PACK_BUILD}/lv_cmsis_pack.txt" "${PACK_BUILD}/lv_cmsis_pack.c"
|
||||
|
||||
# Run Schema Check (for Linux only):
|
||||
# sudo apt-get install libxml2-utils
|
||||
|
||||
echo Running schema check for $PACK_VENDOR.$PACK_NAME.pdsc
|
||||
$XMLLINT --noout --schema ${CMSIS_PACK_PATH}/CMSIS/Utilities/PACK.xsd $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc
|
||||
errorlevel=$?
|
||||
if [ $errorlevel -ne 0 ]; then
|
||||
echo "build aborted: Schema check of $PACK_VENDOR.$PACK_NAME.pdsc against PACK.xsd failed"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
|
||||
# Run Pack Check and generate PackName file with version
|
||||
$PACKCHK $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc -n PackName.txt -x M362
|
||||
errorlevel=$?
|
||||
if [ $errorlevel -ne 0 ]; then
|
||||
echo "build aborted: pack check failed"
|
||||
echo " "
|
||||
exit
|
||||
fi
|
||||
|
||||
PACKNAME=`cat PackName.txt`
|
||||
rm -rf PackName.txt
|
||||
|
||||
# echo apply patches...
|
||||
# rm -rf $PACK_BUILD/demos/lv_demos.h
|
||||
# cp -f ./lv_demos.h $PACK_BUILD/demos/
|
||||
|
||||
echo delete files...
|
||||
find $PACK_BUILD/demos/ -type f -name "*.png" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.gif" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.gif" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.ttf" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.otf" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.jpg" -delete
|
||||
find $PACK_BUILD/demos/ -type f -name "*.fnt" -delete
|
||||
|
||||
# Archiving
|
||||
# $ZIP a $PACKNAME
|
||||
echo creating pack file $PACKNAME
|
||||
#if $PACK_WAREHOUSE directory does not exist create it
|
||||
if [ ! -d $PACK_WAREHOUSE ]; then
|
||||
mkdir -p $PACK_WAREHOUSE
|
||||
fi
|
||||
pushd $PACK_WAREHOUSE
|
||||
PACK_WAREHOUSE=`pwd`
|
||||
popd
|
||||
pushd $PACK_BUILD
|
||||
"$ZIP" a $PACK_WAREHOUSE/$PACKNAME -tzip
|
||||
popd
|
||||
errorlevel=$?
|
||||
if [ $errorlevel -ne 0 ]; then
|
||||
echo "build aborted: archiving failed"
|
||||
exit
|
||||
fi
|
||||
|
||||
# cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_WAREHOUSE}
|
||||
|
||||
|
||||
echo "build of pack succeeded"
|
||||
# Clean up
|
||||
echo "cleaning up ..."
|
||||
|
||||
rm -rf $PACK_BUILD
|
||||
|
||||
echo " "
|
||||
|
||||
echo Completed CMSIS-Pack Generation: `date`
|
||||
139
libraries/lvgl/env_support/cmsis-pack/lv_cmsis_pack.txt
Normal file
139
libraries/lvgl/env_support/cmsis-pack/lv_cmsis_pack.txt
Normal file
@@ -0,0 +1,139 @@
|
||||
/****************************************************************************
|
||||
* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
|
||||
* *
|
||||
* 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. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file lv_cmsis_pack.c
|
||||
*
|
||||
* @brief This file will only be used by cmsis-pack.
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "RTE_Components.h"
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
|
||||
# include "perf_counter.h"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "lv_global.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define state LV_GLOBAL_DEFAULT()->tick_state
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/*! \name The macros to identify the compiler */
|
||||
/*! @{ */
|
||||
|
||||
/*! \note for IAR */
|
||||
#undef __IS_COMPILER_IAR__
|
||||
#if defined(__IAR_SYSTEMS_ICC__)
|
||||
# define __IS_COMPILER_IAR__ 1
|
||||
#endif
|
||||
|
||||
/*! \note for arm compiler 5 */
|
||||
#undef __IS_COMPILER_ARM_COMPILER_5__
|
||||
#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
|
||||
# define __IS_COMPILER_ARM_COMPILER_5__ 1
|
||||
#endif
|
||||
/*! @} */
|
||||
|
||||
/*! \note for arm compiler 6 */
|
||||
|
||||
#undef __IS_COMPILER_ARM_COMPILER_6__
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
# define __IS_COMPILER_ARM_COMPILER_6__ 1
|
||||
#endif
|
||||
|
||||
#undef __IS_COMPILER_ARM_COMPILER__
|
||||
#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__ \
|
||||
|| defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__
|
||||
|
||||
# define __IS_COMPILER_ARM_COMPILER__ 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#undef __IS_COMPILER_LLVM__
|
||||
#if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__
|
||||
# define __IS_COMPILER_LLVM__ 1
|
||||
#else
|
||||
/*! \note for gcc */
|
||||
# undef __IS_COMPILER_GCC__
|
||||
# if defined(__GNUC__) && !( defined(__IS_COMPILER_ARM_COMPILER__) \
|
||||
|| defined(__IS_COMPILER_LLVM__))
|
||||
# define __IS_COMPILER_GCC__ 1
|
||||
# endif
|
||||
/*! @} */
|
||||
#endif
|
||||
/*! @} */
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/* When Arm Compilers using the MicroLib, provide an empty implementation for
|
||||
* time() which is not included in the MicroLib
|
||||
*/
|
||||
#if defined(__IS_COMPILER_ARM_COMPILER__) && __IS_COMPILER_ARM_COMPILER__
|
||||
# if defined(__MICROLIB)
|
||||
__attribute__((weak))
|
||||
_ARMABI time_t time(time_t * time)
|
||||
{
|
||||
return (time_t)(-1);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
# if defined(__PERF_COUNTER__) && __PERF_COUNTER__
|
||||
/**
|
||||
* Get the elapsed milliseconds since start up from perf_counter
|
||||
* @return the elapsed milliseconds
|
||||
*/
|
||||
uint32_t perfc_tick_get(void)
|
||||
{
|
||||
return (uint32_t)get_system_ms();
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
1025
libraries/lvgl/env_support/cmsis-pack/lv_conf_cmsis.h
Normal file
1025
libraries/lvgl/env_support/cmsis-pack/lv_conf_cmsis.h
Normal file
File diff suppressed because it is too large
Load Diff
120
libraries/lvgl/env_support/cmsis-pack/lv_os_custom_c.txt
Normal file
120
libraries/lvgl/env_support/cmsis-pack/lv_os_custom_c.txt
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* @file lv_os_custom.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_os.h"
|
||||
|
||||
#if LV_USE_OS == LV_OS_CUSTOM
|
||||
#include "../misc/lv_types.h"
|
||||
#include "../misc/lv_assert.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
|
||||
void * user_data)
|
||||
{
|
||||
LV_UNUSED(thread);
|
||||
LV_UNUSED(callback);
|
||||
LV_UNUSED(prio);
|
||||
LV_UNUSED(stack_size);
|
||||
LV_UNUSED(user_data);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
lv_result_t lv_thread_delete(lv_thread_t * thread)
|
||||
{
|
||||
LV_UNUSED(thread);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
lv_result_t lv_mutex_init(lv_mutex_t * mutex)
|
||||
{
|
||||
LV_UNUSED(mutex);
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
lv_result_t lv_mutex_lock(lv_mutex_t * mutex)
|
||||
{
|
||||
LV_UNUSED(mutex);
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex)
|
||||
{
|
||||
LV_UNUSED(mutex);
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
lv_result_t lv_mutex_unlock(lv_mutex_t * mutex)
|
||||
{
|
||||
LV_UNUSED(mutex);
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
lv_result_t lv_mutex_delete(lv_mutex_t * mutex)
|
||||
{
|
||||
LV_UNUSED(mutex);
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync)
|
||||
{
|
||||
LV_UNUSED(sync);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync)
|
||||
{
|
||||
LV_UNUSED(sync);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync)
|
||||
{
|
||||
LV_UNUSED(sync);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync)
|
||||
{
|
||||
LV_UNUSED(sync);
|
||||
LV_ASSERT(0);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_OS == LV_OS_CUSTOM*/
|
||||
43
libraries/lvgl/env_support/cmsis-pack/lv_os_custom_h.txt
Normal file
43
libraries/lvgl/env_support/cmsis-pack/lv_os_custom_h.txt
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @file lv_os_custom.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_OS_CUSTOM_H
|
||||
#define LV_OS_CUSTOM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#if LV_USE_OS == LV_OS_CUSTOM
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef int lv_mutex_t;
|
||||
typedef int lv_thread_t;
|
||||
typedef int lv_thread_sync_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_OS == LV_OS_CUSTOM*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_OS_CUSTOM_H*/
|
||||
Reference in New Issue
Block a user