WXK
2025-01-22 1dcc8f022ebbcd6422bae262a8b1debf77fa954a
Src/main.c
@@ -135,10 +135,22 @@
    
      if(motor_keeptime>0)
      {
         motor_state = 2;
      }else{
         motor_state = 0;
//         motor_state = 2;
            if(hardware_type==NSH1)
            {MOTOR_ON;
            }else if(hardware_type==GP)
            {
            HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);
            }
      }
        else{
//         motor_state = 0;
//            if(hardware_type==NSH1)
//            {MOTOR_OFF;
//            }else if(hardware_type==GP)
//            {
//            HAL_TIM_PWM_Stop(&htim2, TIM_CHANNEL_3);
//            }
      //motor_state=2;
   switch(motor_state)
      {case 0:
@@ -184,6 +196,7 @@
            }   
         break;   
   }
            }
}
    bat_percent=Get_Battary();
   if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin))
@@ -288,7 +301,7 @@
   hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2);
   hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4);
   //deca_sleep(1000);
   g_com_map[VERSION] = (2<<8)|52;
   g_com_map[VERSION] = (2<<8)|63;
    
//   g_com_map[DEV_ID]=0x7;
#ifdef DEBUG_MODE
@@ -369,7 +382,7 @@
   {
         g_com_map[MOTORBEEPER_INDEX] = 1;
   }
   hardware_type   = g_com_map[MOTORBEEPER_INDEX];
   hardware_type   = /*NSH1;//*/g_com_map[MOTORBEEPER_INDEX];
   switch(hardware_type)
      {
        case 1:     
@@ -480,14 +493,14 @@
//      {
//      MODBUS_Poll();
//      }
if(m_bEUARTTxEn==0&&(motor_state==0||motor_state==3))
if(m_bEUARTTxEn==0&&(motor_state==0||motor_state==3)&&motor_keeptime==0)
         {   
#ifndef DEBUG_MODE   
            if(!HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin))
            HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);  
#endif
         }
      if(g_start_send_flag&&active_flag&&uwb_active_flag)
      if(g_start_send_flag&&active_flag/*&&uwb_active_flag*/)
   { static uint16_t blink_count=0;
      g_start_send_flag = 0;   
   //   GetPressAndTemp();