C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 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/task_header.h" 1 =3 #ifndef _TASK_HEADER_H 2 =3 #define _TASK_HEADER_H 3 =3 4 =3 #include "task_hal.h" 1 =4 #ifndef _TASK_HAL_H_ 2 =4 #define _TASK_HAL_H_ 3 =4 4 =4 5 =4 #include "stdint.h" 1 =5 #ifndef _STD_INT_H_ 2 =5 #define _STD_INT_H_ 3 =5 typedef signed long int32_t; 4 =5 typedef unsigned long uint32_t; 5 =5 typedef signed char int8_t; 6 =5 typedef unsigned char uint8_t; 7 =5 typedef signed int int16_t; 8 =5 typedef unsigned int uint16_t; 9 =5 #endif 6 =4 #include "intrins.h" 1 =5 /*-------------------------------------------------------------------------- 2 =5 INTRINS.H 3 =5 4 =5 Intrinsic functions for C51. 5 =5 Copyright (c) 1988-2010 Keil Elektronik GmbH and ARM Germany GmbH 6 =5 All rights reserved. 7 =5 --------------------------------------------------------------------------*/ 8 =5 9 =5 #ifndef __INTRINS_H__ 10 =5 #define __INTRINS_H__ 11 =5 12 =5 #pragma SAVE 13 =5 14 =5 #if defined (__CX2__) =5 #pragma FUNCTIONS(STATIC) =5 /* intrinsic functions are reentrant, but need static attribute */ =5 #endif 18 =5 19 =5 extern void _nop_ (void); 20 =5 extern bit _testbit_ (bit); 21 =5 extern unsigned char _cror_ (unsigned char, unsigned char); 22 =5 extern unsigned int _iror_ (unsigned int, unsigned char); 23 =5 extern unsigned long _lror_ (unsigned long, unsigned char); 24 =5 extern unsigned char _crol_ (unsigned char, unsigned char); C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 2 25 =5 extern unsigned int _irol_ (unsigned int, unsigned char); 26 =5 extern unsigned long _lrol_ (unsigned long, unsigned char); 27 =5 extern unsigned char _chkfloat_(float); 28 =5 #if defined (__CX2__) =5 extern int abs (int); =5 extern void _illop_ (void); =5 #endif 32 =5 #if !defined (__CX2__) 33 =5 extern void _push_ (unsigned char _sfr); 34 =5 extern void _pop_ (unsigned char _sfr); 35 =5 #endif 36 =5 37 =5 #pragma RESTORE 38 =5 39 =5 #endif 40 =5 7 =4 #include "task_hal_cfg.h" 1 =5 #ifndef _TASK_HAL_CFG_H_ 2 =5 #define _TASK_HAL_CFG_H_ 3 =5 4 =5 5 =5 #include 1 =6 #ifndef _SC92F8003_H 2 =6 #define _SC92F8003_H 3 =6 4 =6 #include "SC92F8003_C.h" 1 =7 /*-------------------------------------------------------------------------- 2 =7 SC92F8003_C.H 3 =7 4 =7 C Header file for SC92F8003 microcontroller. 5 =7 Copyright (c) 2018 Shenzhen SinOne Chip Electronic CO., Ltd. 6 =7 All rights reserved. 7 =7 深圳市赛元微电子有限公司 8 =7 版本号: V1.0 9 =7 日期: 2018.05.02 10 =7 --------------------------------------------------------------------------*/ 11 =7 #ifndef _SC92F8003_H_ 12 =7 #define _SC92F8003_H_ 13 =7 14 =7 /* ------------------- 字节寄存器-------------------- */ 15 =7 ///*CPU*/ 16 =7 sfr ACC = 0xE0; //累加器A 17 =7 sfr B = 0xF0; //通用寄存器B 18 =7 sfr PSW = 0xD0; //程序状态字 19 =7 sfr DPH = 0x83; //数据指针高8位 20 =7 sfr DPL = 0x82; //数据指针低8位 21 =7 sfr SP = 0x81; //堆栈指针 22 =7 23 =7 24 =7 /*system*/ 25 =7 sfr PCON = 0x87; //电源管理控制寄存器 26 =7 27 =7 /*interrupt*/ 28 =7 sfr IP1 = 0XB9; //中断优先级控制寄存器1 29 =7 sfr IP = 0xB8; //中断优先权控制寄存器 30 =7 sfr IE = 0xA8; //中断控制寄存器 31 =7 sfr IE1 = 0XA9; //中断控制寄存器1 32 =7 33 =7 /*PORT*/ 34 =7 sfr P2PH = 0xA2; //P2口模式控制寄存器 35 =7 sfr P2CON = 0xA1; //P2口模式控制寄存器 36 =7 sfr P2 = 0xA0; //P2口数据寄存器 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 3 37 =7 sfr P1PH = 0x92; //P1口模式控制寄存器 38 =7 sfr P1CON = 0x91; //P1口模式控制寄存器 39 =7 sfr P1 = 0x90; //P1口数据寄存器 40 =7 sfr P0PH = 0x9B; //P0口模式控制寄存器 41 =7 sfr P0CON = 0x9A; //P0口模式控制寄存器 42 =7 sfr P0 = 0x80; //P0口数据寄存器 43 =7 44 =7 /*TIMER*/ 45 =7 sfr TMCON = 0x8E; //定时器频率控制寄存器 46 =7 sfr TH1 = 0x8D; //定时器1高8位 47 =7 sfr TH0 = 0x8C; //定时器0高8位 48 =7 sfr TL1 = 0x8B; //定时器1低8位 49 =7 sfr TL0 = 0x8A; //定时器0低8位 50 =7 sfr TMOD = 0x89; //定时器工作模式寄存器 51 =7 sfr TCON = 0x88; //定时器控制寄存器 52 =7 sfr T2CON = 0xC8; //定时器2控制寄存器 53 =7 sfr T2MOD = 0xC9; //定时器2工作模式寄存器 54 =7 sfr RCAP2L = 0xCA; //定时器2重载/捕捉低8位 55 =7 sfr RCAP2H = 0xCB; //定时器2重载/捕捉高8位 56 =7 sfr TL2 = 0xCC; //定时器2低8位 57 =7 sfr TH2 = 0xCD; //定时器2高8位 58 =7 59 =7 60 =7 /*ADC*/ 61 =7 sfr ADCCFG1 = 0xAA; //ADC功能配置寄存器0 62 =7 sfr ADCCFG0 = 0xAB; //ADC功能配置寄存器1 63 =7 sfr ADCCON = 0XAD; //ADC控制寄存器 64 =7 sfr ADCVL = 0xAE; //ADC 结果寄存器 65 =7 sfr ADCVH = 0xAF; //ADC 结果寄存器 66 =7 67 =7 /*PWM*/ 68 =7 sfr PWMCFG = 0xD1; //PWM设置寄存器 69 =7 sfr PWMCON0 = 0xD2; //PWM控制寄存器 70 =7 sfr PWMPRD = 0xD3; //PWM周期设置寄存器 71 =7 sfr PWMDTYA = 0xD4; //PWM占空比设置寄存器A 72 =7 sfr PWMDTY0 = 0xD5; //PWM0设置寄存器 73 =7 sfr PWMDTY1 = 0xD6; //PWM1设置寄存器 74 =7 sfr PWMDTY2 = 0xD7; //PWM2设置寄存器 75 =7 sfr PWMCON1 = 0xDA; //PWM控制寄存器 76 =7 sfr PWMDTYB = 0xDB; //PWM占空比设置寄存器B 77 =7 sfr PWMDTY3 = 0xDC; //PWM3设置寄存器 78 =7 sfr PWMDTY4 = 0xDD; //PWM4设置寄存器 79 =7 sfr PWMDTY5 = 0xDE; //PWM5设置寄存器 80 =7 sfr PWMDTY6 = 0xDF; //PWM6设置寄存器 81 =7 82 =7 83 =7 // 84 =7 ///*WatchDog*/ 85 =7 sfr BTMCON = 0XCE; //低频定时器控制寄存器 86 =7 sfr WDTCON = 0xCF; //WDT控制寄存器 87 =7 88 =7 89 =7 sfr OTCON = 0X8F; //输出控制寄存器 90 =7 91 =7 /*INT*/ 92 =7 sfr INT0F = 0XBA; //INT0 下降沿中断控制寄存器 93 =7 sfr INT0R = 0XBB; //INT0 上降沿中断控制寄存器 94 =7 sfr INT1F = 0XBC; //INT1 下降沿中断控制寄存器 95 =7 sfr INT1R = 0XBD; //INT1 上降沿中断控制寄存器 96 =7 sfr INT2F = 0XC6; //INT2 下降沿中断控制寄存器 97 =7 sfr INT2R = 0XC7; //INT2 上降沿中断控制寄存器 98 =7 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 4 99 =7 /*IAP */ 100 =7 sfr IAPCTL = 0xF6; //IAP控制寄存器 101 =7 sfr IAPDAT = 0xF5; //IAP数据寄存器 102 =7 sfr IAPADE = 0xF4; //IAP扩展地址寄存器 103 =7 sfr IAPADH = 0xF3; //IAP写入地址高位寄存器 104 =7 sfr IAPADL = 0xF2; //IAP写入地址低8位寄存器 105 =7 sfr IAPKEY = 0xF1; //IAP保护寄存器 106 =7 107 =7 /*uart0*/ 108 =7 sfr SCON = 0X98; //uart控制寄存器 109 =7 sfr SBUF = 0X99; //uart0数据寄存器 110 =7 111 =7 /*三合一*/ 112 =7 sfr SSCON0 = 0X9D; //SSI控制寄存器0 113 =7 sfr SSCON1 = 0X9E; //SSI控制寄存器1 114 =7 sfr SSCON2 = 0X95; //SSI控制寄存器2 115 =7 sfr SSDAT = 0X9F; //SSI数据寄存器 116 =7 117 =7 sfr OPINX = 0XFE; 118 =7 sfr OPREG = 0XFF; 119 =7 120 =7 /*Check Sum*/ 121 =7 sfr CHKSUML = 0XFC; //Check Sum结果寄存器低位 122 =7 sfr CHKSUMH = 0XFD; //Check Sum结果寄存器高位 123 =7 124 =7 sfr OPERCON = 0xEF; //运算控制寄存器 125 =7 126 =7 ///* ------------------- 位寄存器-------------------- */ 127 =7 /*PSW*/ 128 =7 sbit CY = PSW^7; //标志位 0:加法运算最高位无进位,或者减法运算最高位无借 -时 1:加法运算最高位有进位,或者减法运算最高位有借位时 129 =7 sbit AC = PSW^6; //进位辅助标志位 0:无借位、进位 1:加法运算时在bit3位有进位 -,或减法运算在bit3位有借位时 130 =7 sbit F0 = PSW^5; //用户标志位 131 =7 sbit RS1 = PSW^4; //工作寄存器组选择位 132 =7 sbit RS0 = PSW^3; //工作寄存器组选择位 133 =7 sbit OV = PSW^2; //溢出标志位 134 =7 sbit F1 = PSW^1; //F1标志 135 =7 sbit P = PSW^0; //奇偶标志位 0:ACC中1的个数为偶数(包括0个) 1:ACC中1的个数 -奇数 136 =7 137 =7 /*T2CON*/ 138 =7 sbit TF2 = T2CON^7; 139 =7 sbit EXF2 = T2CON^6; 140 =7 sbit RCLK = T2CON^5; 141 =7 sbit TCLK = T2CON^4; 142 =7 sbit EXEN2 = T2CON^3; 143 =7 sbit TR2 = T2CON^2; 144 =7 sbit T2 = T2CON^1; 145 =7 sbit CP = T2CON^0; 146 =7 147 =7 148 =7 /*IP*/ 149 =7 sbit IPADC = IP^6; //ADC中断优先控制位 0:设定 ADC的中断优先权是 “低” 1:设定 AD -C的中断优先权是 “高” 150 =7 sbit IPT2 = IP^5; //PWM中断优先控制位 0:设定 PWM的中断优先权是 “低” 1:设定 PW -M 的中断优先权是 “高” 151 =7 sbit IPUART = IP^4; //SIF中断优先控制位 0:设定 SIF的中断优先权是 “低” 1:设定 SI -F的中断优先权是 “高” 152 =7 sbit IPT1 = IP^3; //Timer1中断优先控制位 0:设定 Timer 1的中断优先权是 “低” 1:设 - Timer 1的中断优先权是 “高” 153 =7 sbit IPINT1 = IP^2; //32K Base Timer中断优先控制位 0:设定 32K的中断优先权是 “低” C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 5 - 1:设定 32K的中断优先权是 “高” 154 =7 sbit IPT0 = IP^1; //Timer0中断优先控制位 0:设定 Timer 0的中断优先权是 “低” 1:设 - Timer 0的中断优先权是 “高” 155 =7 sbit IPINT0 = IP^0; 156 =7 157 =7 /*IE*/ 158 =7 sbit EA = IE^7; //中断使能的总控制 0:关闭所有的中断 1:打开所有的中断 159 =7 sbit EADC = IE^6; //ADC中断使能控制 0:关闭ADC中断 1:打开ADC中断 160 =7 sbit ET2 = IE^5; //PWM中断使能控制 0:关闭PWM中断 1:打开PWM中断 161 =7 sbit EUART = IE^4; //UART中断使能控制 0:关闭SIF中断 1:打开SIF中断 162 =7 sbit ET1 = IE^3; //Timer1中断使能控制 0:关闭TIMER1中断 1:打开TIMER1中断 163 =7 sbit EINT1 = IE^2; //32K Base Timer中断使能控制 0:关闭32K中断 1:打开32K中断 164 =7 sbit ET0 = IE^1; //Timer0中断使能控制 0:关闭TIMER0中断 1:打开TIMER0中断 165 =7 sbit EINT0 = IE^0; //TouchKey的中断使能控制 0:关闭TouchKey中断 1:打开TouchKey中断 166 =7 167 =7 /*TCON*/ 168 =7 sbit TF1 = TCON^7; //T1溢出中断请求标志位 T1产生溢出,发生中断时,硬件将TF1 -为“1”,申请中断,CPU响应时,硬件清“0”。 169 =7 sbit TR1 = TCON^6; //定时器T1的运行控制位 0:Timer1禁止计数 1:Timer1开始计数 170 =7 sbit TF0 = TCON^5; //T0溢出中断请求标志位 T0产生溢出,发生中断时,硬件将TF0 -为“1”,申请中断,CPU响应时,硬件清“0”。 171 =7 sbit TR0 = TCON^4; //定时器T0的运行控制位 0:Timer0禁止计数 1:Timer0开始计数 172 =7 173 =7 /*SCON*/ 174 =7 sbit SM0 = SCON^7; 175 =7 sbit SM1 = SCON^6; 176 =7 sbit SM2 = SCON^5; 177 =7 sbit REN = SCON^4; 178 =7 sbit TB8 = SCON^3; 179 =7 sbit RB8 = SCON^2; 180 =7 sbit TI = SCON^1; 181 =7 sbit RI = SCON^0; 182 =7 183 =7 /* P0 */ 184 =7 sbit P01 = P0^1; 185 =7 sbit P00 = P0^0; 186 =7 187 =7 /* P1 */ 188 =7 sbit P17 = P1^7; 189 =7 sbit P16 = P1^6; 190 =7 sbit P15 = P1^5; 191 =7 sbit P14 = P1^4; 192 =7 sbit P13 = P1^3; 193 =7 sbit P12 = P1^2; 194 =7 sbit P11 = P1^1; 195 =7 sbit P10 = P1^0; 196 =7 197 =7 /* P2 */ 198 =7 sbit P27 = P2^7; 199 =7 sbit P26 = P2^6; 200 =7 sbit P25 = P2^5; 201 =7 sbit P24 = P2^4; 202 =7 sbit P23 = P2^3; 203 =7 sbit P22 = P2^2; 204 =7 sbit P21 = P2^1; 205 =7 sbit P20 = P2^0; 206 =7 207 =7 #endif 5 =6 #include "stdint.h" 1 =7 #ifndef _STD_INT_H_ =7 #define _STD_INT_H_ =7 typedef signed long int32_t; C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 6 =7 typedef unsigned long uint32_t; =7 typedef signed char int8_t; =7 typedef unsigned char uint8_t; =7 typedef signed int int16_t; =7 typedef unsigned int uint16_t; =7 #endif 6 =6 7 =6 #define enableInterrupts() EA=1 /** 开启总中断 **/ 8 =6 #define disableInterrupts() EA=0 /** 关闭总中断 **/ 9 =6 10 =6 #define __I volatile const /*!< defines 'read only' permissions */ 11 =6 #define __O volatile /*!< defines 'write only' permissions */ 12 =6 #define __IO volatile /*!< defines 'read / write' permissions */ 13 =6 /* 14 =6 //!< Signed integer types 15 =6 typedef signed char int8_t; 16 =6 typedef signed short int16_t; 17 =6 typedef signed long int32_t; 18 =6 19 =6 //!< Unsigned integer types 20 =6 typedef unsigned char uint8_t; 21 =6 typedef unsigned short uint16_t; 22 =6 typedef unsigned long uint32_t; 23 =6 24 =6 typedef int32_t s32; 25 =6 typedef int16_t s16; 26 =6 typedef int8_t s8; 27 =6 28 =6 typedef uint32_t u32; 29 =6 typedef uint16_t u16; 30 =6 typedef uint8_t u8; 31 =6 */ 32 =6 33 =6 34 =6 typedef enum {FALSE = 0, TRUE = !FALSE} bool; 35 =6 36 =6 typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus, BitStatus; 37 =6 38 =6 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; 39 =6 40 =6 typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; 41 =6 42 =6 typedef enum {LOW = 0, HIGH = !LOW} PriorityStatus; 43 =6 44 =6 #endif 6 =5 7 =5 #define INT_EXT0 0 8 =5 #define INT_T0 1 9 =5 #define INT_EXT1 2 10 =5 #define INT_T1 3 11 =5 #define INT_UART0 4 12 =5 #define INT_T2 5 13 =5 #define INT_ADC 6 14 =5 #define INT_SSI 7 15 =5 #define INT_PWM 8 16 =5 #define INT_BTM 9 17 =5 #define INT_EXT2 10 18 =5 19 =5 20 =5 21 =5 #define GPIOR GPIO1 22 =5 #define GPIOG GPIO2 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 7 23 =5 #define GPIOB GPIO2 24 =5 #define GPIOC GPIO2 25 =5 #define GPIOW GPIO2 26 =5 27 =5 #define LEDR GPIO_PIN_0 28 =5 #define LEDG GPIO_PIN_7 29 =5 #define LEDB GPIO_PIN_6 30 =5 #define LEDC GPIO_PIN_5 31 =5 #define LEDW GPIO_PIN_4 32 =5 33 =5 34 =5 35 =5 #define FOSC 12000000UL 36 =5 #define TICKPER1S 1000UL 37 =5 38 =5 39 =5 40 =5 #endif 8 =4 #include "al_helper.h" 1 =5 /* 2 =5 * al_helper.h 3 =5 * 4 =5 * Created on: 2023-4-20 5 =5 * Author: xukaiming 6 =5 */ 7 =5 8 =5 #ifndef _AL_HELPER_H_ 9 =5 #define _AL_HELPER_H_ 10 =5 11 =5 #include "stdint.h" 1 =6 #ifndef _STD_INT_H_ =6 #define _STD_INT_H_ =6 typedef signed long int32_t; =6 typedef unsigned long uint32_t; =6 typedef signed char int8_t; =6 typedef unsigned char uint8_t; =6 typedef signed int int16_t; =6 typedef unsigned int uint16_t; =6 #endif 12 =5 13 =5 #ifdef __cplusplus =5 extern "C" { =5 #endif 16 =5 17 =5 //#define AL_STATIC static 18 =5 #define AL_STATIC 19 =5 #define AL_INLINE inline 20 =5 21 =5 #define TASK_WITH_PT 1 22 =5 #define TASK_WITH_NAME 0 23 =5 24 =5 #define XDATA xdata 25 =5 #define IDATA idata 26 =5 #define CONST code 27 =5 //#define CONST xdata 28 =5 29 =5 30 =5 #ifndef UNUSED 31 =5 #define UNUSED(x) (void)(x) 32 =5 #endif 33 =5 34 =5 enum C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 8 35 =5 { 36 =5 false = 0, 37 =5 true =!false 38 =5 }; 39 =5 40 =5 #ifdef __cplusplus =5 } =5 #endif 43 =5 44 =5 #endif 45 =5 9 =4 #include "pt_header.h" 1 =5 #ifndef _PT_HEADER_H_ 2 =5 #define _PT_HEADER_H_ 3 =5 4 =5 #include "pt_timer.h" 1 =6 #ifndef _PT_TIMER_H_ 2 =6 #define _PT_TIMER_H_ 3 =6 #include "pt.h" 1 =7 2 =7 #ifndef __PT_H__ 3 =7 #define __PT_H__ 4 =7 5 =7 #include "lc.h" 1 =8 #ifndef __LC_H__ 2 =8 #define __LC_H__ 3 =8 4 =8 5 =8 #ifdef LC_INCLUDE =8 #include LC_INCLUDE =8 #else 8 =8 #include "lc-switch.h" 1 =9 2 =9 3 =9 #ifndef __LC_SWITCH_H__ 4 =9 #define __LC_SWITCH_H__ 5 =9 6 =9 typedef unsigned short lc_t; 7 =9 8 =9 #define LC_INIT(s) s = 0; 9 =9 10 =9 #define LC_RESUME(s) switch(s) { case 0: 11 =9 12 =9 #define LC_SET(s) s = __LINE__; case __LINE__: 13 =9 14 =9 #define LC_END(s) } 15 =9 16 =9 #endif /* __LC_SWITCH_H__ */ 17 =9 18 =9 /** @} */ 9 =8 #endif 10 =8 11 =8 #endif 6 =7 7 =7 struct pt { 8 =7 lc_t lc; 9 =7 }; 10 =7 11 =7 12 =7 #ifndef UNUSED_PARAM 13 =7 #define UNUSED_PARAM(v) (void)(v) 14 =7 #endif C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 9 15 =7 16 =7 #define PT_WAITING 0 //等待 17 =7 #define PT_YIELDED 1 //锁死线程 18 =7 #define PT_EXITED 2 //退出 19 =7 #define PT_ENDED 3 //结束 20 =7 21 =7 22 =7 #define PT_BIND(pt1) {static idata struct pt pt_hide ;pt1 = &pt_hide;} 23 =7 24 =7 25 =7 #define PT_INIT(pt) LC_INIT((pt)->lc) 26 =7 #define PT_THREAD(name_args) int8_t name_args 27 =7 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) 28 =7 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ 29 =7 UNUSED_PARAM(PT_YIELD_FLAG );\ 30 =7 PT_INIT(pt); return PT_ENDED; } 31 =7 32 =7 33 =7 //等待条件成立,如果不成立,继续等待 34 =7 #define PT_WAIT_UNTIL(pt, condition) \ 35 =7 do { \ 36 =7 LC_SET((pt)->lc); \ 37 =7 if(!(condition)) { \ 38 =7 return PT_WAITING; \ 39 =7 } \ 40 =7 } while(0) 41 =7 42 =7 //一直等待,直到条件不成立 43 =7 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) 44 =7 //等待子线程退出 45 =7 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) 46 =7 47 =7 //启动子线程,等待子线程退出,如果不退出,在此阻塞 48 =7 #define PT_SPAWN(pt, child, thread) \ 49 =7 do { \ 50 =7 PT_INIT((child)); \ 51 =7 PT_WAIT_THREAD((pt), (thread)); \ 52 =7 } while(0) 53 =7 54 =7 //重新启动线程,从头开始 55 =7 #define PT_RESTART(pt) \ 56 =7 do { \ 57 =7 PT_INIT(pt); \ 58 =7 return PT_WAITING; \ 59 =7 } while(0) 60 =7 61 =7 //退出线程 62 =7 #define PT_EXIT(pt) \ 63 =7 do { \ 64 =7 PT_INIT(pt); \ 65 =7 return PT_EXITED; \ 66 =7 } while(0) 67 =7 //子线程是否退出 68 =7 #define PT_SCHEDULE(f) ((f) < PT_EXITED) 69 =7 70 =7 //锁死任务 71 =7 #define PT_YIELD(pt) \ 72 =7 do { \ 73 =7 PT_YIELD_FLAG = 0; \ 74 =7 LC_SET((pt)->lc); \ 75 =7 if(PT_YIELD_FLAG == 0) { \ 76 =7 return PT_YIELDED; \ C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 10 77 =7 } \ 78 =7 } while(0) 79 =7 80 =7 //锁死任务直到符合条件 81 =7 #define PT_YIELD_UNTIL(pt, cond) \ 82 =7 do { \ 83 =7 PT_YIELD_FLAG = 0; \ 84 =7 LC_SET((pt)->lc); \ 85 =7 if((PT_YIELD_FLAG == 0) || !(cond)) { \ 86 =7 return PT_YIELDED; \ 87 =7 } \ 88 =7 } while(0) 89 =7 90 =7 91 =7 #endif /* __PT_H__ */ 4 =6 5 =6 6 =6 struct timer { 7 =6 unsigned long start; //记录启动时的tick值 8 =6 unsigned long interval; //要定时的tick数 9 =6 }; 10 =6 11 =6 void timer_set(struct timer *t, unsigned long interval); 12 =6 unsigned char timer_expired(struct timer *t); 13 =6 void delay_ms(unsigned long t_ms); 14 =6 void Delay10us(void); 15 =6 void delay_us(unsigned int t); 16 =6 #endif 5 =5 #include "pt-sem.h" 1 =6 /* 2 =6 #include "pt-sem.h" 3 =6 4 =6 #define NUM_ITEMS 32 5 =6 #define BUFSIZE 8 6 =6 7 =6 static struct pt_sem mutex, full, empty; 8 =6 9 =6 PT_THREAD(producer(struct pt *pt)) 10 =6 { 11 =6 static int produced; 12 =6 13 =6 PT_BEGIN(pt); 14 =6 15 =6 for(produced = 0; produced < NUM_ITEMS; ++produced) { 16 =6 17 =6 PT_SEM_WAIT(pt, &full); 18 =6 19 =6 PT_SEM_WAIT(pt, &mutex); 20 =6 add_to_buffer(produce_item()); 21 =6 PT_SEM_SIGNAL(pt, &mutex); 22 =6 23 =6 PT_SEM_SIGNAL(pt, &empty); 24 =6 } 25 =6 26 =6 PT_END(pt); 27 =6 } 28 =6 29 =6 PT_THREAD(consumer(struct pt *pt)) 30 =6 { 31 =6 static int consumed; 32 =6 33 =6 PT_BEGIN(pt); C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 11 34 =6 35 =6 for(consumed = 0; consumed < NUM_ITEMS; ++consumed) { 36 =6 37 =6 PT_SEM_WAIT(pt, &empty); 38 =6 39 =6 PT_SEM_WAIT(pt, &mutex); 40 =6 consume_item(get_from_buffer()); 41 =6 PT_SEM_SIGNAL(pt, &mutex); 42 =6 43 =6 PT_SEM_SIGNAL(pt, &full); 44 =6 } 45 =6 46 =6 PT_END(pt); 47 =6 } 48 =6 49 =6 PT_THREAD(driver_thread(struct pt *pt)) 50 =6 { 51 =6 static struct pt pt_producer, pt_consumer; 52 =6 53 =6 PT_BEGIN(pt); 54 =6 55 =6 PT_SEM_INIT(&empty, 0); 56 =6 PT_SEM_INIT(&full, BUFSIZE); 57 =6 PT_SEM_INIT(&mutex, 1); 58 =6 59 =6 PT_INIT(&pt_producer); 60 =6 PT_INIT(&pt_consumer); 61 =6 62 =6 PT_WAIT_THREAD(pt, producer(&pt_producer) & 63 =6 consumer(&pt_consumer)); 64 =6 65 =6 PT_END(pt); 66 =6 } 67 =6 */ 68 =6 69 =6 #ifndef __PT_SEM_H__ 70 =6 #define __PT_SEM_H__ 71 =6 72 =6 #include "pt.h" 1 =7 2 =7 #ifndef __PT_H__ =7 #define __PT_H__ =7 =7 #include "lc.h" =7 =7 struct pt { =7 lc_t lc; =7 }; =7 =7 =7 #ifndef UNUSED_PARAM =7 #define UNUSED_PARAM(v) (void)(v) =7 #endif =7 =7 #define PT_WAITING 0 //等待 =7 #define PT_YIELDED 1 //锁死线程 =7 #define PT_EXITED 2 //退出 =7 #define PT_ENDED 3 //结束 =7 =7 =7 #define PT_BIND(pt1) {static idata struct pt pt_hide ;pt1 = &pt_hide;} =7 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 12 =7 =7 #define PT_INIT(pt) LC_INIT((pt)->lc) =7 #define PT_THREAD(name_args) int8_t name_args =7 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) =7 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ =7 UNUSED_PARAM(PT_YIELD_FLAG );\ =7 PT_INIT(pt); return PT_ENDED; } =7 =7 =7 //等待条件成立,如果不成立,继续等待 =7 #define PT_WAIT_UNTIL(pt, condition) \ =7 do { \ =7 LC_SET((pt)->lc); \ =7 if(!(condition)) { \ =7 return PT_WAITING; \ =7 } \ =7 } while(0) =7 =7 //一直等待,直到条件不成立 =7 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) =7 //等待子线程退出 =7 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) =7 =7 //启动子线程,等待子线程退出,如果不退出,在此阻塞 =7 #define PT_SPAWN(pt, child, thread) \ =7 do { \ =7 PT_INIT((child)); \ =7 PT_WAIT_THREAD((pt), (thread)); \ =7 } while(0) =7 =7 //重新启动线程,从头开始 =7 #define PT_RESTART(pt) \ =7 do { \ =7 PT_INIT(pt); \ =7 return PT_WAITING; \ =7 } while(0) =7 =7 //退出线程 =7 #define PT_EXIT(pt) \ =7 do { \ =7 PT_INIT(pt); \ =7 return PT_EXITED; \ =7 } while(0) =7 //子线程是否退出 =7 #define PT_SCHEDULE(f) ((f) < PT_EXITED) =7 =7 //锁死任务 =7 #define PT_YIELD(pt) \ =7 do { \ =7 PT_YIELD_FLAG = 0; \ =7 LC_SET((pt)->lc); \ =7 if(PT_YIELD_FLAG == 0) { \ =7 return PT_YIELDED; \ =7 } \ =7 } while(0) =7 =7 //锁死任务直到符合条件 =7 #define PT_YIELD_UNTIL(pt, cond) \ =7 do { \ =7 PT_YIELD_FLAG = 0; \ =7 LC_SET((pt)->lc); \ =7 if((PT_YIELD_FLAG == 0) || !(cond)) { \ C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 13 =7 return PT_YIELDED; \ =7 } \ =7 } while(0) =7 =7 =7 #endif /* __PT_H__ */ 73 =6 74 =6 struct pt_sem { 75 =6 unsigned int count; 76 =6 }; 77 =6 78 =6 //信号量 79 =6 #define PT_SEM_INIT(s, c) (s)->count = c 80 =6 81 =6 //信号量等待 当信号量大于0 时继续,否则等待 82 =6 #define PT_SEM_WAIT(pt, s) \ 83 =6 do { \ 84 =6 PT_WAIT_UNTIL(pt, (s)->count > 0); \ 85 =6 --(s)->count; \ 86 =6 } while(0) 87 =6 88 =6 //写入信号量 89 =6 #define PT_SEM_SIGNAL(pt, s) ++(s)->count 90 =6 91 =6 #endif /* __PT_SEM_H__ */ 92 =6 93 =6 /** @} */ 94 =6 /** @} */ 95 =6 6 =5 7 =5 #endif 8 =5 10 =4 11 =4 #include "LT89xx_rf.h" 1 =5 #ifndef _LT89XX_RF_H_ 2 =5 #define _LT89XX_RF_H_ 3 =5 #include "stdint.h" 1 =6 #ifndef _STD_INT_H_ =6 #define _STD_INT_H_ =6 typedef signed long int32_t; =6 typedef unsigned long uint32_t; =6 typedef signed char int8_t; =6 typedef unsigned char uint8_t; =6 typedef signed int int16_t; =6 typedef unsigned int uint16_t; =6 #endif 4 =5 5 =5 #define SIMULATOR 0 6 =5 void InitLT89xxRF(void); 7 =5 uint8_t DecodePackage(uint8_t *pBuf,uint8_t len1); 8 =5 void TaskLT89xx_thread_entry(void *param ); 9 =5 10 =5 #endif 12 =4 #include "key.h" 1 =5 #ifndef _KEY_H_ 2 =5 #define _KEY_H_ 3 =5 #include "pt.h" 1 =6 2 =6 #ifndef __PT_H__ =6 #define __PT_H__ =6 =6 #include "lc.h" C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 14 =6 =6 struct pt { =6 lc_t lc; =6 }; =6 =6 =6 #ifndef UNUSED_PARAM =6 #define UNUSED_PARAM(v) (void)(v) =6 #endif =6 =6 #define PT_WAITING 0 //等待 =6 #define PT_YIELDED 1 //锁死线程 =6 #define PT_EXITED 2 //退出 =6 #define PT_ENDED 3 //结束 =6 =6 =6 #define PT_BIND(pt1) {static idata struct pt pt_hide ;pt1 = &pt_hide;} =6 =6 =6 #define PT_INIT(pt) LC_INIT((pt)->lc) =6 #define PT_THREAD(name_args) int8_t name_args =6 #define PT_BEGIN(pt) { int8_t PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) =6 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \ =6 UNUSED_PARAM(PT_YIELD_FLAG );\ =6 PT_INIT(pt); return PT_ENDED; } =6 =6 =6 //等待条件成立,如果不成立,继续等待 =6 #define PT_WAIT_UNTIL(pt, condition) \ =6 do { \ =6 LC_SET((pt)->lc); \ =6 if(!(condition)) { \ =6 return PT_WAITING; \ =6 } \ =6 } while(0) =6 =6 //一直等待,直到条件不成立 =6 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond)) =6 //等待子线程退出 =6 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) =6 =6 //启动子线程,等待子线程退出,如果不退出,在此阻塞 =6 #define PT_SPAWN(pt, child, thread) \ =6 do { \ =6 PT_INIT((child)); \ =6 PT_WAIT_THREAD((pt), (thread)); \ =6 } while(0) =6 =6 //重新启动线程,从头开始 =6 #define PT_RESTART(pt) \ =6 do { \ =6 PT_INIT(pt); \ =6 return PT_WAITING; \ =6 } while(0) =6 =6 //退出线程 =6 #define PT_EXIT(pt) \ =6 do { \ =6 PT_INIT(pt); \ =6 return PT_EXITED; \ =6 } while(0) =6 //子线程是否退出 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 15 =6 #define PT_SCHEDULE(f) ((f) < PT_EXITED) =6 =6 //锁死任务 =6 #define PT_YIELD(pt) \ =6 do { \ =6 PT_YIELD_FLAG = 0; \ =6 LC_SET((pt)->lc); \ =6 if(PT_YIELD_FLAG == 0) { \ =6 return PT_YIELDED; \ =6 } \ =6 } while(0) =6 =6 //锁死任务直到符合条件 =6 #define PT_YIELD_UNTIL(pt, cond) \ =6 do { \ =6 PT_YIELD_FLAG = 0; \ =6 LC_SET((pt)->lc); \ =6 if((PT_YIELD_FLAG == 0) || !(cond)) { \ =6 return PT_YIELDED; \ =6 } \ =6 } while(0) =6 =6 =6 #endif /* __PT_H__ */ 4 =5 #include "al_helper.h" 1 =6 /* 2 =6 * al_helper.h 3 =6 * 4 =6 * Created on: 2023-4-20 5 =6 * Author: xukaiming 6 =6 */ 7 =6 8 =6 #ifndef _AL_HELPER_H_ =6 #define _AL_HELPER_H_ =6 =6 #include "stdint.h" =6 =6 #ifdef __cplusplus =6 extern "C" { =6 #endif =6 =6 //#define AL_STATIC static =6 #define AL_STATIC =6 #define AL_INLINE inline =6 =6 #define TASK_WITH_PT 1 =6 #define TASK_WITH_NAME 0 =6 =6 #define XDATA xdata =6 #define IDATA idata =6 #define CONST code =6 //#define CONST xdata =6 =6 =6 #ifndef UNUSED =6 #define UNUSED(x) (void)(x) =6 #endif =6 =6 enum =6 { =6 false = 0, =6 true =!false C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 16 =6 }; =6 =6 #ifdef __cplusplus =6 } =6 #endif =6 =6 #endif 45 =6 5 =5 void InitKey(void); 6 =5 7 =5 #if TASK_WITH_PT 8 =5 PT_THREAD(TaskScanKey(struct pt *pt1 )) ; 9 =5 #else =5 PT_THREAD(TaskScanKey(void)) ; =5 #endif 12 =5 extern XDATA unsigned char gcKey; 13 =5 unsigned char GetKey(void) ; 14 =5 #endif 13 =4 #include "BulbId.h" 1 =5 #ifndef _BULBLD_H_ 2 =5 #define _BULBLD_H_ 3 =5 4 =5 #include "BulbId_def.h" 1 =6 #ifndef _BULBLD_DEF_H_ 2 =6 #define _BULBLD_DEF_H_ 3 =6 #include "stdint.h" 1 =7 #ifndef _STD_INT_H_ =7 #define _STD_INT_H_ =7 typedef signed long int32_t; =7 typedef unsigned long uint32_t; =7 typedef signed char int8_t; =7 typedef unsigned char uint8_t; =7 typedef signed int int16_t; =7 typedef unsigned int uint16_t; =7 #endif 4 =6 5 =6 6 =6 #define V2_PACKET_LEN 9 7 =6 8 =6 #define V2_PROTOCOL_ID_INDEX 1 9 =6 #define V2_ID_HI_INDEX 2 10 =6 #define V2_ID_LOW_INDEX 3 11 =6 #define V2_COMMAND_INDEX 4 12 =6 #define V2_ARGUMENT_INDEX 5 13 =6 14 =6 #define V2_GRP_INDEX 7 15 =6 16 =6 17 =6 #define FUT089_COLOR_OFFSET 0 18 =6 19 =6 enum MiLightFUT089Command 20 =6 { 21 =6 FUT089_ON = 0x01, 22 =6 FUT089_OFF = 0x01, 23 =6 FUT089_COLOR = 0x02, 24 =6 FUT089_BRIGHTNESS = 0x05, 25 =6 FUT089_MODE = 0x06, 26 =6 FUT089_KELVIN = 0x07, // Controls Kelvin when in White mode 27 =6 FUT089_SATURATION = 0x07 // Controls Saturation when in Color mode 28 =6 }; 29 =6 30 =6 enum MiLightFUT089Arguments C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 17 31 =6 { 32 =6 FUT089_MODE_SPEED_UP = 0x12, 33 =6 FUT089_MODE_SPEED_DOWN = 0x13, 34 =6 FUT089_WHITE_MODE = 0x14 35 =6 }; 36 =6 37 =6 enum MiLightRemoteType 38 =6 { 39 =6 REMOTE_TYPE_UNKNOWN = 255, 40 =6 REMOTE_TYPE_RGBW = 0, 41 =6 REMOTE_TYPE_CCT = 1, 42 =6 REMOTE_TYPE_RGB_CCT = 2, 43 =6 REMOTE_TYPE_RGB = 3, 44 =6 REMOTE_TYPE_FUT089 = 4, 45 =6 REMOTE_TYPE_FUT091 = 5, 46 =6 REMOTE_TYPE_FUT020 = 6 47 =6 }; 48 =6 49 =6 // MiLight CCT bulbs range from 2700K-6500K, or ~370.3-153.8 mireds. 50 =6 #define COLOR_TEMP_MAX_MIREDS 370 51 =6 #define COLOR_TEMP_MIN_MIREDS 153 52 =6 53 =6 54 =6 55 =6 enum BulbMode { 56 =6 BULB_MODE_WHITE, 57 =6 BULB_MODE_COLOR, 58 =6 BULB_MODE_SCENE, 59 =6 BULB_MODE_NIGHT 60 =6 }; 61 =6 62 =6 enum IncDIR{ 63 =6 INCREASE = 1, 64 =6 DECREASE = -1U 65 =6 }; 66 =6 67 =6 68 =6 enum eCommands { 69 =6 UNPAIR , 70 =6 PAIR , 71 =6 SET_WHITE , 72 =6 NIGHT_MODE , 73 =6 LEVEL_UP , 74 =6 LEVEL_DOWN , 75 =6 TEMPERATURE_UP , 76 =6 TEMPERATURE_DOWN, 77 =6 NEXT_MODE , 78 =6 PREVIOUS_MODE , 79 =6 MODE_SPEED_DOWN , 80 =6 MODE_SPEED_UP , 81 =6 TOGGLE , 82 =6 TRANSITION 83 =6 }; 84 =6 85 =6 86 =6 enum LEDState 87 =6 { 88 =6 OFF = 0, 89 =6 ON 90 =6 }; 91 =6 92 =6 struct Result C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 18 93 =6 { 94 =6 uint8_t button_id ; 95 =6 uint8_t argument ; 96 =6 uint8_t STATE ; 97 =6 uint8_t STATUS ; 98 =6 uint8_t BRIGHTNESS ; 99 =6 uint8_t LEVEL ; 100 =6 uint8_t HUE ; 101 =6 uint8_t SATURATION ; 102 =6 uint8_t COLOR ; 103 =6 uint8_t MODE ; 104 =6 uint8_t KELVIN ; 105 =6 uint8_t TEMPERATURE ; 106 =6 uint8_t COLOR_TEMP ; 107 =6 uint8_t BULB_MODE ; 108 =6 uint8_t COMPUTED_COLOR ; 109 =6 uint8_t EFFECT ; 110 =6 uint8_t DEVICE_ID ; 111 =6 uint8_t GROUP_ID ; 112 =6 uint8_t DEVICE_TYPE ; 113 =6 uint8_t OH_COLOR ; 114 =6 uint8_t HEX_COLOR ; 115 =6 uint8_t COMMAND ; 116 =6 uint8_t COMMANDS ; 117 =6 uint8_t COLOR_MODE ; 118 =6 }; 119 =6 120 =6 struct BulbId 121 =6 { 122 =6 enum MiLightRemoteType deviceType; 123 =6 uint8_t groupId; 124 =6 uint16_t deviceId; 125 =6 uint16_t PWM_Value[5]; 126 =6 127 =6 uint8_t bENPWM :1; 128 =6 uint8_t bInit :1; 129 =6 uint8_t repeatCnt; 130 =6 131 =6 struct Result result; 132 =6 }; 133 =6 #endif 5 =5 #include "al_helper.h" 1 =6 /* 2 =6 * al_helper.h 3 =6 * 4 =6 * Created on: 2023-4-20 5 =6 * Author: xukaiming 6 =6 */ 7 =6 8 =6 #ifndef _AL_HELPER_H_ =6 #define _AL_HELPER_H_ =6 =6 #include "stdint.h" =6 =6 #ifdef __cplusplus =6 extern "C" { =6 #endif =6 =6 //#define AL_STATIC static =6 #define AL_STATIC =6 #define AL_INLINE inline =6 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 19 =6 #define TASK_WITH_PT 1 =6 #define TASK_WITH_NAME 0 =6 =6 #define XDATA xdata =6 #define IDATA idata =6 #define CONST code =6 //#define CONST xdata =6 =6 =6 #ifndef UNUSED =6 #define UNUSED(x) (void)(x) =6 #endif =6 =6 enum =6 { =6 false = 0, =6 true =!false =6 }; =6 =6 #ifdef __cplusplus =6 } =6 #endif =6 =6 #endif 45 =6 6 =5 #include "pt_header.h" 1 =6 #ifndef _PT_HEADER_H_ =6 #define _PT_HEADER_H_ =6 =6 #include "pt_timer.h" =6 #include "pt-sem.h" =6 =6 #endif 8 =6 7 =5 8 =5 9 =5 void SetBulbInfo(uint8_t *pBulbInfo,uint8_t len1); 10 =5 void InitOrUninit(void* p); 11 =5 void waitForInitOrUnInit(void); 12 =5 13 =5 14 =5 #if TASK_WITH_PT 15 =5 PT_THREAD(TaskBlinLed(struct pt * pt1 )) ; 16 =5 #else =5 PT_THREAD(TaskBlinLed(void)) ; =5 #endif 19 =5 20 =5 #endif 14 =4 15 =4 typedef void (* func )(void); 16 =4 17 =4 void Idle(void); 18 =4 void Init(void); 19 =4 void InitWdt(void); 20 =4 void InitPort(void); 21 =4 22 =4 23 =4 void SysTick_Handler(void); 24 =4 void Task_SysTick_Handler(void); 25 =4 26 =4 27 =4 #if TASK_WITH_PT C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 20 28 =4 PT_THREAD(TaskWDT(struct pt * pt1 )) ; 29 =4 #else =4 PT_THREAD(TaskWDT(void )) ; =4 #endif 32 =4 int InitTaskStack(void); 33 =4 int InitTimerStack(void); 34 =4 #endif 5 =3 #endif 6 =3 5 =2 #include "task_def.h" 1 =3 #ifndef _TASK_DEF_H_ 2 =3 #define _TASK_DEF_H_ 3 =3 4 =3 5 =3 #define TASK_ID(FUNC) TASK_ID_##FUNC 6 =3 7 =3 #if(TASK_WITH_NAME) =3 #define TASK_NAME(FUNC) #FUNC =3 #else 10 =3 #define TASK_NAME(FUNC) 0 11 =3 #endif 12 =3 13 =3 14 =3 #ifndef UNUSED_PARAM =3 #define UNUSED_PARAM(p) (void)(p) =3 #endif 17 =3 18 =3 19 =3 #ifndef NULL 20 =3 #define NULL (void*)0 21 =3 #endif 22 =3 23 =3 24 =3 #ifndef UNUSED =3 #define UNUSED(x) (void)(x) =3 #endif 27 =3 28 =3 #endif 6 =2 7 =2 #ifdef __cplusplus =2 extern "C" { =2 #endif 10 =2 11 =2 12 =2 13 =2 enum TASK_ID { 14 =2 TASK_ID(TaskTimer), 15 =2 #include "cfg/taskid.h" 1 =3 TASK_ID(TaskBlinLed), 2 =3 TASK_ID(TaskWDT), 3 =3 TASK_ID(TaskScanKey), 4 =3 5 =3 16 =2 }; 17 =2 18 =2 19 =2 20 =2 enum TASK_MODE 21 =2 { 22 =2 TASK_MODE_ONCE, 23 =2 TASK_MODE_PERIOD 24 =2 }; C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 21 25 =2 26 =2 enum TIMER_MODE 27 =2 { 28 =2 TIMER_MODE_TIMER = 0, 29 =2 TIMER_MODE_ONCEROUTINE, 30 =2 TIMER_MODE_CYCROUTINE 31 =2 }; 32 =2 33 =2 void InitT0(void); 34 =2 void InitTask(void); 35 =2 void TaskProc(void) ; 36 =2 37 =2 38 =2 int8_t ActiveTask(int8_t cTaskID, int32_t lPeriod); 39 =2 int8_t SuspendTask(int8_t cTaskID); 40 =2 41 =2 void ActiveTaskNow(int8_t cTaskID, int32_t lPeriod); 42 =2 int8_t SetTaskLastTime(int8_t cTaskID,int32_t lLastTime); 43 =2 44 =2 45 =2 int8_t StartTimer2(int8_t *TimerID,int8_t cMode,uint32_t lPeriod,void (* routine)(void * Param1),void * - Param1); 46 =2 int8_t StartTimer( int8_t cMode,int32_t lPeriod,void (* routine)(void * Param1),void * - Param1); 47 =2 int8_t StopTimer ( int8_t * pcTimerNumber ); 48 =2 void StopAllTimer(void); 49 =2 50 =2 uint32_t get_system_ms(void); 51 =2 void ResetTimer(void); 52 =2 //////////////// 53 =2 54 =2 55 =2 56 =2 // function prototype 57 =2 #if TASK_WITH_PT 58 =2 PT_THREAD(TaskTimer(struct pt *pt1 )); 59 =2 #else =2 PT_THREAD(TaskTimer(void)); =2 #endif 62 =2 63 =2 #ifdef __cplusplus =2 } =2 #endif 66 =2 #endif 67 =2 5 =1 6 =1 #include "bulbId.h" 1 =2 #ifndef _BULBLD_H_ =2 #define _BULBLD_H_ =2 =2 #include "BulbId_def.h" =2 #include "al_helper.h" =2 #include "pt_header.h" =2 =2 =2 void SetBulbInfo(uint8_t *pBulbInfo,uint8_t len1); =2 void InitOrUninit(void* p); =2 void waitForInitOrUnInit(void); =2 =2 =2 #if TASK_WITH_PT =2 PT_THREAD(TaskBlinLed(struct pt * pt1 )) ; C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 22 =2 #else =2 PT_THREAD(TaskBlinLed(void)) ; =2 #endif =2 =2 #endif 7 =1 #include "LT89xx_rf.h" 1 =2 #ifndef _LT89XX_RF_H_ =2 #define _LT89XX_RF_H_ =2 #include "stdint.h" =2 =2 #define SIMULATOR 0 =2 void InitLT89xxRF(void); =2 uint8_t DecodePackage(uint8_t *pBuf,uint8_t len1); =2 void TaskLT89xx_thread_entry(void *param ); =2 =2 #endif 8 =1 #include "pwm.h" 1 =2 #ifndef _PWM_H_ 2 =2 #define _PWM_H_ 3 =2 #include "stdint.h" 1 =3 #ifndef _STD_INT_H_ =3 #define _STD_INT_H_ =3 typedef signed long int32_t; =3 typedef unsigned long uint32_t; =3 typedef signed char int8_t; =3 typedef unsigned char uint8_t; =3 typedef signed int int16_t; =3 typedef unsigned int uint16_t; =3 #endif 4 =2 #include "al_helper.h" 1 =3 /* 2 =3 * al_helper.h 3 =3 * 4 =3 * Created on: 2023-4-20 5 =3 * Author: xukaiming 6 =3 */ 7 =3 8 =3 #ifndef _AL_HELPER_H_ =3 #define _AL_HELPER_H_ =3 =3 #include "stdint.h" =3 =3 #ifdef __cplusplus =3 extern "C" { =3 #endif =3 =3 //#define AL_STATIC static =3 #define AL_STATIC =3 #define AL_INLINE inline =3 =3 #define TASK_WITH_PT 1 =3 #define TASK_WITH_NAME 0 =3 =3 #define XDATA xdata =3 #define IDATA idata =3 #define CONST code =3 //#define CONST xdata =3 =3 =3 #ifndef UNUSED =3 #define UNUSED(x) (void)(x) =3 #endif C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 23 =3 =3 enum =3 { =3 false = 0, =3 true =!false =3 }; =3 =3 #ifdef __cplusplus =3 } =3 #endif =3 =3 #endif 45 =3 5 =2 6 =2 enum ePWM_INDEX 7 =2 { 8 =2 PWM_R = 0, 9 =2 PWM_G, 10 =2 PWM_B, 11 =2 PWM_C, 12 =2 PWM_W 13 =2 }; 14 =2 15 =2 void SetPWMInfo(uint16_t *pPwmInfo,uint8_t len1) ; 16 =2 void InitPWM(void); 17 =2 void SetPWMDuty(unsigned char channel,unsigned int duty); 18 =2 void StartBlinkLED(uint8_t cnt); 19 =2 #endif 9 =1 #endif 10 =1 3 #include "V2RFEncoding.h" 1 =1 2 =1 3 =1 #ifndef _V2_RF_ENCODING_H 4 =1 #define _V2_RF_ENCODING_H 5 =1 #include "stdint.h" 1 =2 #ifndef _STD_INT_H_ =2 #define _STD_INT_H_ =2 typedef signed long int32_t; =2 typedef unsigned long uint32_t; =2 typedef signed char int8_t; =2 typedef unsigned char uint8_t; =2 typedef signed int int16_t; =2 typedef unsigned int uint16_t; =2 #endif 6 =1 #include "string.h" 1 =2 /*-------------------------------------------------------------------------- 2 =2 STRING.H 3 =2 4 =2 String functions. 5 =2 Copyright (c) 1988-2008 Keil Elektronik GmbH and Keil Software, Inc. 6 =2 Copyright (c) 2008-2016 ARM Germany GmbH 7 =2 All rights reserved. 8 =2 --------------------------------------------------------------------------*/ 9 =2 10 =2 #ifndef __STRING_H__ 11 =2 #define __STRING_H__ 12 =2 13 =2 #ifndef _SIZE_T 14 =2 #define _SIZE_T 15 =2 typedef unsigned int size_t; 16 =2 #endif C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 24 17 =2 18 =2 #ifndef NULL =2 #define NULL ((void *)0) =2 #endif 21 =2 22 =2 #pragma SAVE 23 =2 #pragma REGPARMS 24 =2 extern char *strcat (char *s1, const char *s2); 25 =2 extern char *strncat (char *s1, const char *s2, size_t n); 26 =2 27 =2 extern char strcmp (const char *s1, const char *s2); 28 =2 extern char strncmp (const char *s1, const char *s2, size_t n); 29 =2 30 =2 extern char *strcpy (char *s1, const char *s2); 31 =2 extern char *strncpy (char *s1, const char *s2, size_t n); 32 =2 33 =2 extern size_t strlen (const char *); 34 =2 35 =2 extern char *strchr (const char *s, char c); 36 =2 extern int strpos (const char *s, char c); 37 =2 extern char *strrchr (const char *s, char c); 38 =2 extern int strrpos (const char *s, char c); 39 =2 40 =2 extern size_t strspn (const char *s, const char *set); 41 =2 extern size_t strcspn (const char *s, const char *set); 42 =2 extern char *strpbrk (const char *s, const char *set); 43 =2 extern char *strrpbrk(const char *s, const char *set); 44 =2 extern char *strstr (const char *s, const char *sub); 45 =2 extern char *strtok (char *str, const char *set); 46 =2 47 =2 extern char memcmp (const void *s1, const void *s2, size_t n); 48 =2 extern void *memcpy (void *s1, const void *s2, size_t n); 49 =2 extern void *memchr (const void *s, char val, size_t n); 50 =2 extern void *memccpy (void *s1, const void *s2, char val, size_t n); 51 =2 extern void *memmove (void *s1, const void *s2, size_t n); 52 =2 extern void *memset (void *s, char val, size_t n); 53 =2 #pragma RESTORE 54 =2 55 =2 #endif 7 =1 8 =1 9 =1 #define TESTDECODE 0 10 =1 11 =1 #define V2_OFFSET_JUMP_START 0x54 12 =1 13 =1 void encodeV2Packet(uint8_t* packet); 14 =1 void decodeV2Packet(uint8_t* packet); 15 =1 uint8_t xorKey(uint8_t key); 16 =1 uint8_t encodeByte(uint8_t byte, uint8_t s1, uint8_t xorKey, uint8_t s2); 17 =1 uint8_t decodeByte(uint8_t byte, uint8_t s1, uint8_t xorKey, uint8_t s2); 18 =1 19 =1 void TestDecode(void); 20 =1 #endif 4 int main(void) 5 { 6 1 Init(); 7 1 TaskProc(); 8 1 return 0; 9 1 } C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 25 ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION main (BEGIN) ; SOURCE LINE # 4 ; SOURCE LINE # 5 ; SOURCE LINE # 6 0000 120000 E LCALL Init ; SOURCE LINE # 7 0003 120000 E LCALL TaskProc ; SOURCE LINE # 8 0006 E4 CLR A 0007 FE MOV R6,A 0008 FF MOV R7,A ; SOURCE LINE # 9 0009 22 RET ; FUNCTION main (END) C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 26 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== OPREG. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FFH 1 uint16_t . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2 MODE_SPEED_UP. . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 LEVEL_UP . . . . . . . . . . . . . . . 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 FUT089_SATURATION. . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 P2 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A0H 1 Result . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 24 button_id. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0000H 1 argument . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0001H 1 STATE. . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0002H 1 STATUS . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0003H 1 BRIGHTNESS . . . . . . . . . . . . . MEMBER ----- U_CHAR 0004H 1 LEVEL. . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0005H 1 HUE. . . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0006H 1 SATURATION . . . . . . . . . . . . . MEMBER ----- U_CHAR 0007H 1 COLOR. . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0008H 1 MODE . . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0009H 1 KELVIN . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 000AH 1 TEMPERATURE. . . . . . . . . . . . . MEMBER ----- U_CHAR 000BH 1 COLOR_TEMP . . . . . . . . . . . . . MEMBER ----- U_CHAR 000CH 1 BULB_MODE. . . . . . . . . . . . . . MEMBER ----- U_CHAR 000DH 1 COMPUTED_COLOR . . . . . . . . . . . MEMBER ----- U_CHAR 000EH 1 EFFECT . . . . . . . . . . . . . . . MEMBER ----- U_CHAR 000FH 1 DEVICE_ID. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0010H 1 GROUP_ID . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0011H 1 DEVICE_TYPE. . . . . . . . . . . . . MEMBER ----- U_CHAR 0012H 1 OH_COLOR . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0013H 1 HEX_COLOR. . . . . . . . . . . . . . MEMBER ----- U_CHAR 0014H 1 COMMAND. . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0015H 1 COMMANDS . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0016H 1 COLOR_MODE . . . . . . . . . . . . . MEMBER ----- U_CHAR 0017H 1 NIGHT_MODE . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 MiLightFUT089Arguments . . . . . . . . * TAG * ----- ENUM ----- ----- 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 REMOTE_TYPE_RGBW . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 REMOTE_TYPE_UNKNOWN. . . . . . . . . . E_CONST ----- U_CHAR ----- 1 FUT089_MODE_SPEED_DOWN . . . . . . . . E_CONST ----- U_CHAR ----- 1 PWMCON0. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D2H 1 int32_t. . . . . . . . . . . . . . . . TYPEDEF ----- LONG ----- 4 PREVIOUS_MODE. . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 ----- ----- BULB_MODE_NIGHT. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 MiLightFUT089Command . . . . . . . . . * TAG * ----- ENUM ----- ----- pt_sem . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 2 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 27 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== count. . . . . . . . . . . . . . . . MEMBER ----- U_INT 0000H 2 ERROR. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 false. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 EADC . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AEH 1 IE . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A8H 1 BulbMode . . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- BULB_MODE_COLOR. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TRANSITION . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 FUT089_ON. . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 OPINX. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FEH 1 BULB_MODE_WHITE. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 size_t . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2 CP . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00C8H 1 MODE_SPEED_DOWN. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 LEVEL_DOWN . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 Init . . . . . . . . . . . . . . . . . EXTERN CODE PROC ----- ----- ErrorStatus. . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 EXF2 . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CEH 1 CHKSUMH. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00FDH 1 PWM_B. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 PWM_C. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 PWMDTY0. . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D5H 1 FUT089_MODE. . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 PWM_G. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 ON . . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 eCommands. . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- 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 ----- ----- 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 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 28 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== IAPADE . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F4H 1 RCAP2L . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CAH 1 main . . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H ----- PWM_R. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 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 PWM_W. . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TaskProc . . . . . . . . . . . . . . . EXTERN CODE PROC ----- ----- PAIR . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 RCLK . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CDH 1 IAPADL . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00F2H 1 func . . . . . . . . . . . . . . . . . TYPEDEF ----- PTR ----- 3 REMOTE_TYPE_CCT. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 bool . . . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 REMOTE_TYPE_RGB. . . . . . . . . . . . E_CONST ----- 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 ePWM_INDEX . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- BulbId . . . . . . . . . . . . . . . . * TAG * ----- STRUCT ----- 40 deviceType . . . . . . . . . . . . . MEMBER ----- U_CHAR 0000H 1 groupId. . . . . . . . . . . . . . . MEMBER ----- U_CHAR 0001H 1 deviceId . . . . . . . . . . . . . . MEMBER ----- U_INT 0002H 2 PWM_Value. . . . . . . . . . . . . . MEMBER ----- ARRAY 0004H 10 bENPWM . . . . . . . . . . . . . . . MEMBER ----- FIELD 000EH 1.0 bInit. . . . . . . . . . . . . . . . MEMBER ----- FIELD 000EH 1.1 repeatCnt. . . . . . . . . . . . . . MEMBER ----- U_CHAR 000FH 1 result . . . . . . . . . . . . . . . MEMBER ----- STRUCT 0010H 24 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 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 29 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== 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 ----- ----- FUT089_KELVIN. . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 DECREASE . . . . . . . . . . . . . . . E_CONST ----- CHAR ----- 1 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 true . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TOGGLE . . . . . . . . . . . . . . . . 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 NEXT_MODE. . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 ACC. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00E0H 1 MiLightRemoteType. . . . . . . . . . . * TAG * ----- ENUM ----- ----- 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 TASK_ID_TaskScanKey. . . . . . . . . . E_CONST ----- U_CHAR ----- 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 INCREASE . . . . . . . . . . . . . . . E_CONST ----- CHAR ----- 1 TH1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008DH 1 FUT089_OFF . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TB8. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009BH 1 TH2. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00CDH 1 P. . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D0H 1 uint8_t. . . . . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 SET_WHITE. . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 SM0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 009FH 1 TL0. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008AH 1 UNPAIR . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 REMOTE_TYPE_FUT020 . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 TR0. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008CH 1 RS1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00D4H 1 TR1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008EH 1 IPUART . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00BCH 1 TR2. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00CAH 1 TEMPERATURE_UP . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 int8_t . . . . . . . . . . . . . . . . TYPEDEF ----- CHAR ----- 1 C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 30 NAME CLASS MSPACE TYPE OFFSET SIZE ==== ===== ====== ==== ====== ==== LEDState . . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- OFF. . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 PWMPRD . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D3H 1 DPH. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0083H 1 REMOTE_TYPE_FUT091 . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 lc . . . . . . . . . . . . . . . . . MEMBER ----- U_INT 0000H 2 INT2F. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C6H 1 REMOTE_TYPE_FUT089 . . . . . . . . . . E_CONST ----- U_CHAR ----- 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 REMOTE_TYPE_RGB_CCT. . . . . . . . . . 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 TEMPERATURE_DOWN . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 INT0R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BBH 1 INT1R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00BDH 1 FUT089_BRIGHTNESS. . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 PriorityStatus . . . . . . . . . . . . TYPEDEF ----- U_CHAR ----- 1 INT2R. . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00C7H 1 FUT089_MODE_SPEED_UP . . . . . . . . . E_CONST ----- U_CHAR ----- 1 LOW. . . . . . . . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 FUT089_COLOR . . . . . . . . . . . . . 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 IncDIR . . . . . . . . . . . . . . . . * TAG * ----- ENUM ----- ----- FUT089_WHITE_MODE. . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 uint32_t . . . . . . . . . . . . . . . TYPEDEF ----- U_LONG ----- 4 BULB_MODE_SCENE. . . . . . . . . . . . E_CONST ----- U_CHAR ----- 1 MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = 10 ---- CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- EDATA SIZE = ---- ---- C51 COMPILER V9.60.7.0 MAIN 08/17/2024 22:06:31 PAGE 31 HDATA SIZE = ---- ---- XDATA CONST SIZE = ---- ---- FAR CONST SIZE = ---- ---- END OF MODULE INFORMATION. C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)