Browse Source

小牙盘运行OK,Debug地址已改,霍尔零位已改,屏蔽车速传感器故障检测。

Deyauo 6 months ago
parent
commit
4023b237ab

File diff suppressed because it is too large
+ 0 - 32
.launches/empty_LP_MSPM0G3507.launch


File diff suppressed because it is too large
+ 18 - 9
.launches/empty_LP_MSPM0G3507_APP_Normal_20250107.launch


File diff suppressed because it is too large
+ 0 - 32
.launches/empty_LP_MSPM0G3507_nortos_ticlang.launch


+ 0 - 3
.settings/org.eclipse.cdt.codan.core.prefs

@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-inEditor=false
-onBuild=false

+ 0 - 2
.settings/org.eclipse.cdt.debug.core.prefs

@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker

+ 0 - 31
.settings/org.eclipse.core.resources.prefs

@@ -1,34 +1,4 @@
 eclipse.preferences.version=1
-encoding//1.FrameLayer/Source/TimeTask_Event.c=UTF-8
-encoding//1.FrameLayer/Source/app.c=UTF-8
-encoding//1.FrameLayer/Source/main.c=UTF-8
-encoding//1.FrameLayer/Source/tbc.c=UTF-8
-encoding//2.MotorDrive/Include/uart_monitor.h=UTF-8
-encoding//2.MotorDrive/Source/adc.c=UTF-8
-encoding//2.MotorDrive/Source/alarm.c=UTF-8
-encoding//2.MotorDrive/Source/spdctrmode.c=UTF-8
-encoding//3.BasicFunction/Include/AssistCurve.h=UTF-8
-encoding//3.BasicFunction/Include/Cadence.h=UTF-8
-encoding//3.BasicFunction/Include/MosResCalib.h=UTF-8
-encoding//3.BasicFunction/Include/Temp.h=UTF-8
-encoding//3.BasicFunction/Include/bikelight.h=UTF-8
-encoding//3.BasicFunction/Include/canAppl.h=UTF-8
-encoding//3.BasicFunction/Include/i2c_master.h=UTF-8
-encoding//3.BasicFunction/Include/uart_Lidian2.h=UTF-8
-encoding//3.BasicFunction/Include/uart_gainianzhihui.h=UTF-8
-encoding//3.BasicFunction/Include/usart.h=UTF-8
-encoding//3.BasicFunction/Source/MosResCalib.c=UTF-8
-encoding//3.BasicFunction/Source/bikelight.c=UTF-8
-encoding//3.BasicFunction/Source/bikethrottle.c=UTF-8
-encoding//3.BasicFunction/Source/canAppl.c=UTF-8
-encoding//3.BasicFunction/Source/flash_master.c=UTF-8
-encoding//3.BasicFunction/Source/switchhall.c=UTF-8
-encoding//3.BasicFunction/Source/uart_Lidian2.c=UTF-8
-encoding//3.BasicFunction/Source/uart_gainianzhihui.c=UTF-8
-encoding//3.BasicFunction/Source/usart.c=UTF-8
-encoding//4.BasicHardwSoftwLayer/1.BasicHardwLayer/Include/UserGpio_Config.h=UTF-8
-encoding//4.BasicHardwSoftwLayer/1.BasicHardwLayer/Source/hwsetup.c=UTF-8
-encoding//4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/syspar.h=UTF-8
 encoding//Debug/1.FrameLayer/Source/subdir_rules.mk=UTF-8
 encoding//Debug/1.FrameLayer/Source/subdir_vars.mk=UTF-8
 encoding//Debug/2.MotorDrive/Lib/subdir_rules.mk=UTF-8
@@ -48,4 +18,3 @@ encoding//Debug/objects.mk=UTF-8
 encoding//Debug/sources.mk=UTF-8
 encoding//Debug/subdir_rules.mk=UTF-8
 encoding//Debug/subdir_vars.mk=UTF-8
-encoding/<project>=UTF-8

+ 5 - 1
1.FrameLayer/Source/FSM_1st.c

@@ -148,7 +148,11 @@ void SysInit_hook(void)
     if (adc_stDownOut.blADCCalibFlg && adc_stUpOut.blADCCalibFlg && sysfsm_stFlg.CommuRdy_Flag)
     {
         /* BikeLightInit */
-        bikelight_voBikeLightInit();
+        bikelight_voBikeLightInit(&BikeLedCheck_F);
+        bikelight_voBikeLightInit(&BikeLedCheck_B);
+        bikelight_voBikeLightInit(&BikeLedCheck_L);
+        bikelight_voBikeLightInit(&BikeLedCheck_R);
+        bikelight_voBikeLightInit(&BikeLedCheck_DC);
         /* BikeThrottleInit */
         bikethrottle_voBikeThrottleInit();
         /* TorqueSensorInit */

+ 3 - 3
1.FrameLayer/Source/TimeTask_Event.c

@@ -106,10 +106,10 @@ void  Event_1ms(void)
 
     /* 限制母线电流 */
     AssCurLimAccordIdc(adc_stUpOut.uwIbusAvgLpfPu);
-#if 0//(BIKE_OXFORD_EN==0)
+#if(BIKE_OXFORD_EN==0)
     if(power_stPowStateOut.powerstate != POWER_ON_END)
     {
-        cp_stBikeRunInfoPara.uwBikeGear = 0;
+       cp_stBikeRunInfoPara.uwBikeGear = 0;
     }
 #endif
 
@@ -372,7 +372,7 @@ void  Event_200ms(void)
         alm_stBikeIn.uwThrottleReg = adc_stUpOut.uwThrottleReg;
         alm_stBikeIn.blThrottleExistFlg = TRUE;
         alm_stBikeIn.blMotorNTCExistFlg = FALSE;
-        alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
+        //alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
     }
 
     if(power_stPowStateOut.powerstate != POWER_START)

+ 3 - 3
1.FrameLayer/Source/main.c

@@ -155,7 +155,7 @@ int  main(void)
     DL_Timer_setCaptCompUpdateMethod(MOTOR_PWM_INST,DL_TIMER_CC_UPDATE_METHOD_ZERO_EVT,DL_TIMERA_CAPTURE_COMPARE_1_INDEX);
     DL_Timer_setCaptCompUpdateMethod(MOTOR_PWM_INST,DL_TIMER_CC_UPDATE_METHOD_ZERO_EVT,DL_TIMERA_CAPTURE_COMPARE_2_INDEX);
     NVIC_EnableIRQ(ADC12_0_INST_INT_IRQN);
-    DL_Timer_setCaptCompUpdateMethod(PWM_F_INST,DL_TIMER_CC_UPDATE_METHOD_ZERO_EVT,DL_TIMER_CC_1_INDEX);
+    //DL_Timer_setCaptCompUpdateMethod(PWM_F_INST,DL_TIMER_CC_UPDATE_METHOD_ZERO_EVT,DL_TIMER_CC_1_INDEX);
     NVIC_EnableIRQ(HALLTIMER_INST_INT_IRQN); //
 
     DL_TimerA_setCaptureCompareValue(MOTOR_PWM_INST, 0, DL_TIMER_CC_0_INDEX);
@@ -193,9 +193,9 @@ int  main(void)
 
 //LED pwm 开始计数
    // DL_TimerG_startCounter(TIMG12);
-    DL_TimerG_startCounter(PWM_R_INST);
+  //  DL_TimerG_startCounter(PWM_R_INST);
     DL_TimerG_startCounter(PWM_F_INST);
-    DL_TimerG_startCounter(PWM_B_L_INST);
+  //  DL_TimerG_startCounter(PWM_B_L_INST);
 
 //    DL_GPIO_clearPins(OUTPUT_CAN_STB_PORT, OUTPUT_CAN_STB_PIN);
 //    DL_GPIO_setPins(OUTPUT_CAN_STB_PORT, OUTPUT_CAN_STB_PIN);

+ 1 - 1
2.MotorDrive/Source/adc.c

@@ -35,7 +35,7 @@ Revising History (ECL of this file):
 #include "MosResCalib.h"
 #include "hwsetup.h"
 
- extern uint16_t gAdcResult0[8];
+ extern uint16_t gAdcResult0[15];
 /************************************************************************
  Constant Table:
 *************************************************************************/

+ 101 - 101
2.MotorDrive/Source/alarm.c

@@ -1314,91 +1314,91 @@ Reference:
 void alm_voDetec200MS(const ALM_BIKE_IN *in, const ALM_DETEC200MS_COF *coef) 
 { 
     /* Bike speed sensor fault */
-    if(in->uwCadenceFreqPu > 150 || in->swMotorSpdAbsPu > coef->swMotorSpdMinPu) // 0.2Hz 150
-    {
-        if(in->uwBikeSpdPu < 75) // 0.1hz 75
-        {
-            alm_stDecCt.uwBikeSpdFlt ++;
-            if(alm_stDecCt.uwBikeSpdFlt >= coef->uwBikeSpdFltCt)
-            {
-                alm_stDecCt.uwBikeSpdFlt = coef->uwBikeSpdFltCt;
-                alm_unBikeCode.bit.BikeSpdSen = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }    
-        }
-        else if(in->blBikeSpdOvrFlg)
-        {        
-            alm_unBikeCode.bit.BikeSpdSen = 1;
-            alm_unAction.bit.PWMOff = 1;
-        }
-        else
-        {
-            alm_stDecCt.uwBikeSpdFlt = 0;
-        }
-    }
-    else
-    {
-        alm_stDecCt.uwBikeSpdFlt = 0;
-    }
+//    if(in->uwCadenceFreqPu > 150 || in->swMotorSpdAbsPu > coef->swMotorSpdMinPu) // 0.2Hz 150
+//    {
+//        if(in->uwBikeSpdPu < 75) // 0.1hz 75
+//        {
+//            alm_stDecCt.uwBikeSpdFlt ++;
+//            if(alm_stDecCt.uwBikeSpdFlt >= coef->uwBikeSpdFltCt)
+//            {
+//                alm_stDecCt.uwBikeSpdFlt = coef->uwBikeSpdFltCt;
+//                alm_unBikeCode.bit.BikeSpdSen = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//        }
+//        else if(in->blBikeSpdOvrFlg)
+//        {
+//            alm_unBikeCode.bit.BikeSpdSen = 1;
+//            alm_unAction.bit.PWMOff = 1;
+//        }
+//        else
+//        {
+//            alm_stDecCt.uwBikeSpdFlt = 0;
+//        }
+//    }
+//    else
+//    {
+//        alm_stDecCt.uwBikeSpdFlt = 0;
+//    }
 
-  if(power_stPowStateOut.blPowerStartupFlg == TRUE)
-  {
-    if(cp_stFlg.RunModelSelect == CadAssist)  /* 纯踏频助力判断逻辑 */
-    {
-        /* Bike cadence sensor fault */
-        if(in->blCadenceFreqOvrFlg)
-        {
-            alm_unBikeCode.bit.CadenceSen = 1;
-            alm_unAction.bit.PWMOff = 1;
-        }
-    }
-    else if((cp_stFlg.RunModelSelect == TorqAssist) &&(power_stPowStateOut.blPowerStartupFlg == TRUE))/* 力矩中轴助力判断逻辑 */
-    {
-        /* Bike cadence sensor fault */
-        if(in->uwBikeSpdPu > 475 && in->uwTroqPu > coef->uwTorqMinPu) //475-5km/h
-        {
-            if(in->uwCadenceFreqPu == 0)
-            {
-                alm_stDecCt.uwCadenceFlt ++;
-                if(alm_stDecCt.uwCadenceFlt >= coef->uwCadenceFltCt)
-                {
-                    alm_stDecCt.uwCadenceFlt = coef->uwCadenceFltCt;
-                    alm_unBikeCode.bit.CadenceSen = 1;
-                    alm_unAction.bit.PWMOff = 1;
-                }
-            }
-            else if(in->blCadenceFreqOvrFlg)
-            {
-                alm_unBikeCode.bit.CadenceSen = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-            else
-            {
-                alm_stDecCt.uwCadenceFlt = 0;
-            }
-        }
-        else
-        {
-            alm_stDecCt.uwCadenceFlt = 0;
-        }
-        
-        /* Bike torque sensor fault */
-        if((in->uwTroqReg < coef->uwTorqMinReg) || (in->uwTroqReg >= coef->uwTorqMaxReg)) //Fault: U_Torq < 0.1V or  >=3V
-        {
-            alm_stDecCt.uwTorqFlt ++;
-            if(alm_stDecCt.uwTorqFlt >= coef->uwTorqFltCt)
-            {
-                alm_stDecCt.uwTorqFlt = coef->uwTorqFltCt;
-                alm_unBikeCode.bit.TorqSen = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.uwTorqFlt = 0;
-        }
-    }
-  }
+//  if(power_stPowStateOut.blPowerStartupFlg == TRUE)
+//  {
+//    if(cp_stFlg.RunModelSelect == CadAssist)  /* 纯踏频助力判断逻辑 */
+//    {
+//        /* Bike cadence sensor fault */
+//        if(in->blCadenceFreqOvrFlg)
+//        {
+//            alm_unBikeCode.bit.CadenceSen = 1;
+//            alm_unAction.bit.PWMOff = 1;
+//        }
+//    }
+//    else if((cp_stFlg.RunModelSelect == TorqAssist) &&(power_stPowStateOut.blPowerStartupFlg == TRUE))/* 力矩中轴助力判断逻辑 */
+//    {
+//        /* Bike cadence sensor fault */
+//        if(in->uwBikeSpdPu > 475 && in->uwTroqPu > coef->uwTorqMinPu) //475-5km/h
+//        {
+//            if(in->uwCadenceFreqPu == 0)
+//            {
+//                alm_stDecCt.uwCadenceFlt ++;
+//                if(alm_stDecCt.uwCadenceFlt >= coef->uwCadenceFltCt)
+//                {
+//                    alm_stDecCt.uwCadenceFlt = coef->uwCadenceFltCt;
+//                    alm_unBikeCode.bit.CadenceSen = 1;
+//                    alm_unAction.bit.PWMOff = 1;
+//                }
+//            }
+//            else if(in->blCadenceFreqOvrFlg)
+//            {
+//                alm_unBikeCode.bit.CadenceSen = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//            else
+//            {
+//                alm_stDecCt.uwCadenceFlt = 0;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.uwCadenceFlt = 0;
+//        }
+//
+//        /* Bike torque sensor fault */
+//        if((in->uwTroqReg < coef->uwTorqMinReg) || (in->uwTroqReg >= coef->uwTorqMaxReg)) //Fault: U_Torq < 0.1V or  >=3V
+//        {
+//            alm_stDecCt.uwTorqFlt ++;
+//            if(alm_stDecCt.uwTorqFlt >= coef->uwTorqFltCt)
+//            {
+//                alm_stDecCt.uwTorqFlt = coef->uwTorqFltCt;
+//                alm_unBikeCode.bit.TorqSen = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.uwTorqFlt = 0;
+//        }
+//    }
+//  }
     
     /* Bike throttle fault */
 #if 0
@@ -1437,23 +1437,23 @@ void alm_voDetec200MS(const ALM_BIKE_IN *in, const ALM_DETEC200MS_COF *coef)
 //    }
   
     /* Motor NTC fault */
-    if(in->blMotorNTCExistFlg)
-    {
-        if((in->uwMotorNTCReg < coef->uwNTCMinReg) || (in->uwMotorNTCReg > coef->uwNTCMaxReg))  // Fault: NTC>100k or <0.032k
-        {
-            alm_stDecCt.uwMotorNTCFlt ++;
-            if(alm_stDecCt.uwMotorNTCFlt >= coef->uwMotorNTCFltCt)
-            {
-                alm_stDecCt.uwMotorNTCFlt = coef->uwMotorNTCFltCt;
-                alm_unBikeCode.bit.MotorNTC = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.uwMotorNTCFlt = 0;
-        }
-    }  
+//    if(in->blMotorNTCExistFlg)
+//    {
+//        if((in->uwMotorNTCReg < coef->uwNTCMinReg) || (in->uwMotorNTCReg > coef->uwNTCMaxReg))  // Fault: NTC>100k or <0.032k
+//        {
+//            alm_stDecCt.uwMotorNTCFlt ++;
+//            if(alm_stDecCt.uwMotorNTCFlt >= coef->uwMotorNTCFltCt)
+//            {
+//                alm_stDecCt.uwMotorNTCFlt = coef->uwMotorNTCFltCt;
+//                alm_unBikeCode.bit.MotorNTC = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.uwMotorNTCFlt = 0;
+//        }
+//    }
 }
 
 /***************************************************************

+ 1 - 1
3.BasicFunction/Include/FuncLayerAPI.h

@@ -33,7 +33,7 @@ extern CADENCE_COF      cadence_stFreGetCof;
 extern TORQUESENSOR_OUT torsensor_stTorSensorOut;
 extern TORQUESENSOR_COF torsensor_stTorSensorCof;
 extern BIKESPEED_OUT    bikespeed_stFreGetOut;
-extern BIKELIGHT_OUT    bikelight_stBikeLightOut;
+//extern BIKELIGHT_OUT    bikelight_stBikeLightOut;
 
 /***************************************
  *

+ 26 - 224
3.BasicFunction/Include/bikelight.h

@@ -28,107 +28,16 @@ typedef _Bool  BOOL;
 #endif
 
 
-#define   BIKEMODE_LUNGU_NORMOL      0X01   //常规控轮毂控制器,前后灯1路DCDC,1个IO控制使能
-#define   BIKEMODE_LUNGU_OXFORD      0X02   //oxfordPCB版本,前后灯2路DCDC,2个IO控制器使能,2个IO选择电压
-#define   BIKEMODE_LUNGU_750MINI     0x03   //短款750W,前后灯1路DCDC,开机使能,2个IO控制MOS,1个IO选择电压
-
-#define   BIKEMODE      BIKEMODE_LUNGU_OXFORD
-
-#define   LED_OUTVOLT_6V        0X01
-#define   LED_OUTVOLT_12V       0X02
-#define   LED_OUTVOLT_6VOR12V   0X03
-
-#if(BIKEMODE==BIKEMODE_LUNGU_NORMOL) //常规控轮毂控制器,前后灯1路DCDC,1个IO控制使能
-
-#define    LED_OUTVOLT        LED_OUTVOLT_6V // led输出电压
-
-#define    BIKELEDCHECK_F_ENABLE    0  //led前灯故障检测 0-失能 ,1使能LED灯压检测
-#define    BIKELEDCHECK_R_ENABLE    0  //led尾灯故障检测 0-失能 ,1使能LED灯压检测
-
-#define    BIKELEDOPEN_F_ENABLE    1  //前灯使能,0-失能,1-使能
-#define    BIKELEDOPEN_R_ENABLE    1  //尾灯使能,0-失能,1-使能
-
-//- 管脚分配
-/*前灯控制IO on/off */
-#define IO_FORWARDLED_ON()            GPIO_SetBits(GPIOB,GPIO_Pin_3)//
-#define IO_FORWARDLED_OFF()           GPIO_ResetBits(GPIOB,GPIO_Pin_3)//
-
-#define IO_FORWARDLED_12V_ENABLE()    __NOP()
-#define IO_FORWARDLED_12V_DISABLE()   __NOP()
-
-/* 后灯控制IO on/off */
-#define IO_BACKLED_ON()             __NOP()
-#define IO_BACKLED_OFF()            __NOP()
-#define IO_BACKLED_12V_ENABLE()    __NOP()
-#define IO_BACKLED_12V_DISABLE()    __NOP()
-
-#elif(BIKEMODE==BIKEMODE_LUNGU_OXFORD) //oxfordPCB版本,前后灯2路DCDC,2个IO控制器使能,2个IO选择电压
-
-#define    LED_OUTVOLT        LED_OUTVOLT_6VOR12V // led检测电压
-
-#define    BIKELEDCHECK_F_ENABLE    0  //led前灯故障检测 0-失能 ,1使能LED灯压检测
-#define    BIKELEDCHECK_R_ENABLE    0  //led尾灯故障检测 0-失能 ,1使能LED灯压检测
-
-#define    BIKELEDOPEN_F_ENABLE    1  //前灯使能,0-失能,1-使能
-#define    BIKELEDOPEN_R_ENABLE    1  //尾灯使能,0-失能,1-使能
-
-//- -管脚分配
-/* 前灯控制IO on/off */
-//#define IO_FORWARDLED_ON()              GPIO_SetBits(GPIOB,GPIO_Pin_3)////PB3
-//#define IO_FORWARDLED_OFF()             GPIO_ResetBits(GPIOB,GPIO_Pin_3)//PB3
-//#define IO_FORWARDLED_12V_ENABLE()      GPIO_SetBits(GPIOB,GPIO_Pin_6)//PB6
-//#define IO_FORWARDLED_12V_DISABLE()     GPIO_ResetBits(GPIOB,GPIO_Pin_6)//PB6
-
-/* 后灯控制IO on/off */
-//#define IO_BACKLED_ON()             GPIO_SetBits(GPIOB,GPIO_Pin_5)//PB5
-//#define IO_BACKLED_OFF()            GPIO_ResetBits(GPIOB,GPIO_Pin_5) //PB5
-//#define IO_BACKLED_12V_ENABLE()     GPIO_SetBits(GPIOB,GPIO_Pin_7)//PB7
-//#define IO_BACKLED_12V_DISABLE()    GPIO_ResetBits(GPIOB,GPIO_Pin_7)//PB7
-
-#elif(BIKEMODE==BIKEMODE_LUNGU_750MINI) //短款750W,前后灯1路DCDC,开机使能,2个IO控制MOS,1个IO选择电压
-
-#define    LED_OUTVOLT        LED_OUTVOLT_6VOR12V // led检测电压
-
-#define    BIKELEDCHECK_F_ENABLE    0  //led前灯故障检测 0-失能 ,1使能LED灯压检测
-#define    BIKELEDCHECK_R_ENABLE    0  //led尾灯故障检测 0-失能 ,1使能LED灯压检测
-
 #define    BIKELEDOPEN_F_ENABLE    1  //前灯使能,0-失能,1-使能
 #define    BIKELEDOPEN_R_ENABLE    1  //尾灯使能,0-失能,1-使能
 
-//- -管脚分配
-/* 前灯控制IO on/off */
-#define IO_FORWARDLED_ON()              GPIO_SetBits(GPIOB,GPIO_Pin_7)    //PB7
-#define IO_FORWARDLED_OFF()             GPIO_ResetBits(GPIOB,GPIO_Pin_7)  //PB7
-#define IO_FORWARDLED_12V_ENABLE()      GPIO_SetBits(GPIOB,GPIO_Pin_3)    //PB3
-#define IO_FORWARDLED_12V_DISABLE()     GPIO_ResetBits(GPIOB,GPIO_Pin_3)  //PB3
-
-/* 后灯控制IO on/off */
-#define IO_BACKLED_ON()             GPIO_SetBits(GPIOB,GPIO_Pin_6)        //PB6
-#define IO_BACKLED_OFF()            GPIO_ResetBits(GPIOB,GPIO_Pin_6)      //PB6
-#define IO_BACKLED_12V_ENABLE()     __NOP()
-#define IO_BACKLED_12V_DISABLE()    __NOP()
-
-#else
-
-#define    BIKELEDCHECK_F_ENABLE    0  //led前灯故障检测 0-失能 ,1使能LED灯压检测
-#define    BIKELEDCHECK_R_ENABLE    0  //led尾灯故障检测 0-失能 ,1使能LED灯压检测
-
-#define    BIKELEDOPEN_F_ENABLE     1  //前灯使能,0-失能,1-使能
-#define    BIKELEDOPEN_R_ENABLE     0  //尾灯使能,0-失能,1-使能
-
-//- 管脚分配
-/* 前灯控制IO on/off */
-#define IO_FORWARDLED_ON()            GPIO_SetBits(GPIOB,GPIO_Pin_3)//
-#define IO_FORWARDLED_OFF()           GPIO_ResetBits(GPIOB,GPIO_Pin_3)//
-
-#endif
 
 //---------------------------------------
-#define    BikeLedAddCycle    12  //亮尾灯周期
+#define    BikeLedAddCycle    15//12  //亮尾灯周期
 
-#define    BikeLedAddDuty     5  //亮尾灯占空比
+#define    BikeLedAddDuty     5//5  //亮尾灯占空比
 
-#define    BikeLedFlickerHZ   50  //亮尾闪烁频率
+#define    BikeLedFlickerHZ   5  //亮尾闪烁频率 1秒5次
 
 #define    BikeLedFlickerCycle   1000/BikeLedFlickerHZ  //亮尾灯周期
 
@@ -146,48 +55,14 @@ typedef _Bool  BOOL;
 #define    BikeLedOverSpeedMin    140  //基本单位0.1km/h
 
 //---------------------------------------------------------
-#define     LIGHT_ERR_VOLTAGE_MAX   75   // 0.1v
-
-#define     LIGHT_ERR_VOLTAGE_MIN   50   // 0.1v
-
-#define     LIGHT_OFFERR_VOLTAGE    15   // 0.1v
-
-#define     LEDERRTIME              5 //LED灯电路检测错误次数
-
-#define     LEDRISETIME              200 //上升沿时间 1ms单位
-
-#define     LEDFALLTIME              2000 //下降沿时间 1ms单位
-
-#define  LIGHT_FIRSTPWM         144 //64KHZ,max=2304
-#define  LIGHT_SECTPWM          691 //64KHZ,max=2304
-
-typedef enum
-{
-    one_byte = 1,
 
-    two_byte = 2,
+ //启动LED的起始PWM时
+#define  LIGHT_FIRSTPWM         144 //64us,max=2304 第一个PWM 前灯
+#define  LIGHTBLR_FIRSTPWM      346 //64us,max=2304 第一个PWM 尾灯,左右灯
+#define  LIGHT_SECTPWM          2304//691 //64us,max=2304 第二个PWM
+#define  LIGHT_MAXPWM           2304//691 //64us,max=2304 第二个PWM
 
-    Three_byte = 3,
 
-    four_byte = 4,
-
-    five_byte = 5,
-
-    six_byte = 6,
-
-    seven_byte = 7,
-
-    eight_byte = 8
-
-} LED_TYPE_STR;
-
-//typedef struct
-//{
-//    UBYTE       ubBike_keyLedSta;  // 开关灯临时状态
-//
-//    UWORD       uwLedAddcnt;
-//
-//} BIKELED_STR;
 
 typedef enum
 {
@@ -206,78 +81,46 @@ typedef enum
 
 typedef struct
 {
-    UWORD       uwLedOnVoltMax; // 开灯时上限电压
-
-    UWORD       uwLedOnVoltMin; //开灯时下限电压
-
-    BOOL        blBike_LedOnErr;   // 开灯电路故障状态
-
-    UWORD       uwBike_LedOnErrCnt;   //  开灯电路滤波
-
-    UWORD       uwBike_LedOnErrDCnt;   //  开灯电路滤波
+    UWORD       uwBike_LedOffErrCnt;   // 过流恢复计时
 
-    UWORD       uwBike_LedOnErrAddNO;   // 开灯电路错误次数累加值
+    UWORD       uwBike_LedVolt;   //灯压选择
 
-    UWORD       uwLedOffVoltMax; // 关灯时上限电压
+    UWORD       uwBike_LedMode;   //选择功能,
 
-    BOOL        blBike_LedOffErr;   // 关灯电路故障状态
+    UWORD       uwBike_OpenPreTime;   //开灯时刻开始计时
 
-    UWORD       uwBike_LedOffErrCnt;   // 关灯电路滤波
+    UWORD       uwBike_OpenLedEn;   //开灯瞬间处理标志
 
-    UWORD       uwBike_LedOffErrDCnt;   // 关灯电路滤波
+    UWORD       uwBikeLight_PWM;  // LED PWM
 
-    UWORD       uwBike_LedOffErrAddNO;   // 光灯电路错误次数累加值
-
-    UWORD       uwBike_LedVolt;   //
-
-    UWORD       uwBike_LedMode;   //
-
-    UWORD       uwBike_OpenPreTime;   //
-    UWORD       uwBike_OpenLedEn;   //
-    UWORD       uwBikeLight_PWM;
-    UWORD       uwBike_LedCheckLowTime;   //
+    UWORD       uwBike_LedCheckLowTime;   //检测过流IO出现低电平次数
 
     UWORD       uwBike_keyLedHighSta;  // 开关灯临时状态
-    UWORD       uwBike_keyLedLowSta;  // 开关灯临时状态
-    UWORD       uwLedAddcnt;
-
-    BOOL       blBike_LedCurErr;   // 灯电路过流
-
-    BOOL       blBike_ForwardLedStart;   // 前灯开灯过流反复标志
-
-} BIKELEDCHECK_STR;
-
 
-typedef struct
-{
-    BOOL       blBike_ForwardLedFlag;  // 前灯开关状态
-
-    BOOL       blBike_BackLedSta;//尾灯开关状态
-
-   // BOOL       blBike_ForwardLedCurErr;   // 前灯电路过流
+    UWORD       uwBike_keyLedLowSta;  // 开关灯临时状态
 
+    UWORD       uwLedAddcnt;//Led功能翻转计时
 
+    UWORD       uwLeddelaycnt;//Led延时开灯
 
-    BOOL       blBike_BackLedDetErr;    // 尾灯电路
+    BOOL        blBike_LedSta; //开关LED输入状态
 
-    BOOL       blBike_BackLedStart;    // 尾灯开灯过流反复标志
+    BOOL       blBike_LedCurErr;   // 灯电路过流
 
-    //UWORD     uwlBike_ForwardLedDetErrTime;   // 前灯电路短路累计时间
+    BOOL       blBike_ForwardLedStart;   // 允许开灯启动,总开关
 
-    UWORD     uwBike_BackLedDetErrTime;   // 前灯电路短路累计时间
 
-    UWORD       uwBikeLight_L_PWM;    //
+} BIKELEDCHECK_STR;
 
-    UWORD       uwBikeLight_F_PWM;    //
 
-} BIKELED_Global_STR;
 
 
-EXTERNBIKE  BIKELED_Global_STR  BikeLedGloFun;
+//EXTERNBIKE  BIKELED_Global_STR  BikeLedGloFun;
 EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_F;//前灯参数
 EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_B;//尾灯参数
 EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_L;//左灯参数
 EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_R;//右灯参数
+EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_DC;//DC12V
 
 //---------------------------------------
 
@@ -286,21 +129,7 @@ EXTERNBIKE  BIKELEDCHECK_STR    BikeLedCheck_R;//右灯参数
  *          Definitions & Macros
  *
  ****************************************/
-#define BIKELIGHT_OUT_DEFAULT     \
-    {                             \
-        0, 0, 0, FALSE, LIGHT_Off \
-    } // Default value of BIKELIGHT_OUT
-#define BIKELIGHT_COEF_DEFAULT \
-    {                          \
-        0, 0, 0, 0, 0          \
-    }
-
-#define LIGHT_POWER_ERROR_VOLTAGE_UP   70   // 0.1v
-#define LIGHT_POWER_ERROR_VOLTAGE_DOWN 50   // 0.1v
-#define LIGHT_POWER_ERROR_DETECT       2000 // ms
-#define LIGHT_POWER_ERROR_RECOVER      2000 // ms
-#define LIGHT_POWER_ERROR_SHUT         2000 // ms
-#define LIGHT_POWER_ERROR_TIMEUNIT     200  // ms
+
 
 /***************************************
  *
@@ -320,42 +149,15 @@ typedef enum
     LIGHT_Shut = 3
 } LIGHT_STATE;
 
-/**
- * @brief BikeLight out
- *
- */
-typedef struct
-{
-    UWORD       uwBikeLightErrorCnt;   // Cnt of detect GPIO low voltage
-    UWORD       uwBikeLightRecoverCnt; // Cnt of detect GPIO high voltage
-    UWORD       uwBikeLightShutCnt;    // Cnt of detect GPIO high voltage
-
-    BOOL        blBikeLightErrorFlg;   // flag of light error
-    LIGHT_STATE LightState;            // state of light
-} BIKELIGHT_OUT;
 
-typedef struct
-{
-    UWORD uwBikeLightErrorCnt;           // Cnt of detect GPIO low voltage
-    UWORD uwBikeLightRecoverCnt;         // Cnt of detect GPIO high voltage
-    UWORD uwBikeLightShutCnt;            // Cnt of detect GPIO high voltage
-    UWORD uwBikeLightErrorVoltagePuDown; // flag of light error
-    UWORD uwBikeLightErrorVoltagePuUp;   // flag of light error
-} BIKELIGHT_COEF;
 
-/****************************************
- *
- *           Exported variable
- *
- ****************************************/
-EXTERNBIKE BIKELIGHT_OUT    bikelight_stBikeLightOut;
 
 /***************************************
  *
  *          Function  Definations
  *
  ***************************************/
-void bikelight_voBikeLightInit(void); // interface function
+void bikelight_voBikeLightInit(BIKELEDCHECK_STR *LedPoit);; // interface function
 void bikelight_voBikeLightCoef(UWORD volt);
 void bikelight_voGetBikeLightError(UWORD LightPowerVolPu,BOOL Ledsta,BIKELEDCHECK_STR *p);
 void bikelight_voBikeLightControl(UWORD switchAction, BOOL Brate_Sta);

+ 1 - 1
3.BasicFunction/Source/bikebrake.c

@@ -44,7 +44,7 @@ void bikebrake_voBikeBrakeInit(void)
     bikebrake_stBikeBrakeOut.blBikeBrakeOnFlg = FALSE;
 }
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: bikebrake_voBikeBrakeDetect;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A

File diff suppressed because it is too large
+ 424 - 397
3.BasicFunction/Source/bikelight.c


+ 11 - 11
3.BasicFunction/Source/bikethrottle.c

@@ -148,16 +148,16 @@ void bikethrottle_voBikeThrottleADC(void) // need to match ADC_StartConversion(A
         mth_voLPFilter(bikethrottle_stBikeThrottleOut.uwThrottleVolPu, &scm_stBikeThrottleLpf);
         bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = scm_stBikeThrottleLpf.slY.sw.hi;
  //故障判断
-        if (bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu < bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu)
-        {
-            bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu;
-            bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt++;
-            if (bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt == bikethrottle_stBikeThrottleCof.uwThrottleErrorCnt)
-            {
-                bikethrottle_stBikeThrottleOut.blThrottleErrorFlg = TRUE;
-                bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
-            }
-        }
+//        if (bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu < bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu)
+//        {
+//            bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu;
+//            bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt++;
+//            if (bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt == bikethrottle_stBikeThrottleCof.uwThrottleErrorCnt)
+//            {
+//                bikethrottle_stBikeThrottleOut.blThrottleErrorFlg = TRUE;
+//                bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
+//            }
+//        }
 //        else if (bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu > bikethrottle_stBikeThrottleCof.uwMaxThrottleVolOutputPu)
 //        {
 //            bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = bikethrottle_stBikeThrottleCof.uwMaxThrottleVolOutputPu;
@@ -168,7 +168,7 @@ void bikethrottle_voBikeThrottleADC(void) // need to match ADC_StartConversion(A
 //                bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
 //            }
 //        }
-        else //无故障
+   //     else //无故障
         {
             bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
 

+ 1 - 1
3.BasicFunction/Source/canAppl.c

@@ -269,7 +269,7 @@ void  Can_voInitMC_Run(void)
    // flash_voErrorRead();
 
     // MC版本信息初始化,Mode和SN从EEPROM读取
-    strncpy(MC_VerInfo.HW_Version, (char *)"88K7000101V1    ", 16); //长度不超过16
+    strncpy(MC_VerInfo.HW_Version, (char *)"SC20100101V1    ", 16); //长度不超过16
 
     // Software version
     char chFwVersion[16]="V1r0r0_";

+ 5 - 5
3.BasicFunction/Source/display.c

@@ -61,7 +61,7 @@ static void display_voSetDisplayOff(void)
 }
 
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: display_voGetDisplayError;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A
@@ -105,7 +105,7 @@ void display_voGetDisplayError(UWORD DisplayVolPu)
 }
 
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: display_voDisplayInit;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A
@@ -128,7 +128,7 @@ void display_voDisplayInit(void)
 }
 
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: display_voDisplayCoef;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A
@@ -144,7 +144,7 @@ void display_voDisplayCoef(void)
     display_stDisplayCoef.uwDisplayErrorVoltagePuUp = ((ULONG)Display_POWER_ERROR_VOLTAGE_UP << 14) / VBASE;
 }
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: display_voDisplayControl;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A
@@ -166,7 +166,7 @@ void display_voDisplayControl(UWORD switchAction)
 }
 
 /***************************************************************
- Function: bikelight_voBikeLightInit;
+ Function: display_voCommunication;
  Description: bike light control initialization
  Call by: functions in main loop;
  Input Variables: N/A

+ 1 - 1
3.BasicFunction/Source/switchhall.c

@@ -53,7 +53,7 @@ void switchhall_voInit(void)
 //    switchhall_stOut.uwSectorNumPre = 0;
     switchhall_stOut.slLowThetaPu = 0;
 
-    switchhall_stOut.swLowThetaOffsetPu = 0; //-683  -7 degree
+    switchhall_stOut.swLowThetaOffsetPu = cof_sl300DegreePu; //-683  -7 degree
 
     switchhall_stCap.slCapValueDelta = HALL3_SPD_CAP_LEVEL1;
     switchhall_stCap.ulCapValue = 0;

+ 1 - 1
3.BasicFunction/Source/uart_bafang.c

@@ -410,7 +410,7 @@ void Bafang_USART_RxData_Process(USART_Buf_TypeDef* ptUartTx, UBYTE* buf, UWORD
 ****************************************************************/
 void Bafang_SendData_BMS(USART_Buf_TypeDef* ptUartTx, UBYTE Addr, UBYTE Cmd, UBYTE Length)
 {
-#if (SIMULATION == 1)
+#if 0//(SIMULATION == 1)
   return;
 #else
     UBYTE databuf[255] = {0};

+ 2 - 2
4.BasicHardwSoftwLayer/1.BasicHardwLayer/Include/UserGpio_Config.h

@@ -4,7 +4,7 @@
 #include "ti_msp_dl_config.h"
 //GPIO cofig
 #include "syspar.h"
-#define Get_BRAKE_DETECT_PORT()        DL_GPIO_readPins(INPUT_PORT, INPUT_BREAK_PIN)// (GPIO_PINS_14 & GPIOC->idt)   //鍒硅溅娈靛伓
+#define Get_BRAKE_DETECT_PORT()        DL_GPIO_readPins(INPUT_BREAK_PORT, INPUT_BREAK_PIN)// (GPIO_PINS_14 & GPIOC->idt)   //鍒硅溅娈靛伓
 
 //#define CapValutBike_CCRx()            DL_Timer_getTimerCount(TIMG6)// (TMR16->c1dt)  //bikespeed cnt
 
@@ -30,7 +30,7 @@
 
 
 
-#define Get_CAD_PORT()              DL_GPIO_readPins(INPUT_PORT, INPUT_Cadence_in_PIN)//  (GPIOB->idt &GPIO_PINS_9) // CAD
+#define Get_CAD_PORT()              DL_GPIO_readPins(INPUT_Cadence_Speed_PORT, INPUT_Cadence_Speed_PIN)//  (GPIOB->idt &GPIO_PINS_9) // CAD
 
 
 /* 前灯IO on/off */

+ 2 - 2
4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/syspar.h

@@ -43,7 +43,7 @@ Update Time
 
 #define IPM_VOLTAGE_36V         0x0
 #define IPM_VOLTAGE_48V         0x1
-#define IPM_VOLTAGE_SEL         IPM_VOLTAGE_36V
+#define IPM_VOLTAGE_SEL         IPM_VOLTAGE_48V
 
 #define BIKE_TYPE_R219          0x0
 #define BIKE_TYPE_R168          0x01
@@ -62,7 +62,7 @@ Update Time
 #define BIKE_THROTTLE_SPEED_LIMIT_SEL    BIKE_THROTTLE_SPEED_LIMIT_32
 /*======================================================================*
     uart2关闭与打开
-    0-打开UART2  1- 关闭uart2-Simulation
+    0-打开LED12v电源  1- 关闭关闭 可仿真
 *=======================================================================*/
 #define  SIMULATION        1            
 /*======================================================================*

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

@@ -77,7 +77,7 @@ Update Time
 #elif (IPM_POWER_SEL == IPM_POWER_350W_9G)
 #define MOTOR_ID_SEL   MOTOR_LUNGU_WELLING_HAL_POLE8_350W_958Ratio
 #elif ((IPM_POWER_SEL == IPM_POWER_250W_6G)||(IPM_POWER_SEL == IPM_POWER_350W_6G))
-#define MOTOR_ID_SEL   MOTOR_LUNGU_WELLING_HAL_POLE8_350W_958Ratio//
+#define MOTOR_ID_SEL  MOTOR_LUNGU_WELLING_HAL_POLE8_500W//
 #else
 #define MOTOR_ID_SEL MOTOR_LUNGU_WELLING_HAL_POLE8_250W
 #endif

+ 3 - 3
JSCOPE/SEGGER_RTT.c

@@ -2121,7 +2121,7 @@ char JS_RTT_UpBuffer[1024];    // J-Scope RTT Buffer
   //------------------------
 void Jscope_Init(void)
 {
-  SEGGER_RTT_ConfigUpBuffer(1, "JScope_I4I4I4U4", &JS_RTT_UpBuffer[0],sizeof(JS_RTT_UpBuffer),SEGGER_RTT_MODE_NO_BLOCK_SKIP);// SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
+  SEGGER_RTT_ConfigUpBuffer(1, "JScope_I4I4I4", &JS_RTT_UpBuffer[0],sizeof(JS_RTT_UpBuffer),SEGGER_RTT_MODE_NO_BLOCK_SKIP);// SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
 }
 /***************************************************************
  Function: Jscope_WtiteData;
@@ -2143,7 +2143,7 @@ void Jscope_WtiteData(void)
     signed int Sine1;
     signed int Sine2;
     signed int Sine3;
-    unsigned int Sine4;
+   // unsigned int Sine4;
 //    unsigned int Sine3;
 //    unsigned int  Sine4;
    
@@ -2154,7 +2154,7 @@ void Jscope_WtiteData(void)
    acValBuffer.Sine1  = adc_stDownOut.swIaPu;// adc_stDownOut.swIaPu;// adc_stUpOut.swSampCapIaPu;//adc_stDownOut.swIaPu;
    acValBuffer.Sine2 =adc_stDownOut.swIbPu;// adc_stDownOut.swIbPu;//adc_stUpOut.swCalibIaPu;//adc_stDownOut.swIaPu;
    acValBuffer.Sine3=adc_stDownOut.swIcPu;
-   acValBuffer.Sine4 =scm_uwAngRefPu;
+ //  acValBuffer.Sine4 =scm_uwAngRefPu;
 //   acValBuffer.Sine3 = scm_uwAngParkPu;
 //   acValBuffer.Sine4= switchhall_stOut.uwSectorNum;
  //  acValBuffer.Sine3 = adc_stUpOut.swCalibIaPu;

+ 91 - 90
m0g3507_int.c

@@ -418,31 +418,31 @@ void ADC12_0_INST_IRQHandler(void)//void ADC1_CMP_IRQHandler(void)
         {
 
 //
-//        gAdcResult0[0] =
-//             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0);
-//        gAdcResult0[1] =
-//             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_1);
-//        gAdcResult0[2] =
-//             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_2);
-//        gAdcResult0[3] =
-//             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_3);
-//
-////        gAdcResult0[4] =
-////             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_4);
-//        gAdcResult0[5] =
-//             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_0);
-//
-//
-//        gAdcResult0[6] =
-//             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_1);
-//
-//        gAdcResult0[7] =
-//            DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_2);
-//        gAdcResult0[8] =
-//             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_3);
-//        gAdcResult0[9] =
-//             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_4);
-
+        gAdcResult0[0] =
+             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0);
+        gAdcResult0[1] =
+             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_1);
+        gAdcResult0[2] =
+             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_2);
+        gAdcResult0[3] =
+             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_3);
+
+        gAdcResult0[4] =
+             DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_4);
+
+
+        gAdcResult0[5] =
+             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_0);
+        gAdcResult0[6] =
+             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_1);
+        gAdcResult0[7] =
+            DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_2);
+        gAdcResult0[8] =
+             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_3);
+        gAdcResult0[9] =
+             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_4);
+        gAdcResult0[10] =
+             DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_5);
       // GPIOC->odt  ^= GPIO_PINS_13;
      // GPIOC->odt  ^= GPIO_PINS_15;
           // IO_PC10_TEST_ENABLE; //PC10鎵撳嵃鎸囩ず
@@ -1046,41 +1046,46 @@ void GROUP1_IRQHandler(void) //void TMR3_GLOBAL_IRQHandler(void)
 //                 default:
 //                     break;
 //             }
-
-    switch (DL_COMP_getPendingInterrupt(COMP_FLEDCHECK_INST)) {
-               case DL_COMP_IIDX_OUTPUT_EDGE:
-                   if(BikeLedCheck_F.uwBike_OpenLedEn!=0)
-                   {
-                       DL_TimerG_setCaptureCompareValue(PWM_F_INST, 0, GPIO_PWM_F_C1_IDX);//max=2304
-                   }
-                   else
-                   {
-                       if(BikeLedCheck_F.uwBike_OpenPreTime<=2)
-                       {
-                           BikeLedCheck_F.uwBike_OpenPreTime=2;
-                       //    CMPF++;
-                           BikeLedCheck_F.uwBikeLight_PWM=691;//LIGHT_SECTPWM;
-                           DL_TimerG_setCaptureCompareValue(PWM_F_INST, BikeLedCheck_F.uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);//max=2304
-                       }
-
-
-                   }
-                       BikeLedCheck_F.blBike_LedCurErr=TRUE;
-
-                     //  CHMPF++;
-                   break;
-               case DL_COMP_IIDX_OUTPUT_EDGE_INV:
-                   if(BikeLedCheck_F.uwBike_OpenLedEn!=0)
-                      {
-                       DL_TimerG_stopCounter(PWM_F_INST);
-                         BikeLedCheck_F.uwBikeLight_PWM=0;
-                         DL_TimerG_setCaptureCompareValue(PWM_F_INST, 0, GPIO_PWM_F_C1_IDX);//max=2304
-                      }
-                  // CLMPF++;
-                   break;
-               default:
-                   break;
-           }
+//F_LED
+//    switch (DL_COMP_getPendingInterrupt(COMP_FLEDCHECK_INST)) {
+//               case DL_COMP_IIDX_OUTPUT_EDGE:
+//                   if(BikeLedCheck_F.uwBike_OpenLedEn!=0)
+//                   {
+//                       DL_TimerG_setCaptureCompareValue(PWM_F_INST, 0, GPIO_PWM_F_C1_IDX);//max=2304
+//                   }
+//                   else
+//                   {
+//                       if (BikeLedCheck_F.blBike_LedSta == TRUE)
+//                       {
+//                           if(BikeLedCheck_F.uwBike_OpenPreTime<=2)
+//                           {
+//                               BikeLedCheck_F.uwBike_OpenPreTime=2;
+//                           //    CMPF++;
+//                               BikeLedCheck_F.uwBikeLight_PWM=LIGHT_SECTPWM;//LIGHT_SECTPWM;
+//                               DL_TimerG_setCaptureCompareValue(PWM_F_INST, BikeLedCheck_F.uwBikeLight_PWM, GPIO_PWM_F_C1_IDX);//max=2304
+//                           }
+//                       }
+//
+//                   }
+//                   if (BikeLedCheck_F.blBike_LedSta == TRUE)
+//                   {
+//                       BikeLedCheck_F.blBike_LedCurErr=TRUE;
+//                   }
+//
+//                     //  CHMPF++;
+//                   break;
+//               case DL_COMP_IIDX_OUTPUT_EDGE_INV:
+//                   if(BikeLedCheck_F.uwBike_OpenLedEn!=0)
+//                      {
+//                       DL_TimerG_stopCounter(PWM_F_INST);
+//                         BikeLedCheck_F.uwBikeLight_PWM=0;
+//                         DL_TimerG_setCaptureCompareValue(PWM_F_INST, 0, GPIO_PWM_F_C1_IDX);//max=2304
+//                      }
+//                  // CLMPF++;
+//                   break;
+//               default:
+//                   break;
+//           }
     uint32_t gpioA = DL_GPIO_getEnabledInterruptStatus(
             GPIOA,DL_GPIO_PIN_8 | DL_GPIO_PIN_3    );
 
@@ -1094,23 +1099,26 @@ void GROUP1_IRQHandler(void) //void TMR3_GLOBAL_IRQHandler(void)
         if(BikeLedCheck_B.uwBike_OpenLedEn!=0)
          {
             // DL_TimerG_stopCounter(PWM_B_L_INST);
-            DL_Timer_overrideCCPOut(PWM_B_L_INST, DL_TIMER_FORCE_OUT_LOW, DL_TIMER_FORCE_CMPL_OUT_LOW, GPIO_PWM_B_L_C1_IDX);
+   //         DL_Timer_overrideCCPOut(PWM_B_L_INST, DL_TIMER_FORCE_OUT_LOW, DL_TIMER_FORCE_CMPL_OUT_LOW, GPIO_PWM_B_L_C1_IDX);
             BikeLedCheck_B.uwBikeLight_PWM=0;
-              DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, 0, GPIO_PWM_B_L_C1_IDX);//max=2304
+ //             DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, 0, GPIO_PWM_B_L_C1_IDX);//max=2304
                CLMPF++;
          }
          else
          {
+             if( BikeLedCheck_B.blBike_LedSta==TRUE)
+             {
              if(BikeLedCheck_B.uwBike_OpenPreTime<=2)
              {
                  BikeLedCheck_B.uwBike_OpenPreTime=2;
                   CMPF++;
-                 BikeLedCheck_B.uwBikeLight_PWM=691;//LIGHT_SECTPWM;
-                 DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, BikeLedCheck_B.uwBikeLight_PWM, GPIO_PWM_B_L_C1_IDX);//max=2304
+                 BikeLedCheck_B.uwBikeLight_PWM=LIGHT_SECTPWM;//LIGHT_SECTPWM;
+   //              DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, BikeLedCheck_B.uwBikeLight_PWM, GPIO_PWM_B_L_C1_IDX);//max=2304
+             }
              }
-
 
          }
+        if( BikeLedCheck_B.blBike_LedSta==TRUE)
          BikeLedCheck_B.blBike_LedCurErr=TRUE;
 
            CHMPF++;
@@ -1119,28 +1127,31 @@ void GROUP1_IRQHandler(void) //void TMR3_GLOBAL_IRQHandler(void)
             DL_GPIO_clearInterruptStatus(GPIOB, DL_GPIO_PIN_15);
     }
 
-        //R_LED
+//R_LED
      if ((gpioB & DL_GPIO_PIN_8) ==  DL_GPIO_PIN_8)
           {
              if(BikeLedCheck_R.uwBike_OpenLedEn!=0)
                   {
-                      DL_TimerG_stopCounter(PWM_R_INST);
+  //                    DL_TimerG_stopCounter(PWM_R_INST);
                       BikeLedCheck_R.uwBikeLight_PWM=0;
-                       DL_TimerG_setCaptureCompareValue(PWM_R_INST, 0, GPIO_PWM_R_C1_IDX);//max=2304
+  //                     DL_TimerG_setCaptureCompareValue(PWM_R_INST, 0, GPIO_PWM_R_C1_IDX);//max=2304
                      //  CLMPF++;
                   }
                   else
                   {
+                    if(BikeLedCheck_R.blBike_LedSta==TRUE)
+                    {
                       if(BikeLedCheck_R.uwBike_OpenPreTime<=2)
                       {
                           BikeLedCheck_R.uwBike_OpenPreTime=2;
                         //  CMPF++;
-                          BikeLedCheck_R.uwBikeLight_PWM=691;//LIGHT_SECTPWM;
-                          DL_TimerG_setCaptureCompareValue(PWM_R_INST, BikeLedCheck_R.uwBikeLight_PWM, GPIO_PWM_R_C1_IDX);//max=2304
+                          BikeLedCheck_R.uwBikeLight_PWM=LIGHT_SECTPWM;//LIGHT_SECTPWM;
+    //                      DL_TimerG_setCaptureCompareValue(PWM_R_INST, BikeLedCheck_R.uwBikeLight_PWM, GPIO_PWM_R_C1_IDX);//max=2304
                       }
-
+                    }
 
                   }
+             if(BikeLedCheck_R.blBike_LedSta==TRUE)
               BikeLedCheck_R.blBike_LedCurErr=TRUE;
 
             //  CHMPF++;
@@ -1152,24 +1163,27 @@ void GROUP1_IRQHandler(void) //void TMR3_GLOBAL_IRQHandler(void)
              if(BikeLedCheck_L.uwBike_OpenLedEn!=0)
               {
                 //  DL_TimerG_stopCounter(PWM_B_L_INST);
-                 DL_Timer_overrideCCPOut(PWM_B_L_INST, DL_TIMER_FORCE_OUT_LOW, DL_TIMER_FORCE_CMPL_OUT_LOW, GPIO_PWM_B_L_C0_IDX);
+ //                DL_Timer_overrideCCPOut(PWM_B_L_INST, DL_TIMER_FORCE_OUT_LOW, DL_TIMER_FORCE_CMPL_OUT_LOW, GPIO_PWM_B_L_C0_IDX);
                   BikeLedCheck_L.uwBikeLight_PWM=0;
-                   DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, 0, GPIO_PWM_B_L_C0_IDX);//max=2304
+//                   DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, 0, GPIO_PWM_B_L_C0_IDX);//max=2304
                   // CLMPF++;
               }
               else
               {
+                  if(BikeLedCheck_L.blBike_LedSta==TRUE)
+                  {
                   if(BikeLedCheck_L.uwBike_OpenPreTime<=2)
                   {
                       BikeLedCheck_L.uwBike_OpenPreTime=2;
                       CMPF++;
-                      BikeLedCheck_L.uwBikeLight_PWM=691;//LIGHT_SECTPWM;
-                      DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, BikeLedCheck_L.uwBikeLight_PWM, GPIO_PWM_B_L_C0_IDX);//max=2304
+                      BikeLedCheck_L.uwBikeLight_PWM=LIGHT_SECTPWM;//LIGHT_SECTPWM;
+//                      DL_TimerG_setCaptureCompareValue(PWM_B_L_INST, BikeLedCheck_L.uwBikeLight_PWM, GPIO_PWM_B_L_C0_IDX);//max=2304
+                  }
                   }
-
 
               }
-          BikeLedCheck_L.blBike_LedCurErr=TRUE;
+             if(BikeLedCheck_L.blBike_LedSta==TRUE)
+                 BikeLedCheck_L.blBike_LedCurErr=TRUE;
 
         //  CHMPF++;
 
@@ -1614,20 +1628,7 @@ void TIMA1_IRQHandler(void) //void TMR1_BRK_OVF_TRG_HALL_IRQHandler(void)
 //                         }
 //                      }
 //                  }
-          if(( BikeLedGloFun.blBike_BackLedSta==TRUE) &&(BikeLedGloFun.blBike_BackLedStart==TRUE))
-          {
-              if( BikeLedGloFun.blBike_BackLedDetErr==TRUE)
 
-              {
-                  BikeLedGloFun.blBike_BackLedDetErr=FALSE;
-                  IO_BACKLED_ON();
-                  BikeLedGloFun.uwBike_BackLedDetErrTime++;
-                  if( BikeLedGloFun.uwBike_BackLedDetErrTime>=64)
-                  {
-                      BikeLedGloFun.blBike_BackLedStart=FALSE;
-                  }
-              }
-          }
 
             break;
 

+ 40 - 81
mspm0g3507.syscfg

@@ -15,13 +15,13 @@ const ADC122        = ADC12.addInstance();
 const Board         = scripting.addModule("/ti/driverlib/Board");
 const COMP          = scripting.addModule("/ti/driverlib/COMP", {}, false);
 const COMP1         = COMP.addInstance();
-const COMP2         = COMP.addInstance();
-const DAC12         = scripting.addModule("/ti/driverlib/DAC12");
 const GPIO          = scripting.addModule("/ti/driverlib/GPIO", {}, false);
 const GPIO1         = GPIO.addInstance();
 const GPIO2         = GPIO.addInstance();
 const GPIO3         = GPIO.addInstance();
 const GPIO4         = GPIO.addInstance();
+const GPIO5         = GPIO.addInstance();
+const GPIO6         = GPIO.addInstance();
 const MATHACL       = scripting.addModule("/ti/driverlib/MATHACL");
 const MCAN          = scripting.addModule("/ti/driverlib/MCAN", {}, false);
 const MCAN1         = MCAN.addInstance();
@@ -31,8 +31,6 @@ const OPA2          = OPA.addInstance();
 const PWM           = scripting.addModule("/ti/driverlib/PWM", {}, false);
 const PWM1          = PWM.addInstance();
 const PWM2          = PWM.addInstance();
-const PWM3          = PWM.addInstance();
-const PWM4          = PWM.addInstance();
 const SYSCTL        = scripting.addModule("/ti/driverlib/SYSCTL");
 const SYSTICK       = scripting.addModule("/ti/driverlib/SYSTICK");
 const TIMER         = scripting.addModule("/ti/driverlib/TIMER", {}, false);
@@ -96,13 +94,16 @@ ADC121.adcMem2chansel              = "DL_ADC12_INPUT_CHAN_12";
 ADC121.enabledInterrupts           = ["DL_ADC12_INTERRUPT_MEM1_RESULT_LOADED"];
 ADC121.endAdd                      = 4;
 ADC121.interruptPriority           = "2";
+ADC121.adcMem4chansel              = "DL_ADC12_INPUT_CHAN_1";
 ADC121.peripheral.$assign          = "ADC0";
 ADC121.peripheral.adcPin6.$assign  = "PB20";
 ADC121.peripheral.adcPin12.$assign = "PA14";
 ADC121.peripheral.adcPin0.$assign  = "PA27";
+ADC121.peripheral.adcPin1.$assign  = "PA26";
 ADC121.adcPin0Config.$name         = "ti_driverlib_gpio_GPIOPinGeneric16";
 ADC121.adcPin6Config.$name         = "ti_driverlib_gpio_GPIOPinGeneric9";
 ADC121.adcPin12Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric18";
+ADC121.adcPin1Config.$name         = "ti_driverlib_gpio_GPIOPinGeneric4";
 
 ADC122.$name                      = "ADC12_1";
 ADC122.adcMem0chansel             = "DL_ADC12_INPUT_CHAN_13";
@@ -116,18 +117,20 @@ ADC122.adcMem3chansel             = "DL_ADC12_INPUT_CHAN_4";
 ADC122.sampleTime0                = "0.25us";
 ADC122.adcMem0stime               = "DL_ADC12_SAMPLE_TIMER_SOURCE_SCOMP1";
 ADC122.sampleTime1                = "3us";
-ADC122.endAdd                     = 4;
 ADC122.adcMem4chansel             = "DL_ADC12_INPUT_CHAN_7";
-ADC122.adcMem4trig                = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
+ADC122.endAdd                     = 5;
+ADC122.adcMem5trig                = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
 ADC122.peripheral.$assign         = "ADC1";
 ADC122.peripheral.adcPin6.$assign = "PB19";
 ADC122.peripheral.adcPin5.$assign = "PB18";
 ADC122.peripheral.adcPin4.$assign = "PB17";
 ADC122.peripheral.adcPin7.$assign = "PA21";
+ADC122.peripheral.adcPin0.$assign = "PA15";
 ADC122.adcPin4Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric19";
 ADC122.adcPin5Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric0";
 ADC122.adcPin6Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric23";
 ADC122.adcPin7Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric22";
+ADC122.adcPin0Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric7";
 
 Board.peripheral.$assign = "DEBUGSS";
 
@@ -144,30 +147,8 @@ COMP1.setDACCode0                    = 0x99;
 COMP1.peripheral.compPinPos1.$assign = "PB24";
 COMP1.compPinPos1Config.$name        = "ti_driverlib_gpio_GPIOPinGeneric21";
 
-COMP2.$name                                        = "COMP_FLEDCHECK";
-COMP2.channelEnable                                = ["POS"];
-COMP2.vSource                                      = "DL_COMP_REF_SOURCE_VDDA_DAC";
-COMP2.terminalSelect                               = "DL_COMP_REF_TERMINAL_SELECT_NEG";
-COMP2.controlSelect                                = "DL_COMP_DAC_CONTROL_SW";
-COMP2.hysteresis                                   = "DL_COMP_HYSTERESIS_10";
-COMP2.setDACCode1                                  = 0x20;
-COMP2.enableOutputFilter                           = true;
-COMP2.setDACCode0                                  = 0xF;
-COMP2.enabledInterrupts                            = ["DL_COMP_INTERRUPT_OUTPUT_EDGE","DL_COMP_INTERRUPT_OUTPUT_EDGE_INV"];
-COMP2.interruptPriority                            = "1";
-COMP2.peripheral.$assign                           = "COMP0";
-COMP2.peripheral.compPinPos0.$assignAllowConflicts = "PA26";
-COMP2.compPinPos0Config.$name                      = "ti_driverlib_gpio_GPIOPinGeneric24";
-
-DAC12.dacOutputPinEn            = true;
-DAC12.dacOutput12               = 2048;
-DAC12.dacAmplifier              = "ON";
-DAC12.peripheral.$assign        = "DAC0";
-DAC12.peripheral.OutPin.$assign = "PA15";
-DAC12.OutPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric14";
-
 GPIO1.$name                          = "INPUT";
-GPIO1.associatedPins.create(2);
+GPIO1.associatedPins.create(4);
 GPIO1.associatedPins[0].$name        = "BREAK";
 GPIO1.associatedPins[0].direction    = "INPUT";
 GPIO1.associatedPins[0].assignedPort = "PORTA";
@@ -177,7 +158,18 @@ GPIO1.associatedPins[0].pin.$assign  = "PA28";
 GPIO1.associatedPins[1].direction    = "INPUT";
 GPIO1.associatedPins[1].assignedPort = "PORTA";
 GPIO1.associatedPins[1].assignedPin  = "9";
-GPIO1.associatedPins[1].$name        = "Cadence_in";
+GPIO1.associatedPins[1].$name        = "Cadence_Speed";
+GPIO1.associatedPins[1].pin.$assign  = "PA9";
+GPIO1.associatedPins[2].direction    = "INPUT";
+GPIO1.associatedPins[2].$name        = "Cadence_Dir";
+GPIO1.associatedPins[2].assignedPort = "PORTB";
+GPIO1.associatedPins[2].assignedPin  = "7";
+GPIO1.associatedPins[2].pin.$assign  = "PB7";
+GPIO1.associatedPins[3].$name        = "PIN_GEAR";
+GPIO1.associatedPins[3].direction    = "INPUT";
+GPIO1.associatedPins[3].assignedPort = "PORTB";
+GPIO1.associatedPins[3].assignedPin  = "15";
+GPIO1.associatedPins[3].pin.$assign  = "PB15";
 
 GPIO2.$name                               = "HALL";
 GPIO2.associatedPins.create(3);
@@ -206,27 +198,27 @@ GPIO2.associatedPins[2].pin.$assign       = "PB2";
 
 GPIO3.$name                          = "OUTPUT";
 GPIO3.associatedPins[0].$name        = "POWER_EN";
-GPIO3.associatedPins[0].assignedPort = "PORTA";
-GPIO3.associatedPins[0].assignedPin  = "23";
-GPIO3.associatedPins[0].pin.$assign  = "PA23";
+GPIO3.associatedPins[0].assignedPort = "PORTB";
+GPIO3.associatedPins[0].assignedPin  = "8";
+GPIO3.associatedPins[0].pin.$assign  = "PB8";
 
 GPIO4.$name                         = "LIGHT_DETECT";
-GPIO4.associatedPins.create(3);
-GPIO4.associatedPins[0].$name       = "BACK";
-GPIO4.associatedPins[0].interruptEn = true;
+GPIO4.associatedPins[0].$name       = "LEFT";
 GPIO4.associatedPins[0].direction   = "INPUT";
+GPIO4.associatedPins[0].interruptEn = true;
 GPIO4.associatedPins[0].polarity    = "RISE";
-GPIO4.associatedPins[0].pin.$assign = "PB15";
-GPIO4.associatedPins[1].$name       = "RIGHT";
-GPIO4.associatedPins[1].direction   = "INPUT";
-GPIO4.associatedPins[1].interruptEn = true;
-GPIO4.associatedPins[1].polarity    = "RISE";
-GPIO4.associatedPins[1].pin.$assign = "PB8";
-GPIO4.associatedPins[2].$name       = "LEFT";
-GPIO4.associatedPins[2].direction   = "INPUT";
-GPIO4.associatedPins[2].interruptEn = true;
-GPIO4.associatedPins[2].polarity    = "RISE";
-GPIO4.associatedPins[2].pin.$assign = "PA3";
+GPIO4.associatedPins[0].pin.$assign = "PA3";
+
+GPIO5.$name                       = "GPIO_BIKESPEED";
+GPIO5.associatedPins[0].$name     = "PIN_speed";
+GPIO5.associatedPins[0].direction = "INPUT";
+
+GPIO6.$name                         = "GPIO_B_LED";
+GPIO6.associatedPins.create(2);
+GPIO6.associatedPins[0].$name       = "PIN_EN";
+GPIO6.associatedPins[0].pin.$assign = "PB6";
+GPIO6.associatedPins[1].$name       = "PIN_SEL";
+GPIO6.associatedPins[1].pin.$assign = "PB16";
 
 MCAN1.$name                    = "MCAN0";
 MCAN1.desiredNomRate           = 250;
@@ -378,39 +370,6 @@ PWM2.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
 PWM2.ccp1PinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric28";
 PWM2.PWM_CHANNEL_1.$name                = "ti_driverlib_pwm_PWMTimerCC3";
 
-PWM3.timerCount                         = 2304;
-PWM3.pwmMode                            = "EDGE_ALIGN_UP";
-PWM3.$name                              = "PWM_B_L";
-PWM3.peripheral.$assignAllowConflicts   = "TIMG8";
-PWM3.peripheral.ccp0Pin.$assign         = "PB6";
-PWM3.peripheral.ccp1Pin.$assign         = "PB16";
-PWM3.PWM_CHANNEL_0.$name                = "ti_driverlib_pwm_PWMTimerCC1";
-PWM3.PWM_CHANNEL_1.$name                = "ti_driverlib_pwm_PWMTimerCC6";
-PWM3.ccp0PinConfig.direction            = scripting.forceWrite("OUTPUT");
-PWM3.ccp0PinConfig.hideOutputInversion  = scripting.forceWrite(false);
-PWM3.ccp0PinConfig.onlyInternalResistor = scripting.forceWrite(false);
-PWM3.ccp0PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
-PWM3.ccp0PinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric25";
-PWM3.ccp1PinConfig.direction            = scripting.forceWrite("OUTPUT");
-PWM3.ccp1PinConfig.hideOutputInversion  = scripting.forceWrite(false);
-PWM3.ccp1PinConfig.onlyInternalResistor = scripting.forceWrite(false);
-PWM3.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
-PWM3.ccp1PinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric26";
-
-PWM4.$name                              = "PWM_R";
-PWM4.ccIndex                            = [1];
-PWM4.clockDivider                       = 2;
-PWM4.timerCount                         = 2304;
-PWM4.pwmMode                            = "EDGE_ALIGN_UP";
-PWM4.peripheral.$assign                 = "TIMG12";
-PWM4.peripheral.ccp1Pin.$assign         = "PA31";
-PWM4.ccp1PinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric7";
-PWM4.ccp1PinConfig.direction            = scripting.forceWrite("OUTPUT");
-PWM4.ccp1PinConfig.hideOutputInversion  = scripting.forceWrite(false);
-PWM4.ccp1PinConfig.onlyInternalResistor = scripting.forceWrite(false);
-PWM4.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
-PWM4.PWM_CHANNEL_1.$name                = "ti_driverlib_pwm_PWMTimerCC4";
-
 SYSCTL.clockTreeEn           = true;
 SYSCTL.forceDefaultClkConfig = true;
 
@@ -467,4 +426,4 @@ scripting.suppress("Migrating requires going through the Switch Board or Device
 Board.peripheral.swclkPin.$suggestSolution   = "PA20";
 Board.peripheral.swdioPin.$suggestSolution   = "PA19";
 COMP1.peripheral.$suggestSolution            = "COMP1";
-GPIO1.associatedPins[1].pin.$suggestSolution = "PA9";
+GPIO5.associatedPins[0].pin.$suggestSolution = "PA31";

Some files were not shown because too many files changed in this diff