From d2dcdc1c40ac44ceaf70481f02e36f8a5a188fba Mon Sep 17 00:00:00 2001 From: Vergil_Wong Date: Sun, 26 Nov 2023 00:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=BD=BF=E7=94=A8xu?= =?UTF-8?q?a=E9=85=8D=E7=BD=AE=E7=9A=84=E9=80=89=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E9=80=9A=E8=BF=87Makefile=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=EF=BC=88issue=20#2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 现在通过 _XUA_CONF_H_EXISTS_ 宏控制 - 编译时在BUILD_FLAGS += -D_XUA_CONF_H_EXISTS_ 以使用xua_conf.h --- examples/app_test_config_rgb_port/Makefile | 3 ++- .../app_test_config_rgb_port/src/core/PXUA-316-MC-MAX.xn | 2 +- examples/app_test_config_rgb_port/src/core/xua_conf.h | 1 - ...eHSV_with_vol_level_example.c => test_config_rgb_port.c} | 0 lib_rgb/api/rgb_driver.h | 6 +++++- lib_rgb/api/rgb_effect.h | 6 +++++- 6 files changed, 13 insertions(+), 5 deletions(-) rename examples/app_test_config_rgb_port/src/{test_cycleHSV_with_vol_level_example.c => test_config_rgb_port.c} (100%) diff --git a/examples/app_test_config_rgb_port/Makefile b/examples/app_test_config_rgb_port/Makefile index 5fe0145..9ee29aa 100644 --- a/examples/app_test_config_rgb_port/Makefile +++ b/examples/app_test_config_rgb_port/Makefile @@ -8,7 +8,8 @@ TARGET = PXUA-316-MC-MAX.xn # report: 打开编译报告 # g: 生成调试信息 # fxscope: 使用 xSCOPE,对代码进行跟踪(默认使用xlink) -BUILD_FLAGS = -O2 -g -DDEBUG_PRINT_ENABLE=1 -report -fxscope +# _XUA_CONF_H_EXISTS_: 提示编译器,编译部分文件时包含xua_conf.h +BUILD_FLAGS = -O2 -g -report -fxscope -D_XUA_CONF_H_EXISTS_ USED_MODULES = lib_rgb diff --git a/examples/app_test_config_rgb_port/src/core/PXUA-316-MC-MAX.xn b/examples/app_test_config_rgb_port/src/core/PXUA-316-MC-MAX.xn index 036f02c..c7a918a 100644 --- a/examples/app_test_config_rgb_port/src/core/PXUA-316-MC-MAX.xn +++ b/examples/app_test_config_rgb_port/src/core/PXUA-316-MC-MAX.xn @@ -60,7 +60,7 @@ - + diff --git a/examples/app_test_config_rgb_port/src/core/xua_conf.h b/examples/app_test_config_rgb_port/src/core/xua_conf.h index d02bfae..dd936e1 100644 --- a/examples/app_test_config_rgb_port/src/core/xua_conf.h +++ b/examples/app_test_config_rgb_port/src/core/xua_conf.h @@ -11,5 +11,4 @@ #define RGB_TILE (1) #endif -#include "rgb_driver.h" #endif diff --git a/examples/app_test_config_rgb_port/src/test_cycleHSV_with_vol_level_example.c b/examples/app_test_config_rgb_port/src/test_config_rgb_port.c similarity index 100% rename from examples/app_test_config_rgb_port/src/test_cycleHSV_with_vol_level_example.c rename to examples/app_test_config_rgb_port/src/test_config_rgb_port.c diff --git a/lib_rgb/api/rgb_driver.h b/lib_rgb/api/rgb_driver.h index e76da58..68451ed 100644 --- a/lib_rgb/api/rgb_driver.h +++ b/lib_rgb/api/rgb_driver.h @@ -1,10 +1,14 @@ #ifndef RGB_DRIVER_H #define RGB_DRIVER_H - #include #include //TODO: 在XUA工程环境中测试 +// 在Makefile中定义编译选项,以使用xua配置项覆盖定义 +#ifdef _XUA_CONF_H_EXISTS_ + #include "xua_conf.h" +#endif + #ifndef RGB_TILE #define RGB_TILE (1) #endif diff --git a/lib_rgb/api/rgb_effect.h b/lib_rgb/api/rgb_effect.h index 712d5e0..5365503 100644 --- a/lib_rgb/api/rgb_effect.h +++ b/lib_rgb/api/rgb_effect.h @@ -1,12 +1,16 @@ #ifndef RGB_EFFECT_H #define RGB_EFFECT_H - #include #include #include "rgb_driver.h" #include "samples_to_levels.h" #include "misc_utils.h" +// 在Makefile中定义编译选项,以使用xua配置项覆盖定义 +#ifdef _XUA_CONF_H_EXISTS_ + #include "xua_conf.h" +#endif + // RGB灯的数量 #ifndef NUM_RGBS #define NUM_RGBS (12)