修复了使用xua配置的选项,现在通过Makefile控制(issue #2)

- 现在通过 _XUA_CONF_H_EXISTS_ 宏控制
- 编译时在BUILD_FLAGS += -D_XUA_CONF_H_EXISTS_ 以使用xua_conf.h
This commit is contained in:
2023-11-26 00:24:47 +08:00
parent 44bc75ee1a
commit d2dcdc1c40
6 changed files with 13 additions and 5 deletions

View File

@@ -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

View File

@@ -60,7 +60,7 @@
<Port Location="XS1_PORT_1B" Name="PORT_SPDIF_IN"/> <!-- SPDIF_IN -->
<!-- Ctrl Ports :PXUA-316-MC-MAX -->
<Port Location="XS1_PORT_4A" Name="PORT_RGB_DAISY"/> <!-- 4A3: PORT_RGB_DAISY_CHAIN -->
<Port Location="XS1_PORT_4A" Name="PORT_RGB_DAISY_CHAIN"/> <!-- 4A3: PORT_RGB_DAISY_CHAIN -->
<Port Location="XS1_PORT_1K" Name="PORT_UART_TX_PP"/> <!-- 1K: UART_TX -->
<Port Location="XS1_PORT_1F" Name="PORT_UART_RX_PP"/> <!-- 1F: UART_RX -->

View File

@@ -11,5 +11,4 @@
#define RGB_TILE (1)
#endif
#include "rgb_driver.h"
#endif

View File

@@ -1,10 +1,14 @@
#ifndef RGB_DRIVER_H
#define RGB_DRIVER_H
#include <stdint.h>
#include <xs1.h>
//TODO: 在XUA工程环境中测试
// 在Makefile中定义编译选项以使用xua配置项覆盖定义
#ifdef _XUA_CONF_H_EXISTS_
#include "xua_conf.h"
#endif
#ifndef RGB_TILE
#define RGB_TILE (1)
#endif

View File

@@ -1,12 +1,16 @@
#ifndef RGB_EFFECT_H
#define RGB_EFFECT_H
#include <stdint.h>
#include <stddef.h>
#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)