Browse Source

fix(lightcontrol): 修复前灯电压控制失效问题,修复后灯电压与使能接口配置错误问题,切换后动控制模式。

CN\zhangkai71 1 năm trước cách đây
mục cha
commit
e885c6ea7e

+ 1 - 1
User project/1.FrameLayer/Source/TimeTask_Event.c

@@ -293,7 +293,7 @@ void Event_10ms(void)
         
         /* Bike light control */
         Can_Light_switch();
-        bikelight_voBikeLightControl(cp_stBikeRunInfoPara.uwLightSwitch, BikeBrake_blGetstate(),(UBYTE)one_byte);
+        bikelight_voBikeLightControl(cp_stBikeRunInfoPara.uwLightSwitch, BikeBrake_blGetstate(),(UBYTE)Three_byte);
 
         /* Trip cal when open */
         bikespeed_votempTripCal();

+ 13 - 0
User project/1.FrameLayer/Source/app.c

@@ -208,6 +208,19 @@ void PeripheralInit()
     iCap_EnableDeviceInterrupt(0);
     iCap_EnableChannelInterrupt(0,CAP_CH(2));
     iCap_EnableChannelInterrupt(0,CAP_CH(3));
+
+#ifdef RUN_ARCH_SIM
+    iCap_BindDeviceInterrupt(2,switchhall_voTim3Int);
+    iCap_BindChannelInterrupt(2,CAP_CH(0),switchhall_voTim3Int);
+    iCap_BindChannelInterrupt(2,CAP_CH(1),switchhall_voTim3Int);
+    iCap_BindChannelInterrupt(2,CAP_CH(2),switchhall_voTim3Int);
+    iCap_EnableDeviceInterrupt(2);
+    iCap_EnableChannelInterrupt(2,CAP_CH(0));
+    iCap_EnableChannelInterrupt(2,CAP_CH(1));
+    iCap_EnableChannelInterrupt(2,CAP_CH(2));
+
+#endif
+
 }
 
 void PeripheralStart()

+ 2 - 1
User project/1.FrameLayer/Source/gd32f30x_it.c

@@ -240,7 +240,8 @@ void TIMER3_IRQHandler(void)
     /* MCU self check count */
     clasB_uwTIM3Cnt++;
     
-    iRtTimer_Isr(HW_TBS_TIMER);   
+    iRtTimer_Isr(HW_TBS_TIMER);  
+
 }
 /*!
     \brief      

+ 5 - 2
User project/2.MotorDrive/Source/spdctrmode.c

@@ -85,8 +85,11 @@ void scm_voSpdCtrMdInit(void)
     dbc_voDBCompInit();
     /* Contant voltage brake init */
     cvb_voBrakeInit();
-    /* switchHall init */
-    //switchhall_voInit();
+#ifdef RUN_ARCH_SIM
+   /* switchHall init */
+    switchhall_voInit();
+#endif
+ 
     /* Align pos startup open2clz clzloop init */
     align_voInit();
     /* Torque observer init */

+ 74 - 74
User project/3.BasicFunction/Source/switchhall.c

@@ -13,18 +13,18 @@
  Beginning of File, do not put anything above here except notes
  Compiler Directives:
 *************************************************************************/
-#ifdef RUN_ARCH_SIM
+ #ifdef RUN_ARCH_SIM
 #include "switchhall.h"
 
-SWITCHHALL_OUT switchhall_stOut = SWITCHHALL_OUT_DEFAULT;
+ SWITCHHALL_OUT switchhall_stOut = SWITCHHALL_OUT_DEFAULT;
 
-void switchhall_voInit(void)
-{}
-void switchhall_voTim3Int(void)
-{}
-void switchhall_voPosCalTbc(void)
-{}
-#else
+ void switchhall_voInit(void)
+ {}
+ void switchhall_voTim3Int(void)
+ {}
+ void switchhall_voPosCalTbc(void)
+ {}
+ #else
 #include "gd32f30x.h"
 #include "typedefine.h"
 #include "syspar.h"
@@ -80,30 +80,30 @@ static void switchhall_voSectorJudge(void)
 {
     /* HALLA(PC8), HALLB(PC7), PHALLC(PC6), wzy */
   
-    if(gpio_input_bit_get(GPIOC,GPIO_PIN_6) != 0)
-    {
-      switchhall_stOut.uwSectorNum = 0;
-    }
-    else
-    {
-      switchhall_stOut.uwSectorNum = 1;
-    }
-    if(gpio_input_bit_get(GPIOC,GPIO_PIN_8) != 0)
-    {
-      switchhall_stOut.uwSectorNum |= 0<<1;
-    }
-    else
-    {
-      switchhall_stOut.uwSectorNum |= 1<<1;
-    }
-    if(gpio_input_bit_get(GPIOC,GPIO_PIN_7) != 0)
-    {
-      switchhall_stOut.uwSectorNum |= 0<<2;
-    }
-    else
-    {
-      switchhall_stOut.uwSectorNum |= 1<<2;
-    }
+//    if(iGpio_Read(HW_GPIO_HALL_A_PIN) != 0)
+//    {
+//      switchhall_stOut.uwSectorNum = 0;
+//    }
+//    else
+//    {
+//      switchhall_stOut.uwSectorNum = 1;
+//    }
+//    if(iGpio_Read(HW_GPIO_HALL_B_PIN) != 0)
+//    {
+//      switchhall_stOut.uwSectorNum |= 0<<1;
+//    }
+//    else
+//    {
+//      switchhall_stOut.uwSectorNum |= 1<<1;
+//    }
+//    if(iGpio_Read(HW_GPIO_HALL_C_PIN) != 0)
+//    {
+//      switchhall_stOut.uwSectorNum |= 0<<2;
+//    }
+//    else
+//    {
+//      switchhall_stOut.uwSectorNum |= 1<<2;
+//    }
     
     
 //    switchhall_stOut.uwSectorNum = GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_6);
@@ -135,49 +135,49 @@ void   switchhall_voTim3Int(void)
     /* Capture Value */    
     if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_UP) == SET)
     {
-        if(curSpeed_state.state == StartUp || curSpeed_state.state == Open2Clz || curSpeed_state.state == ClzLoop)
-        {     
-          if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH0) == SET)
-          {
-              switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH0);
-              timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH0);
-          }
-          else if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH1) == SET)
-          {
-              switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH1);
-              timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH1);
-          }
-          else if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH2) == SET)
-          {
-              switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH2);
-              timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH2);
-          }
-          else
-          {
-              switchhall_stCap.uwState=0;
-          }  
+        // if(curSpeed_state.state == StartUp || curSpeed_state.state == Open2Clz || curSpeed_state.state == ClzLoop)
+        // {     
+        //   if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH0) == SET)
+        //   {
+        //       switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH0);
+        //       timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH0);
+        //   }
+        //   else if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH1) == SET)
+        //   {
+        //       switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH1);
+        //       timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH1);
+        //   }
+        //   else if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH2) == SET)
+        //   {
+        //       switchhall_stCap.uwState = (UWORD)timer_channel_capture_value_register_read(TIMER2, TIMER_INT_FLAG_CH2);
+        //       timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH2);
+        //   }
+        //   else
+        //   {
+        //       switchhall_stCap.uwState=0;
+        //   }  
           
-          if (switchhall_stCap.uwState > timer_counter_read(TIMER2))
-          {
-              switchhall_stCap.ulCapValue = switchhall_stCap.uwState;
-              switchhall_stCap.slCapValueDelta = (SLONG)switchhall_stCap.uwCaptureOverFlowCnt * 60000 + (SLONG)switchhall_stCap.ulCapValue - (SLONG)switchhall_stCap.ulCapValuePre;
-              switchhall_stCap.uwCaptureOverFlowCnt ++;              
-          }
-          else
-          {
-            switchhall_stCap.uwCaptureOverFlowCnt ++;
-          }
+        //   if (switchhall_stCap.uwState > timer_counter_read(TIMER2))
+        //   {
+        //       switchhall_stCap.ulCapValue = switchhall_stCap.uwState;
+        //       switchhall_stCap.slCapValueDelta = (SLONG)switchhall_stCap.uwCaptureOverFlowCnt * 60000 + (SLONG)switchhall_stCap.ulCapValue - (SLONG)switchhall_stCap.ulCapValuePre;
+        //       switchhall_stCap.uwCaptureOverFlowCnt ++;              
+        //   }
+        //   else
+        //   {
+        //     switchhall_stCap.uwCaptureOverFlowCnt ++;
+        //   }
           
-          if (switchhall_stCap.uwCaptureOverFlowCnt > 3000)
-          {
-            switchhall_stCap.uwCaptureOverFlowCnt=0;
-          }
-        }
-        else
-        {
-          switchhall_stCap.uwCaptureOverFlowCnt = 0;
-        }
-        
+        //   if (switchhall_stCap.uwCaptureOverFlowCnt > 3000)
+        //   {
+        //     switchhall_stCap.uwCaptureOverFlowCnt=0;
+        //   }
+        // }
+        // else
+        // {
+        //   switchhall_stCap.uwCaptureOverFlowCnt = 0;
+        // }
+        switchhall_stCap.uwCaptureOverFlowCnt ++;
         timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_UP);
     }
     else if (timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH0)== SET)

+ 3 - 2
User project/4.BasicHardwSoftwLayer/1.BasicHardwLayer/Include/board_config.h

@@ -123,8 +123,8 @@
 /* GPIO*/
 #define HW_GPIO_POWERSTATE_PIN     0  ///> GPIOC  PIN0
 #define HW_GPIO_POWERLOCK_PIN      1  ///> GPIOC  PIN1
-#define HW_GPIO_BLIG_EN_PIN        2  ///> GPIOC  PIN7
-#define HW_GPIO_BLIG_6V_12V_EN_PIN 3  ///> GPIOC  PIN8
+#define HW_GPIO_BLIG_EN_PIN        2  ///> GPIOC  PIN8
+#define HW_GPIO_BLIG_6V_12V_EN_PIN 3  ///> GPIOC  PIN7
 #define HW_GPIO_FLIG_EN_PIN        4  ///> GPIOC  PIN15
 #define HW_GPIO_FLIG_6V_12V_EN_PIN 5  ///> GPIOC  PIN13
 #define HW_GPIO_BREAK_PIN          6  ///> GPIOC  PIN14
@@ -138,4 +138,5 @@
 #define HW_GPIO_CADDIR_PIN         14 ///> GPIOB  PIN2
 #define HW_GPIO_CADENCE_PIN        15 ///> GPIOB  PIN10
 
+
 /* Api Device Index Definations */

+ 2 - 2
User project/4.BasicHardwSoftwLayer/1.BasicHardwLayer/Source/hwsetup.c

@@ -282,9 +282,9 @@ void hw_voInitGPIO(void)
     
 //    gpio_init(GPIOC,GPIO_MODE_OUT_PP,GPIO_OSPEED_50MHZ, GPIO_PIN_10);  // test       
 //    
-//    gpio_init(GPIOC,GPIO_MODE_OUT_PP,GPIO_OSPEED_50MHZ, GPIO_PIN_11);  // test   
-    
     gpio_init(GPIOC,GPIO_MODE_OUT_PP,GPIO_OSPEED_50MHZ, GPIO_PIN_12);  /* I2C0 Write Protect*/   
+    
+    gpio_init(GPIOC,GPIO_MODE_OUT_PP,GPIO_OSPEED_50MHZ, GPIO_PIN_13); /* F_6V_12V_Enable */
 
     gpio_init(GPIOC,GPIO_MODE_IPD,GPIO_OSPEED_50MHZ,GPIO_PIN_14); /* Bike Brake */
 

+ 1 - 1
User project/4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/user.h

@@ -48,7 +48,7 @@ Update Time
 #define MOTOR_WELLING_MTB_48V     0x31
 
 /* !!!强调:syspar.h中也需要选择36V/48V系统 */
-#define MOTOR_ID_SEL              MOTOR_WELLING_CITY_36V  
+#define MOTOR_ID_SEL              MOTOR_WELLING_MTB_36V  
 /*======================================================================*
     Motor Parameters
 *=======================================================================*/

+ 2 - 2
User project/5.Api_rt/api_rt_gpio.c

@@ -4,8 +4,8 @@
 Gpio_Handle const Gpios[GPIO_PIN_COUNT] = {
     [0] = {.GpioBase = GPIOC, .Index = 0},
     [1] = {.GpioBase = GPIOC, .Index = 1},
-    [2] = {.GpioBase = GPIOC, .Index = 7},
-    [3] = {.GpioBase = GPIOC, .Index = 8},
+    [2] = {.GpioBase = GPIOC, .Index = 8},
+    [3] = {.GpioBase = GPIOC, .Index = 7},
     [4] = {.GpioBase = GPIOC, .Index = 15},
     [5] = {.GpioBase = GPIOC, .Index = 13},
     [6] = {.GpioBase = GPIOC, .Index = 14},

BIN
tests/sim/FanPlatformAuto.slx


+ 17 - 3
tests/sim/sim_board/api_rt/api_rt_cap.c

@@ -3,7 +3,7 @@
 #include "api_rt_dbg.h"
 #include "board.h"
 
-ApiRtCap_Handle Caps[2];
+ApiRtCap_Handle Caps[3];
 
 void iRtCap_Init()
 {
@@ -13,6 +13,8 @@ void iRtCap_Init()
     Caps[1].CapBase                 = &bikeSpdCap;
     Caps[1].CapBase->Base.Prescaler = 100;
 
+    Caps[2].CapBase                 = &switchhalCap;
+
 }
       
 
@@ -93,8 +95,16 @@ void iCap_DisableDeviceInterrupt(uint8_t devIndex)
 }
 
 void iCap_BindDeviceInterrupt(uint8_t devIndex, void (*action)())
-{
-    scheduler.InterruptBind(&scheduler, &Caps[devIndex].CapBase->Base, CaptureInterruptCounter, action);
+{   
+    if(devIndex == 0)
+    {
+        scheduler.InterruptBind(&scheduler, &Caps[devIndex].CapBase->Base, CaptureInterruptCounter, action);
+    }
+    else 
+    {
+        scheduler.InterruptBind(&scheduler, &Caps[2].CapBase->Base, CaptureInterruptCounter, action);
+    }
+   
 }
 
 void iCap_EnableChannelInterrupt(uint8_t devIndex, uint8_t channelIndex)
@@ -114,6 +124,10 @@ void iCap_BindChannelInterrupt(uint8_t devIndex, uint8_t channelIndex, void (*ac
     {
         scheduler.InterruptBind(&scheduler, &Caps[1].CapBase->Base, CaptureInterruptOut1 + channelIndex, action);
     }
+    else if(devIndex == 2) 
+    {
+        scheduler.InterruptBind(&scheduler, &Caps[2].CapBase->Base, CaptureInterruptOut1 + channelIndex, action);
+    }
     else 
     {
         scheduler.InterruptBind(&scheduler, &Caps[devIndex].CapBase->Base, CaptureInterruptOut1 + channelIndex, action);

+ 3 - 3
tests/sim/sim_board/api_rt/api_rt_gpio.c

@@ -10,9 +10,9 @@ void iRtGpioLow_Init()
 {
     Gpios[0].GpioBase = &ledPin;
     Gpios[1].GpioBase = &capPin;
-    Gpios[2].GpioBase = &ledPin;
-    Gpios[3].GpioBase = &ledPin;
-    Gpios[4].GpioBase = &ledPin;
+    Gpios[2].GpioBase = &switchHallA;
+    Gpios[3].GpioBase = &switchHallB;
+    Gpios[4].GpioBase = &switchHallC;
     Gpios[5].GpioBase = &ledPin;
     Gpios[6].GpioBase = &bikeBrakePin;
     Gpios[7].GpioBase = &ledPin;

+ 1 - 1
tests/sim/sim_board/api_rt/api_rt_gpio.h

@@ -9,7 +9,7 @@
 extern "C" {
 #endif // __cplusplus
 
-#define GPIO_PIN_COUNT 16
+#define GPIO_PIN_COUNT 19
 
 typedef struct
 {

+ 3 - 3
tests/sim/sim_board/api_rt/api_rt_pwm.c

@@ -175,7 +175,7 @@ ApiPwm_CompareMode iPwm_GetCompareMode(uint8_t devIndex, uint8_t channelIndex)
     struct Sim_Pwm *base = Pwms[devIndex].PwmBase;
 
     ApiPwm_CompareMode mode = ApiPwm_NoAction;
-    switch (base->PwmMode)
+    switch (base->PwmMode[channelIndex])
     {
     case SIM_PWM_PWMMODE1:
         mode = ApiPwm_HigherClear;
@@ -197,10 +197,10 @@ void iPwm_SetCompareMode(uint8_t devIndex, uint8_t channelIndex, ApiPwm_CompareM
     switch (mode)
     {
     case ApiPwm_HigherSet:
-        base->PwmMode = SIM_PWM_PWMMODE2;
+        base->PwmMode[channelIndex] = SIM_PWM_PWMMODE2;
         break;
     case ApiPwm_HigherClear:
-        base->PwmMode = SIM_PWM_PWMMODE1;
+        base->PwmMode[channelIndex] = SIM_PWM_PWMMODE1;
         break;
     default:
         break;

+ 5 - 1
tests/sim/sim_board/include/mcu_instance.h

@@ -8,6 +8,9 @@ extern struct Sim_Adc       adc2;
 extern struct Sim_Adc       adc3;
 extern struct Sim_Gpio      ledPin;
 extern struct Sim_Gpio      capPin;
+extern struct Sim_Gpio      switchHallA;
+extern struct Sim_Gpio      switchHallB;
+extern struct Sim_Gpio      switchHallC;
 extern struct Sim_Gpio      breakPin;
 extern struct Sim_Gpio      bikeBrakePin;
 extern struct Sim_Timer     sysTick;
@@ -18,4 +21,5 @@ extern struct Sim_Timer     sampleTrigTimer;
 extern struct Sim_Timer     sampleTrigTimer2;
 extern struct Sim_DMA       pwmLoadDma;
 extern struct Sim_Capture   cadenceCap;
-extern struct Sim_Capture   bikeSpdCap;
+extern struct Sim_Capture   bikeSpdCap;
+extern struct Sim_Capture   switchhalCap;

+ 25 - 1
tests/sim/sim_board/source/board.c

@@ -35,6 +35,9 @@ void BoardInit(double ts)
     Sim_AdcInit(&adc3);
     Sim_GpioInit(&ledPin);
     Sim_GpioInit(&capPin);
+    Sim_GpioInit(&switchHallA);
+    Sim_GpioInit(&switchHallB);
+    Sim_GpioInit(&switchHallC);
     Sim_GpioInit(&breakPin);
     Sim_GpioInit(&bikeBrakePin);
     Sim_TimerInit(&sysTick);
@@ -46,6 +49,8 @@ void BoardInit(double ts)
     Sim_DMAInit(&pwmLoadDma);
     Sim_CaptureInit(&cadenceCap);
     Sim_CaptureInit(&bikeSpdCap);
+    Sim_CaptureInit(&switchhalCap);
+
     /* 调度器外设注册 */
     scheduler.Register(&scheduler, &pwm.Base);
     scheduler.Register(&scheduler, &adc.Base);
@@ -53,6 +58,9 @@ void BoardInit(double ts)
     scheduler.Register(&scheduler, &adc3.Base);
     scheduler.Register(&scheduler, &ledPin.Base);
     scheduler.Register(&scheduler, &capPin.Base);
+    scheduler.Register(&scheduler, &switchHallA.Base);
+    scheduler.Register(&scheduler, &switchHallB.Base);
+    scheduler.Register(&scheduler, &switchHallC.Base);
     scheduler.Register(&scheduler, &breakPin.Base);
     scheduler.Register(&scheduler, &bikeBrakePin.Base);
     scheduler.Register(&scheduler, &sysTick.Base);
@@ -64,9 +72,12 @@ void BoardInit(double ts)
     scheduler.Register(&scheduler, &pwmLoadDma.Base);
     scheduler.Register(&scheduler, &cadenceCap.Base);
     scheduler.Register(&scheduler, &bikeSpdCap.Base);
+    scheduler.Register(&scheduler, &switchhalCap.Base);
     /* Pwm配置 */
     pwm.CntMode             = SIM_PWM_UP_DOWN;
-    pwm.PwmMode             = SIM_PWM_PWMMODE2;
+    pwm.PwmMode[0]          = SIM_PWM_PWMMODE2;
+    pwm.PwmMode[1]          = SIM_PWM_PWMMODE2;
+    pwm.PwmMode[2]          = SIM_PWM_PWMMODE2;
     pwm.OCPolarity[0]       = SIM_PWM_POLARITY_HIGH;
     pwm.OCPolarity[1]       = SIM_PWM_POLARITY_HIGH;
     pwm.OCPolarity[2]       = SIM_PWM_POLARITY_HIGH;
@@ -166,6 +177,19 @@ void BoardInit(double ts)
     bikeSpdCap.Channel[3].Edge            = CaptureRisingEdge;
     bikeSpdCap.Channel[3].Enable          = 1;
     bikeSpdCap.Channel[3].InterruptEnable = 1;
+
+    switchhalCap.CountMax                   = TICK_TRANS(HW_TIM_CLOCK_HZ / HW_INIT_FTBS_HZ - 1);
+    switchhalCap.CounterInterruptEnable     = 1;
+    switchhalCap.Channel[0].Edge            = CaptureRisingFallingEdge;
+    switchhalCap.Channel[0].Enable          = 1;
+    switchhalCap.Channel[0].InterruptEnable = 1;
+    switchhalCap.Channel[1].Edge            = CaptureRisingFallingEdge;
+    switchhalCap.Channel[1].Enable          = 1;
+    switchhalCap.Channel[1].InterruptEnable = 1;
+    switchhalCap.Channel[2].Edge            = CaptureRisingFallingEdge;
+    switchhalCap.Channel[2].Enable          = 1;
+    switchhalCap.Channel[2].InterruptEnable = 1;
+
     //scheduler.InterruptBind(&scheduler, &bikeSpdCap.Base, CaptureInterruptOut1, CaptureIsr);
 
     scheduler.AppTimeSlice.Add(&scheduler.AppTimeSlice, 1, 1, 0, BackgroundTask);

+ 5 - 1
tests/sim/sim_board/source/mcu_instance.c

@@ -7,6 +7,9 @@ struct Sim_Adc       adc2;
 struct Sim_Adc       adc3;
 struct Sim_Gpio      ledPin;
 struct Sim_Gpio      capPin;
+struct Sim_Gpio      switchHallA;
+struct Sim_Gpio      switchHallB;
+struct Sim_Gpio      switchHallC;
 struct Sim_Gpio      breakPin;
 struct Sim_Gpio      bikeBrakePin;
 struct Sim_Timer     sysTick;
@@ -17,4 +20,5 @@ struct Sim_Timer     sampleTrigTimer;
 struct Sim_Timer     sampleTrigTimer2;
 struct Sim_DMA       pwmLoadDma;
 struct Sim_Capture   cadenceCap;
-struct Sim_Capture   bikeSpdCap;
+struct Sim_Capture   bikeSpdCap;
+extern struct Sim_Capture   switchhalCap;

+ 1 - 1
tests/unit_test/board_sim/api_rt/api_rt_cap.h

@@ -17,7 +17,7 @@ typedef struct
     ApiRt_Interrupt ChannelISR[4];
 } ApiRtCap_Handle;
 
-extern ApiRtCap_Handle Caps[1];
+extern ApiRtCap_Handle Caps[3];
 
 void iRtCap_Init(void);
 void iRtCap_Isr(uint8_t devIndex);