⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskkey.c

📁 Keil单片机软件开发平台下的一个51系列单片机工程
💻 C
📖 第 1 页 / 共 3 页
字号:
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    DAk += temp16*KeyNumber;
                                }
                            }break;
                            case 7://设定Tb
                            {
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    Tb += temp16*KeyNumber;
                                }
                            }break;
                            case 8://设定Tk
                            {
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    Tk += temp16*KeyNumber;
                                }
                            }break;
                        }
                    }break;
                    case SET_PROGRAM_STEP:
                    {
                        switch(Deep0Focus)
                        {
                            case 1://设定模式
                            {
                                if(KeyNumber>0)
                                {
                                    Mode = KeyNumber*10 + KeyNumber;
                                }
                            }break;
                            case 2://Deep0Focus==2
                            {
                                if(Mode==77)//设定循环次数
                                {
                                    if(Deep1Focus!=255)
                                    {
                                        temp16=1;
                                        temp8 = Deep1Focus--;
                                        while(temp8>0)
                                        {
                                            temp8--;
                                            temp16*=10;
                                        }
                                        LoopTimes += (unsigned char)temp16*KeyNumber;
                                    }
                                }
                                else if(Mode==99)//设定充放电时的电流方向
                                {
                                    if(KeyNumber>0)
                                    {
                                        SetupCurrentDirection = 1;
                                    }
                                    else
                                    {
                                        SetupCurrentDirection = 0;
                                    }
                                }
                                else//设定电流
                                {
                                    if(Deep1Focus!=255)
                                    {
                                        temp16=1;
                                        temp8 = Deep1Focus--;
                                        while(temp8>0)
                                        {
                                            temp8--;
                                            temp16*=10;
                                        }
                                        SetupI += temp16*KeyNumber;
                                    }
                                }
                            }break;
                            case 3://设定电压
                            {
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    SetupU += temp16*KeyNumber;
                                }
                            }break;
                            case 4://设定跳转时间(小时)
                            {
                                if(Deep1Focus==1)
                                {
                                    JumpTimeM = KeyNumber;
                                    JumpTimeM*=600;
                                    Deep1Focus--;
                                }
                                else if(Deep1Focus==0)
                                {
                                    JumpTimeM += KeyNumber*60;
                                    Deep0Focus=5;
                                    Deep1Focus=1;
                                }
                            }break;
                            case 5://设定跳转时间(分钟)
                            {
                                if(Deep1Focus!=255)
                                {
                                    if(Deep1Focus==1)
                                    {
                                        JumpTimeM+=KeyNumber*10;
                                    }
                                    else if(Deep1Focus==0)
                                    {
                                        JumpTimeM+=KeyNumber;
                                    }
                                    Deep1Focus--;
                                }
                            }break;
                            case 6://设定跳转电压
                            {
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    JumpU += temp16*KeyNumber;
                                }
                            }break;
                            /*
                            case 7://设定记录时间(小时)
                            {
                                if(Deep1Focus==1)
                                {
                                    Deep1Focus--;
                                    IntervalTimeM = KeyNumber;
                                    IntervalTimeM*=600;
                                }
                                else if(Deep1Focus==0)
                                {
                                    IntervalTimeM += KeyNumber*60;
                                    Deep0Focus=8;
                                    Deep1Focus=1;
                                }
                            }break;
                            case 8://设定记录时间(分钟)
                            {
                                if(Deep1Focus!=255)
                                {
                                    if(Deep1Focus==1)
                                    {
                                        IntervalTimeM+=KeyNumber*10;
                                    }
                                    else if(Deep1Focus==0)
                                    {
                                        IntervalTimeM+=KeyNumber;
                                    }
                                    Deep1Focus--;
                                }
                            }break;
                            */
                            case 7://设定跳转容量
                            {
                                if(Deep1Focus!=255)
                                {
                                    temp16=1;
                                    temp8 = Deep1Focus--;
                                    while(temp8>0)
                                    {
                                        temp8--;
                                        temp16*=10;
                                    }
                                    JumpQ += temp16*KeyNumber;
                                }
                            }break;
                        }
                    }break;
                    case AFFIRM_RUN_OTHERS_STEP:
                    {
                        if(Deep1Focus!=255)
                        {
                            temp16=1;
                            temp8 = Deep1Focus--;
                            while(temp8>0)
                            {
                                temp8--;
                                temp16*=10;
                            }
                            Step += temp16*KeyNumber;
                            if(Step >= STEP_MAX)
                            {
                                Step = STEP_MAX-1;
                            }
                        }
                    }break;
                }
            }break;
            //////////////////////////////////////////////////////////////////////////////////////////////
            case KEY_LEFT:
            {
                switch(State)
                {
                    case STOP:
                    case RUN:
                    case POWER_DOWN:
                    case PAUSE:
                    case AFFIRM_SET_PROGRAM:
                    case SET_PROGRAM_NO:
                    case REFER_RECORD:
                    case AFFIRM_RUN:
                    case AFFIRM_STOP:
                    case AFFIRM_PAUSE:
                    case AFFIRM_RESTORE:
                    {
                    }break;
                    case AFFIRM_RUN_OTHERS_STEP:
                    {
                        Deep1Focus = 1;
                        Step = 0;
                    }break;
                    case SET_PARAMETER:
                    {
                        switch(Deep0Focus)
                        {
                            case 0:Deep1Focus=2;Address = 0;break;
                            case 1:Deep1Focus=4;Ib      = 0;break;
                            case 2:Deep1Focus=4;Ik      = 0;break;
                            case 3:Deep1Focus=4;Ub      = 0;break;
                            case 4:Deep1Focus=4;Uk      = 0;break;
                            case 5:Deep1Focus=4;DAb     = 0;break;
                            case 6:Deep1Focus=4;DAk     = 0;break;
                            case 7:Deep1Focus=4;Tb      = 0;break;
                            case 8:Deep1Focus=4;Tk      = 0;break;
                        }
                    }break;
                    case SET_PROGRAM_STEP:
                    {
                        switch(Deep0Focus)
                        {
                            case 1:break;
                            case 2:
                            {
                                if(Mode==77)
                                {
                                    Deep1Focus=2;
                                    LoopTimes=0;
                                }
                                else
                                {
                                    Deep1Focus=4;
                                    SetupI = 0;
                                }
                            }break;
                            case 3:Deep1Focus=3;SetupU = 0;break;
                            case 4:
                            case 5:Deep1Focus=1;JumpTimeM = 0;Deep0Focus=4;break;
                            case 6:Deep1Focus=3;JumpU = 0;break;
                            /*
                            case 7:
                            case 8:Deep1Focus=1;IntervalTimeM = 0;Deep0Focus=7;break;
                            */
                            case 7:Deep1Focus=4;JumpQ = 0;break;
                        }
                    }break;
                    case SET_RUN_START:
                    {
                        switch(Deep0Focus)
                        {
                            case 0:if(Deep1Focus<1)Deep1Focus++;break;
                            case 2:if(Deep1Focus<2)Deep1Focus++;break;
                        }
                    }break;
                }
            }break;
            //////////////////////////////////////////////////////////////////////////////////////////////
            case KEY_YES:
            {
                switch(State)
                {
                    case STOP:
                    case RUN:
                    case POWER_DOWN:
                    case PAUSE:
                    case REFER_RECORD:
                    {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -