v1.0.3
41
packages/artinchip/aic-dm-apps/.gitignore
vendored
@@ -1,41 +0,0 @@
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
*.mo
|
||||
*.pyc
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
.sconsign.dblite
|
||||
|
||||
/win_cmd.bat
|
||||
/win_env.bat
|
||||
/toolchain/
|
||||
/tools/sdk/
|
||||
/tools/env/
|
||||
/tools/scripts/
|
||||
/tools/onestep.sh
|
||||
@@ -1,340 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
# The Applications of RT-Thread RTOS #
|
||||
|
||||
## Introduction ##
|
||||
|
||||
The user application is the application layer of RT-Thread RTOS. The developer can
|
||||
develop his/her application out of RT-Thread RTOS firmware environment.
|
||||
|
||||
There are two mode for RT-Thread Applications,
|
||||
|
||||
* Standalone Application
|
||||
* Shared Library
|
||||
|
||||
The standalone application has a main() function as the program entry. It more like
|
||||
a program in the PC/Linux.
|
||||
|
||||
The shared library is compose of functions, and provide these APIs to other programs.
|
||||
|
||||
## Build Application ##
|
||||
|
||||
First of all, these programs must base on RT-Thread RTOS environment, and run inside.
|
||||
In the RT-Thread RTOS, the module option must be enable in rtconfig.h File:
|
||||
|
||||
#define RT_USING_MODULE
|
||||
|
||||
And provide the flags for Application building in rtconfig.py file (since RT-Thread 2.1.x,
|
||||
these flags will be gradually added to each BSP):
|
||||
|
||||
* M_CFLAGS - User Application C/C++ compiler flags
|
||||
* M_LFLAGS - User Application link flags
|
||||
|
||||
And Provide the ENV variable `BSP_ROOT` which points to your board support package
|
||||
directory.
|
||||
|
||||
Windows:
|
||||
|
||||
set BSP_ROOT=your_bsp_directory
|
||||
|
||||
Linux:
|
||||
|
||||
export BSP_ROOT=your_bsp_directory
|
||||
|
||||
And to run the command under your BSP directory:
|
||||
|
||||
scons --target=ua -s
|
||||
|
||||
To generate the information for User Application, such as the header file search path,
|
||||
the macro defined in the RT-Thread RTOS etc.
|
||||
|
||||
Finally, you can build the user application in `rtthread-apps` directory, for example:
|
||||
|
||||
scons --app=hello
|
||||
|
||||
To build `hello` program.
|
||||
|
||||
scons --lib=libtar
|
||||
|
||||
To build a shared library.
|
||||
|
||||
## A Simple Application ##
|
||||
|
||||
This is a simple application of `Hello World`:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
It's just like the `Hello World` program in the PC/Linux. Beside that, the user
|
||||
application can use the most of APIs of RT-Thread, for example:
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
void my_thread_entry(void* parameter)
|
||||
{
|
||||
int index;
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_kprintf("index => %d\n", index ++);
|
||||
rt_thread_delay(RT_TICK_PER_SECOND);
|
||||
}
|
||||
}
|
||||
|
||||
int my_thread_init(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("tMyTask', my_thread_entry, RT_NULL,
|
||||
2048, 20, 20);
|
||||
if (tid != RT_NULL) rt_thread_startup(tid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
This example will create a sub-thread, which named as 'tMyTask'.
|
||||
|
||||
## Build the POSIX application in the host ##
|
||||
|
||||
If you didn't set RTT_ROOT/BSP_ROOT, The command ```scons --app=hello``` will
|
||||
build the program in host environment, for example, build it as a Linux program.
|
||||
|
||||
Therefore, only POSIX application can be built like that.
|
||||
|
||||
## License ##
|
||||
|
||||
All of user application are standalone program, if there is no special explanation,
|
||||
the license of these program is [GPLv2](LICENSE). While the license of RT-Thread RTOS is GPLv2+.
|
||||
@@ -1,220 +0,0 @@
|
||||
# File : SConstruct.py
|
||||
# Building Script for User Applications
|
||||
# This file is part of RT-Thread RTOS
|
||||
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Change Logs:
|
||||
# Date Author Notes
|
||||
# 2015-02-07 Bernard The firstly version
|
||||
# 2018-04-15 Bernard Add the build option for library
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import shutil
|
||||
|
||||
# 0. path variable
|
||||
cwd = os.getcwd()
|
||||
tools_path = os.path.join(cwd, 'tools')
|
||||
sdk_path = os.path.join(tools_path, 'sdk')
|
||||
# luban-Lite root directory
|
||||
AIC_ROOT = os.path.join(cwd, '../../../')
|
||||
AIC_ROOT = os.path.normpath(AIC_ROOT)
|
||||
config_path = os.path.join(AIC_ROOT, '.config')
|
||||
toolchain_path = os.path.join(cwd, 'toolchain')
|
||||
os.environ["M_EXEC_PATH"] = os.path.join(toolchain_path, 'bin')
|
||||
if os.path.exists(config_path):
|
||||
# luban-lite custom scripts
|
||||
aic_script_path = os.path.join(AIC_ROOT, 'tools/scripts/')
|
||||
sys.path.append(aic_script_path)
|
||||
from aic_build import *
|
||||
PRJ_CHIP,PRJ_BOARD,PRJ_KERNEL,PRJ_APP,PRJ_DEFCONFIG_NAME,PRJ_CUSTOM_LDS,MKIMAGE_POST_ACTION = get_prj_config(AIC_ROOT)
|
||||
PRJ_NAME = PRJ_DEFCONFIG_NAME.replace('_defconfig','')
|
||||
PRJ_OUT_DIR = 'output/' + PRJ_NAME + '/images/'
|
||||
|
||||
# 1. luban-lite paths
|
||||
bsp_root = AIC_ROOT
|
||||
rtt_root = os.path.join(AIC_ROOT, 'kernel/rt-thread/')
|
||||
rtt_root = os.path.normpath(rtt_root)
|
||||
chip_dir = os.path.join(AIC_ROOT, 'bsp/artinchip/sys/' + PRJ_CHIP)
|
||||
chip_dir = os.path.normpath(chip_dir)
|
||||
prj_out_dir = os.path.join(AIC_ROOT, PRJ_OUT_DIR)
|
||||
prj_out_dir = os.path.normpath(prj_out_dir)
|
||||
|
||||
# 2. make local sdk
|
||||
AddOption('--target',
|
||||
dest = 'target',
|
||||
type = 'string',
|
||||
help = 'Generate target project: sdk')
|
||||
|
||||
if GetOption('target') == 'sdk':
|
||||
if not os.path.exists(sdk_path):
|
||||
os.mkdir(sdk_path)
|
||||
else:
|
||||
shutil.rmtree(sdk_path)
|
||||
os.mkdir(sdk_path)
|
||||
# copy rtconfig.h
|
||||
print('Copy rtconfig.h...')
|
||||
src_f = os.path.join(AIC_ROOT, 'rtconfig.h')
|
||||
des_f = os.path.join(sdk_path, 'rtconfig.h')
|
||||
shutil.copy(src_f, des_f)
|
||||
# copy rtconfig.py
|
||||
print('Copy rtconfig.py...')
|
||||
src_f = os.path.join(chip_dir, 'rtconfig.py')
|
||||
des_f = os.path.join(sdk_path, 'rtconfig.py')
|
||||
shutil.copy(src_f, des_f)
|
||||
# copy rtua.py
|
||||
print('Copy rtua.py...')
|
||||
src_f = os.path.join(prj_out_dir, 'rtua.py')
|
||||
des_f = os.path.join(sdk_path, 'rtua.py')
|
||||
shutil.copy(src_f, des_f)
|
||||
# copy rt-thread/tools/
|
||||
print('Copy rt-thread/tools/...')
|
||||
src_d = os.path.join(rtt_root, 'tools')
|
||||
des_d = os.path.join(sdk_path, 'tools')
|
||||
src_d = os.path.normpath(src_d);
|
||||
des_d = os.path.normpath(des_d);
|
||||
if not os.path.exists(des_d):
|
||||
if platform.system() == 'Linux':
|
||||
shutil.copytree(src_d, des_d)
|
||||
elif platform.system() == 'Windows':
|
||||
shutil.copytree('\\\\?\\' + src_d, '\\\\?\\' + des_d)
|
||||
# copy tools/env/
|
||||
print('Copy tools/env/...')
|
||||
src_d = os.path.join(AIC_ROOT, 'tools/env')
|
||||
des_d = os.path.join(tools_path, 'env')
|
||||
src_d = os.path.normpath(src_d);
|
||||
des_d = os.path.normpath(des_d);
|
||||
if os.path.exists(des_d):
|
||||
shutil.rmtree(des_d)
|
||||
if not os.path.exists(des_d):
|
||||
if platform.system() == 'Linux':
|
||||
shutil.copytree(src_d, des_d)
|
||||
elif platform.system() == 'Windows':
|
||||
shutil.copytree('\\\\?\\' + src_d, '\\\\?\\' + des_d)
|
||||
# copy tools/scripts/
|
||||
print('Copy tools/scripts/...')
|
||||
src_d = os.path.join(AIC_ROOT, 'tools/scripts')
|
||||
des_d = os.path.join(tools_path, 'scripts')
|
||||
src_d = os.path.normpath(src_d);
|
||||
des_d = os.path.normpath(des_d);
|
||||
if os.path.exists(des_d):
|
||||
shutil.rmtree(des_d)
|
||||
if not os.path.exists(des_d):
|
||||
if platform.system() == 'Linux':
|
||||
shutil.copytree(src_d, des_d)
|
||||
elif platform.system() == 'Windows':
|
||||
shutil.copytree('\\\\?\\' + src_d, '\\\\?\\' + des_d)
|
||||
# copy onestep.sh
|
||||
print('Copy onestep.sh...')
|
||||
src_f = os.path.join(AIC_ROOT, 'tools/onestep.sh')
|
||||
des_f = os.path.join(tools_path, 'onestep.sh')
|
||||
if os.path.exists(des_f):
|
||||
os.remove(des_f)
|
||||
shutil.copy(src_f, des_f)
|
||||
# copy win_env.bat
|
||||
print('Copy win_env.bat...')
|
||||
src_f = os.path.join(AIC_ROOT, 'win_env.bat')
|
||||
des_f = os.path.join(cwd, 'win_env.bat')
|
||||
if os.path.exists(des_f):
|
||||
os.remove(des_f)
|
||||
shutil.copy(src_f, des_f)
|
||||
# copy win_cmd.bat
|
||||
print('Copy win_cmd.bat...')
|
||||
src_f = os.path.join(AIC_ROOT, 'win_cmd.bat')
|
||||
des_f = os.path.join(cwd, 'win_cmd.bat')
|
||||
if os.path.exists(des_f):
|
||||
os.remove(des_f)
|
||||
shutil.copy(src_f, des_f)
|
||||
print('Build local sdk succeed!')
|
||||
exit(0)
|
||||
|
||||
# check local sdk
|
||||
if os.path.exists(sdk_path): # local dm-app sdk
|
||||
# 3. local sdk paths
|
||||
bsp_root = sdk_path
|
||||
rtt_root = sdk_path
|
||||
chip_dir = sdk_path
|
||||
prj_out_dir = os.path.join(tools_path, 'scripts')
|
||||
|
||||
if not os.path.exists(config_path) and not os.path.exists(sdk_path):
|
||||
print('Error: no luban-lite sdk!')
|
||||
exit(-1)
|
||||
else:
|
||||
# 4. check & prepare toolchain
|
||||
toolchain_prefix = 'xpack-riscv-none-embed-gcc'
|
||||
if platform.system() == 'Linux':
|
||||
toolchain_suffix = 'linux-x64.tar.gz'
|
||||
elif platform.system() == 'Windows':
|
||||
toolchain_suffix = 'win32-x64.tar.gz'
|
||||
toolchain_ppath = os.path.join(cwd, 'tools/toolchain/')
|
||||
toolchain_ppath = os.path.normpath(toolchain_ppath)
|
||||
ready_f = os.path.join(toolchain_path, '.ready')
|
||||
if os.path.exists(ready_f):
|
||||
with open(ready_f, 'r') as f:
|
||||
toolchain_os = f.read()
|
||||
if platform.system() != toolchain_os:
|
||||
shutil.rmtree(toolchain_path)
|
||||
if not os.path.exists(ready_f):
|
||||
for root, dirs, files in os.walk(toolchain_ppath):
|
||||
if root != toolchain_ppath:
|
||||
break
|
||||
for f in files:
|
||||
if f.startswith(toolchain_prefix) and f.endswith(toolchain_suffix):
|
||||
abs_f = os.path.join(toolchain_ppath, f)
|
||||
print('Extract toolchain ' + toolchain_prefix + ' ...')
|
||||
if not os.path.exists(toolchain_path):
|
||||
os.mkdir(toolchain_path)
|
||||
os.system('tar -xzf ' + abs_f \
|
||||
+ ' --strip-components 1 -C ' + toolchain_path)
|
||||
with open(ready_f, 'w') as f:
|
||||
f.write(platform.system())
|
||||
break
|
||||
|
||||
# 5. compile dynamic module app
|
||||
from tools.ua import BuildApplication
|
||||
from tools.ua import BuildLibrary
|
||||
|
||||
AddOption('--app',
|
||||
dest='app',
|
||||
nargs=1, type='string',
|
||||
action='store',
|
||||
metavar='DIR',
|
||||
help='application to be built')
|
||||
|
||||
AddOption('--lib',
|
||||
dest='lib',
|
||||
nargs=1, type='string',
|
||||
action='store',
|
||||
metavar='DIR',
|
||||
help='library to be built')
|
||||
|
||||
app = GetOption('app')
|
||||
lib = GetOption('lib')
|
||||
|
||||
if app == None and lib == None:
|
||||
print("none application or library, please use ")
|
||||
print(" scons --app=your_app")
|
||||
print(" scons --lib=your_lib")
|
||||
exit(0)
|
||||
else:
|
||||
if app:
|
||||
BuildApplication(app + '/' + app + '.mo', app +'/SConscript', bsp_root, rtt_root, chip_dir, prj_out_dir)
|
||||
|
||||
if lib:
|
||||
BuildLibrary(lib + '/' + lib + '.so', lib +'/SConscript', bsp_root, rtt_root, chip_dir, prj_out_dir)
|
||||
@@ -1,9 +0,0 @@
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c') + Glob('*.cpp')
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
CPPPATH = [cwd]
|
||||
group = DefineGroup('', src, depend = [''], CPPPATH=CPPPATH)
|
||||
|
||||
Return('group')
|
||||
@@ -1,9 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello, world\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
#
|
||||
# File : building.py
|
||||
# This file is part of RT-Thread RTOS
|
||||
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Change Logs:
|
||||
# Date Author Notes
|
||||
# 2015-01-20 Bernard Add copyright information
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import string
|
||||
|
||||
from SCons.Script import *
|
||||
|
||||
BuildOptions = {}
|
||||
Projects = []
|
||||
Env = None
|
||||
|
||||
def GetCurrentDir():
|
||||
conscript = File('SConscript')
|
||||
fn = conscript.rfile()
|
||||
name = fn.name
|
||||
path = os.path.dirname(fn.abspath)
|
||||
return path
|
||||
|
||||
def PrepareHostModuleBuilding(env):
|
||||
global Env
|
||||
Env = env;
|
||||
|
||||
def GetDepend(depend):
|
||||
# always true
|
||||
return True
|
||||
|
||||
def MergeGroup(src_group, group):
|
||||
src_group['src'] = src_group['src'] + group['src']
|
||||
if group.has_key('CCFLAGS'):
|
||||
if src_group.has_key('CCFLAGS'):
|
||||
src_group['CCFLAGS'] = src_group['CCFLAGS'] + group['CCFLAGS']
|
||||
else:
|
||||
src_group['CCFLAGS'] = group['CCFLAGS']
|
||||
if group.has_key('CPPPATH'):
|
||||
if src_group.has_key('CPPPATH'):
|
||||
src_group['CPPPATH'] = src_group['CPPPATH'] + group['CPPPATH']
|
||||
else:
|
||||
src_group['CPPPATH'] = group['CPPPATH']
|
||||
if group.has_key('CPPDEFINES'):
|
||||
if src_group.has_key('CPPDEFINES'):
|
||||
src_group['CPPDEFINES'] = src_group['CPPDEFINES'] + group['CPPDEFINES']
|
||||
else:
|
||||
src_group['CPPDEFINES'] = group['CPPDEFINES']
|
||||
|
||||
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
||||
if group.has_key('LOCAL_CCFLAGS'):
|
||||
if src_group.has_key('LOCAL_CCFLAGS'):
|
||||
src_group['LOCAL_CCFLAGS'] = src_group['LOCAL_CCFLAGS'] + group['LOCAL_CCFLAGS']
|
||||
else:
|
||||
src_group['LOCAL_CCFLAGS'] = group['LOCAL_CCFLAGS']
|
||||
if group.has_key('LOCAL_CPPPATH'):
|
||||
if src_group.has_key('LOCAL_CPPPATH'):
|
||||
src_group['LOCAL_CPPPATH'] = src_group['LOCAL_CPPPATH'] + group['LOCAL_CPPPATH']
|
||||
else:
|
||||
src_group['LOCAL_CPPPATH'] = group['LOCAL_CPPPATH']
|
||||
if group.has_key('LOCAL_CPPDEFINES'):
|
||||
if src_group.has_key('LOCAL_CPPDEFINES'):
|
||||
src_group['LOCAL_CPPDEFINES'] = src_group['LOCAL_CPPDEFINES'] + group['LOCAL_CPPDEFINES']
|
||||
else:
|
||||
src_group['LOCAL_CPPDEFINES'] = group['LOCAL_CPPDEFINES']
|
||||
|
||||
if group.has_key('LINKFLAGS'):
|
||||
if src_group.has_key('LINKFLAGS'):
|
||||
src_group['LINKFLAGS'] = src_group['LINKFLAGS'] + group['LINKFLAGS']
|
||||
else:
|
||||
src_group['LINKFLAGS'] = group['LINKFLAGS']
|
||||
if group.has_key('LIBS'):
|
||||
if src_group.has_key('LIBS'):
|
||||
src_group['LIBS'] = src_group['LIBS'] + group['LIBS']
|
||||
else:
|
||||
src_group['LIBS'] = group['LIBS']
|
||||
if group.has_key('LIBPATH'):
|
||||
if src_group.has_key('LIBPATH'):
|
||||
src_group['LIBPATH'] = src_group['LIBPATH'] + group['LIBPATH']
|
||||
else:
|
||||
src_group['LIBPATH'] = group['LIBPATH']
|
||||
|
||||
def DefineGroup(name, src, depend, **parameters):
|
||||
global Env
|
||||
if not GetDepend(depend):
|
||||
return []
|
||||
|
||||
# find exist group and get path of group
|
||||
group_path = ''
|
||||
for g in Projects:
|
||||
if g['name'] == name:
|
||||
group_path = g['path']
|
||||
if group_path == '':
|
||||
group_path = GetCurrentDir()
|
||||
|
||||
group = parameters
|
||||
group['name'] = name
|
||||
group['path'] = group_path
|
||||
if type(src) == type(['src1']):
|
||||
group['src'] = File(src)
|
||||
else:
|
||||
group['src'] = src
|
||||
|
||||
if group.has_key('CCFLAGS'):
|
||||
Env.Append(CCFLAGS = group['CCFLAGS'])
|
||||
if group.has_key('CPPPATH'):
|
||||
Env.Append(CPPPATH = group['CPPPATH'])
|
||||
if group.has_key('CPPDEFINES'):
|
||||
Env.Append(CPPDEFINES = group['CPPDEFINES'])
|
||||
if group.has_key('LINKFLAGS'):
|
||||
Env.Append(LINKFLAGS = group['LINKFLAGS'])
|
||||
|
||||
if group.has_key('LIBS'):
|
||||
Env.Append(LIBS = group['LIBS'])
|
||||
if group.has_key('LIBPATH'):
|
||||
Env.Append(LIBPATH = group['LIBPATH'])
|
||||
|
||||
if group.has_key('LIBRARY'):
|
||||
objs = Env.Library(name, group['src'])
|
||||
else:
|
||||
objs = group['src']
|
||||
|
||||
# merge group
|
||||
for g in Projects:
|
||||
if g['name'] == name:
|
||||
# merge to this group
|
||||
MergeGroup(g, group)
|
||||
return objs
|
||||
|
||||
# add a new group
|
||||
Projects.append(group)
|
||||
|
||||
return objs
|
||||
@@ -1,11 +0,0 @@
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c') + Glob('*.cpp')
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
CPPPATH = [cwd]
|
||||
CPPDEFINES = ['HOST_BUILD']
|
||||
|
||||
group = DefineGroup('RT-Thread', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef FINSH_H__
|
||||
#define FINSH_H__
|
||||
|
||||
#define MSH_CMD_EXPORT(command, desc)
|
||||
#define MSH_CMD_EXPORT_ALIAS(command, alias, desc)
|
||||
|
||||
#define FINSH_FUNCTION_EXPORT(name, desc)
|
||||
#define FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc)
|
||||
|
||||
#endif
|
||||
@@ -1,41 +0,0 @@
|
||||
#include "rtthread.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
void rt_kprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr,fmt);
|
||||
vprintf(fmt,argptr);
|
||||
va_end(argptr);
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
rt_tick_t rt_tick_get(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *rt_malloc(rt_size_t nbytes)
|
||||
{
|
||||
void* ret = malloc(nbytes);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rt_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int rt_hw_interrupt_disable(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rt_hw_interrupt_enable(int level)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef RTTHREAD_H__
|
||||
#define RTTHREAD_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RT_USING_DFS
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_TICK_PER_SECOND 100
|
||||
#define RT_CONSOLEBUF_SIZE 256
|
||||
|
||||
#define RT_NULL NULL
|
||||
#define RT_ASSERT(EX) \
|
||||
if (!(EX)) \
|
||||
{ \
|
||||
printf(#EX); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
#define rt_vsnprintf vsnprintf
|
||||
|
||||
typedef size_t rt_size_t;
|
||||
typedef uint32_t rt_tick_t;
|
||||
|
||||
void rt_kprintf(const char *fmt, ...);
|
||||
rt_tick_t rt_tick_get(void);
|
||||
|
||||
void *rt_malloc(rt_size_t nbytes);
|
||||
void rt_free(void *ptr);
|
||||
|
||||
int rt_hw_interrupt_disable(void);
|
||||
void rt_hw_interrupt_enable(int level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,2 +0,0 @@
|
||||
EXPORTS
|
||||
main
|
||||
@@ -1,296 +0,0 @@
|
||||
# File : ua.py
|
||||
# Tool Script for building User Applications
|
||||
# This file is part of RT-Thread RTOS
|
||||
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Change Logs:
|
||||
# Date Author Notes
|
||||
# 2015-02-07 Bernard The firstly version
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
from SCons.Script import *
|
||||
|
||||
Rtt_Root = ''
|
||||
BSP_Root = ''
|
||||
Env = None
|
||||
|
||||
# toolchain path
|
||||
if os.environ.has_key("M_EXEC_PATH"):
|
||||
M_EXEC_PATH = os.environ["M_EXEC_PATH"]
|
||||
else:
|
||||
M_EXEC_PATH = rtconfig.M_EXEC_PATH
|
||||
|
||||
def BuildEnv(BSP_ROOT, RTT_ROOT):
|
||||
if BSP_ROOT == None:
|
||||
if os.getenv('BSP_ROOT'):
|
||||
BSP_ROOT = os.getenv('BSP_ROOT')
|
||||
else:
|
||||
print 'Please set BSP(board support package) directory!'
|
||||
exit(-1)
|
||||
|
||||
if not os.path.exists(BSP_ROOT):
|
||||
print 'No BSP(board support package) directory found!'
|
||||
exit(-1)
|
||||
|
||||
if RTT_ROOT == None:
|
||||
# get RTT_ROOT from BSP_ROOT
|
||||
sys.path = sys.path + [BSP_ROOT]
|
||||
try:
|
||||
import rtconfig
|
||||
RTT_ROOT = rtconfig.RTT_ROOT
|
||||
except Exception as e:
|
||||
print 'Import rtconfig.py in BSP(board support package) failed.'
|
||||
print e
|
||||
exit(-1)
|
||||
|
||||
global Rtt_Root
|
||||
global BSP_Root
|
||||
|
||||
Rtt_Root = RTT_ROOT
|
||||
BSP_Root = BSP_ROOT
|
||||
|
||||
def BuildHostApplication(TARGET, SConscriptFile):
|
||||
import platform
|
||||
|
||||
platform_type = platform.system()
|
||||
if platform_type == 'Windows' or platform_type.find('MINGW') != -1:
|
||||
TARGET = TARGET.replace('.mo', '.exe')
|
||||
|
||||
sys.path = sys.path + [os.path.join(os.getcwd(), 'tools', 'host')]
|
||||
|
||||
from building import PrepareHostModuleBuilding
|
||||
|
||||
HostRtt = os.path.join(os.getcwd(), 'tools', 'host', 'rtthread')
|
||||
Env = Environment()
|
||||
|
||||
if not GetOption('verbose'):
|
||||
# override the default verbose command string
|
||||
Env.Replace(
|
||||
ARCOMSTR = 'AR $TARGET',
|
||||
ASCOMSTR = 'AS $TARGET',
|
||||
ASPPCOMSTR = 'AS $TARGET',
|
||||
CCCOMSTR = 'CC $TARGET',
|
||||
CXXCOMSTR = 'CXX $TARGET',
|
||||
LINKCOMSTR = 'LINK $TARGET'
|
||||
)
|
||||
|
||||
PrepareHostModuleBuilding(Env)
|
||||
|
||||
objs = SConscript(SConscriptFile)
|
||||
objs += SConscript(HostRtt + '/SConscript')
|
||||
|
||||
target = Env.Program(TARGET, objs)
|
||||
return
|
||||
|
||||
def BuildHostLibrary(TARGET, SConscriptFile):
|
||||
import platform
|
||||
|
||||
platform_type = platform.system()
|
||||
if platform_type == 'Windows' or platform_type.find('MINGW') != -1:
|
||||
TARGET = TARGET.replace('.mo', '.exe')
|
||||
|
||||
sys.path = sys.path + [os.path.join(os.getcwd(), 'tools', 'host')]
|
||||
|
||||
from building import PrepareHostModuleBuilding
|
||||
|
||||
HostRtt = os.path.join(os.getcwd(), 'tools', 'host', 'rtthread')
|
||||
Env = Environment()
|
||||
|
||||
if not GetOption('verbose'):
|
||||
# override the default verbose command string
|
||||
Env.Replace(
|
||||
ARCOMSTR = 'AR $TARGET',
|
||||
ASCOMSTR = 'AS $TARGET',
|
||||
ASPPCOMSTR = 'AS $TARGET',
|
||||
CCCOMSTR = 'CC $TARGET',
|
||||
CXXCOMSTR = 'CXX $TARGET',
|
||||
LINKCOMSTR = 'LINK $TARGET'
|
||||
)
|
||||
|
||||
PrepareHostModuleBuilding(Env)
|
||||
|
||||
objs = SConscript(SConscriptFile)
|
||||
objs += SConscript(HostRtt + '/SConscript')
|
||||
|
||||
target = Env.Program(TARGET, objs)
|
||||
return
|
||||
|
||||
|
||||
def BuildApplication(TARGET, SConscriptFile, BSP_ROOT = None, RTT_ROOT = None, CHIP_DIR = None, PRJ_OUT_DIR = None):
|
||||
global Env
|
||||
global Rtt_Root
|
||||
global BSP_Root
|
||||
|
||||
# add comstr option
|
||||
AddOption('--verbose',
|
||||
dest='verbose',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='print verbose information during build')
|
||||
|
||||
# build application in host
|
||||
if BSP_ROOT == None and RTT_ROOT == None and not os.getenv('BSP_ROOT'):
|
||||
BuildHostApplication(TARGET, SConscriptFile)
|
||||
return
|
||||
|
||||
if RTT_ROOT == None and os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
|
||||
# handle BSP_ROOT and RTT_ROOT
|
||||
BuildEnv(BSP_ROOT, RTT_ROOT)
|
||||
|
||||
sys.path = sys.path + [os.path.join(Rtt_Root, 'tools'), BSP_Root, CHIP_DIR, PRJ_OUT_DIR]
|
||||
|
||||
# get configuration from BSP
|
||||
import rtconfig
|
||||
from rtua import GetCPPPATH
|
||||
from rtua import GetCPPDEFINES
|
||||
from building import PrepareModuleBuilding
|
||||
|
||||
linkflags = rtconfig.M_LFLAGS + ' -e main'
|
||||
CPPPATH = GetCPPPATH(BSP_Root, Rtt_Root)
|
||||
|
||||
if rtconfig.PLATFORM == 'cl':
|
||||
Env = Environment(TARGET_ARCH='x86')
|
||||
Env.Append(CCFLAGS=rtconfig.M_CFLAGS)
|
||||
Env.Append(LINKFLAGS=rtconfig.M_LFLAGS)
|
||||
Env.Append(CPPPATH=CPPPATH)
|
||||
Env.Append(LIBS='rtthread', LIBPATH=BSP_Root)
|
||||
Env.Append(CPPDEFINES=GetCPPDEFINES() + ['RTT_IN_MODULE'])
|
||||
Env.PrependENVPath('PATH', M_EXEC_PATH)
|
||||
else:
|
||||
Env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.M_AS, ASFLAGS = rtconfig.M_AFLAGS,
|
||||
CC = rtconfig.M_CC, CCFLAGS = rtconfig.M_CFLAGS,
|
||||
CPPDEFINES = GetCPPDEFINES(),
|
||||
CXX = rtconfig.M_CXX, AR = rtconfig.M_AR, ARFLAGS = '-rc',
|
||||
LINK = rtconfig.M_LINK, LINKFLAGS = linkflags,
|
||||
CPPPATH = CPPPATH)
|
||||
Env.PrependENVPath('PATH', M_EXEC_PATH)
|
||||
|
||||
if not GetOption('verbose'):
|
||||
# override the default verbose command string
|
||||
Env.Replace(
|
||||
ARCOMSTR = 'AR $TARGET',
|
||||
ASCOMSTR = 'AS $TARGET',
|
||||
ASPPCOMSTR = 'AS $TARGET',
|
||||
CCCOMSTR = 'CC $TARGET',
|
||||
CXXCOMSTR = 'CXX $TARGET',
|
||||
LINKCOMSTR = 'LINK $TARGET'
|
||||
)
|
||||
|
||||
PrepareModuleBuilding(Env, Rtt_Root, BSP_Root)
|
||||
|
||||
objs = SConscript(SConscriptFile)
|
||||
|
||||
# build program
|
||||
if rtconfig.PLATFORM == 'cl':
|
||||
dll_target = TARGET.replace('.mo', '.dll')
|
||||
target = Env.SharedLibrary(dll_target, objs)
|
||||
|
||||
target = Command("$TARGET", dll_target, [Move(TARGET, dll_target)])
|
||||
# target = dll_target
|
||||
else:
|
||||
target = Env.Program(TARGET, objs)
|
||||
|
||||
if hasattr(rtconfig, 'M_POST_ACTION'):
|
||||
Env.AddPostAction(target, rtconfig.M_POST_ACTION)
|
||||
|
||||
#if hasattr(rtconfig, 'M_BIN_PATH'):
|
||||
# Env.AddPostAction(target, [Copy(rtconfig.M_BIN_PATH, TARGET)])
|
||||
|
||||
def BuildLibrary(TARGET, SConscriptFile, BSP_ROOT = None, RTT_ROOT = None, CHIP_DIR = None, PRJ_OUT_DIR = None):
|
||||
global Env
|
||||
global Rtt_Root
|
||||
global BSP_Root
|
||||
|
||||
# add comstr option
|
||||
AddOption('--verbose',
|
||||
dest='verbose',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='print verbose information during build')
|
||||
|
||||
# build application in host
|
||||
if BSP_ROOT == None and RTT_ROOT == None and not os.getenv('BSP_ROOT'):
|
||||
BuildHostLibrary(TARGET, SConscriptFile)
|
||||
return
|
||||
|
||||
if RTT_ROOT == None and os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
|
||||
# handle BSP_ROOT and RTT_ROOT
|
||||
BuildEnv(BSP_ROOT, RTT_ROOT)
|
||||
|
||||
sys.path = sys.path + [os.path.join(Rtt_Root, 'tools'), BSP_Root, CHIP_DIR, PRJ_OUT_DIR]
|
||||
|
||||
# get configuration from BSP
|
||||
import rtconfig
|
||||
from rtua import GetCPPPATH
|
||||
from rtua import GetCPPDEFINES
|
||||
from building import PrepareModuleBuilding
|
||||
|
||||
linkflags = rtconfig.M_LFLAGS + ' -e 0'
|
||||
CPPPATH = GetCPPPATH(BSP_Root, Rtt_Root)
|
||||
|
||||
if rtconfig.PLATFORM == 'cl':
|
||||
Env = Environment(TARGET_ARCH='x86')
|
||||
Env.Append(CCFLAGS=rtconfig.M_CFLAGS)
|
||||
Env.Append(LINKFLAGS=rtconfig.M_LFLAGS)
|
||||
Env.Append(CPPPATH=CPPPATH)
|
||||
Env.Append(LIBS='rtthread', LIBPATH=BSP_Root)
|
||||
Env.Append(CPPDEFINES=GetCPPDEFINES() + ['RTT_IN_MODULE'])
|
||||
Env.PrependENVPath('PATH', M_EXEC_PATH)
|
||||
else:
|
||||
Env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.M_AS, ASFLAGS = rtconfig.M_AFLAGS,
|
||||
CC = rtconfig.M_CC, CCFLAGS = rtconfig.M_CFLAGS,
|
||||
CPPDEFINES = GetCPPDEFINES(),
|
||||
CXX = rtconfig.M_CXX, AR = rtconfig.M_AR, ARFLAGS = '-rc',
|
||||
LINK = rtconfig.M_LINK, LINKFLAGS = linkflags,
|
||||
CPPPATH = CPPPATH)
|
||||
Env.PrependENVPath('PATH', M_EXEC_PATH)
|
||||
|
||||
if not GetOption('verbose'):
|
||||
# override the default verbose command string
|
||||
Env.Replace(
|
||||
ARCOMSTR = 'AR $TARGET',
|
||||
ASCOMSTR = 'AS $TARGET',
|
||||
ASPPCOMSTR = 'AS $TARGET',
|
||||
CCCOMSTR = 'CC $TARGET',
|
||||
CXXCOMSTR = 'CXX $TARGET',
|
||||
LINKCOMSTR = 'LINK $TARGET'
|
||||
)
|
||||
|
||||
PrepareModuleBuilding(Env, Rtt_Root, BSP_Root)
|
||||
|
||||
objs = SConscript(SConscriptFile)
|
||||
|
||||
# build program
|
||||
if rtconfig.PLATFORM == 'cl':
|
||||
dll_target = TARGET.replace('.so', '.dll')
|
||||
target = Env.SharedLibrary(dll_target, objs)
|
||||
|
||||
target = Command("$TARGET", dll_target, [Move(TARGET, dll_target)])
|
||||
# target = dll_target
|
||||
else:
|
||||
target = Env.Program(TARGET, objs)
|
||||
|
||||
if hasattr(rtconfig, 'M_POST_ACTION'):
|
||||
Env.AddPostAction(target, rtconfig.M_POST_ACTION)
|
||||
20
packages/artinchip/env/Kconfig
vendored
@@ -23,11 +23,6 @@ config AIC_ENV_REDUNDAND_PART_NAME
|
||||
depends on AIC_ENV_INTERFACE
|
||||
default "env_r"
|
||||
|
||||
config AIC_AB_SYSTEM_INTERFACE
|
||||
bool "Enable A/B system support"
|
||||
depends on AIC_ENV_INTERFACE
|
||||
default y
|
||||
|
||||
config AIC_ENV_SIZE
|
||||
int "Environment Size"
|
||||
default 4096
|
||||
@@ -37,4 +32,19 @@ config AIC_ENV_DEBUG
|
||||
bool "Enable ENV debug"
|
||||
default n
|
||||
depends on AIC_ENV_INTERFACE
|
||||
|
||||
if AIC_BOOTLOADER
|
||||
config AIC_AB_SYSTEM_INTERFACE
|
||||
bool "Enable A/B system support in bootloader"
|
||||
depends on AIC_ENV_INTERFACE
|
||||
default y
|
||||
endif
|
||||
|
||||
if LPKG_USING_HTTP_OTA
|
||||
config AIC_AB_SYSTEM_INTERFACE
|
||||
bool "Enable A/B system support"
|
||||
depends on AIC_ENV_INTERFACE
|
||||
default y
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
70
packages/artinchip/env/env.c
vendored
@@ -13,6 +13,7 @@
|
||||
#include <string.h>
|
||||
#include <aic_core.h>
|
||||
#include <env.h>
|
||||
#include <aic_crc32.h>
|
||||
|
||||
#ifndef KERNEL_BAREMETAL
|
||||
|
||||
@@ -139,69 +140,6 @@ static int env_lock_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static const uint32_t crc32_table[256] = {
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F,
|
||||
0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
|
||||
0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
|
||||
0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
|
||||
0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
|
||||
0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106,
|
||||
0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D,
|
||||
0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
|
||||
0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7,
|
||||
0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA,
|
||||
0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
|
||||
0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84,
|
||||
0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
|
||||
0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
|
||||
0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55,
|
||||
0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28,
|
||||
0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F,
|
||||
0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
|
||||
0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69,
|
||||
0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC,
|
||||
0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693,
|
||||
0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
|
||||
static uint32_t crc32_0(const uint8_t *data, uint32_t length)
|
||||
{
|
||||
register uint32_t crc = 0xFFFFFFFF;
|
||||
|
||||
while (length--) {
|
||||
crc = ((crc >> 8) & 0x00FFFFFF) ^
|
||||
crc32_table[(crc ^ *data++) & 0x000000FF];
|
||||
}
|
||||
|
||||
return (crc ^ 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
static uint32_t crc32(uint32_t crc, const uint8_t *buf, uint32_t len)
|
||||
{
|
||||
return crc32_0(buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* s1 is either a simple 'name', or a 'name=value' pair.
|
||||
* s2 is a 'name=value' pair.
|
||||
@@ -344,7 +282,7 @@ int fw_env_flush(void)
|
||||
/*
|
||||
* Update CRC
|
||||
*/
|
||||
*environment.crc = crc32(0, (uint8_t *)environment.data, usable_envsize);
|
||||
*environment.crc = env_crc32(0, (uint8_t *)environment.data, usable_envsize);
|
||||
|
||||
/* write environment back to flash */
|
||||
if (flash_io(O_RDWR)) {
|
||||
@@ -895,7 +833,7 @@ int fw_env_open(void)
|
||||
ret = -EIO;
|
||||
goto open_cleanup;
|
||||
}
|
||||
crc0 = crc32(0, (uint8_t *)environment.data, usable_envsize);
|
||||
crc0 = env_crc32(0, (uint8_t *)environment.data, usable_envsize);
|
||||
|
||||
#ifdef AIC_ENV_DEBUG
|
||||
printf("crc0 = 0x%x,environment.crc = 0x%x\n", (unsigned int)crc0,
|
||||
@@ -936,7 +874,7 @@ int fw_env_open(void)
|
||||
/* uboot default is FLAG_INCREMENTAL */
|
||||
environment.flag_scheme = FLAG_INCREMENTAL,
|
||||
|
||||
crc1 = crc32(0, (uint8_t *)redundant->data, usable_envsize);
|
||||
crc1 = env_crc32(0, (uint8_t *)redundant->data, usable_envsize);
|
||||
#ifdef AIC_ENV_DEBUG
|
||||
printf("crc1 = 0x%x,redundant->crc = 0x%x\n", (unsigned int)crc1,
|
||||
(unsigned int)redundant->crc);
|
||||
|
||||
22
packages/artinchip/lvgl-ui/SConscript
Normal file
@@ -0,0 +1,22 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = Glob('*.c')
|
||||
|
||||
if GetDepend(['AIC_LVGL_DEMO']):
|
||||
src += Glob('./aic_ui.c')
|
||||
src += Glob('./lv_demo.c')
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['LPKG_USING_LVGL'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 686 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
|
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
|
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 497 B |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -282,6 +282,7 @@ void base_ui_init()
|
||||
lv_obj_set_pos(img_point, 192, 200);
|
||||
lv_img_set_pivot(img_point, 12, 108);
|
||||
lv_img_set_angle(img_point, rot_angle * 10);
|
||||
lv_img_set_antialias(img_point, 0);
|
||||
|
||||
ui_speed = lv_label_create(main_tab0);
|
||||
lv_obj_set_width(ui_speed, LV_SIZE_CONTENT);
|
||||
@@ -854,6 +854,8 @@ void base_ui_init()
|
||||
lv_obj_set_pos(img_point, 192, 200);
|
||||
lv_img_set_pivot(img_point, 12, 108);
|
||||
lv_img_set_angle(img_point, rot_angle * 10);
|
||||
lv_img_set_zoom(img_point, 300);
|
||||
lv_img_set_antialias(img_point, 0);
|
||||
|
||||
ui_speed = lv_label_create(main_tab0);
|
||||
lv_obj_set_width(ui_speed, LV_SIZE_CONTENT);
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
19
packages/artinchip/lvgl-ui/aic_demo/gif_demo/SConscript
Normal file
@@ -0,0 +1,19 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = []
|
||||
CPPPATH = [cwd]
|
||||
|
||||
src += Glob('./gif_ui.c')
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_GIF_DEMO'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
37
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "lvgl.h"
|
||||
#include "gif_ui.h"
|
||||
|
||||
static void gif_event(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_READY) {
|
||||
int *end_flag = (int *)lv_event_get_user_data(e);
|
||||
*end_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void gif_ui_init(int *end_flag)
|
||||
{
|
||||
lv_obj_t * img;
|
||||
img = lv_gif_create(lv_scr_act());
|
||||
|
||||
lv_gif_set_src(img, LVGL_PATH(gif/cherub.gif));
|
||||
|
||||
printf("path:%s\n", LVGL_PATH(gif/cherub.gif));
|
||||
// must call after lv_gif_set_src
|
||||
lv_gif_set_loop_count(img, 1);
|
||||
lv_obj_align(img, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
lv_obj_add_event_cb(img, gif_event, LV_EVENT_ALL, end_flag);
|
||||
printf("gif_ini_ok\n");
|
||||
}
|
||||
22
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#ifndef GIF_UI_H
|
||||
#define GIF_UI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "aic_ui.h"
|
||||
|
||||
void gif_ui_init();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif // GIF_UI_H
|
||||
|
After Width: | Height: | Size: 58 KiB |
21
packages/artinchip/lvgl-ui/aic_demo/launcher_demo/SConscript
Normal file
@@ -0,0 +1,21 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = []
|
||||
CPPPATH = [cwd]
|
||||
|
||||
src += Glob('./launcher_ui.c')
|
||||
src += Glob('./launcher_screen.c')
|
||||
src += Glob('./camera_screen.c')
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_LAUNCHER_DEMO'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include "lvgl.h"
|
||||
#include "aic_ui.h"
|
||||
#include "launcher_ui.h"
|
||||
#include "camera_screen.h"
|
||||
|
||||
FAKE_IMAGE_DECLARE(bg_dark);
|
||||
|
||||
static void back_event_cb(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = (lv_event_code_t)lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_CLICKED) {
|
||||
// back to launcher screen
|
||||
lv_scr_load(scr_launcher);
|
||||
}
|
||||
}
|
||||
|
||||
lv_obj_t *camera_screen_init(void)
|
||||
{
|
||||
scr_camera = lv_obj_create(NULL);
|
||||
lv_obj_clear_flag(scr_camera, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
FAKE_IMAGE_INIT(bg_dark, 480, 272, 0, 0x00000000);
|
||||
|
||||
lv_obj_t *img_bg = lv_img_create(scr_camera);
|
||||
lv_img_set_src(img_bg, FAKE_IMAGE_NAME(bg_dark));
|
||||
lv_obj_set_pos(img_bg, 0, 0);
|
||||
|
||||
static lv_style_t style_pr;
|
||||
lv_style_init(&style_pr);
|
||||
lv_style_set_translate_x(&style_pr, 2);
|
||||
lv_style_set_translate_y(&style_pr, 2);
|
||||
|
||||
lv_obj_t *back_btn = lv_imgbtn_create(scr_camera);
|
||||
lv_imgbtn_set_src(back_btn, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Back.png), NULL);
|
||||
lv_imgbtn_set_src(back_btn, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Back.png), NULL);
|
||||
lv_obj_set_pos(back_btn, 10, 10);
|
||||
lv_obj_set_size(back_btn, 32, 32);
|
||||
lv_obj_add_style(back_btn, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_add_event_cb(back_btn, back_event_cb, LV_EVENT_ALL, NULL);
|
||||
|
||||
return scr_camera;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#ifndef CAMERA_SCREEN_H
|
||||
#define CAMERA_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
lv_obj_t *camera_screen_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif //CAMERA_SCREEN_H
|
||||
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include "lvgl.h"
|
||||
#include "aic_ui.h"
|
||||
#include "launcher_screen.h"
|
||||
#include "launcher_ui.h"
|
||||
|
||||
static void launcher_tapview_event(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * tapview = lv_event_get_target(e);
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_VALUE_CHANGED) {
|
||||
int tab_num;
|
||||
|
||||
tab_num = lv_tabview_get_tab_act(tapview);
|
||||
(void)tab_num;
|
||||
//printf("tab_num:%d\n", tab_num);
|
||||
}
|
||||
}
|
||||
|
||||
static void camera_event_cb(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = (lv_event_code_t)lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_CLICKED) {
|
||||
// load camera screen
|
||||
lv_scr_load(scr_camera);
|
||||
}
|
||||
}
|
||||
|
||||
lv_obj_t *launcher_screen_init(void)
|
||||
{
|
||||
scr_launcher = lv_obj_create(NULL);
|
||||
lv_obj_clear_flag(scr_launcher, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
lv_obj_t *img_bg = lv_img_create(scr_launcher);
|
||||
lv_img_set_src(img_bg, LVGL_PATH(bg.jpg));
|
||||
lv_obj_set_pos(img_bg, 0, 0);
|
||||
|
||||
lv_obj_t *tab_sub = lv_tabview_create(scr_launcher, LV_DIR_TOP, 0);
|
||||
lv_obj_set_pos(tab_sub, 0, 0);
|
||||
lv_obj_set_style_bg_opa(tab_sub, LV_OPA_0, 0);
|
||||
|
||||
lv_obj_t *sub_tab0 = lv_tabview_add_tab(tab_sub, "lancher page 0");
|
||||
lv_obj_t *sub_tab1 = lv_tabview_add_tab(tab_sub, "lancher page 1");
|
||||
|
||||
static lv_style_t style_pr;
|
||||
lv_style_init(&style_pr);
|
||||
lv_style_set_translate_x(&style_pr, 2);
|
||||
lv_style_set_translate_y(&style_pr, 2);
|
||||
|
||||
lv_obj_t *sub_image00 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image00, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Camera.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image00, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Camera.png), NULL);
|
||||
lv_obj_set_pos(sub_image00, 30, 25);
|
||||
lv_obj_set_size(sub_image00, 64, 64);
|
||||
lv_obj_add_style(sub_image00, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image00_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image00_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image00_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image00_name, 30 + 2, 25 + 64 + 2);
|
||||
lv_label_set_text(image00_name, "Camera");
|
||||
lv_obj_set_style_text_color(image00_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image00_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image01 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image01, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Activity_Monitor.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image01, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Activity_Monitor.png), NULL);
|
||||
lv_obj_set_pos(sub_image01, 30 + 64 + 44, 25);
|
||||
lv_obj_set_size(sub_image01, 64, 64);
|
||||
lv_obj_add_style(sub_image01, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image01_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image01_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image01_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image01_name, 30 + 3 + 64 + 44, 25 + 64 + 2);
|
||||
lv_label_set_text(image01_name, "Monitor");
|
||||
lv_obj_set_style_text_color(image01_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image01_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image02 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image02, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Downloads.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image02, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Downloads.png), NULL);
|
||||
lv_obj_set_pos(sub_image02, 30 + 64 + 44 + 64 + 44, 25);
|
||||
lv_obj_set_size(sub_image02, 64, 64);
|
||||
lv_obj_add_style(sub_image02, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image02_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image02_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image02_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image02_name, 30 + 64 + 44 + 64 + 44 - 8, 25 + 64 + 2);
|
||||
lv_label_set_text(image02_name, "Downloads");
|
||||
lv_obj_set_style_text_color(image02_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image02_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image03 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image03, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(iChat.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image03, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(iChat.png), NULL);
|
||||
lv_obj_set_pos(sub_image03, 30 + 64 + 44 + 64 + 44 + 64 + 44, 25);
|
||||
lv_obj_set_size(sub_image03, 64, 64);
|
||||
lv_obj_add_style(sub_image03, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image03_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image03_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image03_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image03_name, 30 + 15 + 64 + 44 + 64 + 44 + 64 + 44, 25 + 64 + 2);
|
||||
lv_label_set_text(image03_name, "iChat");
|
||||
lv_obj_set_style_text_color(image03_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image03_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image04 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image04, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Calculator.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image04, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Calculator.png), NULL);
|
||||
lv_obj_set_pos(sub_image04, 30, 40 + 100);
|
||||
lv_obj_set_size(sub_image04, 64, 64);
|
||||
lv_obj_add_style(sub_image04, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image04_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image04_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image04_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image04_name, 30 - 5, 40 + 100 + 64 + 2);
|
||||
lv_label_set_text(image04_name, "Calculator");
|
||||
lv_obj_set_style_text_color(image04_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image04_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image05 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image05, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Mail.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image05, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Mail.png), NULL);
|
||||
lv_obj_set_pos(sub_image05, 30 + 64 + 44, 40 + 100);
|
||||
lv_obj_set_size(sub_image05, 64, 64);
|
||||
lv_obj_add_style(sub_image05, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image05_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image05_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image05_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image05_name, 30 + 13 + 64 + 44, 40 + 100 + 64 + 2);
|
||||
lv_label_set_text(image05_name, "Mail");
|
||||
lv_obj_set_style_text_color(image05_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image05_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image06 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image06, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Maps.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image06, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Maps.png), NULL);
|
||||
lv_obj_set_pos(sub_image06, 30 + 64 + 44 + 64 + 44, 40 + 100);
|
||||
lv_obj_set_size(sub_image06, 64, 64);
|
||||
lv_obj_add_style(sub_image06, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image06_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image06_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image06_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image06_name, 30 + 64 + 44 + 64 + 44 + 10, 40 + 100 + 64 + 2);
|
||||
lv_label_set_text(image06_name, "Maps");
|
||||
lv_obj_set_style_text_color(image06_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image06_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image07 = lv_imgbtn_create(sub_tab0);
|
||||
lv_imgbtn_set_src(sub_image07, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Tools.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image07, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Tools.png), NULL);
|
||||
lv_obj_set_pos(sub_image07, 30 + 64 + 44 + 64 + 44 + 64 + 44, 40 + 100);
|
||||
lv_obj_set_size(sub_image07, 64, 64);
|
||||
lv_obj_add_style(sub_image07, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image07_name = lv_label_create(sub_tab0);
|
||||
lv_obj_set_width(image07_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image07_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image07_name, 30 + 10 + 64 + 44 + 64 + 44 + 64 + 44, 40 + 100 + 64 + 2);
|
||||
lv_label_set_text(image07_name, "Tools");
|
||||
lv_obj_set_style_text_color(image07_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image07_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sub_image10 = lv_imgbtn_create(sub_tab1);
|
||||
lv_imgbtn_set_src(sub_image10, LV_IMGBTN_STATE_RELEASED , NULL, LVGL_PATH(Weather.png), NULL);
|
||||
lv_imgbtn_set_src(sub_image10, LV_IMGBTN_STATE_PRESSED , NULL, LVGL_PATH(Weather.png), NULL);
|
||||
lv_obj_set_pos(sub_image10, 30, 25);
|
||||
lv_obj_set_size(sub_image10, 64, 64);
|
||||
lv_obj_add_style(sub_image10, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
lv_obj_t *image10_name = lv_label_create(sub_tab1);
|
||||
lv_obj_set_width(image10_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_height(image10_name, LV_SIZE_CONTENT);
|
||||
lv_obj_set_pos(image10_name, 30, 25 + 64 + 5);
|
||||
lv_label_set_text(image10_name, "Weather");
|
||||
lv_obj_set_style_text_color(image10_name, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(image10_name, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(tab_sub, launcher_tapview_event, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(sub_image00, camera_event_cb, LV_EVENT_ALL, NULL);
|
||||
|
||||
return scr_launcher;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#ifndef LAUNCHER_SCREEN_H
|
||||
#define LAUNCHER_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
lv_obj_t *launcher_screen_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif //LAUNCHER_SCREEN_H
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include "lvgl.h"
|
||||
#include "launcher_ui.h"
|
||||
#include "launcher_screen.h"
|
||||
#include "camera_screen.h"
|
||||
#include "aic_ui.h"
|
||||
|
||||
lv_obj_t *scr_launcher;
|
||||
lv_obj_t *scr_camera;
|
||||
|
||||
void launcher_ui_init()
|
||||
{
|
||||
scr_launcher = launcher_screen_init();
|
||||
scr_camera = camera_screen_init();
|
||||
|
||||
lv_scr_load(scr_launcher);
|
||||
}
|
||||