尝试烧录官方例程在开发板上, 下面开发板上实现写自己的程序。
在./applications/sample/wifi-iot/app目录下新建一个文件夹
- #include <stdio.h>
- #include "ohos_init.h"
- #include "ohos_types.h"
- void FirstAPP(void)
- {
- printf("Hello!n");
- }
- SYS_RUN(FirstAPP);
复制代码在my_first_app下新建BUILD.gn文件写入
- static_library("myapp"){
- sources = [
- "FirstAPP.c"
- include_dirs = [
- "//utils/native/lite/include"
- }
复制代码在./applications/sample/wifi-iot/app/BUILD.gn文件里面修改成如下代码
import("//build/lite/config/component/lite_component.gni")
- lite_component("app"){
- features = [
- "catkin_ws:myapp",
- }
复制代码编译烧录之后就可以看到串口输出Hello