yincheng.zhong
2023-05-22 55ab0cb67d97aea4c29fa02b6ef85afe645a2deb
Src/main.c
@@ -167,14 +167,14 @@
            
            if(motor5s_state)
            {
                if(motor5s_timer>4)
                if(motor5s_timer>2)
                {
                    motor5s_timer = 0;
                    motor5s_state = 0;
                    JianXieMotorProcess();
                }
            }else{           
                if(motor5s_timer>300)
                if(motor5s_timer>30)
                {
                    motor5s_timer = 0;
                    motor5s_state = 1;
@@ -182,10 +182,10 @@
                } 
            }
        }else{
            if(outside_count>3)
            if(outside_count>3&&motor5s_state)
            {
                motor5s_state = 0;
                motor5s_timer = 900;
                motor5s_timer = 0;
            }                
        }
    }else{
@@ -315,7 +315,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)|9;
   g_com_map[VERSION] = (2<<8)|11;
    
//   g_com_map[DEV_ID]=0x7;
#ifdef DEBUG_MODE
@@ -972,6 +972,7 @@
    tagslotpos = current_slotpos%200;
    flag_tagnewpos = 0;
}
uint16_t motorkeeptime_u16,last_motorkeep;
float lptimedelay=0;
void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim)
{
@@ -1003,6 +1004,12 @@
   if(motor_keeptime>0)
   {   
        motor_keeptime-=lptimedelay;
        motorkeeptime_u16 = motor_keeptime;
        if(motorkeeptime_u16%3==0&&motorkeeptime_u16!=last_motorkeep)
        {
            last_motorkeep=motorkeeptime_u16;
            JianXieMotorProcess();
        }
   }
    if(motor_keeptime<0)
    {motor_keeptime = 0;}