Ver Fonte

工具功能核对完成
V7.4.0.6

yidongFan há 1 mês atrás
pai
commit
1adb76be15

+ 1 - 1
BoardInterface/onechip_load_inf.h

@@ -8,7 +8,7 @@
 #define SOFT_VERSION_1  7	//软件版本号
 #define SOFT_VERSION_2  4	//软件版本号
 #define SOFT_VERSION_3  0	//软件版本号
-#define SOFT_VERSION_4  5	//软件版本号
+#define SOFT_VERSION_4  6	//软件版本号
 
 
 

+ 2 - 0
Core/Src/main.c

@@ -171,6 +171,7 @@ int main(void)
   MX_TIM2_Init();
   MX_TIM3_Init();
   MX_TIM4_Init();
+  MX_IWDG_Init();
   /* USER CODE BEGIN 2 */
 	/* 启动定时器2的中断模式 */
 	
@@ -262,6 +263,7 @@ int main(void)
 			WIFI_process();
 		}
 		if(	sysinf.s1_flag == 1){
+      Refresh_IWDG();
 			sysinf.s1_flag = 0;
 			HAL_GPIO_TogglePin((GPIO_TypeDef *)sysinf.run_led_port, sysinf.run_led_pin); /*green*/      
       update_work();

+ 24 - 7
DriverInterface/communication.c

@@ -232,7 +232,8 @@ void char_replace(unsigned char *str, int size, unsigned char ch, unsigned char
  ********************************************************************/
 int wifi_action(unsigned char cmd, unsigned char *parg)
 {
-
+    parg[WIFI_AP_NAME_MAX_LEN+WIFI_AP_PWD_MAX_LEN-1]=0;
+    parg[WIFI_AP_NAME_MAX_LEN-1]=0;
     strcpy(sysinf.wifiname, (const char *)parg);
 	strcpy(sysinf.password, (const char *)(parg + WIFI_AP_NAME_MAX_LEN));
     // wifi用户名和密码设置
@@ -300,9 +301,9 @@ int SN_action(unsigned char cmd, unsigned char *parg)
  *--------------------------------------------------------------------
  *记录:
  ********************************************************************/
-int seq_selftest_action(unsigned char cmd, unsigned char *parg)
+int default_action(unsigned char cmd, unsigned char *parg)
 {
-    return 0;
+    return 1;
 }
 
 /********************************************************************
@@ -385,6 +386,14 @@ int setState_response(CmdMessage *pMsg, unsigned char result)
     return 0;
 }
 
+int swtichWifi_response(CmdMessage *pMsg, unsigned char result)
+{
+//    char result = 1;
+    data_send_to_pc(PC_CMD_SWITCHWIFI, (char *)&result, 1);
+    sysinf.pc_channel_recv  = PC_CONNECT_TYPE_NULL;
+    return 0;
+}
+
 
 int ans_response(CmdMessage *pMsg, unsigned char result)
 {	
@@ -663,6 +672,12 @@ const struct PCActionPack mPCActionPack[] =
             .response = setState_response,
             .datalen = 0xff,
         },
+        {
+            .cmd = PC_CMD_SWITCHWIFI,
+            .action = default_action,
+            .response = swtichWifi_response,
+            .datalen = 0xff,
+        },
 
         {
             .cmd = PC_CMD_SETRUNTEMP,
@@ -718,14 +733,14 @@ void query_pc_cmd(CmdMessage *pMsg)
     {
         if (mPCActionPack[i].cmd == pMsg->cmd && (mPCActionPack[i].datalen == pMsg->len || mPCActionPack[i].datalen == 0xff)) //防止接收到其他设备的数据帧
         {
-            if(pc_send_cmd == mPCActionPack[i].cmd)
-                pc_send_wait = 0;
+            // if(pc_send_cmd == mPCActionPack[i].cmd)
+            //     pc_send_wait = 0;
+            Van_Device_Printf(VAN_LOG_COMM,"\n<-- pc cmd %x %d \n", pMsg->cmd, pMsg->seq);
             if(mPCActionPack[i].cmd != 1)
             {
             	pc_resend_del(pMsg->seq);
-                Van_Device_Printf(VAN_LOG_INFO,"\n<-- pc cmd %x %d \n", pMsg->cmd, pMsg->seq);
             }
-						pMsg->data[pMsg->len] = 0;
+			pMsg->data[pMsg->len] = 0;
             unsigned char ret = mPCActionPack[i].action(mPCActionPack[i].cmd, (unsigned char *)pMsg->data);
             if (mPCActionPack[i].response)
             {
@@ -951,6 +966,8 @@ void deal_mUnion_cmd(CmdMessage *pMsg)
 	{
 		if (mUnionActionPack[i].cmd == pMsg->cmd ) 
 		{			
+            
+            Van_Device_Printf(VAN_LOG_COMM,"\n<-- pc cmd %x %d \n", pMsg->cmd, pMsg->seq);
 			uint8_t ret = mUnionActionPack[i].action( pMsg->cmd,(uint8_t *)pMsg);
 			if (mUnionActionPack[i].response)
 			{

+ 1 - 0
DriverInterface/communication.h

@@ -39,6 +39,7 @@ typedef  enum
 	PC_CMD_STARTUPDATE = 0x20,/*开始升级*/
 	PC_CMD_UPDATEINFO = 0x21,/*升级包信息*/	
 	PC_CMD_UPDATEDATA = 0x22,/*升级数据*/
+	PC_CMD_SWITCHWIFI = 0x28,/*通信走wifi*/
 	
 	UINON_CMD_TEMP_ADJ = 0x40, /*校准参数*/
 	UINON_CMD_TEMP_PID = 0x41, /*PID参数*/

+ 2 - 0
DriverInterface/rgb381.c

@@ -216,6 +216,8 @@ void SensorEnable(void)
 
 uint8_t SensorInit(ColorSensor *CS)
 {
+	
+     Refresh_IWDG();
 	if(SensorGetID(CS->ID)==0xC2)// device id is 0xC2
 	{
 		SensorEnable();

+ 11 - 4
DriverInterface/state_mini.c

@@ -351,7 +351,8 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
              updateAmplifState(SYS_STATE_READY); 
         	/*************lxx-add-20232.11.30****************/
             if (SensorSelfCheckPass()==0)
-        	{
+        	{   
+                updateAmplifState(SYS_STATE_ERROR_HW); 
                 error_set(ERROR_SENSOR_SELF_CHECK);
         	}
         }
@@ -365,6 +366,7 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
         	}
         	sysinf.heaterMaster.HeatState = SystemPreHeat;
             sysinf.heaterMaster.temp_stable_sta = 0;
+            updateAmplifState(SYS_STATE_READY); 
 
         }
 
@@ -393,8 +395,9 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
              updateAmplifState(SYS_STATE_CHECK); 
         }
 		if((sysinf.skip_CheckOrRun & SKIP_SCANQRCODE)){
-	            sts->statusword |= SW_Chip_Id;
-	            sts->state = SW_Chip_Id;
+	         sts->statusword |= SW_Chip_Id;
+	         sts->state = SW_Chip_Id;
+             updateAmplifState(SYS_STATE_CHECK); 
 		}
         break;
     }
@@ -405,7 +408,10 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
         {
 			HAL_Delay(1000);/*插卡后延时1s检测*/
 			if(!(sysinf.skip_CheckOrRun & SKIP_CHECK_CARDINSERT)){
-				if(check_first_zero() == 1)break;
+				if(check_first_zero() == 1){                    
+                    updateAmplifState(SYS_STATE_ERROR_HW); 
+                    break;
+                }
 			}
 			{				
 	            sts->controlword = Qrcode_publish_cmd;
@@ -429,6 +435,7 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
     // 采样,30min定时
     case SW_Sample_timeout:
     {
+        if(!(sysinf.skip_CheckOrRun & SKIP_CHECK_CARDREMOVE))
          if (TrigStateCheck() == CardOFF){            
             error_set(ERROR_SAMP_MOVE_CARD);
             updateAmplifState(SYS_STATE_ERROR_HM);

+ 5 - 6
DriverInterface/usr_lysis.c

@@ -49,9 +49,6 @@ uint32_t Read_Tupe(void) {
   return (HAL_GPIO_ReadPin(MINI7_V2_TUBE_SW_GPIO_Port,MINI7_V2_TUBE_SW_Pin)) ? 0 : 1; // 检查PF5引脚值
 }
 
-
-
-
 void updatParm_lysis(void) {
 	sysinf.lysis.offset = sysinf.lysis_offset;
 	sysinf.lysis.overHeat = sysinf.lysis_overHeat;
@@ -62,7 +59,6 @@ void updatParm_lysis(void) {
 }
 
 
-
 /**
  * @brief	   Motor_Init
  *
@@ -192,6 +188,8 @@ uint32_t lysis_work(void) {
 	error_set(ERROR_TEMPSENSOR_EER);		
 	updateLysisState(SYS_STATE_ERROR_HW);
 	ptherm->thermostat_st = THERMOSTAT_ERROR;
+	ptherm->firstin = true;
+	Close_therm(0);
   }
   ptherm->pid.realtemp = temp + ptherm->offset;
   switch(ptherm->thermostat_st){
@@ -202,7 +200,9 @@ uint32_t lysis_work(void) {
 			ptherm->firstin = false;
 			updateLysisState(SYS_STATE_PREPARE);sysinf.lysisState = SYS_STATE_PREPARE; 
 			firstTemp = getADC_Chanel_value(1);
-			set_lysis(firstTemp+30);
+			set_lysis(95);				
+   			ptherm->pid.goal = 95;	
+    		ptherm->worktime = 3000;
 			last10ms = conter10ms;				
 		}else{
 			float heattemp = getADC_Chanel_value(1); 
@@ -211,7 +211,6 @@ uint32_t lysis_work(void) {
 					ptherm->firstin = true;
 					ptherm->pid_st = PID_IDLE;
 			  }
-
 			if((conter10ms-last10ms)> HEAT_TEST_TIME){
 				/*超时判断*/
 				ptherm->thermostat_st = THERMOSTAT_ERROR;

Diff do ficheiro suprimidas por serem muito extensas
+ 6 - 7
MDK-ARM/mini7_V2.uvguix.Administrator


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff