C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 1 C51 COMPILER V9.60.7.0, COMPILATION OF MODULE MAIN OBJECT MODULE PLACED IN .\Objects\main.obj COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE Src\main.c OMF2 OPTIMIZE(8,SPEED) BROWSE INCDIR(.\Src;.\Task;.\Task\cpu_por -t\S92F8003A;.\Task\cfg;.\Task\pt_thread;.\SC92F8003_Lib\Inc) DEBUG CODE LISTINCLUDE SYMBOLS PRINT(.\Listings\main.lst) P -REPRINT(.\Listings\main.i) OBJECT(.\Objects\main.obj) line level source 1 2 #include "main.h" 1 =1 #ifndef _MAIN_H_ 2 =1 #define _MAIN_H_ 3 =1 4 =1 #include "task.h" 1 =2 #ifndef _TASK_H_ 2 =2 #define _TASK_H_ 3 =2 4 =2 #include "cfg/al_helper.h" 1 =3 /* 2 =3 * taskdef.h 3 =3 * 4 =3 * Created on: 2023-4-20 5 =3 * Author: xukaiming 6 =3 */ 7 =3 8 =3 #ifndef _AL_HELPER_H_ 9 =3 #define _AL_HELPER_H_ 10 =3 11 =3 #ifdef __cplusplus =3 extern "C" { =3 #endif 14 =3 15 =3 #define AL_STATIC 16 =3 17 =3 18 =3 #ifdef __cplusplus =3 } =3 #endif 21 =3 22 =3 #endif 23 =3 5 =2 #include "cfg/task_cfg.h" 1 =3 /* 2 =3 * taskdef.h 3 =3 * 4 =3 * Created on: 2023-4-20 5 =3 * Author: xukaiming 6 =3 */ 7 =3 8 =3 #ifndef _TASK_CFG_H_ 9 =3 #define _TASK_CFG_H_ 10 =3 11 =3 #ifdef __cplusplus =3 extern "C" { =3 #endif 14 =3 15 =3 #define AL_STATIC 16 =3 17 =3 18 =3 #define TASK_NAME_LEN 16 19 =3 #define MAX_TIMER 5 // the number of timer can be used C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 2 20 =3 #define TICK_PER_S 1000 //1S中打点1000次 21 =3 22 =3 23 =3 24 =3 25 =3 #ifdef __cplusplus =3 } =3 #endif 28 =3 29 =3 #endif 30 =3 6 =2 #include "task_hal.h" 1 =3 #ifndef _TASK_HAL_H_ 2 =3 #define _TASK_HAL_H_ 3 =3 4 =3 5 =3 #include "intrins.h" 1 =4 /*-------------------------------------------------------------------------- 2 =4 INTRINS.H 3 =4 4 =4 Intrinsic functions for C51. 5 =4 Copyright (c) 1988-2010 Keil Elektronik GmbH and ARM Germany GmbH 6 =4 All rights reserved. 7 =4 --------------------------------------------------------------------------*/ 8 =4 9 =4 #ifndef __INTRINS_H__ 10 =4 #define __INTRINS_H__ 11 =4 12 =4 #pragma SAVE 13 =4 14 =4 #if defined (__CX2__) =4 #pragma FUNCTIONS(STATIC) =4 /* intrinsic functions are reentrant, but need static attribute */ =4 #endif 18 =4 19 =4 extern void _nop_ (void); 20 =4 extern bit _testbit_ (bit); 21 =4 extern unsigned char _cror_ (unsigned char, unsigned char); 22 =4 extern unsigned int _iror_ (unsigned int, unsigned char); 23 =4 extern unsigned long _lror_ (unsigned long, unsigned char); 24 =4 extern unsigned char _crol_ (unsigned char, unsigned char); 25 =4 extern unsigned int _irol_ (unsigned int, unsigned char); 26 =4 extern unsigned long _lrol_ (unsigned long, unsigned char); 27 =4 extern unsigned char _chkfloat_(float); 28 =4 #if defined (__CX2__) =4 extern int abs (int); =4 extern void _illop_ (void); =4 #endif 32 =4 #if !defined (__CX2__) 33 =4 extern void _push_ (unsigned char _sfr); 34 =4 extern void _pop_ (unsigned char _sfr); 35 =4 #endif 36 =4 37 =4 #pragma RESTORE 38 =4 39 =4 #endif 40 =4 6 =3 #include "task_hal_cfg.h" 1 =4 #ifndef _TASK_HAL_CFG_H_ 2 =4 #define _TASK_HAL_CFG_H_ 3 =4 4 =4 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 3 5 =4 #include 1 =5 #ifndef _SC92F8003_H 2 =5 #define _SC92F8003_H 3 =5 4 =5 #include "SC92F8003_C.H" 1 =6 /*-------------------------------------------------------------------------- 2 =6 SC92F8003_C.H 3 =6 4 =6 C Header file for SC92F8003 microcontroller. 5 =6 Copyright (c) 2018 Shenzhen SinOne Chip Electronic CO., Ltd. 6 =6 All rights reserved. 7 =6 Ԫ΢޹˾ 8 =6 汾: V1.0 9 =6 : 2018.05.02 10 =6 --------------------------------------------------------------------------*/ 11 =6 #ifndef _SC92F8003_H_ 12 =6 #define _SC92F8003_H_ 13 =6 14 =6 /* ------------------- ֽڼĴ-------------------- */ 15 =6 ///*CPU*/ 16 =6 sfr ACC = 0xE0; //ۼ 17 =6 sfr B = 0xF0; //ͨüĴB 18 =6 sfr PSW = 0xD0; //״̬ 19 =6 sfr DPH = 0x83; //ָ8λ 20 =6 sfr DPL = 0x82; //ָ8λ 21 =6 sfr SP = 0x81; //ջָ 22 =6 23 =6 24 =6 /*system*/ 25 =6 sfr PCON = 0x87; //ԴƼĴ 26 =6 27 =6 /*interrupt*/ 28 =6 sfr IP1 = 0XB9; //жȼƼĴ1 29 =6 sfr IP = 0xB8; //жȨƼĴ 30 =6 sfr IE = 0xA8; //жϿƼĴ 31 =6 sfr IE1 = 0XA9; //жϿƼĴ1 32 =6 33 =6 /*PORT*/ 34 =6 sfr P2PH = 0xA2; //P2ģʽƼĴ 35 =6 sfr P2CON = 0xA1; //P2ģʽƼĴ 36 =6 sfr P2 = 0xA0; //P2ݼĴ 37 =6 sfr P1PH = 0x92; //P1ģʽƼĴ 38 =6 sfr P1CON = 0x91; //P1ģʽƼĴ 39 =6 sfr P1 = 0x90; //P1ݼĴ 40 =6 sfr P0PH = 0x9B; //P0ģʽƼĴ 41 =6 sfr P0CON = 0x9A; //P0ģʽƼĴ 42 =6 sfr P0 = 0x80; //P0ݼĴ 43 =6 44 =6 /*TIMER*/ 45 =6 sfr TMCON = 0x8E; //ʱƵʿƼĴ 46 =6 sfr TH1 = 0x8D; //ʱ18λ 47 =6 sfr TH0 = 0x8C; //ʱ08λ 48 =6 sfr TL1 = 0x8B; //ʱ18λ 49 =6 sfr TL0 = 0x8A; //ʱ08λ 50 =6 sfr TMOD = 0x89; //ʱģʽĴ 51 =6 sfr TCON = 0x88; //ʱƼĴ 52 =6 sfr T2CON = 0xC8; //ʱ2ƼĴ 53 =6 sfr T2MOD = 0xC9; //ʱ2ģʽĴ 54 =6 sfr RCAP2L = 0xCA; //ʱ2/׽8λ 55 =6 sfr RCAP2H = 0xCB; //ʱ2/׽8λ 56 =6 sfr TL2 = 0xCC; //ʱ28λ 57 =6 sfr TH2 = 0xCD; //ʱ28λ C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 4 58 =6 59 =6 60 =6 /*ADC*/ 61 =6 sfr ADCCFG1 = 0xAA; //ADCüĴ0 62 =6 sfr ADCCFG0 = 0xAB; //ADCüĴ1 63 =6 sfr ADCCON = 0XAD; //ADCƼĴ 64 =6 sfr ADCVL = 0xAE; //ADC Ĵ 65 =6 sfr ADCVH = 0xAF; //ADC Ĵ 66 =6 67 =6 /*PWM*/ 68 =6 sfr PWMCFG = 0xD1; //PWMüĴ 69 =6 sfr PWMCON0 = 0xD2; //PWMƼĴ 70 =6 sfr PWMPRD = 0xD3; //PWMüĴ 71 =6 sfr PWMDTYA = 0xD4; //PWMռձüĴA 72 =6 sfr PWMDTY0 = 0xD5; //PWM0üĴ 73 =6 sfr PWMDTY1 = 0xD6; //PWM1üĴ 74 =6 sfr PWMDTY2 = 0xD7; //PWM2üĴ 75 =6 sfr PWMCON1 = 0xDA; //PWMƼĴ 76 =6 sfr PWMDTYB = 0xDB; //PWMռձüĴB 77 =6 sfr PWMDTY3 = 0xDC; //PWM3üĴ 78 =6 sfr PWMDTY4 = 0xDD; //PWM4üĴ 79 =6 sfr PWMDTY5 = 0xDE; //PWM5üĴ 80 =6 sfr PWMDTY6 = 0xDF; //PWM6üĴ 81 =6 82 =6 83 =6 // 84 =6 ///*WatchDog*/ 85 =6 sfr BTMCON = 0XCE; //ƵʱƼĴ 86 =6 sfr WDTCON = 0xCF; //WDTƼĴ 87 =6 88 =6 89 =6 sfr OTCON = 0X8F; //ƼĴ 90 =6 91 =6 /*INT*/ 92 =6 sfr INT0F = 0XBA; //INT0 ½жϿƼĴ 93 =6 sfr INT0R = 0XBB; //INT0 ϽжϿƼĴ 94 =6 sfr INT1F = 0XBC; //INT1 ½жϿƼĴ 95 =6 sfr INT1R = 0XBD; //INT1 ϽжϿƼĴ 96 =6 sfr INT2F = 0XC6; //INT2 ½жϿƼĴ 97 =6 sfr INT2R = 0XC7; //INT2 ϽжϿƼĴ 98 =6 99 =6 /*IAP */ 100 =6 sfr IAPCTL = 0xF6; //IAPƼĴ 101 =6 sfr IAPDAT = 0xF5; //IAPݼĴ 102 =6 sfr IAPADE = 0xF4; //IAPչַĴ 103 =6 sfr IAPADH = 0xF3; //IAPдַλĴ 104 =6 sfr IAPADL = 0xF2; //IAPдַ8λĴ 105 =6 sfr IAPKEY = 0xF1; //IAPĴ 106 =6 107 =6 /*uart0*/ 108 =6 sfr SCON = 0X98; //uartƼĴ 109 =6 sfr SBUF = 0X99; //uart0ݼĴ 110 =6 111 =6 /*һ*/ 112 =6 sfr SSCON0 = 0X9D; //SSIƼĴ0 113 =6 sfr SSCON1 = 0X9E; //SSIƼĴ1 114 =6 sfr SSCON2 = 0X95; //SSIƼĴ2 115 =6 sfr SSDAT = 0X9F; //SSIݼĴ 116 =6 117 =6 sfr OPINX = 0XFE; 118 =6 sfr OPREG = 0XFF; 119 =6 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 5 120 =6 /*Check Sum*/ 121 =6 sfr CHKSUML = 0XFC; //Check SumĴλ 122 =6 sfr CHKSUMH = 0XFD; //Check SumĴλ 123 =6 124 =6 sfr OPERCON = 0xEF; //ƼĴ 125 =6 126 =6 ///* ------------------- λĴ-------------------- */ 127 =6 /*PSW*/ 128 =6 sbit CY = PSW^7; //־λ 0:ӷλ޽λ߼λ޽λʱ 1:ӷλн -λ߼λнλʱ 129 =6 sbit AC = PSW^6; //λ־λ 0:޽λλ 1:ӷʱbit3λнλbit3λн -λʱ 130 =6 sbit F0 = PSW^5; //û־λ 131 =6 sbit RS1 = PSW^4; //Ĵѡλ 132 =6 sbit RS0 = PSW^3; //Ĵѡλ 133 =6 sbit OV = PSW^2; //־λ 134 =6 sbit F1 = PSW^1; //F1־ 135 =6 sbit P = PSW^0; //ż־λ 0:ACC1ĸΪż0 1:ACC1ĸΪ 136 =6 137 =6 /*T2CON*/ 138 =6 sbit TF2 = T2CON^7; 139 =6 sbit EXF2 = T2CON^6; 140 =6 sbit RCLK = T2CON^5; 141 =6 sbit TCLK = T2CON^4; 142 =6 sbit EXEN2 = T2CON^3; 143 =6 sbit TR2 = T2CON^2; 144 =6 sbit T2 = T2CON^1; 145 =6 sbit CP = T2CON^0; 146 =6 147 =6 148 =6 /*IP*/ 149 =6 sbit IPADC = IP^6; //ADCжȿλ 0:趨 ADCжȨ ͡ 1:趨 ADCжȨ ߡ - 150 =6 sbit IPT2 = IP^5; //PWMжȿλ 0:趨 PWMжȨ ͡ 1:趨 PWM жȨ - 151 =6 sbit IPUART = IP^4; //SIFжȿλ 0:趨 SIFжȨ ͡ 1:趨 SIFжȨ ߡ - 152 =6 sbit IPT1 = IP^3; //Timer1жȿλ 0:趨 Timer 1жȨ ͡ 1:趨 Timer 1ж - ߡ 153 =6 sbit IPINT1 = IP^2; //32K Base Timerжȿλ 0:趨 32KжȨ ͡ 1:趨 32Kж -Ȩ ߡ 154 =6 sbit IPT0 = IP^1; //Timer0жȿλ 0:趨 Timer 0жȨ ͡ 1:趨 Timer 0ж - ߡ 155 =6 sbit IPINT0 = IP^0; 156 =6 157 =6 /*IE*/ 158 =6 sbit EA = IE^7; //жʹܵܿ 0:رеж 1:еж 159 =6 sbit EADC = IE^6; //ADCжʹܿ 0:رADCж 1:ADCж 160 =6 sbit ET2 = IE^5; //PWMжʹܿ 0:رPWMж 1:PWMж 161 =6 sbit EUART = IE^4; //UARTжʹܿ 0:رSIFж 1:SIFж 162 =6 sbit ET1 = IE^3; //Timer1жʹܿ 0:رTIMER1ж 1:TIMER1ж 163 =6 sbit EINT1 = IE^2; //32K Base Timerжʹܿ 0:ر32Kж 1:32Kж 164 =6 sbit ET0 = IE^1; //Timer0жʹܿ 0:رTIMER0ж 1:TIMER0ж 165 =6 sbit EINT0 = IE^0; //TouchKeyжʹܿ 0:رTouchKeyж 1:TouchKeyж 166 =6 167 =6 /*TCON*/ 168 =6 sbit TF1 = TCON^7; //T1ж־λ T1жʱӲTF1Ϊ1жϣCPU -ӦʱӲ塰0 169 =6 sbit TR1 = TCON^6; //ʱT1пλ 0:Timer1ֹ 1:Timer1ʼ 170 =6 sbit TF0 = TCON^5; //T0ж־λ T0жʱӲTF0Ϊ1жϣCPU -ӦʱӲ塰0 171 =6 sbit TR0 = TCON^4; //ʱT0пλ 0:Timer0ֹ 1:Timer0ʼ C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 6 172 =6 173 =6 /*SCON*/ 174 =6 sbit SM0 = SCON^7; 175 =6 sbit SM1 = SCON^6; 176 =6 sbit SM2 = SCON^5; 177 =6 sbit REN = SCON^4; 178 =6 sbit TB8 = SCON^3; 179 =6 sbit RB8 = SCON^2; 180 =6 sbit TI = SCON^1; 181 =6 sbit RI = SCON^0; 182 =6 183 =6 /* P0 */ 184 =6 sbit P01 = P0^1; 185 =6 sbit P00 = P0^0; 186 =6 187 =6 /* P1 */ 188 =6 sbit P17 = P1^7; 189 =6 sbit P16 = P1^6; 190 =6 sbit P15 = P1^5; 191 =6 sbit P14 = P1^4; 192 =6 sbit P13 = P1^3; 193 =6 sbit P12 = P1^2; 194 =6 sbit P11 = P1^1; 195 =6 sbit P10 = P1^0; 196 =6 197 =6 /* P2 */ 198 =6 sbit P27 = P2^7; 199 =6 sbit P26 = P2^6; 200 =6 sbit P25 = P2^5; 201 =6 sbit P24 = P2^4; 202 =6 sbit P23 = P2^3; 203 =6 sbit P22 = P2^2; 204 =6 sbit P21 = P2^1; 205 =6 sbit P20 = P2^0; 206 =6 207 =6 #endif 5 =5 6 =5 #define enableInterrupts() EA=1 /** ж **/ 7 =5 #define disableInterrupts() EA=0 /** رж **/ 8 =5 9 =5 #define __I volatile const /*!< defines 'read only' permissions */ 10 =5 #define __O volatile /*!< defines 'write only' permissions */ 11 =5 #define __IO volatile /*!< defines 'read / write' permissions */ 12 =5 13 =5 /*!< Signed integer types */ 14 =5 typedef signed char int8_t; 15 =5 typedef signed short int16_t; 16 =5 typedef signed long int32_t; 17 =5 18 =5 /*!< Unsigned integer types */ 19 =5 typedef unsigned char uint8_t; 20 =5 typedef unsigned short uint16_t; 21 =5 typedef unsigned long uint32_t; 22 =5 23 =5 typedef int32_t s32; 24 =5 typedef int16_t s16; 25 =5 typedef int8_t s8; 26 =5 27 =5 typedef uint32_t u32; 28 =5 typedef uint16_t u16; 29 =5 typedef uint8_t u8; 30 =5 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 7 31 =5 32 =5 typedef enum {FALSE = 0, TRUE = !FALSE} bool; 33 =5 34 =5 typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus, BitStatus; 35 =5 36 =5 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; 37 =5 38 =5 typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; 39 =5 40 =5 typedef enum {LOW = 0, HIGH = !LOW} PriorityStatus; 41 =5 42 =5 #endif 6 =4 7 =4 #define INT_EXT0 0 8 =4 #define INT_T0 1 9 =4 #define INT_EXT1 2 10 =4 #define INT_T1 3 11 =4 #define INT_UART0 4 12 =4 #define INT_T2 5 13 =4 #define INT_ADC 6 14 =4 #define INT_SSI 7 15 =4 #define INT_PWM 8 16 =4 #define INT_BTM 9 17 =4 #define INT_EXT2 10 18 =4 19 =4 20 =4 21 =4 #endif 7 =3 #include "pt.h" 1 =4 2 =4 #ifndef __PT_H__ 3 =4 #define __PT_H__ 4 =4 5 =4 #include "lc.h" 1 =5 #ifndef __LC_H__ 2 =5 #define __LC_H__ 3 =5 4 =5 5 =5 #ifdef LC_INCLUDE =5 #include LC_INCLUDE =5 #else 8 =5 #include "lc-switch.h" 1 =6 2 =6 3 =6 #ifndef __LC_SWITCH_H__ 4 =6 #define __LC_SWITCH_H__ 5 =6 6 =6 typedef unsigned short lc_t; 7 =6 8 =6 #define LC_INIT(s) s = 0; 9 =6 10 =6 #define LC_RESUME(s) switch(s) { case 0: 11 =6 12 =6 #define LC_SET(s) s = __LINE__; case __LINE__: 13 =6 14 =6 #define LC_END(s) } 15 =6 16 =6 #endif /* __LC_SWITCH_H__ */ 17 =6 18 =6 /** @} */ 9 =5 #endif 10 =5 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 8 11 =5 #endif 6 =4 7 =4 struct pt { 8 =4 lc_t lc; 9 =4 }; 10 =4 11 =4 12 =4 #ifndef UNUSED_PARAM 13 =4 #define UNUSED_PARAM(v) (void)(v) 14 =4 #endif 15 =4 16 =4 #define PT_WAITING 0 //等待 17 =4 #define PT_YIELDED 1 //锁死线程 18 =4 #define PT_EXITED 2 //退出 19 =4 #define PT_ENDED 3 //结束 20 =4 21 =4 #define PT_INIT(pt) LC_INIT((pt)->lc) 22 =4 #define PT_THREAD(name_args) int8_t name_args 23 =4 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) 24 =4 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ 25 =4 UNUSED_PARAM(PT_YIELD_FLAG );\ 26 =4 PT_INIT(pt); return PT_ENDED; } 27 =4 28 =4 29 =4 //等待条件成立,如果不成立,继续等待 30 =4 #define PT_WAIT_UNTIL(pt, condition) \ 31 =4 do { \ 32 =4 LC_SET((pt)->lc); \ 33 =4 if(!(condition)) { \ 34 =4 return PT_WAITING; \ 35 =4 } \ 36 =4 } while(0) 37 =4 38 =4 //一直等待,直到条件不成立 39 =4 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) 40 =4 //等待子线程退出 41 =4 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) 42 =4 43 =4 //启动子线程,等待子线程退出,如果不退出,在此阻塞 44 =4 #define PT_SPAWN(pt, child, thread) \ 45 =4 do { \ 46 =4 PT_INIT((child)); \ 47 =4 PT_WAIT_THREAD((pt), (thread)); \ 48 =4 } while(0) 49 =4 50 =4 //重新启动线程,从头开始 51 =4 #define PT_RESTART(pt) \ 52 =4 do { \ 53 =4 PT_INIT(pt); \ 54 =4 return PT_WAITING; \ 55 =4 } while(0) 56 =4 57 =4 //退出线程 58 =4 #define PT_EXIT(pt) \ 59 =4 do { \ 60 =4 PT_INIT(pt); \ 61 =4 return PT_EXITED; \ 62 =4 } while(0) 63 =4 //子线程是否退出 64 =4 #define PT_SCHEDULE(f) ((f) < PT_EXITED) 65 =4 66 =4 //锁死任务 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 9 67 =4 #define PT_YIELD(pt) \ 68 =4 do { \ 69 =4 PT_YIELD_FLAG = 0; \ 70 =4 LC_SET((pt)->lc); \ 71 =4 if(PT_YIELD_FLAG == 0) { \ 72 =4 return PT_YIELDED; \ 73 =4 } \ 74 =4 } while(0) 75 =4 76 =4 //锁死任务直到符合条件 77 =4 #define PT_YIELD_UNTIL(pt, cond) \ 78 =4 do { \ 79 =4 PT_YIELD_FLAG = 0; \ 80 =4 LC_SET((pt)->lc); \ 81 =4 if((PT_YIELD_FLAG == 0) || !(cond)) { \ 82 =4 return PT_YIELDED; \ 83 =4 } \ 84 =4 } while(0) 85 =4 86 =4 87 =4 #endif /* __PT_H__ */ 8 =3 9 =3 #define GPIOR GPIO1 10 =3 #define GPIOG GPIO2 11 =3 #define GPIOB GPIO2 12 =3 #define GPIOC GPIO2 13 =3 #define GPIOW GPIO2 14 =3 15 =3 #define LEDR GPIO_PIN_0 16 =3 #define LEDG GPIO_PIN_7 17 =3 #define LEDB GPIO_PIN_6 18 =3 #define LEDC GPIO_PIN_5 19 =3 #define LEDW GPIO_PIN_4 20 =3 21 =3 22 =3 typedef void (* func )(void); 23 =3 24 =3 void Idle(void); 25 =3 void Init(void); 26 =3 void InitWdt(void); 27 =3 void InitPort(void); 28 =3 29 =3 void SysTick_Handler(void); 30 =3 void Task_SysTick_Handler(void); 31 =3 32 =3 PT_THREAD(TaskBlinLed(struct pt *pt1 )); 33 =3 PT_THREAD(TaskWDT(struct pt *pt1 )); 34 =3 35 =3 36 =3 37 =3 #endif 7 =2 8 =2 #include "pt_thread/pt_header.h" 1 =3 #ifndef _PT_HEADER_H_ 2 =3 #define _PT_HEADER_H_ 3 =3 4 =3 #include "pt_timer.h" 1 =4 #ifndef _PT_TIMER_H_ 2 =4 #define _PT_TIMER_H_ 3 =4 #include "pt.h" 1 =5 2 =5 #ifndef __PT_H__ C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 10 =5 #define __PT_H__ =5 =5 #include "lc.h" =5 =5 struct pt { =5 lc_t lc; =5 }; =5 =5 =5 #ifndef UNUSED_PARAM =5 #define UNUSED_PARAM(v) (void)(v) =5 #endif =5 =5 #define PT_WAITING 0 //等待 =5 #define PT_YIELDED 1 //锁死线程 =5 #define PT_EXITED 2 //退出 =5 #define PT_ENDED 3 //结束 =5 =5 #define PT_INIT(pt) LC_INIT((pt)->lc) =5 #define PT_THREAD(name_args) int8_t name_args =5 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) =5 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ =5 UNUSED_PARAM(PT_YIELD_FLAG );\ =5 PT_INIT(pt); return PT_ENDED; } =5 =5 =5 //等待条件成立,如果不成立,继续等待 =5 #define PT_WAIT_UNTIL(pt, condition) \ =5 do { \ =5 LC_SET((pt)->lc); \ =5 if(!(condition)) { \ =5 return PT_WAITING; \ =5 } \ =5 } while(0) =5 =5 //一直等待,直到条件不成立 =5 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) =5 //等待子线程退出 =5 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) =5 =5 //启动子线程,等待子线程退出,如果不退出,在此阻塞 =5 #define PT_SPAWN(pt, child, thread) \ =5 do { \ =5 PT_INIT((child)); \ =5 PT_WAIT_THREAD((pt), (thread)); \ =5 } while(0) =5 =5 //重新启动线程,从头开始 =5 #define PT_RESTART(pt) \ =5 do { \ =5 PT_INIT(pt); \ =5 return PT_WAITING; \ =5 } while(0) =5 =5 //退出线程 =5 #define PT_EXIT(pt) \ =5 do { \ =5 PT_INIT(pt); \ =5 return PT_EXITED; \ =5 } while(0) =5 //子线程是否退出 =5 #define PT_SCHEDULE(f) ((f) < PT_EXITED) C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 11 =5 =5 //锁死任务 =5 #define PT_YIELD(pt) \ =5 do { \ =5 PT_YIELD_FLAG = 0; \ =5 LC_SET((pt)->lc); \ =5 if(PT_YIELD_FLAG == 0) { \ =5 return PT_YIELDED; \ =5 } \ =5 } while(0) =5 =5 //锁死任务直到符合条件 =5 #define PT_YIELD_UNTIL(pt, cond) \ =5 do { \ =5 PT_YIELD_FLAG = 0; \ =5 LC_SET((pt)->lc); \ =5 if((PT_YIELD_FLAG == 0) || !(cond)) { \ =5 return PT_YIELDED; \ =5 } \ =5 } while(0) =5 =5 =5 #endif /* __PT_H__ */ 4 =4 5 =4 6 =4 struct timer { 7 =4 unsigned long start; //记录启动时的tick值 8 =4 unsigned long interval; //要定时的tick数 9 =4 }; 10 =4 11 =4 void timer_set(struct timer *t, unsigned long interval); 12 =4 unsigned char timer_expired(struct timer *t); 13 =4 14 =4 #endif 5 =3 #include "pt-sem.h" 1 =4 /* 2 =4 #include "pt-sem.h" 3 =4 4 =4 #define NUM_ITEMS 32 5 =4 #define BUFSIZE 8 6 =4 7 =4 static struct pt_sem mutex, full, empty; 8 =4 9 =4 PT_THREAD(producer(struct pt *pt)) 10 =4 { 11 =4 static int produced; 12 =4 13 =4 PT_BEGIN(pt); 14 =4 15 =4 for(produced = 0; produced < NUM_ITEMS; ++produced) { 16 =4 17 =4 PT_SEM_WAIT(pt, &full); 18 =4 19 =4 PT_SEM_WAIT(pt, &mutex); 20 =4 add_to_buffer(produce_item()); 21 =4 PT_SEM_SIGNAL(pt, &mutex); 22 =4 23 =4 PT_SEM_SIGNAL(pt, &empty); 24 =4 } 25 =4 26 =4 PT_END(pt); 27 =4 } C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 12 28 =4 29 =4 PT_THREAD(consumer(struct pt *pt)) 30 =4 { 31 =4 static int consumed; 32 =4 33 =4 PT_BEGIN(pt); 34 =4 35 =4 for(consumed = 0; consumed < NUM_ITEMS; ++consumed) { 36 =4 37 =4 PT_SEM_WAIT(pt, &empty); 38 =4 39 =4 PT_SEM_WAIT(pt, &mutex); 40 =4 consume_item(get_from_buffer()); 41 =4 PT_SEM_SIGNAL(pt, &mutex); 42 =4 43 =4 PT_SEM_SIGNAL(pt, &full); 44 =4 } 45 =4 46 =4 PT_END(pt); 47 =4 } 48 =4 49 =4 PT_THREAD(driver_thread(struct pt *pt)) 50 =4 { 51 =4 static struct pt pt_producer, pt_consumer; 52 =4 53 =4 PT_BEGIN(pt); 54 =4 55 =4 PT_SEM_INIT(&empty, 0); 56 =4 PT_SEM_INIT(&full, BUFSIZE); 57 =4 PT_SEM_INIT(&mutex, 1); 58 =4 59 =4 PT_INIT(&pt_producer); 60 =4 PT_INIT(&pt_consumer); 61 =4 62 =4 PT_WAIT_THREAD(pt, producer(&pt_producer) & 63 =4 consumer(&pt_consumer)); 64 =4 65 =4 PT_END(pt); 66 =4 } 67 =4 */ 68 =4 69 =4 #ifndef __PT_SEM_H__ 70 =4 #define __PT_SEM_H__ 71 =4 72 =4 #include "pt.h" 1 =5 2 =5 #ifndef __PT_H__ =5 #define __PT_H__ =5 =5 #include "lc.h" =5 =5 struct pt { =5 lc_t lc; =5 }; =5 =5 =5 #ifndef UNUSED_PARAM =5 #define UNUSED_PARAM(v) (void)(v) =5 #endif =5 =5 #define PT_WAITING 0 //等待 =5 #define PT_YIELDED 1 //锁死线程 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 13 =5 #define PT_EXITED 2 //退出 =5 #define PT_ENDED 3 //结束 =5 =5 #define PT_INIT(pt) LC_INIT((pt)->lc) =5 #define PT_THREAD(name_args) int8_t name_args =5 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) =5 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ =5 UNUSED_PARAM(PT_YIELD_FLAG );\ =5 PT_INIT(pt); return PT_ENDED; } =5 =5 =5 //等待条件成立,如果不成立,继续等待 =5 #define PT_WAIT_UNTIL(pt, condition) \ =5 do { \ =5 LC_SET((pt)->lc); \ =5 if(!(condition)) { \ =5 return PT_WAITING; \ =5 } \ =5 } while(0) =5 =5 //一直等待,直到条件不成立 =5 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) =5 //等待子线程退出 =5 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) =5 =5 //启动子线程,等待子线程退出,如果不退出,在此阻塞 =5 #define PT_SPAWN(pt, child, thread) \ =5 do { \ =5 PT_INIT((child)); \ =5 PT_WAIT_THREAD((pt), (thread)); \ =5 } while(0) =5 =5 //重新启动线程,从头开始 =5 #define PT_RESTART(pt) \ =5 do { \ =5 PT_INIT(pt); \ =5 return PT_WAITING; \ =5 } while(0) =5 =5 //退出线程 =5 #define PT_EXIT(pt) \ =5 do { \ =5 PT_INIT(pt); \ =5 return PT_EXITED; \ =5 } while(0) =5 //子线程是否退出 =5 #define PT_SCHEDULE(f) ((f) < PT_EXITED) =5 =5 //锁死任务 =5 #define PT_YIELD(pt) \ =5 do { \ =5 PT_YIELD_FLAG = 0; \ =5 LC_SET((pt)->lc); \ =5 if(PT_YIELD_FLAG == 0) { \ =5 return PT_YIELDED; \ =5 } \ =5 } while(0) =5 =5 //锁死任务直到符合条件 =5 #define PT_YIELD_UNTIL(pt, cond) \ =5 do { \ =5 PT_YIELD_FLAG = 0; \ C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 14 =5 LC_SET((pt)->lc); \ =5 if((PT_YIELD_FLAG == 0) || !(cond)) { \ =5 return PT_YIELDED; \ =5 } \ =5 } while(0) =5 =5 =5 #endif /* __PT_H__ */ 73 =4 74 =4 struct pt_sem { 75 =4 unsigned int count; 76 =4 }; 77 =4 78 =4 //信号量 79 =4 #define PT_SEM_INIT(s, c) (s)->count = c 80 =4 81 =4 //信号量等待 当信号量大于0 时继续,否则等待 82 =4 #define PT_SEM_WAIT(pt, s) \ 83 =4 do { \ 84 =4 PT_WAIT_UNTIL(pt, (s)->count > 0); \ 85 =4 --(s)->count; \ 86 =4 } while(0) 87 =4 88 =4 //写入信号量 89 =4 #define PT_SEM_SIGNAL(pt, s) ++(s)->count 90 =4 91 =4 #endif /* __PT_SEM_H__ */ 92 =4 93 =4 /** @} */ 94 =4 /** @} */ 95 =4 6 =3 7 =3 #endif 8 =3 9 =2 10 =2 11 =2 12 =2 #define TASK_ID(FUNC) TASK_ID_##FUNC 13 =2 #define TASK_NAME(FUNC) #FUNC 14 =2 15 =2 #ifndef UNUSED_PARAM =2 #define UNUSED_PARAM(p) (void)(p) =2 #endif 18 =2 19 =2 20 =2 #ifndef NULL 21 =2 #define NULL (void*)0 22 =2 #endif 23 =2 24 =2 25 =2 #ifndef UNUSED 26 =2 #define UNUSED(x) (void)(x) 27 =2 #endif 28 =2 29 =2 #ifdef __cplusplus =2 extern "C" { =2 #endif 32 =2 33 =2 34 =2 35 =2 enum TASK_ID { 36 =2 TASK_ID(TaskTimer), C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 15 37 =2 #include "cfg/taskid.h" 1 =3 TASK_ID(TaskBlinLed), 2 =3 TASK_ID(TaskWDT), 3 =3 TASK_ID(TaskLMM), 4 =3 TASK_ID(TaskEX_WDT), 5 =3 TASK_ID(TaskCAN), 6 =3 7 =3 38 =2 }; 39 =2 40 =2 41 =2 42 =2 enum TASK_MODE 43 =2 { 44 =2 TASK_MODE_ONCE, 45 =2 TASK_MODE_PERIOD 46 =2 }; 47 =2 48 =2 enum TIMER_MODE 49 =2 { 50 =2 TIMER_MODE_TIMER = 0, 51 =2 TIMER_MODE_ONCEROUTINE, 52 =2 TIMER_MODE_CYCROUTINE 53 =2 }; 54 =2 55 =2 void InitT0(void); 56 =2 void InitTask(void); 57 =2 void TaskProc(void); 58 =2 59 =2 60 =2 int8_t ActiveTask(int8_t cTaskID, int32_t lPeriod); 61 =2 int8_t SuspendTask(int8_t cTaskID); 62 =2 63 =2 void ActiveTaskNow(int8_t cTaskID, int32_t lPeriod); 64 =2 int8_t SetTaskLastTime(int8_t cTaskID,int32_t lLastTime); 65 =2 66 =2 67 =2 int8_t StartTimer2(int8_t *TimerID,int8_t cMode,uint32_t lPeriod,void (* routine)(void * Param1),void * - Param1); 68 =2 int8_t StartTimer( int8_t cMode,int32_t lPeriod,void (* routine)(void * Param1),void * - Param1); 69 =2 int8_t StopTimer ( int8_t * pcTimerNumber ); 70 =2 void StopAllTimer(void); 71 =2 72 =2 uint32_t get_system_ms(void); 73 =2 //////////////// 74 =2 75 =2 #ifdef __cplusplus =2 } =2 #endif 78 =2 #endif 79 =2 5 =1 #endif 6 =1 3 int main(void) 4 { 5 1 Init(); 6 1 TaskProc(); 7 1 return 0; 8 1 } C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 16 ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION main (BEGIN) ; SOURCE LINE # 3 ; SOURCE LINE # 4 ; SOURCE LINE # 5 0000 120000 E LCALL Init ; SOURCE LINE # 6 0003 120000 E LCALL TaskProc ; SOURCE LINE # 7 0006 E4 CLR A 0007 FE MOV R6,A 0008 FF MOV R7,A ; SOURCE LINE # 8 0009 22 RET ; FUNCTION main (END) C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 17 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== uint16_t . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2 OPREG. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FFH 1 TASK_ID_TaskLMM. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 P0 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0080H 1 SSDAT. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 009FH 1 P1 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0090H 1 P2 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A0H 1 EUART. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00ACH 1 TMCON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008EH 1 AC . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D6H 1 FlagStatus . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 RESET. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 OTCON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008FH 1 EA . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AFH 1 T2 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00C9H 1 TASK_ID_TaskEX_WDT . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 int32_t. . . . . . . . . . . . . . . . TYPEDEF ----- LONG ----- 4 PWMCON0. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D2H 1 PWMCON1. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DAH 1 TASK_ID_TaskWDT. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 int16_t. . . . . . . . . . . . . . . . TYPEDEF ----- INT ----- 2 TIMER_MODE . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- pt_sem . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 2 count. . . . . . . . . . . . . . . . MEMBER ----- U_INT 0000H 2 ERROR. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 EADC . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AEH 1 IE . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A8H 1 OPINX. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FEH 1 CP . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00C8H 1 Init . . . . . . . . . . . . . . . . . EXTERN CODE PROC ----- ----- ErrorStatus. . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 EXF2 . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CEH 1 CHKSUMH. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FDH 1 PWMDTY0. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D5H 1 OPERCON. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00EFH 1 PWMDTY1. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D6H 1 P0PH . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 009BH 1 IP . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B8H 1 CHKSUML. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FCH 1 PWMDTY2. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D7H 1 P1PH . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0092H 1 RI . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0098H 1 PWMDTY3. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DCH 1 P2PH . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A2H 1 SUCCESS. . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 CY . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D7H 1 PWMDTY4. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DDH 1 TASK_ID_TaskTimer. . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TI . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0099H 1 PWMDTY5. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DEH 1 IPT0 . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00B9H 1 PWMDTY6. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DFH 1 FunctionalState. . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 IPT1 . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BBH 1 IPT2 . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BDH 1 HIGH . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TASK_ID. . . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 18 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== RCAP2H . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CBH 1 SP . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0081H 1 timer. . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 8 start. . . . . . . . . . . . . . . . MEMBER ----- U_LONG 0000H 4 interval . . . . . . . . . . . . . . MEMBER ----- U_LONG 0004H 4 lc_t . . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2 OV . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D2H 1 ITStatus . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 IAPADE . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F4H 1 RCAP2L . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CAH 1 main . . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H ----- ENABLE . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 BitStatus. . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 IAPADH . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F3H 1 PWMDTYA. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D4H 1 PWMDTYB. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00DBH 1 ADCCON . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00ADH 1 s8 . . . . . . . . . . . . . . . . . . TYPEDEF ----- CHAR ----- 1 TaskProc . . . . . . . . . . . . . . . EXTERN CODE PROC ----- ----- u8 . . . . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 RCLK . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CDH 1 IAPADL . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F2H 1 func . . . . . . . . . . . . . . . . . TYPEDEF ----- PTR ----- 3 bool . . . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 TCLK . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CCH 1 P00. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0080H 1 P10. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0090H 1 P01. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0081H 1 SBUF . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0099H 1 PCON . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0087H 1 P20. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A0H 1 P11. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0091H 1 P21. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A1H 1 P12. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0092H 1 P22. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A2H 1 P13. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0093H 1 SCON . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0098H 1 P23. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A3H 1 P14. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0094H 1 IAPDAT . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F5H 1 TCON . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0088H 1 TMOD . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0089H 1 P24. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A4H 1 P15. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0095H 1 IPINT0 . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00B8H 1 TASK_ID_TaskBlinLed. . . . . . . . . . E_CONST ----- U_CHAR ----- 1 P25. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A5H 1 P16. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0096H 1 IPINT1 . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BAH 1 P26. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A6H 1 P17. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0097H 1 SSCON0 . . . . . . . . . . . . . . . . SFR DATA U_CHAR 009DH 1 P27. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A7H 1 SSCON1 . . . . . . . . . . . . . . . . SFR DATA U_CHAR 009EH 1 SSCON2 . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0095H 1 TIMER_MODE_ONCEROUTINE . . . . . . . . E_CONST ----- U_CHAR ----- 1 TASK_MODE. . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 19 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== IAPCTL . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F6H 1 IE1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A9H 1 TRUE . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 B. . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F0H 1 TASK_MODE_ONCE . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 IAPKEY . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F1H 1 BTMCON . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CEH 1 PWMCFG . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D1H 1 ACC. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00E0H 1 ET0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A9H 1 TF0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008DH 1 ET1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00ABH 1 ADCCFG0. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00ABH 1 IP1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B9H 1 TF1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008FH 1 ET2. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00ADH 1 ADCCFG1. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00AAH 1 RB8. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009AH 1 TF2. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CFH 1 TH0. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008CH 1 TH1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008DH 1 TB8. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009BH 1 TH2. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CDH 1 uint8_t. . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 P. . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D0H 1 SM0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009FH 1 TL0. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008AH 1 SM1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009EH 1 WDTCON . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CFH 1 TL1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008BH 1 SM2. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009DH 1 TL2. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CCH 1 RS0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D3H 1 TR0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008CH 1 RS1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D4H 1 TR1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008EH 1 IPUART . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BCH 1 s32. . . . . . . . . . . . . . . . . . TYPEDEF ----- LONG ----- 4 TR2. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CAH 1 int8_t . . . . . . . . . . . . . . . . TYPEDEF ----- CHAR ----- 1 u32. . . . . . . . . . . . . . . . . . TYPEDEF ----- U_LONG ----- 4 s16. . . . . . . . . . . . . . . . . . TYPEDEF ----- INT ----- 2 u16. . . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2 PWMPRD . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D3H 1 DPH. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0083H 1 DPL. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0082H 1 TASK_MODE_PERIOD . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 EINT0. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A8H 1 P0CON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 009AH 1 EINT1. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AAH 1 IPADC. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BEH 1 INT0F. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BAH 1 P1CON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0091H 1 EXEN2. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CBH 1 INT1F. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BCH 1 P2CON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A1H 1 pt . . . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 2 C51 COMPILER V9.60.7.0 MAIN 05/13/2024 00:07:49 PAGE 20 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== lc . . . . . . . . . . . . . . . . . MEMBER ----- U_INT 0000H 2 INT2F. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C6H 1 REN. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009CH 1 ADCVH. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00AFH 1 T2MOD. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C9H 1 T2CON. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C8H 1 TASK_ID_TaskCAN. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 ADCVL. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00AEH 1 SET. . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 FALSE. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TIMER_MODE_TIMER . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 INT0R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BBH 1 INT1R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BDH 1 PriorityStatus . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 INT2R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C7H 1 LOW. . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TIMER_MODE_CYCROUTINE. . . . . . . . . E_CONST ----- U_CHAR ----- 1 F0 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D5H 1 DISABLE. . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 F1 . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D1H 1 PSW. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D0H 1 uint32_t . . . . . . . . . . . . . . . TYPEDEF ----- U_LONG ----- 4 MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = 10 ---- CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- EDATA SIZE = ---- ---- HDATA SIZE = ---- ---- XDATA CONST SIZE = ---- ---- FAR CONST SIZE = ---- ---- END OF MODULE INFORMATION. C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)