/** 声明,本程序仅供学习使用未经允许严谨用于商业行为违者必究
**----------------------------------项目信息------------------------------------
** 文件名称: drive.c
** 说 明:
**
**----------------------------------版本历史------------------------------------
** 版本号 修改者 完成日期 内容
** V1.0 一明九零 2023.04
**
*******************************************************************************/
#include "DIV_KEY.h"
uint8_t Alarm;
bit keyok=0;
bit keyup=0;
bit keydn=0;
bit keyec=0;
//按键处理
void KEY_Deal(void)
{
if(keyok==0)
{
if(Key_OK==0)
{
keyok=1;
Refresh=1;
gMenuType.Menu_FaNum++;
if(gMenuType.Menu_FaNum>10) //设置结束
{
gMenuType.Menu_FaNum=0;
}
}
}
if(keyup==0)
{
if(Key_UP==0)
{
keyup=1;
Refresh=1;
switch(gMenuType.Menu_FaNum) //设置界面
{
case 0:
{
Time.Year++;
if(Time.Year>99)
Time.Year=0;
}break;
case 1:
{
Time.Mon++;
if(Time.Mon>12)
Time.Day=1;
}break;
case 2:
{
Time.Day++;
if(Time.Day>31)
Time.Day=1;
}break;
case 3:
{
Time.Hour++;
if(Time.Hour>23)
Time.Hour=0;
}break;
case 4:
{
Time.Min++;
if(Time.Min>60)
Time.Min=0;
}break;
case 5: //闹钟设置
{
TimeAlarm.Year++;
if(TimeAlarm.Year>99)
TimeAlarm.Year=0;
}break;
case 6:
{
TimeAlarm.Mon++;
if(TimeAlarm.Mon>12)
TimeAlarm.Day=1;
}break;
case 7:
{
TimeAlarm.Day++;
if(TimeAlarm.Day>31)
TimeAlarm.Day=1;
}break;
case 8:
{
TimeAlarm.Hour++;
if(TimeAlarm.Hour>23)
TimeAlarm.Hour=0;
}break;
case 9:
{
TimeAlarm.Min++;
if(TimeAlarm.Min>60)
TimeAlarm.Min=0;
}break;
default:break;
}
}
}
if(keydn==0)
{
if(Key_DN==0)
{
keydn=1;
Refresh=1;
switch(gMenuType.Menu_FaNum) //设置界面
{
case 0:
{
Time.Year--;
if(Time.Year>99)
Time.Year=0;
}break;
case 1:
{
Time.Mon--;
if(Time.Mon>12)
Time.Day=1;
}break;
case 2:
{
Time.Day--;
if(Time.Day>31)
Time.Day=1;
}break;
case 3:
{
Time.Hour--;
if(Time.Hour>23)
Time.Hour=0;
}break;
case 4:
{
Time.Min--;
if(Time.Min>60)
Time.Min=0;
}break;
case 5: //闹钟设置
{
TimeAlarm.Year--;
if(TimeAlarm.Year>99)
TimeAlarm.Year=0;
}break;
case 6:
{
TimeAlarm.Mon--;
if(TimeAlarm.Mon>12)
TimeAlarm.Day=1;
}break;
case 7:
{
TimeAlarm.Day--;
if(TimeAlarm.Day>31)
TimeAlarm.Day=1;
}break;
case 8:
{
TimeAlarm.Hour--;
if(TimeAlarm.Hour>23)
TimeAlarm.Hour=0;
}break;
case 9:
{
TimeAlarm.Min--;
if(TimeAlarm.Min>60)
TimeAlarm.Min=0;
}break;
default:break;
}
}
}
if(keyec==0)
{
if(Key_EC==0)
{
keydn=1;
Refresh=1;
gMenuType.Menu_FaNum=0;
}
}
if(Key_OK==1)
keyok=0;
if(Key_UP==1)
keyup=0;
if(Key_DN==1)
keydn=0;
if(Key_EC==1)
keyec=0;
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 22 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/bfaec73c72014f8b848b329a16fc7aad_weixin_44252100.jpg!1)
一明九零
- 粉丝: 126
- 资源: 10
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)