Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

\[ English | [简体中文](CONTRIBUTING_zh-cn.md) \]

openvela is developed by an active team of software engineers and researchers. You are welcome to join the openvela open source community and make any contribution to improve this project!
openvela is developed by an active team of software engineers and researchers.You are welcome to join openvela, an open source community, and contribute in any way to this project!

openvela mainly follows the Apache License 2.0 license, please refer to the LICENSE file for details.
openvela is mainly subject to Apache License 2.0. See the LICENSE file for details.

## Sign the CLA

In order to participate in community contributions, you need to sign the corresponding Contributor License Agreement (CLA). Here are the specific steps for different platforms:
In order to participate in community contributions, you need to sign a Contributor License Agreement before contributing to the community. Here are the specific steps for different platforms:

- **Gitee platform**:
- Please visit the [Gitee CLA signing page](https://gitee.com/organizations/open-vela/cla/zs6b7c48u6juka2tsnrnkzx6k88np85e) to complete the signing.
Expand All @@ -19,67 +19,70 @@ In order to participate in community contributions, you need to sign the corresp

## Bug reports

If you think you have found a bug in openvela, first make sure you have tested with the latest version of openvela (your problem may already be fixed).
If you think there is an error in openvela, make sure you have tested it with the latest version of openvela (the problem may have been fixed).

If not, search the issue list to see if there is already a similar problem.

## Feature requests
## Feature request

Please submit an issue describing the feature you would like to see added, why you need it, and how you expect it to work.
Please submit an issue describing the feature you would like to add, why you need it, and how it is expected to work.

## Contributing code and documentation changes
## Contributing code and documentation

If you want to add new features or fix some bugs to openvela, please check if there are similar issues. If not, please create a new issue to discuss your ideas with others.
If you want to add new features to openvela or fix some bugs, first check if similar issues already exist. If not, create a new issue and share your views.

### Branch strategy

- **trunk**: The **trunk** branch does not accept pull request
- **dev**: Fork the code from the **dev** branch and push a pull request
### Branching strategy

### Tips for code changes
- **trunk**: **trunk** branches do not accept pull requests
- **dev**: fork code from **dev** branch and push a pull request

- Following these tips prior to raising a pull request will speed up the review cycle.
- Add integration tests, if applicable
### Tips Before Submitting Code

Follow these tips before making a pull request to speed up the review.

- Add appropriate unit tests
- Add integration tests if applicable
- Lines that are not part of your change should not be edited (e.g. don't format unchanged lines, don't reorder existing imports)
- Add the appropriate license headers to any new files

### Submitting your changes

1. Test your changes

Run the test suite to make sure that nothing is broken.

Run the test suite to make sure that nothing is wrong.
2. Sign the Contributor License Agreement

Please make sure you have signed our Contributor License Agreement. We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
Make sure you have signed our Contributor License Agreement (CLA). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask all contributors to sign it in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.

3. **Rebase your changes**

Update your local repository with the most recent code from the main openvela repository, and rebase your branch on top of the latest main branch. We prefer your initial changes to be squashed into a single commit. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review. As a final step before merging we will either ask you to squash all commits yourself or we'll do it for you.
Update your local repository with the latest code from the main openvela repository, and rebase your branch on top of the latest main branch. We prefer your initial changes to be squashed into a single commit. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review. As a final step before merging, we will either ask you to squash all commits yourself or we'll do it for you.

4. Submit a pull request

Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, choose a title which sums up the changes that you have made, and in the body provide more details about what your changes do. Also mention the number of the issue where discussion has taken place, eg "Closes #123".
Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, choose a title which sums up the changes made. In the body text, provide details about the changes. Also mention the number of the issue; for example, “Closing #123".

### How to deal with conflicts
### Resolving Conflicts

Normally, you don't need to rebase your pull request unless there is a merge conflict with the master branch. When GitHub prompts that your pull request "cannot be merged automatically", use the following command to rebase your pull request onto the latest master branch:
When the platform indicates that your pull request "can't automatically merge", use the following command to rebase the pull request on top of the latest main branch:

1. Rebase to the latest master branch
1. Rebase to the latest main branch

```Bash
git remote add upstream https://github.com/open-vela/[repository].git
git fetch upstream
git rebase upstream/dev
```

2. Git may show some conflicts when it cannot merge, such as `conflict.cpp`, you need to manually modify the file to resolve the conflict and mark it as resolved after resolution
2. Git may show conflicts when it can't merge, e.g. “conflict.cpp”. You need to modify the file manually to resolve the conflict, and mark it as resolved afterwards

```Bash
git add conflict.cpp
```

3. You can continue the rebase by the following ways
3. Continue rebasing with:

```Bash
git rebase --continue
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING_zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ openvela 主要遵循 Apache License 2.0 许可证,具体请参看 LICENSE 文

请提交一个 Issue,描述您希望添加的功能、您需要它的原因以及预期的工作方式。

## 贡献代码和文档更改
## 贡献代码和文档

如果您想给 openvela 增加新功能或者修复一些错误,先确认是否已有类似的问题。如果没有,您就新建一个问题,和大家讨论您的想法。
如果您想给 openvela 增加新功能或者修复一些错误,先确认是否已有类似的问题。如果没有,请您新建一个问题,和大家讨论您的想法。

### 分支策略

- **trunk**:**trunk** 分支不接受 pull request
- **dev**:从 **dev** 分支fork代码,并推送pull request
- **trunk**:**trunk** 分支不接受 pull request
- **dev**:从 **dev** 分支fork代码,并推送pull request

### 提交代码更改提示
### 提交代码前提示

在提出拉取请求(pull request之前遵循这些提示将加快审核周期。
在新建 pull request 之前遵循这些提示将加快审核周期。

- 添加适当的单元测试
- 如果适用,添加集成测试
Expand All @@ -65,7 +65,7 @@ openvela 主要遵循 Apache License 2.0 许可证,具体请参看 LICENSE 文

### 冲突的处理方式

通常情况下,除非与主分支存在合并冲突,否则您无需重新定位您的拉取请求。当 GitHub/Gitee 提示您的拉取请求“无法自动合并”,请使用以下命令将您的拉取请求重新定位到最新的主分支之上:
当平台提示您的拉取请求无法合并时,请使用以下命令将您的拉取请求重新定位到最新的主分支之上:

1. 重新定位到最新的主分支

Expand Down
2 changes: 2 additions & 0 deletions Examples/Music_Player_Example.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ This article describes how to run the music player demo on openvela Emulator.
LVX_MUSIC_PLAYER_DATA_ROOT="/data"
```

> Take LVX_USE_DEMO_MUSIC_PLAYER as an example for illustration. The other configurations are modified is the same way.

1. Enter the configuration “LVX_USE_DEMO_MUSIC_PLAYER” to be searched. Fuzzy search is supported; for example, “music_player” will get the corresponding configuration. Press the Enter key to enter that configuration.
![img](images/021.png)

Expand Down
2 changes: 2 additions & 0 deletions Examples/Music_Player_Example_zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
LVX_MUSIC_PLAYER_DATA_ROOT="/data"
```

> 以LVX_USE_DEMO_MUSIC_PLAYER为例进行操作,其余配置方式相同。

1. 输入待搜索的配置 `LVX_USE_DEMO_MUSIC_PLAYER`,支持模糊搜索,例如 `music_player`,找到对应的配置,按回车键进入该配置。
![img](images/021.png)

Expand Down
107 changes: 57 additions & 50 deletions Examples/Smart_Band_Example.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,98 @@
# Bracelet Bandx Demo
# Bandx Demo

\[ English | [简体中文](Smart_Band_Example_zh-cn.md) \]

## Introduction
Bandx is a smart band demo, including watch face, launcher, music, heart rate, stopwatch, sleep, exercise, settings, flashlight, with a resolution of 194*368. You can learn more details about bandx in the `apps/packages/demos/bandx/` directory.

This article describes how to run the example on the openvela Emulator.
Bandx is a smart band demo that incorporates watch dial, launcher, music, heart rate, stopwatch, sleep, sports, settings and flashlight, with a resolution of 194 x 368 pixels.Details about bandx are available in the “apps/packages/demos/bandx/” directory.

This article describes how to run this example on openvela Emulator.

## Prerequisites

1. Build the development environment, see [Environment Build](../Getting_Started/Set_up_the_development_environment_zh-cn.md).
1. Set up the development environment. Refer to [Environment Setup](../Getting_Started/Set_up_the_development_environment.md).

2. Download the source code. Refer to [Download openvela source code](../Getting_Started/Download_Vela_sources.md).

2. Download the source code, please refer to [Download openvela source code](../Getting_Started/Download_Vela_sources_zh-cn.md).
## Step 1: Configure the project

## Step 1 Configure the project
1. Switch to the root directory of openvela repository and execute the following command to configure Bandx.

1. Switch to the root directory of the openvela repository and execute the following command to configure the Bandx wristband.
> The simulator configuration file (defconfig) is in the `vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap/` directory. Use `build.sh` to configure and compile the simulator code.
> The emulator configuration file (defconfig) is in the “vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap/” directory, and the emulator code is configured and compiled using “build.sh”.

```Bash
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap menuconfig
```

- build.sh: compilation script, used to configure and compile openvela code
- vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap: configuration path
- menuconfig: open the menuconfig page and modify the configuration of the project code.
- build.sh: A script for compilation used to configure and compile openvela code.
- vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap: configuration path
- menuconfig: Open the menuconfig page to modify the configuration of the project code.

After execution, the following interface appears:
The following screen appears after execution:

![](images/001.png)

2. Press the `/` key to search and modify the following configuration items one by one:
2. Press the “/” key to search and modify the following configurations:

```Bash
LV_USE_FRAGMENT = y
LVX_USE_DEMO_BANDX = y
BANDX_BASE_PATH = "/data"
```
> Take LV_USE_FRAGMENT as an example, and the rest of the configuration is the same.
```Bash
LV_USE_FRAGMENT = y
LVX_USE_DEMO_BANDX = y
BANDX_BASE_PATH = "/data"
```

> Take LV_USE_FRAGMENT as an example for illustration. The other configurations are modified is the same way.

1. Enter the configuration to be searched.

![](images/002.png)

2. Press `Enter` to enter the configuration page.
2. Press Enter to go to the configuration page.

![](images/003.png)

3. Press the `Enter` key to open the configuration. `*` appears in `[ ]` to indicate that the configuration is opened.
3. Press Enterto open the configuration, and a \* that appears in [ ] indicates that the configuration is opened.

![](images/004.png)

4. Press the `/` key to continue searching for the remaining configurations, and modify the remaining configurations according to the above steps.
4. Press the “/” key to continue searching for the remaining configurations, and modify them as described above.

5. Press the letter `Q` key, and the following exit save interface will pop up.
5. Press the letter Q to bring up the exit Save screen as follows.

![](images/005.png)

6. Press the letter `Y` key to save the configuration and exit the configuration modification page.
6. Press the letter Y to save the configuration and exit the Modify Configuration page.

## Step 2 Compile the project
## Step 2: Compile the project

1. Switch to the root directory of the openvela repository and execute the following commands in the terminal in sequence:
1. Switch to the root directory of openvela repository and execute the following commands one by one in a terminal:

```Bash
# Clean up build artifacts
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap distclean -j$(nproc)

# Start building
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap -j$(nproc)
```
#Start to build
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap -j$(nproc)
```

2. After successful execution, the following files will be obtained:
2. After successful execution, you will get the following files:

```Bash
./nuttx
├── vela_ap.elf
├── vela_ap.bin
```

## Step 3 Start the simulator and push resources
## Step 3: Launch the emulator and push resources

The font and image resources used in Bandx are located in `apps/packages/demos/bandx/resources/`. To push these resources to the corresponding file path mounted by the simulator, you can follow the steps below.
The font and image resources used in Bandx are located in apps/packages/demos/bandx/resources/. To push these resources to the corresponding file paths mounted by the emulator, follow the steps below.

1. Switch to the root directory of the openvela repository and start the emulator:
1. Switch to the root directory of openvela repository and start the emulator:

```bash
./emulator.sh vela
```

2. Use `ADB` supported by the emulator to push resources to the device. Open a new terminal in the root directory of the openvela repository and enter `adb push` followed by the file path to transfer the resources to the corresponding location.
2. Push resources to the device by using emulator-supported ADB. Open a new terminal in the root directory of openvela repository, type “adb push followed by the file path to transfer the resources to the appropriate location.

```bash
# Install adb
Expand All @@ -100,49 +103,53 @@ The font and image resources used in Bandx are located in `apps/packages/demos/b
adb push apps/packages/demos/bandx/resource/image/assets /data/image/
```

> If `BANDX_BASE_PATH` is changed to a non-default value, such as `/tmp`, the resource files must also be transferred to the `/tmp/font/` and `/tmp/image/` directories. Otherwise, an error that the resource cannot be found will occur.
> If BANDX_BASE_PATH is changed to a non-default value like “/tmp, the resource files must also be moved to the /tmp/font/ and /tmp/image/ directories.Otherwise, a “resource not found” error will occur.

## Step 4 Launch Bandx
## Step 4: Start Bandx

1. Enter the following command in the simulator's terminal environment `openvela-ap>`:
1. Enter the following command in the emulator's terminal environment openvela-ap:

```powershell
bandx &
```
```Bash
bandx &
```

![](images/006.png)

2. To access the Launcher interface, swipe `from right to left`. Click different icons to navigate to sub-pages, such as the Heart Rate page shown below. To exit the page, swipe `from left to right`.
2. To access the Launcher screen, swipe quickly from right to left.Single-click different icons to navigate to subpages, such as the Heart Rate page shown below.To exit the page, swipe quickly from left to right.

> Note: The music page is just a UI display, and there is no actual audio access.
> Note: The music page is just a UI display, with no access to audio.

![](images/007.png)

3. Turn on `Auto-show` in settings to automatically play the entire application; turn off `Auto-show` to end the automatic playback.
3. Turn on Auto-show in settings to auto-play the entire application. Turn off Auto-show to end playing it.

## Step 5 Exit Demo
## Step 5: Exit Demo

Close the simulator and exit Demo, as shown below:
Shut down the emulator to exit Demo, as shown below:

![img](images/026.png)

## FAQ
### 1 adb command not found

### 1. adb command not found

#### Reason
The `adb` tool is not installed.

The "adb" tool is not installed.

#### Solution
Install `adb` and execute the following command:

Install “adb” and execute the following command:

``` Bash
sudo apt install android-tools-adb
```

### 2 Fonts are displayed as garbled characters
### 2. Garbled text is shown

#### Reason
Font resources are not loaded correctly.

#### Solution
Please press [Step 3](#step-3-start-the-simulator-and-push-resources) to push resources.

Follow [Step 3](#step-3-launch-the-emulator-and-push-resources) to push resources.
4 changes: 2 additions & 2 deletions Examples/Smart_Band_Example_zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Bandx 中使用的字体和图像资源位于 `apps/packages/demos/bandx/resourc
![img](images/026.png)

## 常见问题
### 1 adb 命令找不到
### 1. adb 命令找不到

#### 原因
未安装 `adb` 工具。
Expand All @@ -140,7 +140,7 @@ Bandx 中使用的字体和图像资源位于 `apps/packages/demos/bandx/resourc
sudo apt install android-tools-adb
```

### 2 字体显示为乱码
### 2. 字体显示为乱码

#### 原因
未正确加载字体资源。
Expand Down
Loading
Loading