这篇文章我们开始根据自己的开发板编写测试例程,通过编写例程来更好的学习。
目的:使用开发板上电后周期性打印“hello world”
我们需要创建自己的开发板工程目录,这里大部分时候会参考hqyj开发板的目录,但是我们会从0开始,这样能够更好的了解我们的工程中有哪些是我们自己的,哪些是鸿蒙sdk的。
修改D:\DevEcoProjects\test\src\applications\sample\wifi-iot\app\BUILD.gn文件
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/lite/config/component/lite_component.gni")
lite_component("app") {
features = [
# "startup",
"//vendor/rtplay/rt_hi3861/demo:demo",
]
}
在D:\DevEcoProjects\test\src\vendor创建文件夹rtplay,里面创建rt_hi3861,编写config文件,复制D:\DevEcoProjects\test\src\vendor\hqyj\fs_hi3861\config.json文件为 D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\config.json,并修改里面的开发板信息。
{
"product_name": "rt_hi3861",
"ohos_version": "OpenHarmony 1.0",
"device_company": "rtplay",
"board": "rtplay_hi3861",
"kernel_type": "liteos_m",
"kernel_version": "",
"subsystems": [
{
"subsystem": "applications",
"components": [
{ "component": "wifi_iot_sample_app", "features":[] }
]
},
{
"subsystem": "iot_hardware",
"components": [
{ "component": "iot_controller", "features":[] }
]
},
{
"subsystem": "hiviewdfx",
"components