forked from PAWPAW/lib_rgb
修复了使用xua配置的选项,现在通过Makefile控制(issue #2)
- 现在通过 _XUA_CONF_H_EXISTS_ 宏控制 - 编译时在BUILD_FLAGS += -D_XUA_CONF_H_EXISTS_ 以使用xua_conf.h
This commit is contained in:
@@ -8,7 +8,8 @@ TARGET = PXUA-316-MC-MAX.xn
|
|||||||
# report: 打开编译报告
|
# report: 打开编译报告
|
||||||
# g: 生成调试信息
|
# g: 生成调试信息
|
||||||
# fxscope: 使用 xSCOPE,对代码进行跟踪(默认使用xlink)
|
# 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
|
USED_MODULES = lib_rgb
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
<Port Location="XS1_PORT_1B" Name="PORT_SPDIF_IN"/> <!-- SPDIF_IN -->
|
<Port Location="XS1_PORT_1B" Name="PORT_SPDIF_IN"/> <!-- SPDIF_IN -->
|
||||||
|
|
||||||
<!-- Ctrl Ports :PXUA-316-MC-MAX -->
|
<!-- 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_1K" Name="PORT_UART_TX_PP"/> <!-- 1K: UART_TX -->
|
||||||
<Port Location="XS1_PORT_1F" Name="PORT_UART_RX_PP"/> <!-- 1F: UART_RX -->
|
<Port Location="XS1_PORT_1F" Name="PORT_UART_RX_PP"/> <!-- 1F: UART_RX -->
|
||||||
|
|||||||
@@ -11,5 +11,4 @@
|
|||||||
#define RGB_TILE (1)
|
#define RGB_TILE (1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "rgb_driver.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
#ifndef RGB_DRIVER_H
|
#ifndef RGB_DRIVER_H
|
||||||
#define RGB_DRIVER_H
|
#define RGB_DRIVER_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <xs1.h>
|
#include <xs1.h>
|
||||||
//TODO: 在XUA工程环境中测试
|
//TODO: 在XUA工程环境中测试
|
||||||
|
|
||||||
|
// 在Makefile中定义编译选项,以使用xua配置项覆盖定义
|
||||||
|
#ifdef _XUA_CONF_H_EXISTS_
|
||||||
|
#include "xua_conf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef RGB_TILE
|
#ifndef RGB_TILE
|
||||||
#define RGB_TILE (1)
|
#define RGB_TILE (1)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
#ifndef RGB_EFFECT_H
|
#ifndef RGB_EFFECT_H
|
||||||
#define RGB_EFFECT_H
|
#define RGB_EFFECT_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "rgb_driver.h"
|
#include "rgb_driver.h"
|
||||||
#include "samples_to_levels.h"
|
#include "samples_to_levels.h"
|
||||||
#include "misc_utils.h"
|
#include "misc_utils.h"
|
||||||
|
|
||||||
|
// 在Makefile中定义编译选项,以使用xua配置项覆盖定义
|
||||||
|
#ifdef _XUA_CONF_H_EXISTS_
|
||||||
|
#include "xua_conf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// RGB灯的数量
|
// RGB灯的数量
|
||||||
#ifndef NUM_RGBS
|
#ifndef NUM_RGBS
|
||||||
#define NUM_RGBS (12)
|
#define NUM_RGBS (12)
|
||||||
|
|||||||
Reference in New Issue
Block a user