forked from PAWPAW/lib_rgb
添加了用例
This commit is contained in:
21
examples/app_hsv_cycle_example/Makefile
Normal file
21
examples/app_hsv_cycle_example/Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# `TARGET` 变量决定了应用程序编译的目标系统。它可以引用源目录中的一个 XN 文件,或者是在编译时作为 `--target` 选项的一个有效参数。
|
||||||
|
|
||||||
|
TARGET = XCORE-AI-EXPLORER
|
||||||
|
|
||||||
|
# 编译选项
|
||||||
|
# 构建应用程序时传递给 xcc 的参数
|
||||||
|
# O2: xcc编译器优化等级2
|
||||||
|
# report: 打开编译报告
|
||||||
|
# g: 生成调试信息
|
||||||
|
# fxscope: 使用 xSCOPE,对代码进行跟踪(默认使用xlink)
|
||||||
|
BUILD_FLAGS = -O2 -g -DDEBUG_PRINT_ENABLE=1 -report -fxscope
|
||||||
|
|
||||||
|
USED_MODULES = lib_rgb
|
||||||
|
|
||||||
|
XCC_FLAGS = $(BUILD_FLAGS)
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# 下面部分的 Makefile 包含了用于编译 XMOS 应用程序的公共构建基础设施。你无需编辑此处以下的内容。
|
||||||
|
|
||||||
|
XMOS_MAKE_PATH ?= ../..
|
||||||
|
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
|
||||||
BIN
examples/app_hsv_cycle_example/bin/app_hsv_cycle_example.xe
Normal file
BIN
examples/app_hsv_cycle_example/bin/app_hsv_cycle_example.xe
Normal file
Binary file not shown.
23
examples/app_hsv_cycle_example/src/main.xc
Normal file
23
examples/app_hsv_cycle_example/src/main.xc
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/** @brief RGB循环呼吸
|
||||||
|
* @author Vergil Wong
|
||||||
|
* @date 2023-11-11
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
#include <stdio.h> // 包含基本的输入输出函数
|
||||||
|
#include <platform.h> // 包含对封装的定义,引用以使用 on tile[] 语法
|
||||||
|
#include "rgb_effect.h"
|
||||||
|
|
||||||
|
int main() // 定义主函数
|
||||||
|
{
|
||||||
|
par
|
||||||
|
{
|
||||||
|
on tile[1]:
|
||||||
|
{
|
||||||
|
cycleRGB_driver();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0; // 返回0,表示程序正常结束
|
||||||
|
}
|
||||||
21
examples/app_rgb_cycle_breathing_example/Makefile
Normal file
21
examples/app_rgb_cycle_breathing_example/Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# `TARGET` 变量决定了应用程序编译的目标系统。它可以引用源目录中的一个 XN 文件,或者是在编译时作为 `--target` 选项的一个有效参数。
|
||||||
|
|
||||||
|
TARGET = XCORE-AI-EXPLORER
|
||||||
|
|
||||||
|
# 编译选项
|
||||||
|
# 构建应用程序时传递给 xcc 的参数
|
||||||
|
# O2: xcc编译器优化等级2
|
||||||
|
# report: 打开编译报告
|
||||||
|
# g: 生成调试信息
|
||||||
|
# fxscope: 使用 xSCOPE,对代码进行跟踪(默认使用xlink)
|
||||||
|
BUILD_FLAGS = -O2 -g -DDEBUG_PRINT_ENABLE=1 -report -fxscope
|
||||||
|
|
||||||
|
USED_MODULES = lib_rgb
|
||||||
|
|
||||||
|
XCC_FLAGS = $(BUILD_FLAGS)
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# 下面部分的 Makefile 包含了用于编译 XMOS 应用程序的公共构建基础设施。你无需编辑此处以下的内容。
|
||||||
|
|
||||||
|
XMOS_MAKE_PATH ?= ../..
|
||||||
|
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
|
||||||
Binary file not shown.
23
examples/app_rgb_cycle_breathing_example/src/main.xc
Normal file
23
examples/app_rgb_cycle_breathing_example/src/main.xc
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/** @brief 循环输出整个HSV色域
|
||||||
|
* @author Vergil Wong
|
||||||
|
* @date 2023-11-11
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
#include <stdio.h> // 包含基本的输入输出函数
|
||||||
|
#include <platform.h> // 包含对封装的定义,引用以使用 on tile[] 语法
|
||||||
|
#include "rgb_effect.h"
|
||||||
|
|
||||||
|
int main() // 定义主函数
|
||||||
|
{
|
||||||
|
par
|
||||||
|
{
|
||||||
|
on tile[1]:
|
||||||
|
{
|
||||||
|
cycleHSV_driver();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0; // 返回0,表示程序正常结束
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user