Ye Jin 6 달 전
부모
커밋
d5f3d2f11e

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

@@ -19,6 +19,7 @@
 #include "FSM_1st.h"
 #include "can.h"
 #include "canAppl.h"
+#include "giant_can.h"
 #include "syspar.h"
 #include "torquesensor.h"
 #include "bikelight.h"
@@ -347,7 +348,8 @@ void Event_10ms(void)
 
         // Trip cal when open
         bikespeed_votempTripCal();
-    }        
+    }
+    giant_10msTask();
 }
 
 void  Event_20ms(void)

+ 1 - 0
User project/3.BasicFunction/Include/giant_can.h

@@ -105,6 +105,7 @@ extern GiantControlParams_Struct_t stGiantControlParams;
  *          Function  Definations
  *
  ***************************************/
+void giant_10msTask(void);
 void giant_DataProcess(void);
 void giant_SendDriveChainPassiveData(UBYTE remoteMG, UBYTE DataAddr);
 void giant_SendDriveChainActiveData(UBYTE functiongroup, UBYTE dataaddr);

+ 2 - 2
User project/3.BasicFunction/Source/canAppl.c

@@ -239,8 +239,8 @@ void Can_voInitMC_Run(void)
     memcpy((uint8_t*)(MC_VerInfo.HW_Version + 12), (uint8_t*)(&MCU_ID_CRC32), 4);
     
     // Software version
-    char chFwVersion[16]="V1r0r4_";
-    strncat(chFwVersion,COMMIT_TIME,9);
+    char chFwVersion[16]="V1r0r4__";
+    strncat(chFwVersion,COMMIT_TIME,8);
     strncpy(MC_VerInfo.FW_Version, (char *)chFwVersion, 16);
     
     // Firmware Special Info

+ 6 - 3
User project/3.BasicFunction/Source/giant_can.c

@@ -21,6 +21,7 @@
 #include "adc.h"
 #include "power.h"
 #include "CodePara.h"
+#include "flash_master.h"
 /******************************
  *
  *  Parameter
@@ -202,7 +203,7 @@ void giant_DataProcess(void)
                     }
                     case 0x3:
                     {
-                        if(pRxMsg2->rx_dlen == 8)//cmd3
+                        if(pRxMsg2->rx_dlen == 7)//cmd3
                         {
                             stGiantControlParams.SpeedLimitation = (UWORD)(pRxMsg2->rx_data[5] + (pRxMsg2->rx_data[6]<<8));//speed limitation,0.01km/h
 //                            if(0 == stGiantControlParams.SpeedLimitation)
@@ -247,7 +248,9 @@ void giant_DataProcess(void)
                     {
                         if(pRxMsg2->rx_dlen == 8)//Customized Version
                         {
-                            
+                            memcpy(MC_RsASSCII.CustomASCII1, pRxMsg2->rx_data, 8);
+                            //执行存储操作
+                            memcpy(flash_stPara.ubRsASSCII.CustomASCII1, MC_RsASSCII.CustomASCII1, sizeof(MC_RsASSCII.CustomASCII1));
                         }
                         break;
                     }
@@ -366,7 +369,7 @@ void giant_SendDriveChainPassiveData(UBYTE remoteMG, UBYTE DataAddr)
         }
         case 0x5:
         {
-            //memcpy(data, MC_VerInfo., 8);//Customized Version
+            memcpy(data, MC_RsASSCII.CustomASCII1, 8);//Customized Version
             break;
         }
         case 0xB:

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

@@ -47,7 +47,7 @@ Update Time
 #define MOTOR_WELLING_CITY_48V 0x30
 #define MOTOR_WELLING_MTB_48V  0x31
 
-#define MOTOR_ID_SEL      MOTOR_WELLING_MTB_36V
+#define MOTOR_ID_SEL      MOTOR_WELLING_CITY_36V
 #define GEARSENSOR_ENABLE 1 // 0-Uart,1-GearSensor
 
 // #define TEST  //only use for testing