7.2.6. 常见问题

7.2.6.1. 编译报错

7.2.6.1.1. 现象

编译时报以下错误

bsp/artinchip/include/hal/hal_cap.h:27: error: "AIC_CAP_CH_NUM" redefined [-Werror]
   27 | #define AIC_CAP_CH_NUM      AIC_CAPS_CH_NUM
      |
bsp/artinchip/include/hal/hal_cap.h:23: note: this is the location of the previous definition
   23 | #define AIC_CAP_CH_NUM      AIC_HRTIMER_CH_NUM
      |

7.2.6.1.2. 原因分析

Capture 和 Hrtimer 共用 PWMCS 中的 CAP 子模块,故会产生冲突,两者不能同时使用。

menuconfig 的功能配置界面应将 HRTimerx 关闭。

Board options  --->
    [ ] Using HRTimer0
    [ ] Using HRTimer1
    [ ] Using HRTimer2
    [ ] Using HRTimer3
    [ ] Using HRTimer4
    [ ] Using HRTimer5
    [*] Using CAP0
    [ ] Using CAP1
    [ ] Using CAP2
    [ ] Using CAP3
    [ ] Using CAP4
    [ ] Using CAP5