Both_Way_Comm_SY8833/Project/Listings/hall.lst

258 lines
10 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.57.0.0 HALL 06/14/2024 11:08:36 PAGE 1
C51 COMPILER V9.57.0.0, COMPILATION OF MODULE HALL
OBJECT MODULE PLACED IN .\Objects\hall.obj
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE ..\UsrSrc\hall\hall.c ROM(COMPACT) OPTIMIZE(9,SIZE) BROWSE INCDIR(..\Usr
-Inc\adc;..\UsrInc\charger;..\UsrInc\discharge;..\UsrInc\gpio;..\UsrInc\hall;..\UsrInc\i2c_simu;..\UsrInc\inc;..\UsrInc\k
-ey;..\UsrInc\led;..\UsrInc\mtp;..\UsrInc\pwm;..\UsrInc\sleep;..\UsrInc\system;..\UsrInc\uart;..\UsrInc\userapp;..\UsrInc
-\vox;..\UsrInc\vox_comm;..\UsrInc\watchdog;..\UsrInc\bat;..\UsrInc\timer) DEBUG OBJECTEXTEND CODE PRINT(.\Listings\hall.
-lst) TABS(2) OBJECT(.\Objects\hall.obj)
line level source
1 /*
2 ******************************************************************************
3 *
4 * @file hall.c
5 * @brief hall module
6 *
7 *
8 * @version 1.0
9 * @date 2022/08/04 15:00:40
10 * @author Alex Xu
11 *
12 * Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd.
13 * All Rights Reserved
14 *
15 * History:
16 * Revision Date Author Desc
17 * 1.0.0 2022/08/04 Alex build this file
18 ******************************************************************************/
19 /*_____ I N C L U D E S ____________________________________________________*/
20 #include "hall.h"
21 #include "key.h"
22 #include "led.h"
23 #include "vox_module.h"
24 #include "userapp.h"
25 #include "charger_module.h"
26
27
28
29 /******************************************************************************\
30 Macro definitions
31 \******************************************************************************/
32
33 /******************************************************************************\
34 Variables definitions
35 \******************************************************************************/
36 uint8_t Hall_Sta_bk = 0xff;
37
38 CoverStatus_E CoverStatus;
39
40 bit CoverEvent_Flg = 0; //Hall<6C><6C><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>־λ
41 bit CoverEvent_Flg_led = 0;
42
43 #if KEY_HALL_ENABLE
44
45 /******************************************************************************\
46 Functions definitions
47 \******************************************************************************/
48
49 /*
50 *******************************************************************************
51 * void Hall_Init(void)
C51 COMPILER V9.57.0.0 HALL 06/14/2024 11:08:36 PAGE 2
52 *
53 * Description : Hall Initialization
54 *
55 * Arguments :
56
57 * Returns :
58
59 * Notes :
60 *
61 *******************************************************************************
62 */
63 #if 0
void Hall_Init(void)
{
while ( !(CHIP_STA0 & 0x10) ); //Hall analog first detection complete status,hall flag valid only after
-this bit sets.
if(CHIP_STA0 & 0x08) //<2F><>ȡHALL<4C><4C>ʼ״̬
{
#if HALL_OPEN_LEV_SET
CoverStatus = CLOSE;
#else
CoverStatus = OPEN;
#endif
}
else
{
#if HALL_OPEN_LEV_SET
CoverStatus = OPEN;
#else
CoverStatus = CLOSE;
#endif
}
//Hall_Sta_bk = (CHIP_STA0 & 0x08);
}
#endif
90 /*
91 *******************************************************************************
92 * void Hall_Handle(void)
93 *
94 * Description : Hall Handle --- <20><>ѭ<EFBFBD><D1AD><EFBFBD>е<EFBFBD><D0B5>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10ms<6D><73>CoverStatus --- <20><><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>״̬<D7B4><CCAC>
95 *
96 * Arguments : NONE
97
98 * Returns : NONE
99
100 * Notes : NONE
101 *
102 *******************************************************************************
103 */
104
105 void Hall_Handler(void)
106 {
107 1 uint8_t Hall_Sta = 0;
108 1 if( CHIP_STA0 & 0x10 )
109 1 {
110 2 Hall_Sta = CHIP_STA0 & 0x08;
111 2 if( Hall_Sta != Hall_Sta_bk)
112 2 {
C51 COMPILER V9.57.0.0 HALL 06/14/2024 11:08:36 PAGE 3
113 3 if(CHIP_STA0 & 0x08) //Hall <20>ߵ<EFBFBD>ƽ
114 3 {
115 4 //P10 = 1;
116 4 #if HALL_OPEN_LEV_SET
117 4 CoverStatus = OPEN;
118 4 #else
CoverStatus = CLOSE;
led_blink_1time_flag = 0;
#endif
122 4
123 4 #ifdef _DEBUG_HALL
#if HALL_OPEN_LEV_SET
printf("Open Hall Status:0x%x,sta0:0x%x\r\n",(uint16_t)CoverStatus,(uint16_t)CHIP_STA0);
#else
printf("Close Hall Status:0x%x\r\n",(uint16_t)CoverStatus);
#endif
#endif
132 4 }
133 3 else
134 3 {
135 4 //P10 = 0;
136 4 #if HALL_OPEN_LEV_SET
137 4 CoverStatus = CLOSE;
138 4 led_blink_1time_flag = 0;
139 4 #else
CoverStatus = OPEN;
#endif
142 4
143 4 #ifdef _DEBUG_HALL
#if HALL_OPEN_LEV_SET
printf("Close Hall Status:0x%x,sta0:0x%x\r\n",(uint16_t)CoverStatus,(uint16_t)CHIP_STA0);
#else
printf("Open Hall Status:0x%x\r\n",(uint16_t)CoverStatus);
#endif
#endif
152 4 }
153 3
154 3 CoverEvent_Flg = 1;
155 3 CoverEvent_Flg_led = 1;
156 3 LED_On_Timer = 0;
157 3 //LED_On_Timer1 = 0;
158 3 Vox_TX_Timer = 0;
159 3 Hall_Sta_bk = Hall_Sta;
160 3 }
161 2 }
162 1 }
163
164 #endif
165
C51 COMPILER V9.57.0.0 HALL 06/14/2024 11:08:36 PAGE 4
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION Hall_Handler (BEGIN)
; SOURCE LINE # 105
; SOURCE LINE # 106
; SOURCE LINE # 107
;---- Variable 'Hall_Sta' assigned to Register 'R7' ----
; SOURCE LINE # 108
0000 E5E2 MOV A,CHIP_STA0
0002 30E425 JNB ACC.4,?C0005
; SOURCE LINE # 109
; SOURCE LINE # 110
0005 E5E2 MOV A,CHIP_STA0
0007 5408 ANL A,#08H
0009 FF MOV R7,A
; SOURCE LINE # 111
000A 6500 R XRL A,Hall_Sta_bk
000C 601C JZ ?C0005
; SOURCE LINE # 112
; SOURCE LINE # 113
000E E5E2 MOV A,CHIP_STA0
0010 30E305 JNB ACC.3,?C0003
; SOURCE LINE # 114
; SOURCE LINE # 117
0013 750001 R MOV CoverStatus,#01H
; SOURCE LINE # 132
0016 8005 SJMP ?C0004
0018 ?C0003:
; SOURCE LINE # 134
; SOURCE LINE # 137
0018 E4 CLR A
0019 F500 R MOV CoverStatus,A
; SOURCE LINE # 138
001B C200 E CLR led_blink_1time_flag
; SOURCE LINE # 152
001D ?C0004:
; SOURCE LINE # 154
001D D200 R SETB CoverEvent_Flg
; SOURCE LINE # 155
001F D200 R SETB CoverEvent_Flg_led
; SOURCE LINE # 156
0021 E4 CLR A
0022 F500 E MOV LED_On_Timer,A
; SOURCE LINE # 158
0024 F500 E MOV Vox_TX_Timer,A
0026 F500 E MOV Vox_TX_Timer+01H,A
; SOURCE LINE # 159
0028 8F00 R MOV Hall_Sta_bk,R7
; SOURCE LINE # 160
; SOURCE LINE # 161
; SOURCE LINE # 162
002A ?C0005:
002A 22 RET
; FUNCTION Hall_Handler (END)
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 43 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
C51 COMPILER V9.57.0.0 HALL 06/14/2024 11:08:36 PAGE 5
PDATA SIZE = ---- ----
DATA SIZE = 2 ----
IDATA SIZE = ---- ----
BIT SIZE = 2 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)