加入通道轮询宏定义,当宏为1时代表通道可++,代表四通道,反之为单通道
1. 在chrg_def.h中新增多通道轮询配置宏CHRG_MULTI_CHANNEL,以及对应通道自增宏CHRG_CHANNEL_NEXT 2. 将chrg_roll_sou.c和chrg_roll_nor.c中的原生index++替换为CHRG_CHANNEL_NEXT(index) 3. 实现单/多通道硬件的兼容适配
This commit is contained in:
@@ -12,6 +12,19 @@
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/*
|
||||
* Channel polling mode:
|
||||
* 1 - multi-channel hardware, advance the polling channel index;
|
||||
* 0 - single-channel hardware, keep polling channel 0.
|
||||
*/
|
||||
#define CHRG_MULTI_CHANNEL 1
|
||||
|
||||
#if CHRG_MULTI_CHANNEL
|
||||
#define CHRG_CHANNEL_NEXT(index) do { (index)++; } while (0)
|
||||
#else
|
||||
#define CHRG_CHANNEL_NEXT(index) do { } while (0)
|
||||
#endif
|
||||
|
||||
// 4路选通
|
||||
typedef enum {
|
||||
IDX_CH1 = 0, // 通路1
|
||||
|
||||
Reference in New Issue
Block a user