ZDBMS/output/KeyApp.lst

131 lines
5.9 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

C51 COMPILER V9.01 KEYAPP 02/22/2025 15:36:21 PAGE 1
C51 COMPILER V9.01, COMPILATION OF MODULE KEYAPP
OBJECT MODULE PLACED IN .\output\KeyApp.obj
COMPILER INVOKED BY: D:\Tool\Keil\C51\BIN\C51.EXE code_app\KeyApp.c LARGE OPTIMIZE(7,SIZE) REGFILE(.\output\MCUCore_Load
-.ORC) BROWSE INTVECTOR(0X1000) INCDIR(.\header_app;.\header_drv;.\code_gasguage;.\code_classb\iec60730_lib\include;.\cod
-e_classb\iec60730_proc\Include;.\code_classb\config) DEBUG OBJECTEXTEND PRINT(.\output\KeyApp.lst) OBJECT(.\output\KeyAp
-p.obj)
line level source
1 /********************************************************************************
2 Copyright (C), Sinowealth Electronic. Ltd.
3 Author: Sino
4 Version: V0.0
5 Date: 2020/04/26
6 History:
7 V2.0 2020/04/26 Preliminary
8 ********************************************************************************/
9 #include "Main.h"
10
11
12 U8 xdata ucDsgingSpeed;
13
14 /*************************************************************************************************
15 * 函数名: KeySwitchSpeed
16 * 参 数: 无
17 * 返回值: 无
18 * 描 述: 按键调速,分为三挡
19 *************************************************************************************************/
20 void KeySwitchSpeed(void)
21 {
22 1 bSlowDischarge = 0;
23 1 bMidDischarge = 0;
24 1 bFastDischarge = 0;
25 1 if(bDSGING)
26 1 {
27 2 if(ucDsgingSpeed == 0)
28 2 {
29 3 ucDsgingSpeed = 1;
30 3 bMidDischarge = 1;
31 3 McuPWM2Set(E2uiDSG1PWMFreq ,E2ucDSG1PWMRatioH);
32 3 McuPWM2En();
33 3 }
34 2 else if(ucDsgingSpeed == 1)
35 2 {
36 3 ucDsgingSpeed = 2;
37 3 bFastDischarge = 1;
38 3 McuPWM2Set(E2uiDSG1PWMFreq, 100);
39 3 McuPWM2En();
40 3 }
41 2 else
42 2 {
43 3 ucDsgingSpeed = 0;
44 3 bSlowDischarge = 1;
45 3 McuPWM2Set(E2uiDSG1PWMFreq ,E2ucDSG1PWMRatioL);
46 3 McuPWM2En();
47 3 }
48 2 }
49 1 else
50 1 {
51 2 bSlowDischarge = 0;
52 2 bMidDischarge = 0;
C51 COMPILER V9.01 KEYAPP 02/22/2025 15:36:21 PAGE 2
53 2 bFastDischarge = 0;
54 2 }
55 1 }
56
57
58 /*************************************************************************************************
59 * 函数名: KeyProcess
60 * 参 数: 无
61 * 返回值: 无
62 * 描 述: 当检测到有效按键后,处理对应按键
63 *************************************************************************************************/
64 void KeyProcess(void)
65 {
66 1 if(bKeyFlg)
67 1 {
68 2 bKeyFlg = 0; //同一按键一直被按下,如果持续的时间足够长,则会先触发长按,
-后触发长按持续,但目前我们没有用到长按持续状态
69 2 switch(ucKeyValue)
70 2 {
71 3 case KEY_ON_S:
72 3 KeySwitchSpeed();
73 3 break;
74 3
75 3 case KEY_LED_S:
76 3 bLedDisFlg = 1;
77 3 ucLedTimeCnt = 0;
78 3 break;
79 3
80 3 case KEY_LED_L: //长按LED进PD模式
81 3 bPDFlg = 1;
82 3 break;
83 3
84 3 case KEY_ON_L: //长按唤醒按键2S蓝牙电源开启/关闭
85 3 bLedDisBleFlg = ~bLedDisBleFlg;
86 3 if(bLedDisBleFlg)
87 3 {
88 4 BlueToothPowerEn();
89 4 }
90 3 else
91 3 {
92 4 BlueToothPowerDis();
93 4 }
94 3 break;
95 3
96 3 default:
97 3 break;
98 3 }
99 2 }
100 1 }
101
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 150 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 1 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)